Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
delete_tracks_command.h
1// SPDX-FileCopyrightText: © 2026 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include <optional>
7#include <unordered_set>
8#include <vector>
9
10#include "structure/tracks/track_collection.h"
11
12#include <QUndoCommand>
13
14namespace zrythm::commands
15{
16
17class DeleteTracksCommand : public QUndoCommand
18{
19public:
20 static constexpr auto CommandId = 1776134295;
21
22 DeleteTracksCommand (
24 std::vector<structure::tracks::TrackUuidReference> track_refs);
25
26 void undo () override;
27 void redo () override;
28 int id () const override { return CommandId; }
29
30private:
31 struct TrackInfo
32 {
33 structure::tracks::TrackUuidReference ref;
34 int original_position;
35 std::optional<structure::tracks::Track::Uuid> original_folder_parent;
36 bool original_expanded_state;
37 };
38
40
41 std::vector<TrackInfo> tracks_;
42 std::unordered_set<structure::tracks::Track::Uuid> deleted_uuids_;
43};
44
45} // namespace zrythm::commands
A collection of tracks that provides a QAbstractListModel interface.