diff options
author | David Robillard <d@drobilla.net> | 2008-08-17 20:16:21 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-08-17 20:16:21 +0000 |
commit | 9dadfb83f9ce69a870362824bc6a3cad371385af (patch) | |
tree | 8018e5fdcd77dbb674191c3a3200c2680670876b /src/libs/engine/events | |
parent | cd0bc4625bab110e8e4b780c5b80c87662d35bab (diff) | |
download | ingen-9dadfb83f9ce69a870362824bc6a3cad371385af.tar.gz ingen-9dadfb83f9ce69a870362824bc6a3cad371385af.tar.bz2 ingen-9dadfb83f9ce69a870362824bc6a3cad371385af.zip |
Set/send/etc properties through the engine.
Add 'ingen:selected' property so selection is persistent and shared among clients.
git-svn-id: http://svn.drobilla.net/lad/ingen@1424 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r-- | src/libs/engine/events/SetMetadataEvent.cpp | 30 | ||||
-rw-r--r-- | src/libs/engine/events/SetMetadataEvent.hpp | 8 |
2 files changed, 27 insertions, 11 deletions
diff --git a/src/libs/engine/events/SetMetadataEvent.cpp b/src/libs/engine/events/SetMetadataEvent.cpp index 3e41a510..b4ee00ff 100644 --- a/src/libs/engine/events/SetMetadataEvent.cpp +++ b/src/libs/engine/events/SetMetadataEvent.cpp @@ -28,12 +28,20 @@ using std::string; namespace Ingen { -SetMetadataEvent::SetMetadataEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& path, const string& key, const Atom& value) -: QueuedEvent(engine, responder, timestamp), - _path(path), - _key(key), - _value(value), - _object(NULL) +SetMetadataEvent::SetMetadataEvent( + Engine& engine, + SharedPtr<Responder> responder, + SampleCount timestamp, + bool property, + const string& path, + const string& key, + const Atom& value) + : QueuedEvent(engine, responder, timestamp) + , _property(property) + , _path(path) + , _key(key) + , _value(value) + , _object(NULL) { } @@ -47,7 +55,10 @@ SetMetadataEvent::pre_process() return; } - _object->set_variable(_key, _value); + if (_property) + _object->set_property(_key, _value); + else + _object->set_variable(_key, _value); QueuedEvent::pre_process(); } @@ -70,7 +81,10 @@ SetMetadataEvent::post_process() _responder->respond_error(msg); } else { _responder->respond_ok(); - _engine.broadcaster()->send_variable_change(_path, _key, _value); + if (_property) + _engine.broadcaster()->send_property_change(_path, _key, _value); + else + _engine.broadcaster()->send_variable_change(_path, _key, _value); } } diff --git a/src/libs/engine/events/SetMetadataEvent.hpp b/src/libs/engine/events/SetMetadataEvent.hpp index 457d3052..9707ce56 100644 --- a/src/libs/engine/events/SetMetadataEvent.hpp +++ b/src/libs/engine/events/SetMetadataEvent.hpp @@ -39,6 +39,7 @@ public: SetMetadataEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, + bool property, const string& path, const string& key, const Raul::Atom& value); @@ -48,9 +49,10 @@ public: void post_process(); private: - string _path; - string _key; - Raul::Atom _value; + bool _property; + string _path; + string _key; + Raul::Atom _value; GraphObjectImpl* _object; }; |