diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-16 16:58:50 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-16 16:58:50 +0000 |
commit | a668964d5c07c8edf6fc0036fd927eb74f4b1546 (patch) | |
tree | 5557b7b357fe3e659a53a97f5aff4906bdb0d8cb /libs/ardour/midi_model.cc | |
parent | bb34b15944ff24ca703a13daac861d7d4377276b (diff) |
avoid needless errors when redoing an operation involving adding notes that were not added because of overlap exclusion preferences
git-svn-id: svn://localhost/ardour2/branches/3.0@7264 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/midi_model.cc')
-rw-r--r-- | libs/ardour/midi_model.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc index bac630bb14..bdf0516dea 100644 --- a/libs/ardour/midi_model.cc +++ b/libs/ardour/midi_model.cc @@ -232,7 +232,12 @@ MidiModel::DiffCommand::operator()() MidiModel::WriteLock lock(_model->edit_lock()); for (NoteList::iterator i = _added_notes.begin(); i != _added_notes.end(); ++i) { - _model->add_note_unlocked(*i); + if (!_model->add_note_unlocked(*i)) { + /* failed to add it, so don't leave it in the removed list, to + avoid apparent errors on undo. + */ + _removed_notes.remove (*i); + } } for (NoteList::iterator i = _removed_notes.begin(); i != _removed_notes.end(); ++i) { |