summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events/SetMetadataEvent.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-19 00:56:05 +0000
committerDavid Robillard <d@drobilla.net>2008-08-19 00:56:05 +0000
commit5609c1ce452f8122b5ed12144dd4c1941bd07bc2 (patch)
treee0984409aaeee38599e32c9364636962586b7739 /src/libs/engine/events/SetMetadataEvent.cpp
parentf63dcf61bc04cc276ed5ae63266bfb91e3b84d94 (diff)
downloadingen-5609c1ce452f8122b5ed12144dd4c1941bd07bc2.tar.gz
ingen-5609c1ce452f8122b5ed12144dd4c1941bd07bc2.tar.bz2
ingen-5609c1ce452f8122b5ed12144dd4c1941bd07bc2.zip
Kill more API/code - replace enable_port_broadcast and disable_port_broadcast functions/events
with property ingen:broadcast. git-svn-id: http://svn.drobilla.net/lad/ingen@1441 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events/SetMetadataEvent.cpp')
-rw-r--r--src/libs/engine/events/SetMetadataEvent.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libs/engine/events/SetMetadataEvent.cpp b/src/libs/engine/events/SetMetadataEvent.cpp
index 341fa06c..6e72d57b 100644
--- a/src/libs/engine/events/SetMetadataEvent.cpp
+++ b/src/libs/engine/events/SetMetadataEvent.cpp
@@ -20,6 +20,7 @@
#include <boost/format.hpp>
#include "Responder.hpp"
#include "Engine.hpp"
+#include "PortImpl.hpp"
#include "ClientBroadcaster.hpp"
#include "GraphObjectImpl.hpp"
#include "EngineStore.hpp"
@@ -39,6 +40,7 @@ SetMetadataEvent::SetMetadataEvent(
const Atom& value)
: QueuedEvent(engine, responder, timestamp)
, _error(NO_ERROR)
+ , _special_type(NONE)
, _property(property)
, _path(path)
, _key(key)
@@ -67,6 +69,11 @@ SetMetadataEvent::pre_process()
_object->set_property(_key, _value);
else
_object->set_variable(_key, _value);
+
+ if (_key == "ingen:broadcast") {
+ std::cout << "BROADCAST" << std::endl;
+ _special_type = ENABLE_BROADCAST;
+ }
QueuedEvent::pre_process();
}
@@ -75,6 +82,12 @@ SetMetadataEvent::pre_process()
void
SetMetadataEvent::execute(ProcessContext& context)
{
+ if (_special_type == ENABLE_BROADCAST) {
+ PortImpl* port = dynamic_cast<PortImpl*>(_object);
+ if (port)
+ port->broadcast(_value.get_bool());
+ }
+
QueuedEvent::execute(context);
// Do nothing
}