Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
move_plugins_command.h
1// SPDX-FileCopyrightText: © 2025-2026 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include <utility>
7
8#include "plugins/plugin_group.h"
9#include "structure/tracks/automation_tracklist.h"
10
11#include <QUndoCommand>
12
13namespace zrythm::commands
14{
15
22class MovePluginsCommand : public QUndoCommand
23{
24public:
25 static constexpr int CommandId = 1763227783;
26
27 using PluginLocation =
28 std::pair<plugins::PluginGroup *, structure::tracks::AutomationTracklist *>;
29
32 {
34 plugins::PluginUuidReference plugin_ref;
36 PluginLocation source_location;
39 };
40
50 std::vector<PluginMoveInfo> plugin_infos,
51 PluginLocation target_location,
52 std::optional<int> target_start_index = std::nullopt);
53
54 void undo () override;
55 void redo () override;
56
57 int id () const override { return CommandId; }
58
59private:
60 void move_plugin_automation (
61 const plugins::PluginUuidReference &plugin_ref,
64
65private:
66 std::vector<PluginMoveInfo> plugin_infos_;
67 PluginLocation target_location_;
68 std::optional<int> target_start_index_;
69};
70
71} // namespace zrythm::commands
MovePluginsCommand(std::vector< PluginMoveInfo > plugin_infos, PluginLocation target_location, std::optional< int > target_start_index=std::nullopt)
Constructs a command to move plugins to a target location.
A container that manages a list of automation tracks.
int index_in_source
Index of the plugin in its source group (saved during redo).
plugins::PluginUuidReference plugin_ref
Reference to the plugin being moved.
PluginLocation source_location
Where the plugin currently lives.