Actions module

User action implementations.

Contents

Classes

struct ArrangerSelectionsAction
The action.
struct UndoManager
Undo manager.
struct UndoStack
Serializable stack for undoable actions.

Enums

enum ArrangerSelectionsActionResizeType { ARRANGER_SELECTIONS_ACTION_RESIZE_L, ARRANGER_SELECTIONS_ACTION_RESIZE_R, ARRANGER_SELECTIONS_ACTION_RESIZE_L_LOOP, ARRANGER_SELECTIONS_ACTION_RESIZE_R_LOOP, ARRANGER_SELECTIONS_ACTION_RESIZE_L_FADE, ARRANGER_SELECTIONS_ACTION_RESIZE_R_FADE, ARRANGER_SELECTIONS_ACTION_STRETCH_L, ARRANGER_SELECTIONS_ACTION_STRETCH_R }
Type used when the action is a RESIZE action.
enum ArrangerSelectionsActionEditType { ARRANGER_SELECTIONS_ACTION_EDIT_NAME, ARRANGER_SELECTIONS_ACTION_EDIT_POS, ARRANGER_SELECTIONS_ACTION_EDIT_PRIMITIVE, ARRANGER_SELECTIONS_ACTION_EDIT_SCALE, ARRANGER_SELECTIONS_ACTION_EDIT_FADES, ARRANGER_SELECTIONS_ACTION_EDIT_MUTE }
Type used when the action is an EDIT action.
enum UndoableActionType { UA_CREATE_TRACKS, UA_MOVE_TRACKS, UA_EDIT_TRACKS, UA_COPY_TRACKS, UA_DELETE_TRACKS, UA_CREATE_PLUGINS, UA_MOVE_PLUGINS, UA_EDIT_PLUGINS, UA_COPY_PLUGINS, UA_DELETE_PLUGINS, UA_CREATE_ARRANGER_SELECTIONS, UA_MOVE_ARRANGER_SELECTIONS, UA_LINK_ARRANGER_SELECTIONS, UA_RECORD_ARRANGER_SELECTIONS, UA_RESIZE_ARRANGER_SELECTIONS, UA_SPLIT_ARRANGER_SELECTIONS, UA_EDIT_ARRANGER_SELECTIONS, UA_DUPLICATE_ARRANGER_SELECTIONS, UA_DELETE_ARRANGER_SELECTIONS, UA_QUANTIZE_ARRANGER_SELECTIONS }
Type of UndoableAction.

Typedefs

using ArrangerSelectionsActionResizeType = enum ArrangerSelectionsActionResizeType
Type used when the action is a RESIZE action.
using ArrangerSelectionsActionEditType = enum ArrangerSelectionsActionEditType
Type used when the action is an EDIT action.
using ArrangerSelectionsAction = struct ArrangerSelectionsAction
The action.
using UndoManager = struct UndoManager
Undo manager.
using UndoStack = struct UndoStack
Serializable stack for undoable actions.
using UndoableActionType = enum UndoableActionType
Type of UndoableAction.

Functions

