Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
TrackSpan Class Reference

Track span that offers helper methods on a range of tracks. More...

#include <src/gui/dsp/track_span.h>

Inheritance diagram for TrackSpan:
Collaboration diagram for TrackSpan:

Public Types

using Base = utils::UuidIdentifiableObjectView<TrackRegistry>
 
using VariantType = typename Base::VariantType
 
using TrackUuid = typename Base::UuidType
 
- Public Types inherited from zrythm::utils::UuidIdentifiableObjectView< TrackRegistry >
using UuidType
 
using VariantType
 
using UuidRefType
 

Public Member Functions

bool contains_track (const TrackUuid &id) const
 
std::optional< VariantType > get_track_by_pos (int pos) const
 
std::optional< VariantType > get_track_by_name (const utils::Utf8String &name) const
 
VariantType get_first_track () const
 Returns the highest track (with smallest position).
 
VariantType get_last_track () const
 Returns the lowest track (with largest position).
 
bool contains_track_name (const utils::Utf8String &name) const
 
auto get_visible_tracks () const
 
auto get_selected_tracks () const
 
void print_tracks () const
 Prints the track collection contents (for debugging).
 
MasterTrackget_master_track () const
 
void mark_for_bounce (Tracklist &tracklist, bool with_parents, bool mark_master)
 Marks the tracks to be bounced.
 
void mark_all_tracks_for_bounce (Tracklist &tracklist, bool bounce)
 Marks or unmarks all tracks for bounce.
 
void toggle_visibility ()
 Toggle visibility of the tracks in this collection.
 
bool contains_non_automatable_track () const
 Returns whether the tracklist selections contains a track that cannot have automation lanes.
 
bool contains_undeletable_track () const
 
bool contains_uncopyable_track () const
 
bool contains_uninstantiated_plugin () const
 
void paste_to_pos (int pos)
 Paste to the given position in the tracklist (performs a copy).
 
template<typename T>
void get_plugins (T &container)
 Fills in the given array with all plugins in the tracklist.
 
void deselect_all_plugins ()
 
auto has_soloed () const
 
auto has_listened () const
 
auto get_num_muted_tracks () const
 
auto get_num_soloed_tracks () const
 
auto get_num_listened_tracks () const
 
int get_total_bars (const Transport &transport, int total_bars) const
 Get the total (max) bars in the track list.
 
void set_caches (CacheType types)
 Set various caches (snapshots, track name hashes, plugin input/output ports, etc).
 
void expose_ports_to_backend (AudioEngine &engine)
 Exposes each track's ports that should be exposed to the backend.
 
void reconnect_ext_input_ports (AudioEngine &engine)
 
bool fix_audio_regions (dsp::FramesPerTick frames_per_tick)
 Fixes audio regions and returns whether positions were adjusted.
 
void activate_all_plugins (bool activate)
 Activate or deactivate all plugins.
 
void init_loaded (gui::old_dsp::plugins::PluginRegistry &plugin_registry, PortRegistry &port_registry)
 
void move_after_copying_or_moving_inside (int diff_between_track_below_and_parent)
 
std::vector< VariantType > create_snapshots (QObject &owner, TrackRegistry &track_registry, PluginRegistry &plugin_registry, PortRegistry &port_registry, ArrangerObjectRegistry &obj_registry) const
 Creates a snapshot of the track collection.
 
std::vector< TrackUuidReferencecreate_new_identities (TrackRegistry &track_registry, PluginRegistry &plugin_registry, PortRegistry &port_registry, ArrangerObjectRegistry &obj_registry) const
 
- Public Member Functions inherited from zrythm::utils::UuidIdentifiableObjectView< TrackRegistry >
 UuidIdentifiableObjectView (std::span< const VariantType > objects)
 Constructor for direct object range.
 
 UuidIdentifiableObjectView (std::span< const UuidRefType > refs)
 Constructor for UuidReference range.
 
 UuidIdentifiableObjectView (const TrackRegistry &registry, std::span< const UuidType > uuids)
 Constructor for Uuid + Registry.
 
 UuidIdentifiableObjectView (const VariantType &obj)
 Single object constructor.
 
Iterator begin () const
 
Iterator end () const
 
VariantType operator[] (size_t index) const
 
VariantType front () const
 
VariantType back () const
 
VariantType at (size_t index) const
 
