diff options
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; |