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.

101 lines
2.5KB

  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. #include <list>
  22. #ifndef SequencerPLUGIN
  23. #define SequencerPLUGIN
  24. const int NUM_PATTERNS = 16;
  25. class Track
  26. {
  27. public:
  28. class Sequence
  29. {
  30. public:
  31. class Pattern
  32. {
  33. public:
  34. class Note
  35. {
  36. public:
  37. float time;
  38. int note;
  39. float vol;
  40. };
  41. map<int,Note> m_NoteMap;
  42. };
  43. float m_StartTime;
  44. int m_Pattern;
  45. };
  46. map<int,Sequence::Pattern> m_PatternMap;
  47. list<Sequence> m_SequenceList;
  48. };
  49. class SequencerPlugin : public SpiralPlugin
  50. {
  51. public:
  52. SequencerPlugin();
  53. virtual ~SequencerPlugin();
  54. virtual PluginInfo &Initialise(const HostInfo *Host);
  55. virtual SpiralGUIType *CreateGUI();
  56. virtual void Execute();
  57. virtual void ExecuteCommands();
  58. virtual void StreamOut(ostream &s);
  59. virtual void StreamIn(istream &s);
  60. bool GetNoteCut() { return m_NoteCut; }
  61. void ClearAll() { /*m_Eventmap[m_CurrentPattern]->RemoveAllEvents();*/ }
  62. int GetCurrentPattern() { return m_CurrentPattern; }
  63. private:
  64. Track m_Track;
  65. void SetEventMap(int n, Fl_EventMap* s) { /*m_Eventmap[n]=s;*/ }
  66. void SetUpdate(bool s) { /*m_Eventmap[m_CurrentPattern]->SetUpdate(s);*/ }
  67. void SetZoom(float s) { /*m_Eventmap[m_CurrentPattern]->SetZoomLevel(s);*/ }
  68. void SetNoteCut(bool s) { m_NoteCut=s; }
  69. void SetEndTime(float s) { /*m_Eventmap[m_CurrentPattern]->SetEndTime(s);*/ m_Length=s; }
  70. void SetSpeed(float s) { m_SpeedMod=s; }
  71. void SetPattern(int s);
  72. float m_Time;
  73. float m_Length;
  74. bool m_Loop;
  75. bool m_NoteCut;
  76. float m_SpeedMod;
  77. float m_CurrentNoteCV;
  78. float m_CurrentTriggerCV;
  79. bool m_InNoteDown;
  80. int m_InNoteID;
  81. float m_InNoteTime;
  82. int m_CurrentPattern;
  83. bool m_Triggered;
  84. };
  85. #endif