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.

77 lines
2.2KB

  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 "SplitterPluginGUI.h"
  19. #include <FL/fl_draw.H>
  20. #include <FL/fl_draw.H>
  21. using namespace std;
  22. ////////////////////////////////////////////
  23. SplitterPluginGUI::SplitterPluginGUI(int w, int h,SplitterPlugin *o,ChannelHandler *ch,const HostInfo *Info) :
  24. SpiralPluginGUI(w,h,o,ch)
  25. {
  26. m_Channels = new Fl_Counter (15, 20, 50, 15, "Channels");
  27. m_Channels->labelsize (8);
  28. m_Channels->textsize (8);
  29. m_Channels->type (FL_SIMPLE_COUNTER);
  30. m_Channels->box (FL_PLASTIC_UP_BOX);
  31. m_Channels->color (Info->GUI_COLOUR);
  32. m_Channels->selection_color (Info->GUI_COLOUR);
  33. m_Channels->step (1);
  34. m_Channels->value (4);
  35. m_Channels->callback ((Fl_Callback*) cb_Channels, this);
  36. add (m_Channels);
  37. end();
  38. }
  39. void SplitterPluginGUI::Update()
  40. {
  41. }
  42. void SplitterPluginGUI::UpdateValues(SpiralPlugin *o)
  43. {
  44. SplitterPlugin* Plugin = (SplitterPlugin*)o;
  45. m_Channels->value (Plugin->GetChannelCount());
  46. }
  47. inline void SplitterPluginGUI::cb_Channels_i (Fl_Counter* o)
  48. {
  49. if (o->value() < 2)
  50. {
  51. o->value(2);
  52. }
  53. else {
  54. m_GUICH->Set ("ChannelCount", int (o->value ()));
  55. m_GUICH->SetCommand (SplitterPlugin::SETCHANNELCOUNT);
  56. m_GUICH->Wait ();
  57. Resize (w(), h());
  58. }
  59. }
  60. const string SplitterPluginGUI::GetHelpText(const string &loc)
  61. {
  62. return string("")
  63. + "The simplest plugin - the splitter simply takes the input,\n"
  64. + "and duplicates it into it's outputs. Simple, but difficult\n"
  65. + "to do without.\n";
  66. }