From 752662051a1d7217ce842ded78d1ee8e041a112f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 8 Apr 2016 18:16:01 +0200 Subject: add Plugin LatencyChanged() signal and max latency report --- libs/ardour/ardour/plugin.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'libs/ardour/ardour/plugin.h') diff --git a/libs/ardour/ardour/plugin.h b/libs/ardour/ardour/plugin.h index e219ec5bdd..087f5968bd 100644 --- a/libs/ardour/ardour/plugin.h +++ b/libs/ardour/ardour/plugin.h @@ -199,6 +199,26 @@ class LIBARDOUR_API Plugin : public PBD::StatefulDestructible, public Latent return 0; } + /** Emitted when a Latency Changes + * + * (this cannot be part of ARDOUR::Latent because + * signals cannot be copy-constructed). + */ + PBD::Signal2 LatencyChanged; + + /* overload Latent::set_user_latency w/signal emission */ + virtual void set_user_latency (framecnt_t val) { + bool changed = val != _user_latency; + framecnt_t old = effective_latency (); + _user_latency = val; + if (changed) { + LatencyChanged (old, effective_latency ()); /* EMIT SIGNAL */ + } + } + + /** the max possible latency a plugin will have */ + virtual framecnt_t max_latency () const { return 0; } // TODO = 0, require implementation + /** Emitted when a preset is added or removed, respectively */ PBD::Signal0 PresetAdded; PBD::Signal0 PresetRemoved; -- cgit v1.2.3