diff options
author | David Robillard <d@drobilla.net> | 2022-05-30 19:31:30 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-08-17 13:50:26 -0400 |
commit | cebc0e98c60f3d3af9399356e1ea09c98fcd8dcb (patch) | |
tree | e790934ccff672ceee232098ff11e358de69eada /src | |
parent | bf0664df5f22b2400fe5fb52ad9bf017986e1595 (diff) | |
download | jalv-cebc0e98c60f3d3af9399356e1ea09c98fcd8dcb.tar.gz jalv-cebc0e98c60f3d3af9399356e1ea09c98fcd8dcb.tar.bz2 jalv-cebc0e98c60f3d3af9399356e1ea09c98fcd8dcb.zip |
Move Port definition to its own header
Diffstat (limited to 'src')
-rw-r--r-- | src/jack.c | 1 | ||||
-rw-r--r-- | src/jalv.c | 1 | ||||
-rw-r--r-- | src/jalv_console.c | 1 | ||||
-rw-r--r-- | src/jalv_gtk.c | 1 | ||||
-rw-r--r-- | src/jalv_internal.h | 17 | ||||
-rw-r--r-- | src/jalv_qt.cpp | 1 | ||||
-rw-r--r-- | src/log.c | 1 | ||||
-rw-r--r-- | src/log.h | 2 | ||||
-rw-r--r-- | src/port.h | 38 | ||||
-rw-r--r-- | src/state.c | 1 |
10 files changed, 47 insertions, 17 deletions
@@ -11,6 +11,7 @@ #include "lv2_evbuf.h" #include "nodes.h" #include "options.h" +#include "port.h" #include "urids.h" #include "lilv/lilv.h" @@ -14,6 +14,7 @@ #include "lv2_evbuf.h" #include "nodes.h" #include "options.h" +#include "port.h" #include "state.h" #include "urids.h" #include "worker.h" diff --git a/src/jalv_console.c b/src/jalv_console.c index 641c505..f71c49f 100644 --- a/src/jalv_console.c +++ b/src/jalv_console.c @@ -12,6 +12,7 @@ #include "jalv_internal.h" #include "log.h" #include "options.h" +#include "port.h" #include "state.h" #include "lilv/lilv.h" diff --git a/src/jalv_gtk.c b/src/jalv_gtk.c index 0760683..3be1957 100644 --- a/src/jalv_gtk.c +++ b/src/jalv_gtk.c @@ -6,6 +6,7 @@ #include "jalv_internal.h" #include "nodes.h" #include "options.h" +#include "port.h" #include "state.h" #include "urids.h" diff --git a/src/jalv_internal.h b/src/jalv_internal.h index 14e0648..0224651 100644 --- a/src/jalv_internal.h +++ b/src/jalv_internal.h @@ -6,7 +6,6 @@ #include "control.h" #include "jalv_config.h" -#include "lv2_evbuf.h" #include "nodes.h" #include "options.h" #include "symap.h" @@ -53,22 +52,6 @@ typedef struct JalvBackend JalvBackend; typedef struct Jalv Jalv; -enum PortFlow { FLOW_UNKNOWN, FLOW_INPUT, FLOW_OUTPUT }; - -enum PortType { TYPE_UNKNOWN, TYPE_CONTROL, TYPE_AUDIO, TYPE_EVENT, TYPE_CV }; - -struct Port { - const LilvPort* lilv_port; ///< LV2 port - enum PortType type; ///< Data type - enum PortFlow flow; ///< Data flow direction - void* sys_port; ///< For audio/MIDI ports, otherwise NULL - LV2_Evbuf* evbuf; ///< For MIDI ports, otherwise NULL - void* widget; ///< Control widget, if applicable - size_t buf_size; ///< Custom buffer size, or 0 - uint32_t index; ///< Port index - float control; ///< For control ports, otherwise 0.0f -}; - typedef enum { JALV_RUNNING, JALV_PAUSE_REQUESTED, JALV_PAUSED } JalvPlayState; typedef struct { diff --git a/src/jalv_qt.cpp b/src/jalv_qt.cpp index 90e469d..15aa05f 100644 --- a/src/jalv_qt.cpp +++ b/src/jalv_qt.cpp @@ -6,6 +6,7 @@ #include "jalv_internal.h" #include "nodes.h" #include "options.h" +#include "port.h" #include "lilv/lilv.h" #include "suil/suil.h" @@ -8,6 +8,7 @@ #include "jalv_config.h" #include "jalv_internal.h" #include "options.h" +#include "port.h" #include "urids.h" #include "lilv/lilv.h" @@ -22,6 +22,8 @@ extern "C" { #endif +struct Port; + // String and log utilities void diff --git a/src/port.h b/src/port.h new file mode 100644 index 0000000..7c6d644 --- /dev/null +++ b/src/port.h @@ -0,0 +1,38 @@ +// Copyright 2007-2022 David Robillard <d@drobilla.net> +// SPDX-License-Identifier: ISC + +#ifndef JALV_PORT_H +#define JALV_PORT_H + +#include "lv2_evbuf.h" + +#include "lilv/lilv.h" + +#include <stddef.h> +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +enum PortFlow { FLOW_UNKNOWN, FLOW_INPUT, FLOW_OUTPUT }; + +enum PortType { TYPE_UNKNOWN, TYPE_CONTROL, TYPE_AUDIO, TYPE_EVENT, TYPE_CV }; + +struct Port { + const LilvPort* lilv_port; ///< LV2 port + enum PortType type; ///< Data type + enum PortFlow flow; ///< Data flow direction + void* sys_port; ///< For audio/MIDI ports, otherwise NULL + LV2_Evbuf* evbuf; ///< For MIDI ports, otherwise NULL + void* widget; ///< Control widget, if applicable + size_t buf_size; ///< Custom buffer size, or 0 + uint32_t index; ///< Port index + float control; ///< For control ports, otherwise 0.0f +}; + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // JALV_PORT_H diff --git a/src/state.c b/src/state.c index 344e53d..11fcb5c 100644 --- a/src/state.c +++ b/src/state.c @@ -7,6 +7,7 @@ #include "jalv_internal.h" #include "log.h" #include "nodes.h" +#include "port.h" #include "lilv/lilv.h" #include "lv2/atom/forge.h" |