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.

105 lines
2.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 "list"
  19. #include <FL/Fl.H>
  20. #include <FL/Fl_Window.H>
  21. #include <FL/Fl_Group.H>
  22. #include <FL/Fl_Slider.H>
  23. #include <FL/Fl_Counter.H>
  24. #include <FL/Fl_Scroll.H>
  25. #include <FL/Fl_Button.H>
  26. #include <FL/Fl_Box.H>
  27. #include <FL/Fl_Pack.H>
  28. #include "../Widgets/Fl_LED_Button.H"
  29. #include "SeqSelectorPlugin.h"
  30. #include "../SpiralPluginGUI.h"
  31. #ifndef MixerGUI
  32. #define MixerGUI
  33. class CountLine : public Fl_Group
  34. {
  35. public:
  36. CountLine (int n, Fl_Color col1, Fl_Color col2);
  37. ~CountLine();
  38. void SetVal(int n, float val);
  39. float GetVal(int n);
  40. void SetLED(bool s) { m_Flasher->value(s); }
  41. virtual int handle(int event);
  42. ChannelHandler *m_GUICH;
  43. private:
  44. Fl_LED_Button *m_Flasher;
  45. Fl_Counter *m_Counter[NUM_VALUES];
  46. int m_Num;
  47. char m_Count[32];
  48. };
  49. class SeqSelectorPluginGUI : public SpiralPluginGUI
  50. {
  51. public:
  52. SeqSelectorPluginGUI(int w, int h, SeqSelectorPlugin *o,ChannelHandler *ch,const HostInfo *Info);
  53. virtual void UpdateValues(SpiralPlugin *o);
  54. virtual void Update();
  55. void AddLine(int* Val=NULL);
  56. void RemoveLine();
  57. float GetVal(int l, int v);
  58. int GetNumLines() { return m_LineVec.size(); }
  59. void SetLED(int n);
  60. void StreamOut(ostream &s);
  61. void StreamIn(istream &s);
  62. protected:
  63. const string GetHelpText(const string &loc);
  64. private:
  65. int m_LastLight;
  66. Fl_Color m_Colour1, m_Colour2;
  67. Fl_Pack *m_Main;
  68. Fl_Scroll *m_Scroll;
  69. Fl_Button *m_New;
  70. Fl_Button *m_Delete;
  71. Fl_Counter *m_Begin;
  72. Fl_Counter *m_End;
  73. Fl_Button *m_UseRange;
  74. list<CountLine*> m_LineVec;
  75. //// Callbacks ////
  76. inline void cb_New_i(Fl_Button* o, void* v);
  77. static void cb_New(Fl_Button* o, void* v);
  78. inline void cb_Delete_i(Fl_Button* o, void* v);
  79. static void cb_Delete(Fl_Button* o, void* v);
  80. inline void cb_Begin_i(Fl_Counter* o, void* v);
  81. static void cb_Begin(Fl_Counter* o, void* v);
  82. inline void cb_End_i(Fl_Counter* o, void* v);
  83. static void cb_End(Fl_Counter* o, void* v);
  84. inline void cb_UseRange_i(Fl_Button* o, void* v);
  85. static void cb_UseRange(Fl_Button* o, void* v);
  86. };
  87. #endif