Added supports_input/output methods to DeviceTrait (#920)
Time to get list of WASAPI devices on my machine (5 devices in total) before change: Input devices: 12 ms, output devices: 187 ms After change: Input devices: 1 ms, output devices: 1 ms
This commit is contained in:
parent
ca77d848ad
commit
582e93c41d
3 changed files with 42 additions and 14 deletions
|
|
@ -315,6 +315,24 @@ macro_rules! impl_platform_host {
|
|||
}
|
||||
}
|
||||
|
||||
fn supports_input(&self) -> bool {
|
||||
match self.0 {
|
||||
$(
|
||||
$(#[cfg($feat)])?
|
||||
DeviceInner::$HostVariant(ref d) => d.supports_input(),
|
||||
)*
|
||||
}
|
||||
}
|
||||
|
||||
fn supports_output(&self) -> bool {
|
||||
match self.0 {
|
||||
$(
|
||||
$(#[cfg($feat)])?
|
||||
DeviceInner::$HostVariant(ref d) => d.supports_output(),
|
||||
)*
|
||||
}
|
||||
}
|
||||
|
||||
fn supported_input_configs(&self) -> Result<Self::SupportedInputConfigs, crate::SupportedStreamConfigsError> {
|
||||
match self.0 {
|
||||
$(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue