[−][src]Trait audir::Instance
Associated Types
Loading content...Required methods
unsafe fn properties() -> InstanceProperties
Get instance properties.
unsafe fn create(name: &str) -> Self
unsafe fn enumerate_physical_devices(&self) -> Vec<PhysicalDevice>
Retrieve a list of physical devices of the current instance.
The list may vary over time when devices get added or removed. Users may track changes manually by registering an event handler.
unsafe fn default_physical_input_device(&self) -> Option<PhysicalDevice>
Get the default physical input device.
unsafe fn default_physical_output_device(&self) -> Option<PhysicalDevice>
Get the default physical output device.
unsafe fn physical_device_properties(
&self,
physical_device: PhysicalDevice
) -> Result<PhysicalDeviceProperties>
&self,
physical_device: PhysicalDevice
) -> Result<PhysicalDeviceProperties>
unsafe fn physical_device_supports_format(
&self,
physical_device: PhysicalDevice,
sharing: SharingMode,
frame_desc: FrameDesc
) -> bool
&self,
physical_device: PhysicalDevice,
sharing: SharingMode,
frame_desc: FrameDesc
) -> bool
unsafe fn physical_device_default_concurrent_format(
&self,
physical_device: PhysicalDevice
) -> Result<FrameDesc>
&self,
physical_device: PhysicalDevice
) -> Result<FrameDesc>
Get default concurrent mode format.
Returns the default format used for physical devices when used with concurrent sharing mode.
Validation
physical_device
must be a valid handle.
unsafe fn create_device(
&self,
desc: DeviceDesc,
channels: Channels,
callback: StreamCallback
) -> Result<Self::Device>
&self,
desc: DeviceDesc,
channels: Channels,
callback: StreamCallback
) -> Result<Self::Device>
Create a new logical device.
A logical device with an associated stream will be created from a physical device.
Validation
physical_device
must be a valid handle.- If the device properties does not include
StreamFlags::INPUT
, the input channel mask must be empty. - If the device properties does not include
StreamFlags::OUTPUT
, the output channel mask must be empty. - If output channel mask is not empty, the format consisting of sample desc and output channel mask must be supported by this physical device.
- If input channel mask is not empty, the format consisting of sample desc and input channel mask must be supported by this physical device.
unsafe fn create_session(&self, sample_rate: usize) -> Result<Self::Session>
Create an audio session.
Audio sessions are needed for ensuring realtime properties for audio streaming. Callback based instances have an internal executor with the a properly configured audio session. After creating a session the current executor thread will have realtime properties for the lifetime of the session.
All polling instances will expose a concurrent default format with a sample_rate
,
which is not equal to DEFAULT_SAMPLE_RATE
.
Validation
sample_rate
must not beDEFAULT_SAMPLE_RATE
.
unsafe fn set_event_callback<F>(&mut self, callback: Option<F>) -> Result<()> where
F: FnMut(Event) + Send + 'static,
F: FnMut(Event) + Send + 'static,
Implementors
impl Instance for Instance
[src]
type Device = Device
type Session = Session
unsafe fn properties() -> InstanceProperties
[src]
unsafe fn create(_: &str) -> Self
[src]
unsafe fn enumerate_physical_devices(&self) -> Vec<PhysicalDevice>
[src]
unsafe fn default_physical_input_device(&self) -> Option<PhysicalDevice>
[src]
unsafe fn default_physical_output_device(&self) -> Option<PhysicalDevice>
[src]
unsafe fn physical_device_properties(
&self,
physical_device: PhysicalDevice
) -> Result<PhysicalDeviceProperties>
[src]
&self,
physical_device: PhysicalDevice
) -> Result<PhysicalDeviceProperties>
unsafe fn physical_device_default_concurrent_format(
&self,
physical_device: PhysicalDevice
) -> Result<FrameDesc>
[src]
&self,
physical_device: PhysicalDevice
) -> Result<FrameDesc>
unsafe fn create_device(
&self,
desc: DeviceDesc,
channels: Channels,
callback: StreamCallback
) -> Result<Device>
[src]
&self,
desc: DeviceDesc,
channels: Channels,
callback: StreamCallback
) -> Result<Device>
unsafe fn create_session(&self, sample_rate: usize) -> Result<Session>
[src]
unsafe fn set_event_callback<F>(&mut self, callback: Option<F>) -> Result<()> where
F: FnMut(Event) + Send + 'static,
[src]
F: FnMut(Event) + Send + 'static,
unsafe fn physical_device_supports_format(
&self,
physical_device: PhysicalDevice,
sharing: SharingMode,
frame_desc: FrameDesc
) -> bool
[src]
&self,
physical_device: PhysicalDevice,
sharing: SharingMode,
frame_desc: FrameDesc
) -> bool