6#include "dsp/port_connections_manager.h"
7#include "plugins/plugin.h"
8#include "utils/types.h"
10namespace zrythm::gui::actions
13#define DEFINE_UNDOABLE_ACTION_QML_PROPERTIES(ClassType) \
18 Q_INVOKABLE QString getDescription () const \
20 return to_string (); \
69 dsp::FramesPerTick frames_per_tick,
70 units::sample_rate_t sample_rate);
110 virtual void get_plugins (std::vector<plugins::Plugin *> &plugins) { };
113 auto get_ticks_per_frame ()
const
115 return to_ticks_per_frame (get_frames_per_tick ());
154 friend void init_from (
156 const UndoableAction &other,
161 virtual void init_loaded_impl () = 0;
162 virtual void perform_impl () = 0;
163 virtual void undo_impl () = 0;
166 void do_or_undo (
bool perform);
213using UndoableActionVariant = std::variant<
224using UndoableActionPtrVariant = to_pointer_variant<UndoableActionVariant>;
228 std::derived_from<T, UndoableAction> && !std::is_same_v<T, UndoableAction>;
Port connections manager.
An action that performs changes to the arranger selections.
Action for channel send changes.
Action for chord pad changes.
Action for manipulating plugins (plugin slot selections in the mixer).
Tracklist selections (tracks) action.
Base class to be inherited by implementing undoable actions.
virtual bool needs_transport_total_bar_update(bool perform) const
Returns whether the total transport bars need to be recalculated.
std::unique_ptr< dsp::PortConnectionsManager > port_connections_after_
void undo()
Undoes the action.
void set_num_actions(int num_actions)
Sets the number of actions for this action.
virtual bool needs_pause() const
Returns whether the action requires pausing the engine.
int num_actions_
Number of actions to perform.
virtual QString to_string() const =0
Stringizes the action to be used in Undo/Redo buttons.
std::unique_ptr< dsp::PortConnectionsManager > port_connections_before_
An (optional) clone of the port connections at the start of the action, used for reverting port conne...
Type
Type of UndoableAction.
virtual void get_plugins(std::vector< plugins::Plugin * > &plugins)
Get the plugins referenced in this action.
void perform()
Performs the action.
dsp::FramesPerTick frames_per_tick_
A snapshot of AudioEngine.frames_per_tick when the action is executed.
virtual bool affects_audio_region_internal_positions() const
Whether audio region loop/fade/etc.
Type undoable_action_type_
Undoable action type.
units::sample_rate_t sample_rate_
Sample rate of this action.
void save_or_load_port_connections(bool performing)
To be used by actions that save/load port connections.
void init_loaded(sample_rate_t engine_sample_rate)
Non virtual function following the NVI pattern.