Merge pull request #64 from tomaka/underflowed
Add an underflow() method to Voice
This commit is contained in:
commit
d3e610a614
4 changed files with 24 additions and 0 deletions
|
|
@ -301,6 +301,16 @@ impl Voice {
|
|||
|
||||
self.playing = false;
|
||||
}
|
||||
|
||||
pub fn underflowed(&self) -> bool {
|
||||
unsafe {
|
||||
let mut padding = mem::uninitialized();
|
||||
let hresult = (*self.audio_client).GetCurrentPadding(&mut padding);
|
||||
check_result(hresult).unwrap();
|
||||
|
||||
padding == 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Voice {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue