mirror of
https://github.com/italicsjenga/agb.git
synced 2025-02-23 22:58:18 +11:00
Add ability to set that a channel should loop
This commit is contained in:
parent
773e893421
commit
86ba309377
1 changed files with 11 additions and 1 deletions
|
@ -70,11 +70,21 @@ impl Mixer {
|
||||||
pub struct SoundChannel {
|
pub struct SoundChannel {
|
||||||
data: &'static [u8],
|
data: &'static [u8],
|
||||||
pos: usize,
|
pos: usize,
|
||||||
|
should_loop: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SoundChannel {
|
impl SoundChannel {
|
||||||
pub fn new(data: &'static [u8]) -> Self {
|
pub fn new(data: &'static [u8]) -> Self {
|
||||||
SoundChannel { data, pos: 0 }
|
SoundChannel {
|
||||||
|
data,
|
||||||
|
pos: 0,
|
||||||
|
should_loop: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn should_loop(mut self) -> Self {
|
||||||
|
self.should_loop = true;
|
||||||
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue