Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::structure::tracks::TrackLaneImpl< RegionT > Class Template Reference

A TrackLane belongs to a Track (can have many TrackLanes in a Track) and contains Regions. More...

#include <src/structure/tracks/track_lane.h>

Inheritance diagram for zrythm::structure::tracks::TrackLaneImpl< RegionT >:
Collaboration diagram for zrythm::structure::tracks::TrackLaneImpl< RegionT >:

Public Types

using MidiRegion = arrangement::MidiRegion
using AudioRegion = arrangement::AudioRegion
using TrackLaneT
using LanedTrackT = LanedTrackImpl<TrackLaneT>
using Position = dsp::Position
Public Types inherited from zrythm::structure::arrangement::ArrangerObjectOwner< RegionT >
using ArrangerObjectChildType
using ArrangerObjectListModel

Public Member Functions

TrackLaneT & get_derived_lane ()
const TrackLaneT & get_derived_lane () const
 TrackLaneImpl (structure::arrangement::ArrangerObjectRegistry &registry, dsp::FileAudioSourceRegistry &file_audio_source_registry, LanedTrackT *track, QObject &derived)
 Creates a new TrackLane at the given pos in the given Track.
void set_soloed (bool solo, bool trigger_undo, bool fire_events)
 Sets track lane soloed, updates UI and optionally adds the action to the undo stack.
void set_muted (bool mute, bool trigger_undo, bool fire_events)
 Sets track lane muted, updates UI and optionally adds the action to the undo stack.
bool is_effectively_muted () const
 Returns if the lane is effectively muted (explicitly or implicitly muted).
void rename (const utils::Utf8String &new_name, bool with_action)
 Rename the lane.
void rename_with_action (const utils::Utf8String &new_name)
 Wrapper over track_lane_rename().
void unselect_all ()
 Unselects all arranger objects.
void write_to_midi_file (MIDI_FILE *mf, dsp::MidiEventVector *events, const Position *start, const Position *end, bool lanes_as_tracks, bool use_track_or_lane_pos)
 Writes the lane to the given MIDI file.
LanedTrackTget_track () const
int get_index_in_track (this const auto &self)
int calculate_lane_idx_for_midi_serialization () const
 Calculates a unique index for this lane.
std::unique_ptr< TrackLaneT > gen_snapshot () const
 Generate a snapshot for playback.
std::string get_field_name_for_serialization (const RegionT *) const override
Public Member Functions inherited from zrythm::structure::tracks::TrackLane
auto get_name () const
void generate_name (int pos)
bool get_soloed () const
bool get_muted () const
 Returns if the lane is explicitly marked as muted.
Public Member Functions inherited from zrythm::structure::arrangement::ArrangerObjectOwner< RegionT >
 ArrangerObjectOwner (ArrangerObjectRegistry &registry, dsp::FileAudioSourceRegistry &file_audio_source_registry, QObject &derived)
auto & get_children_vector ()
auto get_children_view () const
void add_ticks_to_children (double ticks)
ArrangerObjectListModelget_model () const
ArrangerObjectUuidReference remove_object (this SelfT &self, const ArrangerObject::Uuid &id)
void insert_object (this SelfT &self, const ArrangerObjectUuidReference &obj_ref, int idx)
void add_object (this SelfT &self, const ArrangerObjectUuidReference &obj_ref)
void clear_objects ()
virtual std::string get_field_name_for_serialization (const ChildT *) const=0
 Get the children field name to be used during serialization/deserialization.

Data Fields

LanedTrackTtrack_ = nullptr
 Owner track.
Data Fields inherited from zrythm::structure::tracks::TrackLane
utils::Utf8String name_
 Position in the Track.
double height_ { DEF_HEIGHT }
 Position of handle.
bool mute_ {}
 Muted or not.
bool solo_ {}
 Soloed or not.
uint8_t midi_ch_ = 0
 MIDI channel, if MIDI lane, starting at 1.

Friends

void init_from (TrackLaneImpl &obj, const TrackLaneImpl &other, utils::ObjectCloneType clone_type)
void to_json (nlohmann::json &j, const TrackLaneImpl &lane)
void from_json (const nlohmann::json &j, TrackLaneImpl &lane)

Additional Inherited Members

Static Public Attributes inherited from zrythm::structure::tracks::TrackLane
static constexpr double DEF_HEIGHT = 48

Detailed Description

template<arrangement::RegionObject RegionT>
class zrythm::structure::tracks::TrackLaneImpl< RegionT >

A TrackLane belongs to a Track (can have many TrackLanes in a Track) and contains Regions.

Only Tracks that have Regions can have TrackLanes, such as InstrumentTrack and AudioTrack.

Definition at line 126 of file track_lane.h.

Member Typedef Documentation

◆ AudioRegion

template<arrangement::RegionObject RegionT>
using zrythm::structure::tracks::TrackLaneImpl< RegionT >::AudioRegion = arrangement::AudioRegion

Definition at line 132 of file track_lane.h.

◆ LanedTrackT

template<arrangement::RegionObject RegionT>
using zrythm::structure::tracks::TrackLaneImpl< RegionT >::LanedTrackT = LanedTrackImpl<TrackLaneT>

Definition at line 135 of file track_lane.h.

◆ MidiRegion

