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.

68 lines
2.5KB

  1. /* SpiralPlugin
  2. * Copyleft (C) 2003 Andy Preston <andy@clublinux.co.uk>
  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 "TransposePluginGUI.h"
  19. #include <FL/fl_draw.h>
  20. ////////////////////////////////////////////
  21. TransposePluginGUI::TransposePluginGUI (int w, int h,TransposePlugin *o,ChannelHandler *ch,const HostInfo *Info) :
  22. SpiralPluginGUI (w, h, o, ch)
  23. {
  24. m_Amount = new Fl_Counter (10, 20, 50, 20, "Amount");
  25. m_Amount->color (Info->GUI_COLOUR);
  26. m_Amount->type (FL_SIMPLE_COUNTER);
  27. m_Amount->box (FL_PLASTIC_UP_BOX);
  28. m_Amount->color (Info->GUI_COLOUR);
  29. m_Amount->textsize (10);
  30. m_Amount->labelsize (10);
  31. m_Amount->step (1);
  32. m_Amount->lstep (1);
  33. m_Amount->minimum (-12);
  34. m_Amount->maximum (12);
  35. m_Amount->value (0);
  36. m_Amount->callback ((Fl_Callback*) cb_Amount);
  37. add (m_Amount);
  38. end ();
  39. }
  40. void TransposePluginGUI::UpdateValues (SpiralPlugin *o) {
  41. TransposePlugin *Plugin = (TransposePlugin *)o;
  42. m_Amount->value (Plugin->GetAmount ());
  43. }
  44. inline void TransposePluginGUI::cb_Amount_i (Fl_Counter* o, void* v) {
  45. m_GUICH->Set ("Amount", int (o->value ()));
  46. }
  47. void TransposePluginGUI::cb_Amount (Fl_Counter* o, void* v) {
  48. ((TransposePluginGUI*)(o->parent ()))->cb_Amount_i (o, v);
  49. }
  50. const string TransposePluginGUI::GetHelpText (const string &loc) {
  51. return string("")
  52. + "The first input connects to a note CV from (e.g.) a Matrix.\n"
  53. + "The second input can be connected to (e.g.) a Keyboard, to\n"
  54. + "transpose the sequence up by the number of notes indicated\n"
  55. + "by the key.\n\n"
  56. + "If you use both inputs the 'Amount' value is ignored.\n"
  57. + "With only one input connected the 'Amount' value lets you\n"
  58. + "transpose the input up or down by the indicated number of\n"
  59. + "notes.";
  60. }