Plugins module

Audio plugin handling.

Contents

Classes

struct CachedPluginDescriptors
Descriptors to be cached.
struct PluginCollection
Plugin collection used in the plugin browser.
struct PluginCollections
Serializable plugin collections.
struct Plugin
The base plugin Inheriting plugins must have this as a child.
struct PluginGtkController
Widget for a control.
struct PluginIdentifier
Plugin identifier.
struct PluginManager
The PluginManager is responsible for scanning and keeping track of available Plugin's.
struct PluginPresetIdentifier
Preset identifier.
struct PluginPreset
Plugin preset.
struct PluginBank
A plugin bank containing presets.
struct PluginSetting
A setting for a a specific plugin descriptor.

Enums

enum CarlaPluginType { CARLA_PLUGIN_NONE, CARLA_PLUGIN_RACK, CARLA_PLUGIN_PATCHBAY, CARLA_PLUGIN_PATCHBAY16, CARLA_PLUGIN_PATCHBAY32, CARLA_PLUGIN_PATCHBAY64 }
The type of the Carla plugin.
enum ZPluginCategory { ZPLUGIN_CATEGORY_NONE, PC_DELAY, PC_REVERB, PC_DISTORTION, PC_WAVESHAPER, PC_DYNAMICS, PC_AMPLIFIER, PC_COMPRESSOR, PC_ENVELOPE, PC_EXPANDER, PC_GATE, PC_LIMITER, PC_FILTER, PC_ALLPASS_FILTER, PC_BANDPASS_FILTER, PC_COMB_FILTER, PC_EQ, PC_MULTI_EQ, PC_PARA_EQ, PC_HIGHPASS_FILTER, PC_LOWPASS_FILTER, PC_GENERATOR, PC_CONSTANT, PC_INSTRUMENT, PC_OSCILLATOR, PC_MIDI, PC_MODULATOR, PC_CHORUS, PC_FLANGER, PC_PHASER, PC_SIMULATOR, PC_SIMULATOR_REVERB, PC_SPATIAL, PC_SPECTRAL, PC_PITCH, PC_UTILITY, PC_ANALYZER, PC_CONVERTER, PC_FUNCTION, PC_MIXER }
Plugin category.
enum PluginProtocol { PROT_DUMMY, PROT_LV2, PROT_DSSI, PROT_LADSPA, PROT_VST, PROT_VST3, PROT_AU, PROT_SFZ, PROT_SF2 }
Plugin protocol.
enum PluginArchitecture { ARCH_32, ARCH_64 }
32 or 64 bit.
enum CarlaBridgeMode { CARLA_BRIDGE_NONE, CARLA_BRIDGE_UI, CARLA_BRIDGE_FULL }
Carla bridge mode.
enum PluginSlotType { PLUGIN_SLOT_INVALID, PLUGIN_SLOT_INSERT, PLUGIN_SLOT_MIDI_FX, PLUGIN_SLOT_INSTRUMENT, PLUGIN_SLOT_MODULATOR }

Typedefs

using CachedPluginDescriptors = struct CachedPluginDescriptors
Descriptors to be cached.
using CarlaPluginType = enum CarlaPluginType
The type of the Carla plugin.
using PluginCollection = struct PluginCollection
Plugin collection used in the plugin browser.
using PluginCollections = struct PluginCollections
Serializable plugin collections.
using Plugin = struct Plugin
The base plugin Inheriting plugins must have this as a child.
using ZPluginCategory = enum ZPluginCategory
Plugin category.
using PluginProtocol = enum PluginProtocol
Plugin protocol.
using PluginArchitecture = enum PluginArchitecture
32 or 64 bit.
using CarlaBridgeMode = enum CarlaBridgeMode
Carla bridge mode.
using PluginGtkController = struct PluginGtkController
Widget for a control.
using PluginIdentifier = struct PluginIdentifier
Plugin identifier.
using PluginManager = struct PluginManager
The PluginManager is responsible for scanning and keeping track of available Plugin's.
using PluginPresetIdentifier = struct PluginPresetIdentifier
Preset identifier.
using PluginPreset = struct PluginPreset
Plugin preset.
using PluginBank = struct PluginBank
A plugin bank containing presets.
using PluginSetting = struct PluginSetting
A setting for a a specific plugin descriptor.

Functions

