Actions module

User action implementations.

Contents

Classes

struct ArrangerSelectionsAction
The action.
struct EditTracksAction
Edit tracks 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 EditTracksActionType { EDIT_TRACK_ACTION_TYPE_SOLO, EDIT_TRACK_ACTION_TYPE_MUTE, EDIT_TRACK_ACTION_TYPE_VOLUME, EDIT_TRACK_ACTION_TYPE_PAN, EDIT_TRACK_ACTION_TYPE_DIRECT_OUT, EDIT_TRACK_ACTION_TYPE_RENAME }
Action type.
enum PortActionType { PORT_ACTION_SET_CONTROL_VAL }
enum UndoableActionType { UA_CREATE_TRACKS, UA_MOVE_TRACKS, UA_EDIT_TRACKS, UA_COPY_TRACKS, UA_DELETE_TRACKS, UA_CHANNEL_SEND, 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_MERGE_ARRANGER_SELECTIONS, UA_EDIT_ARRANGER_SELECTIONS, UA_DUPLICATE_ARRANGER_SELECTIONS, UA_DELETE_ARRANGER_SELECTIONS, UA_QUANTIZE_ARRANGER_SELECTIONS, UA_AUTOMATION_FILL, UA_MIDI_MAPPING, UA_PORT_CONNECTION, UA_PORT, UA_RANGE, UA_TRANSPORT }
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 EditTracksActionType = enum EditTracksActionType
Action type.
using EditTracksAction = struct EditTracksAction
Edit tracks 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_automation_fill(ZRegion* region_before, ZRegion* region_after, bool already_changed) -> UndoableAction*
Creates a new action for automation autofill.
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_merge(ArrangerSelections* sel) -> UndoableAction*
Creates a new action for merging 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 channel_send_action_new(ChannelSend* send, ChannelSendActionType type, Port* midi, StereoPorts* stereo, float amount) -> UndoableAction*
Creates a new action.
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 track_pos, Position* pos, int num_tracks) -> UndoableAction*
Creates a new CreateTracksAction.
auto edit_tracks_action_new(EditTracksActionType type, TracklistSelections* tls, Track* direct_out, float vol_delta, float pan_delta, bool solo_new, bool mute_new) -> UndoableAction*
All-in-one constructor.
auto edit_tracks_action_new_generic(EditTracksActionType type, TracklistSelections* tls_before, TracklistSelections* tls_after, bool already_edited) -> UndoableAction*
Generic edit action.
auto edit_tracks_action_new_track_float(EditTracksActionType type, Track* track, float val_before, float val_after, bool already_edited) -> UndoableAction*
Generic edit action.
auto edit_tracks_action_new_mute(TracklistSelections* tls, bool mute_new) -> UndoableAction*
Wrapper over edit_tracks_action_new().
auto edit_tracks_action_new_solo(TracklistSelections* tls, bool solo_new) -> UndoableAction*
Wrapper over edit_tracks_action_new().
auto edit_tracks_action_new_direct_out(TracklistSelections* tls, Track* direct_out) -> UndoableAction*
Wrapper over edit_tracks_action_new().
auto midi_mapping_action_new_enable(int idx, bool enable) -> UndoableAction*
Creates a new action.
auto midi_mapping_action_new_bind(midi_byte_t* buf, ExtPort* device_port, Port* dest_port) -> UndoableAction*
Creates a new action.
auto midi_mapping_action_new_unbind(int idx) -> UndoableAction*
Creates a new action.
auto move_tracks_action_new(TracklistSelections* tls, int pos) -> UndoableAction*
Move tracks to given position.
auto port_action_new(PortActionType type, PortIdentifier* port_id, float val, bool is_normalized) -> UndoableAction*
Create a new action.
auto port_connection_action_new(PortConnectionActionType type, PortIdentifier* src_id, PortIdentifier* dest_id, float new_val) -> UndoableAction*
Create a new action.
auto range_action_new(RangeActionType type, Position* start_pos, Position* end_pos) -> UndoableAction*
Creates a new action.
void undo_manager_init_loaded(UndoManager* self)
Inits the undo manager by populating the undo/redo stacks.
auto undo_manager_new(void) -> UndoManager*
Inits the undo manager by creating the undo/redo stacks.
void undo_manager_undo(UndoManager* self)
Undo last action.
void undo_manager_redo(UndoManager* self)
Redo last undone action.
auto undo_manager_perform(UndoManager* self, UndoableAction* action) -> int
Performs the action and pushes it to the undo stack.
void undo_manager_clear_stacks(UndoManager* self, bool free)
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.
void undo_stack_clear(UndoStack* self, bool free)
Clears the stack, optionally freeing all the elements.
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.

Defines

#define create_tracks_action_new_audio_fx(pl_descr, track_pos, num_tracks)
Creates a new CreateTracksAction for an audio FX track.
#define create_tracks_action_new_audio_group(track_pos, num_tracks)
Creates a new CreateTracksAction for an audio group track.

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.

enum PortActionType

Enumerators
PORT_ACTION_SET_CONTROL_VAL

Set control port value.

Typedef documentation

typedef enum ArrangerSelectionsActionResizeType ArrangerSelectionsActionResizeType

Type used when the action is a RESIZE action.

typedef enum ArrangerSelectionsActionEditType ArrangerSelectionsActionEditType

Type used when the action is an EDIT action.

typedef struct EditTracksAction EditTracksAction

Edit tracks action.

typedef struct UndoManager UndoManager

Undo manager.

typedef struct UndoStack UndoStack

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_automation_fill(ZRegion* region_before, ZRegion* region_after, bool already_changed)

Creates a new action for automation autofill.

Parameters
region_before The region before the change.
region_after The region after the change.
already_changed Whether the change was already made.

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* channel_send_action_new(ChannelSend* send, ChannelSendActionType type, Port* midi, StereoPorts* stereo, float amount)

Creates a new action.

Parameters
send
type
midi MIDI port, if connecting MIDI.
stereo Stereo ports, if connecting audio.
amount

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 track_pos, Position* pos, int num_tracks)

Creates a new CreateTracksAction.

Parameters
type
pl_descr Plugin descriptor, if any.
file_descr
track_pos
pos Position to make the tracks at.
num_tracks

UndoableAction* edit_tracks_action_new(EditTracksActionType type, TracklistSelections* tls, Track* direct_out, float vol_delta, float pan_delta, bool solo_new, bool mute_new)

All-in-one constructor.

Only the necessary params should be passed, others will get ignored.

UndoableAction* edit_tracks_action_new_generic(EditTracksActionType type, TracklistSelections* tls_before, TracklistSelections* tls_after, bool already_edited)

Generic edit action.

UndoableAction* edit_tracks_action_new_track_float(EditTracksActionType type, Track* track, float val_before, float val_after, bool already_edited)

Generic edit action.

UndoableAction* range_action_new(RangeActionType type, Position* start_pos, Position* end_pos)

Creates a new action.

Parameters
type
start_pos Range start.
end_pos Range end.

void undo_manager_init_loaded(UndoManager* self)

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

UndoManager* undo_manager_new(void)

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

void undo_manager_undo(UndoManager* self)

Undo last action.

void undo_manager_redo(UndoManager* self)

Redo last undone action.

int undo_manager_perform(UndoManager* self, UndoableAction* action)

Performs the action and pushes it to the undo stack.

Returns Non-zero if error.

void undo_manager_clear_stacks(UndoManager* self, bool free)

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.

void undo_stack_clear(UndoStack* self, bool free)

Clears the stack, optionally freeing all the elements.

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().