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.

69 lines
2.2KB

  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_Widget.H>
  21. #include <FL/Fl_Box.H>
  22. #include "../Widgets/Fl_Knob.H"
  23. #include "../Widgets/Fl_DragBar.H"
  24. #include "../Widgets/Fl_LED_Button.H"
  25. #include "WaveShaperPlugin.h"
  26. #include "../SpiralPluginGUI.h"
  27. #ifndef WaveShaperGUI
  28. #define WaveShaperGUI
  29. class FunctionPlot : public Fl_Widget {
  30. public:
  31. FunctionPlot (int ox, int oy, int ww, int hh);
  32. ~FunctionPlot ();
  33. private:
  34. float *fval;
  35. void draw ();
  36. int handle (int event);
  37. Fl_Color m_IndColour, m_MrkColour, m_FGColour;
  38. public:
  39. void SetColours (unsigned i, unsigned m, unsigned f) {
  40. m_IndColour=(Fl_Color)i; m_MrkColour=(Fl_Color)m; m_FGColour=(Fl_Color)f;
  41. }
  42. void set (const int index, const float v);
  43. float get (const int index) const;
  44. };
  45. class WaveShaperPluginGUI : public SpiralPluginGUI {
  46. public:
  47. WaveShaperPluginGUI (int w, int h, WaveShaperPlugin *o, ChannelHandler *ch, const HostInfo *Info);
  48. virtual void UpdateValues (SpiralPlugin *o);
  49. virtual void Update ();
  50. protected:
  51. const string GetHelpText (const string &loc);
  52. private:
  53. FunctionPlot *fplot;
  54. Fl_LED_Button *radio_polynomial, *radio_sines;
  55. Fl_Knob *knob[6];
  56. //// Callbacks ////
  57. inline void cb_radio_i (Fl_LED_Button*, void*);
  58. static void cb_radio (Fl_LED_Button* o, void* v);
  59. inline void cb_knob_i (Fl_Knob*, void*);
  60. static void cb_knob (Fl_Knob* o, void* v);
  61. };
  62. #endif