summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-07-31 04:49:47 +0000
committerDavid Robillard <d@drobilla.net>2012-07-31 04:49:47 +0000
commita41af6e41d60f8724809486b94ce1e6281c3bc31 (patch)
tree921857fc8c19aba4d8f60816f5625d7d202a36b9 /src
parentd184de93fce861f4b632f410bde8d527ce1bf34f (diff)
downloadingen-a41af6e41d60f8724809486b94ce1e6281c3bc31.tar.gz
ingen-a41af6e41d60f8724809486b94ce1e6281c3bc31.tar.bz2
ingen-a41af6e41d60f8724809486b94ce1e6281c3bc31.zip
Remove AudioBuffer::copy and just use memcpy.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4583 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/server/AudioBuffer.cpp19
-rw-r--r--src/server/AudioBuffer.hpp1
-rw-r--r--src/server/JackDriver.cpp2
-rw-r--r--src/server/ingen_lv2.cpp4
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;