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.

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