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 "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/iobject_registry.h"
15#include "utils/playback_cache_scheduler.h"
16#include "utils/typed_uuid_reference.h"
17
18#include <QColor>
19#include <QtQmlIntegration/qqmlintegration.h>
20
21namespace zrythm::dsp
22{
23class MidiPlaybackCache;
24class TempoMapWrapper;
25}
26
27namespace zrythm::structure::tracks
28{
29using SoloedTracksExistGetter = std::function<bool ()>;
30
31using TrackRecordingCallback = std::function<void (
32 const utils::UuidIdentifiableObject<Track>::Uuid &,
33 units::sample_t,
34 const dsp::ITransport &,
35 std::optional<std::span<const dsp::MidiEvent>>,
36 std::optional<TrackProcessor::ConstStereoPortPair>,
37 units::sample_u32_t)>;
38
40{
41 const dsp::TempoMapWrapper &tempo_map_;
42 utils::IObjectRegistry &registry_;
43 const dsp::ITransport &transport_;
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 (
94 playbackCacheActivityTracker READ playbackCacheActivityTracker CONSTANT)
95 QML_ELEMENT
96 QML_UNCREATABLE ("")
97public:
98 using PluginUuid = plugins::Plugin::Uuid;
99 using PortType = dsp::PortType;
100 using ArrangerObject = structure::arrangement::ArrangerObject;
101 using ArrangerObjectPtrVariant =
102 structure::arrangement::ArrangerObjectPtrVariant;
103 using Color = utils::Color;
104
105 enum class Type : uint8_t
106 {
112
117 Audio,
118
122 Master,
123
128 Chord,
129
133 Marker,
134
139
145 AudioBus,
146
155
158 Midi,
159
161 MidiBus,
162
164 MidiGroup,
165
167 Folder,
168 };
169 Q_ENUM (Type)
170
171 static constexpr int MIN_HEIGHT = 26;
172 static constexpr int DEF_HEIGHT = 52;
173
174 static bool
175 type_can_have_region_type (Type type, ArrangerObject::Type region_type)
176 {
177 switch (region_type)
178 {
179 case ArrangerObject::Type::AudioRegion:
180 return type == Type::Audio;
181 case ArrangerObject::Type::MidiRegion:
182 return type == Type::Midi || type == Type::Instrument;
183 case ArrangerObject::Type::ChordRegion:
184 return type == Type::Chord;
185 case ArrangerObject::Type::AutomationRegion:
186 return true;
187 default:
188 throw std::runtime_error ("Invalid region type");
189 }
190 }
191
192 static constexpr bool type_is_foldable (Type type)
194 return type == Type::Folder || type == Type::AudioGroup
195 || type == Type::MidiGroup;
196 }
197
198 static constexpr bool type_is_copyable (Type type)
199 {
200 return type != Type::Master && type != Type::Chord
201 && type != Type::Modulator && type != Type::Marker;
202 }
203
207 static constexpr bool type_is_deletable (Type type)
208 {
209 return type_is_copyable (type);
211
212 static Type type_get_from_plugin_descriptor (
214
215 static consteval bool type_has_mono_compat_switch (const Type tt)
216 {
217 return tt == Type::AudioGroup || tt == Type::Master;
218 }
219
220 /**
221 * Returns if regions in tracks from @p type1 can be moved to @p type2.
222 */
223 static constexpr bool
224 type_is_compatible_for_moving (const Type type1, const Type type2)
225 {
226 return type1 == type2 || (type1 == Type::Midi && type2 == Type::Instrument)
227 || (type1 == Type::Instrument && type2 == Type::Midi);
229
232
233 [[gnu::const]]
234 static constexpr bool type_has_piano_roll (const Type type)
235 {
236 return type == Type::Midi || type == Type::Instrument;
237 }
238
240 * Returns if the Track should have an inputs selector.
241 */
242 static constexpr bool type_has_inputs (const Type type)
243 {
244 return type == Type::Midi || type == Type::Instrument || type == Type::Audio;
245 }
246
254 static constexpr bool type_can_be_group_target (const Type type)
255 {
256 return type == Type::AudioGroup || type == Type::MidiGroup
257 || type == Type::Instrument || type == Type::Master;
258 }
259
260 static constexpr bool type_can_have_automation (const Type type)
261 {
262 return type == Type::Instrument || type == Type::Audio
263 || type == Type::Master || type == Type::Chord
264 || type == Type::Modulator || type == Type::AudioBus
265 || type == Type::AudioGroup || type == Type::Midi
266 || type == Type::MidiBus || type == Type::MidiGroup;
267 }
268
269 static constexpr bool type_can_have_lanes (const Type type)
270 {
271 return type == Type::Instrument || type == Type::Audio || type == Type::Midi;
272 }
273
274 template <typename T> static consteval Type get_type_for_class ()
275 {
276 if constexpr (std::is_same_v<T, MidiTrack>)
277 return Type::Midi;
278 else if constexpr (std::is_same_v<T, AudioTrack>)
279 return Type::Audio;
280 else if constexpr (std::is_same_v<T, ChordTrack>)
281 return Type::Chord;
282 else if constexpr (std::is_same_v<T, InstrumentTrack>)
283 return Type::Instrument;
284 else if constexpr (std::is_same_v<T, AudioBusTrack>)
285 return Type::AudioBus;
286 else if constexpr (std::is_same_v<T, MidiBusTrack>)
287 return Type::MidiBus;
288 else if constexpr (std::is_same_v<T, MasterTrack>)
289 return Type::Master;
290 else if constexpr (std::is_same_v<T, ModulatorTrack>)
291 return Type::Modulator;
292 else if constexpr (std::is_same_v<T, MarkerTrack>)
293 return Type::Marker;
294 else if constexpr (std::is_same_v<T, FolderTrack>)
295 return Type::Folder;
296 else if constexpr (std::is_same_v<T, AudioGroupTrack>)
297 return Type::AudioGroup;
298 else if constexpr (std::is_same_v<T, MidiGroupTrack>)
299 return Type::MidiGroup;
300 else
301 {
302 static_assert (utils::dependent_false_v<T>, "Unknown track type");
303 }
304 }
305
306public:
307 ~Track () override;
308 Q_DISABLE_COPY_MOVE (Track)
310protected:
311 enum class TrackFeatures : std::uint8_t
312 {
313 Modulators = 1 << 0,
314 Automation = 1 << 1,
315 Lanes = 1 << 2,
316 Recording = 1 << 3,
317 PianoRoll = 1 << 4,
318 };
319
323 Track (
324 Type type,
325 std::optional<PortType> in_signal_type,
326 std::optional<PortType> out_signal_type,
327 TrackFeatures enabled_features,
328 BaseTrackDependencies dependencies);
329
330public:
331 bool has_piano_roll () const { return type_has_piano_roll (type_); }
332
333 bool is_folder () const { return type_ == Type::Folder; }
334 bool is_audio_group () const { return type_ == Type::AudioGroup; }
335 bool is_midi_group () const { return type_ == Type::MidiGroup; }
336 bool is_audio_bus () const { return type_ == Type::AudioBus; }
337 bool is_midi_bus () const { return type_ == Type::MidiBus; }
338 bool is_modulator () const { return type_ == Type::Modulator; }
339 bool is_chord () const { return type_ == Type::Chord; }
340 bool is_marker () const { return type_ == Type::Marker; }
341 bool is_audio () const { return type_ == Type::Audio; }
342 bool is_instrument () const { return type_ == Type::Instrument; }
343 bool is_midi () const { return type_ == Type::Midi; }
344 bool is_master () const { return type_ == Type::Master; }
345
346 // ========================================================================
347 // QML Interface
348 // ========================================================================
349
350 Type type () const { return type_; }
351
352 AutomationTracklist * automationTracklist () const
353 {
354 return automation_tracklist_.get ();
355 }
356
357 QString name () const { return name_.to_qstring (); }
358 void setName (const QString &name)
359 {
360 const auto name_str = utils::Utf8String::from_qstring (name);
361 if (name_ == name_str)
362 return;
363
364 name_ = name_str;
365 Q_EMIT nameChanged (name);
366 }
367 Q_SIGNAL void nameChanged (const QString &name);
368
369 QColor color () const { return color_.to_qcolor (); }
370 void setColor (const QColor &color)
371 {
372 if (color_.to_qcolor () == color)
373 return;
374
375 color_ = color;
376 Q_EMIT colorChanged (color);
377 }
378 Q_SIGNAL void colorChanged (const QColor &color);
379
380 QString comment () const { return comment_.to_qstring (); }
381 void setComment (const QString &comment)
382 {
383 const auto comment_str = utils::Utf8String::from_qstring (comment);
384 if (comment_ == comment_str)
385 return;
386
387 comment_ = comment_str;
388 Q_EMIT commentChanged (comment);
389 }
390 Q_SIGNAL void commentChanged (const QString &comment);
391
392 bool visible () const { return visible_; }
393 void setVisible (bool visible)
394 {
395 if (visible_ == visible)
396 return;
397
398 visible_ = visible;
399 Q_EMIT visibleChanged (visible);
400 }
401 Q_SIGNAL void visibleChanged (bool visible);
402
403 bool enabled () const { return enabled_; }
404 void setEnabled (bool enabled)
405 {
406 if (enabled_ == enabled)
407 return;
408 enabled_ = enabled;
409 Q_EMIT enabledChanged (enabled);
410 }
411 Q_SIGNAL void enabledChanged (bool enabled);
412
413 double height () const { return main_height_; }
414 void setHeight (double height)
415 {
417 return;
418
419 height = std::max (static_cast<double> (Track::MIN_HEIGHT), height);
420 main_height_ = height;
421 Q_EMIT heightChanged (height);
422 }
423 Q_SIGNAL void heightChanged (double height);
424
425 double fullVisibleHeight () const { return get_full_visible_height (); }
426 Q_SIGNAL void fullVisibleHeightChanged ();
427
428 QString icon () const { return icon_name_.to_qstring (); }
429 void setIcon (const QString &icon)
430 {
431 const auto icon_str = utils::Utf8String::from_qstring (icon);
432 if (icon_name_ == icon_str)
433 {
434 return;
435 }
436 icon_name_ = icon_str;
437 Q_EMIT iconChanged (icon);
438 }
439 Q_SIGNAL void iconChanged (const QString &icon);
440
441 Channel * channel () const { return channel_.get (); }
442
443 plugins::PluginGroup * modulators () const { return modulators_.get (); }
444
445 TrackLaneList * lanes () const { return lanes_.get (); }
446
447 dsp::ProcessorParameter * recordingParam () const;
448 dsp::ProcessorParameter * monitorParam () const;
449
450 PianoRollTrackMixin * pianoRollTrackMixin () const
451 {
452 return piano_roll_track_mixin_.get ();
453 }
454
455 bool clipLauncherMode () const { return clip_launcher_mode_; }
456 void setClipLauncherMode (bool mode);
457 Q_SIGNAL void clipLauncherModeChanged (bool mode);
458
459 // cache activity tracking
460 [[nodiscard]] PlaybackCacheActivityTracker *
461 playbackCacheActivityTracker () const
462 {
463 return playback_cache_activity_tracker_.get ();
464 }
465
472 Q_INVOKABLE void
474
475 // ========================================================================
476
477 // bool has_lanes () const { return type_has_lanes (type_); }
478
479 bool is_deletable () const { return type_is_deletable (type_); }
480 bool is_copyable () const { return type_is_copyable (type_); }
481 bool has_automation () const { return automationTracklist () != nullptr; }
487 double get_full_visible_height () const;
488
489 bool multiply_heights (double multiplier, bool visible_only, bool check_only);
490
491 bool can_be_group_target () const { return type_can_be_group_target (type_); }
492
496 void set_default_name ();
497
498 template <arrangement::RegionObject RegionT>
499 auto generate_name_for_region (
500 const RegionT &region,
501 AutomationTrack * automation_track = nullptr)
502 {
503 auto ret = get_name ();
504 if constexpr (std::is_same_v<RegionT, arrangement::AutomationRegion>)
505 {
506 assert (automation_track != nullptr);
508 fmt::format (
509 "{} - {}", get_name (), automation_track->parameter ()->label ()));
510 }
511 return ret;
512 }
513
518 std::vector<ArrangerObjectPtrVariant> &objects) const;
519
520 bool contains_uninstantiated_plugin () const;
521
525 utils::Utf8String get_name () const { return name_; };
527 auto input_signal_type () const { return in_signal_type_; }
528 auto output_signal_type () const { return out_signal_type_; }
529
534 uint8_t get_midi_ch (const arrangement::MidiRegion &midi_region) const;
535
539 void
540 collect_plugins (std::vector<plugins::PluginUuidReference> &plugins) const;
541
542// TODO
543#if 0
548 static bool is_plugin_descriptor_valid_for_slot_type (
550 zrythm::plugins::PluginSlotType slot_type,
551 Track::Type track_type);
552#endif
553
554 utils::Utf8String get_full_designation_for_port (const dsp::Port &port) const;
555
564
565 auto &get_registry () const { return base_dependencies_.registry_; }
566 auto &get_registry () { return base_dependencies_.registry_; }
567
568 TrackProcessor * get_track_processor () const { return processor_.get (); }
569
570 auto get_icon_name () const { return icon_name_; }
571
572protected:
573 friend void
574 init_from (Track &obj, const Track &other, utils::ObjectCloneType clone_type);
575
576 void generate_automation_tracks_for_processor (
578 const dsp::ProcessorBase &processor)
579 {
580 structure::tracks::generate_automation_tracks_for_processor (
581 ats, processor, base_dependencies_.tempo_map_,
582 base_dependencies_.registry_);
583 }
584
586 * @brief Implementations with a processor must call this in their constructor.
587 */
589 std::optional<TrackProcessor::FillEventsCallback> fill_events_cb =
590 std::nullopt,
591 std::optional<TrackProcessor::TransformMidiInputsFunc>
592 transform_midi_inputs_func = std::nullopt,
593 std::optional<TrackProcessor::AppendMidiInputsToOutputsFunc>
594 append_midi_inputs_to_outputs_func = std::nullopt);
595
601 std::vector<ArrangerObjectPtrVariant> &objects) const
602 {
603 }
604
605private:
606 static constexpr auto kNameKey = "name"sv;
607 static constexpr auto kIconNameKey = "iconName"sv;
608 static constexpr auto kVisibleKey = "visible"sv;
609 static constexpr auto kMainHeightKey = "mainHeight"sv;
610 static constexpr auto kEnabledKey = "enabled"sv;
611 static constexpr auto kColorKey = "color"sv;
612 static constexpr auto kInputSignalTypeKey = "inSignalType"sv;
613 static constexpr auto kOutputSignalTypeKey = "outSignalType"sv;
614 static constexpr auto kCommentKey = "comment"sv;
615 static constexpr auto kFrozenClipIdKey = "frozenClipId"sv;
616 static constexpr auto kProcessorKey = "processor"sv;
617 static constexpr auto kAutomationTracklistKey = "automationTracklist"sv;
618 static constexpr auto kChannelKey = "channel"sv;
619 static constexpr auto kModulatorsKey = "modulators"sv;
620 static constexpr auto kModulatorMacroProcessorsKey =
621 "modulatorMacroProcessors"sv;
622 static constexpr auto kPianoRollKey = "pianoRoll"sv;
623 static constexpr auto kClipLauncherModeKey = "clipLauncherMode"sv;
624 friend void to_json (nlohmann::json &j, const Track &track);
625 friend void from_json (const nlohmann::json &j, Track &track);
626
628 make_automation_tracklist ();
629 [[nodiscard]] utils::QObjectUniquePtr<Channel> make_channel ();
631 make_modulators ();
632 [[nodiscard]] utils::QObjectUniquePtr<TrackLaneList> make_lanes ();
634 make_piano_roll_track_mixin ();
635
641 void init_cache_scheduler ();
650 void init_playback_cache_activity_tracker (TrackProcessor &proc);
651
652protected:
653 BaseTrackDependencies base_dependencies_;
654
657
658 TrackFeatures features_{};
659
662
665
667 bool visible_ = true;
668
670 double main_height_{ DEF_HEIGHT };
678 bool enabled_ = true;
679
685 Color color_;
686
690 std::optional<PortType> in_signal_type_;
695 std::optional<PortType> out_signal_type_;
699
705 std::optional<dsp::FileAudioSourceUuidReference> frozen_clip_id_;
721
726
729
731 std::vector<utils::QObjectUniquePtr<dsp::ModulatorMacroProcessor>>
733
735
736 utils::QObjectUniquePtr<PianoRollTrackMixin> piano_roll_track_mixin_;
737
743
744 bool clip_launcher_mode_{};
746 playback_cache_activity_tracker_;
747
748 BOOST_DESCRIBE_CLASS (
749 Track,
751 (),
752 (type_,
753 name_,
754 visible_,
756 enabled_,
757 color_,
760 comment_,
763 channel_,
766 lanes_,
767 piano_roll_track_mixin_,
768 clip_launcher_mode_),
769 ())
770};
771
772using TrackUuidReference = utils::TypedUuidReference<Track>;
773
774struct FinalTrackDependencies : public BaseTrackDependencies
775{
776 FinalTrackDependencies (
777 const dsp::TempoMapWrapper &tempo_map,
778 utils::IObjectRegistry &registry,
779 const dsp::ITransport &transport,
780 SoloedTracksExistGetter soloed_tracks_exist_getter,
781 TrackRecordingCallback recording_callback)
783 tempo_map,
784 registry,
785 transport,
786 std::move (soloed_tracks_exist_getter),
787 std::move (recording_callback))
788 {
789 }
790
791 BaseTrackDependencies to_base_dependencies ()
792 {
793 return static_cast<BaseTrackDependencies> (*this); // NOLINT
794 }
795};
796
797} // 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:34
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
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 Region containing MIDI events.
Definition midi_region.h:24
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:714
static constexpr bool type_has_inputs(const Type type)
Returns if the Track should have an inputs selector.
Definition track.h:228
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:706
bool enabled_
Active (enabled) or not.
Definition track.h:664
std::optional< dsp::FileAudioSourceUuidReference > frozen_clip_id_
Pool ID of the clip if track is frozen (unset if not frozen).
Definition track.h:691
utils::Utf8String name_
Track name, used in channel too.
Definition track.h:647
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:210
void generate_basic_automation_tracks()
Adds basic automation tracks.
double main_height_
Height of the main part (without lanes).
Definition track.h:656
static constexpr bool type_has_piano_roll(const Type type)
Returns if the Track should have a piano roll.
Definition track.h:220
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:676
utils::Utf8String get_name() const
Getter for the track name.
Definition track.h:511
utils::QObjectUniquePtr< utils::PlaybackCacheScheduler > playable_content_cache_request_debouncer_
Debouncer/scheduler of audio/MIDI cache requests.
Definition track.h:728
utils::QObjectUniquePtr< AutomationTracklist > automation_tracklist_
Automation tracks, if track is automatable.
Definition track.h:696
Type type_
The type of track this is.
Definition track.h:642
utils::Utf8String comment_
User comments.
Definition track.h:684
utils::QObjectUniquePtr< Channel > channel_
Channel for this track, if any.
Definition track.h:711
std::optional< PortType > out_signal_type_
The output signal type (eg midi tracks have MIDI output signals).
Definition track.h:681
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:119
@ AudioGroup
Group Tracks are used for grouping audio signals, for example routing multiple drum tracks to a "Drum...
Definition track.h:138
@ AudioBus
Buses are channels that receive audio input and have effects on their channel strip.
Definition track.h:131
@ Modulator
Special track to contain global Modulator's.
Definition track.h:124
@ Midi
Midi tracks can only have MIDI effects in the strip and produce MIDI output that can be routed to ins...
Definition track.h:144
@ Instrument
Instrument tracks must have an Instrument plugin at the first slot and they produce audio output.
Definition track.h:97
@ Folder
Foldable track used for visual grouping.
Definition track.h:153
@ Audio
Audio tracks can record and contain audio clips.
Definition track.h:103
@ MidiGroup
Same with audio group but for MIDI signals.
Definition track.h:150
@ MidiBus
Same with audio bus but for MIDI signals.
Definition track.h:147
@ 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:114
@ Master
The master track is a special type of group track.
Definition track.h:108
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:718
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:586
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:193
Color color_
Track color.
Definition track.h:671
bool visible_
Whole Track is visible or not.
Definition track.h:653
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:650
static constexpr bool type_can_be_group_target(const Type type)
Returns if the Track can be a direct route target.
Definition track.h:240
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