From d04c9b32444b01e9c29d603c6301843003986c4a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 23 Nov 2019 00:09:46 -0700 Subject: more tweaks to correctly (or more correctly) reload disk reader buffers when loop fade choice changes --- libs/ardour/disk_reader.cc | 2 ++ libs/ardour/session.cc | 12 ++++++------ libs/ardour/session_state.cc | 4 ++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/libs/ardour/disk_reader.cc b/libs/ardour/disk_reader.cc index b4ffba834e..03e3b50d59 100644 --- a/libs/ardour/disk_reader.cc +++ b/libs/ardour/disk_reader.cc @@ -794,6 +794,8 @@ DiskReader::audio_read (PBD::PlaybackBuffer*rb, /* Looping: do something (maybe) about the loop boundaries */ + cerr << name() << " Read with lfc = " << enum_2_string (Config->get_loop_fade_choice()) << endl; + switch (Config->get_loop_fade_choice()) { case NoLoopFade: break; diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 79bf3b31e2..980dec8dcf 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -1415,15 +1415,15 @@ Session::auto_loop_changed (Location* location) const bool rolling = transport_rolling (); - if (rolling) { + boost::shared_ptr r = routes.reader (); - if (play_loop) { + for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { + (*i)->reload_loop (); + } - boost::shared_ptr r = routes.reader (); + if (rolling) { - for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { - (*i)->reload_loop (); - } + if (play_loop) { if (_transport_sample < location->start() || _transport_sample > location->end()) { // new loop range excludes current transport diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 5222c85a8e..12d2c706ea 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -4148,6 +4148,10 @@ Session::config_changed (std::string p, bool ours) remove_monitor_section (); } } + } else if (p == "loop-fade-choice") { + cerr << "LFC change, change auto-loop\n"; + last_loopend = 0; /* force locate to refill buffers with new loop boundary data */ + auto_loop_changed (_locations->auto_loop_location()); } set_dirty (); -- cgit v1.2.3