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.2KB

  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 "TranslatePluginGUI.h"
  19. #include <FL/fl_draw.h>
  20. using namespace std;
  21. ////////////////////////////////////////////
  22. TranslatePluginGUI::TranslatePluginGUI (int w, int h,TranslatePlugin *o,ChannelHandler *ch,const HostInfo *Info) :
  23. SpiralPluginGUI (w, h, o, ch)
  24. {
  25. m_Method = new Fl_Choice (0, 20, 150, 20, "");
  26. //m_Method->color (Info->GUI_COLOUR);
  27. m_Method->box (FL_PLASTIC_UP_BOX);
  28. m_Method->textsize (10);
  29. m_Method->labelsize (10);
  30. m_Method->callback ((Fl_Callback*) cb_Method);
  31. m_Method->add ("Pass Through");
  32. m_Method->add ("Note -> Frequency");
  33. m_Method->add ("Frequency -> Note");
  34. m_Method->add ("Note -> Note Number");
  35. m_Method->add ("Note Number -> Note");
  36. m_Method->value (0);
  37. add (m_Method);
  38. end ();
  39. }
  40. void TranslatePluginGUI::UpdateValues (SpiralPlugin *o) {
  41. TranslatePlugin *Plugin = (TranslatePlugin *)o;
  42. m_Method->value (Plugin->GetMethod ());
  43. }
  44. inline void TranslatePluginGUI::cb_Method_i (Fl_Choice *o, void *v) {
  45. m_GUICH->Set ("Method", int (o->value ()));
  46. m_GUICH->SetCommand (TranslatePlugin::SETMETHOD);
  47. }
  48. void TranslatePluginGUI::cb_Method (Fl_Choice *o, void *v) {
  49. ((TranslatePluginGUI*)(o->parent ()))->cb_Method_i (o, v);
  50. }
  51. const string TranslatePluginGUI::GetHelpText (const string &loc) {
  52. return string("")
  53. + "Translates control voltages into other formats.";
  54. }