Plugins module

Audio plugin handling.

Contents

Classes

struct CachedPluginDescriptors
Descriptors to be cached.
struct Plugin
The base plugin Inheriting plugins must have this as a child.
struct PluginGtkController
Widget for a control.
struct PluginIdentifier
Plugin identifier.
struct Lv2Nodes
Cached LV2 nodes.
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.

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_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 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 Lv2Nodes = struct Lv2Nodes
Cached LV2 nodes.
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.

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.
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(const Lv2Control* control, float value)
Called by generic UI callbacks when e.g.
void lv2_gtk_on_window_destroy(Lv2Plugin* plugin)
To be called by plugin_gtk both on generic UIs and normal UIs when a plugin window is destroyed.
void plugin_add_automation_track(Plugin* self, AutomationTrack* at)
Adds an AutomationTrack to the Plugin.
void plugin_add_in_port(Plugin* pl, Port* port)
Adds an in port to the plugin's list.
void plugin_add_out_port(Plugin* pl, Port* port)
Adds an out port to the plugin's list.
auto plugin_new_from_descr(PluginDescriptor* descr, int track_pos, int slot) -> Plugin*
Creates/initializes a plugin and its internal plugin (LV2, etc.) using the given descriptor.
auto plugin_new_dummy(ZPluginCategory cat, int track_pos, int slot) -> Plugin*
Create a dummy plugin for tests.
void plugin_set_ui_refresh_rate(Plugin* self)
Sets the UI refresh rate on the Plugin.
auto plugin_get_enabled_port(Plugin* self) -> Port*
Gets the enable/disable port for this plugin.
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.
auto plugin_clone(Plugin* pl, bool src_is_project) -> Plugin*
Clones the given plugin.
auto plugin_activate(Plugin* pl, bool activate) -> int
Activates or deactivates the plugin.
void plugin_move(Plugin* pl, Track* track, PluginSlotType slot_type, int slot)
Moves the plugin to the given slot in the given channel.
void plugin_set_track_and_slot(Plugin* pl, int track_pos, PluginSlotType slot_type, int slot)
Sets the channel and slot on the plugin and its ports.
auto plugin_descriptor_is_instrument(const PluginDescriptor* descr) -> int
Returns if the Plugin is an instrument or not.
void plugin_move_automation(Plugin* pl, Track* prev_track, Track* track, PluginSlotType new_slot_type, int new_slot)
Moves the Plugin's automation from one Channel to another.
void plugin_expose_ports(Plugin* pl, bool expose, bool inputs, bool outputs)
Exposes or unexposes plugin ports to the backend.
auto plugin_get_port_by_symbol(Plugin* pl, const char* sym) -> Port*
Gets a port by its symbol.
auto plugin_get_escaped_name(Plugin* pl) -> char*
Returns the escaped name of the plugin.
auto plugin_get_abs_state_dir(Plugin* self, bool is_backup) -> char*
Returns the state dir as an absolute path.
void plugin_ensure_state_dir(Plugin* self, bool is_backup)
Ensures the state dir exists or creates it.
void plugin_update_identifier(Plugin* self)
To be called when changes to the plugin identifier were made, so we can update all children recursively.
void plugin_update_latency(Plugin* pl)
Updates the plugin's latency.
void plugin_generate_automation_tracks(Plugin* plugin, Track* track)
Generates automatables for the plugin.
void plugin_prepare_process(Plugin* self)
Prepare plugin for processing.
auto plugin_instantiate(Plugin* self, bool project, LilvState* state) -> int
Loads the plugin from its state file.
void plugin_set_track_pos(Plugin* pl, int pos)
Sets the track and track_pos on the plugin.
void plugin_process(Plugin* plugin, const long g_start_frames, const nframes_t local_offset, const nframes_t nframes)
Process plugin.
void plugin_open_ui(Plugin* plugin)
Process show ui.
auto plugin_is_selected(Plugin* pl) -> bool
Returns if Plugin exists in MixerSelections.
auto plugin_has_custom_ui(Plugin* pl) -> bool
Returns whether the plugin has a custom UI.
void plugin_select(Plugin* pl, bool select, bool exclusive)
Selects the plugin in the MixerSelections.
auto plugin_is_enabled(Plugin* self) -> bool
Returns whether the plugin is enabled.
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.
auto plugin_get_event_ports(Plugin* pl, Port** ports, int input) -> int
Returns the event ports in the plugin.
void plugin_close_ui(Plugin* plugin)
Process hide ui.
void plugin_update_automatables(Plugin* plugin)
(re)Generates automatables for the plugin.
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.
void plugin_disconnect_from_plugin(Plugin* src, Plugin* dest)
Disconnect the automatic connections from the given source Plugin to the given destination Plugin.
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.
void plugin_disconnect_from_prefader(Plugin* pl, Channel* ch)
Disconnect the automatic connections from the Plugin to the Channel's prefader (if last Plugin).
void plugin_disconnect(Plugin* plugin)
To be called immediately when a channel or plugin is deleted.
void plugin_delete_state_files(Plugin* self)
Deletes any state files associated with this plugin.
auto plugin_cleanup(Plugin* self) -> int
Cleans up an instantiated but not activated plugin.
void plugin_free(Plugin* plugin)
Frees given plugin, breaks all its port connections, and frees its ports and other internal pointers.
void plugin_descriptor_copy(const PluginDescriptor* src, PluginDescriptor* dest)
Clones the plugin descriptor.
auto plugin_descriptor_clone(const PluginDescriptor* src) -> PluginDescriptor*
Clones the plugin descriptor.
auto plugin_descriptor_is_effect(PluginDescriptor* descr) -> int
Returns if the Plugin is an effect or not.
auto plugin_descriptor_is_modulator(PluginDescriptor* descr) -> int
Returns if the Plugin is a modulator or not.
auto plugin_descriptor_is_midi_modifier(PluginDescriptor* descr) -> int
Returns if the Plugin is a midi modifier or not.
auto plugin_descriptor_string_to_category(const char* str) -> 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) -> bool
Returns whether the two descriptors describe the same plugin, ignoring irrelevant fields.
auto plugin_descriptor_has_custom_ui(PluginDescriptor* self) -> bool
Returns if the Plugin has a supported custom UI.
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_close_window(Plugin* plugin)
Closes the window of the plugin.
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_combo_box(GtkComboBoxText* cb, 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_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.

Defines

#define PLUGIN_MIN_REFRESH_RATE
Plugin UI refresh rate limits.

Enum documentation

enum CarlaPluginType

The type of the Carla plugin.

enum CarlaBridgeMode

Carla bridge mode.

Typedef documentation

typedef enum CarlaPluginType CarlaPluginType

The type of the Carla plugin.

typedef struct Plugin Plugin

The base plugin Inheriting plugins must have this as a child.

typedef enum CarlaBridgeMode CarlaBridgeMode

Carla bridge mode.

typedef struct PluginGtkController PluginGtkController

Widget for a control.

typedef struct Lv2Nodes Lv2Nodes

Cached LV2 nodes.

typedef struct PluginManager PluginManager

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

typedef struct PluginPresetIdentifier PluginPresetIdentifier

Preset identifier.

typedef struct PluginPreset PluginPreset

Plugin preset.

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

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 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(const Lv2Control* control, float value)

Called by generic UI callbacks when e.g.

a slider changes value.

void lv2_gtk_on_window_destroy(Lv2Plugin* plugin)

To be called by plugin_gtk both on generic UIs and normal UIs when a plugin window is destroyed.

void plugin_add_in_port(Plugin* pl, Port* port)

Adds an in port to the plugin's list.

void plugin_add_out_port(Plugin* pl, Port* port)

Adds an out port to the plugin's list.

Plugin* plugin_new_from_descr(PluginDescriptor* descr, int track_pos, int slot)

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

Parameters
descr
track_pos The expected position of the track the plugin will be in.
slot The expected slot the plugin will be in.

Plugin* plugin_new_dummy(ZPluginCategory cat, int track_pos, int slot)

Create a dummy plugin for tests.

void plugin_set_ui_refresh_rate(Plugin* self)

Sets the UI refresh rate on the Plugin.

Port* plugin_get_enabled_port(Plugin* self)

Gets the enable/disable port for this plugin.

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* pl, bool src_is_project)

