summaryrefslogtreecommitdiffstats
path: root/slv2
diff options
context:
space:
mode:
Diffstat (limited to 'slv2')
-rw-r--r--slv2/port.h26
-rw-r--r--slv2/types.h42
2 files changed, 50 insertions, 18 deletions
diff --git a/slv2/port.h b/slv2/port.h
index db1c308..08c1e45 100644
--- a/slv2/port.h
+++ b/slv2/port.h
@@ -60,6 +60,16 @@ SLV2Values
slv2_port_get_hints(SLV2Plugin plugin,
SLV2Port port);
+#if 0
+/** Return whether a port has a certain hint.
+ *
+ * Time = Query
+ */
+bool
+slv2_port_has_hint(SLV2Plugin p,
+ SLV2Port port,
+ SLV2Value hint)
+#endif
/** Get the symbol of a port given the index.
*
@@ -87,13 +97,21 @@ slv2_port_get_name(SLV2Plugin plugin,
SLV2Port port);
-/** Get the class (input/output, data type, rate...) of a port.
+/** Get the direction (input, output) of a port.
*
* Time = Query
*/
-SLV2PortClass
-slv2_port_get_class(SLV2Plugin plugin,
- SLV2Port port);
+SLV2PortDirection
+slv2_port_get_direction(SLV2Plugin plugin,
+ SLV2Port port);
+
+/** Get the (data) type of a port.
+ *
+ * Time = Query
+ */
+SLV2PortType
+slv2_port_get_type(SLV2Plugin plugin,
+ SLV2Port port);
/** Get the default value of a port.
diff --git a/slv2/types.h b/slv2/types.h
index 0eba199..4b1782d 100644
--- a/slv2/types.h
+++ b/slv2/types.h
@@ -27,21 +27,35 @@ extern "C" {
#endif
-/** Class (direction and type) of a port
+/** (Data) Type of a port
*
- * Note that ports may be of other classes not listed here, this is just
- * to make the most common case simple. Use slv2_port_get_value(p, "rdf:type")
- * if you need further class information.
+ * SLV2_UNKNOWN_PORT_TYPE means the Port is not of any type SLV2 understands
+ * (currently Control, Audio, MIDI, and OSC).
+ *
+ * Further class information can be using slv2_port_get_value(p, "rdf:type")
+ * or a custom query.
+ */
+typedef enum _SLV2PortType {
+ SLV2_PORT_TYPE_UNKNOWN,
+ SLV2_PORT_TYPE_CONTROL, /**< One float per block */
+ SLV2_PORT_TYPE_AUDIO, /**< One float per frame */
+ SLV2_PORT_TYPE_MIDI, /**< A buffer of MIDI data (LL extension) */
+ SLV2_PORT_TYPE_OSC, /**< A buffer of OSC data (DR extension) */
+} SLV2PortType;
+
+/** Direction (input or output) of a port
+ *
+ * SLV2_UNKNOWN_PORT_DIRECTION means the Port is only of type lv2:Port
+ * (neither lv2:Input or lv2:Output) as far as SLV2 understands.
+ *
+ * Further class information can be using slv2_port_get_value(p, "rdf:type")
+ * or a custom query.
*/
-typedef enum _SLV2PortClass {
- SLV2_UNKNOWN_PORT_CLASS,
- SLV2_CONTROL_INPUT, /**< One input float per block */
- SLV2_CONTROL_OUTPUT, /**< One output float per block */
- SLV2_AUDIO_INPUT, /**< One input float per frame */
- SLV2_AUDIO_OUTPUT, /**< One output float per frame */
- SLV2_MIDI_INPUT, /**< MIDI input (LL extension) */
- SLV2_MIDI_OUTPUT /**< MIDI output (LL extension) */
-} SLV2PortClass;
+typedef enum _SLV2PortDirection {
+ SLV2_PORT_DIRECTION_UNKNOWN, /**< Neither input or output */
+ SLV2_PORT_DIRECTION_INPUT, /**< Plugin reads from port when run */
+ SLV2_PORT_DIRECTION_OUTPUT, /**< Plugin writes to port when run */
+} SLV2PortDirection;
/** The format of a URI string.
@@ -58,7 +72,7 @@ typedef enum _SLV2URIType {
/** A type of plugin GUI (corresponding to some LV2 GUI extension).
*/
typedef enum _SLV2GUIType {
- SLV2_GTK2_GUI ///< http://ll-plugins.nongnu.org/lv2/ext/gtk2gui
+ SLV2_GUI_TYPE_GTK2 ///< http://ll-plugins.nongnu.org/lv2/ext/gtk2gui
} SLV2GUIType;