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.

58 lines
1.8KB

  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 "SwitchPluginGUI.h"
  19. #include <FL/fl_draw.h>
  20. #include <FL/fl_draw.H>
  21. ////////////////////////////////////////////
  22. SwitchPluginGUI::SwitchPluginGUI(int w, int h,SwitchPlugin *o,ChannelHandler *ch,const HostInfo *Info) :
  23. SpiralPluginGUI(w,h,o,ch)
  24. {
  25. m_Mix = new Fl_Button(20, 30, 50, 20, "Mix");
  26. m_Mix->selection_color(Info->GUI_COLOUR);
  27. m_Mix->labelsize(8);
  28. m_Mix->type(1);
  29. m_Mix->callback((Fl_Callback*)cb_Mix);
  30. end();
  31. }
  32. void SwitchPluginGUI::UpdateValues(SpiralPlugin *o)
  33. {
  34. SwitchPlugin* Plugin = (SwitchPlugin*)o;
  35. m_Mix->value(Plugin->GetMix());
  36. }
  37. //// Callbacks ////
  38. inline void SwitchPluginGUI::cb_Mix_i(Fl_Button* o, void* v)
  39. {
  40. m_GUICH->Set("Mix",(bool)o->value());
  41. }
  42. void SwitchPluginGUI::cb_Mix(Fl_Button* o, void* v)
  43. { ((SwitchPluginGUI*)(o->parent()))->cb_Mix_i(o,v);}
  44. const string SwitchPluginGUI::GetHelpText(const string &loc){
  45. return string("")
  46. + "Switches between inputs, if mix is turned on the inputs are\n"
  47. + "crossfaded between, according to the CV input";
  48. }