summaryrefslogtreecommitdiffstats
path: root/src/server/JackDriver.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-07-31 15:12:38 +0000
committerDavid Robillard <d@drobilla.net>2012-07-31 15:12:38 +0000
commit8d559e4991a491b612e63d5a4deff0ab48a3d3dd (patch)
tree06da8b1d71f8068f12bc3f476b90734b67d9120c /src/server/JackDriver.cpp
parenta41af6e41d60f8724809486b94ce1e6281c3bc31 (diff)
downloadingen-8d559e4991a491b612e63d5a4deff0ab48a3d3dd.tar.gz
ingen-8d559e4991a491b612e63d5a4deff0ab48a3d3dd.tar.bz2
ingen-8d559e4991a491b612e63d5a4deff0ab48a3d3dd.zip
Merge AudioBuffer into Buffer and avoid all the casting.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4584 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/JackDriver.cpp')
-rw-r--r--src/server/JackDriver.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index b21a3c58..b3c2fc6c 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -33,7 +33,6 @@
#include "raul/List.hpp"
#include "raul/log.hpp"
-#include "AudioBuffer.hpp"
#include "DuplexPort.hpp"
#include "Engine.hpp"
#include "JackDriver.hpp"
@@ -112,13 +111,13 @@ JackPort::pre_process(ProcessContext& context)
_buffer = jack_port_get_buffer(_jack_port, nframes);
if (!is_input()) {
- ((AudioBuffer*)_patch_port->buffer(0).get())->clear();
+ _patch_port->buffer(0)->clear();
return;
}
if (_patch_port->is_a(PortType::AUDIO)) {
- AudioBuffer* patch_buf = (AudioBuffer*)_patch_port->buffer(0).get();
- memcpy(patch_buf->data(), _buffer, nframes * sizeof(float));
+ Buffer* patch_buf = _patch_port->buffer(0).get();
+ memcpy(patch_buf->samples(), _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();
@@ -155,12 +154,11 @@ JackPort::post_process(ProcessContext& context)
_patch_port->post_process(context);
if (_patch_port->is_a(PortType::AUDIO)) {
- AudioBuffer* patch_buf = (AudioBuffer*)_patch_port->buffer(0).get();
-
- memcpy(_buffer, patch_buf->data(), nframes * sizeof(Sample));
+ Buffer* patch_buf = _patch_port->buffer(0).get();
+ memcpy(_buffer, patch_buf->samples(), nframes * sizeof(Sample));
} else if (_patch_port->buffer_type() == _patch_port->bufs().uris().atom_Sequence) {
- Buffer* patch_buf = (Buffer*)_patch_port->buffer(0).get();
+ Buffer* patch_buf = _patch_port->buffer(0).get();
jack_midi_clear_buffer(_buffer);