|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
Base class to be inherited by implementing undoable actions. More...
#include <src/gui/backend/backend/legacy_actions/undoable_action.h>

Public Types | |
| enum class | Type { TracklistSelections , ChannelSend , MixerSelections , ArrangerSelections , MidiMapping , PortConnection , Port , Range , Transport , Chord } |
| Type of UndoableAction. More... | |
| using | PortConnectionsManager = dsp::PortConnectionsManager |
Public Member Functions | |
| UndoableAction (Type type) | |
| UndoableAction (Type type, dsp::FramesPerTick frames_per_tick, units::sample_rate_t sample_rate) | |
| void | init_loaded (sample_rate_t engine_sample_rate) |
| Non virtual function following the NVI pattern. | |
| virtual bool | needs_pause () const |
| Returns whether the action requires pausing the engine. | |
| virtual bool | needs_transport_total_bar_update (bool perform) const |
| Returns whether the total transport bars need to be recalculated. | |
| virtual bool | affects_audio_region_internal_positions () const |
| Whether audio region loop/fade/etc. | |
| virtual void | get_plugins (std::vector< plugins::Plugin * > &plugins) |
| Get the plugins referenced in this action. | |
| auto | get_frames_per_tick () const |
| auto | get_ticks_per_frame () const |
| void | set_num_actions (int num_actions) |
| Sets the number of actions for this action. | |
| void | save_or_load_port_connections (bool performing) |
| To be used by actions that save/load port connections. | |
| void | perform () |
| Performs the action. | |
| void | undo () |
| Undoes the action. | |
| virtual QString | to_string () const =0 |
| Stringizes the action to be used in Undo/Redo buttons. | |
Data Fields | |
| Type | undoable_action_type_ {} |
| Undoable action type. | |
| dsp::FramesPerTick | frames_per_tick_ |
| A snapshot of AudioEngine.frames_per_tick when the action is executed. | |
| units::sample_rate_t | sample_rate_ = 0 |
| Sample rate of this action. | |
| int | num_actions_ = 1 |
| Number of actions to perform. | |
| 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 connections when undoing. | |
| std::unique_ptr< dsp::PortConnectionsManager > | port_connections_after_ |
Friends | |
| void | init_from (UndoableAction &obj, const UndoableAction &other, utils::ObjectCloneType clone_type) |
Base class to be inherited by implementing undoable actions.
Definition at line 26 of file undoable_action.h.
| using zrythm::gui::actions::UndoableAction::PortConnectionsManager = dsp::PortConnectionsManager |
Definition at line 29 of file undoable_action.h.
|
strong |
Type of UndoableAction.
Definition at line 34 of file undoable_action.h.
|
inlinevirtual |
Whether audio region loop/fade/etc.
positions are affected by this undoable action.
Used to correct off-by-one errors when changing BPM or resampling or something that causes position conversions.
Definition at line 103 of file undoable_action.h.
|
inline |
Definition at line 112 of file undoable_action.h.
|
inlinevirtual |
Get the plugins referenced in this action.
| plugins |
Definition at line 110 of file undoable_action.h.
|
inline |
Definition at line 113 of file undoable_action.h.
| void zrythm::gui::actions::UndoableAction::init_loaded | ( | sample_rate_t | engine_sample_rate | ) |
Non virtual function following the NVI pattern.
|
inlinevirtual |
Returns whether the action requires pausing the engine.
Reimplemented in zrythm::gui::actions::ArrangerSelectionsAction, and zrythm::gui::actions::TracklistSelectionsAction.
Definition at line 83 of file undoable_action.h.
|
inlinevirtual |
Returns whether the total transport bars need to be recalculated.
Reimplemented in zrythm::gui::actions::ArrangerSelectionsAction, and zrythm::gui::actions::TracklistSelectionsAction.
Definition at line 91 of file undoable_action.h.
| void zrythm::gui::actions::UndoableAction::perform | ( | ) |
| void zrythm::gui::actions::UndoableAction::save_or_load_port_connections | ( | bool | performing | ) |
To be used by actions that save/load port connections.
| performing | True if doing/performing, false if undoing. |
| void zrythm::gui::actions::UndoableAction::set_num_actions | ( | int | num_actions | ) |
Sets the number of actions for this action.
This should be set on the last action to be performed.
|
pure virtual |
Stringizes the action to be used in Undo/Redo buttons.
Implemented in zrythm::gui::actions::ArrangerSelectionsAction, zrythm::gui::actions::ChannelSendAction, zrythm::gui::actions::ChordAction, zrythm::gui::actions::MidiMappingAction, zrythm::gui::actions::MixerSelectionsAction, zrythm::gui::actions::PortAction, zrythm::gui::actions::PortConnectionAction, zrythm::gui::actions::RangeAction, zrythm::gui::actions::TracklistSelectionsAction, and zrythm::gui::actions::TransportAction.
| void zrythm::gui::actions::UndoableAction::undo | ( | ) |
Undoes the action.
| ZrythmException | on error. |
| dsp::FramesPerTick zrythm::gui::actions::UndoableAction::frames_per_tick_ |
A snapshot of AudioEngine.frames_per_tick when the action is executed.
Definition at line 173 of file undoable_action.h.
| int zrythm::gui::actions::UndoableAction::num_actions_ = 1 |
Number of actions to perform.
This is used to group multiple actions into one logical action (eg, create a group track and route multiple tracks to it).
To be set on the last action being performed.
Definition at line 191 of file undoable_action.h.
| std::unique_ptr<dsp::PortConnectionsManager> zrythm::gui::actions::UndoableAction::port_connections_after_ |
Definition at line 200 of file undoable_action.h.
| std::unique_ptr<dsp::PortConnectionsManager> zrythm::gui::actions::UndoableAction::port_connections_before_ |
An (optional) clone of the port connections at the start of the action, used for reverting port connections when undoing.
Definition at line 197 of file undoable_action.h.
| units::sample_rate_t zrythm::gui::actions::UndoableAction::sample_rate_ = 0 |
Sample rate of this action.
Used to recalculate UndoableAction.frames_per_tick when the project is loaded under a new samplerate.
Definition at line 181 of file undoable_action.h.
| Type zrythm::gui::actions::UndoableAction::undoable_action_type_ {} |
Undoable action type.
Definition at line 170 of file undoable_action.h.