fix another semantically-significant statement buried in an assert() macro
[ardour.git] / libs / ardour / midi_model.cc
index a914a0d8873f55942942d93db825c600a9b6737f..4c6f6633d5e2a7ec90cd2dc3f3822f198f2d43ac 100644 (file)
@@ -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)
 {
@@ -1555,7 +1569,7 @@ MidiModel::edit_lock()
        boost::shared_ptr<MidiSource> ms = _midi_source.lock ();
        assert (ms);
 
-       Glib::Mutex::Lock* source_lock = new Glib::Mutex::Lock (ms->mutex());
+       Glib::Threads::Mutex::Lock* source_lock = new Glib::Threads::Mutex::Lock (ms->mutex());
        ms->invalidate(); // Release cached iterator's read lock on model
        return WriteLock(new WriteLockImpl(source_lock, _lock, _control_lock));
 }
@@ -1807,7 +1821,7 @@ MidiModel::set_midi_source (boost::shared_ptr<MidiSource> s)
 void
 MidiModel::source_interpolation_changed (Evoral::Parameter p, Evoral::ControlList::InterpolationStyle s)
 {
-       Glib::Mutex::Lock lm (_control_lock);
+       Glib::Threads::Mutex::Lock lm (_control_lock);
        control(p)->list()->set_interpolation (s);
 }
 
@@ -1826,7 +1840,7 @@ MidiModel::control_list_interpolation_changed (Evoral::Parameter p, Evoral::Cont
 void
 MidiModel::source_automation_state_changed (Evoral::Parameter p, AutoState s)
 {
-       Glib::Mutex::Lock lm (_control_lock);
+       Glib::Threads::Mutex::Lock lm (_control_lock);
        boost::shared_ptr<AutomationList> al = boost::dynamic_pointer_cast<AutomationList> (control(p)->list ());
        al->set_automation_state (s);
 }