24class TrackCollectionOperator :
public QObject
29 WRITE setCollection NOTIFY collectionChanged)
36 explicit TrackCollectionOperator (QObject * parent =
nullptr)
47 if (collection_ != collection)
49 collection_ = collection;
50 Q_EMIT collectionChanged ();
53 Q_SIGNAL
void collectionChanged ();
58 if (undo_stack_ != undoStack)
60 undo_stack_ = undoStack;
61 Q_EMIT undoStackChanged ();
64 Q_SIGNAL
void undoStackChanged ();
76 const QList<zrythm::structure::tracks::Track *> &tracks,
87 const QList<zrythm::structure::tracks::Track *> &tracks,
100 deleteTracks (
const QList<zrythm::structure::tracks::Track *> &tracks);
109 [[nodiscard]] std::vector<structure::tracks::TrackUuidReference>
110 expand_with_descendants (
113 assert (collection_ !=
nullptr);
115 auto ®istry = collection_->get_track_registry ();
119 | std::views::transform ([] (
const auto &ref) {
return ref.id (); })
120 | std::ranges::to<std::unordered_set> ();
124 | std::ranges::to<std::vector<structure::tracks::TrackUuidReference>> ();
126 for (
const auto &ref : track_refs)
133 if (!seen.contains (desc_id))
135 expanded.emplace_back (desc_id, registry);
136 seen.insert (desc_id);
145 structure::tracks::TrackCollection * collection_{};
146 undo::UndoStack * undo_stack_{};
Q_INVOKABLE void moveTracks(const QList< zrythm::structure::tracks::Track * > &tracks, int targetPosition, zrythm::structure::tracks::Track *targetFolder)
Moves tracks to a new position in the collection.