10#ifndef __UNDO_ARRANGER_SELECTIONS_ACTION_H__
11#define __UNDO_ARRANGER_SELECTIONS_ACTION_H__
39enum class ArrangerSelectionsActionType
41 AS_ACTION_AUTOMATION_FILL,
60 ARRANGER_SELECTIONS_ACTION_RESIZE_L,
61 ARRANGER_SELECTIONS_ACTION_RESIZE_R,
62 ARRANGER_SELECTIONS_ACTION_RESIZE_L_LOOP,
63 ARRANGER_SELECTIONS_ACTION_RESIZE_R_LOOP,
64 ARRANGER_SELECTIONS_ACTION_RESIZE_L_FADE,
65 ARRANGER_SELECTIONS_ACTION_RESIZE_R_FADE,
66 ARRANGER_SELECTIONS_ACTION_STRETCH_L,
67 ARRANGER_SELECTIONS_ACTION_STRETCH_R,
124 ArrangerSelectionsActionType
type;
227#define arranger_selections_action_new_create(sel, error) \
228 arranger_selections_action_new_create_or_delete ( \
229 (ArrangerSelections *) sel, true, error)
231#define arranger_selections_action_new_delete(sel, error) \
232 arranger_selections_action_new_create_or_delete ( \
233 (ArrangerSelections *) sel, false, error)
236arranger_selections_action_new_record (
239 const bool already_recorded,
258 const int delta_chords,
259 const int delta_pitch,
260 const int delta_tracks,
261 const int delta_lanes,
262 const double delta_normalized_amount,
264 const bool already_moved,
267#define arranger_selections_action_new_move( \
268 sel, ticks, chords, pitch, tracks, lanes, norm_amt, port_id, already_moved, \
270 arranger_selections_action_new_move_or_duplicate ( \
271 (ArrangerSelections *) sel, 1, ticks, chords, pitch, tracks, lanes, \
272 norm_amt, port_id, already_moved, error)
273#define arranger_selections_action_new_duplicate( \
274 sel, ticks, chords, pitch, tracks, lanes, norm_amt, port_id, already_moved, \
276 arranger_selections_action_new_move_or_duplicate ( \
277 (ArrangerSelections *) sel, 0, ticks, chords, pitch, tracks, lanes, \
278 norm_amt, port_id, already_moved, error)
280#define arranger_selections_action_new_move_timeline( \
281 sel, ticks, delta_tracks, delta_lanes, port_id, already_moved, error) \
282 arranger_selections_action_new_move ( \
283 sel, ticks, 0, 0, delta_tracks, delta_lanes, 0, port_id, already_moved, \
285#define arranger_selections_action_new_duplicate_timeline( \
286 sel, ticks, delta_tracks, delta_lanes, port_id, already_moved, error) \
287 arranger_selections_action_new_duplicate ( \
288 sel, ticks, 0, 0, delta_tracks, delta_lanes, 0, port_id, already_moved, \
291#define arranger_selections_action_new_move_midi( \
292 sel, ticks, delta_pitch, already_moved, error) \
293 arranger_selections_action_new_move ( \
294 sel, ticks, 0, delta_pitch, 0, 0, 0, NULL, already_moved, error)
295#define arranger_selections_action_new_duplicate_midi( \
296 sel, ticks, delta_pitch, already_moved, error) \
297 arranger_selections_action_new_duplicate ( \
298 sel, ticks, 0, delta_pitch, 0, 0, 0, NULL, already_moved, error)
299#define arranger_selections_action_new_move_chord( \
300 sel, ticks, delta_chords, already_moved, error) \
301 arranger_selections_action_new_move ( \
302 sel, ticks, delta_chords, 0, 0, 0, 0, NULL, already_moved, error)
303#define arranger_selections_action_new_duplicate_chord( \
304 sel, ticks, delta_chords, already_moved, error) \
305 arranger_selections_action_new_duplicate ( \
306 sel, ticks, delta_chords, 0, 0, 0, 0, NULL, already_moved, error)
308#define arranger_selections_action_new_move_automation( \
309 sel, ticks, norm_amt, already_moved, error) \
310 arranger_selections_action_new_move ( \
311 sel, ticks, 0, 0, 0, 0, norm_amt, NULL, already_moved, error)
312#define arranger_selections_action_new_duplicate_automation( \
313 sel, ticks, norm_amt, already_moved, error) \
314 arranger_selections_action_new_duplicate ( \
315 sel, ticks, 0, 0, 0, 0, norm_amt, NULL, already_moved, error)
330 const int delta_tracks,
331 const int delta_lanes,
332 const bool already_moved,
354arranger_selections_action_new_edit_single_obj (
369 MidiFunctionType midi_func_type,
381 AutomationFunctionType automation_func_type,
411 bool already_changed,
463arranger_selections_action_perform_create_or_delete (
468#define arranger_selections_action_perform_create(sel, error) \
469 arranger_selections_action_perform_create_or_delete ( \
470 (ArrangerSelections *) sel, true, error)
472#define arranger_selections_action_perform_delete(sel, error) \
473 arranger_selections_action_perform_create_or_delete ( \
474 (ArrangerSelections *) sel, false, error)
477arranger_selections_action_perform_record (
480 const bool already_recorded,
484arranger_selections_action_perform_move_or_duplicate (
488 const int delta_chords,
489 const int delta_pitch,
490 const int delta_tracks,
491 const int delta_lanes,
492 const double delta_normalized_amount,
494 const bool already_moved,
497#define arranger_selections_action_perform_move( \
498 sel, ticks, chords, pitch, tracks, lanes, norm_amt, port_id, already_moved, \
500 arranger_selections_action_perform_move_or_duplicate ( \
501 (ArrangerSelections *) sel, 1, ticks, chords, pitch, tracks, lanes, \
502 norm_amt, port_id, already_moved, error)
503#define arranger_selections_action_perform_duplicate( \
504 sel, ticks, chords, pitch, tracks, lanes, norm_amt, port_id, already_moved, \
506 arranger_selections_action_perform_move_or_duplicate ( \
507 (ArrangerSelections *) sel, 0, ticks, chords, pitch, tracks, lanes, \
508 norm_amt, port_id, already_moved, error)
510#define arranger_selections_action_perform_move_timeline( \
511 sel, ticks, delta_tracks, delta_lanes, port_id, already_moved, error) \
512 arranger_selections_action_perform_move ( \
513 sel, ticks, 0, 0, delta_tracks, delta_lanes, 0, port_id, already_moved, \
515#define arranger_selections_action_perform_duplicate_timeline( \
516 sel, ticks, delta_tracks, delta_lanes, port_id, already_moved, error) \
517 arranger_selections_action_perform_duplicate ( \
518 sel, ticks, 0, 0, delta_tracks, delta_lanes, 0, port_id, already_moved, \
521#define arranger_selections_action_perform_move_midi( \
522 sel, ticks, delta_pitch, already_moved, error) \
523 arranger_selections_action_perform_move ( \
524 sel, ticks, 0, delta_pitch, 0, 0, 0, NULL, already_moved, error)
525#define arranger_selections_action_perform_duplicate_midi( \
526 sel, ticks, delta_pitch, already_moved, error) \
527 arranger_selections_action_perform_duplicate ( \
528 sel, ticks, 0, delta_pitch, 0, 0, 0, NULL, already_moved, error)
529#define arranger_selections_action_perform_move_chord( \
530 sel, ticks, delta_chords, already_moved, error) \
531 arranger_selections_action_perform_move ( \
532 sel, ticks, delta_chords, 0, 0, 0, 0, NULL, already_moved, error)
533#define arranger_selections_action_perform_duplicate_chord( \
534 sel, ticks, delta_chords, already_moved, error) \
535 arranger_selections_action_perform_duplicate ( \
536 sel, ticks, delta_chords, 0, 0, 0, 0, NULL, already_moved, error)
538#define arranger_selections_action_perform_move_automation( \
539 sel, ticks, norm_amt, already_moved, error) \
540 arranger_selections_action_perform_move ( \
541 sel, ticks, 0, 0, 0, 0, norm_amt, NULL, already_moved, error)
542#define arranger_selections_action_perform_duplicate_automation( \
543 sel, ticks, norm_amt, already_moved, error) \
544 arranger_selections_action_perform_duplicate ( \
545 sel, ticks, 0, 0, 0, 0, norm_amt, NULL, already_moved, error)
548arranger_selections_action_perform_link (
552 const int delta_tracks,
553 const int delta_lanes,
554 const bool already_moved,
558arranger_selections_action_perform_edit (
566arranger_selections_action_perform_edit_single_obj (
574arranger_selections_action_perform_edit_midi_function (
576 MidiFunctionType midi_func_type,
581arranger_selections_action_perform_edit_automation_function (
583 AutomationFunctionType automation_func_type,
587arranger_selections_action_perform_edit_audio_function (
595arranger_selections_action_perform_automation_fill (
598 bool already_changed,
602arranger_selections_action_perform_split (
608arranger_selections_action_perform_merge (
613arranger_selections_action_perform_resize (
621arranger_selections_action_perform_quantize (
630arranger_selections_action_undo (
638arranger_selections_action_contains_clip (
API for selections in the AudioArrangerWidget.
API for selections in the AutomationArrangerWidget.
API for selections in the piano roll.
WARN_UNUSED_RESULT UndoableAction * arranger_selections_action_new_edit(ArrangerSelections *sel_before, ArrangerSelections *sel_after, ArrangerSelectionsActionEditType type, bool already_edited, GError **error)
Creates a new action for editing properties of an object.
WARN_UNUSED_RESULT UndoableAction * arranger_selections_action_new_create_or_delete(ArrangerSelections *sel, const bool create, GError **error)
Creates a new action for creating/deleting objects.
ArrangerSelectionsActionResizeType
Type used when the action is a RESIZE action.
WARN_UNUSED_RESULT UndoableAction * arranger_selections_action_new_resize(ArrangerSelections *sel_before, ArrangerSelections *sel_after, ArrangerSelectionsActionResizeType type, const double ticks, GError **error)
Creates a new action for resizing ArrangerObject's.
WARN_UNUSED_RESULT UndoableAction * arranger_selections_action_new_split(ArrangerSelections *sel, const Position *pos, GError **error)
Creates a new action for splitting ArrangerObject's.
WARN_UNUSED_RESULT UndoableAction * arranger_selections_action_new_automation_fill(Region *region_before, Region *region_after, bool already_changed, GError **error)
Creates a new action for automation autofill.
WARN_UNUSED_RESULT UndoableAction * arranger_selections_action_new_quantize(ArrangerSelections *sel, QuantizeOptions *opts, GError **error)
Creates a new action for quantizing ArrangerObject's.
WARN_UNUSED_RESULT UndoableAction * arranger_selections_action_new_edit_midi_function(ArrangerSelections *sel_before, MidiFunctionType midi_func_type, MidiFunctionOpts opts, GError **error)
Wrapper over arranger_selections_action_new_edit() for MIDI functions.
WARN_UNUSED_RESULT UndoableAction * arranger_selections_action_new_edit_automation_function(ArrangerSelections *sel_before, AutomationFunctionType automation_func_type, GError **error)
Wrapper over arranger_selections_action_new_edit() for automation functions.
ArrangerSelectionsActionEditType
Type used when the action is an EDIT action.
WARN_UNUSED_RESULT 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, GError **error)
Creates a new action for linking regions.
WARN_UNUSED_RESULT UndoableAction * arranger_selections_action_new_merge(ArrangerSelections *sel, GError **error)
Creates a new action for merging ArrangerObject's.
WARN_UNUSED_RESULT UndoableAction * arranger_selections_action_new_edit_audio_function(ArrangerSelections *sel_before, AudioFunctionType audio_func_type, AudioFunctionOpts opts, const char *uri, GError **error)
Wrapper over arranger_selections_action_new_edit() for automation functions.
WARN_UNUSED_RESULT 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 PortIdentifier *tgt_port_id, const bool already_moved, GError **error)
Creates a new action for moving or duplicating objects.
@ ARRANGER_SELECTIONS_ACTION_EDIT_SCALE
For editing the MusicalScale inside ScaleObject's.
@ ARRANGER_SELECTIONS_ACTION_EDIT_EDITOR_FUNCTION
For ramping MidiNote velocities or AutomationPoint values.
@ ARRANGER_SELECTIONS_ACTION_EDIT_POS
Edit a Position of the ArrangerObject's in the selection.
@ ARRANGER_SELECTIONS_ACTION_EDIT_FADES
Editing fade positions or curve options.
@ ARRANGER_SELECTIONS_ACTION_EDIT_MUTE
Change mute status.
@ ARRANGER_SELECTIONS_ACTION_EDIT_NAME
Edit the name of the ArrangerObject's in the selection.
@ ARRANGER_SELECTIONS_ACTION_EDIT_PRIMITIVE
Edit a primitive (int, etc) member of ArrangerObject's in the selection.
API for selections in the piano roll.
Base struct for arranger objects.
int delta_tracks
Tracks moved.
double delta_normalized_amount
Difference in a normalized amount, such as automation point normalized value.
int delta_lanes
Lanes moved.
char * str
String, when changing a string.
ArrangerSelectionsActionType type
Action type.
PortIdentifier * target_port
Target port (used to find corresponding automation track when moving/copying automation regions to an...
ArrangerSelections * sel
A clone of the ArrangerSelections before the change.
int delta_chords
Chords moved (up/down in the Chord editor).
ArrangerObject * r1[800]
Used when splitting - these are the split ArrangerObject's.
ArrangerSelectionsActionEditType edit_type
Type of edit action, if an Edit action.
QuantizeOptions * opts
QuantizeOptions clone, if quantizing.
int num_split_objs
Number of split objects inside r1 and r2 each.
int delta_vel
Delta of MidiNote velocity.
Region * region_before
Used for automation autofill action.
Position pos
Position, when changing a Position.
bool first_run
If this is true, the first "do" call does nothing in some cases.
int delta_pitch
Delta of MidiNote pitch.
ArrangerSelections * sel_after
A clone of the ArrangerSelections after the change (used in the EDIT action and quantize).
Audio clips for the pool.
Selections to be used for the AudioArrangerWidget's current selections, copying, undoing,...
Selections to be used for the AutomationArrangerWidget's current selections, copying,...
Selections to be used for the ChordArrangerWidget's current selections, copying, undoing,...
A collection of selected MidiNote's.
A MIDI note inside a Region shown in the piano roll.
Struct used to identify Ports in the project.
A Position is made up of bars.beats.sixteenths.ticks.
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
Selections to be used for the timeline's current selections, copying, undoing, etc.
Base struct to be inherited by implementing undoable actions.
Current TimelineArranger selections.