Plugins module

Audio plugin handling.

Contents

Classes

struct CachedVstDescriptors
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.

Typedefs

using CachedVstDescriptors = struct CachedVstDescriptors
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 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_vst_descriptors_new(void) -> CachedVstDescriptors*
Reads the file and fills up the object.
auto cached_vst_descriptors_is_blacklisted(CachedVstDescriptors* self, const char* abs_path) -> int
Returns if the plugin at the given path is blacklisted or not.
auto cached_vst_descriptors_get(CachedVstDescriptors* self, const char* abs_path) -> PluginDescriptor*
Returns the PluginDescriptor corresponding to the .so/.dll file at the given path, if it exists and the MD5 hash matches.
void cached_vst_descriptors_blacklist(CachedVstDescriptors* self, const char* abs_path, int _serialize)
Appends a descriptor to the cache.
void cached_vst_descriptors_add(CachedVstDescriptors* self, PluginDescriptor* descr, int _serialize)
Appends a descriptor to the cache.
void cached_vst_descriptors_clear(CachedVstDescriptors* 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, int free_ats)
Removes the automation tracks associated with this plugin from the automation tracklist in the corresponding track.
auto plugin_clone(Plugin* pl) -> Plugin*
Clones the given plugin.
void plugin_set_channel_and_slot(Plugin* pl, Channel* ch, 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, Channel* prev_ch, Channel* ch, PluginSlotType new_slot_type, int new_slot)
Moves the Plugin's automation from one Channel to another.
auto plugin_get_escaped_name(Plugin* pl) -> char*
Returns the escaped name of the plugin.
auto plugin_generate_state_dir(Plugin* pl, bool mkdir) -> char*
Generates a state directory path for the plugin.
auto plugin_has_supported_custom_ui(Plugin* self) -> int
Returns if the Plugin has a supported custom UI.
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* plugin) -> 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) -> int
Returns if Plugin exists in 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_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.
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_init(PluginManager* self)
Initializes plugin manager.
void plugin_manager_scan_plugins(PluginManager* self, const double max_progress, double* progress)
Scans for plugins, optionally updating the progress.

Enum documentation

enum CarlaPluginType

The type of the Carla plugin.

Typedef documentation

typedef enum CarlaPluginTypeCarlaPluginType

The type of the Carla plugin.

typedef struct PluginPlugin

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

typedef struct PluginGtkControllerPluginGtkController

Widget for a control.

typedef struct Lv2NodesLv2Nodes

Cached LV2 nodes.

typedef struct PluginManagerPluginManager

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

typedef struct PluginPresetIdentifierPluginPresetIdentifier

Preset identifier.

typedef struct PluginBankPluginBank

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

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, int free_ats)

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

Parameters
pl
free_ats Also free the ats.

Used e.g. when moving plugins.

Plugin* plugin_clone(Plugin* pl)

Clones the given plugin.

void plugin_set_channel_and_slot(Plugin* pl, Channel* ch, 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, Channel* prev_ch, Channel* ch, PluginSlotType new_slot_type, int new_slot)

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

char* plugin_get_escaped_name(Plugin* pl)

Returns the escaped name of the plugin.

char* plugin_generate_state_dir(Plugin* pl, bool mkdir)

Generates a state directory path for the plugin.

Parameters
pl
mkdir Create the directory at the path.
Returns The path. Must be free'd by caller with g_free().

int plugin_has_supported_custom_ui(Plugin* self)

Returns if the Plugin has a supported custom UI.

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* plugin)

Loads the plugin from its state file.

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.

int plugin_is_selected(Plugin* pl)

Returns if Plugin exists in MixerSelections.

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_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.

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_init(PluginManager* self)

Initializes plugin manager.

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.