diff options
author | David Robillard <d@drobilla.net> | 2007-09-19 23:54:39 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-09-19 23:54:39 +0000 |
commit | ad558bdafde7e40b5de79b47d8586aec53cf3f7e (patch) | |
tree | a4431ddd696eb66eceb3119a9f7da933f3585ea4 /src/libs/engine/events | |
parent | 0b8415c61e321d032d62b5b1cbda65bab6f178d7 (diff) | |
download | ingen-ad558bdafde7e40b5de79b47d8586aec53cf3f7e.tar.gz ingen-ad558bdafde7e40b5de79b47d8586aec53cf3f7e.tar.bz2 ingen-ad558bdafde7e40b5de79b47d8586aec53cf3f7e.zip |
Toggling of individual node polyphonic state.
git-svn-id: http://svn.drobilla.net/lad/ingen@733 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r-- | src/libs/engine/events/SetPolyphonicEvent.cpp | 33 | ||||
-rw-r--r-- | src/libs/engine/events/SetPolyphonicEvent.hpp | 10 |
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; }; |