generated from GarandPLG/rust-flake-template
Add selectable soundtracks via CLI
Introduce a `Soundtrack` enum with Clap `ValueEnum` support and expose it in the CLI as a `--sound-track` option. Extend `AudioCmd` with a `ChangeSoundtrack` variant and refactor audio handling to load and cache soundtracks per‑track using a thread‑safe `RwLock`. Update the `handle_audio` function signature to accept the selected soundtrack, adjust re‑exports, and modify `main` to pass the chosen soundtrack to the audio thread. Also reposition the logging flag in the CLI definition.
This commit is contained in:
1 parent
7ec3eec6e3
commit
633494ed46
4 files changed
+127
-34
No files matched your search
@@ -2,6 +2,6 @@ pub mod audio;
|
||||
pub mod events;
|
||||
pub mod handle_events;
|
||||
|
||||
pub use audio::{AudioCmd, SoundrackParts, handle_audio};
|
||||
pub use audio::{AudioCmd, SoundrackParts, Soundtrack, handle_audio};
|
||||
pub use events::AppEvent;
|
||||
pub use handle_events::handle_events;
|
||||
Reference in new issue
Block a user