summaryrefslogtreecommitdiffstats
path: root/slv2
diff options
context:
space:
mode:
Diffstat (limited to 'slv2')
-rw-r--r--slv2/Makefile.am8
-rw-r--r--slv2/plugin.h60
-rw-r--r--slv2/pluginclasses.h4
-rw-r--r--slv2/plugins.h6
-rw-r--r--slv2/pluginuiinstance.h1
-rw-r--r--slv2/pluginuis.h6
-rw-r--r--slv2/port.h8
-rw-r--r--slv2/portsignature.h53
-rw-r--r--slv2/slv2.h16
-rw-r--r--slv2/template.h68
-rw-r--r--slv2/types.h14
-rw-r--r--slv2/util.h5
-rw-r--r--slv2/values.h20
-rw-r--r--slv2/world.h8
14 files changed, 233 insertions, 44 deletions
diff --git a/slv2/Makefile.am b/slv2/Makefile.am
index 924fbec..8d3ee26 100644
--- a/slv2/Makefile.am
+++ b/slv2/Makefile.am
@@ -5,13 +5,15 @@ slv2include_HEADERS = \
plugin.h \
pluginclass.h \
pluginclasses.h \
- pluginui.h \
- pluginuis.h \
- pluginuiinstance.h \
plugininstance.h \
plugins.h \
+ pluginui.h \
+ pluginuiinstance.h \
+ pluginuis.h \
port.h \
+ portsignature.h \
slv2.h \
+ template.h \
types.h \
util.h \
value.h \
diff --git a/slv2/plugin.h b/slv2/plugin.h
index b7a436e..3a386fc 100644
--- a/slv2/plugin.h
+++ b/slv2/plugin.h
@@ -128,7 +128,6 @@ const char*
slv2_plugin_get_library_uri(SLV2Plugin plugin);
-
/** Get the name of \a plugin.
*
* This is guaranteed to return the untranslated name (the doap:name in the
@@ -250,6 +249,32 @@ uint32_t
slv2_plugin_get_num_ports(SLV2Plugin p);
+/** Get the "template" (port signature) of this plugin.
+ *
+ * The template is intended to be all the basic information a host might
+ * want to know about a plugin's inputs and outputs (e.g. to determine if the
+ * plugin is appropriate for a given situation). Using this function is much,
+ * much faster than using the individual functions repeatedly to get the same
+ * information (since each call results in a single query).
+ *
+ * Time = Query
+ */
+SLV2Template
+slv2_plugin_get_template(SLV2Plugin p);
+
+
+/** Get the number of ports on this plugin of a given direction and/or type.
+ *
+ * Use SLV2_PORT_DATA_TYPE_ANY and SLV2_PORT_DIRECTION_ANY for a wildcard.
+ *
+ * Time = O(1)
+ */
+uint32_t
+slv2_plugin_get_num_ports_of_type(SLV2Plugin p,
+ SLV2PortDirection dir,
+ SLV2PortDataType type);
+
+
/** Return whether or not the plugin introduces (and reports) latency.
*
* The index of the latency port can be found with slv2_plugin_get_latency_port
@@ -344,6 +369,39 @@ SLV2UIs
slv2_plugin_get_uis(SLV2Plugin plugin);
+/** Get the full name of the plugin's author.
+ *
+ * Returns NULL if author name is not present.
+ * Returned value must be freed by caller.
+ *
+ * Time = Query
+ */
+char*
+slv2_plugin_get_author_name(SLV2Plugin plugin);
+
+
+/** Get the email address of the plugin's author.
+ *
+ * Returns NULL if author email address is not present.
+ * Returned value must be freed by caller.
+ *
+ * Time = Query
+ */
+char*
+slv2_plugin_get_author_email(SLV2Plugin plugin);
+
+
+/** Get the email address of the plugin's author.
+ *
+ * Returns NULL if author homepage is not present.
+ * Returned value must be freed by caller.
+ *
+ * Time = Query
+ */
+char*
+slv2_plugin_get_author_homepage(SLV2Plugin plugin);
+
+
/** @} */
#ifdef __cplusplus
diff --git a/slv2/pluginclasses.h b/slv2/pluginclasses.h
index b4cd08d..f283356 100644
--- a/slv2/pluginclasses.h
+++ b/slv2/pluginclasses.h
@@ -19,12 +19,12 @@
#ifndef __SLV2_PLUGIN_CLASSES_H__
#define __SLV2_PLUGIN_CLASSES_H__
-#include <slv2/pluginclass.h>
-
#ifdef __cplusplus
extern "C" {
#endif
+#include <slv2/pluginclass.h>
+
/** \addtogroup slv2_collections
* @{
*/
diff --git a/slv2/plugins.h b/slv2/plugins.h
index 6b8eead..274696e 100644
--- a/slv2/plugins.h
+++ b/slv2/plugins.h
@@ -19,13 +19,13 @@
#ifndef __SLV2_PLUGINS_H__
#define __SLV2_PLUGINS_H__
-#include <slv2/types.h>
-#include <slv2/plugin.h>
-
#ifdef __cplusplus
extern "C" {
#endif
+#include <slv2/types.h>
+#include <slv2/plugin.h>
+
/** \addtogroup slv2_collections
* @{
*/
diff --git a/slv2/pluginuiinstance.h b/slv2/pluginuiinstance.h
index 1384d7c..e0e6349 100644
--- a/slv2/pluginuiinstance.h
+++ b/slv2/pluginuiinstance.h
@@ -1,6 +1,5 @@
/* SLV2
* Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- * Author: Lars Luthman
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
diff --git a/slv2/pluginuis.h b/slv2/pluginuis.h
index b14e61a..6c91d45 100644
--- a/slv2/pluginuis.h
+++ b/slv2/pluginuis.h
@@ -19,13 +19,13 @@
#ifndef __SLV2_PLUGIN_UIS_H__
#define __SLV2_PLUGIN_UIS_H__
-#include <slv2/types.h>
-#include <slv2/plugin.h>
-
#ifdef __cplusplus
extern "C" {
#endif
+#include <slv2/types.h>
+#include <slv2/plugin.h>
+
/** \addtogroup slv2_collections
*
* @{
diff --git a/slv2/port.h b/slv2/port.h
index 2cf0e30..7846541 100644
--- a/slv2/port.h
+++ b/slv2/port.h
@@ -52,16 +52,14 @@ slv2_port_get_properties(SLV2Plugin plugin,
SLV2Port port);
-#if 0
/** Return whether a port has a certain property.
*
* Time = Query
*/
bool
-slv2_port_has_property(SLV2Plugin p,
- SLV2Port port,
- SLV2Value hint)
-#endif
+slv2_port_has_property(SLV2Plugin p,
+ SLV2Port port,
+ const char* property_uri);
/** Get the symbol of a port given the index.
diff --git a/slv2/portsignature.h b/slv2/portsignature.h
new file mode 100644
index 0000000..700b572
--- /dev/null
+++ b/slv2/portsignature.h
@@ -0,0 +1,53 @@
+/* SLV2
+ * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __SLV2_PORTSIGNATURE_H__
+#define __SLV2_PORTSIGNATURE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdbool.h>
+#include <slv2/types.h>
+
+/** \addtogroup slv2_data
+ * @{
+ */
+
+
+/** Get the direction (input or output) of the port.
+ */
+SLV2PortDirection
+slv2_port_signature_get_direction(SLV2PortSignature sig);
+
+
+/** Get the type (e.g. audio, midi) of the port.
+ */
+SLV2PortDataType
+slv2_port_signature_get_type(SLV2PortSignature sig);
+
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __SLV2_PORTSIGNATURE_H__ */
+
diff --git a/slv2/slv2.h b/slv2/slv2.h
index 8aaf958..9aa5c8c 100644
--- a/slv2/slv2.h
+++ b/slv2/slv2.h
@@ -23,19 +23,21 @@
extern "C" {
#endif
-#include <slv2/types.h>
-#include <slv2/world.h>
-#include <slv2/pluginclass.h>
#include <slv2/plugin.h>
+#include <slv2/pluginclass.h>
+#include <slv2/plugininstance.h>
+#include <slv2/plugins.h>
#include <slv2/pluginui.h>
+#include <slv2/pluginuiinstance.h>
#include <slv2/pluginuis.h>
#include <slv2/port.h>
-#include <slv2/plugins.h>
-#include <slv2/pluginuiinstance.h>
-#include <slv2/plugininstance.h>
+#include <slv2/portsignature.h>
+#include <slv2/template.h>
+#include <slv2/types.h>
+#include <slv2/util.h>
#include <slv2/value.h>
#include <slv2/values.h>
-#include <slv2/util.h>
+#include <slv2/world.h>
#ifdef __cplusplus
}
diff --git a/slv2/template.h b/slv2/template.h
new file mode 100644
index 0000000..a65ae40
--- /dev/null
+++ b/slv2/template.h
@@ -0,0 +1,68 @@
+/* SLV2
+ * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __SLV2_TEMPLATE_H__
+#define __SLV2_TEMPLATE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdbool.h>
+#include <slv2/types.h>
+
+/** \addtogroup slv2_data
+ * @{
+ */
+
+
+/** Free an SLV2Template.
+ */
+void
+slv2_template_free(SLV2Template);
+
+
+/** Get the signature (direction and type) of a port
+ */
+SLV2PortSignature
+slv2_template_get_port(SLV2Template t,
+ uint32_t index);
+
+
+/** Get the total number of ports.
+ */
+uint32_t
+slv2_template_get_num_ports(SLV2Template t);
+
+
+/** Get the number of ports of a given direction and type.
+ */
+uint32_t
+slv2_template_get_num_ports_of_type(SLV2Template t,
+ SLV2PortDirection direction,
+ SLV2PortDataType type);
+
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __SLV2_TEMPLATE_H__ */
+
diff --git a/slv2/types.h b/slv2/types.h
index df818ce..1342934 100644
--- a/slv2/types.h
+++ b/slv2/types.h
@@ -19,13 +19,13 @@
#ifndef __SLV2_TYPES_H__
#define __SLV2_TYPES_H__
-#include <stdbool.h>
-#include <stdint.h>
-
#ifdef __cplusplus
extern "C" {
#endif
+#include <stdbool.h>
+#include <stdint.h>
+
/** (Data) Type of a port
*
@@ -73,6 +73,10 @@ typedef enum _SLV2URIType {
typedef struct _SLV2Port* SLV2Port;
+/** The port (I/O) signature of a plugin. Opaque, but valid to compare to NULL. */
+typedef struct _SLV2PortSignature* SLV2PortSignature;
+
+
/** A plugin. Opaque, but valid to compare to NULL. */
typedef struct _SLV2Plugin* SLV2Plugin;
@@ -97,6 +101,10 @@ typedef void* SLV2PluginClasses;
typedef struct _SLV2Value* SLV2Value;
+/** A plugin template (collection of port signatures). */
+typedef void* SLV2Template;
+
+
/** A collection of typed values. */
typedef void* SLV2Values;
diff --git a/slv2/util.h b/slv2/util.h
index 0313f6e..60c5d4d 100644
--- a/slv2/util.h
+++ b/slv2/util.h
@@ -19,12 +19,13 @@
#ifndef __SLV2_UTIL_H__
#define __SLV2_UTIL_H__
-#include <stdarg.h>
-
#ifdef __cplusplus
extern "C" {
#endif
+#include <stdarg.h>
+
+
/** \defgroup slv2_util Utility functions
*
* @{
diff --git a/slv2/values.h b/slv2/values.h
index 9d6c717..40da342 100644
--- a/slv2/values.h
+++ b/slv2/values.h
@@ -19,13 +19,13 @@
#ifndef __SLV2_VALUES_H__
#define __SLV2_VALUES_H__
-#include <stdbool.h>
-#include <slv2/value.h>
-
#ifdef __cplusplus
extern "C" {
#endif
+#include <stdbool.h>
+#include <slv2/value.h>
+
/** \defgroup slv2_collections Collections of values/objects
*
* Ordered collections of typed values which are fast for random
@@ -41,6 +41,12 @@ SLV2Values
slv2_values_new();
+/** Free an SLV2Values.
+ */
+void
+slv2_values_free(SLV2Values);
+
+
/** Get the number of elements in a string list.
*/
unsigned
@@ -57,7 +63,7 @@ SLV2Value
slv2_values_get_at(SLV2Values list, unsigned index);
-/** Return whether \a list contains \a string.
+/** Return whether \a list contains \a value.
*
* Time = O(n)
*/
@@ -65,12 +71,6 @@ bool
slv2_values_contains(SLV2Values list, SLV2Value value);
-/** Free a string list.
- */
-void
-slv2_values_free(SLV2Values);
-
-
/** @} */
#ifdef __cplusplus
diff --git a/slv2/world.h b/slv2/world.h
index 610d830..9d82dd7 100644
--- a/slv2/world.h
+++ b/slv2/world.h
@@ -19,14 +19,14 @@
#ifndef __SLV2_WORLD_H__
#define __SLV2_WORLD_H__
-#include <slv2/plugins.h>
-#include <slv2/pluginclasses.h>
-#include <librdf.h>
-
#ifdef __cplusplus
extern "C" {
#endif
+#include <slv2/plugins.h>
+#include <slv2/pluginclasses.h>
+#include <librdf.h>
+
/** \defgroup slv2_world Global library state
*
* The "world" represents all library state, and the data found in bundles'