diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/AudioBuffer.cpp | 19 | ||||
-rw-r--r-- | src/server/AudioBuffer.hpp | 1 | ||||
-rw-r--r-- | src/server/JackDriver.cpp | 2 | ||||
-rw-r--r-- | src/server/ingen_lv2.cpp | 4 |
4 files changed, 3 insertions, 23 deletions
diff --git a/src/server/AudioBuffer.cpp b/src/server/AudioBuffer.cpp index 9cd267ee..719b06e3 100644 --- a/src/server/AudioBuffer.cpp +++ b/src/server/AudioBuffer.cpp @@ -76,25 +76,6 @@ AudioBuffer::set_block(Sample val, size_t start_offset, size_t end_offset) buf[i] = val; } -/** Copy a block of @a src into buffer. - * - * @a start_sample and @a end_sample define the inclusive range to be set. - * This function only copies the same range in one buffer to another. - */ -void -AudioBuffer::copy(const Sample* src, size_t start_sample, size_t end_sample) -{ - assert(end_sample >= start_sample); - assert(nframes() != 0); - - Sample* const buf = data(); - assert(buf); - - const size_t copy_end = std::min(end_sample, (size_t)nframes() - 1); - for (size_t i = start_sample; i <= copy_end; ++i) - buf[i] = src[i]; -} - void AudioBuffer::copy(Context& context, const Buffer* src) { diff --git a/src/server/AudioBuffer.hpp b/src/server/AudioBuffer.hpp index e8bfa411..ca519650 100644 --- a/src/server/AudioBuffer.hpp +++ b/src/server/AudioBuffer.hpp @@ -41,7 +41,6 @@ public: void clear(); void set_block(Sample val, size_t start_offset, size_t end_offset); - void copy(const Sample* src, size_t start_sample, size_t end_sample); void copy(Context& context, const Buffer* src); float peak(Context& context) const; diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp index 8d030bf3..b21a3c58 100644 --- a/src/server/JackDriver.cpp +++ b/src/server/JackDriver.cpp @@ -118,7 +118,7 @@ JackPort::pre_process(ProcessContext& context) if (_patch_port->is_a(PortType::AUDIO)) { AudioBuffer* patch_buf = (AudioBuffer*)_patch_port->buffer(0).get(); - patch_buf->copy((jack_sample_t*)_buffer, 0, nframes - 1); + memcpy(patch_buf->data(), _buffer, nframes * sizeof(float)); } else if (_patch_port->buffer_type() == _patch_port->bufs().uris().atom_Sequence) { Buffer* patch_buf = (Buffer*)_patch_port->buffer(0).get(); diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index 88db9b24..8c8dce2c 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -101,10 +101,10 @@ public: if (_patch_port->is_a(PortType::AUDIO) || _patch_port->is_a(PortType::CV)) { AudioBuffer* patch_buf = (AudioBuffer*)_patch_port->buffer(0).get(); - patch_buf->copy((Sample*)_buffer, 0, context.nframes() - 1); + memcpy(patch_buf->data(), _buffer, context.nframes() * sizeof(float)); } else if (_patch_port->is_a(PortType::CONTROL)) { AudioBuffer* patch_buf = (AudioBuffer*)_patch_port->buffer(0).get(); - patch_buf->copy((Sample*)_buffer, 0, 0); + memcpy(patch_buf->data(), _buffer, sizeof(float)); } else { LV2_Atom_Sequence* seq = (LV2_Atom_Sequence*)_buffer; bool enqueued = false; |