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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user