Zrythm
a highly automated and intuitive digital audio workstation
|
Data Structures | |
struct | Lv2URIDs |
Cached URIDs for quick access (instead of having to use symap). More... | |
struct | Lv2Parameter |
Used temporarily to transfer data. More... | |
struct | Lv2ControlChange |
Control change event, sent through ring buffers for UI updates. More... | |
struct | Lv2Plugin |
LV2 plugin. More... | |
Macros | |
#define | LV2_PLUGIN_MAGIC 58173672 |
#define | IS_LV2_PLUGIN(tr) (tr && tr->magic == LV2_PLUGIN_MAGIC) |
#define | LV2_ZRYTHM__defaultBank "https://lv2.zrythm.org#default-bank" |
#define | LV2_ZRYTHM__initPreset "https://lv2.zrythm.org#init-preset" |
#define | LV2_KX__externalUi |
#define | LV2_CORE__enabled LV2_CORE_PREFIX "enabled" |
#define | LV2_CORE__isSideChain LV2_CORE_PREFIX "isSideChain" |
#define | LV2_PARAM_MAX_STR_LEN 1200 |
#define | lv2_plugin_is_in_active_project(self) (plugin_is_in_active_project ((self)->plugin)) |
Typedefs | |
typedef int(* | PresetSink) (Lv2Plugin *plugin, const LilvNode *node, const LilvNode *title, void *data) |
Enumerations | |
enum | Lv2PluginPickUiFlag { LV2_PLUGIN_UI_WRAPPABLE , LV2_PLUGIN_UI_EXTERNAL , LV2_PLUGIN_UI_FOR_BRIDGING } |
In order of preference. More... | |
Functions | |
void | lv2_log_set_printf_funcs (LV2_Log_Log *log) |
Needed because we can't set them directly when gi18n.h is included. | |
int | lv2_log_vprintf (LV2_Log_Handle handle, LV2_URID type, const char *fmt, va_list ap) |
int | lv2_log_printf (LV2_Log_Handle handle, LV2_URID type, const char *fmt,...) |
NONNULL void | lv2_state_apply_state (Lv2Plugin *plugin, LilvState *state) |
WARN_UNUSED_RESULT NONNULL LilvState * | lv2_state_save_to_file (Lv2Plugin *pl, bool is_backup) |
Saves the plugin state to the filesystem and returns the state. | |
LilvState * | lv2_state_save_to_memory (Lv2Plugin *plugin) |
Saves the plugin state into a new LilvState that can be applied to any plugin with the same URI (like clones). | |
LilvState * | lv2_state_save_to_string (Lv2Plugin *pl, bool is_backup) |
Saves the plugin state to a string after writing the required files. | |
char * | lv2_state_make_path_temp (LV2_State_Make_Path_Handle handle, const char *path) |
LV2 State makePath feature for temporary files. | |
int | lv2_state_save_preset (Lv2Plugin *plugin, const char *dir, const char *uri, const char *label, const char *filename) |
Saves the preset. | |
bool | lv2_state_apply_preset (Lv2Plugin *plugin, const LilvNode *preset, const char *path, GError **error) |
Applies the given preset, or the preset in the path if preset is NULL. | |
int | lv2_state_delete_current_preset (Lv2Plugin *plugin) |
Deletes the current preset. | |
int | lv2_state_load_presets (Lv2Plugin *plugin, PresetSink sink, void *data) |
int | lv2_state_unload_presets (Lv2Plugin *plugin) |
bool | lv2_ui_is_resizable (Lv2Plugin *plugin) |
Returns if the UI of the plugin is resizable. | |
void | lv2_ui_init (Lv2Plugin *plugin) |
Inits the LV2 plugin UI. | |
void | lv2_ui_instantiate (Lv2Plugin *plugin) |
Instantiates the plugin UI. | |
void | lv2_ui_read_and_apply_events (Lv2Plugin *plugin, uint32_t nframes) |
Read and apply control change events from UI, for plugins that have their own UIs. | |
void | lv2_ui_send_event_from_ui_to_plugin (Lv2Plugin *plugin, uint32_t port_index, uint32_t buffer_size, uint32_t protocol, const void *buffer) |
Write events from the plugin's UI to the plugin. | |
int | lv2_ui_send_event_from_plugin_to_ui (Lv2Plugin *plugin, uint32_t port_index, uint32_t type, uint32_t size, const void *body) |
Send event to UI, called during the real time audio thread when processing the plugin. | |
NONNULL void | lv2_ui_send_control_val_event_from_plugin_to_ui (Lv2Plugin *lv2_plugin, Port *port) |
Similar to lv2_ui_send_event_from_plugin_to_ui except that it passes a float instead of an LV2 atom. | |
LV2_URID | lv2_urid_map_uri (LV2_URID_Map_Handle handle, const char *uri) |
URID feature map implementation. | |
const char * | lv2_urid_unmap_uri (LV2_URID_Unmap_Handle handle, LV2_URID urid) |
URID feature unmap implementation. | |
NONNULL void | lv2_plugin_init_loaded (Lv2Plugin *self) |
NONNULL PluginDescriptor * | lv2_plugin_create_descriptor_from_lilv (const LilvPlugin *lp) |
Returns a newly allocated plugin descriptor for the given LilvPlugin if it can be hosted, otherwise NULL. | |
Lv2Plugin * | lv2_plugin_new_from_uri (Plugin *plugin, const char *uri, GError **error) |
Creates an LV2 plugin from given uri. | |
int | lv2_plugin_instantiate (Lv2Plugin *self, bool use_state_file, char *preset_uri, LilvState *state, GError **error) |
Instantiate the plugin. | |
NONNULL Lv2Plugin * | lv2_plugin_new (Plugin *plugin) |
Creates a new LV2 plugin using the given Plugin instance. | |
NONNULL void | lv2_plugin_process (Lv2Plugin *self, const EngineProcessTimeInfo *const time_nfo) |
Processes the plugin for this cycle. | |
NONNULL nframes_t | lv2_plugin_get_latency (Lv2Plugin *pl) |
Returns the plugin's latency in samples. | |
NONNULL char * | lv2_plugin_has_deprecated_ui (const char *uri) |
Returns whether the plugin has a custom UI that is deprecated (GtkUI, QtUI, etc.). | |
NONNULL bool | lv2_plugin_is_ui_supported (const char *pl_uri, const char *ui_uri) |
Returns whether the given UI uri is supported. | |
void | lv2_plugin_get_uis (const char *pl_uri, char **uris, int *num_uris) |
Returns the UI URIs that this plugin has. | |
bool | lv2_plugin_pick_ui (const LilvUIs *uis, Lv2PluginPickUiFlag flag, const LilvUI **out_ui, const LilvNode **out_ui_type) |
Pick the most preferable UI for the given flag. | |
NONNULL char * | lv2_plugin_get_ui_class (const char *pl_uri, const char *ui_uri) |
NONNULL char * | lv2_plugin_get_ui_bundle_uri (const char *pl_uri, const char *ui_uri) |
Returns the bundle path of the UI as a URI. | |
NONNULL char * | lv2_plugin_get_ui_binary_uri (const char *pl_uri, const char *ui_uri) |
Returns the binary path of the UI as a URI. | |
bool | lv2_plugin_pick_most_preferable_ui (const char *plugin_uri, char **out_ui, char **out_ui_type, bool allow_bridged, bool print_result) |
Pick the most preferable UI. | |
NONNULL bool | lv2_plugin_ui_type_is_external (const LilvNode *ui_type) |
NONNULL bool | lv2_plugin_is_ui_external (const char *uri, const char *ui_uri, GError **error) |
void | lv2_plugin_set_control (Port *port, uint32_t size, LV2_URID type, const void *body) |
Ported from Lv2Control. | |
NONNULL Port * | lv2_plugin_get_property_port (Lv2Plugin *self, LV2_URID property) |
Returns the property port matching the given property URID. | |
const void * | lv2_plugin_get_port_value (const char *port_sym, void *user_data, uint32_t *size, uint32_t *type) |
Function to get a port value. | |
NONNULL char * | lv2_plugin_get_library_path (Lv2Plugin *self) |
NONNULL char * | lv2_plugin_get_abs_state_file_path (Lv2Plugin *self, bool is_backup) |
NONNULL void | lv2_plugin_allocate_port_buffers (Lv2Plugin *plugin) |
Allocate port buffers (only necessary for MIDI). | |
NONNULL int | lv2_plugin_activate (Lv2Plugin *self, bool activate) |
NONNULL bool | lv2_plugin_can_cleanup (const char *uri) |
Returns whether the plugin can be cleaned up (some plugins crash on cleanup). | |
NONNULL void | lv2_plugin_populate_banks (Lv2Plugin *self) |
Populates the banks in the plugin instance. | |
NONNULL int | lv2_plugin_cleanup (Lv2Plugin *self) |
NONNULL void | lv2_plugin_free (Lv2Plugin *self) |
Frees the Lv2Plugin and all its components. | |
LV2 plugin related code.
#define IS_LV2_PLUGIN | ( | tr | ) | (tr && tr->magic == LV2_PLUGIN_MAGIC) |
Definition at line 78 of file lv2_plugin.h.
#define LV2_CORE__enabled LV2_CORE_PREFIX "enabled" |
Definition at line 88 of file lv2_plugin.h.
#define LV2_CORE__isSideChain LV2_CORE_PREFIX "isSideChain" |
Definition at line 91 of file lv2_plugin.h.
#define LV2_KX__externalUi |
Definition at line 82 of file lv2_plugin.h.
#define LV2_PARAM_MAX_STR_LEN 1200 |
Definition at line 94 of file lv2_plugin.h.
#define lv2_plugin_is_in_active_project | ( | self | ) | (plugin_is_in_active_project ((self)->plugin)) |
Definition at line 96 of file lv2_plugin.h.
#define LV2_PLUGIN_MAGIC 58173672 |
Definition at line 77 of file lv2_plugin.h.
#define LV2_ZRYTHM__defaultBank "https://lv2.zrythm.org#default-bank" |
Definition at line 80 of file lv2_plugin.h.
#define LV2_ZRYTHM__initPreset "https://lv2.zrythm.org#init-preset" |
Definition at line 81 of file lv2_plugin.h.
typedef int(* PresetSink) (Lv2Plugin *plugin, const LilvNode *node, const LilvNode *title, void *data) |
Definition at line 31 of file lv2_state.h.
enum Lv2PluginPickUiFlag |
In order of preference.
Enumerator | |
---|---|
LV2_PLUGIN_UI_WRAPPABLE | Plugin UI wrappable using Suil. |
LV2_PLUGIN_UI_EXTERNAL | External/KxExternal UI. |
LV2_PLUGIN_UI_FOR_BRIDGING | Gtk2. |
Definition at line 436 of file lv2_plugin.h.
Returns the plugin's latency in samples.
This will be 0 if the plugin does not report latency.
const void * lv2_plugin_get_port_value | ( | const char * | port_sym, |
void * | user_data, | ||
uint32_t * | size, | ||
uint32_t * | type ) |
Function to get a port value.
Used when saving the state. This function MUST set size and type appropriately.
NONNULL char * lv2_plugin_has_deprecated_ui | ( | const char * | uri | ) |
Returns whether the plugin has a custom UI that is deprecated (GtkUI, QtUI, etc.).
int lv2_plugin_instantiate | ( | Lv2Plugin * | self, |
bool | use_state_file, | ||
char * | preset_uri, | ||
LilvState * | state, | ||
GError ** | error ) |
Instantiate the plugin.
All of the actual initialization is done here. If this is a new plugin, preset_uri should be empty. If the project is being loaded, preset uri should be the state file path.
self | Plugin to instantiate. |
use_state_file | Whether to use the plugin's state file to instantiate the plugin. |
preset_uri | URI of preset to load. |
state | State to load, if loading from a state. This is used when cloning plugins for example. The state of the original plugin is passed here. |
Creates an LV2 plugin from given uri.
Used when populating the plugin browser.
plugin | A newly created Plugin with its descriptor filled in. |
uri | The URI. |
bool lv2_plugin_pick_most_preferable_ui | ( | const char * | plugin_uri, |
char ** | out_ui, | ||
char ** | out_ui_type, | ||
bool | allow_bridged, | ||
bool | print_result ) |
Pick the most preferable UI.
Calls lv2_plugin_pick_ui().
[out] | ui | (Output) UI of the specific plugin. |
[out] | ui_type | UI type (eg, X11). |
bool lv2_plugin_pick_ui | ( | const LilvUIs * | uis, |
Lv2PluginPickUiFlag | flag, | ||
const LilvUI ** | out_ui, | ||
const LilvNode ** | out_ui_type ) |
Pick the most preferable UI for the given flag.
[out] | ui | (Output) UI of the specific plugin. |
[out] | ui_type | UI type (eg, X11). |
bool lv2_state_apply_preset | ( | Lv2Plugin * | plugin, |
const LilvNode * | preset, | ||
const char * | path, | ||
GError ** | error ) |
Applies the given preset, or the preset in the path if preset is NULL.
char * lv2_state_make_path_temp | ( | LV2_State_Make_Path_Handle | handle, |
const char * | path ) |
LV2 State makePath feature for temporary files.
Should be passed to LV2_Descriptor::instantiate() and this function must return an absolute path.
LilvState * lv2_state_save_to_memory | ( | Lv2Plugin * | plugin | ) |
Saves the plugin state into a new LilvState that can be applied to any plugin with the same URI (like clones).
Must be free'd with lilv_state_free().
void lv2_ui_init | ( | Lv2Plugin * | plugin | ) |
Inits the LV2 plugin UI.
To be called for generic, suil-wrapped and external UIs.
void lv2_ui_read_and_apply_events | ( | Lv2Plugin * | plugin, |
uint32_t | nframes ) |
Read and apply control change events from UI, for plugins that have their own UIs.
Called in the real-time audio thread during plugin processing.
nframes | Used for event ports. |
NONNULL void lv2_ui_send_control_val_event_from_plugin_to_ui | ( | Lv2Plugin * | lv2_plugin, |
Port * | port ) |
Similar to lv2_ui_send_event_from_plugin_to_ui except that it passes a float instead of an LV2 atom.
lv2_port | The port to pass the value of. |
int lv2_ui_send_event_from_plugin_to_ui | ( | Lv2Plugin * | plugin, |
uint32_t | port_index, | ||
uint32_t | type, | ||
uint32_t | size, | ||
const void * | body ) |
Send event to UI, called during the real time audio thread when processing the plugin.
type | Atom type. |
void lv2_ui_send_event_from_ui_to_plugin | ( | Lv2Plugin * | plugin, |
uint32_t | port_index, | ||
uint32_t | buffer_size, | ||
uint32_t | protocol, | ||
const void * | buffer ) |
Write events from the plugin's UI to the plugin.
protocol | format |
LV2_URID lv2_urid_map_uri | ( | LV2_URID_Map_Handle | handle, |
const char * | uri ) |
URID feature map implementation.
LV2_URID is just an int (uint32_t) for the given uri.