|
|
@ -17,10 +17,10 @@ pub struct SoundIo { |
|
|
|
name: CString,
|
|
|
|
}
|
|
|
|
impl SoundIo {
|
|
|
|
pub fn new() -> Self {
|
|
|
|
pub fn new<S: Into<String>>(name: S) -> Self {
|
|
|
|
SoundIo {
|
|
|
|
context: unsafe { ffi::soundio_create() },
|
|
|
|
name: CString::new("rsoundio").unwrap(),
|
|
|
|
name: CString::new(name.into()).unwrap(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
@ -250,6 +250,14 @@ impl SoundIo { |
|
|
|
unsafe { ffi::utils::ptr_to_string((*self.context).app_name) }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl Default for SoundIo {
|
|
|
|
fn default() -> Self {
|
|
|
|
SoundIo {
|
|
|
|
context: unsafe { ffi::soundio_create() },
|
|
|
|
name: CString::new("rsoundio").unwrap(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl Drop for SoundIo {
|
|
|
|
fn drop(&mut self) {
|
|
|
|
unsafe {
|
|
|
|