mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-10 00:07:52 -06:00
test: allow mute state updates while audio subsystem is disabled
This commit is contained in:
13
src/audio.rs
13
src/audio.rs
@@ -140,15 +140,14 @@ impl Audio {
|
|||||||
///
|
///
|
||||||
/// If audio is disabled, this function does nothing.
|
/// If audio is disabled, this function does nothing.
|
||||||
pub fn set_mute(&mut self, mute: bool) {
|
pub fn set_mute(&mut self, mute: bool) {
|
||||||
if self.disabled {
|
if !self.disabled {
|
||||||
return;
|
let channels = 4;
|
||||||
|
let volume = if mute { 0 } else { 32 };
|
||||||
|
for i in 0..channels {
|
||||||
|
mixer::Channel(i).set_volume(volume);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let channels = 4;
|
|
||||||
let volume = if mute { 0 } else { 32 };
|
|
||||||
for i in 0..channels {
|
|
||||||
mixer::Channel(i).set_volume(volume);
|
|
||||||
}
|
|
||||||
self.muted = mute;
|
self.muted = mute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user