10#ifndef __PLUGINS_PLUGIN_DESCRIPTOR_H__
11#define __PLUGINS_PLUGIN_DESCRIPTOR_H__
13#include "zrythm-config.h"
19#include <glib/gi18n.h>
21#include <CarlaBackend.h>
31#define PLUGIN_DESCRIPTOR_SCHEMA_VERSION 1
81static const cyaml_strval_t plugin_descriptor_category_strings[] = {
83 {
"Delay", PC_DELAY },
84 {
"Reverb", PC_REVERB },
85 {
"Distortion", PC_DISTORTION },
86 {
"Waveshaper", PC_WAVESHAPER },
87 {
"Dynamics", PC_DYNAMICS },
88 {
"Amplifier", PC_AMPLIFIER },
89 {
"Compressor", PC_COMPRESSOR },
90 {
"Envelope", PC_ENVELOPE },
91 {
"Expander", PC_EXPANDER },
93 {
"Limiter", PC_LIMITER },
94 {
"Filter", PC_FILTER },
95 {
"Allpass Filter", PC_ALLPASS_FILTER },
96 {
"Bandpass Filter", PC_BANDPASS_FILTER },
97 {
"Comb Filter", PC_COMB_FILTER },
99 {
"Multi-EQ", PC_MULTI_EQ },
100 {
"Parametric EQ", PC_PARA_EQ },
101 {
"Highpass Filter", PC_HIGHPASS_FILTER },
102 {
"Lowpass Filter", PC_LOWPASS_FILTER },
103 {
"Generator", PC_GENERATOR },
104 {
"Constant", PC_CONSTANT },
105 {
"Instrument", PC_INSTRUMENT },
106 {
"Oscillator", PC_OSCILLATOR },
108 {
"Modulator", PC_MODULATOR },
109 {
"Chorus", PC_CHORUS },
110 {
"Flanger", PC_FLANGER },
111 {
"Phaser", PC_PHASER },
112 {
"Simulator", PC_SIMULATOR },
113 {
"Simulator Reverb", PC_SIMULATOR_REVERB },
114 {
"Spatial", PC_SPATIAL },
115 {
"Spectral", PC_SPECTRAL },
116 {
"Pitch", PC_PITCH },
117 {
"Utility", PC_UTILITY },
118 {
"Analyzer", PC_ANALYZER },
119 {
"Converter", PC_CONVERTER },
120 {
"Function", PC_FUNCTION },
121 {
"Mixer", PC_MIXER },
131 Z_PLUGIN_PROTOCOL_LV2,
132 Z_PLUGIN_PROTOCOL_DSSI,
133 Z_PLUGIN_PROTOCOL_LADSPA,
134 Z_PLUGIN_PROTOCOL_VST,
135 Z_PLUGIN_PROTOCOL_VST3,
136 Z_PLUGIN_PROTOCOL_AU,
137 Z_PLUGIN_PROTOCOL_SFZ,
138 Z_PLUGIN_PROTOCOL_SF2,
139 Z_PLUGIN_PROTOCOL_CLAP,
140 Z_PLUGIN_PROTOCOL_JSFX,
143static const cyaml_strval_t plugin_protocol_strings[] = {
145 {
"LV2", Z_PLUGIN_PROTOCOL_LV2 },
146 {
"DSSI", Z_PLUGIN_PROTOCOL_DSSI },
147 {
"LADSPA", Z_PLUGIN_PROTOCOL_LADSPA},
148 {
"VST", Z_PLUGIN_PROTOCOL_VST },
149 {
"VST3", Z_PLUGIN_PROTOCOL_VST3 },
150 {
"AU", Z_PLUGIN_PROTOCOL_AU },
151 {
"SFZ", Z_PLUGIN_PROTOCOL_SFZ },
152 {
"SF2", Z_PLUGIN_PROTOCOL_SF2 },
153 {
"CLAP", Z_PLUGIN_PROTOCOL_CLAP },
154 {
"JSFX", Z_PLUGIN_PROTOCOL_JSFX },
166static const cyaml_strval_t plugin_architecture_strings[] = {
168 {
"64-bit", ARCH_64},
181static const cyaml_strval_t carla_bridge_mode_strings[] = {
182 {
"None", CARLA_BRIDGE_NONE},
183 {
"UI", CARLA_BRIDGE_UI },
184 {
"Full", CARLA_BRIDGE_FULL},
248static const cyaml_schema_field_t plugin_descriptor_fields_schema[] = {
253 YAML_FIELD_ENUM (
PluginDescriptor, category, plugin_descriptor_category_strings),
268 YAML_FIELD_ENUM (
PluginDescriptor, min_bridge_mode, carla_bridge_mode_strings),
276static const cyaml_schema_value_t plugin_descriptor_schema = {
281plugin_descriptor_new (
void);
287plugin_protocol_from_str (
const char * str);
289static inline const char *
292 const char * icon = NULL;
295 case Z_PLUGIN_PROTOCOL_LV2:
298 case Z_PLUGIN_PROTOCOL_LADSPA:
299 icon =
"logo-ladspa";
301 case Z_PLUGIN_PROTOCOL_AU:
304 case Z_PLUGIN_PROTOCOL_VST:
305 case Z_PLUGIN_PROTOCOL_VST3:
308 case Z_PLUGIN_PROTOCOL_SFZ:
309 case Z_PLUGIN_PROTOCOL_SF2:
310 icon =
"file-music-line";
326plugin_descriptor_get_carla_plugin_type_from_protocol (
ZPluginProtocol protocol);
329plugin_descriptor_get_protocol_from_carla_plugin_type (PluginType ptype);
332plugin_descriptor_get_category_from_carla_category_str (
const char * category);
335plugin_descriptor_get_category_from_carla_category (PluginCategory carla_cat);
443plugin_descriptor_free_closure (
void * data, GClosure * closure);
NONNULL 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_is_valid_for_slot_type(const PluginDescriptor *self, int slot_type, int track_type)
Returns if the given plugin identifier can be dropped in a slot of the given type.
NONNULL CarlaBridgeMode plugin_descriptor_get_min_bridge_mode(const PluginDescriptor *self)
Returns the minimum bridge mode required for this plugin.
NONNULL int plugin_descriptor_is_midi_modifier(const PluginDescriptor *const descr)
Returns if the Plugin is a midi modifier or not.
NONNULL bool plugin_descriptor_is_instrument(const PluginDescriptor *const descr)
Returns if the Plugin is an instrument or not.
NONNULL bool plugin_descriptor_is_whitelisted(const PluginDescriptor *self)
Returns whether the plugin is known to work, so it should be whitelisted.
PluginArchitecture
32 or 64 bit.
CarlaBridgeMode
Carla bridge mode.
NONNULL bool plugin_descriptor_is_effect(const PluginDescriptor *const descr)
Returns if the Plugin is an effect or not.
const char * plugin_descriptor_get_icon_name(const PluginDescriptor *const self)
Gets an appropriate icon name for the given descriptor.
ZPluginProtocol
Plugin protocol.
ZPluginCategory
Plugin category.
NONNULL void plugin_descriptor_copy(PluginDescriptor *dest, const PluginDescriptor *src)
Clones the plugin descriptor.
NONNULL PluginDescriptor * plugin_descriptor_clone(const PluginDescriptor *src)
Clones the plugin descriptor.
NONNULL ZPluginCategory plugin_descriptor_string_to_category(const char *str)
Returns the ZPluginCategory matching the given string.
NONNULL bool plugin_descriptor_has_custom_ui(const PluginDescriptor *self)
Returns if the Plugin has a supported custom UI.
NONNULL int plugin_descriptor_is_modulator(const PluginDescriptor *const descr)
Returns if the Plugin is a modulator or not.
@ Z_PLUGIN_PROTOCOL_DUMMY
Dummy protocol for tests.
@ ZPLUGIN_CATEGORY_NONE
None specified.
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
CarlaBridgeMode min_bridge_mode
Minimum required bridge mode.
int num_midi_ins
Number of MIDI input ports.
int num_midi_outs
Number of MIDI output ports.
ZPluginProtocol protocol
Plugin protocol (Lv2/DSSI/LADSPA/VST/etc.).
int num_audio_outs
Number of audio output ports.
int num_cv_outs
Number of output CV ports.
char * category_str
Lv2 plugin subcategory.
WrappedObjectWithChangeSignal * gobj
Used in Gtk.
int num_ctrl_ins
Number of input control (plugin param) ports.
char * sha1
SHA1 of the file (replaces ghash).
char * path
Path, if not an Lv2Plugin which uses URIs.
unsigned int ghash
Hash of the plugin's bundle (.so/.ddl for VST) used when caching PluginDescriptor's,...
int num_ctrl_outs
Number of output control (plugin param) ports.
PluginArchitecture arch
Architecture (32/64bit).
int num_cv_ins
Number of input CV ports.
int64_t unique_id
Used for VST.
int num_audio_ins
Number of audio input ports.
A GObject-ified normal C object with a signal that interested parties can listen to for changes.