summaryrefslogtreecommitdiffstats
path: root/src/libs/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/engine')
-rw-r--r--src/libs/engine/InputPort.cpp8
-rw-r--r--src/libs/engine/InputPort.h1
-rw-r--r--src/libs/engine/MidiControlNode.cpp10
-rw-r--r--src/libs/engine/MidiTriggerNode.cpp2
4 files changed, 17 insertions, 4 deletions
diff --git a/src/libs/engine/InputPort.cpp b/src/libs/engine/InputPort.cpp
index bdc6162c..349175eb 100644
--- a/src/libs/engine/InputPort.cpp
+++ b/src/libs/engine/InputPort.cpp
@@ -221,6 +221,14 @@ InputPort::set_buffer_size(size_t size)
}
+void
+InputPort::post_process(SampleCount nframes, FrameTime start, FrameTime end)
+{
+ // Prepare for next cycle
+ for (size_t i=0; i < _poly; ++i)
+ _buffers.at(i)->prepare_write(nframes);
+}
+
} // namespace Ingen
diff --git a/src/libs/engine/InputPort.h b/src/libs/engine/InputPort.h
index 25777ecf..e0367025 100644
--- a/src/libs/engine/InputPort.h
+++ b/src/libs/engine/InputPort.h
@@ -57,6 +57,7 @@ public:
const Connections& connections() { return _connections; }
void pre_process(SampleCount nframes, FrameTime start, FrameTime end);
+ void post_process(SampleCount nframes, FrameTime start, FrameTime end);
bool is_connected() const { return (_connections.size() > 0); }
bool is_connected_to(const OutputPort* port) const;
diff --git a/src/libs/engine/MidiControlNode.cpp b/src/libs/engine/MidiControlNode.cpp
index 05454bdb..cca43549 100644
--- a/src/libs/engine/MidiControlNode.cpp
+++ b/src/libs/engine/MidiControlNode.cpp
@@ -76,15 +76,17 @@ MidiControlNode::process(SampleCount nframes, FrameTime start, FrameTime end)
while (midi_in->get_event(&timestamp, &size, &buffer) < nframes) {
- cerr << "EVENT: ";
+ printf("EVENT: ");
for (size_t i=0; i < size; ++i)
- cerr << buffer[i] << " ";
- cerr << endl;
+ printf("%X ", (int)buffer[i]);
+ printf("\n");
//const FrameTime time = start + (FrameTime)timestamp;
if (size >= 3 && (buffer[0] & 0xF0) == MIDI_CMD_CONTROL)
control(buffer[1], buffer[2], (SampleCount)timestamp);
+
+ midi_in->increment();
}
NodeBase::post_process(nframes, start, end);
@@ -132,7 +134,7 @@ MidiControlNode::control(uchar control_num, uchar val, SampleCount offset)
}
if (control_num == ((AudioBuffer*)_param_port->buffer(0))->value_at(0)) {
- ((AudioBuffer*)_control_port->buffer(0))->set(scaled_value, offset);
+ ((AudioBuffer*)_control_port->buffer(0))->set(scaled_value, 0);
((AudioBuffer*)_audio_port->buffer(0))->set(scaled_value, offset);
}
}
diff --git a/src/libs/engine/MidiTriggerNode.cpp b/src/libs/engine/MidiTriggerNode.cpp
index d45cfe85..a0b0c032 100644
--- a/src/libs/engine/MidiTriggerNode.cpp
+++ b/src/libs/engine/MidiTriggerNode.cpp
@@ -92,6 +92,8 @@ MidiTriggerNode::process(SampleCount nframes, FrameTime start, FrameTime end)
break;
}
}
+
+ midi_in->increment();
}
NodeBase::post_process(nframes, start, end);