[−][src]Struct miniaudio::RawContext
Methods
impl RawContext
[src]
pub fn alloc(
backends: &[Backend],
config: Option<&ContextConfig>
) -> Result<Arc<RawContext>, Error>
[src]
backends: &[Backend],
config: Option<&ContextConfig>
) -> Result<Arc<RawContext>, Error>
-
backends
- A list of backends to try initializing, in priority order. Can be None, in which case it uses default priority order. -
config
- Optional context configuration.
pub fn get_device_info(
&self,
device_type: DeviceType,
device_id: &DeviceId,
share_mode: ShareMode
) -> Result<DeviceInfo, Error>
[src]
&self,
device_type: DeviceType,
device_id: &DeviceId,
share_mode: ShareMode
) -> Result<DeviceInfo, Error>
Returns information like name, format, and sample rate, ect. about a device with the given ID.
pub fn set_device_info(
&self,
device_type: DeviceType,
device_id: &DeviceId,
share_mode: ShareMode,
device_info: &mut DeviceInfo
) -> Result<(), Error>
[src]
&self,
device_type: DeviceType,
device_id: &DeviceId,
share_mode: ShareMode,
device_info: &mut DeviceInfo
) -> Result<(), Error>
Returns information like name, format, and sample rate, ect. about a device with the given ID. This will place the gathered information into the passed in device_info reference.
pub fn backend(&self) -> Backend
[src]
pub fn thread_priority(&self) -> ThreadPriority
[src]
pub fn device_info_capacity(&self) -> u32
[src]
pub fn playback_device_count(&self) -> u32
[src]
Returns the number of found playback devices.
pub fn capture_device_count(&self) -> u32
[src]
Returns the number of found capture devices.
pub fn playback_devices(&self) -> &[DeviceIdAndName]
[src]
Returns a slice containing the name and IDs of all found playback devices.
pub fn capture_devices(&self) -> &[DeviceIdAndName]
[src]
Returns a slice containing the name and IDs of all found capture devices.
pub fn is_backend_asynchronous(&self) -> bool
[src]
pub fn with_devices<F>(&self, f: F) -> Result<(), Error> where
F: FnOnce(&[DeviceIdAndName], &[DeviceIdAndName]),
[src]
F: FnOnce(&[DeviceIdAndName], &[DeviceIdAndName]),
Retrieves basic information about every active playback and capture device. This function will allocate memory internally for device lists. This function will not call the closure if an error occurred.
pub fn with_playback_devices<F>(&self, f: F) -> Result<(), Error> where
F: FnOnce(&[DeviceIdAndName]),
[src]
F: FnOnce(&[DeviceIdAndName]),
Retrieves basic information about every active playback device. This function will allocate memory internally for device lists. This function will not call the closure if an error occurred.
pub fn with_capture_devices<F>(&self, f: F) -> Result<(), Error> where
F: FnOnce(&[DeviceIdAndName]),
[src]
F: FnOnce(&[DeviceIdAndName]),
Retrieves basic information about every active capture device. This function will allocate memory internally for device lists. This function will not call the closure if an error occurred.
pub unsafe fn enumerate_devices<F>(&self, callback: F) -> Result<(), Error> where
F: for<'r, 's> FnMut(&'r RawContext, DeviceType, &'s DeviceIdAndName) -> bool,
[src]
F: for<'r, 's> FnMut(&'r RawContext, DeviceType, &'s DeviceIdAndName) -> bool,
Safety
DO NOT call get_device_info
or set_device_info
while inside of the callback.
Trait Implementations
impl Clone for RawContext
[src]
fn clone(&self) -> RawContext
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Drop for RawContext
[src]
Auto Trait Implementations
impl RefUnwindSafe for RawContext
impl !Send for RawContext
impl !Sync for RawContext
impl Unpin for RawContext
impl UnwindSafe for RawContext
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,