summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/MidiBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/engine/MidiBuffer.cpp')
-rw-r--r--src/libs/engine/MidiBuffer.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libs/engine/MidiBuffer.cpp b/src/libs/engine/MidiBuffer.cpp
index f2741dfb..4d515f2e 100644
--- a/src/libs/engine/MidiBuffer.cpp
+++ b/src/libs/engine/MidiBuffer.cpp
@@ -100,6 +100,23 @@ MidiBuffer::prepare_write(SampleCount nframes)
assert(!_joined_buf || data() == _joined_buf->data());
}
+
+/** FIXME: parameters ignored */
+void
+MidiBuffer::copy(const Buffer* src_buf, size_t start_sample, size_t end_sample)
+{
+ MidiBuffer* src = (MidiBuffer*)src_buf;
+ clear();
+ src->reset(_this_nframes);
+ const uint32_t frame_count = min(_this_nframes, src->this_nframes());
+ double time;
+ uint32_t size;
+ unsigned char* data;
+ while (src->increment() < frame_count) {
+ src->get_event(&time, &size, &data);
+ put_event(time, size, data);
+ }
+}
} // namespace Ingen