From c34d7b6e9354529b6e83c136857e798c63b256fe Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Apr 2007 19:33:14 +0000 Subject: Fixed audio output. git-svn-id: http://svn.drobilla.net/lad/ingen@425 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/InputPort.cpp | 82 ------------------------------------------- 1 file changed, 82 deletions(-) (limited to 'src/libs/engine/InputPort.cpp') diff --git a/src/libs/engine/InputPort.cpp b/src/libs/engine/InputPort.cpp index 0e149abe..a0a65d79 100644 --- a/src/libs/engine/InputPort.cpp +++ b/src/libs/engine/InputPort.cpp @@ -205,88 +205,6 @@ InputPort::pre_process(SampleCount nframes, FrameTime start, FrameTime end) } } -#if 0 - -/** Prepare buffer for access, realtime safe. - * - * MIDI mixing not yet implemented. - */ -void -InputPort::process(SampleCount nframes, FrameTime start, FrameTime end) -{ - //assert(!_is_tied || _tied_port != NULL); - - const size_t num_ins = _connections.size(); - bool do_mixdown = true; - - assert(num_ins == 0 || num_ins == 1); - - assert(_poly == 1); - - for (Connections::iterator c = _connections.begin(); c != _connections.end(); ++c) - (*c)->process(nframes, start, end); - - - // If only one connection, buffer is used directly (no copying) - if (num_ins == 1) { - // Buffer changed since connection - if (_buffers.at(0) != (*_connections.begin())->buffer(0)) { - if (_fixed_buffers) { // || (_is_tied && _tied_port->fixed_buffers())) { - // can't change buffer, must copy - do_mixdown = true; - } else { - // zero-copy - _buffers.at(0)->join((*_connections.begin())->buffer(0)); - //if (_is_tied) - // _tied_port->buffer(0)->join(_buffers.at(0)); - do_mixdown = false; - } - connect_buffers(); - } else { - do_mixdown = false; - } - //assert(!_is_tied || _tied_port != NULL); - //assert(!_is_tied || _buffers.at(0)->data() == _tied_port->buffer(0)->data()); - //assert(!_is_tied || _buffers.at(0)->filled_size() == _tied_port->buffer(0)->filled_size()); - assert(do_mixdown || _buffers.at(0)->filled_size() == - (*_connections.begin())->src_port()->buffer(0)->filled_size()); - } - - // Get valid buffer size from inbound connections, unless a port on a top-level - // patch (which will be fed by the MidiDriver) - if (_parent->parent() != NULL) { - if (num_ins == 1) { - _buffers.at(0)->filled_size( - (*_connections.begin())->src_port()->buffer(0)->filled_size()); - - //if (_is_tied) - // _tied_port->buffer(0)->filled_size(_buffers.at(0)->filled_size()); - - assert(_buffers.at(0)->filled_size() == - (*_connections.begin())->src_port()->buffer(0)->filled_size()); - } else { - // Mixing not implemented - _buffers.at(0)->clear(); - } - } - - //assert(!_is_tied || _buffers.at(0)->data() == _tied_port->buffer(0)->data()); - - if (!do_mixdown || _buffers.at(0)->filled_size() == 0 || num_ins == 0) - return; - - //cerr << path() << " - Copying MIDI buffer" << endl; - - // Be sure buffers are the same as tied port's, if joined - //assert(!_is_tied || _tied_port != NULL); - //assert(!_is_tied || _buffers.at(0)->data() == _tied_port->buffer(0)->data()); - - if (num_ins > 0) - for (size_t i=0; i < _buffers.at(0)->filled_size(); ++i) - _buffers.at(0)[i] = (*_connections.begin())->buffer(0)[i]; -} -#endif - void InputPort::set_buffer_size(size_t size) -- cgit v1.2.1