size_t size () const
 
bool empty () const
 
auto get_elements_by_type () const
 
auto as_base_type () const
 
bool contains_type () const
 
auto as_type () const
 
auto get_elements_derived_from () const
 

Static Public Member Functions

static auto position_projection (const VariantType &track_var)
 
static auto visible_projection (const VariantType &track_var)
 
static auto name_projection (const VariantType &track_var)
 
static auto selected_projection (const VariantType &track_var)
 
static auto foldable_projection (const VariantType &track_var)
 
template<typename BaseType>
static auto derived_type_transformation (const VariantType &track_var)
 
- Static Public Member Functions inherited from zrythm::utils::UuidIdentifiableObjectView< TrackRegistry >
static UuidType uuid_projection (const VariantType &var)
 
static TrackRegistry::BaseType * base_projection (const VariantType &var)
 
static auto type_projection (const VariantType &var)
 
static auto derived_from_type_projection (const VariantType &var)
 
static auto type_transformation (const VariantType &var)
 
static auto derived_from_type_transformation (const VariantType &var)
 

Detailed Description

Track span that offers helper methods on a range of tracks.

Definition at line 15 of file track_span.h.

Member Typedef Documentation

◆ Base

◆ TrackUuid

using TrackSpan::TrackUuid = typename Base::UuidType

Definition at line 20 of file track_span.h.

◆ VariantType

using TrackSpan::VariantType = typename Base::VariantType

Definition at line 19 of file track_span.h.

Member Function Documentation

◆ activate_all_plugins()

void TrackSpan::activate_all_plugins ( bool activate)
inline

Activate or deactivate all plugins.

This is useful for exporting: deactivating and reactivating a plugin will reset its state.

Definition at line 375 of file track_span.h.

◆ contains_non_automatable_track()

bool TrackSpan::contains_non_automatable_track ( ) const
inline

Returns whether the tracklist selections contains a track that cannot have automation lanes.

Definition at line 237 of file track_span.h.

◆ contains_track()

bool TrackSpan::contains_track ( const TrackUuid & id) const
inline

Definition at line 23 of file track_span.h.

◆ contains_track_name()

bool TrackSpan::contains_track_name ( const utils::Utf8String & name) const
inline

Definition at line 123 of file track_span.h.

◆ contains_uncopyable_track()

bool TrackSpan::contains_uncopyable_track ( ) const
inline

Definition at line 251 of file track_span.h.

◆ contains_undeletable_track()

bool TrackSpan::contains_undeletable_track ( ) const
inline

Definition at line 243 of file track_span.h.

◆ contains_uninstantiated_plugin()

bool TrackSpan::contains_uninstantiated_plugin ( ) const
inline

Definition at line 259 of file track_span.h.

◆ create_new_identities()

std::vector< TrackUuidReference > TrackSpan::create_new_identities ( TrackRegistry & track_registry,
PluginRegistry & plugin_registry,
PortRegistry & port_registry,
ArrangerObjectRegistry & obj_registry ) const
inline

Definition at line 426 of file track_span.h.

◆ create_snapshots()

std::vector< VariantType > TrackSpan::create_snapshots ( QObject & owner,
TrackRegistry & track_registry,
PluginRegistry & plugin_registry,
PortRegistry & port_registry,
ArrangerObjectRegistry & obj_registry ) const
inline

Creates a snapshot of the track collection.

Intended to be used in undoable actions.

Returns
A vector of track variants.

Definition at line 407 of file track_span.h.

◆ derived_type_transformation()

template<typename BaseType>
static auto TrackSpan::derived_type_transformation ( const VariantType & track_var)
inlinestatic

Definition at line 79 of file track_span.h.

◆ deselect_all_plugins()

void TrackSpan::deselect_all_plugins ( )
inline

Definition at line 288 of file track_span.h.

◆ expose_ports_to_backend()

void TrackSpan::expose_ports_to_backend ( AudioEngine & engine)

Exposes each track's ports that should be exposed to the backend.

This should be called after setting up the engine.

◆ foldable_projection()

static auto TrackSpan::foldable_projection ( const VariantType & track_var)
inlinestatic

Definition at line 48 of file track_span.h.

◆ get_first_track()

VariantType TrackSpan::get_first_track ( ) const
inline

Returns the highest track (with smallest position).

