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.

88 lines
3.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. #ifndef OSC_GUI
  19. #define OSC_GUI
  20. #include <FL/Fl_Pixmap.H>
  21. #include <FL/Fl_Slider.H>
  22. #include <FL/Fl_Counter.H>
  23. #include <FL/Fl_Tabs.H>
  24. #include <FL/Fl_Group.H>
  25. #include <FL/Fl_Button.H>
  26. #include "../Widgets/Fl_LED_Button.H"
  27. #include "../Widgets/Fl_Knob.H"
  28. #include "../SpiralPluginGUI.h"
  29. #include "OscillatorPlugin.h"
  30. class OscillatorPluginGUI : public SpiralPluginGUI {
  31. public:
  32. OscillatorPluginGUI (int w, int h, OscillatorPlugin *o, ChannelHandler *ch, const HostInfo *Info);
  33. virtual void UpdateValues (SpiralPlugin *o);
  34. protected:
  35. const std::string GetHelpText(const std::string &loc);
  36. private:
  37. // Utility Functions
  38. void UpdateFreq (void);
  39. float CalcFineFreq (float Fine);
  40. // Widgets
  41. Fl_Tabs *m_Tabs;
  42. Fl_Group *m_CtlGroup, *m_NumGroup;
  43. Fl_Button *m_Reset;
  44. Fl_LED_Button *m_ShapeSquare, *m_ShapeNoise, *m_ShapeSaw;
  45. Fl_Pixmap m_PixmapSquare, m_PixmapNoise, m_PixmapSaw;
  46. Fl_Knob *m_Octave, *m_ModAmount, *m_FineTune;
  47. Fl_Slider *m_PulseWidth, *m_SHLen;
  48. Fl_Counter *m_NumFreq, *m_NumModAmount, *m_NumPulseWidth, *m_NumSHLen, *m_NumOctave;
  49. // Data
  50. float m_FineFreq;
  51. // Callbacks - no group
  52. inline void cb_Square_i (Fl_LED_Button* o, void* v);
  53. static void cb_Square (Fl_LED_Button* o, void* v);
  54. inline void cb_Saw_i (Fl_LED_Button* o, void* v);
  55. static void cb_Saw (Fl_LED_Button* o, void* v);
  56. inline void cb_Noise_i (Fl_LED_Button* o, void* v);
  57. static void cb_Noise (Fl_LED_Button* o, void* v);
  58. // Callbacks - Control Group
  59. inline void cb_Octave_i (Fl_Knob* o, void* v);
  60. static void cb_Octave (Fl_Knob* o, void* v);
  61. inline void cb_FineTune_i (Fl_Knob* o, void* v);
  62. static void cb_FineTune (Fl_Knob* o, void* v);
  63. inline void cb_Reset_i (Fl_Button* o, void* v);
  64. static void cb_Reset (Fl_Button* o, void* v);
  65. inline void cb_ModAmount_i (Fl_Knob* o, void* v);
  66. static void cb_ModAmount (Fl_Knob* o, void* v);
  67. inline void cb_PulseWidth_i (Fl_Slider* o, void* v);
  68. static void cb_PulseWidth (Fl_Slider* o, void* v);
  69. inline void cb_SHLen_i (Fl_Slider* o, void* v);
  70. static void cb_SHLen (Fl_Slider* o, void* v);
  71. // Callbacks - Numbers Group
  72. inline void cb_NumPulseWidth_i (Fl_Counter* o, void* v);
  73. static void cb_NumPulseWidth (Fl_Counter* o, void* v);
  74. inline void cb_NumFreq_i (Fl_Counter* o, void* v);
  75. static void cb_NumFreq (Fl_Counter* o, void* v);
  76. inline void cb_NumOctave_i (Fl_Counter* o, void* v);
  77. static void cb_NumOctave (Fl_Counter* o, void* v);
  78. inline void cb_NumModAmount_i (Fl_Counter* o, void* v);
  79. static void cb_NumModAmount (Fl_Counter* o, void* v);
  80. inline void cb_NumSHLen_i (Fl_Counter* o, void* v);
  81. static void cb_NumSHLen (Fl_Counter* o, void* v);
  82. };
  83. #endif