Config notification/toast sound (#179)

* try adding config to load different sound

looks like include_bytes!() doesn't take a variable parameter, so will need a different solution lol.

* no errors in loading, but toast.rs now has a lifetime issue

* hey, config toast sound works now!

the sound is loaded in AppState now, since Toast are created in several different places at different times, and i don't want to load the sound every time a toast is made.

also put back the original sound since i accidentally commited my custom one.

* clean up

* change custom toast sound leak to happen on load rather than every play

* move toast sound loading into a function

so it can be reused in the future, for example if we want to load arbitrary keypress sounds or other [u8] data.

* remove label from try_load_bytes, return early when failing
This commit is contained in:
Jay
2025-03-24 22:32:29 +11:00
committed by GitHub
parent 659f1492fb
commit 5f93bc9cac
3 changed files with 47 additions and 4 deletions

View File

@@ -207,6 +207,9 @@ pub struct GeneralConfig {
#[serde(default = "def_toast_topics")]
pub notification_topics: IdMap<ToastTopic, DisplayMethod>,
#[serde(default = "def_empty")]
pub notification_sound: Arc<str>,
#[serde(default = "def_true")]
pub keyboard_sound_enabled: bool,