Fix non-summon of butler when a track that needs it is followed by a track that does...
authorCarl Hetherington <carl@carlh.net>
Mon, 30 Jan 2012 20:58:17 +0000 (20:58 +0000)
committerCarl Hetherington <carl@carlh.net>
Mon, 30 Jan 2012 20:58:17 +0000 (20:58 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@11391 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/audio_track.cc
libs/ardour/midi_track.cc
libs/ardour/session_process.cc

index 458738bddb0f93c446c4ed6faa8654fd2b41a394..e6a5b82cffe1d7fd64836ef7b284121d7629900e 100644 (file)
@@ -308,6 +308,9 @@ AudioTrack::set_state_part_two ()
        }
 }
 
+/** @param need_butler to be set to true if this track now needs the butler, otherwise it can be left alone
+ *  or set to false.
+ */
 int
 AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler)
 {
index 1b40cb5f566604df3b2fcf3ebba8f9e990a5f1f1..3d9b0f94ff279e4da0b3bbd485fc592eab4d8bb6 100644 (file)
@@ -269,6 +269,9 @@ MidiTrack::set_state_part_two ()
        return;
 }
 
+/** @param need_butler to be set to true if this track now needs the butler, otherwise it can be left alone
+ *  or set to false.
+ */
 int
 MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler)
 {
index d79e2b2c676c1f4980df19d5b19fc3cc97886245..db451432597c0f570ffbf79d098b350670bfa7d0 100644 (file)
@@ -146,6 +146,9 @@ Session::no_roll (pframes_t nframes)
        return ret;
 }
 
+/** @param need_butler to be set to true by this method if it needs the butler,
+ *  otherwise it can be left alone or set to false.
+ */
 int
 Session::process_routes (pframes_t nframes, bool& need_butler)
 {
@@ -175,16 +178,25 @@ Session::process_routes (pframes_t nframes, bool& need_butler)
 
                        (*i)->set_pending_declick (declick);
 
-                       if ((ret = (*i)->roll (nframes, start_frame, end_frame, declick, need_butler)) < 0) {
+                       bool b = false;
+
+                       if ((ret = (*i)->roll (nframes, start_frame, end_frame, declick, b)) < 0) {
                                stop_transport ();
                                return -1;
                        }
+
+                       if (b) {
+                               need_butler = true;
+                       }
                }
        }
 
        return 0;
 }
 
+/** @param need_butler to be set to true by this method if it needs the butler,
+ *  otherwise it must be left alone.
+ */
 int
 Session::silent_process_routes (pframes_t nframes, bool& need_butler)
 {
@@ -204,10 +216,16 @@ Session::silent_process_routes (pframes_t nframes, bool& need_butler)
                                continue;
                        }
 
-                       if ((ret = (*i)->silent_roll (nframes, start_frame, end_frame, need_butler)) < 0) {
+                       bool b = false;
+
+                       if ((ret = (*i)->silent_roll (nframes, start_frame, end_frame, b)) < 0) {
                                stop_transport ();
                                return -1;
                        }
+
+                       if (b) {
+                               need_butler = true;
+                       }
                }
        }