From a9f1f6912fa3e6b485a5c6e4195233ef3fb087a1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 2 Jun 2009 22:55:11 +0000 Subject: Remove redundant EventBuffer::_iter. Fix EventBuffer unjoining. Don't pre-process patch input port connections twice. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2060 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/DuplexPort.cpp | 3 --- src/engine/EventBuffer.cpp | 11 ++--------- src/engine/EventBuffer.hpp | 7 +++---- src/engine/LV2EventBuffer.hpp | 4 ++-- 4 files changed, 7 insertions(+), 18 deletions(-) (limited to 'src/engine') diff --git a/src/engine/DuplexPort.cpp b/src/engine/DuplexPort.cpp index 1f26d4e3..195d0468 100644 --- a/src/engine/DuplexPort.cpp +++ b/src/engine/DuplexPort.cpp @@ -62,9 +62,6 @@ DuplexPort::pre_process(ProcessContext& context) cerr << path() << " duplex pre: buffer: " << buffer(0) << endl; cerr << path() << " duplex pre: is_output: " << _is_output << " { " << endl;*/ - for (Connections::iterator c = _connections.begin(); c != _connections.end(); ++c) - (*c)->process(context); - if (_is_output) { for (uint32_t i=0; i < _poly; ++i) diff --git a/src/engine/EventBuffer.cpp b/src/engine/EventBuffer.cpp index f8e3a5de..7110ccc2 100644 --- a/src/engine/EventBuffer.cpp +++ b/src/engine/EventBuffer.cpp @@ -51,16 +51,10 @@ bool EventBuffer::join(Buffer* buf) { EventBuffer* ebuf = dynamic_cast(buf); - if (ebuf) { - _buf = ebuf->_local_buf; - _joined_buf = ebuf; - _iter = ebuf->_iter; - _iter.buf = _buf->data(); + if (!ebuf) return false; - } else { - return false; - } + _buf = ebuf->_local_buf; _joined_buf = ebuf; return true; @@ -72,7 +66,6 @@ EventBuffer::unjoin() { _joined_buf = NULL; _buf = _local_buf; - reset(_this_nframes); } diff --git a/src/engine/EventBuffer.hpp b/src/engine/EventBuffer.hpp index 5a4be3ac..5f33f2de 100644 --- a/src/engine/EventBuffer.hpp +++ b/src/engine/EventBuffer.hpp @@ -82,10 +82,9 @@ public: } private: - LV2EventBuffer* _buf; ///< Contents (maybe belong to _joined_buf) - LV2EventBuffer* _local_buf; ///< Local contents - mutable LV2_Event_Iterator _iter; ///< Iterator into _buf - uint32_t _this_nframes; ///< Current cycle nframes + LV2EventBuffer* _buf; ///< Contents (maybe belong to _joined_buf) + LV2EventBuffer* _local_buf; ///< Local contents + uint32_t _this_nframes; ///< Current cycle nframes }; diff --git a/src/engine/LV2EventBuffer.hpp b/src/engine/LV2EventBuffer.hpp index 9d802a62..68633a8f 100644 --- a/src/engine/LV2EventBuffer.hpp +++ b/src/engine/LV2EventBuffer.hpp @@ -29,8 +29,8 @@ public: LV2EventBuffer(size_t capacity); ~LV2EventBuffer(); - inline LV2_Event_Buffer* data() { return _data; } - inline const LV2_Event_Buffer* data() const { return _data; } + /*inline LV2_Event_Buffer* data() { return _data; } + inline const LV2_Event_Buffer* data() const { return _data; }*/ inline void rewind() const { lv2_event_begin(&_iter, _data); } -- cgit v1.2.1