a highly automated and intuitive digital audio workstation
No Matches
channel.h File Reference

API for Channel, representing a channel strip on the mixer. More...

#include "zrythm-config.h"
#include "dsp/channel_send.h"
#include "dsp/ext_port.h"
#include "dsp/fader.h"
#include "plugins/plugin.h"
#include "utils/audio.h"
#include "utils/yaml.h"
#include <gdk/gdk.h>
Include dependency graph for channel.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Channel
 A Channel is part of a Track (excluding Tracks that don't have Channels) and contains information related to routing and the Mixer. More...


#define CHANNEL_MAGIC   8431676
 Magic number to identify channels.
#define IS_CHANNEL(x)   (((Channel *) x)->magic == CHANNEL_MAGIC)
#define IS_CHANNEL_AND_NONNULL(x)   (x && IS_CHANNEL (x))
#define FOREACH_STRIP   for (int i = 0; i < STRIP_SIZE; i++)
#define FOREACH_AUTOMATABLE(ch)   for (int i = 0; i < ch->num_automatables; i++)
#define MAX_FADER_AMP   1.42f
#define channel_is_in_active_project(self)    (self->track && track_is_in_active_project (self->track))


typedef struct _ChannelWidget ChannelWidget
typedef struct _TrackWidget TrackWidget


NONNULL void channel_init_loaded (Channel *channel, Track *track)
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_append_ports (Channel *self, GPtrArray *ports, bool include_plugins)
 Appends all channel ports and optionally plugin ports to the array.
NONNULL void channel_set_magic (Channel *self)
NONNULL void channel_expose_ports_to_backend (Channel *ch)
 Exposes the channel's ports to the backend.
void channel_connect (Channel *ch)
 Connects the channel's ports.
NONNULL void channel_set_phase (void *channel, float phase)
NONNULL float channel_get_phase (void *channel)
NONNULL void channel_set_balance_control (void *_channel, float pan)
NONNULL void channel_add_balance_control (void *_channel, float pan)
 Adds to (or subtracts from) the pan.
NONNULL float channel_get_balance_control (void *_channel)
NONNULL void channel_reset_fader (Channel *self, bool fire_events)
 Sets fader to 0.0.
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_prepare_process (Channel *channel)
 Prepares the channel for processing.
NONNULL Channelchannel_new (Track *track)
 Creates a channel of the given type with the given label.
NONNULL void channel_process (Channel *channel)
 The process function prototype.
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 Trackchannel_get_track (Channel *self)
NONNULL Trackchannel_get_output_track (Channel *self)
NONNULL void channel_reconnect_ext_input_ports (Channel *ch)
 Called when the input has changed for Midi, Instrument or Audio tracks.
NONNULL AutomationTrackchannel_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_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_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 int channel_get_plugins (Channel *self, Plugin **pls)
NONNULL bool channel_get_mono_compat_enabled (Channel *self)
 Gets whether mono compatibility is enabled.
NONNULL void channel_set_mono_compat_enabled (Channel *self, bool enabled, bool fire_events)
 Sets whether mono compatibility is enabled.
NONNULL bool channel_get_swap_phase (Channel *self)
 Gets whether mono compatibility is enabled.
NONNULL void channel_set_swap_phase (Channel *self, bool enabled, bool fire_events)
 Sets whether mono compatibility is enabled.
void channel_select_all (Channel *self, ZPluginSlotType type, bool select)
 Selects/deselects all plugins in the given slot type.
NONNULL void channel_set_caches (Channel *self)
 Sets caches for processing.
Channelchannel_clone (Channel *ch, Track *track, GError **error)
 Clones the channel recursively.
NONNULL void channel_disconnect (Channel *channel, bool remove_pl)
 Disconnects the channel from the processing chain.
NONNULL void channel_free (Channel *channel)
 Frees the channel.

Detailed Description

API for Channel, representing a channel strip on the mixer.

Definition in file channel.h.

Typedef Documentation

◆ ChannelWidget

typedef struct _ChannelWidget ChannelWidget

Definition at line 26 of file channel.h.

◆ TrackWidget

typedef struct _TrackWidget TrackWidget

Definition at line 28 of file channel.h.