summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_track.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-10-31 21:17:08 +0000
committerCarl Hetherington <carl@carlh.net>2011-10-31 21:17:08 +0000
commit5dba72c874def27bef3ba3fe7a5cf2414e77aadb (patch)
treed4a41d2aca384122422d72a850b19ef46627488e /libs/ardour/midi_track.cc
parentd47e9247dfba27d198b8a0c43cef5553fc40745d (diff)
Take commit() out of process() in both types of
diskstream, and call commit() where appropriate. git-svn-id: svn://localhost/ardour2/branches/3.0@10361 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/midi_track.cc')
-rw-r--r--libs/ardour/midi_track.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc
index dcea38521b..238e616a4f 100644
--- a/libs/ardour/midi_track.cc
+++ b/libs/ardour/midi_track.cc
@@ -279,14 +279,13 @@ MidiTrack::set_state_part_two ()
}
int
-MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& needs_butler)
+MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler)
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
if (!lm.locked()) {
return 0;
}
- int dret;
boost::shared_ptr<MidiDiskstream> diskstream = midi_diskstream();
automation_snapshot (start_frame);
@@ -302,17 +301,23 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame
framepos_t transport_frame = _session.transport_frame();
+ int dret;
+ framecnt_t playback_distance;
+
if ((nframes = check_initial_delay (nframes, transport_frame)) == 0) {
/* need to do this so that the diskstream sets its
playback distance to zero, thus causing diskstream::commit
to do nothing.
*/
- return diskstream->process (transport_frame, 0, needs_butler);
+ dret = diskstream->process (transport_frame, 0, playback_distance);
+ need_butler = diskstream->commit (playback_distance);
+ return dret;
}
_silent = false;
- if ((dret = diskstream->process (transport_frame, nframes, needs_butler)) != 0) {
+ if ((dret = diskstream->process (transport_frame, nframes, playback_distance)) != 0) {
+ need_butler = diskstream->commit (playback_distance);
silence (nframes);
return dret;
}
@@ -373,6 +378,8 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame
}
}
+ need_butler = diskstream->commit (playback_distance);
+
return 0;
}