mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 17:41:33 +11:00
Provide a way to get the channel again
This commit is contained in:
parent
27a470c648
commit
80ce5173e1
|
@ -62,6 +62,16 @@ impl Mixer {
|
|||
|
||||
panic!("Cannot play more than 16 sounds at once");
|
||||
}
|
||||
|
||||
pub fn get_channel(&mut self, id: ChannelId) -> Option<&'_ mut SoundChannel> {
|
||||
if let Some(channel) = &mut self.channels[id.0] {
|
||||
if self.indices[id.0] == id.1 {
|
||||
return Some(channel);
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
// I've picked one frequency that works nicely. But there are others that work nicely
|
||||
|
|
Loading…
Reference in a new issue