2.9 KiB
2.9 KiB
Todo / scratch
What works now
- Login → server hits
/Users/AuthenticateByName, token+user_id persisted to~/.config/player/config.json - Subsequent launches skip login, jump straight to library
- Library view: 3 columns (artists / albums / tracks), scrollable, click-to-drill
- All HTTP is async —
http_submitqueues a worker thread;http_pump()runs once per frame and fires callbacks on the main thread. UI no longer freezes during fetches or downloads. - MP3 + FLAC playback via vendored
dr_mp3.h/dr_flac.h(compiled tomodules/audio_decoders/linux/decoders.a—build.jaiauto-rebuilds when the .c source is newer). Decoded to s16 PCM and handed to Sound_Player asSound_Data.LINEAR_SAMPLE_ARRAY. - OGG + WAV continue through
Sound.load_audio_data(Sound_Player's native path). - Click a track → downloads (async) → decodes → plays. Auto-advance via Sound_Player's
release_assetcallback firingtrack_finished. - Pause/resume via
user_volume_scalemute trick (still not a real pause) - Now-playing screen with title/artist/album, transport buttons, scrub bar
- Logout button on library top-right clears
config.json
Known stubs / rough edges
- Memory leak: each played track leaks its decoded PCM buffer (~50 MB for a 5-min FLAC). The
release_assetcallback should calldecoder_freefor MP3/FLAC paths andfreefor OGG/WAV — currently it only flipstrack_finished. Track allocation type per-Sound_Data so the release knows which allocator to use. audio_toggle_pauseis volume-mute, not real pause — cursor keeps advancing- No real seek (scrub bar is read-only)
- Image cache never evicts — hold for thousands of items but unbounded over a long session (low priority)
- Failed image fetches stay marked
failedforever; no retry. Often that's right (item has no art) but transient network errors should retry once gfx/shaders.jaiis stillSimp.immediate_quad(mirrored bars + bass pulse, but no GLSL fragment shader yet)client.jaistill has the old synchttp_get/http_postandHttp_Response/build_auth_header— async.jai usesbuild_auth_headerso the helpers stay, but the sync wrappers are dead code now- Stream URL
/Audio/{id}/streamreturns the original file. If the original is something exotic (Opus, AAC, etc.) it'll fail. Could fall back to/Audio/{id}/universalwithaudioCodec=mp3or similar to force-transcode for unsupported formats.
Next likely tasks (in rough order)
- Free the decoded buffer when the stream ends (fix the leak)
- Fetch primary image per album, decode with stb_image, upload as
Simp.Texture, render in album rows + as backdrop on now-playing - Real FFT (dr_libs author's work? or kissfft) hooked to Sound_Player's mixed output buffer
- Custom GLSL fragment shader for the visualizer (replaces the bar stack)
- Album-level "play all" button in the album column
- Real per-stream pause + seek
- Search bar above artists column