Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
track.h
1// SPDX-FileCopyrightText: © 2018-2022, 2024-2026 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "dsp/modulator_macro_processor.h"
7#include "structure/tracks/automation_tracklist.h"
8#include "structure/tracks/channel.h"
9#include "structure/tracks/piano_roll_track.h"
10#include "structure/tracks/playback_cache_activity_tracker.h"
11#include "structure/tracks/track_fwd.h"
12#include "structure/tracks/track_lane_list.h"
13#include "structure/tracks/track_processor.h"
14#include "utils/playback_cache_scheduler.h"
15
16#include <QColor>
17#include <QtQmlIntegration/qqmlintegration.h>
18
19namespace zrythm::dsp
20{
21class MidiPlaybackCache;
22class TempoMapWrapper;
23}
24
25namespace zrythm::structure::tracks
26{
27using SoloedTracksExistGetter = std::function<bool ()>;
28
29using TrackRecordingCallback = std::function<void (
30 const utils::UuidIdentifiableObject<Track>::Uuid &,
31 units::sample_t,
32 const dsp::ITransport &,
33 const dsp::MidiEventVector *,
34 std::optional<TrackProcessor::ConstStereoPortPair>)>;
35
37{
38 const dsp::TempoMapWrapper &tempo_map_;
39 dsp::FileAudioSourceRegistry &file_audio_source_registry_;
40 plugins::PluginRegistry &plugin_registry_;
41 dsp::PortRegistry &port_registry_;
42 dsp::ProcessorParameterRegistry &param_registry_;
43 arrangement::ArrangerObjectRegistry &obj_registry_;
44 const dsp::ITransport &transport_;
45 SoloedTracksExistGetter soloed_tracks_exist_getter_;
46 TrackRecordingCallback track_recording_callback;
47};
48
60class Track : public QObject, public utils::UuidIdentifiableObject<Track>
61{
62 Q_OBJECT
63 Q_PROPERTY (Type type READ type CONSTANT)
64 Q_PROPERTY (
65 zrythm::structure::tracks::AutomationTracklist * automationTracklist READ
66 automationTracklist CONSTANT)
67 Q_PROPERTY (QString name READ name WRITE setName NOTIFY nameChanged)
68 Q_PROPERTY (QColor color READ color WRITE setColor NOTIFY colorChanged)
69 Q_PROPERTY (
70 QString comment READ comment WRITE setComment NOTIFY commentChanged)
71 Q_PROPERTY (QString icon READ icon WRITE setIcon NOTIFY iconChanged)
72 Q_PROPERTY (bool visible READ visible WRITE setVisible NOTIFY visibleChanged)
73 Q_PROPERTY (bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
74 Q_PROPERTY (bool isDeletable READ is_deletable CONSTANT)
75 Q_PROPERTY (double height READ height WRITE setHeight NOTIFY heightChanged)
76 Q_PROPERTY (
77 double fullVisibleHeight READ fullVisibleHeight NOTIFY
78 fullVisibleHeightChanged)
79 Q_PROPERTY (zrythm::structure::tracks::Channel * channel READ channel CONSTANT)
80 Q_PROPERTY (zrythm::plugins::PluginGroup * modulators READ modulators CONSTANT)
81 Q_PROPERTY (
82 zrythm::structure::tracks::TrackLaneList * lanes READ lanes CONSTANT)
83 Q_PROPERTY (
84 zrythm::dsp::ProcessorParameter * recordingParam READ recordingParam CONSTANT)
85 Q_PROPERTY (
86 zrythm::dsp::ProcessorParameter * monitorParam READ monitorParam CONSTANT)
87 Q_PROPERTY (
88 zrythm::structure::tracks::PianoRollTrackMixin * pianoRollTrackMixin READ
89 pianoRollTrackMixin CONSTANT)
90 Q_PROPERTY (
91 bool clipLauncherMode READ clipLauncherMode WRITE setClipLauncherMode NOTIFY
92 clipLauncherModeChanged)
93 Q_PROPERTY (
95 playbackCacheActivityTracker READ playbackCacheActivityTracker CONSTANT)
96 QML_ELEMENT
97 QML_UNCREATABLE ("")
98public:
99 using Plugin = plugins::Plugin;
100 using PluginUuid = Plugin::Uuid;
101 using PortType = dsp::PortType;
102 using PluginRegistry = plugins::PluginRegistry;
103 using PluginPtrVariant = PluginRegistry::VariantType;
104 using ArrangerObject = structure::arrangement::ArrangerObject;
105 using ArrangerObjectPtrVariant =
106 structure::arrangement::ArrangerObjectPtrVariant;
107 using ArrangerObjectRegistry = structure::arrangement::ArrangerObjectRegistry;
108 using Color = utils::Color;
109
110 enum class Type : uint8_t
111 {
117
122 Audio,
123
127 Master,
128
133 Chord,
134
138 Marker,
139
144
150 AudioBus,
151
160
163 Midi,
164
166 MidiBus,
167
169 MidiGroup,
170
172 Folder,
173 };
174 Q_ENUM (Type)
175
176 static constexpr int MIN_HEIGHT = 26;
177 static constexpr int DEF_HEIGHT = 52;
178
179 static bool
180 type_can_have_region_type (Type type, ArrangerObject::Type region_type)
181 {
182 switch (region_type)
183 {
184 case ArrangerObject::Type::AudioRegion:
185 return type == Type::Audio;
186 case ArrangerObject::Type::MidiRegion:
187 return type == Type::Midi || type == Type::Instrument;
188 case ArrangerObject::Type::ChordRegion:
189 return type == Type::Chord;
190 case ArrangerObject::Type::AutomationRegion:
191 return true;
192 default:
193 throw std::runtime_error ("Invalid region type");
194 }
195 }
196
197 static constexpr bool type_is_foldable (Type type)
199 return type == Type::Folder || type == Type::AudioGroup
200 || type == Type::MidiGroup;
201 }
202
203 static constexpr bool type_is_copyable (Type type)
204 {
205 return type != Type::Master && type != Type::Chord
206 && type != Type::Modulator && type != Type::Marker;
207 }
208
212 static constexpr bool type_is_deletable (Type type)
213 {
214 return type_is_copyable (type);
216
217 static Type type_get_from_plugin_descriptor (
219
220 static consteval bool type_has_mono_compat_switch (const Type tt)
221 {
222 return tt == Type::AudioGroup || tt == Type::Master;
223 }
224
225 /**
226 * Returns if regions in tracks from @p type1 can be moved to @p type2.
227 */
228 static constexpr bool
229 type_is_compatible_for_moving (const Type type1, const Type type2)
230 {
231 return type1 == type2 || (type1 == Type::Midi && type2 == Type::Instrument)
232 || (type1 == Type::Instrument && type2 == Type::Midi);
234
237
238 [[gnu::const]]
239 static constexpr bool type_has_piano_roll (const Type type)
240 {
241 return type == Type::Midi || type == Type::Instrument;
242 }
243
245 * Returns if the Track should have an inputs selector.
246 */
247 static constexpr bool type_has_inputs (const Type type)
248 {
249 return type == Type::Midi || type == Type::Instrument || type == Type::Audio;
250 }
251
259 static constexpr bool type_can_be_group_target (const Type type)
260 {
261 return type == Type::AudioGroup || type == Type::MidiGroup
262 || type == Type::Instrument || type == Type::Master;
263 }
264
265 static constexpr bool type_can_have_automation (const Type type)
266 {
267 return type == Type::Instrument || type == Type::Audio
268 || type == Type::Master || type == Type::Chord
269 || type == Type::Modulator || type == Type::AudioBus
270 || type == Type::AudioGroup || type == Type::Midi
271 || type == Type::MidiBus || type == Type::MidiGroup;
272 }
273
274 static constexpr bool type_can_have_lanes (const Type type)
275 {
276 return type == Type::Instrument || type == Type::Audio || type == Type::Midi;
277 }
278
279 template <typename T> static consteval Type get_type_for_class ()
280 {
281 if constexpr (std::is_same_v<T, MidiTrack>)
282 return Type::Midi;
283 else if constexpr (std::is_same_v<T, AudioTrack>)
284 return Type::Audio;
285 else if constexpr (std::is_same_v<T, ChordTrack>)
286 return Type::Chord;
287 else if constexpr (std::is_same_v<T, InstrumentTrack>)
288 return Type::Instrument;
289 else if constexpr (std::is_same_v<T, AudioBusTrack>)
290 return Type::AudioBus;
291 else if constexpr (std::is_same_v<T, MidiBusTrack>)
292 return Type::MidiBus;
293 else if constexpr (std::is_same_v<T, MasterTrack>)
294 return Type::Master;
295 else if constexpr (std::is_same_v<T, ModulatorTrack>)
296 return Type::Modulator;
297 else if constexpr (std::is_same_v<T, MarkerTrack>)
298 return Type::Marker;
299 else if constexpr (std::is_same_v<T, FolderTrack>)
300 return Type::Folder;
301 else if constexpr (std::is_same_v<T, AudioGroupTrack>)
302 return Type::AudioGroup;
303 else if constexpr (std::is_same_v<T, MidiGroupTrack>)
304 return Type::MidiGroup;
305 else
306 {
307 static_assert (dependent_false_v<T>, "Unknown track type");
308 }
309 }
310
311public:
312 ~Track () override;
313 Q_DISABLE_COPY_MOVE (Track)
315protected:
316 enum class TrackFeatures : std::uint8_t
317 {
318 Modulators = 1 << 0,
319 Automation = 1 << 1,
320 Lanes = 1 << 2,
321 Recording = 1 << 3,
322 PianoRoll = 1 << 4,
323 };
324
328 Track (
329 Type type,
330 std::optional<PortType> in_signal_type,
331 std::optional<PortType> out_signal_type,
332 TrackFeatures enabled_features,
333 BaseTrackDependencies dependencies);
334
335public:
336 bool has_piano_roll () const { return type_has_piano_roll (type_); }
337
338 bool is_folder () const { return type_ == Type::Folder; }
339 bool is_audio_group () const { return type_ == Type::AudioGroup; }
340 bool is_midi_group () const { return type_ == Type::MidiGroup; }
341 bool is_audio_bus () const { return type_ == Type::AudioBus; }
342 bool is_midi_bus () const { return type_ == Type::MidiBus; }
343 bool is_modulator () const { return type_ == Type::Modulator; }
344 bool is_chord () const { return type_ == Type::Chord; }
345 bool is_marker () const { return type_ == Type::Marker; }
346 bool is_audio () const { return type_ == Type::Audio; }
347 bool is_instrument () const { return type_ == Type::Instrument; }
348 bool is_midi () const { return type_ == Type::Midi; }
349 bool is_master () const { return type_ == Type::Master; }
350
351 // ========================================================================
352 // QML Interface
353 // ========================================================================
354
355 Type type () const { return type_; }
356
357 AutomationTracklist * automationTracklist () const
358 {
359 return automation_tracklist_.get ();
360 }
361
362 QString name () const { return name_.to_qstring (); }
363 void setName (const QString &name)
364 {
365 const auto name_str = utils::Utf8String::from_qstring (name);
366 if (name_ == name_str)
367 return;
368
369 name_ = name_str;
370 Q_EMIT nameChanged (name);
371 }
372 Q_SIGNAL void nameChanged (const QString &name);
373
374 QColor color () const { return color_.to_qcolor (); }
375 void setColor (const QColor &color)
376 {
377 if (color_.to_qcolor () == color)
378 return;
379
380 color_ = color;
381 Q_EMIT colorChanged (color);
382 }
383 Q_SIGNAL void colorChanged (const QColor &color);
384
385 QString comment () const { return comment_.to_qstring (); }
386 void setComment (const QString &comment)
387 {
388 const auto comment_str = utils::Utf8String::from_qstring (comment);
389 if (comment_ == comment_str)
390 return;
391
392 comment_ = comment_str;
393 Q_EMIT commentChanged (comment);
394 }
395 Q_SIGNAL void commentChanged (const QString &comment);
396
397 bool visible () const { return visible_; }
398 void setVisible (bool visible)
399 {
400 if (visible_ == visible)
401 return;
402
403 visible_ = visible;
404 Q_EMIT visibleChanged (visible);
405 }
406 Q_SIGNAL void visibleChanged (bool visible);
407
408 bool enabled () const { return enabled_; }
409 void setEnabled (bool enabled)
410 {
411 if (enabled_ == enabled)
412 return;
413 enabled_ = enabled;
414 Q_EMIT enabledChanged (enabled);
415 }
416 Q_SIGNAL void enabledChanged (bool enabled);
417
418 double height () const { return main_height_; }
419 void setHeight (double height)
420 {
422 return;
423
424 height = std::max (static_cast<double> (Track::MIN_HEIGHT), height);
425 main_height_ = height;
426 Q_EMIT heightChanged (height);
427 }
428 Q_SIGNAL void heightChanged (double height);
429
430 double fullVisibleHeight () const { return get_full_visible_height (); }
431 Q_SIGNAL void fullVisibleHeightChanged ();
432
433 QString icon () const { return icon_name_.to_qstring (); }
434 void setIcon (const QString &icon)
435 {
436 const auto icon_str = utils::Utf8String::from_qstring (icon);
437 if (icon_name_ == icon_str)
438 {
439 return;
440 }
441 icon_name_ = icon_str;
442 Q_EMIT iconChanged (icon);
443 }
444 Q_SIGNAL void iconChanged (const QString &icon);
445
446 Channel * channel () const { return channel_.get (); }
447
448 plugins::PluginGroup * modulators () const { return modulators_.get (); }
449
450 TrackLaneList * lanes () const { return lanes_.get (); }
451
452 dsp::ProcessorParameter * recordingParam () const;
453 dsp::ProcessorParameter * monitorParam () const;
454
455 PianoRollTrackMixin * pianoRollTrackMixin () const
456 {
457 return piano_roll_track_mixin_.get ();
458 }
459
460 bool clipLauncherMode () const { return clip_launcher_mode_; }
461 void setClipLauncherMode (bool mode);
462 Q_SIGNAL void clipLauncherModeChanged (bool mode);
463
464 // cache activity tracking
465 [[nodiscard]] PlaybackCacheActivityTracker *
466 playbackCacheActivityTracker () const
467 {
468 return playback_cache_activity_tracker_.get ();
469 }
470
477 Q_INVOKABLE void
479
480 // ========================================================================
481
482 // bool has_lanes () const { return type_has_lanes (type_); }
483
484 bool is_deletable () const { return type_is_deletable (type_); }
485 bool is_copyable () const { return type_is_copyable (type_); }
486 bool has_automation () const { return automationTracklist () != nullptr; }
492 double get_full_visible_height () const;
493
494 bool multiply_heights (double multiplier, bool visible_only, bool check_only);
495
496 bool can_be_group_target () const { return type_can_be_group_target (type_); }
497
501 void set_default_name ();
502
503 template <arrangement::RegionObject RegionT>
504 auto generate_name_for_region (
505 const RegionT &region,
506 AutomationTrack * automation_track = nullptr)
507 {
508 auto ret = get_name ();
509 if constexpr (std::is_same_v<RegionT, arrangement::AutomationRegion>)
510 {
511 assert (automation_track != nullptr);
513 fmt::format (
514 "{} - {}", get_name (), automation_track->parameter ()->label ()));
515 }
516 return ret;
517 }
518
523 std::vector<ArrangerObjectPtrVariant> &objects) const;
524
525 bool contains_uninstantiated_plugin () const;
526
530 utils::Utf8String get_name () const { return name_; };
531
532 auto input_signal_type () const { return in_signal_type_; }
533 auto output_signal_type () const { return out_signal_type_; }
534
539 uint8_t get_midi_ch (const arrangement::MidiRegion &midi_region) const;
540
544 void collect_plugins (std::vector<plugins::PluginPtrVariant> &plugins) const;
545
546// TODO
547#if 0
552 static bool is_plugin_descriptor_valid_for_slot_type (
554 zrythm::plugins::PluginSlotType slot_type,
555 Track::Type track_type);
556#endif
557
558 utils::Utf8String get_full_designation_for_port (const dsp::Port &port) const;
559
568
569 auto &get_plugin_registry () const
570 {
571 return base_dependencies_.plugin_registry_;
572 }
573 auto &get_plugin_registry () { return base_dependencies_.plugin_registry_; }
574 auto &get_port_registry () const { return base_dependencies_.port_registry_; }
575 auto &get_port_registry () { return base_dependencies_.port_registry_; }
576 auto &get_param_registry () const
577 {
578 return base_dependencies_.param_registry_;
579 }
580 auto &get_param_registry () { return base_dependencies_.param_registry_; }
581 auto &get_object_registry () const
582 {
583 return base_dependencies_.obj_registry_;
584 }
585 auto &get_object_registry () { return base_dependencies_.obj_registry_; }
586
587 TrackProcessor * get_track_processor () const { return processor_.get (); }
588
589 auto get_icon_name () const { return icon_name_; }
590
591protected:
592 friend void
593 init_from (Track &obj, const Track &other, utils::ObjectCloneType clone_type);
595 void generate_automation_tracks_for_processor (
597 const dsp::ProcessorBase &processor)
598 {
599 structure::tracks::generate_automation_tracks_for_processor (
600 ats, processor, base_dependencies_.tempo_map_,
601 base_dependencies_.file_audio_source_registry_,
602 base_dependencies_.obj_registry_);
603 }
604
606 * @brief Implementations with a processor must call this in their constructor.
607 */
609 std::optional<TrackProcessor::FillEventsCallback> fill_events_cb =
610 std::nullopt,
611 std::optional<TrackProcessor::TransformMidiInputsFunc>
612 transform_midi_inputs_func = std::nullopt,
613 std::optional<TrackProcessor::AppendMidiInputsToOutputsFunc>
614 append_midi_inputs_to_outputs_func = std::nullopt);
615
621 std::vector<ArrangerObjectPtrVariant> &objects) const
622 {
623 }
624
625private:
626 static constexpr auto kNameKey = "name"sv;
627 static constexpr auto kIconNameKey = "iconName"sv;
628 static constexpr auto kVisibleKey = "visible"sv;
629 static constexpr auto kMainHeightKey = "mainHeight"sv;
630 static constexpr auto kEnabledKey = "enabled"sv;
631 static constexpr auto kColorKey = "color"sv;
632 static constexpr auto kInputSignalTypeKey = "inSignalType"sv;
633 static constexpr auto kOutputSignalTypeKey = "outSignalType"sv;
634 static constexpr auto kCommentKey = "comment"sv;
635 static constexpr auto kFrozenClipIdKey = "frozenClipId"sv;
636 static constexpr auto kProcessorKey = "processor"sv;
637 static constexpr auto kAutomationTracklistKey = "automationTracklist"sv;
638 static constexpr auto kChannelKey = "channel"sv;
639 static constexpr auto kModulatorsKey = "modulators"sv;
640 static constexpr auto kModulatorMacroProcessorsKey =
641 "modulatorMacroProcessors"sv;
642 static constexpr auto kPianoRollKey = "pianoRoll"sv;
643 static constexpr auto kClipLauncherModeKey = "clipLauncherMode"sv;
644 friend void to_json (nlohmann::json &j, const Track &track);
645 friend void from_json (const nlohmann::json &j, Track &track);
646
648 make_automation_tracklist ();
649 [[nodiscard]] utils::QObjectUniquePtr<Channel> make_channel ();
651 make_modulators ();
652 [[nodiscard]] utils::QObjectUniquePtr<TrackLaneList> make_lanes ();
654 make_piano_roll_track_mixin ();
655
661 void init_cache_scheduler ();
670 void init_playback_cache_activity_tracker (TrackProcessor &proc);
671
672protected:
673 BaseTrackDependencies base_dependencies_;
674
677
678 TrackFeatures features_{};
679
682
685
687 bool visible_ = true;
688
690 double main_height_{ DEF_HEIGHT };
698 bool enabled_ = true;
699
705 Color color_;
706
710 std::optional<PortType> in_signal_type_;
715 std::optional<PortType> out_signal_type_;
719
725 std::optional<dsp::FileAudioSourceUuidReference> frozen_clip_id_;
741
746
749
751 std::vector<utils::QObjectUniquePtr<dsp::ModulatorMacroProcessor>>
753
755
756 utils::QObjectUniquePtr<PianoRollTrackMixin> piano_roll_track_mixin_;
757
763
764 bool clip_launcher_mode_{};
766 playback_cache_activity_tracker_;
767
768 BOOST_DESCRIBE_CLASS (
769 Track,
771 (),
772 (type_,
773 name_,
774 visible_,
776 enabled_,
777 color_,
780 comment_,
783 channel_,
786 lanes_,
787 piano_roll_track_mixin_,
788 clip_launcher_mode_),
789 ())
790};
791
793using TrackRegistryRef = std::reference_wrapper<TrackRegistry>;
794using TrackUuidReference = utils::UuidReference<TrackRegistry>;
795
796struct FinalTrackDependencies : public BaseTrackDependencies
797{
798 FinalTrackDependencies (
799 const dsp::TempoMapWrapper &tempo_map,
800 dsp::FileAudioSourceRegistry &file_audio_source_registry,
801 plugins::PluginRegistry &plugin_registry,
802 dsp::PortRegistry &port_registry,
803 dsp::ProcessorParameterRegistry &param_registry,
804 arrangement::ArrangerObjectRegistry &obj_registry,
805 TrackRegistry &track_registry,
806 const dsp::ITransport &transport,
807 SoloedTracksExistGetter soloed_tracks_exist_getter,
808 TrackRecordingCallback recording_callback)
810 tempo_map,
811 file_audio_source_registry,
812 plugin_registry,
813 port_registry,
814 param_registry,
815 obj_registry,
816 transport,
817 std::move (soloed_tracks_exist_getter),
818 std::move (recording_callback)),
819 track_registry_ (track_registry)
820 {
821 }
822
823 TrackRegistry &track_registry_;
824
825 BaseTrackDependencies to_base_dependencies ()
826 {
827 return static_cast<BaseTrackDependencies> (*this); // NOLINT
828 }
829};
830
831} // namespace zrythm::structure::tracks
Interface for transport.
Definition itransport.h:16
A base class for ports used for connecting processors in the DSP graph.
Definition port.h:29
A base class for processors in the DSP graph.
Wrapper over a Uuid registry that provides (slow) lookup by unique ID.
Definition parameter.h:542
Processor parameter that accepts automation and modulation sources and integrates with QML and the DS...
Definition parameter.h:252
The PluginDescriptor class provides a set of static utility functions and member functions to work wi...
A flexible container for plugins and nested plugin groups.
A container that manages a list of automation tracks.
Represents a channel strip on the mixer.
Definition channel.h:57
Mixin for a piano roll-based track.
Helper that manages cache activity state for a cache-holding object.
A TrackProcessor is a standalone processor that is used as the first step when processing a track in ...
Represents a track in the project.
Definition track.h:61
Track(Type type, std::optional< PortType > in_signal_type, std::optional< PortType > out_signal_type, TrackFeatures enabled_features, BaseTrackDependencies dependencies)
Constructor to be used by subclasses.
utils::QObjectUniquePtr< plugins::PluginGroup > modulators_
Modulators.
Definition track.h:734
static constexpr bool type_has_inputs(const Type type)
Returns if the Track should have an inputs selector.
Definition track.h:233
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.
utils::QObjectUniquePtr< TrackProcessor > processor_
The TrackProcessor, used for processing.
Definition track.h:726
bool enabled_
Active (enabled) or not.
Definition track.h:684
std::optional< dsp::FileAudioSourceUuidReference > frozen_clip_id_
Pool ID of the clip if track is frozen (unset if not frozen).
Definition track.h:711
utils::Utf8String name_
Track name, used in channel too.
Definition track.h:667
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.
Definition track.h:215
void generate_basic_automation_tracks()
Adds basic automation tracks.
double main_height_
Height of the main part (without lanes).
Definition track.h:676
static constexpr bool type_has_piano_roll(const Type type)
Returns if the Track should have a piano roll.
Definition track.h:225
std::optional< PortType > in_signal_type_
The input signal type (eg audio bus tracks have audio input signals).
Definition track.h:696
utils::Utf8String get_name() const
Getter for the track name.
Definition track.h:516
utils::QObjectUniquePtr< utils::PlaybackCacheScheduler > playable_content_cache_request_debouncer_
Debouncer/scheduler of audio/MIDI cache requests.
Definition track.h:748
utils::QObjectUniquePtr< AutomationTracklist > automation_tracklist_
Automation tracks, if track is automatable.
Definition track.h:716
Type type_
The type of track this is.
Definition track.h:662
utils::Utf8String comment_
User comments.
Definition track.h:704
utils::QObjectUniquePtr< Channel > channel_
Channel for this track, if any.
Definition track.h:731
std::optional< PortType > out_signal_type_
The output signal type (eg midi tracks have MIDI output signals).
Definition track.h:701
void set_default_name()
Sets a default name for this track (based on its type).
@ Marker
Marker Track's contain named markers at specific Position's in the song.
Definition track.h:124
@ AudioGroup
Group Tracks are used for grouping audio signals, for example routing multiple drum tracks to a "Drum...
Definition track.h:143
@ AudioBus
Buses are channels that receive audio input and have effects on their channel strip.
Definition track.h:136
@ Modulator
Special track to contain global Modulator's.
Definition track.h:129
@ Midi
Midi tracks can only have MIDI effects in the strip and produce MIDI output that can be routed to ins...
Definition track.h:149
@ Instrument
Instrument tracks must have an Instrument plugin at the first slot and they produce audio output.
Definition track.h:102
@ Folder
Foldable track used for visual grouping.
Definition track.h:158
@ Audio
Audio tracks can record and contain audio clips.
Definition track.h:108
@ MidiGroup
Same with audio group but for MIDI signals.
Definition track.h:155
@ MidiBus
Same with audio bus but for MIDI signals.
Definition track.h:152
@ Chord
The chord track contains chords that can be used to modify midi in real time or to color the piano ro...
Definition track.h:119
@ Master
The master track is a special type of group track.
Definition track.h:113
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.
std::vector< utils::QObjectUniquePtr< dsp::ModulatorMacroProcessor > > modulator_macro_processors_
Modulator macros.
Definition track.h:738
double get_full_visible_height() const
Returns the full visible height (main height + height of all visible automation tracks + height of al...
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 ...
Definition track.h:606
static constexpr bool type_is_deletable(Type type)
Returns whether a track of the given type should be deletable by the user.
Definition track.h:198
Color color_
Track color.
Definition track.h:691
void collect_plugins(std::vector< plugins::PluginPtrVariant > &plugins) const
Fills in the given array with all plugins in the track.
bool visible_
Whole Track is visible or not.
Definition track.h:673
void collect_timeline_objects(std::vector< ArrangerObjectPtrVariant > &objects) const
Appends all the timeine objects in the track to objects.
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.
utils::Utf8String icon_name_
Icon name of the track.
Definition track.h:670
static constexpr bool type_can_be_group_target(const Type type)
Returns if the Track can be a direct route target.
Definition track.h:245
A registry that owns and manages objects identified by a UUID.
A unique pointer for QObject objects that also works with QObject-based ownership.
Definition qt.h:36
Lightweight UTF-8 string wrapper with safe conversions.
Definition utf8_string.h:37
static constexpr Utf8String from_utf8_encoded_string(std::string_view str)
Construct from a std::string_view that we are 100% sure is UTF8-encoded.
Definition utf8_string.h:80
Base class for objects that need to be uniquely identified by UUID.
A reference-counted RAII wrapper for a UUID in a registry.
String utilities.
constexpr bool values_equal_for_qproperty_type(const T &a, const T &b)
Helper that checks if 2 values are equal.
Definition qt.h:18