Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
track_creator.h
1// SPDX-FileCopyrightText: © 2025 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "commands/add_track_command.h"
7#include "structure/tracks/track_all.h"
8#include "structure/tracks/track_factory.h"
9#include "structure/tracks/track_routing.h"
10#include "structure/tracks/tracklist.h"
11#include "undo/undo_stack.h"
12
13namespace zrythm::actions
14{
15class TrackCreator : public QObject
16{
17 Q_OBJECT
18 QML_ELEMENT
19 QML_UNCREATABLE ("One instance per project")
20
21public:
22 explicit TrackCreator (
23 undo::UndoStack &undo_stack,
25 structure::tracks::TrackCollection &track_collection,
27 structure::tracks::SingletonTracks &singleton_tracks,
28 QObject * parent = nullptr)
29 : QObject (parent), track_factory_ (track_factory),
30 track_collection_ (track_collection), track_routing_ (track_routing),
31 singleton_tracks_ (singleton_tracks), undo_stack_ (undo_stack)
32 {
33 }
34
35 Q_INVOKABLE QVariant
36 addEmptyTrackFromType (structure::tracks::Track::Type trackType) const;
37
38private:
42 utils::Utf8String get_unique_name_for_track (
43 const structure::tracks::Track::Uuid &track_to_skip,
44 const utils::Utf8String &name) const;
45
46private:
47 structure::tracks::TrackFactory &track_factory_;
48 structure::tracks::TrackCollection &track_collection_;
49 structure::tracks::TrackRouting &track_routing_;
50 structure::tracks::SingletonTracks &singleton_tracks_;
51 undo::UndoStack &undo_stack_;
52};
53} // namespace zrythm::actions
References to tracks that are singletons.
A collection of tracks that provides a QAbstractListModel interface.
Management of track-to-track connections.
Lightweight UTF-8 string wrapper with safe conversions.
Definition utf8_string.h:38