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

Base plugin. More...

#include "zrythm-config.h"
#include "dsp/port.h"
#include "plugins/plugin_descriptor.h"
#include "plugins/plugin_identifier.h"
#include "plugins/plugin_preset.h"
#include "settings/plugin_settings.h"
#include "utils/types.h"
Include dependency graph for plugin.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

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

Macros

#define PLUGIN_SCHEMA_VERSION   1
 
#define PLUGIN_MAGIC   43198683
 
#define IS_PLUGIN(x)   (((Plugin *) x)->magic == PLUGIN_MAGIC)
 
#define IS_PLUGIN_AND_NONNULL(x)   (x && IS_PLUGIN (x))
 
#define PLUGIN_DEFAULT_BANK_URI   "https://lv2.zrythm.org#default-bank"
 
#define PLUGIN_INIT_PRESET_URI   "https://lv2.zrythm.org#init-preset"
 
#define PLUGIN_MIN_REFRESH_RATE   30.f
 Plugin UI refresh rate limits.
 
#define PLUGIN_MAX_REFRESH_RATE   121.f
 
#define PLUGIN_MIN_SCALE_FACTOR   0.5f
 Plugin UI scale factor limits.
 
#define PLUGIN_MAX_SCALE_FACTOR   4.f
 
#define plugin_is_in_active_project(self)    (self->track && track_is_in_active_project (self->track))
 
#define plugin_is_auditioner(self)    (self->track && track_is_auditioner (self->track))
 Whether the plugin is used for MIDI auditioning in SampleProcessor.
 

Typedefs

typedef struct _ModulatorWidget ModulatorWidget
 
typedef struct Lv2Plugin Lv2Plugin
 
typedef struct _WrappedObjectWithChangeSignal WrappedObjectWithChangeSignal
 

Functions

void plugin_init_loaded (Plugin *self, Track *track, MixerSelections *ms)
 
NONNULL void plugin_add_automation_track (Plugin *self, AutomationTrack *at)
 Adds an AutomationTrack to the Plugin.
 
NONNULL void plugin_add_in_port (Plugin *pl, Port *port)
 Adds an in port to the plugin's list.
 
NONNULL void plugin_add_out_port (Plugin *pl, Port *port)
 Adds an out port to the plugin's list.
 
Pluginplugin_new_from_setting (PluginSetting *setting, unsigned int track_name_hash, ZPluginSlotType slot_type, int slot, GError **error)
 Creates/initializes a plugin and its internal plugin (LV2, etc.) using the given setting.
 
Pluginplugin_new_dummy (ZPluginCategory cat, unsigned int track_name_hash, int slot)
 Create a dummy plugin for tests.
 
NONNULL void plugin_set_ui_refresh_rate (Plugin *self)
 Sets the UI refresh rate on the Plugin.
 
NONNULL Portplugin_get_enabled_port (Plugin *self)
 Gets the enable/disable port for this plugin.
 
