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.

101 lines
2.6KB

  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. static const int NUM_VALUES = 8;
  34. class CountLine : public Fl_Group
  35. {
  36. public:
  37. CountLine(int n);
  38. ~CountLine();
  39. void SetVal(int n, float val);
  40. float GetVal(int n);
  41. void SetLED(bool s) { m_Flasher->value(s); }
  42. private:
  43. Fl_LED_Button *m_Flasher;
  44. Fl_Counter *m_Counter[NUM_VALUES];
  45. char m_Count[32];
  46. };
  47. class SeqSelectorPluginGUI : public SpiralPluginGUI
  48. {
  49. public:
  50. SeqSelectorPluginGUI(int w, int h, SeqSelectorPlugin *o,const HostInfo *Info);
  51. virtual void UpdateValues();
  52. virtual SpiralPlugin* GetPlugin() { return m_Plugin; }
  53. SeqSelectorPlugin *m_Plugin;
  54. void AddLine(int* Val=NULL);
  55. void RemoveLine();
  56. float GetVal(int l, int v);
  57. int GetNumLines() { return m_LineVec.size(); }
  58. void SetLED(int n);
  59. void StreamOut(ostream &s);
  60. void StreamIn(istream &s);
  61. private:
  62. Fl_Pack *m_Main;
  63. Fl_Scroll *m_Scroll;
  64. Fl_Button *m_New;
  65. Fl_Button *m_Delete;
  66. Fl_Counter *m_Begin;
  67. Fl_Counter *m_End;
  68. Fl_Button *m_UseRange;
  69. list<CountLine*> m_LineVec;
  70. //// Callbacks ////
  71. inline void cb_New_i(Fl_Button* o, void* v);
  72. static void cb_New(Fl_Button* o, void* v);
  73. inline void cb_Delete_i(Fl_Button* o, void* v);
  74. static void cb_Delete(Fl_Button* o, void* v);
  75. inline void cb_Begin_i(Fl_Counter* o, void* v);
  76. static void cb_Begin(Fl_Counter* o, void* v);
  77. inline void cb_End_i(Fl_Counter* o, void* v);
  78. static void cb_End(Fl_Counter* o, void* v);
  79. inline void cb_UseRange_i(Fl_Button* o, void* v);
  80. static void cb_UseRange(Fl_Button* o, void* v);
  81. };
  82. #endif