diff options
author | David Robillard <d@drobilla.net> | 2018-11-20 23:26:49 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-11-24 10:15:12 +0100 |
commit | 057410f84d1d4ffd509b38187f8764ca6064c202 (patch) | |
tree | 894d9731439c80e8894e2a3e7053d426350208cb /lv2/ui/ui.h | |
parent | 700b4e2a4c62b01a212ff73557f22316efddf3fe (diff) | |
download | lv2-057410f84d1d4ffd509b38187f8764ca6064c202.tar.xz |
WIP: Add feature to request parameter from from UI
Diffstat (limited to 'lv2/ui/ui.h')
-rw-r--r-- | lv2/ui/ui.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lv2/ui/ui.h b/lv2/ui/ui.h index 96fdbac..21dadf6 100644 --- a/lv2/ui/ui.h +++ b/lv2/ui/ui.h @@ -31,6 +31,7 @@ #include <stdint.h> #include "lv2/core/lv2.h" +#include "lv2/urid/urid.h" #define LV2_UI_URI "http://lv2plug.in/ns/extensions/ui" ///< http://lv2plug.in/ns/extensions/ui #define LV2_UI_PREFIX LV2_UI_URI "#" ///< http://lv2plug.in/ns/extensions/ui# @@ -344,6 +345,39 @@ typedef struct _LV2UI_Touch { } LV2UI_Touch; /** + A feature to request a new parameter value from the host. +*/ +typedef struct _LV2UI_Request_Parameter { + /** + Pointer to opaque data which must be passed to request(). + */ + LV2UI_Feature_Handle handle; + + /** + Request a value for a parameter from the host. The main use case for + this is a UI requesting a file path from the host, but conceptually it + can be used to request any parameter value. + + This function returns immediately, and the return value indicates + whether the host can fulfill the request. The host may notify the + plugin about any new parameter value, for example when a file is + selected by the user, via the usual mechanism. Typically, the host will + send a message (using the atom and path extensions) to the plugin that + sets the new parameter value, and the plugin will notify the UI via a + message as usual for any other parameter change. + + The can must determine details about the property, like the value type, + from the plugin data. + + @param handle The handle field of this struct. + @param key The URID of the parameter. + @return 0 on success, non-zero on error. + */ + uint32_t (*request)(LV2UI_Feature_Handle handle, + LV2_URID key); +} LV2UI_Request_Parameter; + +/** UI Idle Interface (LV2_UI__idleInterface) UIs can provide this interface to have an idle() callback called by the host |