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.

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