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.

96 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 <FL/Fl.H>
  19. #include <FL/Fl_Window.H>
  20. #include <FL/Fl_Button.H>
  21. #include <FL/Fl_Group.H>
  22. #include <FL/Fl_Pack.H>
  23. #include <FL/Fl_Int_Input.H>
  24. #include <FL/Fl_Input.H>
  25. #include <FL/Fl_Slider.H>
  26. #include "ControllerPlugin.h"
  27. #include "../SpiralPluginGUI.h"
  28. #ifndef ControllerGUI
  29. #define ControllerGUI
  30. static int Numbers[MAX_CHANNELS];
  31. class ControllerPluginGUI : public SpiralPluginGUI
  32. {
  33. public:
  34. ControllerPluginGUI(int w, int h, ControllerPlugin *o,ChannelHandler *ch,const HostInfo *Info);
  35. virtual void UpdateValues(SpiralPlugin *o);
  36. void StreamIn(istream &s);
  37. void StreamOut(ostream &s);
  38. protected:
  39. const string GetHelpText(const string &loc);
  40. private:
  41. void Clear();
  42. Fl_Color m_GUIColour;
  43. class CVGUI
  44. {
  45. public:
  46. CVGUI::CVGUI(int n, ControllerPluginGUI *p, Fl_Color SelColour);
  47. Fl_Group *m_SliderGroup;
  48. Fl_Input *m_Title;
  49. Fl_Input *m_Min;
  50. Fl_Input *m_Max;
  51. Fl_Slider *m_Chan;
  52. };
  53. friend class CVGUI;
  54. Fl_Pack *m_MainPack, *m_Buttons;
  55. Fl_Button *m_Add, *m_Delete;
  56. vector<CVGUI*> m_GUIVec;
  57. void AddCV();
  58. void DeleteCV();
  59. int m_CVCount;
  60. //// Callbacks ////
  61. inline void cb_Title_i(Fl_Input* o, void* v);
  62. static void cb_Title(Fl_Input* o, void* v);
  63. inline void cb_Max_i(Fl_Input* o, void* v);
  64. static void cb_Max(Fl_Input* o, void* v);
  65. inline void cb_Chan_i(Fl_Slider* o, void* v);
  66. static void cb_Chan(Fl_Slider* o, void* v);
  67. inline void cb_Min_i(Fl_Input* o, void* v);
  68. static void cb_Min(Fl_Input* o, void* v);
  69. inline void cb_Add_i(Fl_Button* o, void* v);
  70. static void cb_Add(Fl_Button* o, void* v);
  71. inline void cb_Delete_i(Fl_Button* o, void* v);
  72. static void cb_Delete(Fl_Button* o, void* v);
  73. friend istream &operator>>(istream &s, ControllerPluginGUI &o);
  74. };
  75. istream &operator>>(istream &s, ControllerPluginGUI &o);
  76. #endif