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.4KB

  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. #include "NoisePluginGUI.h"
  19. #include <FL/fl_draw.h>
  20. #include <FL/fl_draw.H>
  21. NoisePluginGUI::NoisePluginGUI(int w, int h,NoisePlugin *o,ChannelHandler *ch,const HostInfo *Info) :
  22. SpiralPluginGUI(w,h,o,ch)
  23. {
  24. White = new Fl_LED_Button (15, 12, 55, 20, "White");
  25. White->type (FL_RADIO_BUTTON);
  26. White->labelsize (10);
  27. White->set ();
  28. White->callback ((Fl_Callback*)cb_White);
  29. Pink = new Fl_LED_Button (15, 34, 55, 20, "Pink");
  30. Pink->type (FL_RADIO_BUTTON);
  31. Pink->labelsize (10);
  32. Pink->callback ((Fl_Callback*)cb_Pink);
  33. end();
  34. }
  35. void NoisePluginGUI::UpdateValues(SpiralPlugin *o)
  36. {
  37. NoisePlugin *Plugin = (NoisePlugin*)o;
  38. switch (Plugin->GetType())
  39. {
  40. case NoisePlugin::WHITE : White->value(1); break;
  41. case NoisePlugin::PINK : Pink->value(1); break;
  42. }
  43. }
  44. //// Callbacks ////
  45. inline void NoisePluginGUI::cb_White_i(Fl_LED_Button* o, void* v)
  46. { m_GUICH->Set("Type",(char)NoisePlugin::WHITE); }
  47. void NoisePluginGUI::cb_White(Fl_LED_Button* o, void* v)
  48. { ((NoisePluginGUI*)(o->parent()))->cb_White_i(o,v); }
  49. inline void NoisePluginGUI::cb_Pink_i(Fl_LED_Button* o, void* v)
  50. { m_GUICH->Set("Type",(char)NoisePlugin::PINK); }
  51. void NoisePluginGUI::cb_Pink(Fl_LED_Button* o, void* v)
  52. { ((NoisePluginGUI*)(o->parent()))->cb_Pink_i(o,v); }
  53. const string NoisePluginGUI::GetHelpText(const string &loc){
  54. return string("")
  55. + "Makes noise, white noise is just raw randomness, pink noise\n"
  56. + "is white noise filtered to contain equal amounts of each\n"
  57. + "frequency, it should sound more natural and be more useful\n"
  58. + "for synthesis uses";
  59. }