void activate_preferences(GSimpleAction* action, GVariant* variant, gpointer user_data)
Show preferences window.
void activate_log(GSimpleAction* action, GVariant* variant, gpointer user_data)
Show preferences window.
void activate_scripting_interface(GSimpleAction* action, GVariant* variant, gpointer user_data)
Show preferences window.
void activate_audition_mode(GSimpleAction* action, GVariant* variant, gpointer user_data)
Activate audition mode.
void activate_select_mode(GSimpleAction* action, GVariant* variant, gpointer user_data)
Activate select mode.
void activate_edit_mode(GSimpleAction* action, GVariant* variant, gpointer user_data)
Activate edit mode.
void activate_cut_mode(GSimpleAction* action, GVariant* variant, gpointer user_data)
Activate cut mode.
void activate_eraser_mode(GSimpleAction* action, GVariant* variant, gpointer user_data)
Activate eraser mode.
void activate_ramp_mode(GSimpleAction* action, GVariant* variant, gpointer user_data)
Activate ramp mode.
void activate_toggle_top_panel(GSimpleAction* action, GVariant* variant, gpointer user_data)
Toggle timeline visibility.
void activate_toggle_drum_mode(GSimpleAction* action, GVariant* variant, gpointer user_data)
Toggle drum mode in the piano roll.
auto arranger_selections_action_new_create_or_delete(ArrangerSelections* sel, const int create) -> UndoableAction*
Creates a new action for creating/deleting objects.
auto arranger_selections_action_new_move_or_duplicate(ArrangerSelections* sel, const bool move, const double ticks, const int delta_chords, const int delta_pitch, const int delta_tracks, const int delta_lanes, const double delta_normalized_amount, const bool already_moved) -> UndoableAction*
Creates a new action for moving or duplicating objects.
auto arranger_selections_action_new_link(ArrangerSelections* sel_before, ArrangerSelections* sel_after, const double ticks, const int delta_tracks, const int delta_lanes, const bool already_moved) -> UndoableAction*
Creates a new action for linking regions.
auto arranger_selections_action_new_edit(ArrangerSelections* sel_before, ArrangerSelections* sel_after, ArrangerSelectionsActionEditType type, bool already_edited) -> UndoableAction*
Creates a new action for editing properties of an object.
auto arranger_selections_action_new_split(ArrangerSelections* sel, const Position* pos) -> UndoableAction*
Creates a new action for splitting ArrangerObject's.
auto arranger_selections_action_new_resize(ArrangerSelections* sel, ArrangerSelectionsActionResizeType type, const double ticks) -> UndoableAction*
Creates a new action for resizing ArrangerObject's.
auto arranger_selections_action_new_quantize(ArrangerSelections* sel, QuantizeOptions* opts) -> UndoableAction*
Creates a new action fro quantizing ArrangerObject's.
auto copy_plugins_action_new(MixerSelections* ms, PluginSlotType slot_type, Track* tr, int slot) -> UndoableAction*
Create a new CopyPluginsAction.
auto create_tracks_action_new(TrackType type, const PluginDescriptor* pl_descr, SupportedFile* file_descr, int pos, int num_tracks) -> UndoableAction*
Creates a new CreateTracksAction.
auto move_tracks_action_new(TracklistSelections* tls, int pos) -> UndoableAction*
Move tracks to given position.
void undo_manager_init(UndoManager* self, int loading)
Inits the undo manager by creating or populating the undo/redo stacks.
void undo_manager_undo(UndoManager* self)
Undo last action.
void undo_manager_redo(UndoManager* self)
Redo last undone action.
void undo_manager_perform(UndoManager* self, UndoableAction* action)
Performs the action and pushes it to the undo stack.
void undo_manager_clear_stacks(UndoManager* self)
Clears the undo and redo stacks.
auto undo_stack_new(void) -> UndoStack*
Creates a new stack for undoable actions.
auto undo_stack_pop_last(UndoStack* self) -> UndoableAction*
Pops the last element and moves everything back.
auto undoable_action_do(UndoableAction* self) -> int
Performs the action.
auto undoable_action_undo(UndoableAction* self) -> int
Undoes the action.
auto undoable_action_stringize(UndoableAction* ua) -> char*
Stringizes the action to be used in Undo/Redo buttons.

Enum documentation

enum ArrangerSelectionsActionResizeType

Type used when the action is a RESIZE action.

enum ArrangerSelectionsActionEditType

Type used when the action is an EDIT action.

Enumerators
ARRANGER_SELECTIONS_ACTION_EDIT_NAME

Edit the name of the ArrangerObject's in the selection.

ARRANGER_SELECTIONS_ACTION_EDIT_POS

Edit a Position of the ArrangerObject's in the selection.

This will just set all of the positions on the object.

ARRANGER_SELECTIONS_ACTION_EDIT_PRIMITIVE

Edit a primitive (int, etc) member of ArrangerObject's in the selection.

This will simply set all relevant primitive values in an ArrangerObject when doing/undoing.

ARRANGER_SELECTIONS_ACTION_EDIT_SCALE

For editing the MusicalScale inside ScaleObject's.

ARRANGER_SELECTIONS_ACTION_EDIT_FADES

Editing fade positions or curve options.

ARRANGER_SELECTIONS_ACTION_EDIT_MUTE

Change mute status.

Typedef documentation

typedef enum ArrangerSelectionsActionResizeTypeArrangerSelectionsActionResizeType

Type used when the action is a RESIZE action.

typedef enum ArrangerSelectionsActionEditTypeArrangerSelectionsActionEditType

Type used when the action is an EDIT action.

typedef struct UndoManagerUndoManager

Undo manager.

typedef struct UndoStackUndoStack

Serializable stack for undoable actions.

This is used for both undo and redo.

Function documentation

void activate_preferences(GSimpleAction* action, GVariant* variant, gpointer user_data)

Show preferences window.

void activate_log(GSimpleAction* action, GVariant* variant, gpointer user_data)

Show preferences window.

void activate_scripting_interface(GSimpleAction* action, GVariant* variant, gpointer user_data)

Show preferences window.

void activate_audition_mode(GSimpleAction* action, GVariant* variant, gpointer user_data)

Activate audition mode.

void activate_select_mode(GSimpleAction* action, GVariant* variant, gpointer user_data)

