diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 8a257ff5dd..4f29d03f84 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1388,6 +1388,12 @@ public: void globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to); + /* Can be accessed only in process() context, and only after + * Session::process() has returned. + */ + + ProcessedRanges processed_ranges; + protected: friend class AudioEngine; void set_block_size (pframes_t nframes); diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc index e555a8b1e1..3b492d3811 100644 --- a/libs/ardour/session_process.cc +++ b/libs/ardour/session_process.cc @@ -117,6 +117,16 @@ Session::process (pframes_t nframes) io_graph_chain.reset (); /* drop reference */ } + /* set up processed_ranges with the default values. + + This will be updated by ::process_without_events(), + ::process_with_events() and ::locate() + */ + + processed_ranges.start[0] = _transport_sample; + processed_ranges.end[0] = _transport_sample; + processed_ranges.cnt = 1; + (this->*process_function) (nframes); io_graph_chain = _io_graph_chain[1]; @@ -188,6 +198,8 @@ Session::process (pframes_t nframes) /* don't bother with a message */ } + processed_ranges.end[processed_ranges.cnt - 1] = _transport_sample; + SendFeedback (); /* EMIT SIGNAL */ } @@ -657,6 +669,8 @@ Session::process_with_events (pframes_t nframes) } /* implicit release of route lock */ + processed_ranges.end[processed_ranges.cnt - 1] = _transport_sample; + clear_active_cue (); if (session_needs_butler) { @@ -750,6 +764,8 @@ Session::process_without_events (pframes_t nframes) DEBUG_TRACE (DEBUG::Butler, "p-without-events: session needs butler, call it\n"); _butler->summon (); } + + processed_ranges.end[processed_ranges.cnt - 1] = _transport_sample; } /** Process callback used when the auditioner is active. diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 379b3b983d..ff5131ee4c 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -296,6 +296,12 @@ Session::locate (samplepos_t target_sample, bool for_loop_end, bool force, bool send_mmc_locate (_transport_sample); } + if (for_loop_end) { + processed_ranges.end[0] = existing; + processed_ranges.start[1] = _transport_sample; + processed_ranges.cnt = 2; + } + _last_roll_location = _last_roll_or_reversal_location = _transport_sample; Located (); /* EMIT SIGNAL */