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.

63 lines
2.0KB

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