aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-04-27 17:36:06 +0000
committerDavid Robillard <d@drobilla.net>2011-04-27 17:36:06 +0000
commiteee1f5fa6f285d304c1a987d0d83fa86bc1573c3 (patch)
tree00ef49f6207e035cd179a9af71fb296dfbd182f8
parent278dc277d7470fa107f01ccc2917fdcc4252aee6 (diff)
downloadlv2-eee1f5fa6f285d304c1a987d0d83fa86bc1573c3.tar.xz
More flexible discovery API (particularly for anything dynamic).
-rw-r--r--ext/pui.lv2/pui.h47
1 files changed, 41 insertions, 6 deletions
diff --git a/ext/pui.lv2/pui.h b/ext/pui.lv2/pui.h
index 660059c..257c792 100644
--- a/ext/pui.lv2/pui.h
+++ b/ext/pui.lv2/pui.h
@@ -318,18 +318,53 @@ typedef struct _LV2_PUI_Descriptor {
} LV2_PUI_Descriptor;
+typedef void* LV2_PUI_Lib_Data;
+
+/**
+ Descriptor for a plugin UI library.
+
+ Each plugin UI shared library has exactly one of these objects, accessed
+ via the lv2_pui_lib_descriptor() function in that library.
+*/
+typedef struct {
+ /**
+ Opaque library data which must be passed as the first parameter to
+ all the methods of this struct.
+ */
+ LV2_PUI_Lib_Data lib_data;
+
+ void (*cleanup)(LV2_PUI_Lib_Data lib_data);
+
+ /**
+ Prototype for UI accessor function.
+
+ This function follows the same rules as lv2_descriptor(), except it
+ applies to UIs rather than plugins.
+ */
+ LV2_PUI_Descriptor const* (*pui_descriptor)(LV2_PUI_Lib_Data lib_data,
+ uint32_t index);
+
+} LV2_PUI_Lib_Descriptor;
+
/**
- Prototype for UI accessor function.
+ Prototype for UI library accessor function.
- This function follows the same rules as lv2_desciprotr(), except it applies
- to UIs rather than plugins.
+ This is the entry point for a plugin UI library. Hosts load this symbol
+ from the library and call this function to obtain a library descriptor which
+ can be used to access all the UIs contained in this library. The returned
+ object must not be destroyed (with LV2_PUI_Lib_Descriptor::cleanup()) until
+ all UIs loaded from that library have been destroyed.
*/
-LV2_PUI_Descriptor const* lv2ui_descriptor(uint32_t index);
+LV2_PUI_Lib_Descriptor const* lv2_pui_lib_descriptor(
+ const char* bundle_path,
+ LV2_Feature const* const* features);
/**
- Type of the lv2ui_descriptor() function in a UI library.
+ Type of the lv2_pui_lib_descriptor() function in a UI library.
*/
-typedef LV2_PUI_Descriptor const* (*LV2_PUI_DescriptorFunction)(uint32_t index);
+typedef LV2_PUI_Lib_Descriptor const* (*LV2_PUI_Lib_Descriptor_Func)(
+ const char* bundle_path,
+ LV2_Feature const* const* features);
#ifdef __cplusplus
}