RemoveNotes.hpp
1 #pragma once
2 #include <Midi/Commands/CommandFactory.hpp>
3 #include <Midi/MidiNote.hpp>
4 
5 #include <score/model/path/Path.hpp>
6 
7 #include <QPair>
8 #include <QVector>
9 
10 namespace Midi
11 {
12 class ProcessModel;
13 
14 class RemoveNotes final : public score::Command
15 {
16  SCORE_COMMAND_DECL(Midi::CommandFactoryName(), RemoveNotes, "Remove notes")
17 public:
18  RemoveNotes(const ProcessModel& model, const std::vector<Id<Note>>& to_move);
19 
20  void undo(const score::DocumentContext& ctx) const override;
21  void redo(const score::DocumentContext& ctx) const override;
22 
23 protected:
24  void serializeImpl(DataStreamInput& s) const override;
25  void deserializeImpl(DataStreamOutput& s) override;
26 
27 private:
28  Path<ProcessModel> m_model;
29  std::vector<std::pair<Id<Note>, NoteData>> m_notes;
30 };
31 }
Definition: MidiProcess.hpp:15
Definition: RemoveNotes.hpp:15
The id_base_t class.
Definition: Identifier.hpp:57
The Command class.
Definition: Command.hpp:34
Definition: DataStreamHelpers.hpp:99
Definition: DataStreamHelpers.hpp:103
Definition: MidiNote.hpp:11
Definition: DocumentContext.hpp:18