13
0

update DiskReader loop delick objects when loop changes

This commit is contained in:
Paul Davis 2020-05-13 18:51:18 -06:00
parent abbcc755c1
commit 7232ac2f67
4 changed files with 15 additions and 5 deletions

View File

@ -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 ();

View File

@ -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);

View File

@ -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 ();
}

View File

@ -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);