// musicPlayer.h // // Play an audio file (MP3 / WAV / FLAC) through the system audio device. // Backed by the vendored miniaudio library (third_party/miniaudio.h), which // decodes and plays these formats natively and works on both Linux and // Windows. The header deliberately does not include miniaudio. #pragma once #include #include #include "timeline.h" namespace mp { // Blocking playback of `path` in real time. `timeline` is optional; if given // and not yet anchored, the music anchors it (audio is the show's clock). // Returns 0 on success (played to the end or stopped early via `stop`). // Non-zero return values: // 1 argument error // 2 could not open/decode the file // 3 no audio device available (caller should degrade gracefully) int play(const std::string& path, Timeline* timeline = nullptr, std::atomic* stop = nullptr); } // namespace mp