feat: make everything threads-safe.

feat: complete `uninstall.sh` logic to make everything synced.
	feat: complete basic play logic to handle background, music,
	lyric play.
This commit is contained in:
2026-08-30 15:13:28 +08:00
parent 00b7c0b324
commit 7edba3fbc0
10 changed files with 355 additions and 65 deletions
+5 -1
View File
@@ -73,9 +73,13 @@ void dataCallback(ma_device* device, void* out, const void* /*in*/,
} // namespace
int play(const std::string& path, std::atomic<bool>* stop) {
int play(const std::string& path, Timeline* timeline, std::atomic<bool>* stop) {
if (path.empty()) return 1;
// Audio is the show's clock: anchor the timeline the moment playback is
// about to begin (a no-op if the caller already anchored it).
if (timeline && !timeline->started()) timeline->start();
ma_decoder_config decoderConfig = ma_decoder_config_init_default();
ma_decoder decoder;
if (ma_decoder_init_file(path.c_str(), &decoderConfig, &decoder) != MA_SUCCESS) {