From d049b582e1db60ee0f6fd02a40202145488c7288 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 2 Feb 2013 02:16:23 +0000 Subject: Add option to enable/disable canvas animation (fix/avoid #879). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5016 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/Broadcaster.hpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/server/Broadcaster.hpp') diff --git a/src/server/Broadcaster.hpp b/src/server/Broadcaster.hpp index 3162742b..5de5ec8f 100644 --- a/src/server/Broadcaster.hpp +++ b/src/server/Broadcaster.hpp @@ -17,8 +17,10 @@ #ifndef INGEN_ENGINE_CLIENTBROADCASTER_HPP #define INGEN_ENGINE_CLIENTBROADCASTER_HPP +#include #include #include +#include #include #include @@ -41,12 +43,21 @@ namespace Server { class Broadcaster : public Interface { public: - Broadcaster() : _bundle_depth(0) {} + Broadcaster(); ~Broadcaster(); void register_client(const Raul::URI& uri, SPtr client); bool unregister_client(const Raul::URI& uri); + void set_broadcast(const Raul::URI& client, bool broadcast); + + /** Return true iff there are any clients with broadcasting enabled. + * + * This is used in the audio thread to decide whether or not notifications + * should be calculated and emitted. + */ + bool must_broadcast() const { return _must_broadcast; } + /** A handle that represents a transfer of possibly several changes. * * This object going out of scope signifies the transfer is completed. @@ -135,9 +146,11 @@ private: typedef std::map< Raul::URI, SPtr > Clients; - Glib::Mutex _clients_mutex; - Clients _clients; - unsigned _bundle_depth; + Glib::Mutex _clients_mutex; + Clients _clients; + std::set _broadcastees; + std::atomic _must_broadcast; + unsigned _bundle_depth; }; } // namespace Server -- cgit v1.2.1