summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/MidiControlNode.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-30 21:12:16 +0000
committerDavid Robillard <d@drobilla.net>2007-09-30 21:12:16 +0000
commit399ddfc5b1d4f1f131362d0439821778c6681b23 (patch)
treee8ca2536fa251f474817d0575bc3b4747c494954 /src/libs/engine/MidiControlNode.cpp
parentc40ddfc0eebbcb3333d6cc9e3df7fb62ecb45941 (diff)
downloadingen-399ddfc5b1d4f1f131362d0439821778c6681b23.tar.gz
ingen-399ddfc5b1d4f1f131362d0439821778c6681b23.tar.bz2
ingen-399ddfc5b1d4f1f131362d0439821778c6681b23.zip
Better design for process() signature (pass everything needed in a single object parameter).
Working port "monitoring" (connect an output to a control input, GUI will animate controller). git-svn-id: http://svn.drobilla.net/lad/ingen@788 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/MidiControlNode.cpp')
-rw-r--r--src/libs/engine/MidiControlNode.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/libs/engine/MidiControlNode.cpp b/src/libs/engine/MidiControlNode.cpp
index a2db6696..2e4fca1a 100644
--- a/src/libs/engine/MidiControlNode.cpp
+++ b/src/libs/engine/MidiControlNode.cpp
@@ -15,16 +15,17 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "MidiControlNode.hpp"
#include <math.h>
#include <raul/midi_events.h>
+#include "MidiControlNode.hpp"
#include "PostProcessor.hpp"
#include "MidiLearnEvent.hpp"
#include "InputPort.hpp"
#include "OutputPort.hpp"
#include "Plugin.hpp"
-#include "util.hpp"
#include "AudioBuffer.hpp"
+#include "ProcessContext.hpp"
+#include "util.hpp"
namespace Ingen {
@@ -71,18 +72,18 @@ MidiControlNode::MidiControlNode(const string& path, bool polyphonic, Patch* par
void
-MidiControlNode::process(ProcessContext& context, SampleCount nframes, FrameTime start, FrameTime end)
+MidiControlNode::process(ProcessContext& context)
{
- NodeBase::pre_process(nframes, start, end);
+ NodeBase::pre_process(context);
double timestamp = 0;
uint32_t size = 0;
unsigned char* buffer = NULL;
MidiBuffer* const midi_in = (MidiBuffer*)_midi_in_port->buffer(0);
- assert(midi_in->this_nframes() == nframes);
+ assert(midi_in->this_nframes() == context.nframes());
- while (midi_in->get_event(&timestamp, &size, &buffer) < nframes) {
+ while (midi_in->get_event(&timestamp, &size, &buffer) < context.nframes()) {
if (size >= 3 && (buffer[0] & 0xF0) == MIDI_CMD_CONTROL)
control(buffer[1], buffer[2], (SampleCount)timestamp);
@@ -90,7 +91,7 @@ MidiControlNode::process(ProcessContext& context, SampleCount nframes, FrameTime
midi_in->increment();
}
- NodeBase::post_process(nframes, start, end);
+ NodeBase::post_process(context);
}