diff options
author | David Robillard <d@drobilla.net> | 2008-11-27 22:50:32 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-11-27 22:50:32 +0000 |
commit | c58f17efff27f959147dfd231a8b059950d06e69 (patch) | |
tree | f10dd950a9b1b15461a6200f9396a989b3e1ad9d /src/engine/MidiControlNode.cpp | |
parent | cb1d3b65670febd0bd5c3ac7d128f45ef0a744a4 (diff) | |
download | ingen-c58f17efff27f959147dfd231a8b059950d06e69.tar.gz ingen-c58f17efff27f959147dfd231a8b059950d06e69.tar.bz2 ingen-c58f17efff27f959147dfd231a8b059950d06e69.zip |
MIDI learn for control node.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1806 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/MidiControlNode.cpp')
-rw-r--r-- | src/engine/MidiControlNode.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/engine/MidiControlNode.cpp b/src/engine/MidiControlNode.cpp index fc6098ec..0e907a8b 100644 --- a/src/engine/MidiControlNode.cpp +++ b/src/engine/MidiControlNode.cpp @@ -20,12 +20,14 @@ #include "MidiControlNode.hpp" #include "PostProcessor.hpp" #include "events/MidiLearnEvent.hpp" +#include "events/SendPortValueEvent.hpp" #include "InputPort.hpp" #include "OutputPort.hpp" #include "InternalPlugin.hpp" #include "AudioBuffer.hpp" #include "ProcessContext.hpp" #include "EventBuffer.hpp" +#include "Engine.hpp" #include "util.hpp" namespace Ingen { @@ -102,18 +104,13 @@ MidiControlNode::control(ProcessContext& context, uchar control_num, uchar val, const Sample nval = (val / 127.0f); // normalized [0, 1] if (_learning) { - assert(false); // FIXME FIXME FIXME -#if 0 assert(_learn_event != NULL); - _param_port->set_value(control_num, offset); - assert(_param_port->buffer(0)->value_at(0) == control_num); - _learn_event->set_value(control_num); - _learn_event->execute(offset); - //Engine::instance().post_processor()->push(_learn_event); - //Engine::instance().post_processor()->whip(); + _param_port->set_value(control_num); + ((AudioBuffer*)_param_port->buffer(0))->set_value( + (float)control_num, context.start(), context.end()); + _param_port->broadcast_value(context, true); _learning = false; _learn_event = NULL; -#endif } const Sample min_port_val = ((AudioBuffer*)_min_port->buffer(0))->value_at(0); |