pub enum UndoAction {
DeleteNotes {
track_idx: usize,
clip_idx: usize,
notes: Vec<NoteSnapshot>,
},
PasteNotes {
track_idx: usize,
clip_idx: usize,
notes: Vec<NoteSnapshot>,
},
DrawNote {
track_idx: usize,
clip_idx: usize,
note: NoteSnapshot,
},
RemoveNote {
track_idx: usize,
clip_idx: usize,
note: NoteSnapshot,
},
DeleteClip {
track_idx: usize,
clip_idx: usize,
clip: Clip,
},
MoveNotes {
track_idx: usize,
clip_idx: usize,
before: Vec<(usize, NoteSnapshot)>,
},
ModifyClip {
track_idx: usize,
clip_idx: usize,
prev_start: i64,
prev_length: i64,
prev_notes: Vec<NoteSnapshot>,
prev_hidden: Vec<(i64, i64, u8, u8)>,
},
AddClip {
track_idx: usize,
clip_idx: usize,
},
DeleteTrack {
track_idx: usize,
track: TrackState,
mixer_id: usize,
},
}Expand description
A single undoable action.
Variants§
DeleteNotes
Notes were deleted from a clip (undo = add them back).
PasteNotes
Notes were added to a clip via paste (undo = remove them).
DrawNote
A note was drawn (added).
RemoveNote
A note was toggled off (removed by pressing n on it).
DeleteClip
A clip was deleted.
MoveNotes
Notes were moved in the piano roll. Stores snapshots of the notes BEFORE the move so undo can restore their original positions.
Fields
§
before: Vec<(usize, NoteSnapshot)>(note_index, original_snapshot) for each moved note.
ModifyClip
A clip’s position or size was changed (move/stretch/trim). Stores the clip’s previous start_tick, length_ticks, notes, and hidden_notes.
AddClip
A clip was added (paste/duplicate). Undo = remove it.
DeleteTrack
A track was deleted. Stores full track state for restoration.
Trait Implementations§
Source§impl Clone for UndoAction
impl Clone for UndoAction
Source§fn clone(&self) -> UndoAction
fn clone(&self) -> UndoAction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for UndoAction
impl RefUnwindSafe for UndoAction
impl Send for UndoAction
impl Sync for UndoAction
impl Unpin for UndoAction
impl UnsafeUnpin for UndoAction
impl UnwindSafe for UndoAction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more