From 8296a030a582bd620479907ab17afc8fdc92609a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 20 Mar 2020 17:38:23 -0600 Subject: redesign chasing the transport master Substantive comments associated with code in Session::plan_master_strategy. Known not to work for reverse TC. Also, the JACK related code has not yet been tested --- libs/ardour/ardour/session.h | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'libs/ardour/ardour') diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 3ab11aee91..c9b8c84798 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -775,7 +775,7 @@ public: bool transport_stopped_or_stopping() const; bool transport_rolling() const; bool transport_will_roll_forwards() const; - + bool silent () { return _silent; } bool punch_is_possible () const; @@ -1369,7 +1369,34 @@ private: }; samplepos_t master_wait_end; - void track_transport_master (float slave_speed, samplepos_t slave_transport_sample); + + enum TransportMasterAction { + TransportMasterRelax, + TransportMasterNoRoll, + TransportMasterLocate, + TransportMasterStart, + TransportMasterStop, + TransportMasterWait, + }; + + struct TransportMasterStrategy { + TransportMasterAction action; + samplepos_t target; + LocateTransportDisposition roll_disposition; + double catch_speed; + + TransportMasterStrategy () + : action (TransportMasterRelax) + , target (0) + , roll_disposition (MustStop) + , catch_speed (0.) {} + }; + + TransportMasterStrategy transport_master_strategy; + double plan_master_strategy (pframes_t nframes, double master_speed, samplepos_t master_transport_sample, double catch_speed); + double plan_master_strategy_engine (pframes_t nframes, double master_speed, samplepos_t master_transport_sample, double catch_speed); + bool implement_master_strategy (); + bool follow_transport_master (pframes_t nframes); void sync_source_changed (SyncSource, samplepos_t pos, pframes_t cycle_nframes); -- cgit v1.2.3