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.

79 lines
2.3KB

  1. /* SpiralSound
  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 "../SpiralPlugin.h"
  19. #include <FL/Fl_Pixmap.H>
  20. #ifndef TranslatePLUGIN
  21. #define TranslatePLUGIN
  22. class TranslatePlugin;
  23. class TranslateClass {
  24. public:
  25. virtual float Translate (float i) = 0;
  26. };
  27. class TranslatePass : public TranslateClass {
  28. public:
  29. virtual float Translate (float i);
  30. };
  31. class TranslateNoteToFreq : public TranslateClass {
  32. public:
  33. virtual float Translate (float i);
  34. };
  35. class TranslateFreqToNote : public TranslateClass {
  36. public:
  37. virtual float Translate (float i);
  38. };
  39. class TranslateNoteToVolt : public TranslateClass {
  40. public:
  41. virtual float Translate (float i);
  42. };
  43. class TranslateVoltToNote : public TranslateClass {
  44. public:
  45. virtual float Translate (float i);
  46. };
  47. ////////////////////////////////////////////////////////////////////////
  48. class TranslatePlugin : public SpiralPlugin {
  49. public:
  50. TranslatePlugin();
  51. virtual ~TranslatePlugin ();
  52. virtual PluginInfo& Initialise (const HostInfo *Host);
  53. virtual SpiralGUIType* CreateGUI ();
  54. virtual void Execute ();
  55. enum GUICommands { NOCMD, SETMETHOD };
  56. virtual void ExecuteCommands ();
  57. virtual void StreamOut (std::ostream &s);
  58. virtual void StreamIn (std::istream &s);
  59. enum TranMethod { tr_Pass, tr_NoteToFreq, tr_FreqToNote, tr_NoteToVolt, tr_VoltToNote };
  60. int GetMethod (void) { return m_Method; }
  61. private:
  62. int m_Method;
  63. TranslateClass *m_Translator;
  64. void SetUpTranslatorClass (void);
  65. };
  66. #endif