add convenience method for playing the system audio queue

This commit is contained in:
Gered 2023-02-27 15:12:07 -05:00
parent 624ca95a97
commit a6f2d43009

View file

@ -522,6 +522,13 @@ impl System {
should_quit
}
/// Convenience method that applies any [`AudioBuffer`]s that may have been queued up on
/// [`System::audio_queue`] to the system audio device so that they will be played. Do not
/// call this when you already have an active lock on an [`AudioDevice`].
pub fn apply_audio_queue(&mut self) -> Result<(), AudioDeviceError> {
self.audio_queue.apply(&mut self.audio)
}
pub fn ticks(&self) -> u64 {
self.sdl_timer_subsystem.performance_counter()
}