mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 17:41:33 +11:00
Add get and set position on sound channels
This commit is contained in:
parent
a5e0e145d2
commit
3de22df7a2
|
@ -375,4 +375,17 @@ impl SoundChannel {
|
||||||
pub fn stop(&mut self) {
|
pub fn stop(&mut self) {
|
||||||
self.is_done = true;
|
self.is_done = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Gets how far along the sound has played.
|
||||||
|
#[inline]
|
||||||
|
pub fn pos(&self) -> Num<usize, 8> {
|
||||||
|
self.pos
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Sets the playback position
|
||||||
|
#[inline]
|
||||||
|
pub fn set_pos(&mut self, pos: impl Into<Num<usize, 8>>) -> &mut Self {
|
||||||
|
self.pos = pos.into();
|
||||||
|
self
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue