Zrythm
a highly automated and intuitive digital audio workstation
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
suil.h File Reference

API for Suil, an LV2 UI wrapper library. More...

#include "zrythm-config.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include "lv2/core/lv2.h"
#include "lv2/ui/ui.h"
#include <dlfcn.h>
#include <gtk/gtk.h>
Include dependency graph for suil.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SuilHost
 UI host descriptor. More...
 
struct  SuilWrapper
 
struct  SuilInstance
 An instance of an LV2 plugin UI. More...
 

Macros

#define GTK2_UI_URI   LV2_UI__GtkUI
 
#define GTK3_UI_URI   LV2_UI__Gtk3UI
 
#define GTK4_UI_URI   LV2_UI__Gtk4UI
 
#define QT4_UI_URI   LV2_UI__Qt4UI
 
#define QT5_UI_URI   LV2_UI__Qt5UI
 
#define X11_UI_URI   LV2_UI__X11UI
 
#define WIN_UI_URI   LV2_UI_PREFIX "WindowsUI"
 
#define COCOA_UI_URI   LV2_UI__CocoaUI
 
#define SUIL_ERRORF(fmt, ...)   g_warning("suil error: " fmt, __VA_ARGS__)
 

Typedefs

typedef void * SuilHandle
 Opaque pointer to a UI handle.
 
typedef void * SuilWidget
 Opaque pointer to a UI widget.
 
typedef void * SuilController
 UI controller.
 
typedef void(* SuilPortWriteFunc) (SuilController controller, uint32_t port_index, uint32_t buffer_size, uint32_t protocol, void const *buffer)
 Function to write/send a value to a port.
 
typedef uint32_t(* SuilPortIndexFunc) (SuilController controller, const char *port_symbol)
 Function to return the index for a port by symbol.
 
typedef uint32_t(* SuilPortSubscribeFunc) (SuilController controller, uint32_t port_index, uint32_t protocol, const LV2_Feature *const *features)
 Function to subscribe to notifications for a port.
 
typedef uint32_t(* SuilPortUnsubscribeFunc) (SuilController controller, uint32_t port_index, uint32_t protocol, const LV2_Feature *const *features)
 Function to unsubscribe from notifications for a port.
 
typedef void(* SuilTouchFunc) (SuilController controller, uint32_t port_index, bool grabbed)
 Function called when a control is grabbed or released.
 
typedef void(* SuilWrapperFreeFunc) (struct _SuilWrapper *)
 
typedef int(* SuilWrapperWrapFunc) (struct _SuilWrapper *wrapper, SuilInstance *instance)
 
typedef SuilWrapper *(* SuilWrapperNewFunc) (SuilHost *host, const char *host_type_uri, const char *ui_type_uri, LV2_Feature ***features, unsigned n_features)
 The type of the suil_wrapper_new entry point in a wrapper module.
 
typedef void(* SuilVoidFunc) (void)
 

Enumerations

enum  SuilArg { SUIL_ARG_NONE }
 Initialization argument. More...
 

Functions

void suil_init (int *argc, char ***argv, SuilArg key,...)
 Initialize suil.
 
SuilHost * suil_host_new (SuilPortWriteFunc write_func, SuilPortIndexFunc index_func, SuilPortSubscribeFunc subscribe_func, SuilPortUnsubscribeFunc unsubscribe_func)
 Create a new UI host descriptor.
 
void suil_host_set_touch_func (SuilHost *host, SuilTouchFunc touch_func)
 Set a touch function for a host descriptor.
 
void suil_host_free (SuilHost *host)
 Free host.
 
unsigned suil_ui_supported (const char *host_type_uri, const char *ui_type_uri)
 Check if suil can wrap a UI type.
 
SuilInstance * suil_instance_new (SuilHost *host, SuilController controller, const char *container_type_uri, const char *plugin_uri, const char *ui_uri, const char *ui_type_uri, const char *ui_bundle_path, const char *ui_binary_path, const LV2_Feature *const *features)
 Instantiate a UI for an LV2 plugin.
 
void suil_instance_free (SuilInstance *instance)
 Free a plugin UI instance.
 
SuilHandle suil_instance_get_handle (SuilInstance *instance)
 Get the handle for a UI instance.
 
SuilWidget suil_instance_get_widget (SuilInstance *instance)
 Get the widget for a UI instance.
 
void suil_instance_port_event (SuilInstance *instance, uint32_t port_index, uint32_t buffer_size, uint32_t format, const void *buffer)
 Notify the UI about a change in a plugin port.
 
const void * suil_instance_extension_data (SuilInstance *instance, const char *uri)
 Return a data structure defined by some LV2 extension URI.
 
SuilWrappersuil_wrapper_new_x11 (SuilHost *host, const char *host_type_uri, const char *ui_type_uri, LV2_Feature ***features, unsigned n_features)
 Prototype for suil_wrapper_new in each wrapper module.
 
SuilWrappersuil_wrapper_new_qt5 (SuilHost *host, const char *host_type_uri, const char *ui_type_uri, LV2_Feature ***features, unsigned n_features)
 Prototype for suil_wrapper_new in each wrapper module.
 
SuilWrappersuil_wrapper_new_woe (SuilHost *host, const char *host_type_uri, const char *ui_type_uri, LV2_Feature ***features, unsigned n_features)
 Prototype for suil_wrapper_new in each wrapper module.
 
SuilWrappersuil_wrapper_new_cocoa (SuilHost *host, const char *host_type_uri, const char *ui_type_uri, LV2_Feature ***features, unsigned n_features)
 Prototype for suil_wrapper_new in each wrapper module.
 
void suil_host_init (void)
 Prototype for suil_host_init in each init module.
 

Detailed Description

API for Suil, an LV2 UI wrapper library.

Definition in file suil.h.

Macro Definition Documentation

◆ COCOA_UI_URI

#define COCOA_UI_URI   LV2_UI__CocoaUI

Definition at line 54 of file suil.h.

◆ GTK2_UI_URI

#define GTK2_UI_URI   LV2_UI__GtkUI

Definition at line 47 of file suil.h.

◆ GTK3_UI_URI

#define GTK3_UI_URI   LV2_UI__Gtk3UI

Definition at line 48 of file suil.h.

◆ GTK4_UI_URI

#define GTK4_UI_URI   LV2_UI__Gtk4UI

Definition at line 49 of file suil.h.

◆ QT4_UI_URI

#define QT4_UI_URI   LV2_UI__Qt4UI

Definition at line 50 of file suil.h.

◆ QT5_UI_URI

#define QT5_UI_URI   LV2_UI__Qt5UI

Definition at line 51 of file suil.h.

◆ SUIL_ERRORF

#define SUIL_ERRORF ( fmt,
... )   g_warning("suil error: " fmt, __VA_ARGS__)

Definition at line 298 of file suil.h.

◆ WIN_UI_URI

#define WIN_UI_URI   LV2_UI_PREFIX "WindowsUI"

Definition at line 53 of file suil.h.

◆ X11_UI_URI

#define X11_UI_URI   LV2_UI__X11UI

Definition at line 52 of file suil.h.

Typedef Documentation

◆ SuilVoidFunc

typedef void(* SuilVoidFunc) (void)

Definition at line 396 of file suil.h.

◆ SuilWrapperFreeFunc

typedef void(* SuilWrapperFreeFunc) (struct _SuilWrapper *)

Definition at line 313 of file suil.h.

◆ SuilWrapperNewFunc

typedef SuilWrapper *(* SuilWrapperNewFunc) (SuilHost *host, const char *host_type_uri, const char *ui_type_uri, LV2_Feature ***features, unsigned n_features)

The type of the suil_wrapper_new entry point in a wrapper module.

This constructs a SuilWrapper which contains everything necessary to wrap a widget, including a possibly extended features array to be used for instantiating the UI.

Definition at line 345 of file suil.h.

◆ SuilWrapperWrapFunc

typedef int(* SuilWrapperWrapFunc) (struct _SuilWrapper *wrapper, SuilInstance *instance)

Definition at line 315 of file suil.h.