summaryrefslogtreecommitdiffstats
path: root/src/engine/JackDriver.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-25 20:40:13 +0000
committerDavid Robillard <d@drobilla.net>2010-02-25 20:40:13 +0000
commit77a9beca75debd2d87d735fc4fe847694eee6f13 (patch)
treeae03699b999e84bc4c283abfd215c8037ecddaf6 /src/engine/JackDriver.cpp
parente22984efe9b82ab006494aea93814a592cd44ece (diff)
downloadingen-77a9beca75debd2d87d735fc4fe847694eee6f13.tar.gz
ingen-77a9beca75debd2d87d735fc4fe847694eee6f13.tar.bz2
ingen-77a9beca75debd2d87d735fc4fe847694eee6f13.zip
Work on contexts and polymorphic ports.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2492 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/JackDriver.cpp')
-rw-r--r--src/engine/JackDriver.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/engine/JackDriver.cpp b/src/engine/JackDriver.cpp
index a604aeae..6c66cba3 100644
--- a/src/engine/JackDriver.cpp
+++ b/src/engine/JackDriver.cpp
@@ -77,7 +77,7 @@ JackPort::create()
_jack_port = jack_port_register(
_driver->jack_client(),
ingen_jack_port_name(_patch_port->path()).c_str(),
- (_patch_port->type() == PortType::AUDIO)
+ (_patch_port->buffer_type() == PortType::AUDIO)
? JACK_DEFAULT_AUDIO_TYPE : JACK_DEFAULT_MIDI_TYPE,
(_patch_port->is_input())
? JackPortIsInput : JackPortIsOutput,
@@ -115,13 +115,13 @@ JackPort::pre_process(ProcessContext& context)
const SampleCount nframes = context.nframes();
- if (_patch_port->type() == PortType::AUDIO) {
+ if (_patch_port->buffer_type() == 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->type() == PortType::EVENTS) {
+ } else if (_patch_port->buffer_type() == PortType::EVENTS) {
void* jack_buf = jack_port_get_buffer(_jack_port, nframes);
EventBuffer* patch_buf = (EventBuffer*)_patch_port->buffer(0).get();
@@ -149,13 +149,13 @@ JackPort::post_process(ProcessContext& context)
const SampleCount nframes = context.nframes();
- if (_patch_port->type() == PortType::AUDIO) {
+ if (_patch_port->buffer_type() == 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->type() == PortType::EVENTS) {
+ } else if (_patch_port->buffer_type() == PortType::EVENTS) {
void* jack_buf = jack_port_get_buffer(_jack_port, context.nframes());
EventBuffer* patch_buf = (EventBuffer*)_patch_port->buffer(0).get();
@@ -367,7 +367,8 @@ DriverPort*
JackDriver::create_port(DuplexPort* patch_port)
{
try {
- if (patch_port->type() == PortType::AUDIO || patch_port->type() == PortType::EVENTS)
+ if (patch_port->buffer_type() == PortType::AUDIO
+ || patch_port->buffer_type() == PortType::EVENTS)
return new JackPort(this, patch_port);
else
return NULL;