diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2019-12-27 21:11:38 -0700 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2019-12-27 21:18:12 -0700 |
commit | 5cdeb2401f789e9968a4f1fb775d1dfb3e9f5a77 (patch) | |
tree | 717980cdb1a9e317f3adb3d9d0b604d49de454e0 /libs/ardour | |
parent | ca36d7cc2f393705a6ce59973ce2bf39bb9e9e85 (diff) |
add new Session method to return the worst_latency_preroll() value rounded up to the nearest buffer size
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/session.h | 1 | ||||
-rw-r--r-- | libs/ardour/session_transport.cc | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 3175168958..d71134db7e 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -504,6 +504,7 @@ public: samplecnt_t worst_input_latency () const { return _worst_input_latency; } samplecnt_t worst_route_latency () const { return _worst_route_latency; } samplecnt_t worst_latency_preroll () const; + samplecnt_t worst_latency_preroll_buffer_size_ceil () const; PBD::Signal0<void> LatencyUpdated; diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index e41eb59a0f..01bdcea7cb 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -1675,6 +1675,12 @@ Session::worst_latency_preroll () const return _worst_output_latency + _worst_input_latency; } +samplecnt_t +Session::worst_latency_preroll_buffer_size_ceil () const +{ + return lrintf (ceil ((_worst_output_latency + _worst_input_latency) / (float) current_block_size) * current_block_size); +} + void Session::unset_play_range () { |