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.

61 lines
1.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 "BeatMatchPluginGUI.h"
  19. #include <FL/fl_draw.h>
  20. #include <FL/fl_draw.H>
  21. using namespace std;
  22. ////////////////////////////////////////////
  23. BeatMatchPluginGUI::BeatMatchPluginGUI(int w, int h,BeatMatchPlugin *o,ChannelHandler *ch,const HostInfo *Info) :
  24. SpiralPluginGUI(w,h,o,ch)
  25. {
  26. m_Sense = new Fl_Knob (15, 15, 50, 50, "Sensitivity");
  27. m_Sense->color(Info->GUI_COLOUR);
  28. m_Sense->labelsize(8);
  29. m_Sense->callback((Fl_Callback*)cb_Sense);
  30. end();
  31. }
  32. void BeatMatchPluginGUI::UpdateValues(SpiralPlugin *o)
  33. {
  34. BeatMatchPlugin* Plugin = (BeatMatchPlugin*)o;
  35. m_Sense->value(Plugin->GetSensitivity());
  36. }
  37. //// Callbacks ////
  38. inline void BeatMatchPluginGUI::cb_Sense_i(Fl_Knob* o, void* v)
  39. {
  40. m_GUICH->Set("Sensitivity",(float)o->value());
  41. }
  42. void BeatMatchPluginGUI::cb_Sense(Fl_Knob* o, void* v)
  43. { ((BeatMatchPluginGUI*)(o->parent()))->cb_Sense_i(o,v);}
  44. const string BeatMatchPluginGUI::GetHelpText(const string &loc){
  45. return string("")
  46. + "Produces an output pulse that slowly syncs to the input pulses,\n"
  47. + "the sensitivity sets the time it takes to sync up.\n"
  48. + "Can be used to transition between different tempo speeds and\n"
  49. + "other stuff";
  50. }