summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-17 04:05:30 +0000
committerDavid Robillard <d@drobilla.net>2008-08-17 04:05:30 +0000
commitfa067527fe00b66b85d71955e152e9ef9215c9cd (patch)
tree382a8e9e58259929415e7188992252ac1ca2ea9b /src/libs/engine/events
parent3019b09099371b3fe568b7dcc3bb92203d800b1f (diff)
downloadingen-fa067527fe00b66b85d71955e152e9ef9215c9cd.tar.gz
ingen-fa067527fe00b66b85d71955e152e9ef9215c9cd.tar.bz2
ingen-fa067527fe00b66b85d71955e152e9ef9215c9cd.zip
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
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r--src/libs/engine/events/RequestMetadataEvent.cpp21
-rw-r--r--src/libs/engine/events/RequestMetadataEvent.hpp8
-rw-r--r--src/libs/engine/events/SetPolyphonicEvent.cpp2
-rw-r--r--src/libs/engine/events/SetPolyphonyEvent.cpp2
4 files changed, 24 insertions, 9 deletions
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> 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> 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> responder, SampleCount timestamp, const string& path, const string& key);
+ RequestMetadataEvent(Engine& engine,
+ SharedPtr<Responder> 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");
}