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.

72 lines
2.0KB

  1. /* WaveShaper Plugin Copyleft (C) 2001 Yves Usson
  2. * for SpiralSynthModular
  3. * Copyleft (C) 2000 David Griffiths <dave@pawfal.org>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. */
  19. #include <FL/Fl.H>
  20. #include <FL/Fl_Window.H>
  21. #include <FL/Fl_Widget.H>
  22. #include <FL/Fl_Group.H>
  23. #include <FL/Fl_Box.H>
  24. #include <FL/Fl_Round_Button.H>
  25. #include "../Widgets/Fl_Knob.H"
  26. #include "../Widgets/Fl_DragBar.H"
  27. #include "WaveShaperPlugin.h"
  28. #include "../SpiralPluginGUI.h"
  29. #ifndef WaveShaperGUI
  30. #define WaveShaperGUI
  31. class FunctionPlot : public Fl_Widget {
  32. public:
  33. FunctionPlot(int ox,int oy,int ww,int hh);
  34. ~FunctionPlot();
  35. private:
  36. float *fval;
  37. void draw();
  38. int handle(int event);
  39. public:
  40. void set(const int index,const float v);
  41. float get(const int index) const;
  42. };
  43. class WaveShaperPluginGUI : public SpiralPluginGUI
  44. {
  45. public:
  46. WaveShaperPluginGUI(int w, int h, WaveShaperPlugin *o,const HostInfo *Info);
  47. virtual void UpdateValues();
  48. virtual SpiralPlugin* GetPlugin() { return m_Plugin; }
  49. WaveShaperPlugin *m_Plugin;
  50. private:
  51. FunctionPlot *fplot;
  52. Fl_Round_Button *radio_polynomial;
  53. Fl_Round_Button *radio_sines;
  54. Fl_Knob *knob[6];
  55. //// Callbacks ////
  56. inline void cb_radio_i(Fl_Round_Button*, void*);
  57. static void cb_radio(Fl_Round_Button* o, void* v);
  58. inline void cb_knob_i(Fl_Knob*, void*);
  59. static void cb_knob(Fl_Knob* o, void* v);
  60. void knobCB();
  61. };
  62. #endif