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.

87 lines
2.8KB

  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 "SmoothPluginGUI.h"
  19. #include <FL/fl_draw.h>
  20. #include <FL/fl_draw.H>
  21. ////////////////////////////////////////////
  22. SmoothPluginGUI::SmoothPluginGUI(int w, int h,SmoothPlugin *o,ChannelHandler *ch,const HostInfo *Info) :
  23. SpiralPluginGUI(w,h,o,ch)
  24. {
  25. m_Up = new Fl_Knob (8, 18, 40, 40, "Up");
  26. m_Up->color(Info->GUI_COLOUR);
  27. m_Up->type(Fl_Knob::DOTLIN);
  28. m_Up->labelsize(10);
  29. m_Up->maximum(1);
  30. m_Up->step(0.001);
  31. m_Up->value(0.5);
  32. m_Up->callback((Fl_Callback*)cb_Up);
  33. add(m_Up);
  34. m_Down = new Fl_Knob (64, 18, 40, 40, "Down");
  35. m_Down->color(Info->GUI_COLOUR);
  36. m_Down->type(Fl_Knob::DOTLIN);
  37. m_Down->labelsize(10);
  38. m_Down->maximum(1);
  39. m_Down->step(0.001);
  40. m_Down->value(0.5);
  41. m_Down->callback((Fl_Callback*)cb_Down);
  42. add(m_Down);
  43. end();
  44. }
  45. void SmoothPluginGUI::UpdateValues(SpiralPlugin *o)
  46. {
  47. SmoothPlugin *Plugin = (SmoothPlugin*)o;
  48. m_Up->value(Plugin->GetUp());
  49. m_Down->value(Plugin->GetDown());
  50. }
  51. inline void SmoothPluginGUI::cb_Down_i(Fl_Knob* o, void* v)
  52. { m_GUICH->Set("Down",(float)o->value()); }
  53. void SmoothPluginGUI::cb_Down(Fl_Knob* o, void* v)
  54. { ((SmoothPluginGUI*)(o->parent()))->cb_Down_i(o,v);}
  55. inline void SmoothPluginGUI::cb_Up_i(Fl_Knob* o, void* v)
  56. { m_GUICH->Set("Up",(float)o->value()); }
  57. void SmoothPluginGUI::cb_Up(Fl_Knob* o, void* v)
  58. { ((SmoothPluginGUI*)(o->parent()))->cb_Up_i(o,v);}
  59. const string SmoothPluginGUI::GetHelpText(const string &loc){
  60. return string("")
  61. + "This device is used for smoothing out the signal fed\n"
  62. + "through it. It's primary use is for smoothing out the\n"
  63. + "frequency CV sent to the oscillator to achieve portmento\n"
  64. + "or sliding between notes.\n"
  65. + "It can also be used as a primitive filter for audio\n"
  66. + "signals, but its mainly used on CVs.\n"
  67. + "\n"
  68. + "The controls on the plugin window allow you to alter\n"
  69. + "the speed of the sliding, up and down are seperated,\n"
  70. + "so going up the keyboard can have a different effect\n"
  71. + "to going down :) \n";
  72. }