diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-04-17 11:12:38 +0100 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-09-18 11:40:53 -0400 |
commit | 2a1dccabc9e66a1c3a6268f40f5bac345a1f89d1 (patch) | |
tree | ba468177f000542891c35c9836c5b6a0b99d8124 /libs/ardour/disk_io.cc | |
parent | fe8c70e6fc864db4950ad03bad14071dfdecbefc (diff) |
get diskreader working, and remove per-track varispeed API and mechanism
Diffstat (limited to 'libs/ardour/disk_io.cc')
-rw-r--r-- | libs/ardour/disk_io.cc | 40 |
1 files changed, 9 insertions, 31 deletions
diff --git a/libs/ardour/disk_io.cc b/libs/ardour/disk_io.cc index 4acbc49057..5b81e2a161 100644 --- a/libs/ardour/disk_io.cc +++ b/libs/ardour/disk_io.cc @@ -49,9 +49,7 @@ DiskIOProcessor::DiskIOProcessor (Session& s, string const & str, Flag f) : Processor (s, str) , _flags (f) , i_am_the_modifier (false) - , _visible_speed (0.0) , _actual_speed (0.0) - , _speed (0.0) , _target_speed (0.0) , _buffer_reallocation_required (false) , _seek_required (false) @@ -170,11 +168,7 @@ DiskIOProcessor::configure_io (ChanCount in, ChanCount out) midi_interpolation.add_channel_to (0,0); } - if (speed() != 1.0f || speed() != -1.0f) { - seek ((framepos_t) (_session.transport_frame() * (double) speed())); - } else { - seek (_session.transport_frame()); - } + seek (_session.transport_frame()); return Processor::configure_io (in, out); } @@ -206,11 +200,7 @@ DiskIOProcessor::non_realtime_locate (framepos_t location) { /* now refill channel buffers */ - if (speed() != 1.0f || speed() != -1.0f) { - seek ((framepos_t) (location * (double) speed()), true); - } else { - seek (location, true); - } + seek (location, true); } void @@ -221,39 +211,27 @@ DiskIOProcessor::non_realtime_set_speed () } if (_seek_required) { - if (speed() != 1.0f || speed() != -1.0f) { - seek ((framepos_t) (_session.transport_frame() * (double) speed()), true); - } - else { - seek (_session.transport_frame(), true); - } - + seek (_session.transport_frame(), true); _seek_required = false; } } bool -DiskIOProcessor::realtime_set_speed (double sp, bool global) +DiskIOProcessor::realtime_set_speed (double new_speed, bool global) { bool changed = false; - double new_speed = sp * _session.transport_speed(); - if (_visible_speed != sp) { - _visible_speed = sp; - changed = true; - } + DEBUG_TRACE (DEBUG::Transport, string_compose ("%1 will run at %2\n", name(), new_speed)); - if (new_speed != _actual_speed) { + if (_target_speed != new_speed) { + _target_speed = new_speed; + changed = true; - framecnt_t required_wrap_size = (framecnt_t) ceil (_session.get_block_size() * - fabs (new_speed)) + 2; + framecnt_t required_wrap_size = (framecnt_t) ceil (_session.get_block_size() * fabs (new_speed)) + 2; if (required_wrap_size > wrap_buffer_size) { _buffer_reallocation_required = true; } - - _actual_speed = new_speed; - _target_speed = fabs(_actual_speed); } if (changed) { |