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.

72 lines
2.6KB

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