Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
remove_arranger_object_command.h
1// SPDX-FileCopyrightText: © 2025 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include <utility>
7
8#include "structure/arrangement/arranger_object_all.h"
9#include "structure/arrangement/arranger_object_owner.h"
10
11#include <QUndoCommand>
12
13namespace zrythm::commands
14{
15
16template <structure::arrangement::FinalArrangerObjectSubclass ObjectT>
17class RemoveArrangerObjectCommand : public QUndoCommand
18{
19public:
20 RemoveArrangerObjectCommand (
22 structure::arrangement::ArrangerObjectUuidReference object_ref)
23 : QUndoCommand (QObject::tr ("Remove Object")),
24 object_owner_ (object_owner), object_ref_ (std::move (object_ref))
25 {
26 }
27
28 void undo () override { object_owner_.add_object (object_ref_); }
29 void redo () override { object_owner_.remove_object (object_ref_.id ()); }
30
31private:
33 structure::arrangement::ArrangerObjectUuidReference object_ref_;
34};
35
36} // namespace zrythm::commands