aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-05-30 19:31:30 -0400
committerDavid Robillard <d@drobilla.net>2022-08-17 13:50:26 -0400
commitcebc0e98c60f3d3af9399356e1ea09c98fcd8dcb (patch)
treee790934ccff672ceee232098ff11e358de69eada /src
parentbf0664df5f22b2400fe5fb52ad9bf017986e1595 (diff)
downloadjalv-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.c1
-rw-r--r--src/jalv.c1
-rw-r--r--src/jalv_console.c1
-rw-r--r--src/jalv_gtk.c1
-rw-r--r--src/jalv_internal.h17
-rw-r--r--src/jalv_qt.cpp1
-rw-r--r--src/log.c1
-rw-r--r--src/log.h2
-rw-r--r--src/port.h38
-rw-r--r--src/state.c1
10 files changed, 47 insertions, 17 deletions
diff --git a/src/jack.c b/src/jack.c
index 5b04c4f..c5cb5f8 100644
--- a/src/jack.c
+++ b/src/jack.c
@@ -11,6 +11,7 @@
#include "lv2_evbuf.h"
#include "nodes.h"
#include "options.h"
+#include "port.h"
#include "urids.h"
#include "lilv/lilv.h"
diff --git a/src/jalv.c b/src/jalv.c
index 1b47653..ac4f9a9 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -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"
diff --git a/src/log.c b/src/log.c
index a86267a..ae0705b 100644
--- a/src/log.c
+++ b/src/log.c
@@ -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"
diff --git a/src/log.h b/src/log.h
index a939d3d..2f81d76 100644
--- a/src/log.h
+++ b/src/log.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"