summaryrefslogtreecommitdiffstats
path: root/src/server/Broadcaster.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-31 23:58:48 +0000
committerDavid Robillard <d@drobilla.net>2014-01-31 23:58:48 +0000
commitcc3359a6bea22c3d4584a5d57403e7d568e16fe7 (patch)
treeb0e57cf8c8227da9ef4be982db062b32f3a0cbdc /src/server/Broadcaster.hpp
parenta659a13c531e991851e013db3d4223bf16a343b8 (diff)
downloadingen-cc3359a6bea22c3d4584a5d57403e7d568e16fe7.tar.gz
ingen-cc3359a6bea22c3d4584a5d57403e7d568e16fe7.tar.bz2
ingen-cc3359a6bea22c3d4584a5d57403e7d568e16fe7.zip
Subscribe to ports before instantiating plugin UIs (fix #954).
Respond to put/set/patch with the same type of event (not set=>delta). Don't feed back changes to originating client. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5326 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/Broadcaster.hpp')
-rw-r--r--src/server/Broadcaster.hpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/server/Broadcaster.hpp b/src/server/Broadcaster.hpp
index 069a0499..b9e37c44 100644
--- a/src/server/Broadcaster.hpp
+++ b/src/server/Broadcaster.hpp
@@ -50,6 +50,14 @@ public:
void set_broadcast(const Raul::URI& client, bool broadcast);
+ /** Ignore a client when broadcasting.
+ *
+ * This is used to prevent feeding back updates to the client that
+ * initiated a property set in the first place.
+ */
+ void set_ignore_client(SPtr<Interface> client) { _ignore_client = client; }
+ void clear_ignore_client() { _ignore_client.reset(); }
+
/** Return true iff there are any clients with broadcasting enabled.
*
* This is used in the audio thread to decide whether or not notifications
@@ -85,8 +93,11 @@ public:
#define BROADCAST(msg, ...) \
std::lock_guard<std::mutex> lock(_clients_mutex); \
- for (const auto& c : _clients) \
- c.second->msg(__VA_ARGS__)
+ for (const auto& c : _clients) { \
+ if (c.second != _ignore_client) { \
+ c.second->msg(__VA_ARGS__); \
+ } \
+ } \
void bundle_begin() { BROADCAST(bundle_begin); }
void bundle_end() { BROADCAST(bundle_end); }
@@ -151,6 +162,7 @@ private:
std::set<Raul::URI> _broadcastees;
std::atomic<bool> _must_broadcast;
unsigned _bundle_depth;
+ SPtr<Interface> _ignore_client;
};
} // namespace Server