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.

119 lines
3.4KB

  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_Input.H>
  26. #include <FL/Fl_Button.H>
  27. #include <FL/Fl_Check_Button.H>
  28. #include <FL/Fl_Box.H>
  29. #include <FL/Fl_Output.H>
  30. #include <FL/Fl_Scroll.H>
  31. #include "../Widgets/Fl_Knob.H"
  32. #include <vector>
  33. #include <string>
  34. #include <cstdio>
  35. #include <cmath>
  36. #include <dlfcn.h>
  37. #include "LADSPAPlugin.h"
  38. #include "LADSPAInfo.h"
  39. #include "../SpiralPluginGUI.h"
  40. class LADSPAPluginGUI : public SpiralPluginGUI
  41. {
  42. public:
  43. LADSPAPluginGUI(int w, int h,
  44. LADSPAPlugin *o,
  45. ChannelHandler *ch,
  46. const HostInfo *Info,
  47. const std::vector<LADSPAInfo::PluginEntry> &PVec);
  48. ~LADSPAPluginGUI();
  49. virtual void UpdateValues(SpiralPlugin *o);
  50. virtual void Update(void);
  51. void SetName(const char *s);
  52. void SetMaker(const char *s);
  53. void ClearPortInfo();
  54. void AddPortInfo(const char *Info);
  55. void UpdatePortDisplay(int n, float v);
  56. void SetPortSettings(unsigned long n, float min, float max, bool clamp, float defolt);
  57. // void SetMinMax(int n, float min, float max, bool clamp);
  58. // void GetMinMax(int n, float &min, float &max, bool &clamp);
  59. private:
  60. Fl_Scroll *m_InputScroll;
  61. Fl_Pack *m_InputPack;
  62. Fl_Choice *m_Browser;
  63. Fl_Knob *m_OutputGain;
  64. Fl_Box *m_Name;
  65. Fl_Box *m_Maker;
  66. Fl_Button *m_UpdateInputs;
  67. Fl_Button *m_UpdateMinMax;
  68. Fl_Button *m_PowerAmp;
  69. std::vector<Fl_Output*> m_PortOutput;
  70. std::vector<Fl_Input*> m_PortMin;
  71. std::vector<Fl_Input*> m_PortMax;
  72. std::vector<Fl_Check_Button*> m_PortClamp;
  73. std::vector<Fl_Input*> m_PortDefault;
  74. std::vector<LADSPAInfo::PluginEntry> PluginList;
  75. // this is needed as fltk seems to crash if you delete
  76. // the pack, is won't delete the children properly???
  77. std::vector<Fl_Group*> m_PackVec;
  78. int inited;
  79. inline void cb_Select_i(Fl_Choice* o);
  80. static void cb_Select(Fl_Choice* o);
  81. inline void cb_Gain_i(Fl_Knob* o, void* v);
  82. static void cb_Gain(Fl_Knob* o, void* v);
  83. inline void cb_MinMax_i(Fl_Button* o, void* v);
  84. static void cb_MinMax(Fl_Button* o, void* v);
  85. inline void cb_PowerAmp_i(Fl_Button* o, void* v);
  86. static void cb_PowerAmp(Fl_Button* o, void* v);
  87. struct InChannelData
  88. {
  89. float Gain;
  90. char Name[256];
  91. char Maker[256];
  92. unsigned long MaxInputPortCount;
  93. unsigned long InputPortCount;
  94. char *InputPortNames;
  95. PortSettings *InputPortSettings;
  96. float *InputPortValues;
  97. };
  98. InChannelData m_InData;
  99. };
  100. #endif // __ladspa_plugin_gui_h__