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.

82 lines
2.7KB

  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. using namespace std;
  22. ////////////////////////////////////////////
  23. EnvFollowerPluginGUI::EnvFollowerPluginGUI(int w, int h,EnvFollowerPlugin *o,ChannelHandler *ch,const HostInfo *Info) :
  24. SpiralPluginGUI(w,h,o,ch)
  25. {
  26. m_Attack = new Fl_Knob (8, 18, 40, 40, "Attack");
  27. m_Attack->color(Info->GUI_COLOUR);
  28. m_Attack->type(Fl_Knob::DOTLIN);
  29. m_Attack->labelsize(10);
  30. m_Attack->maximum(1);
  31. m_Attack->step(0.001);
  32. m_Attack->value(0.5);
  33. m_Attack->callback((Fl_Callback*)cb_Attack);
  34. add(m_Attack);
  35. m_Decay = new Fl_Knob (64, 18, 40, 40, "Decay");
  36. m_Decay->color(Info->GUI_COLOUR);
  37. m_Decay->type(Fl_Knob::DOTLIN);
  38. m_Decay->labelsize(10);
  39. m_Decay->maximum(1);
  40. m_Decay->step(0.001);
  41. m_Decay->value(0.5);
  42. m_Decay->callback((Fl_Callback*)cb_Decay);
  43. add(m_Decay);
  44. end();
  45. }
  46. void EnvFollowerPluginGUI::UpdateValues(SpiralPlugin *o)
  47. {
  48. EnvFollowerPlugin *Plugin = (EnvFollowerPlugin*)o;
  49. m_Attack->value(Plugin->GetAttack());
  50. m_Decay->value(Plugin->GetDecay());
  51. }
  52. inline void EnvFollowerPluginGUI::cb_Decay_i(Fl_Knob* o, void* v)
  53. { m_GUICH->Set("Decay",o->value()); }
  54. void EnvFollowerPluginGUI::cb_Decay(Fl_Knob* o, void* v)
  55. { ((EnvFollowerPluginGUI*)(o->parent()))->cb_Decay_i(o,v);}
  56. inline void EnvFollowerPluginGUI::cb_Attack_i(Fl_Knob* o, void* v)
  57. { m_GUICH->Set("Attack",o->value()); }
  58. void EnvFollowerPluginGUI::cb_Attack(Fl_Knob* o, void* v)
  59. { ((EnvFollowerPluginGUI*)(o->parent()))->cb_Attack_i(o,v);}
  60. const string EnvFollowerPluginGUI::GetHelpText(const string &loc){
  61. return string("")
  62. + "The Envelope Follower takes an audio signal input and\n"
  63. + "attempts to recreate the envelope that shaped it. This\n"
  64. + "is particually useful for extracting information from\n"
  65. + "samples, for use in a vocoder for example.\n"
  66. + "\n"
  67. + "The sensitivity of the EnvFollower can be set with the\n"
  68. + "Attack and Decay controls on the plugin window.\n";
  69. }