eliminate hacky design for being able to deliver the correct time as JACK timebase master

This commit is contained in:
Paul Davis 2019-11-11 18:21:47 -07:00
parent 2f87b111e5
commit c69227fd8d
3 changed files with 10 additions and 2 deletions

View File

@ -717,6 +717,7 @@ public:
samplepos_t audible_sample (bool* latent_locate = NULL) const; samplepos_t audible_sample (bool* latent_locate = NULL) const;
samplepos_t requested_return_sample() const { return _requested_return_sample; } samplepos_t requested_return_sample() const { return _requested_return_sample; }
void set_requested_return_sample(samplepos_t return_to); void set_requested_return_sample(samplepos_t return_to);
boost::optional<samplepos_t> const & nominal_jack_transport_sample() { return _nominal_jack_transport_sample; }
bool compute_audible_delta (samplepos_t& pos_and_delta) const; bool compute_audible_delta (samplepos_t& pos_and_delta) const;
samplecnt_t remaining_latency_preroll () const { return _remaining_latency_preroll; } samplecnt_t remaining_latency_preroll () const { return _remaining_latency_preroll; }
@ -2108,6 +2109,7 @@ private:
CoreSelection* _selection; CoreSelection* _selection;
bool _global_locate_pending; bool _global_locate_pending;
boost::optional<samplepos_t> _nominal_jack_transport_sample;
}; };

View File

@ -244,6 +244,7 @@ Session::do_locate (samplepos_t target_sample, bool with_roll, bool with_flush,
// Update Timecode time // Update Timecode time
_transport_sample = target_sample; _transport_sample = target_sample;
_nominal_jack_transport_sample = boost::none;
// Bump seek counter so that any in-process locate in the butler // Bump seek counter so that any in-process locate in the butler
// thread(s?) can restart. // thread(s?) can restart.
g_atomic_int_inc (&_seek_counter); g_atomic_int_inc (&_seek_counter);

View File

@ -115,7 +115,13 @@ JACKSession::timebase_callback (jack_transport_state_t /*state*/,
{ {
Timecode::BBT_Time bbt; Timecode::BBT_Time bbt;
TempoMap& tempo_map (_session->tempo_map()); TempoMap& tempo_map (_session->tempo_map());
samplepos_t tf = _session->transport_sample (); samplepos_t tf;
/* see commit msg for e2c26e1b9 and Session::start_locate() for
details.
*/
tf = _session->nominal_jack_transport_sample().value_or (_session->transport_sample());
/* BBT info */ /* BBT info */
@ -191,4 +197,3 @@ JACKSession::timebase_callback (jack_transport_state_t /*state*/,
} }
#endif #endif
} }