diff options
author | David Robillard <d@drobilla.net> | 2010-02-20 21:52:36 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-20 21:52:36 +0000 |
commit | 46e5de590817756b21a7a5d99bd4963df343f455 (patch) | |
tree | 7d7b3b63297b24d84e5b42cc8aeb22d4212738b5 /src/engine/AudioBuffer.cpp | |
parent | b96a4015ae39b5bdd9afbd82898c0168a0a8e613 (diff) | |
download | ingen-46e5de590817756b21a7a5d99bd4963df343f455.tar.gz ingen-46e5de590817756b21a7a5d99bd4963df343f455.tar.bz2 ingen-46e5de590817756b21a7a5d99bd4963df343f455.zip |
Heavy overhaul of buffer management and polyphony.
* Working polyphony when nodes are instantiated at desired polyphony
level (dynamic still doesn't work)
* Use shared silent buffer for disconnected audio inputs (save memory)
* Eliminate redundant patch compiling on delete and disconnect-all
events that have child events
* Fix a ton of crash bugs and other issues I've since forgotten
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2468 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/AudioBuffer.cpp')
-rw-r--r-- | src/engine/AudioBuffer.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/engine/AudioBuffer.cpp b/src/engine/AudioBuffer.cpp index 90534f90..99d97e14 100644 --- a/src/engine/AudioBuffer.cpp +++ b/src/engine/AudioBuffer.cpp @@ -36,15 +36,14 @@ namespace Ingen { using namespace Shared; -AudioBuffer::AudioBuffer(BufferFactory& factory, Shared::PortType type, size_t size) - : ObjectBuffer(factory, size + sizeof(LV2_Object) - + (type == PortType::AUDIO ? sizeof(LV2_Vector_Body) : 0)) +AudioBuffer::AudioBuffer(BufferFactory& bufs, Shared::PortType type, size_t size) + : ObjectBuffer(bufs, size) , _state(OK) , _set_value(0) , _set_time(0) { - assert(size >= sizeof(Sample)); - assert(this->size() > size); + assert(size >= sizeof(LV2_Object) + sizeof(Sample)); + assert(this->size() >= size); assert(data()); _type = type; @@ -67,6 +66,8 @@ AudioBuffer::AudioBuffer(BufferFactory& factory, Shared::PortType type, size_t s << "\tdata @ " << (void*)data() << "\t(offset " << (char*)data() - (char*)object() << ")" << endl;*/ + + clear(); } @@ -111,7 +112,9 @@ AudioBuffer::set_value(Sample val, FrameTime cycle_start, FrameTime time) if (offset < nframes()) { set_block(val, offset, nframes() - 1); - if (offset > 0) + if (offset == 0) + _state = OK; + else _state = HALF_SET_CYCLE_1; } // else trigger at very end of block |