|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
Command for moving tracks to a new position in the tracklist. More...
#include <src/commands/move_tracks_command.h>


Public Member Functions | |
| MoveTracksCommand (structure::tracks::TrackCollection &collection, std::vector< structure::tracks::TrackUuidReference > track_refs, int target_position, std::optional< structure::tracks::Track::Uuid > target_folder=std::nullopt) | |
| Constructs a new MoveTracksCommand. | |
| void | undo () override |
| void | redo () override |
| int | id () const override |
Command for moving tracks to a new position in the tracklist.
Supports moving multiple tracks at once while maintaining their relative order. Folder parent relationships that are internal to the moved set (parent is also being moved) are preserved. External relationships are updated: when target_folder is specified, moved tracks become children of that folder; when nullopt, external folder parents are cleared.
Definition at line 25 of file move_tracks_command.h.
| zrythm::commands::MoveTracksCommand::MoveTracksCommand | ( | structure::tracks::TrackCollection & | collection, |
| std::vector< structure::tracks::TrackUuidReference > | track_refs, | ||
| int | target_position, | ||
| std::optional< structure::tracks::Track::Uuid > | target_folder = std::nullopt ) |
Constructs a new MoveTracksCommand.
| collection | Reference to the TrackCollection. |
| track_refs | References to the tracks to move, in their current order. |
| target_position | The index in the current (pre-removal) list where the first moved track should end up. For example, if the collection is [A, B, C, D] and tracks [A, B] are moved to between C and D, pass target_position = 3 (the position of D in the current list). The command adjusts internally for the removal of moved tracks. |
| target_folder | The folder to move tracks into (nullopt = no folder change / clear external folder parents). |