summaryrefslogtreecommitdiffstats
path: root/src/server/JackDriver.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-10-03 04:09:37 +0000
committerDavid Robillard <d@drobilla.net>2011-10-03 04:09:37 +0000
commit990007a6c0317aa0cce97f4e095bc98745c60c4d (patch)
treee5e3010b83ff525b900adf8096556984e0feacf7 /src/server/JackDriver.cpp
parent8768c927968c2541bcac763d9a4f237081eaca4b (diff)
downloadingen-990007a6c0317aa0cce97f4e095bc98745c60c4d.tar.gz
ingen-990007a6c0317aa0cce97f4e095bc98745c60c4d.tar.bz2
ingen-990007a6c0317aa0cce97f4e095bc98745c60c4d.zip
Use port type instead of buffer type where appropriate.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3524 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/JackDriver.cpp')
-rw-r--r--src/server/JackDriver.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index 42e9f78a..246d6fdb 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -85,7 +85,7 @@ JackPort::create()
_jack_port = jack_port_register(
_driver->jack_client(),
ingen_jack_port_name(_patch_port->path()).c_str(),
- (_patch_port->buffer_type() == PortType::AUDIO)
+ (_patch_port->is_a(PortType::AUDIO))
? JACK_DEFAULT_AUDIO_TYPE : JACK_DEFAULT_MIDI_TYPE,
(_patch_port->is_input())
? JackPortIsInput : JackPortIsOutput,
@@ -120,13 +120,13 @@ JackPort::pre_process(ProcessContext& context)
const SampleCount nframes = context.nframes();
- if (_patch_port->buffer_type() == PortType::AUDIO) {
+ if (_patch_port->is_a(PortType::AUDIO)) {
jack_sample_t* jack_buf = (jack_sample_t*)jack_port_get_buffer(_jack_port, nframes);
AudioBuffer* patch_buf = (AudioBuffer*)_patch_port->buffer(0).get();
patch_buf->copy(jack_buf, 0, nframes - 1);
- } else if (_patch_port->buffer_type() == PortType::EVENTS) {
+ } else if (_patch_port->is_a(PortType::EVENTS)) {
void* jack_buf = jack_port_get_buffer(_jack_port, nframes);
EventBuffer* patch_buf = (EventBuffer*)_patch_port->buffer(0).get();
@@ -155,13 +155,13 @@ JackPort::post_process(ProcessContext& context)
const SampleCount nframes = context.nframes();
- if (_patch_port->buffer_type() == PortType::AUDIO) {
+ if (_patch_port->is_a(PortType::AUDIO)) {
jack_sample_t* jack_buf = (jack_sample_t*)jack_port_get_buffer(_jack_port, nframes);
AudioBuffer* patch_buf = (AudioBuffer*)_patch_port->buffer(0).get();
memcpy(jack_buf, patch_buf->data(), nframes * sizeof(Sample));
- } else if (_patch_port->buffer_type() == PortType::EVENTS) {
+ } else if (_patch_port->is_a(PortType::EVENTS)) {
void* jack_buf = jack_port_get_buffer(_jack_port, context.nframes());
EventBuffer* patch_buf = (EventBuffer*)_patch_port->buffer(0).get();
@@ -386,8 +386,8 @@ DriverPort*
JackDriver::create_port(DuplexPort* patch_port)
{
try {
- if (patch_port->buffer_type() == PortType::AUDIO
- || patch_port->buffer_type() == PortType::EVENTS)
+ if (patch_port->is_a(PortType::AUDIO)
+ || patch_port->is_a(PortType::EVENTS))
return new JackPort(this, patch_port);
else
return NULL;