diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2020-05-13 18:51:18 -0600 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2020-05-13 18:52:29 -0600 |
commit | 7232ac2f671220f7f6a971727b02635b4b387582 (patch) | |
tree | 2b411f00b06b7a54d5622b1c61b7e2b866ebcf2d | |
parent | abbcc755c1afc597df345a7d15a050ce8342027e (diff) |
update DiskReader loop delick objects when loop changes
-rw-r--r-- | libs/ardour/ardour/session.h | 5 | ||||
-rw-r--r-- | libs/ardour/enums.cc | 1 | ||||
-rw-r--r-- | libs/ardour/session_butler.cc | 6 | ||||
-rw-r--r-- | libs/ardour/session_transport.cc | 8 |
4 files changed, 15 insertions, 5 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index a54166937e..7de5fea92d 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1169,7 +1169,8 @@ public: PostTransportReverse = 0x40, PostTransportClearSubstate = 0x80, PostTransportAdjustPlaybackBuffering = 0x100, - PostTransportAdjustCaptureBuffering = 0x200 + PostTransportAdjustCaptureBuffering = 0x200, + PostTransportLoopChanged = 0x400 }; boost::shared_ptr<SessionPlaylists> playlists () const { return _playlists; } @@ -1764,7 +1765,7 @@ private: void non_realtime_set_speed (); void non_realtime_locate (); void non_realtime_stop (bool abort, int entry_request_count, bool& finished); - void non_realtime_overwrite (int entry_request_count, bool& finished); + void non_realtime_overwrite (int entry_request_count, bool& finished, bool reset_loop_declicks); void engine_halted (); void engine_running (); void xrun_recovery (); diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc index 3dc0d3122a..9fe3030794 100644 --- a/libs/ardour/enums.cc +++ b/libs/ardour/enums.cc @@ -482,6 +482,7 @@ setup_enum_writer () REGISTER_CLASS_ENUM (Session, PostTransportClearSubstate); REGISTER_CLASS_ENUM (Session, PostTransportAdjustPlaybackBuffering); REGISTER_CLASS_ENUM (Session, PostTransportAdjustCaptureBuffering); + REGISTER_CLASS_ENUM (Session, PostTransportLoopChanged); REGISTER_BITS (_Session_PostTransportWork); REGISTER_CLASS_ENUM (Session, Clean); diff --git a/libs/ardour/session_butler.cc b/libs/ardour/session_butler.cc index a682eff599..1149cd81c3 100644 --- a/libs/ardour/session_butler.cc +++ b/libs/ardour/session_butler.cc @@ -111,7 +111,11 @@ Session::overwrite_some_buffers (boost::shared_ptr<Route> r, OverwriteReason why foreach_track (&Track::set_pending_overwrite, why); } - add_post_transport_work (PostTransportOverWrite); + if (why == LoopChanged) { + add_post_transport_work (PostTransportWork (PostTransportOverWrite|PostTransportLoopChanged)); + } else { + add_post_transport_work (PostTransportOverWrite); + } _butler->schedule_transport_work (); } diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 2f3c2e44f3..a5e8f3ea7f 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -1183,7 +1183,7 @@ Session::butler_transport_work () } if (ptw & PostTransportOverWrite) { - non_realtime_overwrite (on_entry, finished); + non_realtime_overwrite (on_entry, finished, (ptw & PostTransportLoopChanged)); if (!finished) { g_atomic_int_dec_and_test (&_butler->should_do_transport_work); goto restart; @@ -1200,8 +1200,12 @@ Session::butler_transport_work () } void -Session::non_realtime_overwrite (int on_entry, bool& finished) +Session::non_realtime_overwrite (int on_entry, bool& finished, bool update_loop_declicks) { + if (update_loop_declicks) { + DiskReader::reset_loop_declick (_locations->auto_loop_location(), sample_rate()); + } + boost::shared_ptr<RouteList> rl = routes.reader(); for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i); |