Zrythm v2.0.0-alpha.1
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 "dsp/timebase.h"
8#include "structure/tracks/automation_tracklist.h"
9#include "structure/tracks/channel.h"
10#include "structure/tracks/piano_roll_track.h"
11#include "structure/tracks/playback_cache_activity_tracker.h"
12#include "structure/tracks/track_fwd.h"
13#include "structure/tracks/track_lane_list.h"
14#include "structure/tracks/track_processor.h"
15#include "utils/iobject_registry.h"
16#include "utils/playback_cache_scheduler.h"
17#include "utils/typed_uuid_reference.h"
18
19#include <QColor>
20#include <QtQmlIntegration/qqmlintegration.h>
21
22namespace zrythm::dsp
23{
24class MidiPlaybackCache;
25class TempoMapWrapper;
26}
27
28namespace zrythm::structure::tracks
29{
30using SoloedTracksExistGetter = std::function<bool ()>;
31
32using TrackRecordingCallback = std::function<void (
33 const utils::UuidIdentifiableObject<Track>::Uuid &,
34 units::sample_t,
35 const dsp::ITransport &,
36 const dsp::MidiEventBuffer *,
37 std::optional<TrackProcessor::ConstStereoPortPair>,
38 units::sample_u32_t)>;
39
41{
42 const dsp::TempoMapWrapper &tempo_map_;
43 utils::IObjectRegistry &registry_;
44 SoloedTracksExistGetter soloed_tracks_exist_getter_;
45 TrackRecordingCallback track_recording_callback;
46};
47
60{
61 Q_OBJECT
62 Q_PROPERTY (Type type READ type CONSTANT)
63 Q_PROPERTY (
64 zrythm::structure::tracks::AutomationTracklist * automationTracklist READ
65 automationTracklist CONSTANT)
66 Q_PROPERTY (QString name READ name WRITE setName NOTIFY nameChanged)
67 Q_PROPERTY (QColor color READ color WRITE setColor NOTIFY colorChanged)
68 Q_PROPERTY (
69 QString comment READ comment WRITE setComment NOTIFY commentChanged)
70 Q_PROPERTY (QString icon READ icon WRITE setIcon NOTIFY iconChanged)
71 Q_PROPERTY (bool visible READ visible WRITE setVisible NOTIFY visibleChanged)
72 Q_PROPERTY (bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
73 Q_PROPERTY (bool isDeletable READ is_deletable CONSTANT)
74 Q_PROPERTY (double height READ height WRITE setHeight NOTIFY heightChanged)
75 Q_PROPERTY (
76 double fullVisibleHeight READ fullVisibleHeight NOTIFY
77 fullVisibleHeightChanged)
78 Q_PROPERTY (zrythm::structure::tracks::Channel * channel READ channel CONSTANT)
79 Q_PROPERTY (zrythm::plugins::PluginGroup * modulators READ modulators CONSTANT)
80 Q_PROPERTY (
81 zrythm::structure::tracks::TrackLaneList * lanes READ lanes CONSTANT)
82 Q_PROPERTY (
83 zrythm::dsp::ProcessorParameter * recordingParam READ recordingParam CONSTANT)
84 Q_PROPERTY (
85 zrythm::dsp::ProcessorParameter * monitorParam READ monitorParam CONSTANT)
86 Q_PROPERTY (
87 zrythm::structure::tracks::PianoRollTrackMixin * pianoRollTrackMixin READ
88 pianoRollTrackMixin CONSTANT)
89 Q_PROPERTY (
90 bool clipLauncherMode READ clipLauncherMode WRITE setClipLauncherMode NOTIFY
91 clipLauncherModeChanged)
92 Q_PROPERTY (
93 zrythm::dsp::timebase::TimebaseProvider * timebaseProvider READ
94 timebaseProvider CONSTANT)
95 Q_PROPERTY (
97 playbackCacheActivityTracker READ playbackCacheActivityTracker CONSTANT)
98 Q_PROPERTY (
99 zrythm::dsp::MidiPort * trackProcessorMidiOut READ trackProcessorMidiOut
100 CONSTANT)
101 QML_ELEMENT
102 QML_UNCREATABLE ("")
103public:
104 using PluginUuid = plugins::Plugin::Uuid;
105 using PortType = dsp::PortType;
106 using ArrangerObject = structure::arrangement::ArrangerObject;
107 using ArrangerObjectPtrVariant =
108 structure::arrangement::ArrangerObjectPtrVariant;
109 using Color = utils::Color;
110
111 enum class Type : uint8_t
112 {
118
123 Audio,
124
128 Master,
129
135
139 Marker,
140
144 Modulator,
145
151 AudioBus,
152
159
164 Midi,
165
167 MidiBus,
168
170 MidiGroup,
171
173 Folder,
174 };
175 Q_ENUM (Type)
176
177 static constexpr int MIN_HEIGHT = 26;
178 static constexpr int DEF_HEIGHT = 52;
179
180 static bool
181 type_can_have_clip_type (Type type, ArrangerObject::Type clip_type)
182 {
183 switch (clip_type)
184 {
185 case ArrangerObject::Type::AudioClip:
186 return type == Type::Audio;
187 case ArrangerObject::Type::MidiClip:
188 return type == Type::Midi || type == Type::Instrument;
189 case ArrangerObject::Type::ChordClip:
190 return type == Type::Chord;
191 case ArrangerObject::Type::AutomationClip:
192 return true;
193 default:
194 throw std::runtime_error ("Invalid clip type");
195 }
197
198 static constexpr bool type_is_foldable (Type type)
199 {
200 return type == Type::Folder || type == Type::AudioGroup
201 || type == Type::MidiGroup;
202 }
203
204 static constexpr bool type_is_copyable (Type type)
205 {
206 return type != Type::Master && type != Type::Chord
207 && type != Type::Modulator && type != Type::Marker;
208 }
209
213 static constexpr bool type_is_deletable (Type type)
214 {
215 return type_is_copyable (type);
216 }
217
218 static Type type_get_from_plugin_descriptor (
220
221 static consteval bool type_has_mono_compat_switch (const Type tt)
222 {
223 return tt == Type::AudioGroup || tt == Type::Master;
224 }
225
227
229 static constexpr bool
230 type_is_compatible_for_moving (const Type type1, const Type type2)
232 return type1 == type2 || (type1 == Type::Midi && type2 == Type::Instrument)
233 || (type1 == Type::Instrument && type2 == Type::Midi);
234 }
235
239 [[gnu::const]]
240 static constexpr bool type_has_piano_roll (const Type type)
241 {
242 return type == Type::Midi || type == Type::Instrument;
244
248 static constexpr bool type_has_inputs (const Type type)
249 {
250 return type == Type::Midi || type == Type::Instrument || type == Type::Audio;
251 }
252
260 static constexpr bool type_can_be_group_target (const Type type)
261 {
262 return type == Type::AudioGroup || type == Type::MidiGroup
263 || type == Type::Instrument || type == Type::Master;
264 }
265
266 static constexpr bool type_can_have_automation (const Type type)
267 {
268 return type == Type::Instrument || type == Type::Audio
269 || type == Type::Master || type == Type::Chord
270 || type == Type::Modulator || type == Type::AudioBus
271 || type == Type::AudioGroup || type == Type::Midi
272 || type == Type::MidiBus || type == Type::MidiGroup;
273 }
274
275 static constexpr bool type_can_have_lanes (const Type type)
276 {
277 return type == Type::Instrument || type == Type::Audio || type == Type::Midi;
278 }
279
280 template <typename T> static consteval Type get_type_for_class ()
281 {
282 if constexpr (std::is_same_v<T, MidiTrack>)
283 return Type::Midi;
284 else if constexpr (std::is_same_v<T, AudioTrack>)
285 return Type::Audio;
286 else if constexpr (std::is_same_v<T, ChordTrack>)
287 return Type::Chord;
288 else if constexpr (std::is_same_v<T, InstrumentTrack>)
289 return Type::Instrument;
290 else if constexpr (std::is_same_v<T, AudioBusTrack>)
291 return Type::AudioBus;
292 else if constexpr (std::is_same_v<T, MidiBusTrack>)
293 return Type::MidiBus;
294 else if constexpr (std::is_same_v<T, MasterTrack>)
295 return Type::Master;
296 else if constexpr (std::is_same_v<T, ModulatorTrack>)
297 return Type::Modulator;
298 else if constexpr (std::is_same_v<T, MarkerTrack>)
299 return Type::Marker;
300 else if constexpr (std::is_same_v<T, FolderTrack>)
301 return Type::Folder;
302 else if constexpr (std::is_same_v<T, AudioGroupTrack>)
303 return Type::AudioGroup;
304 else if constexpr (std::is_same_v<T, MidiGroupTrack>)
305 return Type::MidiGroup;
306 else
307 {
308 static_assert (utils::dependent_false_v<T>, "Unknown track type");
309 }
310 }
311
312public:
313 ~Track () override;
314 Q_DISABLE_COPY_MOVE (Track)
315
316protected:
317 enum class TrackFeatures : std::uint8_t
318 {
319 Modulators = 1 << 0,
320 Automation = 1 << 1,
321 Lanes = 1 << 2,
322 Recording = 1 << 3,
323 PianoRoll = 1 << 4,
324 };
325
329 Track (
330 Type type,
331 std::optional<PortType> in_signal_type,
332 std::optional<PortType> out_signal_type,
333 TrackFeatures enabled_features,
334 BaseTrackDependencies dependencies);
335
336public:
337 bool has_piano_roll () const { return type_has_piano_roll (type_); }
338
339 bool is_folder () const { return type_ == Type::Folder; }
340 bool is_audio_group () const { return type_ == Type::AudioGroup; }
341 bool is_midi_group () const { return type_ == Type::MidiGroup; }
342 bool is_audio_bus () const { return type_ == Type::AudioBus; }
343 bool is_midi_bus () const { return type_ == Type::MidiBus; }
344 bool is_modulator () const { return type_ == Type::Modulator; }
345 bool is_chord () const { return type_ == Type::Chord; }
346 bool is_marker () const { return type_ == Type::Marker; }
347 bool is_audio () const { return type_ == Type::Audio; }
348 bool is_instrument () const { return type_ == Type::Instrument; }
349 bool is_midi () const { return type_ == Type::Midi; }
350 bool is_master () const { return type_ == Type::Master; }
351
352 // ========================================================================
353 // QML Interface
354 // ========================================================================
355
356 Type type () const { return type_; }
357
358 AutomationTracklist * automationTracklist () const
359 {
360 return automation_tracklist_.get ();
361 }
362
363 QString name () const { return name_.to_qstring (); }
364 void setName (const QString &name)
365 {
366 const auto name_str = utils::Utf8String::from_qstring (name);
367 if (name_ == name_str)
368 return;
369
370 name_ = name_str;
371 Q_EMIT nameChanged (name);
372 }
373 Q_SIGNAL void nameChanged (const QString &name);
374
375 QColor color () const { return color_.to_qcolor (); }
376 void setColor (const QColor &color)
377 {
378 if (color_.to_qcolor () == color)
379 return;
380
381 color_ = color;
382 Q_EMIT colorChanged (color);
383 }
384 Q_SIGNAL void colorChanged (const QColor &color);
385
386 QString comment () const { return comment_.to_qstring (); }
387 void setComment (const QString &comment)
388 {
389 const auto comment_str = utils::Utf8String::from_qstring (comment);
390 if (comment_ == comment_str)
391 return;
392
393 comment_ = comment_str;
394 Q_EMIT commentChanged (comment);
395 }
396 Q_SIGNAL void commentChanged (const QString &comment);
397
398 bool visible () const { return visible_; }
399 void setVisible (bool visible)
400 {
401 if (visible_ == visible)
402 return;
403
404 visible_ = visible;
405 Q_EMIT visibleChanged (visible);
406 }
407 Q_SIGNAL void visibleChanged (bool visible);
408
409 bool enabled () const { return enabled_; }
410 void setEnabled (bool enabled)
411 {
412 if (enabled_ == enabled)
413 return;
414 enabled_ = enabled;
415 Q_EMIT enabledChanged (enabled);
416 }
417 Q_SIGNAL void enabledChanged (bool enabled);
418
419 double height () const { return main_height_; }
420 void setHeight (double height)
421 {
423 return;
424
425 height = std::max (static_cast<double> (Track::MIN_HEIGHT), height);
426 main_height_ = height;
427 Q_EMIT heightChanged (height);
428 }
429 Q_SIGNAL void heightChanged (double height);
430
431 double fullVisibleHeight () const { return get_full_visible_height (); }
432 Q_SIGNAL void fullVisibleHeightChanged ();
433
434 QString icon () const { return icon_name_.to_qstring (); }
435 void setIcon (const QString &icon)
436 {
437 const auto icon_str = utils::Utf8String::from_qstring (icon);
438 if (icon_name_ == icon_str)
439 {
440 return;
441 }
442 icon_name_ = icon_str;
443 Q_EMIT iconChanged (icon);
444 }
445 Q_SIGNAL void iconChanged (const QString &icon);
446
447 Channel * channel () const { return channel_.get (); }
448
449 plugins::PluginGroup * modulators () const { return modulators_.get (); }
450
451 TrackLaneList * lanes () const { return lanes_.get (); }
452
453 dsp::ProcessorParameter * recordingParam () const;
454 dsp::ProcessorParameter * monitorParam () const;
455
456 PianoRollTrackMixin * pianoRollTrackMixin () const
457 {
458 return piano_roll_track_mixin_.get ();
459 }
460
461 bool clipLauncherMode () const { return clip_launcher_mode_; }
462 void setClipLauncherMode (bool mode);
463 Q_SIGNAL void clipLauncherModeChanged (bool mode);
464
465 dsp::TimebaseProvider * timebaseProvider ()
466 {
467 return timebase_provider_.get ();
468 }
470 // cache activity tracking
471 [[nodiscard]] PlaybackCacheActivityTracker *
472 playbackCacheActivityTracker () const
473 {
474 return playback_cache_activity_tracker_.get ();
475 }
476
477 dsp::MidiPort * trackProcessorMidiOut () const;
478
485 Q_INVOKABLE void
487
488 // ========================================================================
489
490 // bool has_lanes () const { return type_has_lanes (type_); }
491
492 bool is_deletable () const { return type_is_deletable (type_); }
493 bool is_copyable () const { return type_is_copyable (type_); }
494 bool has_automation () const { return automationTracklist () != nullptr; }
495
500 double get_full_visible_height () const;
501
502 bool multiply_heights (double multiplier, bool visible_only, bool check_only);
503
504 bool can_be_group_target () const { return type_can_be_group_target (type_); }
505
509 void set_default_name ();
510
511 template <arrangement::ClipObject ClipT>
512 auto generate_name_for_clip (
513 const ClipT &clip,
514 AutomationTrack * automation_track = nullptr)
515 {
516 auto ret = get_name ();
517 if constexpr (std::is_same_v<ClipT, arrangement::AutomationClip>)
518 {
519 assert (automation_track != nullptr);
521 fmt::format (
522 "{} - {}", get_name (), automation_track->parameter ()->label ()));
523 }
524 return ret;
525 }
526
531 std::vector<ArrangerObjectPtrVariant> &objects) const;
532
533 bool contains_uninstantiated_plugin () const;
534
538 utils::Utf8String get_name () const { return name_; };
539
540 auto input_signal_type () const { return in_signal_type_; }
541 auto output_signal_type () const { return out_signal_type_; }
542
547 uint8_t get_midi_ch (const arrangement::MidiClip &midi_clip) const;
548
552 void
553 collect_plugins (std::vector<plugins::PluginUuidReference> &plugins) const;
554
555// TODO
556#if 0
561 static bool is_plugin_descriptor_valid_for_slot_type (
562 const plugins::PluginDescriptor &descr,
563 zrythm::plugins::PluginSlotType slot_type,
564 Track::Type track_type);
565#endif
566
567 utils::Utf8String get_full_designation_for_port (const dsp::Port &port) const;
568
577
578 auto &get_registry () const { return base_dependencies_.registry_; }
579 auto &get_registry () { return base_dependencies_.registry_; }
580
581 TrackProcessor * get_track_processor () const { return processor_.get (); }
582
583 auto get_icon_name () const { return icon_name_; }
585protected:
586 friend void
587 init_from (Track &obj, const Track &other, utils::ObjectCloneType clone_type);
588
589 void generate_automation_tracks_for_processor (
591 const dsp::ProcessorBase &processor)
592 {
593 structure::tracks::generate_automation_tracks_for_processor (
594 ats, processor, base_dependencies_.tempo_map_,
595 base_dependencies_.registry_, timebaseProvider ());
597
600
602 std::optional<TrackProcessor::FillEventsCallback> fill_events_cb =
603 std::nullopt,
604 std::optional<TrackProcessor::TransformMidiInputsFunc>
605 transform_midi_inputs_func = std::nullopt,
606 std::optional<TrackProcessor::AppendMidiInputsToOutputsFunc>
607 append_midi_inputs_to_outputs_func = std::nullopt);
608
614 std::vector<ArrangerObjectPtrVariant> &objects) const
615 {
616 }
617
618private:
619 static constexpr auto kNameKey = "name"sv;
620 static constexpr auto kIconNameKey = "iconName"sv;
621 static constexpr auto kVisibleKey = "visible"sv;
622 static constexpr auto kMainHeightKey = "mainHeight"sv;
623 static constexpr auto kEnabledKey = "enabled"sv;
624 static constexpr auto kColorKey = "color"sv;
625 static constexpr auto kInputSignalTypeKey = "inSignalType"sv;
626 static constexpr auto kOutputSignalTypeKey = "outSignalType"sv;
627 static constexpr auto kCommentKey = "comment"sv;
628 static constexpr auto kFrozenClipIdKey = "frozenClipId"sv;
629 static constexpr auto kProcessorKey = "processor"sv;
630 static constexpr auto kAutomationTracklistKey = "automationTracklist"sv;
631 static constexpr auto kChannelKey = "channel"sv;
632 static constexpr auto kModulatorsKey = "modulators"sv;
633 static constexpr auto kModulatorMacroProcessorsKey =
634 "modulatorMacroProcessors"sv;
635 static constexpr auto kPianoRollKey = "pianoRoll"sv;
636 static constexpr auto kClipLauncherModeKey = "clipLauncherMode"sv;
637 static constexpr auto kTimebaseKey = "timebase"sv;
638 friend void to_json (nlohmann::json &j, const Track &track);
639 friend void from_json (const nlohmann::json &j, Track &track);
640
642 make_automation_tracklist ();
643 [[nodiscard]] utils::QObjectUniquePtr<Channel> make_channel ();
645 make_modulators ();
646 [[nodiscard]] utils::QObjectUniquePtr<TrackLaneList> make_lanes ();
648 make_piano_roll_track_mixin ();
649
655 void init_cache_scheduler ();
656
664 void init_playback_cache_activity_tracker (TrackProcessor &proc);
665
666protected:
667 BaseTrackDependencies base_dependencies_;
668
670 Type type_{};
671
672 TrackFeatures features_{};
673
676
679
681 bool visible_ = true;
684 double main_height_{ DEF_HEIGHT };
685
692 bool enabled_ = true;
693
699 Color color_;
700
704 std::optional<PortType> in_signal_type_;
705
709 std::optional<PortType> out_signal_type_;
710
713
719 std::optional<dsp::FileAudioSourceUuidReference> frozen_clip_id_;
720
735
740
743
745 std::vector<utils::QObjectUniquePtr<dsp::ModulatorMacroProcessor>>
747
749
750 utils::QObjectUniquePtr<PianoRollTrackMixin> piano_roll_track_mixin_;
751
757
758 bool clip_launcher_mode_{};
760 playback_cache_activity_tracker_;
761
763
764 BOOST_DESCRIBE_CLASS (
765 Track,
767 (),
768 (type_,
769 name_,
770 visible_,
772 enabled_,
773 color_,
776 comment_,
779 channel_,
782 lanes_,
783 piano_roll_track_mixin_,
784 clip_launcher_mode_),
785 ())
786};
787
788using TrackUuidReference = utils::TypedUuidReference<Track>;
789
790struct FinalTrackDependencies : public BaseTrackDependencies
791{
792 FinalTrackDependencies (
793 const dsp::TempoMapWrapper &tempo_map,
794 utils::IObjectRegistry &registry,
795 SoloedTracksExistGetter soloed_tracks_exist_getter,
796 TrackRecordingCallback recording_callback)
798 tempo_map,
799 registry,
800 std::move (soloed_tracks_exist_getter),
801 std::move (recording_callback))
802 {
803 }
804
805 BaseTrackDependencies to_base_dependencies ()
806 {
807 return static_cast<BaseTrackDependencies> (*this); // NOLINT
808 }
809};
810
811} // namespace zrythm::structure::tracks
A base class for ports used for connecting processors in the DSP graph.
Definition port.h:37
A base class for processors in the DSP graph.
Processor parameter that accepts automation and modulation sources and integrates with QML and the DS...
Definition parameter.h:255
Self-nesting timebase provider that resolves an effective timebase through a chain of providers.
Definition timebase.h:60
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:58
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:60
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:725
static constexpr bool type_has_inputs(const Type type)
Returns if the Track should have an inputs selector.
Definition track.h:231
utils::QObjectUniquePtr< TrackProcessor > processor_
The TrackProcessor, used for processing.
Definition track.h:717
bool enabled_
Active (enabled) or not.
Definition track.h:675
std::optional< dsp::FileAudioSourceUuidReference > frozen_clip_id_
Pool ID of the clip if track is frozen (unset if not frozen).
Definition track.h:702
utils::Utf8String name_
Track name, used in channel too.
Definition track.h:658
static constexpr bool type_is_compatible_for_moving(const Type type1, const Type type2)
Returns if clips in tracks from type1 can be moved to type2.
Definition track.h:213
void generate_basic_automation_tracks()
Adds basic automation tracks.
uint8_t get_midi_ch(const arrangement::MidiClip &midi_clip) const
Returns the MIDI channel that this clip should be played on, starting from 1.
double main_height_
Height of the main part (without lanes).
Definition track.h:667
static constexpr bool type_has_piano_roll(const Type type)
Returns if the Track should have a piano roll.
Definition track.h:223
void collect_plugins(std::vector< plugins::PluginUuidReference > &plugins) const
Fills in the given array with all plugins in the track.
std::optional< PortType > in_signal_type_
The input signal type (eg audio bus tracks have audio input signals).
Definition track.h:687
utils::Utf8String get_name() const
Getter for the track name.
Definition track.h:521
utils::QObjectUniquePtr< utils::PlaybackCacheScheduler > playable_content_cache_request_debouncer_
Debouncer/scheduler of audio/MIDI cache requests.
Definition track.h:739
utils::QObjectUniquePtr< AutomationTracklist > automation_tracklist_
Automation tracks, if track is automatable.
Definition track.h:707
Type type_
The type of track this is.
Definition track.h:653
utils::Utf8String comment_
User comments.
Definition track.h:695
utils::QObjectUniquePtr< Channel > channel_
Channel for this track, if any.
Definition track.h:722
std::optional< PortType > out_signal_type_
The output signal type (eg midi tracks have MIDI output signals).
Definition track.h:692
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:122
@ AudioGroup
Group Tracks are used for grouping audio signals, for example routing multiple drum tracks to a "Drum...
Definition track.h:141
@ AudioBus
Buses are channels that receive audio input and have effects on their channel strip.
Definition track.h:134
@ Modulator
Special track to contain global Modulator's.
Definition track.h:127
@ Midi
Midi tracks can only have MIDI effects in the strip and produce MIDI output that can be routed to ins...
Definition track.h:147
@ Instrument
Instrument tracks must have an Instrument plugin at the first slot and they produce audio output.
Definition track.h:100
@ Folder
Foldable track used for visual grouping.
Definition track.h:156
@ Audio
Audio tracks can record and contain audio clips.
Definition track.h:106
@ MidiGroup
Same with audio group but for MIDI signals.
Definition track.h:153
@ MidiBus
Same with audio bus but for MIDI signals.
Definition track.h:150
@ 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:117
@ Master
The master track is a special type of group track.
Definition track.h:111
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:729
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:596
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:196
Color color_
Track color.
Definition track.h:682
bool visible_
Whole Track is visible or not.
Definition track.h:664
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:661
static constexpr bool type_can_be_group_target(const Type type)
Returns if the Track can be a direct route target.
Definition track.h:243
Abstract interface for a UUID-keyed object registry.
A unique pointer for QObject objects that also works with QObject-based ownership.
Definition qt.h:36
Typed, reference-counted UUID reference into an IObjectRegistry.
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
CRTP base that adds a typed UUID strong-typedef to a class hierarchy.
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