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.

144 lines
4.9KB

  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. #ifndef __ladspa_plugin_gui_h__
  19. #define __ladspa_plugin_gui_h__
  20. #include <FL/Fl.H>
  21. #include <FL/Fl_Window.H>
  22. #include <FL/Fl_Group.H>
  23. #include <FL/Fl_Pack.H>
  24. #include <FL/Fl_Choice.H>
  25. #include <FL/Fl_Tabs.H>
  26. #include <FL/Fl_Scroll.H>
  27. #include <FL/Fl_Input.H>
  28. #include <FL/Fl_Button.H>
  29. #include <FL/Fl_Check_Button.H>
  30. #include <FL/Fl_Box.H>
  31. #include <FL/Fl_Output.H>
  32. #include "../Widgets/Fl_Knob.H"
  33. #include "../Widgets/Fl_LED_Button.H"
  34. #include <vector>
  35. #include <string>
  36. #include <cstdio>
  37. #include <cmath>
  38. #include <dlfcn.h>
  39. #include "LADSPAPlugin.h"
  40. #include "LADSPAInfo.h"
  41. #include "../SpiralPluginGUI.h"
  42. class LADSPAPluginGUI : public SpiralPluginGUI
  43. {
  44. public:
  45. LADSPAPluginGUI(int w, int h,
  46. LADSPAPlugin *o,
  47. ChannelHandler *ch,
  48. const HostInfo *Info,
  49. const std::vector<LADSPAInfo::PluginEntry> &PVec);
  50. ~LADSPAPluginGUI(void);
  51. virtual void UpdateValues(SpiralPlugin *o);
  52. virtual void Update(void);
  53. protected:
  54. const string GetHelpText(const string &loc);
  55. private:
  56. void AddPortInfo(const char *Info);
  57. void SetTabIndex(int index);
  58. void SetUpdateInputs(bool state);
  59. void SetPluginIndex(unsigned long n);
  60. void SetName(const char *s);
  61. void SetMaker(const char *s);
  62. void SetPortSettings(unsigned long n, float min, float max, bool clamp, float defolt);
  63. void SetDefaultAdjust(unsigned long n);
  64. void UpdateDefaultAdjustControls(void);
  65. void ClearPlugin(void);
  66. void SelectPlugin(void);
  67. Fl_Color m_GUIColour;
  68. Fl_Box *m_NameLabel;
  69. Fl_Box *m_MakerLabel;
  70. Fl_Tabs *m_Tab;
  71. Fl_Group *m_ControlGroup;
  72. Fl_Scroll *m_ControlScroll;
  73. Fl_Pack *m_ControlPack;
  74. Fl_Group *m_SetupGroup;
  75. Fl_Choice *m_Browser;
  76. Fl_Box *m_ValueLabel;
  77. Fl_Box *m_DefaultLabel;
  78. Fl_Box *m_MinLabel;
  79. Fl_Box *m_MaxLabel;
  80. Fl_Box *m_ClampLabel;
  81. Fl_Box *m_PortLabel;
  82. Fl_Scroll *m_InputScroll;
  83. Fl_Pack *m_InputPack;
  84. Fl_LED_Button *m_UpdateInputs;
  85. std::vector<Fl_Output*> m_PortValue;
  86. std::vector<Fl_Input*> m_PortMin;
  87. std::vector<Fl_Input*> m_PortMax;
  88. std::vector<Fl_Check_Button*> m_PortClamp;
  89. std::vector<Fl_Input*> m_PortDefault;
  90. std::vector<Fl_Knob*> m_PortDefaultAdjust;
  91. std::vector<char *> m_PortDefaultAdjustLabels;
  92. std::vector<LADSPAInfo::PluginEntry> m_PluginList;
  93. unsigned long m_PortIndex;
  94. float m_Default;
  95. float m_Min;
  96. float m_Max;
  97. bool m_Clamp;
  98. unsigned long m_PluginIndex;
  99. int m_TabIndex;
  100. bool m_UpdateInputState;
  101. char m_Name[256];
  102. char m_Maker[256];
  103. unsigned long m_MaxInputPortCount;
  104. unsigned long m_InputPortCount;
  105. char *m_InputPortNames;
  106. PortSettings *m_InputPortSettings;
  107. PortValues *m_InputPortValues;
  108. float *m_InputPortDefaults;
  109. inline void cb_TabChange_i(Fl_Tabs *o);
  110. static void cb_TabChange(Fl_Tabs *o);
  111. inline void cb_Select_i(Fl_Choice* o);
  112. static void cb_Select(Fl_Choice* o);
  113. inline void cb_UpdateInputs_i(Fl_LED_Button* o);
  114. static void cb_UpdateInputs(Fl_LED_Button* o);
  115. inline void cb_Default_i(Fl_Input* o);
  116. static void cb_Default(Fl_Input* o);
  117. inline void cb_Min_i(Fl_Input* o);
  118. static void cb_Min(Fl_Input* o);
  119. inline void cb_Max_i(Fl_Input* o);
  120. static void cb_Max(Fl_Input* o);
  121. inline void cb_Clamp_i(Fl_Check_Button* o);
  122. static void cb_Clamp(Fl_Check_Button* o);
  123. inline void cb_DefaultAdjust_i(Fl_Knob *o);
  124. static void cb_DefaultAdjust(Fl_Knob *o);
  125. };
  126. #endif // __ladspa_plugin_gui_h__