diff options
Diffstat (limited to 'libs/ardour/midi_model.cc')
-rw-r--r-- | libs/ardour/midi_model.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc index e86b229c71..4c6f6633d5 100644 --- a/libs/ardour/midi_model.cc +++ b/libs/ardour/midi_model.cc @@ -786,6 +786,10 @@ MidiModel::SysExDiffCommand::operator() () { MidiModel::WriteLock lock (_model->edit_lock ()); + for (list<SysExPtr>::iterator i = _removed.begin(); i != _removed.end(); ++i) { + _model->remove_sysex_unlocked (*i); + } + for (ChangeList::iterator i = _changes.begin(); i != _changes.end(); ++i) { switch (i->property) { case Time: @@ -803,6 +807,10 @@ MidiModel::SysExDiffCommand::undo () { MidiModel::WriteLock lock (_model->edit_lock ()); + for (list<SysExPtr>::iterator i = _removed.begin(); i != _removed.end(); ++i) { + _model->add_sysex_unlocked (*i); + } + for (ChangeList::iterator i = _changes.begin(); i != _changes.end(); ++i) { switch (i->property) { case Time: @@ -816,6 +824,12 @@ MidiModel::SysExDiffCommand::undo () _model->ContentsChanged(); /* EMIT SIGNAL */ } +void +MidiModel::SysExDiffCommand::remove (SysExPtr sysex) +{ + _removed.push_back(sysex); +} + XMLNode& MidiModel::SysExDiffCommand::marshal_change (const Change& change) { |