From 761488e547a750907e70573216ea71f0c6789365 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 28 Nov 2010 19:28:21 +0000 Subject: [PATCH] initialize rec-enable controllable after setting MidiTrack's diskstream (see comment for why) git-svn-id: svn://localhost/ardour2/branches/3.0@8118 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/midi_track.cc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index e31fae9141..6e4f07cf15 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -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 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 ds (new MidiDiskstream (_session, *child)); - ds->do_refill_with_alloc (); - set_diskstream (ds); - } - } - pending_state = const_cast (&node); if (_session.state_of_the_state() & Session::Loading) {