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.

76 lines
2.5KB

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