diff options
author | David Robillard <d@drobilla.net> | 2012-08-11 18:41:31 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-11 18:41:31 +0000 |
commit | 92600e0011488c66175dea483515daec560cd580 (patch) | |
tree | 0df02ad7dd90a59c4abd5c4641fced444a042f09 /src/server/Buffer.hpp | |
parent | 885c186ed6427e7912faadfad7cc91692092efcb (diff) | |
download | ingen-92600e0011488c66175dea483515daec560cd580.tar.gz ingen-92600e0011488c66175dea483515daec560cd580.tar.bz2 ingen-92600e0011488c66175dea483515daec560cd580.zip |
Considerable DSP performance improvements (mixing overhead, and per-event MIDI overhead with Note/Trigger nodes).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4657 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/Buffer.hpp')
-rw-r--r-- | src/server/Buffer.hpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/server/Buffer.hpp b/src/server/Buffer.hpp index 720b1073..fd4151b8 100644 --- a/src/server/Buffer.hpp +++ b/src/server/Buffer.hpp @@ -46,7 +46,6 @@ public: void clear(); void resize(uint32_t size); void copy(const Context& context, const Buffer* src); - void set_block(Sample val, SampleCount start, SampleCount end); void prepare_write(Context& context); void* port_data(PortType port_type); @@ -104,6 +103,18 @@ public: return samples()[offset]; } + inline void set_block(Sample val, + const SampleCount start, + const SampleCount end) + { + assert(end <= nframes()); + // Note: Do not change this without ensuring GCC can still vectorize it + Sample* const buf = samples() + start; + for (SampleCount i = 0; i < (end - start); ++i) { + buf[i] = val; + } + } + /// Audio buffers only float peak(const Context& context) const; |