From ad82b443f47a6ee458b2dbb11deed6422a227b04 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 20 Jan 2020 11:07:27 -0700 Subject: fix API and use of Session::force_locate() Because of the addition of LocateTransportDisposition, this call was unconditionally forcing a roll during startup --- libs/ardour/ardour/session.h | 2 +- libs/ardour/session_state.cc | 2 +- libs/ardour/session_transport.cc | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 5ce59bc174..9969e35c5f 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1686,7 +1686,7 @@ private: void flush_all_inserts (); int micro_locate (samplecnt_t distance); - void force_locate (samplepos_t sample, bool with_roll = false); + void force_locate (samplepos_t sample, LocateTransportDisposition); void set_transport_speed (double speed, samplepos_t destination_sample, bool abort = false, bool clear_state = false, bool as_default = false); void realtime_stop (bool abort, bool clear_state); void realtime_locate (bool); diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 430e0f95ef..9986aa2752 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -436,7 +436,7 @@ Session::session_loaded () /* Now, finally, we can fill the playback buffers */ BootMessage (_("Filling playback buffers")); - force_locate (_transport_sample, false); + force_locate (_transport_sample, MustStop); } string diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 2b630aa939..da6655a696 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -946,10 +946,11 @@ Session::request_locate (samplepos_t target_sample, LocateTransportDisposition l } void -Session::force_locate (samplepos_t target_sample, bool with_roll) +Session::force_locate (samplepos_t target_sample, LocateTransportDisposition ltd) { - SessionEvent *ev = new SessionEvent (with_roll ? SessionEvent::LocateRoll : SessionEvent::Locate, SessionEvent::Add, SessionEvent::Immediate, target_sample, 0, true); - DEBUG_TRACE (DEBUG::Transport, string_compose ("Request forced locate to %1\n", target_sample)); + SessionEvent *ev = new SessionEvent (SessionEvent::Locate, SessionEvent::Add, SessionEvent::Immediate, target_sample, 0, true); + ev->locate_transport_disposition = ltd; + DEBUG_TRACE (DEBUG::Transport, string_compose ("Request forced locate to %1 roll %2\n", target_sample, enum_2_string (ltd))); queue_event (ev); } -- cgit v1.2.3