From ad558bdafde7e40b5de79b47d8586aec53cf3f7e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 19 Sep 2007 23:54:39 +0000 Subject: Toggling of individual node polyphonic state. git-svn-id: http://svn.drobilla.net/lad/ingen@733 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/events/SetPolyphonicEvent.cpp | 33 ++++++++++++--------------- src/libs/engine/events/SetPolyphonicEvent.hpp | 10 ++++---- 2 files changed, 20 insertions(+), 23 deletions(-) (limited to 'src/libs/engine/events') 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, FrameTime time, QueuedEventSource* source, const string& patch_path, bool poly) +SetPolyphonicEvent::SetPolyphonicEvent(Engine& engine, SharedPtr 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 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, FrameTime time, QueuedEventSource* source, const string& patch_path, bool poly); + SetPolyphonicEvent(Engine& engine, SharedPtr 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; }; -- cgit v1.2.1