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

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

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

Inheritance diagram for TrackLaneImpl< RegionT >:
Collaboration diagram for TrackLaneImpl< RegionT >:

Public Types

using TrackLaneT
 
using LanedTrackT = LanedTrackImpl<TrackLaneT>
 
using Position = dsp::Position
 
- Public Types inherited from ArrangerObjectOwner< RegionT >
using PortUuid
 
using ArrangerObjectChildType
 

Public Member Functions

TrackLaneT & get_derived_lane ()
 
const TrackLaneT & get_derived_lane () const
 
 TrackLaneImpl (LanedTrackT *track)
 Creates a new TrackLane at the given pos in the given Track.
 
bool is_in_active_project () const
 
bool is_auditioner () const
 
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.
 
Tracklistget_tracklist () const
 
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.
 
ArrangerObjectOwner< RegionT >::Location get_location (const RegionT &) const override
 
std::string get_field_name_for_serialization (const RegionT *) const override
 
- Public Member Functions inherited from 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 ArrangerObjectOwner< RegionT >
auto & get_children_vector ()
 
auto & get_children_vector () const
 
auto get_children_view () const
 
auto & get_children_snapshots_vector ()
 
auto & get_children_snapshots_vector () const
 
auto get_children_snapshots_view () const
 
void add_ticks_to_children (double ticks, dsp::FramesPerTick frames_per_tick)
 
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 Location get_location (const ChildT &) const=0
 Returns the current location of this owner.
 
virtual std::string get_field_name_for_serialization (const ChildT *) const=0
 Get the children field name to be used during serialization/deserialization.
 
void copy_members_from (const ArrangerObjectOwner &other, ObjectCloneType clone_type)
 
void copy_children (const ArrangerObjectOwner &other)
 

Data Fields

LanedTrackTtrack_ = nullptr
 Owner track.
 
- Data Fields inherited from 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.
 

Protected Member Functions

void copy_members_from (const TrackLaneImpl &other, ObjectCloneType clone_type)
 

Friends

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 TrackLane
static constexpr double DEF_HEIGHT = 48
 
- Protected Attributes inherited from ArrangerObjectOwner< RegionT >
bool clearing_
 

Detailed Description

template<typename RegionT>
class 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 128 of file track_lane.h.

Member Typedef Documentation

◆ LanedTrackT

template<typename RegionT>
using TrackLaneImpl< RegionT >::LanedTrackT = LanedTrackImpl<TrackLaneT>

Definition at line 133 of file track_lane.h.

◆ Position

template<typename RegionT>
using TrackLaneImpl< RegionT >::Position = dsp::Position

Definition at line 134 of file track_lane.h.

◆ TrackLaneT

template<typename RegionT>
using TrackLaneImpl< RegionT >::TrackLaneT
Initial value:
std::conditional_t<std::is_same_v<RegionT, MidiRegion>, MidiLane, AudioLane>

Definition at line 131 of file track_lane.h.

Constructor & Destructor Documentation

◆ TrackLaneImpl()

template<typename RegionT>
TrackLaneImpl< RegionT >::TrackLaneImpl ( LanedTrackT * track)
inline

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

Parameters
trackThe Track to create the TrackLane for.

Definition at line 152 of file track_lane.h.

Member Function Documentation

◆ get_derived_lane() [1/2]

template<typename RegionT>
TrackLaneT & TrackLaneImpl< RegionT >::get_derived_lane ( )
inline

Definition at line 141 of file track_lane.h.

◆ get_derived_lane() [2/2]

template<typename RegionT>
const TrackLaneT & TrackLaneImpl< RegionT >::get_derived_lane ( ) const
inline

Definition at line 142 of file track_lane.h.

◆ get_field_name_for_serialization()

template<typename RegionT>
std::string TrackLaneImpl< RegionT >::get_field_name_for_serialization ( const RegionT * ) const
inlineoverride

Definition at line 249 of file track_lane.h.

◆ get_index_in_track()

template<typename RegionT>
int TrackLaneImpl< RegionT >::get_index_in_track ( this const auto & self)
inline

Definition at line 230 of file track_lane.h.

◆ get_track()

template<typename RegionT>
LanedTrackT * TrackLaneImpl< RegionT >::get_track ( ) const
inline

Definition at line 224 of file track_lane.h.

◆ rename()

template<typename RegionT>
void 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<typename RegionT>
void 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<typename RegionT>
void 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<typename RegionT>
void 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.

Friends And Related Symbol Documentation

◆ from_json

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

Definition at line 273 of file track_lane.h.

◆ to_json

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

Definition at line 264 of file track_lane.h.

Field Documentation

◆ track_

template<typename RegionT>
LanedTrackT* TrackLaneImpl< RegionT >::track_ = nullptr

Owner track.

Definition at line 289 of file track_lane.h.


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