From e96c36c1a7abb062e36efc0ac95c35fedcef922e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Apr 2007 06:04:32 +0000 Subject: De-template-ification of port types (req. for LV2 MIDI, but nice code size reduction). LV2 MIDI patching support (LV2 style MIDI throughout, inc. internal plugins). git-svn-id: http://svn.drobilla.net/lad/ingen@415 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/JackAudioDriver.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/libs/engine/JackAudioDriver.cpp') diff --git a/src/libs/engine/JackAudioDriver.cpp b/src/libs/engine/JackAudioDriver.cpp index df03dcb8..dd52d2b2 100644 --- a/src/libs/engine/JackAudioDriver.cpp +++ b/src/libs/engine/JackAudioDriver.cpp @@ -34,6 +34,7 @@ #include "MidiDriver.h" #include "DuplexPort.h" #include "EventSource.h" +#include "AudioBuffer.h" #ifdef HAVE_LASH #include "LashDriver.h" #endif @@ -46,7 +47,7 @@ namespace Ingen { //// JackAudioPort //// -JackAudioPort::JackAudioPort(JackAudioDriver* driver, DuplexPort* patch_port) +JackAudioPort::JackAudioPort(JackAudioDriver* driver, DuplexPort* patch_port) : DriverPort(patch_port->is_input()), Raul::ListNode(this), _driver(driver), @@ -83,9 +84,11 @@ JackAudioPort::prepare_buffer(jack_nframes_t nframes) */ jack_sample_t* jack_buf = (jack_sample_t*)jack_port_get_buffer(_jack_port, nframes); + AudioBuffer* patch_buf = (AudioBuffer*)_patch_port->buffer(0); + if (jack_buf != _jack_buffer) { //cerr << "Jack buffer: " << jack_buf << endl; - _patch_port->buffer(0)->set_data(jack_buf); + patch_buf->set_data(jack_buf); _jack_buffer = jack_buf; } @@ -100,7 +103,7 @@ JackAudioPort::prepare_buffer(jack_nframes_t nframes) //m_patch_port->fixed_buffers(true); //assert(_patch_port->buffer(0)->data() == _patch_port->tied_port()->buffer(0)->data()); - assert(_patch_port->buffer(0)->data() == jack_buf); + assert(patch_buf->data() == jack_buf); } @@ -257,7 +260,7 @@ JackAudioDriver::port(const Path& path) DriverPort* -JackAudioDriver::create_port(DuplexPort* patch_port) +JackAudioDriver::create_port(DuplexPort* patch_port) { if (patch_port->buffer_size() == _buffer_size) return new JackAudioPort(this, patch_port); -- cgit v1.2.1