Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
lv2_plugin.h File Reference

LV2 Plugin API. More...

#include "zrythm-config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dsp/port.h"
#include "dsp/position.h"
#include "plugins/lv2/ext/host_info.h"
#include "plugins/lv2/lv2_evbuf.h"
#include "plugins/lv2/lv2_external_ui.h"
#include "plugins/lv2/lv2_worker.h"
#include "zix/ring.h"
#include "zix/sem.h"
#include "zix/thread.h"
#include <lilv/lilv.h>
#include <lv2/data-access/data-access.h>
#include <lv2/log/log.h>
#include <lv2/options/options.h>
#include <lv2/state/state.h>
#include <lv2/urid/urid.h>
#include <sratom/sratom.h>
#include <suil/suil.h>
Include dependency graph for lv2_plugin.h:

Go to the source code of this file.

Data Structures

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 struct _GtkWidget GtkWidget
 
typedef struct _GtkCheckMenuItem GtkCheckMenuItem
 

Enumerations

enum  Lv2PluginPickUiFlag { LV2_PLUGIN_UI_WRAPPABLE , LV2_PLUGIN_UI_EXTERNAL , LV2_PLUGIN_UI_FOR_BRIDGING }
 In order of preference. More...
 

Functions

NONNULL void lv2_plugin_init_loaded (Lv2Plugin *self)
 
NONNULL PluginDescriptorlv2_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.
 
Lv2Pluginlv2_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 Lv2Pluginlv2_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 Portlv2_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.
 

Detailed Description

LV2 Plugin API.

Definition in file lv2_plugin.h.

Typedef Documentation

◆ GtkCheckMenuItem

typedef struct _GtkCheckMenuItem GtkCheckMenuItem

Definition at line 66 of file lv2_plugin.h.

◆ GtkWidget

typedef struct _GtkWidget GtkWidget

Definition at line 65 of file lv2_plugin.h.