Merging undo branch into trunk. It compiles and works for limited tests. Keep
[ardour.git] / libs / ardour / session_midi.cc
index 5d513de2fc83dfd36f9b498ecf90ba6777f05503..821f894eeb1f4cb64d803c87c90c896c1e1fa16f 100644 (file)
@@ -776,12 +776,12 @@ Session::mmc_record_enable (MIDI::MachineControl &mmc, size_t trk, bool enabled)
        if (mmc_control) {
 
                RouteList::iterator i;
-               Glib::RWLock::ReaderLock guard (route_lock);
+               boost::shared_ptr<RouteList> r = routes.reader();
                
-               for (i = routes.begin(); i != routes.end(); ++i) {
+               for (i = r->begin(); i != r->end(); ++i) {
                        AudioTrack *at;
 
-                       if ((at = dynamic_cast<AudioTrack*>(*i)) != 0) {
+                       if ((at = dynamic_cast<AudioTrack*>((*i).get())) != 0) {
                                if (trk == at->remote_control_id()) {
                                        at->set_record_enable (enabled, &mmc);
                                        break;