summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r--src/libs/engine/events/SetPolyphonicEvent.cpp33
-rw-r--r--src/libs/engine/events/SetPolyphonicEvent.hpp10
2 files changed, 20 insertions, 23 deletions
diff --git a/src/libs/engine/events/SetPolyphonicEvent.cpp b/src/libs/engine/events/SetPolyphonicEvent.cpp
index 369abbd2..17313f96 100644
--- a/src/libs/engine/events/SetPolyphonicEvent.cpp
+++ b/src/libs/engine/events/SetPolyphonicEvent.cpp
@@ -31,10 +31,10 @@
namespace Ingen {
-SetPolyphonicEvent::SetPolyphonicEvent(Engine& engine, SharedPtr<Responder> responder, FrameTime time, QueuedEventSource* source, const string& patch_path, bool poly)
+SetPolyphonicEvent::SetPolyphonicEvent(Engine& engine, SharedPtr<Responder> responder, FrameTime time, QueuedEventSource* source, const string& path, bool poly)
: QueuedEvent(engine, responder, time, true, source),
- _patch_path(patch_path),
- _patch(NULL),
+ _path(path),
+ _object(NULL),
_poly(poly)
{
}
@@ -43,12 +43,9 @@ SetPolyphonicEvent::SetPolyphonicEvent(Engine& engine, SharedPtr<Responder> resp
void
SetPolyphonicEvent::pre_process()
{
- /*
- _patch = _engine.object_store()->find_patch(_patch_path);
- if (_patch && _poly > _patch->internal_poly())
- _patch->prepare_internal_poly(_poly);
-*/
- QueuedEvent::pre_process();
+ _object = _engine.object_store()->find_object(_path);
+
+ QueuedEvent::pre_process();
}
@@ -56,10 +53,10 @@ void
SetPolyphonicEvent::execute(SampleCount nframes, FrameTime start, FrameTime end)
{
QueuedEvent::execute(nframes, start, end);
-/*
- if (_patch)
- _patch->apply_internal_poly(*_engine.maid(), _poly);
-*/
+
+ if (_object)
+ _object->set_polyphonic(*_engine.maid(), _poly);
+
_source->unblock();
}
@@ -67,12 +64,12 @@ SetPolyphonicEvent::execute(SampleCount nframes, FrameTime start, FrameTime end)
void
SetPolyphonicEvent::post_process()
{
- /*
- if (_patch)
+ if (_object) {
_responder->respond_ok();
- else
- _responder->respond_error("Unable to find patch");
- */
+ _engine.broadcaster()->send_polyphonic(_path, _poly);
+ } else {
+ _responder->respond_error("Unable to find object");
+ }
}
diff --git a/src/libs/engine/events/SetPolyphonicEvent.hpp b/src/libs/engine/events/SetPolyphonicEvent.hpp
index 42988f72..3e3aa81e 100644
--- a/src/libs/engine/events/SetPolyphonicEvent.hpp
+++ b/src/libs/engine/events/SetPolyphonicEvent.hpp
@@ -26,7 +26,7 @@ using std::string;
namespace Ingen {
-class Patch;
+class GraphObject;
/** Delete all nodes from a patch.
@@ -36,16 +36,16 @@ class Patch;
class SetPolyphonicEvent : public QueuedEvent
{
public:
- SetPolyphonicEvent(Engine& engine, SharedPtr<Responder> responder, FrameTime time, QueuedEventSource* source, const string& patch_path, bool poly);
+ SetPolyphonicEvent(Engine& engine, SharedPtr<Responder> responder, FrameTime time, QueuedEventSource* source, const string& path, bool poly);
void pre_process();
void execute(SampleCount nframes, FrameTime start, FrameTime end);
void post_process();
private:
- string _patch_path;
- Patch* _patch;
- bool _poly;
+ string _path;
+ GraphObject* _object;
+ bool _poly;
};