rekordbox_set_list_manager.controllers.project_controller#

Project lifecycle controller: load, save, dirty tracking.

Classes#

ProjectController

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.QObject

Manages 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)

project_changed[source]#
save_path_changed[source]#
dirty_changed[source]#
property project: rekordbox_set_list_manager.models.project.Project | None[source]#

Return the currently loaded project, or None if none is open.

Return type:

rekordbox_set_list_manager.models.project.Project | None

property save_path: pathlib.Path | None[source]#

Return the path the project was last saved to, or None.

Return type:

pathlib.Path | None

property dirty: bool[source]#

Return True if the project has unsaved changes.

Return type:

bool

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:

Project

load(path)[source]#

Load project from path. Raises ProjectIOError on failure.

Parameters:

path (Path) – Path to the .setmgr project file.

Returns:

The loaded project.

Return type:

Project

save(path)[source]#

Save current project to path. Raises ProjectIOError on failure.

Normalises the path suffix to PROJECT_FILE_EXTENSION if 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

mark_dirty()[source]#

Mark the project as having unsaved changes.

Return type:

None

restore(project)[source]#

Replace the active project with project (e.g. an undo/redo snapshot).

Sets dirty = True and emits project_changed so the UI refreshes. The save path is not changed.

Parameters:

project (Project) – The project snapshot to restore.

Return type:

None