auto cached_plugin_descriptors_new(void) -> CachedPluginDescriptors*
Reads the file and fills up the object.
auto cached_plugin_descriptors_is_blacklisted(CachedPluginDescriptors* self, const char* abs_path) -> int
Returns if the plugin at the given path is blacklisted or not.
auto cached_plugin_descriptors_find(CachedPluginDescriptors* self, const PluginDescriptor* descr, bool check_valid, bool check_blacklisted) -> const PluginDescriptor*
Finds a descriptor matching the given one's unique identifiers.
auto cached_plugin_descriptors_get(CachedPluginDescriptors* self, const char* abs_path) -> PluginDescriptor**
Returns the PluginDescriptor's corresponding to the .so/.dll file at the given path, if it exists and the MD5 hash matches.
void cached_plugin_descriptors_blacklist(CachedPluginDescriptors* self, const char* abs_path, int _serialize)
Appends a descriptor to the cache.
void cached_plugin_descriptors_replace(CachedPluginDescriptors* self, const PluginDescriptor* _new_descr, bool _serialize)
Replaces a descriptor in the cache.
void cached_plugin_descriptors_add(CachedPluginDescriptors* self, const PluginDescriptor* descr, int _serialize)
Appends a descriptor to the cache.
void cached_plugin_descriptors_clear(CachedPluginDescriptors* self)
Clears the descriptors and removes the cache file.
auto plugin_collection_new(void) -> PluginCollection*
Creates a new plugin collection.
auto plugin_collection_clone(const PluginCollection* self) -> PluginCollection*
Clones a plugin collection.
auto plugin_collection_contains_descriptor(PluginCollection* self, const PluginDescriptor* descr, bool match_pointer) -> bool
Returns whether the collection contains the given descriptor.
void plugin_collection_add_descriptor(PluginCollection* self, const PluginDescriptor* descr)
Appends a descriptor to the collection.
void plugin_collection_remove_descriptor(PluginCollection* self, const PluginDescriptor* descr)
Removes the descriptor matching the given one from the collection.
void plugin_collection_clear(PluginCollection* self)
Removes all the descriptors.
auto plugin_collections_new(void) -> PluginCollections*
Reads the file and fills up the object.
void plugin_collections_add(PluginCollections* self, const PluginCollection* collection, bool serialize)
Appends a collection.
void plugin_collections_remove(PluginCollections* self, PluginCollection* collection, bool serialize)
Removes the given collection.
void lv2_gtk_ui_port_event(Lv2Plugin* plugin, uint32_t port_index, uint32_t buffer_size, uint32_t protocol, const void* buffer)
Called when there is a UI port event from the plugin.
void lv2_gtk_set_float_control(Lv2Plugin* lv2_plugin, Port* port, float value)
Called by generic UI callbacks when e.g.
auto lv2_gtk_open_ui(Lv2Plugin* plugin) -> int
Opens the LV2 plugin's UI (either wrapped with suil or external).
void lv2_gtk_on_save_preset_activate(GtkWidget* widget, Lv2Plugin* plugin, const char* path, const char* uri, bool add_prefix)
Called by plugin_gtk_on_save_preset_activate() on accept.
auto plugin_add_automation_track(Plugin* self, AutomationTrack* at) -> NONNULL void
Adds an AutomationTrack to the Plugin.
auto plugin_add_in_port(Plugin* pl, Port* port) -> NONNULL void
Adds an in port to the plugin's list.
auto plugin_add_out_port(Plugin* pl, Port* port) -> NONNULL void
Adds an out port to the plugin's list.
auto plugin_new_from_setting(PluginSetting* setting, unsigned int track_name_hash, PluginSlotType slot_type, int slot, GError** error) -> Plugin*
Creates/initializes a plugin and its internal plugin (LV2, etc.) using the given setting.
auto plugin_new_dummy(ZPluginCategory cat, unsigned int track_name_hash, int slot) -> Plugin*
Create a dummy plugin for tests.
auto plugin_set_ui_refresh_rate(Plugin* self) -> NONNULL void
Sets the UI refresh rate on the Plugin.
auto plugin_get_enabled_port(Plugin* self) -> NONNULL Port*
Gets the enable/disable port for this plugin.
auto plugin_validate(Plugin* self) -> NONNULL bool
Verifies that the plugin identifiers are valid.
void plugin_print(Plugin* self, char* buf, size_t buf_sz)
Prints the plugin to the buffer, if any, or to the log.
auto plugin_remove_ats_from_automation_tracklist(Plugin* pl, bool free_ats, bool fire_events) -> NONNULL void
Removes the automation tracks associated with this plugin from the automation tracklist in the corresponding track.
auto plugin_clone(Plugin* src, GError** error) -> Plugin*
Clones the given plugin.
auto plugin_get_port_in_same_group(Plugin* self, Port* port) -> NONNULL Port*
Find corresponding port in the same port group (eg, if this is left, find right and vice versa).
auto plugin_activate(Plugin* pl, bool activate) -> NONNULL int
Activates or deactivates the plugin.
auto plugin_move(Plugin* pl, Track* track, PluginSlotType slot_type, int slot, bool fire_events) -> NONNULL void
Moves the plugin to the given slot in the given channel.
auto plugin_set_track_and_slot(Plugin* pl, unsigned int track_name_hash, PluginSlotType slot_type, int slot) -> NONNULL void
Sets the channel and slot on the plugin and its ports.
auto plugin_move_automation(Plugin* pl, Track* prev_track, Track* track, PluginSlotType new_slot_type, int new_slot) -> NONNULL void
Moves the Plugin's automation from one Channel to another.
auto plugin_expose_ports(Plugin* pl, bool expose, bool inputs, bool outputs) -> NONNULL void
Exposes or unexposes plugin ports to the backend.
auto plugin_get_port_by_symbol(Plugin* pl, const char* sym) -> NONNULL Port*
Gets a port by its symbol.
auto plugin_get_port_by_param_uri(Plugin* pl, const char* uri) -> NONNULL Port*
Gets a port by its param URI.
auto plugin_get_escaped_name(Plugin* pl) -> NONNULL MALLOC char*
Returns the escaped name of the plugin.
auto plugin_get_abs_state_dir(Plugin* self, bool is_backup) -> NONNULL MALLOC char*
Returns the state dir as an absolute path.
auto plugin_ensure_state_dir(Plugin* self, bool is_backup) -> NONNULL void
Ensures the state dir exists or creates it.
auto plugin_update_identifier(Plugin* self) -> NONNULL void
To be called when changes to the plugin identifier were made, so we can update all children recursively.
auto plugin_update_latency(Plugin* pl) -> NONNULL void
Updates the plugin's latency.
auto plugin_generate_automation_tracks(Plugin* plugin, Track* track) -> NONNULL void
Generates automatables for the plugin.
auto plugin_prepare_process(Plugin* self) -> HOT NONNULL void
Prepare plugin for processing.
auto plugin_instantiate(Plugin* self, LilvState* state, GError** error) -> int
Instantiates the plugin (e.g.
auto plugin_set_track_name_hash(Plugin* pl, unsigned int track_name_hash) -> NONNULL void
Sets the track name hash on the plugin.
auto plugin_process(Plugin* plugin, const long g_start_frames, const nframes_t local_offset, const nframes_t nframes) -> NONNULL HOT void
Process plugin.
auto plugin_open_ui(Plugin* plugin) -> NONNULL void
Process show ui.
auto plugin_is_selected(Plugin* pl) -> NONNULL bool
Returns if Plugin exists in MixerSelections.
auto plugin_select(Plugin* self, bool select, bool exclusive) -> NONNULL void
Selects the plugin in the MixerSelections.
auto plugin_is_enabled(Plugin* self, bool check_track) -> NONNULL bool
Returns whether the plugin is enabled.
auto plugin_process_passthrough(Plugin* self, const long g_start_frames, const nframes_t local_offset, const nframes_t nframes) -> HOT NONNULL void
Processes the plugin by passing through the input to its output.
auto plugin_get_event_ports(Plugin* pl, Port** ports, int input) -> NONNULL int
Returns the event ports in the plugin.
auto plugin_close_ui(Plugin* plugin) -> NONNULL void
Process hide ui.
auto plugin_update_automatables(Plugin* plugin) -> NONNULL void
(re)Generates automatables for the plugin.
auto plugin_connect_to_plugin(Plugin* src, Plugin* dest) -> NONNULL void
Connect the output Ports of the given source Plugin to the input Ports of the given destination Plugin.
auto plugin_disconnect_from_plugin(Plugin* src, Plugin* dest) -> NONNULL void
Disconnect the automatic connections from the given source Plugin to the given destination Plugin.
auto plugin_connect_to_prefader(Plugin* pl, Channel* ch) -> NONNULL void
Connects the Plugin's output Port's to the input Port's of the given Channel's prefader.
auto plugin_disconnect_from_prefader(Plugin* pl, Channel* ch) -> NONNULL void
Disconnect the automatic connections from the Plugin to the Channel's prefader (if last Plugin).
auto plugin_disconnect(Plugin* plugin) -> NONNULL void
To be called immediately when a channel or plugin is deleted.
auto plugin_delete_state_files(Plugin* self) -> NONNULL void
Deletes any state files associated with this plugin.
auto plugin_cleanup(Plugin* self) -> NONNULL int
Cleans up an instantiated but not activated plugin.
auto plugin_free(Plugin* plugin) -> NONNULL void
Frees given plugin, breaks all its port connections, and frees its ports and other internal pointers.
auto plugin_descriptor_copy(PluginDescriptor* dest, const PluginDescriptor* src) -> NONNULL void
Clones the plugin descriptor.
auto plugin_descriptor_clone(const PluginDescriptor* src) -> NONNULL PluginDescriptor*
Clones the plugin descriptor.
auto plugin_descriptor_is_instrument(const PluginDescriptor* descr) -> NONNULL bool
Returns if the Plugin is an instrument or not.
auto plugin_descriptor_is_effect(PluginDescriptor* descr) -> NONNULL bool
Returns if the Plugin is an effect or not.
auto plugin_descriptor_is_modulator(PluginDescriptor* descr) -> NONNULL int
Returns if the Plugin is a modulator or not.
auto plugin_descriptor_is_midi_modifier(PluginDescriptor* descr) -> NONNULL int
Returns if the Plugin is a midi modifier or not.
auto plugin_descriptor_string_to_category(const char* str) -> NONNULL ZPluginCategory
Returns the ZPluginCategory matching the given string.
auto plugin_descriptor_is_valid_for_slot_type(PluginDescriptor* self, int slot_type, int track_type) -> bool
Returns if the given plugin identifier can be dropped in a slot of the given type.
auto plugin_descriptor_is_same_plugin(const PluginDescriptor* a, const PluginDescriptor* b) -> NONNULL bool
Returns whether the two descriptors describe the same plugin, ignoring irrelevant fields.
auto plugin_descriptor_has_custom_ui(const PluginDescriptor* self) -> NONNULL bool
Returns if the Plugin has a supported custom UI.
auto plugin_descriptor_get_min_bridge_mode(const PluginDescriptor* self) -> NONNULL CarlaBridgeMode
Returns the minimum bridge mode required for this plugin.
void plugin_gtk_create_window(Plugin* plugin)
Creates a new GtkWindow that will be used to either wrap plugin UIs or create generic UIs in.
void plugin_gtk_open_generic_ui(Plugin* plugin, bool fire_events)
Opens the generic UI of the plugin.
auto plugin_gtk_update_plugin_ui(Plugin* pl) -> NONNULL int
Called on each GUI frame to update the GTK UI.
auto plugin_gtk_close_ui(Plugin* plugin) -> int
Closes the plugin's UI (either LV2 wrapped with suil, generic or LV2 external).
auto plugin_gtk_setup_plugin_banks_combo_box(GtkComboBoxText* cb, Plugin* plugin) -> bool
Sets up the combo box with all the banks the plugin has.
auto plugin_gtk_setup_plugin_presets_list_box(GtkListBox* box, Plugin* plugin) -> bool
Sets up the combo box with all the presets the plugin has in the given bank, or all the presets if NULL is given.
auto plugin_gtk_new_label(const char* text, bool title, bool preformatted, float xalign, float yalign) -> GtkWidget*
Creates a label for a control.
void plugin_gtk_generic_set_widget_value(Plugin* pl, PluginGtkController* controller, uint32_t size, LV2_URID type, const void* body)
Called when a property changed or when there is a UI port event to set (update) the widget's value.
auto plugin_identifier_validate_slot_type_slot_combo(PluginSlotType slot_type, int slot) -> bool
Verifies that slot_type and slot is a valid combination.
auto plugin_manager_get_node(PluginManager* self, const char* uri) -> const LilvNode*
Returns a cached LilvNode for the given URI.
void plugin_manager_scan_plugins(PluginManager* self, const double max_progress, double* progress)
Scans for plugins, optionally updating the progress.
auto plugin_manager_find_plugin_from_uri(PluginManager* self, const char* uri) -> PluginDescriptor*
Returns the PluginDescriptor instance for the given URI.
auto plugin_manager_find_from_descriptor(PluginManager* self, const PluginDescriptor* src_descr) -> PluginDescriptor*
Finds and returns the PluginDescriptor instance matching the given descriptor.
auto plugin_manager_supports_protocol(PluginManager* self, PluginProtocol protocol) -> bool
Returns if the plugin manager supports the given plugin protocol.
auto plugin_manager_pick_instrument(PluginManager* self) -> PluginDescriptor*
Returns an instrument plugin, if any.
auto plugin_setting_new_default(const PluginDescriptor* descr) -> PluginSetting*NONNULL
Creates a plugin setting with the recommended settings for the given plugin descriptor based on the current setup.
auto plugin_setting_validate(PluginSetting* self) -> NONNULL void
Makes sure the setting is valid in the current run and changes any fields to make it conform.
auto plugin_setting_free(PluginSetting* self) -> NONNULL void
Frees the plugin setting.
auto plugin_settings_new(void) -> PluginSettings*
Reads the file and fills up the object.
auto plugin_settings_serialize_to_file(PluginSettings* self) -> NONNULL void
Serializes the current settings.
auto plugin_settings_find(PluginSettings* self, const PluginDescriptor* descr) -> NONNULL PluginSetting*
Finds a setting for the given plugin descriptor.
auto plugin_settings_set(PluginSettings* self, PluginSetting* setting, bool _serialize) -> NONNULL void
Replaces a setting or appends a setting to the cache.

Defines

#define PLUGIN_MIN_REFRESH_RATE
Plugin UI refresh rate limits.
#define PLUGIN_MIN_SCALE_FACTOR
Plugin UI scale factor limits.
#define plugin_is_auditioner(self)
Whether the plugin is used for MIDI auditioning in SampleProcessor.

Enum documentation

enum CarlaPluginType

The type of the Carla plugin.

Typedef documentation

typedef enum CarlaPluginType CarlaPluginType

The type of the Carla plugin.

typedef struct PluginGtkController PluginGtkController

Widget for a control.

typedef struct PluginManager PluginManager

The PluginManager is responsible for scanning and keeping track of available Plugin's.

typedef struct PluginBank PluginBank

A plugin bank containing presets.

If the plugin has no banks, there must be a default bank that will contain all the presets.

Function documentation

CachedPluginDescriptors* cached_plugin_descriptors_new(void)

Reads the file and fills up the object.

int cached_plugin_descriptors_is_blacklisted(CachedPluginDescriptors* self, const char* abs_path)

Returns if the plugin at the given path is blacklisted or not.

const PluginDescriptor* cached_plugin_descriptors_find(CachedPluginDescriptors* self, const PluginDescriptor* descr, bool check_valid, bool check_blacklisted)

Finds a descriptor matching the given one's unique identifiers.

Parameters
self
descr
check_valid Whether to check valid descriptors.
check_blacklisted Whether to check blacklisted descriptors.
Returns The found descriptor or NULL.

PluginDescriptor** cached_plugin_descriptors_get(CachedPluginDescriptors* self, const char* abs_path)

Returns the PluginDescriptor's corresponding to the .so/.dll file at the given path, if it exists and the MD5 hash matches.

Returns NULL-terminated array.

void cached_plugin_descriptors_blacklist(CachedPluginDescriptors* self, const char* abs_path, int _serialize)

Appends a descriptor to the cache.

void cached_plugin_descriptors_replace(CachedPluginDescriptors* self, const PluginDescriptor* _new_descr, bool _serialize)

Replaces a descriptor in the cache.

void cached_plugin_descriptors_add(CachedPluginDescriptors* self, const PluginDescriptor* descr, int _serialize)

Appends a descriptor to the cache.

void cached_plugin_descriptors_clear(CachedPluginDescriptors* self)

Clears the descriptors and removes the cache file.

bool plugin_collection_contains_descriptor(PluginCollection* self, const PluginDescriptor* descr, bool match_pointer)

Returns whether the collection contains the given descriptor.

Parameters
self
descr
match_pointer Whether to check pointers or the descriptor details.

void plugin_collections_add(PluginCollections* self, const PluginCollection* collection, bool serialize)

Appends a collection.

Parameters
self
collection
serialize Whether to serialize the updated cache now.

void plugin_collections_remove(PluginCollections* self, PluginCollection* collection, bool serialize)

Removes the given collection.

Parameters
self
collection
serialize Whether to serialize the updated cache now.

void lv2_gtk_ui_port_event(Lv2Plugin* plugin, uint32_t port_index, uint32_t buffer_size, uint32_t protocol, const void* buffer)

Called when there is a UI port event from the plugin.

void lv2_gtk_set_float_control(Lv2Plugin* lv2_plugin, Port* port, float value)

Called by generic UI callbacks when e.g.

a slider changes value.

int lv2_gtk_open_ui(Lv2Plugin* plugin)

Opens the LV2 plugin's UI (either wrapped with suil or external).

Use plugin_gtk_*() for generic UIs.

void lv2_gtk_on_save_preset_activate(GtkWidget* widget, Lv2Plugin* plugin, const char* path, const char* uri, bool add_prefix)

Called by plugin_gtk_on_save_preset_activate() on accept.

Plugin* plugin_new_from_setting(PluginSetting* setting, unsigned int track_name_hash, PluginSlotType slot_type, int slot, GError** error)

Creates/initializes a plugin and its internal plugin (LV2, etc.) using the given setting.

Parameters
setting
track_name_hash The expected name hash of track the plugin will be in.
slot_type
slot The expected slot the plugin will be in.
error

NONNULL void plugin_remove_ats_from_automation_tracklist(Plugin* pl, bool free_ats, bool fire_events)

Removes the automation tracks associated with this plugin from the automation tracklist in the corresponding track.

Parameters
pl
free_ats Also free the ats.
fire_events

Used e.g. when moving plugins.

Plugin* plugin_clone(Plugin* src, GError** error)

Clones the given plugin.

Parameters
src
error To be filled if an error occurred.
Returns The cloned plugin, or NULL if an error occurred.

NONNULL int plugin_activate(Plugin* pl, bool activate)

Activates or deactivates the plugin.

Parameters
pl
activate True to activate, false to deactivate.

NONNULL void plugin_move(Plugin* pl, Track* track, PluginSlotType slot_type, int slot, bool fire_events)

Moves the plugin to the given slot in the given channel.

If a plugin already exists, it deletes it and replaces it.

NONNULL void plugin_expose_ports(Plugin* pl, bool expose, bool inputs, bool outputs)

Exposes or unexposes plugin ports to the backend.

Parameters
pl
expose Expose or not.
inputs Expose/unexpose inputs.
outputs Expose/unexpose outputs.

NONNULL Port* plugin_get_port_by_symbol(Plugin* pl, const char* sym)

Gets a port by its symbol.

Only works for LV2 plugins.

NONNULL Port* plugin_get_port_by_param_uri(Plugin* pl, const char* uri)

Gets a port by its param URI.

Only works for LV2 plugins.

NONNULL void plugin_generate_automation_tracks(Plugin* plugin, Track* track)

Generates automatables for the plugin.

Parameters
plugin
track The Track this plugin belongs to. This is passed because the track might not be in the project yet so we can't fetch it through indices.

The plugin must be instantiated already.

int plugin_instantiate(Plugin* self, LilvState* state, GError** error)

Instantiates the plugin (e.g.

when adding to a channel)

NONNULL HOT void plugin_process(Plugin* plugin, const long g_start_frames, const nframes_t local_offset, const nframes_t nframes)

Process plugin.

Parameters
plugin
g_start_frames The global start frames.
local_offset
nframes The number of frames to process.

NONNULL void plugin_select(Plugin* self, bool select, bool exclusive)

Selects the plugin in the MixerSelections.

Parameters
self
select Select or deselect.
exclusive Whether to make this the only selected plugin or add it to the selections.

NONNULL bool plugin_is_enabled(Plugin* self, bool check_track)

Returns whether the plugin is enabled.

Parameters
self
check_track Whether to check if the track is enabled as well.

HOT NONNULL void plugin_process_passthrough(Plugin* self, const long g_start_frames, const nframes_t local_offset, const nframes_t nframes)

Processes the plugin by passing through the input to its output.

This is called when the plugin is bypassed.

NONNULL int plugin_get_event_ports(Plugin* pl, Port** ports, int input)

Returns the event ports in the plugin.

Parameters
pl
ports Array to fill in. Must be large enough.
input
Returns The number of ports in the array.

NONNULL void plugin_connect_to_plugin(Plugin* src, Plugin* dest)

Connect the output Ports of the given source Plugin to the input Ports of the given destination Plugin.

Used when automatically connecting a Plugin in the Channel strip to the next Plugin.

NONNULL void plugin_connect_to_prefader(Plugin* pl, Channel* ch)

Connects the Plugin's output Port's to the input Port's of the given Channel's prefader.

Used when doing automatic connections.

NONNULL void plugin_disconnect(Plugin* plugin)

To be called immediately when a channel or plugin is deleted.

A call to plugin_free can be made at any point later just to free the resources.

NONNULL void plugin_delete_state_files(Plugin* self)

Deletes any state files associated with this plugin.

This should be called when a plugin instance is removed from the project (including undo stacks) to remove any files not needed anymore.

void plugin_gtk_create_window(Plugin* plugin)

Creates a new GtkWindow that will be used to either wrap plugin UIs or create generic UIs in.

void plugin_gtk_open_generic_ui(Plugin* plugin, bool fire_events)

Opens the generic UI of the plugin.

Assumes plugin_gtk_create_window() has been called.

NONNULL int plugin_gtk_update_plugin_ui(Plugin* pl)

Called on each GUI frame to update the GTK UI.

int plugin_gtk_close_ui(Plugin* plugin)

Closes the plugin's UI (either LV2 wrapped with suil, generic or LV2 external).

bool plugin_gtk_setup_plugin_banks_combo_box(GtkComboBoxText* cb, Plugin* plugin)

Sets up the combo box with all the banks the plugin has.

Returns Whether any banks were added.

bool plugin_gtk_setup_plugin_presets_list_box(GtkListBox* box, Plugin* plugin)

Sets up the combo box with all the presets the plugin has in the given bank, or all the presets if NULL is given.

Returns Whether any presets were added.

GtkWidget* plugin_gtk_new_label(const char* text, bool title, bool preformatted, float xalign, float yalign)

Creates a label for a control.

Parameters
text
title Whether this is a title text (makes it bold).
preformatted Whether the text is preformatted.
xalign
yalign

TODO move to ui.

void plugin_gtk_generic_set_widget_value(Plugin* pl, PluginGtkController* controller, uint32_t size, LV2_URID type, const void* body)

Called when a property changed or when there is a UI port event to set (update) the widget's value.

const LilvNode* plugin_manager_get_node(PluginManager* self, const char* uri)

Returns a cached LilvNode for the given URI.

If a node doesn't exist for the given URI, a node is created and cached.

void plugin_manager_scan_plugins(PluginManager* self, const double max_progress, double* progress)

Scans for plugins, optionally updating the progress.

Parameters
self
max_progress Maximum progress for this stage.
progress Pointer to a double (0.0-1.0) to update based on the current progress.

PluginDescriptor* plugin_manager_find_plugin_from_uri(PluginManager* self, const char* uri)

Returns the PluginDescriptor instance for the given URI.

This instance is held by the plugin manager and must not be free'd.

PluginDescriptor* plugin_manager_find_from_descriptor(PluginManager* self, const PluginDescriptor* src_descr)

Finds and returns the PluginDescriptor instance matching the given descriptor.

This instance is held by the plugin manager and must not be free'd.

bool plugin_manager_supports_protocol(PluginManager* self, PluginProtocol protocol)

Returns if the plugin manager supports the given plugin protocol.

PluginDescriptor* plugin_manager_pick_instrument(PluginManager* self)

Returns an instrument plugin, if any.

NONNULL void plugin_setting_validate(PluginSetting* self)

Makes sure the setting is valid in the current run and changes any fields to make it conform.

For example, if the setting is set to not open with carla but the descriptor is for a VST plugin, this will set PluginSetting::open_with_carla to true.

NONNULL PluginSetting* plugin_settings_find(PluginSettings* self, const PluginDescriptor* descr)

Finds a setting for the given plugin descriptor.

Returns The found setting or NULL.

NONNULL void plugin_settings_set(PluginSettings* self, PluginSetting* setting, bool _serialize)

Replaces a setting or appends a setting to the cache.

This clones the setting before adding it.