You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.1KB

  1. /* SpiralPlugin
  2. * Copyleft (C) 2000 David Griffiths <dave@pawfal.org>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #include "MixerPluginGUI.h"
  19. #include <FL/fl_draw.h>
  20. #include <FL/fl_draw.H>
  21. static const int GUI_COLOUR = 179;
  22. static const int GUIBG_COLOUR = 144;
  23. static const int GUIBG2_COLOUR = 145;
  24. ////////////////////////////////////////////
  25. MixerPluginGUI::MixerPluginGUI(int w, int h,MixerPlugin *o,ChannelHandler *ch,const HostInfo *Info) :
  26. SpiralPluginGUI(w,h,o,ch)
  27. {
  28. int Width=20;
  29. int Height=100;
  30. for (int n=0; n<NUM_CHANNELS; n++)
  31. {
  32. Numbers[n]=n;
  33. m_Chan[n] = new Fl_Slider(10+(2+Width)*n, 22, Width, Height, "");
  34. m_Chan[n]->type(4);
  35. m_Chan[n]->selection_color(GUI_COLOUR);
  36. m_Chan[n]->labelsize(10);
  37. m_Chan[n]->maximum(2);
  38. m_Chan[n]->step(0.01);
  39. m_Chan[n]->value(1.0);
  40. m_Chan[n]->callback((Fl_Callback*)cb_Chan,(void*)&Numbers[n]);
  41. add(m_Chan[n]);
  42. }
  43. end();
  44. }
  45. void MixerPluginGUI::UpdateValues(SpiralPlugin *o)
  46. {
  47. MixerPlugin *Plugin = (MixerPlugin *)o;
  48. for (int n=0; n<NUM_CHANNELS; n++)
  49. {
  50. m_Chan[n]->value(2.0f-Plugin->GetChannel(n));
  51. }
  52. }
  53. inline void MixerPluginGUI::cb_Chan_i(Fl_Slider* o, void* v)
  54. {
  55. m_GUICH->Set("Num",(*(int*)(v)));
  56. m_GUICH->Set("Value",(float)(2.0f-o->value()));
  57. m_GUICH->SetCommand(MixerPlugin::SETCH);
  58. }
  59. void MixerPluginGUI::cb_Chan(Fl_Slider* o, void* v)
  60. { ((MixerPluginGUI*)(o->parent()))->cb_Chan_i(o,v);}