Clones the given plugin.

@bool src_is_project Whether pl is a project plugin.

int plugin_activate(Plugin* pl, bool activate)

Activates or deactivates the plugin.

Parameters
pl
activate True to activate, false to deactivate.

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

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

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

void plugin_set_track_and_slot(Plugin* pl, int track_pos, PluginSlotType slot_type, int slot)

Sets the channel and slot on the plugin and its ports.

int plugin_descriptor_is_instrument(const PluginDescriptor* descr)

Returns if the Plugin is an instrument or not.

void plugin_move_automation(Plugin* pl, Track* prev_track, Track* track, PluginSlotType new_slot_type, int new_slot)

Moves the Plugin's automation from one Channel to another.

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.

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

Gets a port by its symbol.

Only works for LV2 plugins.

char* plugin_get_escaped_name(Plugin* pl)

Returns the escaped name of the plugin.

char* plugin_get_abs_state_dir(Plugin* self, bool is_backup)

Returns the state dir as an absolute path.

void plugin_ensure_state_dir(Plugin* self, bool is_backup)

Ensures the state dir exists or creates it.

void plugin_update_identifier(Plugin* self)

To be called when changes to the plugin identifier were made, so we can update all children recursively.

void plugin_update_latency(Plugin* pl)

Updates the plugin's latency.

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.

