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.

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