Actions module

User action implementations.

Contents

Classes

struct ArrangerSelectionsAction
The action.
struct ChannelSendAction
Action for channel send changes.
struct TracklistSelectionsAction
Tracklist selections (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, ARRANGER_SELECTIONS_ACTION_EDIT_EDITOR_FUNCTION }
Type used when the action is an EDIT action.
enum PortActionType { PORT_ACTION_SET_CONTROL_VAL }
enum EditTracksActionType { EDIT_TRACK_ACTION_TYPE_SOLO, EDIT_TRACK_ACTION_TYPE_MUTE, EDIT_TRACK_ACTION_TYPE_LISTEN, EDIT_TRACK_ACTION_TYPE_VOLUME, EDIT_TRACK_ACTION_TYPE_PAN, EDIT_TRACK_ACTION_TYPE_DIRECT_OUT, EDIT_TRACK_ACTION_TYPE_RENAME, EDIT_TRACK_ACTION_TYPE_COLOR, EDIT_TRACK_ACTION_TYPE_COMMENT, EDIT_TRACK_ACTION_TYPE_ICON, EDIT_TRACK_ACTION_TYPE_MIDI_FADER_MODE }
Action type.
enum UndoableActionType { UA_TRACKLIST_SELECTIONS, UA_CHANNEL_SEND, UA_MIXER_SELECTIONS, UA_ARRANGER_SELECTIONS, 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 ChannelSendAction = struct ChannelSendAction
Action for channel send changes.
using EditTracksActionType = enum EditTracksActionType
Action type.
using TracklistSelectionsAction = struct TracklistSelectionsAction
Tracklist selections (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.
auto arranger_selections_action_new_create_or_delete(ArrangerSelections* sel, const bool 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_edit_midi_function(ArrangerSelections* sel_before, MidiFunctionType midi_func_type) -> UndoableAction*
Wrapper over arranger_selections_action_new_edit() for MIDI functions.
auto arranger_selections_action_new_edit_automation_function(ArrangerSelections* sel_before, AutomationFunctionType automation_func_type) -> UndoableAction*
Wrapper over arranger_selections_action_new_edit() for automation functions.
auto arranger_selections_action_new_edit_audio_function(ArrangerSelections* sel_before, AudioFunctionType audio_func_type) -> UndoableAction*
Wrapper over arranger_selections_action_new_edit() for automation functions.
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* port, StereoPorts* stereo, float amount) -> UndoableAction*
Creates a new action.
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 port_action_new_reset_control(PortIdentifier* port_id) -> UndoableAction*
Create a new action.
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.
auto tracklist_selections_action_new(TracklistSelectionsActionType type, TracklistSelections* tls_before, TracklistSelections* tls_after, Track* track, TrackType track_type, PluginSetting* pl_setting, SupportedFile* file_descr, int track_pos, const Position* pos, int num_tracks, EditTracksActionType edit_type, Track* direct_out, int ival_after, const GdkRGBA* color_new, float val_before, float val_after, const char* new_txt, bool already_edited) -> UndoableAction*
Creates a new TracklistSelectionsAction.
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_get_as_string(UndoStack* self, int limit) -> char*
Gets the list of actions as a string.
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_to_string(UndoableAction* ua) -> char*
Stringizes the action to be used in Undo/Redo buttons.

Defines

#define tracklist_selections_action_new_create_audio_fx(pl_setting, track_pos, num_tracks)
Creates a new TracklistSelectionsAction for an audio FX track.
#define tracklist_selections_action_new_create_instrument(pl_setting, track_pos, num_tracks)
Creates a new TracklistSelectionsAction for an instrument track.
#define tracklist_selections_action_new_create_audio_group(track_pos, num_tracks)
Creates a new TracklistSelectionsAction for an audio group track.
#define tracklist_selections_action_new_create_midi(track_pos, num_tracks)
Creates a new TracklistSelectionsAction for a MIDI track.
#define tracklist_selections_action_new_edit_generic(type, tls_before, tls_after, already_edited)
Generic edit action.
#define tracklist_selections_action_new_edit_single_float(type, track, val_before, val_after, already_edited)
Convenience wrapper over tracklist_selections_action_new() for single-track float edit changes.
#define tracklist_selections_action_new_edit_single_int(type, track, val_after, already_edited)
Convenience wrapper over tracklist_selections_action_new() for single-track int edit changes.
#define tracklist_selections_action_new_pin(tls)
Toggle the current pin status of the track.
#define tracklist_selections_action_new_unpin(tls)
Toggle the current pin status of the 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.

ARRANGER_SELECTIONS_ACTION_EDIT_EDITOR_FUNCTION

For ramping MidiNote velocities or AutomationPoint values.

(this is handled by EDIT_PRIMITIVE) MIDI function.

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

UndoableAction* arranger_selections_action_new_create_or_delete(ArrangerSelections* sel, const bool 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_edit_automation_function(ArrangerSelections* sel_before, AutomationFunctionType automation_func_type)

Wrapper over arranger_selections_action_new_edit() for automation functions.

UndoableAction* arranger_selections_action_new_edit_audio_function(ArrangerSelections* sel_before, AudioFunctionType audio_func_type)

Wrapper over arranger_selections_action_new_edit() for automation functions.

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* port, StereoPorts* stereo, float amount)

Creates a new action.

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

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.

UndoableAction* tracklist_selections_action_new(TracklistSelectionsActionType type, TracklistSelections* tls_before, TracklistSelections* tls_after, Track* track, TrackType track_type, PluginSetting* pl_setting, SupportedFile* file_descr, int track_pos, const Position* pos, int num_tracks, EditTracksActionType edit_type, Track* direct_out, int ival_after, const GdkRGBA* color_new, float val_before, float val_after, const char* new_txt, bool already_edited)

Creates a new TracklistSelectionsAction.

Parameters
type
tls_before Tracklist selections to act upon.
tls_after
track Track, if single-track action. Used if tls_before and tls_after are NULL.
track_type
pl_setting Plugin setting, if any.
file_descr
track_pos
pos Position to make the tracks at.
num_tracks
edit_type
direct_out
ival_after
color_new
val_before
val_after
new_txt
already_edited

int undo_manager_perform(UndoManager* self, UndoableAction* action)

Performs the action and pushes it to the undo stack.

Returns Non-zero if error.

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_to_string(UndoableAction* ua)

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

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