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.

75 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 "DistributorPluginGUI.h"
  19. #include <FL/fl_draw.H>
  20. #include <FL/fl_draw.H>
  21. using namespace std;
  22. ////////////////////////////////////////////
  23. DistributorPluginGUI::DistributorPluginGUI(int w, int h,DistributorPlugin *o,ChannelHandler *ch,const HostInfo *Info) :
  24. SpiralPluginGUI(w,h,o,ch)
  25. {
  26. m_Chans = new Fl_Counter (15, 20, 50, 15, "Channels");
  27. m_Chans->labelsize (8);
  28. m_Chans->textsize (8);
  29. m_Chans->type (FL_SIMPLE_COUNTER);
  30. m_Chans->box (FL_PLASTIC_UP_BOX);
  31. m_Chans->color (Info->GUI_COLOUR);
  32. m_Chans->selection_color (Info->GUI_COLOUR);
  33. m_Chans->step (1);
  34. m_Chans->value (2);
  35. m_Chans->callback ((Fl_Callback*) cb_Chans, this);
  36. add (m_Chans);
  37. end();
  38. }
  39. void DistributorPluginGUI::Update()
  40. {
  41. }
  42. void DistributorPluginGUI::UpdateValues(SpiralPlugin *o)
  43. {
  44. DistributorPlugin* Plugin = (DistributorPlugin*)o;
  45. m_Chans->value (Plugin->GetChannelCount());
  46. }
  47. inline void DistributorPluginGUI::cb_Chans_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 (DistributorPlugin::SETCHANNELCOUNT);
  56. m_GUICH->Wait ();
  57. Resize (w(), h());
  58. }
  59. }
  60. const string DistributorPluginGUI::GetHelpText(const string &loc)
  61. {
  62. return string("")
  63. + "The Distributor plugin is for polyphony. NEED MORE INFO HERE.\n";
  64. }