feat: sound notification chimes for connection lifecycle events

Audible chimes for reconnect/reconnected/reconnect-failed, self-leave,
peer join/leave, and mic/deafen toggle, completing the 4-phase
notification plan (phase 1 room/peer join+leave shipped in 673b72d).

- Per-event custom WAV overrides in Settings, with ~ expansion and live
  file-found/not-found validation; persisted on settings exit. Each event
  falls back to its embedded default chime when no custom path is set.
- Reconnect-attempt chime is edge-triggered: fires once per disconnect,
  not once per redial attempt.
- Global "enable sound notifications" toggle.
This commit is contained in:
2026-06-01 03:31:12 -04:00
parent bddd1a0e6e
commit 2aec154f07
11 changed files with 270 additions and 33 deletions
+31
View File
@@ -36,6 +36,10 @@ impl std::fmt::Display for NetworkMode {
}
}
fn default_true() -> bool {
true
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AppConfig {
pub input_device: String,
@@ -43,6 +47,24 @@ pub struct AppConfig {
pub noise_gate_threshold: f32,
#[serde(default)]
pub network_mode: NetworkMode,
#[serde(default = "default_true")]
pub notifications_enabled: bool,
#[serde(default)]
pub custom_sound_self_join: Option<String>,
#[serde(default)]
pub custom_sound_peer_join: Option<String>,
#[serde(default)]
pub custom_sound_peer_leave: Option<String>,
#[serde(default)]
pub custom_sound_reconnect_attempt: Option<String>,
#[serde(default)]
pub custom_sound_reconnected: Option<String>,
#[serde(default)]
pub custom_sound_self_leave: Option<String>,
#[serde(default)]
pub custom_sound_mic_toggle: Option<String>,
#[serde(default)]
pub custom_sound_reconnect_failed: Option<String>,
}
impl Default for AppConfig {
@@ -52,6 +74,15 @@ impl Default for AppConfig {
output_device: "".to_string(),
noise_gate_threshold: 0.01,
network_mode: NetworkMode::default(),
notifications_enabled: true,
custom_sound_self_join: None,
custom_sound_peer_join: None,
custom_sound_peer_leave: None,
custom_sound_reconnect_attempt: None,
custom_sound_reconnected: None,
custom_sound_self_leave: None,
custom_sound_mic_toggle: None,
custom_sound_reconnect_failed: None,
}
}
}