Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
add_region_to_clip_slot_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/scenes/clip_slot.h"
10
11#include <QUndoCommand>
12
13namespace zrythm::commands
14{
15
16class AddRegionToClipSlotCommand : public QUndoCommand
17{
18public:
19 AddRegionToClipSlotCommand (
21 structure::arrangement::ArrangerObjectUuidReference object_ref)
22 : QUndoCommand (QObject::tr ("Add Clip")), slot_ (clip_slot),
23 object_ref_ (std::move (object_ref))
24 {
25 }
26
27 void redo () override { slot_.setRegion (object_ref_.get_object_base ()); }
28 void undo () override { slot_.clearRegion (); }
29
30private:
32 structure::arrangement::ArrangerObjectUuidReference object_ref_;
33};
34
35} // namespace zrythm::commands