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

Backend for faders or other volume/gain controls. More...

#include "dsp/port.h"
#include "utils/types.h"
#include "utils/yaml.h"
Include dependency graph for fader.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Fader
 A Fader is a processor that is used for volume controls and pan. More...
 

Macros

#define FADER_SCHEMA_VERSION   2
 
#define MONITOR_FADER   (CONTROL_ROOM->monitor_fader)
 
#define FADER_MAGIC   32548791
 
#define IS_FADER(f)   (f->magic == FADER_MAGIC)
 
#define IS_FADER_AND_NONNULL(f)   (f && f->magic == FADER_MAGIC)
 
#define FADER_DEFAULT_FADE_FRAMES_SHORT   1024
 Causes loud volume in when < 1k.
 
#define FADER_DEFAULT_FADE_FRAMES    (ZRYTHM_TESTING ? FADER_DEFAULT_FADE_FRAMES_SHORT : 8192)
 
#define FADER_FADE_FRAMES_FOR_TYPE(f)
 
#define fader_is_in_active_project(self)    ((self->track != NULL && track_is_in_active_project (self->track)) || (self->sample_processor != NULL && sample_processor_is_in_active_project (self->sample_processor)) || (self->control_room != NULL && control_room_is_in_active_project (self->control_room)))
 
#define fader_get_listened(self)   (control_port_is_toggled (self->listen))
 Returns whether the fader is listened.
 

Enumerations

enum class  FaderType {
  FADER_TYPE_NONE , FaderType::FADER_TYPE_MONITOR , FaderType::FADER_TYPE_SAMPLE_PROCESSOR , FaderType::FADER_TYPE_AUDIO_CHANNEL ,
  FADER_TYPE_MIDI_CHANNEL , FaderType::FADER_TYPE_GENERIC
}
 Fader type. More...
 
enum class  MidiFaderMode { MidiFaderMode::MIDI_FADER_MODE_VEL_MULTIPLIER , MidiFaderMode::MIDI_FADER_MODE_CC_VOLUME }
 

Functions

COLD NONNULL_ARGS (1) void automation_tracklist_init_loaded(AutomationTracklist *self
 Inits a loaded AutomationTracklist.
 
COLD Faderfader_new (FaderType type, bool passthrough, Track *track, ControlRoom *control_room, SampleProcessor *sample_processor)
 Creates a new fader.
 
Faderfader_find_from_port_identifier (const PortIdentifier *id)
 
Portfader_create_swap_phase_port (Fader *self, bool passthrough)
 
NONNULL void fader_append_ports (const Fader *self, GPtrArray *ports)
 Appends the ports owned by fader to the given array.
 
void fader_set_amp (void *self, float amp)
 Sets the amplitude of the fader.
 
void fader_set_amp_with_action (Fader *self, float amp_from, float amp_to, bool skip_if_equal)
 Sets the amp value with an undoable action.
 
void fader_add_amp (void *self, float amp)
 Adds (or subtracts if negative) to the amplitude of the fader (clamped at 0.0 to 2.0).
 
NONNULL void fader_set_midi_mode (Fader *self, MidiFaderMode mode, bool with_action, bool fire_events)
 
void fader_set_muted (Fader *self, bool mute, bool fire_events)
 Sets track muted and optionally adds the action to the undo stack.
 
NONNULL bool fader_get_muted (const Fader *const self)
 Returns if the fader is muted.
 
HOT NONNULL bool fader_get_soloed (const Fader *const self)
 Returns if the track is soloed.
 
bool fader_get_implied_soloed (Fader *self)
 Returns whether the fader is not soloed on its own but its direct out (or its direct out's direct out, etc.) or its child (or its children's child, etc.) is soloed.
 
void fader_set_listened (Fader *self, bool listen, bool fire_events)
 Sets fader listen and optionally adds the action to the undo stack.
 
void fader_set_soloed (Fader *self, bool solo, bool fire_events)
 Sets track soloed and optionally adds the action to the undo stack.
 
NONNULL float fader_get_amp (void *self)
 Gets the fader amplitude (not db) FIXME is void * necessary? do it in the caller.
 
bool fader_get_mono_compat_enabled (Fader *self)
 Gets whether mono compatibility is enabled.
 
void fader_set_mono_compat_enabled (Fader *self, bool enabled, bool fire_events)
 Sets whether mono compatibility is enabled.
 
bool fader_get_swap_phase (Fader *self)
 Gets whether mono compatibility is enabled.
 
void fader_set_swap_phase (Fader *self, bool enabled, bool fire_events)
 Sets whether mono compatibility is enabled.
 
float fader_get_fader_val (void *self)
 
float fader_get_default_fader_val (void *self)
 
void fader_db_string_getter (void *obj, char *buf)
 
Channelfader_get_channel (Fader *self)
 
NONNULL Trackfader_get_track (Fader *self)
 
void fader_update_volume_and_fader_val (Fader *self)
 
HOT NONNULL void fader_clear_buffers (Fader *self)
 Clears all buffers.
 
void fader_set_fader_val (Fader *self, float fader_val)
 Sets the fader levels from a normalized value 0.0-1.0 (such as in widgets).
 
void fader_disconnect_all (Fader *self)
 Disconnects all ports connected to the fader.
 
void fader_copy_values (Fader *src, Fader *dest)
 Copy the fader values from source to dest.
 
NONNULL HOT void fader_process (Fader *self, const EngineProcessTimeInfo *const time_nfo)
 Process the Fader.
 
Faderfader_clone (const Fader *src)
 
void fader_free (Fader *self)
 Frees the fader members.
 

Variables

COLD Tracktrack
 
COLD Track ControlRoomcontrol_room
 
COLD Track ControlRoom SampleProcessorsample_processor
 

Detailed Description

Backend for faders or other volume/gain controls.

Definition in file fader.h.