diff options
Diffstat (limited to 'src/server/Broadcaster.hpp')
-rw-r--r-- | src/server/Broadcaster.hpp | 21 |
1 files changed, 17 insertions, 4 deletions
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 <atomic> #include <list> #include <map> +#include <set> #include <string> #include <glibmm/thread.h> @@ -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<Interface> 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<Interface> > Clients; - Glib::Mutex _clients_mutex; - Clients _clients; - unsigned _bundle_depth; + Glib::Mutex _clients_mutex; + Clients _clients; + std::set<Raul::URI> _broadcastees; + std::atomic<bool> _must_broadcast; + unsigned _bundle_depth; }; } // namespace Server |