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.

57 lines
1.9KB

  1. /* WaveShaper Plugin Copyleft (C) 2001 Yves Usson
  2. * for SpiralSynthModular
  3. * Copyleft (C) 2001 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 "../SpiralPlugin.h"
  20. #include <FL/Fl_Pixmap.H>
  21. #ifndef WaveShaperPLUGIN
  22. #define WaveShaperPLUGIN
  23. class WaveShaperPlugin : public SpiralPlugin {
  24. public:
  25. WaveShaperPlugin();
  26. virtual ~WaveShaperPlugin ();
  27. virtual PluginInfo& Initialise (const HostInfo *Host);
  28. virtual SpiralGUIType* CreateGUI();
  29. virtual void Execute();
  30. virtual void ExecuteCommands();
  31. virtual void StreamOut(std::ostream &s);
  32. virtual void StreamIn(std::istream &s);
  33. float GetCoef(int);
  34. int GetWaveType(void);
  35. enum GUICommands { NONE, SETWAVETYPE, SETCOEF };
  36. struct GUIArgs {
  37. int WaveType, CoefNum;
  38. float CoefVal, *FuncPlot;
  39. };
  40. private:
  41. GUIArgs m_GUIArgs;
  42. float *m_wt, m_Coefs[6];
  43. int m_Wave;
  44. void calc (void);
  45. void set (int index, float v);
  46. friend std::istream &operator>> (std::istream &s, WaveShaperPlugin &o);
  47. friend std::ostream &operator<< (std::ostream &s, WaveShaperPlugin &o);
  48. };
  49. std::istream &operator>> (std::istream &s, WaveShaperPlugin &o);
  50. std::ostream &operator<< (std::ostream &s, WaveShaperPlugin &o);
  51. #endif