diff options
author | Carl Hetherington <carl@carlh.net> | 2011-10-31 21:16:54 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-10-31 21:16:54 +0000 |
commit | 9afd18358b2a6dff8315e7c592a091e514a7661f (patch) | |
tree | c0bbea750e8dfaabf8e0a06f02f2bde2ad7fa6d9 /libs/ardour/audio_diskstream.cc | |
parent | 4978c0d4c63bba054181cc0988fd83bc5fa8c9eb (diff) |
Remove Diskstream member playback_distance that can be
passed directly from process() to commit().
git-svn-id: svn://localhost/ardour2/branches/3.0@10359 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audio_diskstream.cc')
-rw-r--r-- | libs/ardour/audio_diskstream.cc | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index 4588522ab4..77c0ac9432 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -426,7 +426,7 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool& n bool collect_playback = false; bool can_record = _session.actively_recording (); - playback_distance = 0; + framecnt_t playback_distance = 0; if (!_io || !_io->active()) { return 0; @@ -643,7 +643,19 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool& n } if (rec_nframes == 0 && _actual_speed != 1.0f && _actual_speed != -1.0f) { - process_varispeed_playback(nframes, c); + + interpolation.set_speed (_target_speed); + + int channel = 0; + for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan, ++channel) { + ChannelInfo* chaninfo (*chan); + + playback_distance = interpolation.interpolate ( + channel, nframes, chaninfo->current_playback_buffer, chaninfo->speed_buffer); + + chaninfo->current_playback_buffer = chaninfo->speed_buffer; + } + } else { playback_distance = nframes; } @@ -653,7 +665,7 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool& n ret = 0; - if (commit (nframes)) { + if (commit (playback_distance)) { need_butler = true; } @@ -661,26 +673,8 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool& n return ret; } -void -AudioDiskstream::process_varispeed_playback (pframes_t nframes, boost::shared_ptr<ChannelList> c) -{ - ChannelList::iterator chan; - - interpolation.set_speed (_target_speed); - - int channel = 0; - for (chan = c->begin(); chan != c->end(); ++chan, ++channel) { - ChannelInfo* chaninfo (*chan); - - playback_distance = interpolation.interpolate ( - channel, nframes, chaninfo->current_playback_buffer, chaninfo->speed_buffer); - - chaninfo->current_playback_buffer = chaninfo->speed_buffer; - } -} - bool -AudioDiskstream::commit (framecnt_t /* nframes */) +AudioDiskstream::commit (framecnt_t playback_distance) { bool need_butler = false; |