aboutsummaryrefslogtreecommitdiffstats
path: root/mumd/src/audio.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mumd/src/audio.rs')
-rw-r--r--mumd/src/audio.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/mumd/src/audio.rs b/mumd/src/audio.rs
index 53ec2d4..d1ef106 100644
--- a/mumd/src/audio.rs
+++ b/mumd/src/audio.rs
@@ -17,6 +17,10 @@ use crate::audio::output::SaturatingAdd;
pub const EVENT_SOUNDS: &[(&str, NotificationEvents)] = &[
("resources/connect.wav", NotificationEvents::ServerConnect),
("resources/disconnect.wav", NotificationEvents::ServerDisconnect),
+ ("resources/channel_join.wav", NotificationEvents::UserConnected),
+ ("resources/channel_leave.wav", NotificationEvents::UserDisconnected),
+ ("resources/channel_join.wav", NotificationEvents::UserJoinedChannel),
+ ("resources/channel_leave.wav", NotificationEvents::UserLeftChannel),
];
const SAMPLE_RATE: u32 = 48000;
@@ -25,6 +29,10 @@ const SAMPLE_RATE: u32 = 48000;
pub enum NotificationEvents {
ServerConnect,
ServerDisconnect,
+ UserConnected,
+ UserDisconnected,
+ UserJoinedChannel,
+ UserLeftChannel,
}
pub struct Audio {
@@ -296,7 +304,7 @@ impl Audio {
}
}
- pub fn play_effect(&mut self, effect: NotificationEvents) {
+ pub fn play_effect(&self, effect: NotificationEvents) {
let samples = self.sounds.get(&effect).unwrap();
let mut play_sounds = self.play_sounds.lock().unwrap();