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.

48 lines
1.0KB

  1. #pragma once
  2. #include "MidiEditor.h"
  3. #include "MidiSelectionModel.h"
  4. #include "MidiSong.h"
  5. #include "MidiEditorContext.h"
  6. #include "UndoRedoStack.h"
  7. #include <memory>
  8. class MidiSong;
  9. class MidiSequencer;
  10. using MidiSequencerPtr = std::shared_ptr<MidiSequencer>;
  11. /**
  12. * Despite the fancy name, this class doesn't do much.
  13. * It holds all the other modules that make up a sequencer.
  14. * It knows how to create all the objects and hook them up.
  15. */
  16. class MidiSequencer : public std::enable_shared_from_this<MidiSequencer>
  17. {
  18. public:
  19. /** constructor takes a song to edit
  20. */
  21. MidiSequencer(std::shared_ptr<MidiSong>);
  22. /**
  23. * must be called to make constructor
  24. * todo: memory leak for circular ref
  25. */
  26. void makeEditor();
  27. ~MidiSequencer();
  28. void assertValid() const;
  29. /** The various classes we collect
  30. */
  31. MidiSelectionModelPtr const selection;
  32. MidiSongPtr const song;
  33. MidiEditorContextPtr context;
  34. MidiEditorPtr editor;
  35. UndoRedoStackPtr undo;
  36. private:
  37. void assertSelectionInTrack() const;
  38. };