Add Voice::get_pending_samples

This commit is contained in:
Pierre Krieger 2015-09-22 17:52:35 +02:00
parent a709d91d66
commit 44e9dce43f
5 changed files with 46 additions and 1 deletions

View file

@ -193,6 +193,15 @@ impl Voice {
}
}
pub fn get_pending_samples(&self) -> usize {
unsafe {
let mut padding = mem::uninitialized();
let hresult = (*self.audio_client).GetCurrentPadding(&mut padding);
check_result(hresult).unwrap();
padding as usize
}
}
#[inline]
pub fn play(&mut self) {
if !self.playing {