Definition at line 110 of file track_span.h.

◆ get_last_track()

VariantType TrackSpan::get_last_track ( ) const
inline

Returns the lowest track (with largest position).

Definition at line 118 of file track_span.h.

◆ get_master_track()

MasterTrack & TrackSpan::get_master_track ( ) const
inline

Definition at line 172 of file track_span.h.

◆ get_num_listened_tracks()

auto TrackSpan::get_num_listened_tracks ( ) const
inline

Definition at line 318 of file track_span.h.

◆ get_num_muted_tracks()

auto TrackSpan::get_num_muted_tracks ( ) const
inline

Definition at line 308 of file track_span.h.

◆ get_num_soloed_tracks()

auto TrackSpan::get_num_soloed_tracks ( ) const
inline

Definition at line 313 of file track_span.h.

◆ get_plugins()

template<typename T>
void TrackSpan::get_plugins ( T & container)
inline

Fills in the given array with all plugins in the tracklist.

Definition at line 279 of file track_span.h.

◆ get_selected_tracks()

auto TrackSpan::get_selected_tracks ( ) const
inline

Definition at line 133 of file track_span.h.

◆ get_total_bars()

int TrackSpan::get_total_bars ( const Transport & transport,
int total_bars ) const
inline

Get the total (max) bars in the track list.

Parameters
total_barsCurrent known total bars
Returns
New total bars if > than total_bars, or total_bars.

Definition at line 329 of file track_span.h.

◆ get_track_by_name()

std::optional< VariantType > TrackSpan::get_track_by_name ( const utils::Utf8String & name) const
inline

Definition at line 101 of file track_span.h.

◆ get_track_by_pos()

std::optional< VariantType > TrackSpan::get_track_by_pos ( int pos) const
inline

Definition at line 94 of file track_span.h.

◆ get_visible_tracks()

auto TrackSpan::get_visible_tracks ( ) const
inline

Definition at line 128 of file track_span.h.

◆ has_listened()

auto TrackSpan::has_listened ( ) const
inline

Definition at line 303 of file track_span.h.

◆ has_soloed()

auto TrackSpan::has_soloed ( ) const
inline

Definition at line 298 of file track_span.h.

◆ init_loaded()

void TrackSpan::init_loaded ( gui::old_dsp::plugins::PluginRegistry & plugin_registry,
PortRegistry & port_registry )
inline

Definition at line 384 of file track_span.h.

◆ mark_for_bounce()

void TrackSpan::mark_for_bounce ( Tracklist & tracklist,
bool with_parents,
bool mark_master )

Marks the tracks to be bounced.

Parameters
with_parentsAlso mark all the track's parents recursively.
mark_masterAlso mark the master track. Set to true when exporting the mixdown, false otherwise.

◆ name_projection()

static auto TrackSpan::name_projection ( const VariantType & track_var)
inlinestatic

Definition at line 38 of file track_span.h.

◆ paste_to_pos()

void TrackSpan::paste_to_pos ( int pos)

Paste to the given position in the tracklist (performs a copy).

Parameters
pos
Exceptions
ZrythmExceptionif failed to paste.

◆ position_projection()

static auto TrackSpan::position_projection ( const VariantType & track_var)
inlinestatic

Definition at line 28 of file track_span.h.

◆ print_tracks()

void TrackSpan::print_tracks ( ) const
inline

Prints the track collection contents (for debugging).

Definition at line 141 of file track_span.h.

◆ reconnect_ext_input_ports()

void TrackSpan::reconnect_ext_input_ports ( AudioEngine & engine)
See also
Channel.reconnect_ext_input_ports().

◆ selected_projection()

static auto TrackSpan::selected_projection ( const VariantType & track_var)
inlinestatic

Definition at line 43 of file track_span.h.

◆ set_caches()

void TrackSpan::set_caches ( CacheType types)
inline

Set various caches (snapshots, track name hashes, plugin input/output ports, etc).

Definition at line 345 of file track_span.h.

◆ toggle_visibility()

void TrackSpan::toggle_visibility ( )
inline

Toggle visibility of the tracks in this collection.

Definition at line 202 of file track_span.h.

◆ visible_projection()

static auto TrackSpan::visible_projection ( const VariantType & track_var)
inlinestatic

Definition at line 33 of file track_span.h.


The documentation for this class was generated from the following file: