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.

73 lines
2.3KB

  1. /* SpiralSound
  2. * Copyleft (C) 2001 David Griffiths <dave@pawfal.org>
  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. #include "../Widgets/Fl_EventMap.h"
  21. #ifndef SeqPLUGIN
  22. #define SeqPLUGIN
  23. const int NUM_PATTERNS = 16;
  24. class SeqPlugin : public SpiralPlugin
  25. {
  26. public:
  27. SeqPlugin();
  28. virtual ~SeqPlugin();
  29. virtual PluginInfo &Initialise(const HostInfo *Host);
  30. virtual SpiralGUIType *CreateGUI();
  31. virtual void Execute();
  32. virtual void StreamOut(std::ostream &s);
  33. virtual void StreamIn(std::istream &s);
  34. // has to be defined in the plugin
  35. virtual void UpdateGUI() { Fl::check(); }
  36. void SetEventMap(int n, Fl_EventMap* s) { m_Eventmap[n]=s; }
  37. Fl_EventMap* GetEventMap(int n) { return m_Eventmap[n]; }
  38. void SetUpdate(bool s) { m_Eventmap[m_CurrentPattern]->SetUpdate(s); }
  39. void SetZoom(float s) { m_Eventmap[m_CurrentPattern]->SetZoomLevel(s); }
  40. void SetNoteCut(bool s) { m_NoteCut=s; }
  41. bool GetNoteCut() { return m_NoteCut; }
  42. void SetEndTime(float s) { m_Eventmap[m_CurrentPattern]->SetEndTime(s); m_Length=s; }
  43. void SetSpeed(float s) { m_SpeedMod=s; }
  44. void ClearAll() { m_Eventmap[m_CurrentPattern]->RemoveAllEvents(); }
  45. void SetPattern(int s);
  46. int GetCurrentPattern() { return m_CurrentPattern; }
  47. private:
  48. Fl_EventMap* m_Eventmap[NUM_PATTERNS];
  49. float m_Time;
  50. float m_Length;
  51. bool m_Loop;
  52. bool m_NoteCut;
  53. float m_SpeedMod;
  54. float m_CurrentNoteCV;
  55. float m_CurrentTriggerCV;
  56. bool m_InNoteDown;
  57. int m_InNoteID;
  58. float m_InNoteTime;
  59. int m_CurrentPattern;
  60. bool m_Triggered;
  61. };
  62. #endif