rekordbox_set_list_manager.controllers.project_controller#
Project lifecycle controller: load, save, dirty tracking.
Classes#
Manages the active project, save path, and dirty state. |
Module Contents#
- class rekordbox_set_list_manager.controllers.project_controller.ProjectController(parent=None)[source]#
Bases:
PySide6.QtCore.QObjectManages the active project, save path, and dirty state.
Signals:
project_changed(Project | None)— Fired after a new project is loaded, created, or restored from a snapshot.save_path_changed(Path | None)— Fired when the save path changes.dirty_changed(bool)— Fired when dirty state transitions.
- Parameters:
parent (PySide6.QtCore.QObject | None)
- property project: rekordbox_set_list_manager.models.project.Project | None[source]#
Return the currently loaded project, or None if none is open.
- Return type:
- property save_path: pathlib.Path | None[source]#
Return the path the project was last saved to, or None.
- Return type:
pathlib.Path | None
- new(name=_DEFAULT_PROJECT_NAME)[source]#
Create a fresh project and emit signals.
- Parameters:
name (str) – Display name for the new project. Defaults to
"Untitled".- Returns:
The newly created project.
- Return type:
- load(path)[source]#
Load project from path. Raises
ProjectIOErroron failure.- Parameters:
path (Path) – Path to the
.setmgrproject file.- Returns:
The loaded project.
- Return type:
- save(path)[source]#
Save current project to path. Raises
ProjectIOErroron failure.Normalises the path suffix to
PROJECT_FILE_EXTENSIONif needed, then writes the file, updates the save path, clears dirty, and records the file in the recent-files list.- Parameters:
path (Path) – Destination path for the saved project file.
- Return type:
None
- restore(project)[source]#
Replace the active project with project (e.g. an undo/redo snapshot).
Sets dirty = True and emits
project_changedso the UI refreshes. The save path is not changed.- Parameters:
project (Project) – The project snapshot to restore.
- Return type:
None