add new Session method to return the worst_latency_preroll() value rounded up to...
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 28 Dec 2019 04:11:38 +0000 (21:11 -0700)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 28 Dec 2019 04:18:12 +0000 (21:18 -0700)
libs/ardour/ardour/session.h
libs/ardour/session_transport.cc

index 31751689588dc33cf3195fca397be8d11277f07b..d71134db7e1ee569bb0dfb7c1138d354ca3245f6 100644 (file)
@@ -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;
 
index e41eb59a0fee1e44efd4e511686e8c115b359e6a..01bdcea7cb87486191235bf18645929b4d1c791e 100644 (file)
@@ -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 ()
 {