diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-09-25 20:09:17 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-09-25 20:09:17 +0000 |
commit | 58ded03f8f5a9036e2b8263286261021eceb1ea2 (patch) | |
tree | 48891522b15d2cac93a19f11276cec7668f0739a /libs/ardour | |
parent | 129ac54a57d2e68edcea16659c169d994dfba140 (diff) |
3.X version of earlier major fix to 2.X: Route::check_initial_delay() should be virtual and do nothing for busses
git-svn-id: svn://localhost/ardour2/branches/3.0@10123 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/route.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/track.h | 2 | ||||
-rw-r--r-- | libs/ardour/route.cc | 36 | ||||
-rw-r--r-- | libs/ardour/track.cc | 37 |
4 files changed, 40 insertions, 37 deletions
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 34ecffa29c..66464e4457 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -414,7 +414,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, virtual void set_block_size (pframes_t nframes); protected: - framecnt_t check_initial_delay (framecnt_t, framecnt_t&); + virtual framecnt_t check_initial_delay (framecnt_t nframes, framecnt_t&) { return nframes; } void passthru (framepos_t start_frame, framepos_t end_frame, pframes_t nframes, int declick); diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index d245977978..6e7d9ae1e5 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -208,6 +208,8 @@ class Track : public Route, public PublicDiskstream virtual bool send_silence () const; boost::shared_ptr<RecEnableControllable> _rec_enable_control; + + framecnt_t check_initial_delay (framecnt_t nframes, framecnt_t&); private: void diskstream_playlist_changed (); diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 11f510126a..e64f21636c 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -2801,42 +2801,6 @@ Route::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, return 0; } -framecnt_t -Route::check_initial_delay (framecnt_t nframes, framecnt_t& transport_frame) -{ - if (_roll_delay > nframes) { - - _roll_delay -= nframes; - silence_unlocked (nframes); - /* transport frame is not legal for caller to use */ - return 0; - - } else if (_roll_delay > 0) { - - nframes -= _roll_delay; - silence_unlocked (_roll_delay); - transport_frame += _roll_delay; - - /* shuffle all the port buffers for things that lead "out" of this Route - to reflect that we just wrote _roll_delay frames of silence. - */ - - Glib::RWLock::ReaderLock lm (_processor_lock); - for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { - boost::shared_ptr<IOProcessor> iop = boost::dynamic_pointer_cast<IOProcessor> (*i); - if (iop) { - iop->increment_port_buffer_offset (_roll_delay); - } - } - _output->increment_port_buffer_offset (_roll_delay); - - _roll_delay = 0; - - } - - return nframes; -} - int Route::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool /*can_record*/, bool& /* need_butler */) diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index 6cbcc08714..4f682085b2 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -693,3 +693,40 @@ Track::maybe_declick (BufferSet& bufs, framecnt_t nframes, int declick) Amp::declick (bufs, nframes, declick); } } + +framecnt_t +Track::check_initial_delay (framecnt_t nframes, framecnt_t& transport_frame) +{ + if (_roll_delay > nframes) { + + _roll_delay -= nframes; + silence_unlocked (nframes); + /* transport frame is not legal for caller to use */ + return 0; + + } else if (_roll_delay > 0) { + + nframes -= _roll_delay; + silence_unlocked (_roll_delay); + transport_frame += _roll_delay; + + /* shuffle all the port buffers for things that lead "out" of this Route + to reflect that we just wrote _roll_delay frames of silence. + */ + + Glib::RWLock::ReaderLock lm (_processor_lock); + for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { + boost::shared_ptr<IOProcessor> iop = boost::dynamic_pointer_cast<IOProcessor> (*i); + if (iop) { + iop->increment_port_buffer_offset (_roll_delay); + } + } + _output->increment_port_buffer_offset (_roll_delay); + + _roll_delay = 0; + + } + + return nframes; +} + |