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.

91 lines
2.9KB

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