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