NONNULL bool plugin_validate (Plugin *self)
 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.
 
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.
 
 NONNULL_ARGS (1) Plugin *plugin_clone(Plugin *src
 Clones the given plugin.
 
void plugin_get_full_port_group_designation (Plugin *self, const char *port_group, char *buf)
 
NONNULL Portplugin_get_port_in_group (Plugin *self, const char *port_group, bool left)
 
NONNULL Portplugin_get_port_in_same_group (Plugin *self, Port *port)
 Find corresponding port in the same port group (eg, if this is left, find right and vice versa).
 
NONNULL int plugin_activate (Plugin *pl, bool activate)
 Activates or deactivates the plugin.
 
NONNULL void plugin_move (Plugin *pl, Track *track, ZPluginSlotType slot_type, int slot, bool confirm_overwrite, bool fire_events)
 Moves the plugin to the given slot in the given channel.
 
NONNULL void plugin_set_track_and_slot (Plugin *pl, unsigned int track_name_hash, ZPluginSlotType slot_type, int slot)
 Sets the channel and slot on the plugin and its ports.
 
NONNULL void plugin_move_automation (Plugin *pl, Track *prev_track, Track *track, ZPluginSlotType new_slot_type, int new_slot)
 Moves the Plugin's automation from one Channel to another.
 
NONNULL void plugin_append_ports (Plugin *self, GPtrArray *ports)
 
NONNULL void plugin_expose_ports (Plugin *pl, bool expose, bool inputs, bool outputs)
 Exposes or unexposes plugin ports to the backend.
 
NONNULL Portplugin_get_port_by_symbol (Plugin *pl, const char *sym)
 Gets a port by its symbol.
 
NONNULL MALLOC char * plugin_get_escaped_name (Plugin *pl)
 Returns the escaped name of the plugin.
 
int plugin_copy_state_dir (Plugin *self, Plugin *src, bool is_backup, const char *abs_state_dir)
 Copies the state directory from the given source plugin to the given destination plugin's state directory.
 
NONNULL MALLOC char * plugin_get_abs_state_dir (Plugin *self, bool is_backup, bool create_if_not_exists)
 Returns the state dir as an absolute path.
 
NONNULL WARN_UNUSED_RESULT bool plugin_ensure_state_dir (Plugin *self, bool is_backup, GError **error)
 Ensures the state dir exists or creates it.
 
NONNULL void plugin_get_all (Project *prj, GPtrArray *arr, bool check_undo_manager)
 Returns all plugins in the current project.
 
NONNULL Pluginplugin_find (const PluginIdentifier *id)
 
NONNULL void plugin_update_identifier (Plugin *self)
 To be called when changes to the plugin identifier were made, so we can update all children recursively.
 
NONNULL void plugin_update_latency (Plugin *pl)
 Updates the plugin's latency.
 
NONNULL void plugin_generate_automation_tracks (Plugin *plugin, Track *track)
 Generates automatables for the plugin.
 
HOT NONNULL OPTIMIZE_O3 void plugin_prepare_process (Plugin *self)
 Prepare plugin for processing.
 
NONNULL void plugin_set_track_name_hash (Plugin *pl, unsigned int track_name_hash)
 Sets the track name hash on the plugin.
 
NONNULL HOT void plugin_process (Plugin *plugin, const EngineProcessTimeInfo *const time_nfo)
 Process plugin.
 
NONNULL MALLOC char * plugin_generate_window_title (Plugin *plugin)
 
NONNULL void plugin_open_ui (Plugin *plugin)
 Process show ui.
 
NONNULL bool plugin_is_selected (Plugin *pl)
 Returns if Plugin exists in MixerSelections.
 
NONNULL void plugin_select (Plugin *self, bool select, bool exclusive)
 Selects the plugin in the MixerSelections.
 
NONNULL bool plugin_is_enabled (Plugin *self, bool check_track)
 Returns whether the plugin is enabled.
 
NONNULL void plugin_set_enabled (Plugin *self, bool enabled, bool fire_events)
 
HOT NONNULL void plugin_process_passthrough (Plugin *self, const EngineProcessTimeInfo *const time_nfo)
 Processes the plugin by passing through the input to its output.
 
NONNULL int plugin_get_event_ports (Plugin *pl, Port **ports, int input)
 Returns the event ports in the plugin.
 
NONNULL void plugin_close_ui (Plugin *plugin)
 Process hide ui.
 
NONNULL void plugin_update_automatables (Plugin *plugin)
 (re)Generates automatables for the plugin.
 
PluginBankplugin_add_bank_if_not_exists (Plugin *self, const char *uri, const char *name)
 
NONNULL void plugin_add_preset_to_bank (Plugin *self, PluginBank *bank, PluginPreset *preset)
 
NONNULL void plugin_set_selected_bank_from_index (Plugin *self, int idx)
 
NONNULL void plugin_set_selected_preset_from_index (Plugin *self, int idx)
 
NONNULL void plugin_set_selected_preset_by_name (Plugin *self, const char *name)
 
NONNULL void plugin_set_caches (Plugin *self)
 Sets caches for processing.
 
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.
 
NONNULL void plugin_disconnect_from_plugin (Plugin *src, Plugin *dest)
 Disconnect the automatic connections from the given source Plugin to the given destination 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.
 
NONNULL void plugin_disconnect_from_prefader (Plugin *pl, Channel *ch)
 Disconnect the automatic connections from the Plugin to the Channel's prefader (if last Plugin).
 
NONNULL void plugin_disconnect (Plugin *plugin)
 To be called immediately when a channel or plugin is deleted.
 
NONNULL void plugin_delete_state_files (Plugin *self)
 Deletes any state files associated with this plugin.
 
NONNULL int plugin_cleanup (Plugin *self)
 Cleans up an instantiated but not activated plugin.
 
NONNULL void plugin_free (Plugin *plugin)
 Frees given plugin, breaks all its port connections, and frees its ports and other internal pointers.
 

Variables

GError ** error
 

Detailed Description

Base plugin.

Definition in file plugin.h.

Typedef Documentation

◆ Lv2Plugin

typedef struct Lv2Plugin Lv2Plugin

Definition at line 29 of file plugin.h.

◆ ModulatorWidget

typedef struct _ModulatorWidget ModulatorWidget

Definition at line 28 of file plugin.h.

◆ WrappedObjectWithChangeSignal

typedef struct _WrappedObjectWithChangeSignal WrappedObjectWithChangeSignal

Definition at line 32 of file plugin.h.