template<arrangement::RegionObject RegionT>
using zrythm::structure::tracks::TrackLaneImpl< RegionT >::MidiRegion = arrangement::MidiRegion

Definition at line 131 of file track_lane.h.

◆ Position

template<arrangement::RegionObject RegionT>
using zrythm::structure::tracks::TrackLaneImpl< RegionT >::Position = dsp::Position

Definition at line 136 of file track_lane.h.

◆ TrackLaneT

template<arrangement::RegionObject RegionT>
using zrythm::structure::tracks::TrackLaneImpl< RegionT >::TrackLaneT
Initial value:
std::conditional_t<std::is_same_v<RegionT, MidiRegion>, MidiLane, AudioLane>

Definition at line 133 of file track_lane.h.

Constructor & Destructor Documentation

◆ TrackLaneImpl()

template<arrangement::RegionObject RegionT>
zrythm::structure::tracks::TrackLaneImpl< RegionT >::TrackLaneImpl ( structure::arrangement::ArrangerObjectRegistry & registry,
dsp::FileAudioSourceRegistry & file_audio_source_registry,
LanedTrackT * track,
QObject & derived )
inline

Creates a new TrackLane at the given pos in the given Track.

Parameters
trackThe Track to create the TrackLane for.

Definition at line 154 of file track_lane.h.

Member Function Documentation

◆ get_derived_lane() [1/2]

template<arrangement::RegionObject RegionT>
TrackLaneT & zrythm::structure::tracks::TrackLaneImpl< RegionT >::get_derived_lane ( )
inline

Definition at line 143 of file track_lane.h.

◆ get_derived_lane() [2/2]

template<arrangement::RegionObject RegionT>
const TrackLaneT & zrythm::structure::tracks::TrackLaneImpl< RegionT >::get_derived_lane ( ) const
inline

Definition at line 144 of file track_lane.h.

◆ get_field_name_for_serialization()

template<arrangement::RegionObject RegionT>
std::string zrythm::structure::tracks::TrackLaneImpl< RegionT >::get_field_name_for_serialization ( const RegionT * ) const
inlineoverride

Definition at line 251 of file track_lane.h.

◆ get_index_in_track()

template<arrangement::RegionObject RegionT>
int zrythm::structure::tracks::TrackLaneImpl< RegionT >::get_index_in_track ( this const auto & self)
inline

Definition at line 235 of file track_lane.h.

◆ get_track()

template<arrangement::RegionObject RegionT>
LanedTrackT * zrythm::structure::tracks::TrackLaneImpl< RegionT >::get_track ( ) const
inline

Definition at line 229 of file track_lane.h.

◆ rename()

template<arrangement::RegionObject RegionT>
void zrythm::structure::tracks::TrackLaneImpl< RegionT >::rename ( const utils::Utf8String & new_name,
bool with_action )

Rename the lane.

Parameters
with_actionWhether to make this an undoable action.

◆ set_muted()

template<arrangement::RegionObject RegionT>
void zrythm::structure::tracks::TrackLaneImpl< RegionT >::set_muted ( bool mute,
bool trigger_undo,
bool fire_events )

Sets track lane muted, updates UI and optionally adds the action to the undo stack.

Parameters
trigger_undoCreate and perform an undoable action.
fire_eventsFire UI events.

◆ set_soloed()

template<arrangement::RegionObject RegionT>
void zrythm::structure::tracks::TrackLaneImpl< RegionT >::set_soloed ( bool solo,
bool trigger_undo,
bool fire_events )

Sets track lane soloed, updates UI and optionally adds the action to the undo stack.

Parameters
trigger_undoCreate and perform an undoable action.
fire_eventsFire UI events.

◆ write_to_midi_file()

template<arrangement::RegionObject RegionT>
void zrythm::structure::tracks::TrackLaneImpl< RegionT >::write_to_midi_file ( MIDI_FILE * mf,
dsp::MidiEventVector * events,
const Position * start,
const Position * end,
bool lanes_as_tracks,
bool use_track_or_lane_pos )

Writes the lane to the given MIDI file.

Parameters
lanes_as_tracksExport lanes as separate MIDI tracks.
use_track_or_lane_posWhether to use the track position (or lane position if lanes_as_tracks is true) in the MIDI data. The MIDI track will be set to 1 if false.
eventsTrack events, if not using lanes as tracks.
startEvents before this position will be skipped.
endEvents after this position will be skipped.

◆ from_json

template<arrangement::RegionObject RegionT>
void from_json ( const nlohmann::json & j,
TrackLaneImpl< RegionT > & lane )
friend

Definition at line 285 of file track_lane.h.

◆ init_from

template<arrangement::RegionObject RegionT>
void init_from ( TrackLaneImpl< RegionT > & obj,
const TrackLaneImpl< RegionT > & other,
utils::ObjectCloneType clone_type )
friend

Definition at line 257 of file track_lane.h.

◆ to_json

template<arrangement::RegionObject RegionT>
void to_json ( nlohmann::json & j,
const TrackLaneImpl< RegionT > & lane )
friend

Definition at line 275 of file track_lane.h.

Field Documentation

◆ track_

template<arrangement::RegionObject RegionT>
LanedTrackT* zrythm::structure::tracks::TrackLaneImpl< RegionT >::track_ = nullptr

Owner track.

Definition at line 302 of file track_lane.h.


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