diff options
author | Carl Hetherington <carl@carlh.net> | 2010-12-09 21:36:31 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-12-09 21:36:31 +0000 |
commit | 555c7ac094d86a02b7bef85f9691cd507e19391e (patch) | |
tree | 5a4591922d749b6a00911455dabdf2bb3e661412 /libs/ardour/ardour/midi_model.h | |
parent | ad916f6241011266fea05877685376a06ec586bf (diff) |
Undo for sys-ex movements in time.
git-svn-id: svn://localhost/ardour2/branches/3.0@8232 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/midi_model.h')
-rw-r--r-- | libs/ardour/ardour/midi_model.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h index 69dc452b62..532d8c0e94 100644 --- a/libs/ardour/ardour/midi_model.h +++ b/libs/ardour/ardour/midi_model.h @@ -140,6 +140,38 @@ public: NotePtr unmarshal_note(XMLNode *xml_note); }; + /* Currently this class only supports changes of sys-ex time, but could be expanded */ + class SysexDiffCommand : public DiffCommand { + public: + SysexDiffCommand (boost::shared_ptr<MidiModel> m, const XMLNode& node); + + enum Property { + Time, + }; + + int set_state (const XMLNode&, int version); + XMLNode & get_state (); + + void operator() (); + void undo (); + + void change (boost::shared_ptr<Evoral::Event<TimeType> >, TimeType); + + private: + struct Change { + boost::shared_ptr<Evoral::Event<TimeType> > sysex; + SysexDiffCommand::Property property; + TimeType old_time; + TimeType new_time; + }; + + typedef std::list<Change> ChangeList; + ChangeList _changes; + + XMLNode & marshal_change (const Change &); + Change unmarshal_change (XMLNode *); + }; + MidiModel::NoteDiffCommand* new_note_diff_command (const std::string name="midi edit"); void apply_command (Session& session, Command* cmd); void apply_command_as_subcommand (Session& session, Command* cmd); @@ -161,6 +193,7 @@ public: boost::shared_ptr<Evoral::Note<TimeType> > find_note (NotePtr); boost::shared_ptr<Evoral::Note<TimeType> > find_note (gint note_id); + boost::shared_ptr<Evoral::Event<TimeType> > find_sysex (gint); InsertMergePolicy insert_merge_policy () const; void set_insert_merge_policy (InsertMergePolicy); |