Activate select mode.

void activate_edit_mode(GSimpleAction* action, GVariant* variant, gpointer user_data)

Activate edit mode.

void activate_cut_mode(GSimpleAction* action, GVariant* variant, gpointer user_data)

Activate cut mode.

void activate_eraser_mode(GSimpleAction* action, GVariant* variant, gpointer user_data)

Activate eraser mode.

void activate_ramp_mode(GSimpleAction* action, GVariant* variant, gpointer user_data)

Activate ramp mode.

void activate_toggle_top_panel(GSimpleAction* action, GVariant* variant, gpointer user_data)

Toggle timeline visibility.

void activate_toggle_drum_mode(GSimpleAction* action, GVariant* variant, gpointer user_data)

Toggle drum mode in the piano roll.

UndoableAction* arranger_selections_action_new_create_or_delete(ArrangerSelections* sel, const int create)

Creates a new action for creating/deleting objects.

Parameters
sel
create 1 to create 0 to delte.

UndoableAction* arranger_selections_action_new_move_or_duplicate(ArrangerSelections* sel, const bool move, const double ticks, const int delta_chords, const int delta_pitch, const int delta_tracks, const int delta_lanes, const double delta_normalized_amount, const bool already_moved)

Creates a new action for moving or duplicating objects.

Parameters
sel
move True to move, false to duplicate.
ticks
delta_chords
delta_pitch
delta_tracks
delta_lanes
delta_normalized_amount Difference in a normalized amount, such as automation point normalized value.
already_moved If this is true, the first DO will do nothing.

UndoableAction* arranger_selections_action_new_link(ArrangerSelections* sel_before, ArrangerSelections* sel_after, const double ticks, const int delta_tracks, const int delta_lanes, const bool already_moved)

Creates a new action for linking regions.

Parameters
sel_before Original selections.
sel_after Selections after duplication.
ticks
delta_tracks
delta_lanes
already_moved If this is true, the first DO will do nothing.

UndoableAction* arranger_selections_action_new_edit(ArrangerSelections* sel_before, ArrangerSelections* sel_after, ArrangerSelectionsActionEditType type, bool already_edited)

Creates a new action for editing properties of an object.

Parameters
sel_before The selections before the change.
sel_after The selections after the change.
type Indication of which field has changed.
already_edited

UndoableAction* arranger_selections_action_new_split(ArrangerSelections* sel, const Position* pos)

Creates a new action for splitting ArrangerObject's.

Parameters
sel
pos Global position to split at.

UndoableAction* arranger_selections_action_new_resize(ArrangerSelections* sel, ArrangerSelectionsActionResizeType type, const double ticks)

Creates a new action for resizing ArrangerObject's.

Parameters
sel
type
ticks How many ticks to add to the resizing edge.

UndoableAction* arranger_selections_action_new_quantize(ArrangerSelections* sel, QuantizeOptions* opts)

Creates a new action fro quantizing ArrangerObject's.

Parameters
sel
opts Quantize options.

UndoableAction* copy_plugins_action_new(MixerSelections* ms, PluginSlotType slot_type, Track* tr, int slot)

Create a new CopyPluginsAction.

Parameters
ms
slot_type Slot type to copy to.
tr Track to copy to.
slot Starting slot to copy plugins to.

UndoableAction* create_tracks_action_new(TrackType type, const PluginDescriptor* pl_descr, SupportedFile* file_descr, int pos, int num_tracks)

Creates a new CreateTracksAction.

Parameters
type
pl_descr
file_descr
pos Position to make the tracks at.
num_tracks

void undo_manager_init(UndoManager* self, int loading)

Inits the undo manager by creating or populating the undo/redo stacks.

Parameters
self
loading True if this is a loaded project, false if a new project.

void undo_manager_undo(UndoManager* self)

Undo last action.

void undo_manager_redo(UndoManager* self)

Redo last undone action.

void undo_manager_perform(UndoManager* self, UndoableAction* action)

Performs the action and pushes it to the undo stack.

void undo_manager_clear_stacks(UndoManager* self)

Clears the undo and redo stacks.

UndoStack* undo_stack_new(void)

Creates a new stack for undoable actions.

UndoableAction* undo_stack_pop_last(UndoStack* self)

Pops the last element and moves everything back.

int undoable_action_do(UndoableAction* self)

Performs the action.

Returns Non-zero if errors occurred.

int undoable_action_undo(UndoableAction* self)

Undoes the action.

Returns Non-zero if errors occurred.

char* undoable_action_stringize(UndoableAction* ua)

Stringizes the action to be used in Undo/Redo buttons.

The string MUST be free'd using g_free().