|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
Represents a track in the project. More...
#include <src/structure/tracks/track.h>


Public Types | |
| enum class | Type : basic_enum_base_type_t { Instrument , Audio , Master , Chord , Marker , Modulator , AudioBus , AudioGroup , Midi , MidiBus , MidiGroup , Folder } |
| using | Plugin = plugins::Plugin |
| using | PluginUuid = Plugin::Uuid |
| using | PortType = dsp::PortType |
| using | PluginRegistry = plugins::PluginRegistry |
| using | PluginPtrVariant = PluginRegistry::VariantType |
| using | PluginSlot = plugins::PluginSlot |
| using | ArrangerObject = structure::arrangement::ArrangerObject |
| using | ArrangerObjectPtrVariant |
| using | ArrangerObjectRegistry = structure::arrangement::ArrangerObjectRegistry |
| using | Color = utils::Color |
Public Member Functions | |
| bool | has_piano_roll () const |
| bool | is_folder () const |
| bool | is_audio_group () const |
| bool | is_midi_group () const |
| bool | is_audio_bus () const |
| bool | is_midi_bus () const |
| bool | is_modulator () const |
| bool | is_chord () const |
| bool | is_marker () const |
| bool | is_audio () const |
| bool | is_instrument () const |
| bool | is_midi () const |
| bool | is_master () const |
| Type | type () const |
| AutomationTracklist * | automationTracklist () const |
| QString | name () const |
| void | setName (const QString &name) |
| Q_SIGNAL void | nameChanged (const QString &name) |
| QColor | color () const |
| void | setColor (const QColor &color) |
| Q_SIGNAL void | colorChanged (const QColor &color) |
| QString | comment () const |
| void | setComment (const QString &comment) |
| Q_SIGNAL void | commentChanged (const QString &comment) |
| bool | visible () const |
| void | setVisible (bool visible) |
| Q_SIGNAL void | visibleChanged (bool visible) |
| bool | enabled () const |
| void | setEnabled (bool enabled) |
| Q_SIGNAL void | enabledChanged (bool enabled) |
| double | height () const |
| void | setHeight (double height) |
| Q_SIGNAL void | heightChanged (double height) |
| double | fullVisibleHeight () const |
| Q_SIGNAL void | fullVisibleHeightChanged () |
| QString | icon () const |
| void | setIcon (const QString &icon) |
| Q_SIGNAL void | iconChanged (const QString &icon) |
| Channel * | channel () const |
| plugins::PluginGroup * | modulators () const |
| TrackLaneList * | lanes () const |
| RecordableTrackMixin * | recordableTrackMixin () const |
| PianoRollTrackMixin * | pianoRollTrackMixin () const |
| bool | clipLauncherMode () const |
| void | setClipLauncherMode (bool mode) |
| Q_SIGNAL void | clipLauncherModeChanged (bool mode) |
| Q_INVOKABLE void | regeneratePlaybackCaches (utils::ExpandableTickRange affectedRange) |
| To be connected to to notify of any changes to the playable content, like MIDI or audio events. | |
| bool | is_deletable () const |
| bool | is_copyable () const |
| bool | has_automation () const |
| double | get_full_visible_height () const |
| Returns the full visible height (main height + height of all visible automation tracks + height of all visible lanes). | |
| bool | multiply_heights (double multiplier, bool visible_only, bool check_only) |
| bool | can_be_group_target () const |
| template<arrangement::RegionObject RegionT> | |
| auto | generate_name_for_region (const RegionT ®ion, AutomationTrack *automation_track=nullptr) |
| void | collect_timeline_objects (std::vector< ArrangerObjectPtrVariant > &objects) const |
Appends all the timeine objects in the track to objects. | |
| bool | contains_uninstantiated_plugin () const |
| utils::Utf8String | get_name () const |
| Getter for the track name. | |
| auto | get_input_signal_type () const |
| auto | get_output_signal_type () const |
| uint8_t | get_midi_ch (const arrangement::MidiRegion &midi_region) const |
| Returns the MIDI channel that this region should be played on, starting from 1. | |
| void | collect_plugins (std::vector< plugins::PluginPtrVariant > &plugins) const |
| Fills in the given array with all plugins in the track. | |
| void | set_caches (CacheType types) |
| Set various caches (snapshots, track name hash, plugin input/output ports, etc). | |
| utils::Utf8String | get_full_designation_for_port (const dsp::Port &port) const |
| void | generate_basic_automation_tracks () |
| Adds basic automation tracks. | |
| auto & | get_plugin_registry () const |
| auto & | get_plugin_registry () |
| auto & | get_port_registry () const |
| auto & | get_port_registry () |
| auto & | get_param_registry () const |
| auto & | get_param_registry () |
| auto & | get_object_registry () const |
| auto & | get_object_registry () |
| TrackProcessor * | get_track_processor () const |
| auto | get_icon_name () const |
| Public Member Functions inherited from zrythm::utils::UuidIdentifiableObject< Track > | |
| UuidIdentifiableObject & | operator= (const UuidIdentifiableObject &other)=default |
| auto | get_uuid () const |
Static Public Member Functions | |
| static bool | type_can_have_region_type (Type type, ArrangerObject::Type region_type) |
| static constexpr bool | type_is_foldable (Type type) |
| static constexpr bool | type_is_copyable (Type type) |
| static constexpr bool | type_is_deletable (Type type) |
| Returns whether a track of the given type should be deletable by the user. | |
| static Type | type_get_from_plugin_descriptor (const zrythm::plugins::PluginDescriptor &descr) |
| static consteval bool | type_has_mono_compat_switch (const Type tt) |
| static constexpr bool | type_is_compatible_for_moving (const Type type1, const Type type2) |
Returns if regions in tracks from type1 can be moved to type2. | |
| static constexpr bool | type_has_piano_roll (const Type type) |
| Returns if the Track should have a piano roll. | |
| static constexpr bool | type_has_inputs (const Type type) |
| Returns if the Track should have an inputs selector. | |
| static constexpr bool | type_can_be_group_target (const Type type) |
| Returns if the Track can be a direct route target. | |
| static constexpr bool | type_can_have_automation (const Type type) |
| static constexpr bool | type_can_have_lanes (const Type type) |
| template<typename T> | |
| static consteval Type | get_type_for_class () |
| static bool | is_plugin_descriptor_valid_for_slot_type (const plugins::PluginDescriptor &descr, zrythm::plugins::PluginSlotType slot_type, Track::Type track_type) |
Returns if descr can be dropped at slot_type in a track of type track_type. | |
Static Public Attributes | |
| static constexpr int | MIN_HEIGHT = 26 |
| static constexpr int | DEF_HEIGHT = 52 |
Protected Types | |
| enum class | TrackFeatures : std::uint8_t { Modulators = 1 << 0 , Automation = 1 << 1 , Lanes = 1 << 2 , Recording = 1 << 3 , PianoRoll = 1 << 4 } |
Protected Member Functions | |
| Track (Type type, PortType in_signal_type, PortType out_signal_type, TrackFeatures enabled_features, BaseTrackDependencies dependencies) | |
| Constructor to be used by subclasses. | |
| virtual void | set_playback_caches () |
| Set the playback caches for a track. | |
| void | generate_automation_tracks_for_processor (std::vector< utils::QObjectUniquePtr< AutomationTrack > > &ats, const dsp::ProcessorBase &processor) |
| utils::QObjectUniquePtr< TrackProcessor > | make_track_processor (std::optional< TrackProcessor::FillEventsCallback > fill_events_cb=std::nullopt, std::optional< TrackProcessor::TransformMidiInputsFunc > transform_midi_inputs_func=std::nullopt, std::optional< TrackProcessor::AppendMidiInputsToOutputsFunc > append_midi_inputs_to_outputs_func=std::nullopt) |
| Implementations with a processor must call this in their constructor. | |
| virtual void | collect_additional_timeline_objects (std::vector< ArrangerObjectPtrVariant > &objects) const |
| Called by collect_timeline_objects to collect any additional objects not handled by this class (such as markers and scales). | |
Protected Attributes | |
| BaseTrackDependencies | base_dependencies_ |
| Type | type_ {} |
| The type of track this is. | |
| TrackFeatures | features_ {} |
| utils::Utf8String | name_ |
| Track name, used in channel too. | |
| utils::Utf8String | icon_name_ |
| Icon name of the track. | |
| bool | visible_ = true |
| Whole Track is visible or not. | |
| double | main_height_ { DEF_HEIGHT } |
| Height of the main part (without lanes). | |
| bool | enabled_ = true |
| Active (enabled) or not. | |
| Color | color_ |
| Track color. | |
| PortType | in_signal_type_ = {} |
| The input signal type (eg audio bus tracks have audio input signals). | |
| PortType | out_signal_type_ = {} |
| The output signal type (eg midi tracks have MIDI output signals). | |
| utils::Utf8String | comment_ |
| User comments. | |
| std::optional< dsp::FileAudioSourceUuidReference > | frozen_clip_id_ |
| Pool ID of the clip if track is frozen (unset if not frozen). | |
| utils::QObjectUniquePtr< AutomationTracklist > | automation_tracklist_ |
| Automation tracks, if track is automatable. | |
| utils::QObjectUniquePtr< TrackProcessor > | processor_ |
| The TrackProcessor, used for processing. | |
| utils::QObjectUniquePtr< Channel > | channel_ |
| Channel for this track, if any. | |
| utils::QObjectUniquePtr< plugins::PluginGroup > | modulators_ |
| Modulators. | |
| std::vector< utils::QObjectUniquePtr< dsp::ModulatorMacroProcessor > > | modulator_macro_processors_ |
| Modulator macros. | |
| utils::QObjectUniquePtr< TrackLaneList > | lanes_ |
| utils::QObjectUniquePtr< RecordableTrackMixin > | recordable_track_mixin_ |
| utils::QObjectUniquePtr< PianoRollTrackMixin > | piano_roll_track_mixin_ |
| utils::QObjectUniquePtr< utils::PlaybackCacheScheduler > | playable_content_cache_request_debouncer_ |
| Debouncer/scheduler of audio/MIDI cache requests. | |
| bool | clip_launcher_mode_ {} |
Properties | |
| Type | type |
| zrythm::structure::tracks::AutomationTracklist * | automationTracklist |
| QString | name |
| QColor | color |
| QString | comment |
| QString | icon |
| bool | visible |
| bool | enabled |
| double | height |
| double | fullVisibleHeight |
| zrythm::structure::tracks::Channel * | channel |
| zrythm::plugins::PluginGroup * | modulators |
| zrythm::structure::tracks::TrackLaneList * | lanes |
| zrythm::structure::tracks::RecordableTrackMixin * | recordableTrackMixin |
| zrythm::structure::tracks::PianoRollTrackMixin * | pianoRollTrackMixin |
| bool | clipLauncherMode |
Friends | |
| void | init_from (Track &obj, const Track &other, utils::ObjectCloneType clone_type) |
| void | to_json (nlohmann::json &j, const Track &track) |
| void | from_json (const nlohmann::json &j, Track &track) |
Represents a track in the project.
The Track class is the base class for all types of tracks in the project. It provides common functionality and properties shared by all track types, such as the track's position in the tracklist, its label, and whether it is muted.
Subclasses of Track represent specific types of tracks, such as MIDI tracks, instrument tracks, and audio tracks.
| using zrythm::structure::tracks::Track::ArrangerObject = structure::arrangement::ArrangerObject |
| using zrythm::structure::tracks::Track::ArrangerObjectPtrVariant |
| using zrythm::structure::tracks::Track::ArrangerObjectRegistry = structure::arrangement::ArrangerObjectRegistry |
| using zrythm::structure::tracks::Track::Color = utils::Color |
| using zrythm::structure::tracks::Track::Plugin = plugins::Plugin |
| using zrythm::structure::tracks::Track::PluginPtrVariant = PluginRegistry::VariantType |
| using zrythm::structure::tracks::Track::PluginRegistry = plugins::PluginRegistry |
| using zrythm::structure::tracks::Track::PluginSlot = plugins::PluginSlot |
| using zrythm::structure::tracks::Track::PluginUuid = Plugin::Uuid |
| using zrythm::structure::tracks::Track::PortType = dsp::PortType |
|
strongprotected |
|
strong |
| Enumerator | |
|---|---|
| Instrument | Instrument tracks must have an Instrument plugin at the first slot and they produce audio output. |
| Audio | Audio tracks can record and contain audio clips. Other than that their channel strips are similar to buses. |
| Master | The master track is a special type of group track. |
| Chord | The chord track contains chords that can be used to modify midi in real time or to color the piano roll. |
| Marker | Marker Track's contain named markers at specific Position's in the song. |
| Modulator | Special track to contain global Modulator's. |
| AudioBus | Buses are channels that receive audio input and have effects on their channel strip. They are similar to Group Tracks, except that they cannot be routed to directly. Buses are used for send effects. |
| AudioGroup | Group Tracks are used for grouping audio signals, for example routing multiple drum tracks to a "Drums" group track. Like buses, they only contain effects but unlike buses they can be routed to. |
| Midi | Midi tracks can only have MIDI effects in the strip and produce MIDI output that can be routed to instrument channels or hardware. |
| MidiBus | Same with audio bus but for MIDI signals. |
| MidiGroup | Same with audio group but for MIDI signals. |
| Folder | Foldable track used for visual grouping. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotectedvirtual |
Called by collect_timeline_objects to collect any additional objects not handled by this class (such as markers and scales).
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
| void zrythm::structure::tracks::Track::generate_basic_automation_tracks | ( | ) |
Adds basic automation tracks.
This only adds automation tracks for a few commonly used parameters. When the user selects an automatable parameter to automate that does not have automation tracks yet, automation tracks should be created lazily.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestaticconsteval |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| Q_INVOKABLE void zrythm::structure::tracks::Track::regeneratePlaybackCaches | ( | utils::ExpandableTickRange | affectedRange | ) |
To be connected to to notify of any changes to the playable content, like MIDI or audio events.
This will request new caches to be generated for the track processor.
|
inlineprotectedvirtual |
Set the playback caches for a track.
This is called by set_caches().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestatic |
|
inlinestaticconstexpr |
|
inlinestaticconsteval |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inline |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticconstexpr |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticconstexpr |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
The TrackProcessor, used for processing.
This is the starting point when processing a Track. Tracks that want to be part of the DSP graph as signal producers must have this.
|
protected |
|
protected |
|
protected |
|
read |
|
read |
|
readwrite |
|
read |
|
read |
|
read |
|
read |
|
read |