Repository navigation
project preview
Working manual · 0.0.1-alpha · source snapshot 16 November 2026
SdlAudioDevice now provides startProjectPreview, endProjectPreview and projectPreviewActive. These are render/UI-thread control operations on the existing device, not a second output device. The normal project-load browser now connects START through ProjectPreviewManager.
The working session owns its AudioEngine, prepared document/PCM, instrument audition bank and retired live-update banks. Starting project preview retains that complete session and installs a separately prepared, owning session. The working engine is not rebound, copied or advanced while preview runs, preserving voice, effect, lane and fractional transport state. Switching preview selections replaces only the temporary session. Ending preview restores the original ownership and device pause state, clears queued preview audio, and republishes its transport/telemetry snapshot. Ending an already ended preview is harmless.
Prepared previews must own their sample bank; score-only snapshots borrowing sampleSource are rejected. Construction and allocation happen before the SDL stream lock. The lock protects only session ownership changes and publication; old previews are destroyed on the controlling thread after unlocking. The callback continues using the same engine interface, with no new allocation, filesystem work or synchronization. Working plus preview engines/banks coexist temporarily; this increases peak memory and still needs handheld profiling and application budgeting.
While preview is active, ordinary start, live score/sample replacement, note audition, cue, track-mix and looper commands are rejected so working-document commands cannot accidentally alter the temporary score. Pause/resume affect the current preview. Explicit stop first restores the working session, then stops it. Device destruction closes the callback before either session is destroyed. A device resume failure attempts restoration; callers must inspect the returned status and projectPreviewActive rather than assume a failed operation completed.
Open Project > PROJECT > LOAD and highlight a CTP. START prepares and auditions that saved file; START again stops or cancels preparation. Moving selection, entering/leaving a folder, B-back, focus loss, controller removal and A-load end preview and restore the working session. A retains the existing unsaved-project confirmation. Save-browser START continues to submit filenames as before.
The browser displays PREPARING PREVIEW or PREVIEW / START STOP / A LOAD. The main loop suppresses working-project live score/oscillator updates while temporary playback owns the device, refreshes display pointers after ownership changes, and cancels preparation when the load browser closes or the project generation changes. The active ProjectManager document, dirty state, path and save binding are untouched by preview. No publication or listening event is created.
ProjectPreviewManager runs one std::async preparation at a time, loading a detached CTP with the existing serializer and preparation services. It begins at the first Song position containing a playable Chain, or 00 for an empty project. Cancelling invalidates the request generation; old results cannot start playback, including when the same path is selected again. A replacement waits for the outstanding job rather than creating unbounded workers. Worker decode cannot be interrupted midway; shutdown joins it outside audio. Prepared PCM/oscillator banks remain owned by the preview. File errors or any preparation warning reject the preview and leave the working session available, with the error shown in the browser.
This normal file-browser preview reads the saved CTP, not its CTL recovery sidecar or unsaved edits. It supports private and unsigned files and makes no claim that the selected bytes match a historical publication. History-specific audition still needs FileAvailabilityResolver revalidation tied to immutable prepared samples. The history screen and its preview/load integration remain unfinished. Physical handheld latency, audio quality and peak memory still require hardware checks.
Project LOAD now offers PROJECTS (L1) and RECEIVED (R1). Paths resolve against the selected StoragePaths root, including received subfolders. Tab changes stop preview before changing roots; a stop failure leaves the current tab active. A-load retains unsaved-edit confirmation. Both folder and highlighted file are remembered independently per source for the current app session; first use starts at Projects. This is UI state, not CTP or persisted device data. Save remains rooted in Projects. Snapshot flags --project-load and --project-received exercise the real controller workflow when used with --snapshot.
| Documentation still to add |
|---|
| Annotated current-build screenshots and a recorded controller walkthrough for this topic. |
Repository sources used for this page:
docs/project-preview.md
This is a documentation/source review, not a new runtime or hardware test. Physical response, screenshots and listening examples still need verification on a recorded build.