From fa067527fe00b66b85d71955e152e9ef9215c9cd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 17 Aug 2008 04:05:30 +0000 Subject: Replace imperative polyphony/polyphonic stuff with properties (kill more API). git-svn-id: http://svn.drobilla.net/lad/ingen@1412 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/events/RequestMetadataEvent.cpp | 21 +++++++++++++++------ src/libs/engine/events/RequestMetadataEvent.hpp | 8 +++++++- src/libs/engine/events/SetPolyphonicEvent.cpp | 2 +- src/libs/engine/events/SetPolyphonyEvent.cpp | 2 +- 4 files changed, 24 insertions(+), 9 deletions(-) (limited to 'src/libs/engine/events') diff --git a/src/libs/engine/events/RequestMetadataEvent.cpp b/src/libs/engine/events/RequestMetadataEvent.cpp index 23a3ac7b..733a6a82 100644 --- a/src/libs/engine/events/RequestMetadataEvent.cpp +++ b/src/libs/engine/events/RequestMetadataEvent.cpp @@ -28,11 +28,17 @@ using std::string; namespace Ingen { -RequestMetadataEvent::RequestMetadataEvent(Engine& engine, SharedPtr responder, SampleCount timestamp, const string& node_path, const string& key) -: QueuedEvent(engine, responder, timestamp), - _path(node_path), - _key(key), - _object(NULL) +RequestMetadataEvent::RequestMetadataEvent(Engine& engine, + SharedPtr responder, + SampleCount timestamp, + bool property, + const string& node_path, + const string& key) + : QueuedEvent(engine, responder, timestamp) + , _path(node_path) + , _property(property) + , _key(key) + , _object(NULL) { } @@ -48,7 +54,10 @@ RequestMetadataEvent::pre_process() } } - _value = _object->get_variable(_key); + if (_property) + _value = _object->get_property(_key); + else + _value = _object->get_variable(_key); QueuedEvent::pre_process(); } diff --git a/src/libs/engine/events/RequestMetadataEvent.hpp b/src/libs/engine/events/RequestMetadataEvent.hpp index 71f55399..f6a18dfc 100644 --- a/src/libs/engine/events/RequestMetadataEvent.hpp +++ b/src/libs/engine/events/RequestMetadataEvent.hpp @@ -38,13 +38,19 @@ namespace Shared { class RequestMetadataEvent : public QueuedEvent { public: - RequestMetadataEvent(Engine& engine, SharedPtr responder, SampleCount timestamp, const string& path, const string& key); + RequestMetadataEvent(Engine& engine, + SharedPtr responder, + SampleCount timestamp, + bool property, + const string& path, + const string& key); void pre_process(); void post_process(); private: string _path; + bool _property; string _key; Raul::Atom _value; GraphObjectImpl* _object; diff --git a/src/libs/engine/events/SetPolyphonicEvent.cpp b/src/libs/engine/events/SetPolyphonicEvent.cpp index bce65ba9..9b7fd980 100644 --- a/src/libs/engine/events/SetPolyphonicEvent.cpp +++ b/src/libs/engine/events/SetPolyphonicEvent.cpp @@ -68,7 +68,7 @@ SetPolyphonicEvent::post_process() if (_object) { if (_success) { _responder->respond_ok(); - _engine.broadcaster()->send_polyphonic(_path, _poly); + _engine.broadcaster()->send_property_change(_path, "ingen:polyphonic", _poly); } else { _responder->respond_error("Unable to set object as polyphonic"); } diff --git a/src/libs/engine/events/SetPolyphonyEvent.cpp b/src/libs/engine/events/SetPolyphonyEvent.cpp index 17222330..eb6550cb 100644 --- a/src/libs/engine/events/SetPolyphonyEvent.cpp +++ b/src/libs/engine/events/SetPolyphonyEvent.cpp @@ -68,7 +68,7 @@ SetPolyphonyEvent::post_process() { if (_patch) { _responder->respond_ok(); - _engine.broadcaster()->send_patch_polyphony(_patch_path, _poly); + _engine.broadcaster()->send_property_change(_patch_path, "ingen:polyphony", (int32_t)_poly); } else { _responder->respond_error("Unable to find patch"); } -- cgit v1.2.1