From 6eec851cda92e1030173dbfd613c44883ced6816 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 9 Apr 2007 01:01:50 +0000 Subject: MIDI patching. wooo! git-svn-id: http://svn.drobilla.net/lad/ingen@429 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/MidiBuffer.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/libs/engine/MidiBuffer.cpp') diff --git a/src/libs/engine/MidiBuffer.cpp b/src/libs/engine/MidiBuffer.cpp index 3dcb7b4c..9842b28c 100644 --- a/src/libs/engine/MidiBuffer.cpp +++ b/src/libs/engine/MidiBuffer.cpp @@ -15,13 +15,29 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -//#include +#include #include "MidiBuffer.h" using namespace std; namespace Ingen { +MidiBuffer::MidiBuffer(size_t capacity) + : Buffer(DataType(DataType::MIDI), capacity) + , _buf(lv2midi_new((uint32_t)capacity)) + , _joined_buf(NULL) +{ + _local_state.midi = _buf; + _state = &_local_state; + assert(_local_state.midi); + reset(0); + clear(); + assert(_local_state.midi == _buf); + + cerr << "Creating MIDI Buffer " << _buf << ", capacity = " << _buf->capacity << endl; +} + + /** Use another buffer's data instead of the local one. * @@ -38,7 +54,7 @@ MidiBuffer::join(Buffer* buf) _joined_buf = mbuf; - _state = mbuf->data(); + _state = mbuf->_state; return true; } -- cgit v1.2.1