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.

90 lines
3.8KB

  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 W_TABLE_GUI
  19. #define W_TABLE_GUI
  20. #include <FL/Fl_Pixmap.H>
  21. #include <FL/Fl_Counter.H>
  22. #include <FL/Fl_Tabs.h>
  23. #include <FL/Fl_Group.h>
  24. #include <FL/Fl_Button.h>
  25. #include "../Widgets/Fl_LED_Button.H"
  26. #include "../Widgets/Fl_Knob.H"
  27. #include "../SpiralPluginGUI.h"
  28. #include "WaveTablePlugin.h"
  29. class WaveTablePluginGUI : public SpiralPluginGUI {
  30. public:
  31. WaveTablePluginGUI (int w, int h, SpiralPlugin *o, ChannelHandler *ch, const HostInfo *Info);
  32. virtual void UpdateValues (SpiralPlugin* o);
  33. protected:
  34. const std::string GetHelpText(const std::string &loc);
  35. private:
  36. // Utility Functions
  37. void UpdateFreq (void);
  38. float CalcFineFreq (float Fine);
  39. // Widgets
  40. Fl_Tabs *m_Tabs;
  41. Fl_Group *m_CtlGroup, *m_NumGroup;
  42. Fl_Button *m_Reset;
  43. Fl_LED_Button *m_ShapeSine, *m_ShapeSquare, *m_ShapeSaw, *m_ShapeRevSaw,
  44. *m_ShapeTri, *m_ShapePulse1, *m_ShapePulse2, *m_ShapeInvSine;
  45. Fl_Pixmap m_PixmapSine, m_PixmapSquare, m_PixmapSaw, m_PixmapRevSaw,
  46. m_PixmapTri, m_PixmapPulse1, m_PixmapPulse2, m_PixmapInvSine;
  47. Fl_Knob *m_Octave, *m_ModAmount, *m_FineTune;
  48. Fl_Counter *m_NumFreq, *m_NumModAmount, *m_NumOctave;
  49. // Data
  50. float m_FineFreq;
  51. // Callbacks - no group
  52. inline void cb_Sine_i (Fl_LED_Button* o, void* v);
  53. static void cb_Sine (Fl_LED_Button* o, void* v);
  54. inline void cb_Square_i (Fl_LED_Button* o, void* v);
  55. static void cb_Square (Fl_LED_Button* o, void* v);
  56. inline void cb_Saw_i (Fl_LED_Button* o, void* v);
  57. static void cb_Saw (Fl_LED_Button* o, void* v);
  58. inline void cb_RevSaw_i (Fl_LED_Button* o, void* v);
  59. static void cb_RevSaw (Fl_LED_Button* o, void* v);
  60. inline void cb_Tri_i (Fl_LED_Button* o, void* v);
  61. static void cb_Tri (Fl_LED_Button* o, void* v);
  62. inline void cb_Pulse1_i (Fl_LED_Button* o, void* v);
  63. static void cb_Pulse1 (Fl_LED_Button* o, void* v);
  64. inline void cb_Pulse2_i (Fl_LED_Button* o, void* v);
  65. static void cb_Pulse2 (Fl_LED_Button* o, void* v);
  66. inline void cb_InvSine_i (Fl_LED_Button* o, void* v);
  67. static void cb_InvSine (Fl_LED_Button* o, void* v);
  68. // Callbacks - Control Group
  69. inline void cb_Octave_i (Fl_Knob* o, void* v);
  70. static void cb_Octave (Fl_Knob* o, void* v);
  71. inline void cb_FineTune_i (Fl_Knob* o, void* v);
  72. static void cb_FineTune (Fl_Knob* o, void* v);
  73. inline void cb_Reset_i (Fl_Button* o, void* v);
  74. static void cb_Reset (Fl_Button* o, void* v);
  75. inline void cb_ModAmount_i (Fl_Knob* o, void* v);
  76. static void cb_ModAmount (Fl_Knob* o, void* v);
  77. // Callbacks - Numbers Group
  78. inline void cb_NumFreq_i (Fl_Counter* o, void* v);
  79. static void cb_NumFreq (Fl_Counter* o, void* v);
  80. inline void cb_NumOctave_i (Fl_Counter* o, void* v);
  81. static void cb_NumOctave (Fl_Counter* o, void* v);
  82. inline void cb_NumModAmount_i (Fl_Counter* o, void* v);
  83. static void cb_NumModAmount (Fl_Counter* o, void* v);
  84. };
  85. #endif