From e400bef1a70653295e4b7edca100b4a07ff0b9e8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 12 Feb 2011 05:40:21 +0000 Subject: Remove useless enum PortDirection. git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2937 a436a847-0d15-0410-975c-d299462d15a1 --- hosts/lv2_jack_host.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'hosts/lv2_jack_host.c') diff --git a/hosts/lv2_jack_host.c b/hosts/lv2_jack_host.c index d4d2783..bf5c6a2 100644 --- a/hosts/lv2_jack_host.c +++ b/hosts/lv2_jack_host.c @@ -19,6 +19,7 @@ #define _XOPEN_SOURCE 500 #include +#include #include #include #include @@ -36,11 +37,6 @@ #define MIDI_BUFFER_SIZE 1024 -enum PortDirection { - INPUT, - OUTPUT -}; - enum PortType { CONTROL, AUDIO, @@ -49,11 +45,11 @@ enum PortType { struct Port { SLV2Port slv2_port; - enum PortDirection direction; enum PortType type; jack_port_t* jack_port; /**< For audio/MIDI ports, otherwise NULL */ float control; /**< For control ports, otherwise 0.0f */ LV2_Event_Buffer* ev_buffer; /**< For MIDI ports, otherwise NULL */ + bool is_input; }; /** This program's data */ @@ -128,11 +124,11 @@ create_port(struct JackHost* host, enum JackPortFlags jack_flags = 0; if (slv2_port_is_a(host->plugin, port->slv2_port, host->input_class)) { - jack_flags = JackPortIsInput; - port->direction = INPUT; + jack_flags = JackPortIsInput; + port->is_input = true; } else if (slv2_port_is_a(host->plugin, port->slv2_port, host->output_class)) { - jack_flags = JackPortIsOutput; - port->direction = OUTPUT; + jack_flags = JackPortIsOutput; + port->is_input = false; } else if (slv2_port_has_property(host->plugin, port->slv2_port, host->optional)) { slv2_instance_connect_port(host->instance, port_index, NULL); } else { @@ -195,7 +191,7 @@ jack_process_cb(jack_nframes_t nframes, void* data) LV2_EVENT_AUDIO_STAMP, (uint8_t*)(host->ports[p].ev_buffer + 1)); - if (host->ports[p].direction == INPUT) { + if (host->ports[p].is_input) { void* buf = jack_port_get_buffer(host->ports[p].jack_port, nframes); @@ -219,7 +215,7 @@ jack_process_cb(jack_nframes_t nframes, void* data) /* Deliver MIDI output */ for (uint32_t p = 0; p < host->num_ports; ++p) { if (host->ports[p].jack_port - && host->ports[p].direction == OUTPUT + && !host->ports[p].is_input && host->ports[p].type == EVENT) { void* buf = jack_port_get_buffer(host->ports[p].jack_port, -- cgit v1.2.1