void plugin_prepare_process(Plugin* self)

Prepare plugin for processing.

int plugin_instantiate(Plugin* self, bool project, LilvState* state)

Loads the plugin from its state file.

Parameters
self
project Whether this is a project plugin (as opposed to a clone used in actions).
state

Instantiates the plugin (e.g. when adding to a channel)

void plugin_set_track_pos(Plugin* pl, int pos)

Sets the track and track_pos on the plugin.

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.

void plugin_open_ui(Plugin* plugin)

Process show ui.

bool plugin_is_selected(Plugin* pl)

Returns if Plugin exists in MixerSelections.

bool plugin_has_custom_ui(Plugin* pl)

Returns whether the plugin has a custom UI.

void plugin_select(Plugin* pl, bool select, bool exclusive)

Selects the plugin in the MixerSelections.

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

bool plugin_is_enabled(Plugin* self)

Returns whether the plugin is enabled.

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.

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.

void plugin_close_ui(Plugin* plugin)

Process hide ui.

void plugin_update_automatables(Plugin* plugin)

(re)Generates automatables for the plugin.

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.

void plugin_disconnect_from_plugin(Plugin* src, Plugin* dest)

Disconnect the automatic connections from the given source Plugin to the given destination Plugin.

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.

void plugin_disconnect_from_prefader(Plugin* pl, Channel* ch)

Disconnect the automatic connections from the Plugin to the Channel's prefader (if last Plugin).

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.

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.

int plugin_cleanup(Plugin* self)

Cleans up an instantiated but not activated plugin.

void plugin_free(Plugin* plugin)

Frees given plugin, breaks all its port connections, and frees its ports and other internal pointers.

void plugin_descriptor_copy(const PluginDescriptor* src, PluginDescriptor* dest)

Clones the plugin descriptor.

PluginDescriptor* plugin_descriptor_clone(const PluginDescriptor* src)

Clones the plugin descriptor.

int plugin_descriptor_is_effect(PluginDescriptor* descr)

Returns if the Plugin is an effect or not.

int plugin_descriptor_is_modulator(PluginDescriptor* descr)

Returns if the Plugin is a modulator or not.

int plugin_descriptor_is_midi_modifier(PluginDescriptor* descr)

Returns if the Plugin is a midi modifier or not.

ZPluginCategory plugin_descriptor_string_to_category(const char* str)

Returns the ZPluginCategory matching the given string.

bool plugin_descriptor_is_valid_for_slot_type(PluginDescriptor* self, int slot_type, int track_type)

Returns if the given plugin identifier can be dropped in a slot of the given type.

bool plugin_descriptor_is_same_plugin(const PluginDescriptor* a, const PluginDescriptor* b)

Returns whether the two descriptors describe the same plugin, ignoring irrelevant fields.

bool plugin_descriptor_has_custom_ui(PluginDescriptor* self)

Returns if the Plugin has a supported custom UI.

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_close_window(Plugin* plugin)

Closes the window of the plugin.

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_combo_box(GtkComboBoxText* cb, 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_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.

Define documentation

#define PLUGIN_MIN_REFRESH_RATE

Plugin UI refresh rate limits.