Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4.8 KiB
4.8 KiB
Vocaluxe (fork at git.disi.dev/Projects/Vocaluxe)
Fork of Vocaluxe/Vocaluxe, a karaoke game (C#, .NET 10). Default branch
develop tracks upstream; the fork's own work happens on feature branches. Keep changes to upstream code small and
hook-based, so upstream can still be merged.
Goal of the fork
- Song server (
VocaluxeSongServer/, in progress): a central song library on the homelab. The game becomes the frontend and downloads song files on demand. SeeVocaluxeSongServer/README.md. - Later: serve the guest WebApp ("browse by phone",
WebApp/+VocaluxeWeb/) directly from the server. - Search and download songs that aren't in the library (started: server web UI with the sources
freeandusdb; next: more sources, UltraSinger to create songs from audio).
Layout
| Folder | What |
|---|---|
Vocaluxe/ |
The game. Song server client: Base/SongServer/ (CSongServer sync, CRemoteSongFileProvider downloads) |
VocaluxeLib/ |
Shared library. Songs/CSongFiles.cs is the hook every song file access goes through |
VocaluxeSongServer/ |
ASP.NET Core server, Docker image git.disi.dev/projects/vocaluxe-song-server. Sources/: song search and downloads (free CC songs from GitHub, USDB + yt-dlp). wwwroot/: mobile web UI (plain JS, no build) |
VocaluxeWeb/, WebApp/ |
Built-in webserver of the game and the guest WebApp (Vue), upstream |
Tests/ |
NUnit; song server tests in Tests/SongServer |
How the song server integration works
CSongs.LoadSongscallsCSongServer.Sync(): fetches/api/v1/library(ETag), mirrors the song.txtfiles into<DataFolder>/SongServer/<host>_<port>(zip bundles), deletes files no longer on the server, and installsCRemoteSongFileProviderasCSongFiles.Provider. The cache folder is then loaded like a normal song folder.CSongFiles.Exists(loader header checks) is true for files that only exist on the server.IsLocalmeans the file is downloaded and current (size and mtime match the server).- Downloads on demand: covers (
CSong.LoadSmallCover, background threads, blocking), preview audio (CBackgroundMusic.LoadPreview+Update), everything before singing (CScreenSing._LoadAndStartCurrentSong, progress viaTR_SCREENSING_DOWNLOADING). Downloads resume from.partfiles with Range requests. - Config:
config.xmlsectionSongServer(Url,ApiKey). The contracts (VocaluxeSongServer/Contracts) are linked intoVocaluxe.csproj; the test project references the server withextern alias songserver.
Song server web UI and sources
- The web UI is plain HTML/CSS/JS in
VocaluxeSongServer/wwwroot(no build step, no external requests except cover images). Check it at phone width: headless Edge has a ~500px minimum window, so render the page in a 390px iframe. - USDB can't be tested without an account (search and text download need a login). Its HTML parsing is covered by
Tests/SongServer/CSongSourcesTest.cs; if USDB changes its HTML, fixCUsdbSongSource.ParseListthere.
Build and test (Windows)
dotnet build Vocaluxe/Vocaluxe.csproj -c DebugWin -p:Platform=x64(the whole solution also builds the nativePitchTracker, which needs Visual Studio's C++ tools).dotnet test Tests/Tests.csproj -c DebugWin -p:Platform=x64- Running the game (
Output\Vocaluxe.exe) without the C++ tools: takelibs/unmanaged/x64/PitchTracker.dll(and theThemes/Vocaluxe 2024/*.mp4videos) from the upstream Nightly zip (github.com/Vocaluxe/Vocaluxe/releases/tag/Nightly,Vocaluxe_Nightly_Windows_x64.zip); the PitchTracker source is unchanged in this fork. Both are gitignored. Data andConfig.xmlare inOutput(non-installer builds). - First start is slow on Windows with Smart App Control: GStreamer (default
PlayBackLib) scans its 216 plugins once and each unsigned DLL is checked (~19 min on DisiFramework, window "not responding" in "Init Playback"). Later starts are fast.<Sound><PlayBackLib>PortAudio</PlayBackLib></Sound>inConfig.xmlavoids GStreamer. - Building rewrites the copyright year in
Vocaluxe/Properties/AssemblyInfo.cs; don't commit that. - Don't use
dotnet sln add: it rewrites the configuration table ofVocaluxe.sln. Copy the lines ofVocaluxeWeb. - New
config.xmlfields must also go intoTests/VocaluxeLib/XML/TestFiles/SConfig.xml(round-trip test; CRLF).
Known gaps (song server)
- Cover/background auto-detection (
[CO]/[BG]files without a tag,CSong._CheckFiles) only sees local files. - Media in subfolders of a song folder are not served (only the song folder itself).
- On Linux clients, media whose name differs in case from the
.txtreference won't be found after download. - No cache size limit yet. The WebApp's cover images for server songs depend on the cover loader having fetched them.
- No in-game UI for the server address yet (only
config.xml).