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.

73 lines
2.2KB

  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 "DelayPluginGUI.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. ////////////////////////////////////////////
  25. DelayPluginGUI::DelayPluginGUI(int w, int h,DelayPlugin *o,const HostInfo *Info) :
  26. SpiralPluginGUI(w,h,o)
  27. {
  28. m_Plugin=o;
  29. m_Delay = new Fl_Slider(15, 20, 20, 70, "Delay");
  30. m_Delay->type(4);
  31. m_Delay->selection_color(GUI_COLOUR);
  32. m_Delay->labelsize(10);
  33. m_Delay->maximum(1);
  34. m_Delay->step(0.001);
  35. m_Delay->value(0.5);
  36. m_Delay->callback((Fl_Callback*)cb_Delay);
  37. m_Mix = new Fl_Knob(58, 28, 45, 45, "Mix");
  38. m_Mix->color(GUI_COLOUR);
  39. m_Mix->type(Fl_Knob::DOTLIN);
  40. m_Mix->labelsize(10);
  41. m_Mix->maximum(1);
  42. m_Mix->step(0.01);
  43. m_Mix->value(0);
  44. m_Mix->callback((Fl_Callback*)cb_Mix);
  45. end();
  46. }
  47. void DelayPluginGUI::UpdateValues()
  48. {
  49. m_Delay->value(m_Plugin->GetDelay()-5.0f);
  50. m_Mix->value(m_Plugin->GetMix());
  51. }
  52. inline void DelayPluginGUI::cb_Delay_i(Fl_Slider* o, void* v)
  53. {
  54. float value=1.0f-o->value();
  55. m_Plugin->SetDelay(value);
  56. }
  57. void DelayPluginGUI::cb_Delay(Fl_Slider* o, void* v)
  58. { ((DelayPluginGUI*)(o->parent()))->cb_Delay_i(o,v); }
  59. inline void DelayPluginGUI::cb_Mix_i(Fl_Knob* o, void* v)
  60. { m_Plugin->SetMix(o->value()); }
  61. void DelayPluginGUI::cb_Mix(Fl_Knob* o, void* v)
  62. { ((DelayPluginGUI*)(o->parent()))->cb_Mix_i(o,v); }