initialize rec-enable controllable after setting MidiTrack's diskstream (see comment...
authorPaul Davis <paul@linuxaudiosystems.com>
Sun, 28 Nov 2010 19:28:21 +0000 (19:28 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sun, 28 Nov 2010 19:28:21 +0000 (19:28 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8118 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/midi_track.cc

index e31fae91411b9cce62573ae828e68a0c9d438fa8..6e4f07cf15c23bbfc432c700ed8283bf44e43333 100644 (file)
@@ -156,6 +156,19 @@ MidiTrack::_set_state (const XMLNode& node, int version, bool call_base)
        XMLNode *child;
 
        nlist = node.children();
+
+       if (version >= 3000) {
+               if ((child = find_named_node (node, X_("Diskstream"))) != 0) {
+                       boost::shared_ptr<MidiDiskstream> ds (new MidiDiskstream (_session, *child));
+                       ds->do_refill_with_alloc ();
+                       set_diskstream (ds);
+               }
+       }
+
+        /* set rec-enable control *AFTER* setting up diskstream, because it may want to operate
+           on the diskstream as it sets its own state
+        */
+
        for (niter = nlist.begin(); niter != nlist.end(); ++niter){
                child = *niter;
 
@@ -166,14 +179,6 @@ MidiTrack::_set_state (const XMLNode& node, int version, bool call_base)
                 }
        }
 
-       if (version >= 3000) {
-               if ((child = find_named_node (node, X_("Diskstream"))) != 0) {
-                       boost::shared_ptr<MidiDiskstream> ds (new MidiDiskstream (_session, *child));
-                       ds->do_refill_with_alloc ();
-                       set_diskstream (ds);
-               }
-       }
-
        pending_state = const_cast<XMLNode*> (&node);
 
        if (_session.state_of_the_state() & Session::Loading) {