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.

74 lines
2.3KB

  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 "EnvFollowerPluginGUI.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. EnvFollowerPluginGUI::EnvFollowerPluginGUI(int w, int h,EnvFollowerPlugin *o,const HostInfo *Info) :
  26. SpiralPluginGUI(w,h,o)
  27. {
  28. m_Plugin=o;
  29. m_Attack = new Fl_Knob(20, 25, 40, 40, "Attack");
  30. m_Attack->color(GUI_COLOUR);
  31. m_Attack->type(Fl_Knob::DOTLIN);
  32. m_Attack->labelsize(10);
  33. m_Attack->maximum(1);
  34. m_Attack->step(0.001);
  35. m_Attack->value(0.5);
  36. m_Attack->callback((Fl_Callback*)cb_Attack);
  37. add(m_Attack);
  38. m_Decay = new Fl_Knob(75, 25, 40, 40, "Decay");
  39. m_Decay->color(GUI_COLOUR);
  40. m_Decay->type(Fl_Knob::DOTLIN);
  41. m_Decay->labelsize(10);
  42. m_Decay->maximum(1);
  43. m_Decay->step(0.001);
  44. m_Decay->value(0.5);
  45. m_Decay->callback((Fl_Callback*)cb_Decay);
  46. add(m_Decay);
  47. end();
  48. }
  49. void EnvFollowerPluginGUI::UpdateValues()
  50. {
  51. m_Attack->value(m_Plugin->GetAttack());
  52. m_Decay->value(m_Plugin->GetDecay());
  53. }
  54. inline void EnvFollowerPluginGUI::cb_Decay_i(Fl_Knob* o, void* v)
  55. { m_Plugin->SetDecay(o->value()); }
  56. void EnvFollowerPluginGUI::cb_Decay(Fl_Knob* o, void* v)
  57. { ((EnvFollowerPluginGUI*)(o->parent()))->cb_Decay_i(o,v);}
  58. inline void EnvFollowerPluginGUI::cb_Attack_i(Fl_Knob* o, void* v)
  59. { m_Plugin->SetAttack(o->value()); }
  60. void EnvFollowerPluginGUI::cb_Attack(Fl_Knob* o, void* v)
  61. { ((EnvFollowerPluginGUI*)(o->parent()))->cb_Attack_i(o,v);}