11#ifndef __AUDIO_CHANNEL_H__
12#define __AUDIO_CHANNEL_H__
14#include "zrythm-config.h"
37#define CHANNEL_SCHEMA_VERSION 2
40#define CHANNEL_MAGIC 8431676
41#define IS_CHANNEL(x) (((Channel *) x)->magic == CHANNEL_MAGIC)
42#define IS_CHANNEL_AND_NONNULL(x) (x && IS_CHANNEL (x))
44#define FOREACH_STRIP for (int i = 0; i < STRIP_SIZE; i++)
45#define FOREACH_AUTOMATABLE(ch) for (int i = 0; i < ch->num_automatables; i++)
46#define MAX_FADER_AMP 1.42f
48#define channel_is_in_active_project(self) \
49 (self->track && track_is_in_active_project (self->track))
107 int num_ext_stereo_l_ins;
122 int num_ext_stereo_r_ins;
202 const long g_frames_start,
213channel_set_magic (
Channel * self);
230channel_set_phase (
void * channel,
float phase);
233channel_get_phase (
void * channel);
236channel_set_balance_control (
void * _channel,
float pan);
245channel_get_balance_control (
void * _channel);
272 bool ask_if_overwrite);
331 bool gen_automatables,
336channel_get_track (
Channel * self);
339channel_get_output_track (
Channel * self);
379 bool deleting_plugin,
380 bool deleting_channel,
390 unsigned int old_name_hash,
391 unsigned int new_name_hash);
Backend for faders or other volume/gain controls.
NONNULL_ARGS(1) int undo_manager_undo(UndoManager *self
Undo last action.
void channel_select_all(Channel *self, ZPluginSlotType type, bool select)
Selects/deselects all plugins in the given slot type.
void channel_handle_plugin_import(Channel *self, const Plugin *pl, const MixerSelections *sel, const PluginDescriptor *descr, int slot, ZPluginSlotType slot_type, bool copy, bool ask_if_overwrite)
Handles import (paste/drop) of plugins or plugin descriptors or mixer selections.
NONNULL void channel_remove_plugin(Channel *channel, ZPluginSlotType slot_type, int slot, bool moving_plugin, bool deleting_plugin, bool deleting_channel, bool recalc_graph)
Removes a plugin at pos from the channel.
NONNULL void channel_add_balance_control(void *_channel, float pan)
Adds to (or subtracts from) the pan.
Channel * channel_clone(Channel *ch, Track *track, GError **error)
Clones the channel recursively.
#define EXT_PORTS_MAX
Maximum external ports.
NONNULL void channel_disconnect(Channel *channel, bool remove_pl)
Disconnects the channel from the processing chain.
NONNULL bool channel_add_plugin(Channel *channel, ZPluginSlotType slot_type, int pos, Plugin *plugin, bool confirm, bool moving_plugin, bool gen_automatables, bool recalc_graph, bool pub_events)
Adds given plugin to given position in the strip.
NONNULL void channel_free(Channel *channel)
Frees the channel.
NONNULL bool channel_get_mono_compat_enabled(Channel *self)
Gets whether mono compatibility is enabled.
void channel_append_ports(Channel *self, GPtrArray *ports, bool include_plugins)
Appends all channel ports and optionally plugin ports to the array.
NONNULL void channel_set_caches(Channel *self)
Sets caches for processing.
NONNULL void channel_set_mono_compat_enabled(Channel *self, bool enabled, bool fire_events)
Sets whether mono compatibility is enabled.
NONNULL void channel_expose_ports_to_backend(Channel *ch)
Exposes the channel's ports to the backend.
NONNULL void channel_update_track_name_hash(Channel *self, unsigned int old_name_hash, unsigned int new_name_hash)
Updates the track name hash in the channel and all related ports and identifiers.
NONNULL bool channel_get_swap_phase(Channel *self)
Gets whether mono compatibility is enabled.
NONNULL Channel * channel_new(Track *track)
Creates a channel of the given type with the given label.
NONNULL void channel_reset_fader(Channel *self, bool fire_events)
Sets fader to 0.0.
NONNULL AutomationTrack * channel_get_automation_track(Channel *channel, PortIdentifier::Flags port_flags)
Convenience function to get the automation track of the given type for the channel.
NONNULL void channel_process(Channel *channel)
The process function prototype.
NONNULL void channel_prepare_process(Channel *channel)
Prepares the channel for processing.
NONNULL void channel_handle_recording(Channel *self, const long g_frames_start, const nframes_t nframes)
Handles the recording logic inside the process cycle.
void channel_connect(Channel *ch)
Connects the channel's ports.
NONNULL void channel_set_swap_phase(Channel *self, bool enabled, bool fire_events)
Sets whether mono compatibility is enabled.
NONNULL void channel_reconnect_ext_input_ports(Channel *ch)
Called when the input has changed for Midi, Instrument or Audio tracks.
uint32_t nframes_t
Frame count.
#define STRIP_SIZE
Number of plugin slots per channel.
A Channel is part of a Track (excluding Tracks that don't have Channels) and contains information rel...
Plugin * instrument
The instrument plugin, if instrument track.
ExtPort * ext_stereo_l_ins[EXT_PORTS_MAX]
External audio L inputs that are currently connected to this channel as official inputs,...
Fader * prefader
Prefader.
Plugin * midi_fx[STRIP_SIZE]
The MIDI effect strip on instrument/MIDI tracks.
int midi_channels[16]
1 or 0 flags for each channel to enable it or disable it.
Track * track
Pointer to owner track.
int has_output
Whether or not output_pos corresponds to a Track or not.
bool all_stereo_r_ins
If true, the channel will connect to all stereo R ins found.
Plugin * inserts[STRIP_SIZE]
The channel insert strip.
bool all_stereo_l_ins
If true, the channel will connect to all stereo L ins found.
ChannelSend * sends[STRIP_SIZE]
The sends strip.
ExtPort * ext_midi_ins[EXT_PORTS_MAX]
External MIDI inputs that are currently connected to this channel as official inputs,...
bool all_midi_channels
If true, the channel will accept MIDI messages from all MIDI channels.
Fader * fader
The channel fader.
bool all_midi_ins
If true, the channel will connect to all MIDI ins found.
unsigned int output_name_hash
Output track.
Port * midi_out
MIDI output for sending MIDI signals to other destinations, such as other channels when directly rout...
ChannelWidget * widget
The channel widget.
int track_pos
Track associated with this channel.
int magic
This must be set to CHANNEL_MAGIC.
ExtPort * ext_stereo_r_ins[EXT_PORTS_MAX]
External audio R inputs that are currently connected to this channel as official inputs,...
int width
Channel widget width - reserved for future use.
A Fader is a processor that is used for volume controls and pan.
Selections to be used for the timeline's current selections, copying, undoing, etc.
The base plugin Inheriting plugins must have this as a child.
Must ONLY be created via port_new()
L & R port, for convenience.
Track to be inserted into the Project's Tracklist.