pub struct SoundDriver<T: Send + 'static> { /* private fields */ }Expand description
This is the sound API that allows you to send events to your generator.
Implementations§
Source§impl<T: Send + 'static> SoundDriver<T>
impl<T: Send + 'static> SoundDriver<T>
Sourcepub fn get_error(&self) -> SoundError
pub fn get_error(&self) -> SoundError
After calling SoundDriver::new, you can call this function to see if the audio initialization was a success.
Sourcepub fn new(generator: Box<dyn SoundGenerator<T>>) -> Self
pub fn new(generator: Box<dyn SoundGenerator<T>>) -> Self
Initialize the sound device and provide the generator to the driver.
Sourcepub fn send_event(&mut self, event: T)
pub fn send_event(&mut self, event: T)
Send an event to the generator
Auto Trait Implementations§
impl<T> !Freeze for SoundDriver<T>
impl<T> !RefUnwindSafe for SoundDriver<T>
impl<T> !Send for SoundDriver<T>
impl<T> !Sync for SoundDriver<T>
impl<T> Unpin for SoundDriver<T>where
T: Unpin,
impl<T> !UnwindSafe for SoundDriver<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more