mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'capucho/stop-ambient' into 'master'
Stop ambient sounds on logout See merge request veloren/veloren!2151
This commit is contained in:
commit
12cc4cb29f
@ -193,6 +193,8 @@ impl AmbientChannel {
|
|||||||
self.sink.append(source);
|
self.sink.append(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn stop(&mut self) { self.sink.stop(); }
|
||||||
|
|
||||||
pub fn set_volume(&mut self, volume: f32) { self.sink.set_volume(volume); }
|
pub fn set_volume(&mut self, volume: f32) { self.sink.set_volume(volume); }
|
||||||
|
|
||||||
pub fn get_volume(&mut self) -> f32 { self.sink.volume() }
|
pub fn get_volume(&mut self) -> f32 { self.sink.volume() }
|
||||||
|
@ -422,6 +422,12 @@ impl AudioFrontend {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn stop_ambient_sounds(&mut self) {
|
||||||
|
for channel in self.ambient_channels.iter_mut() {
|
||||||
|
channel.stop()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// The following is for the disabled device switcher
|
// The following is for the disabled device switcher
|
||||||
//// TODO: figure out how badly this will break things when it is called
|
//// TODO: figure out how badly this will break things when it is called
|
||||||
//pub fn set_device(&mut self, name: String) {
|
//pub fn set_device(&mut self, name: String) {
|
||||||
|
@ -920,6 +920,7 @@ impl PlayState for SessionState {
|
|||||||
},
|
},
|
||||||
HudEvent::Logout => {
|
HudEvent::Logout => {
|
||||||
self.client.borrow_mut().logout();
|
self.client.borrow_mut().logout();
|
||||||
|
global_state.audio.stop_ambient_sounds();
|
||||||
return PlayStateResult::Pop;
|
return PlayStateResult::Pop;
|
||||||
},
|
},
|
||||||
HudEvent::Quit => {
|
HudEvent::Quit => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user