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
|
|
@ -58,6 +58,14 @@ impl DeviceTrait for Device {
|
|||
Device::name(self)
|
||||
}
|
||||
|
||||
fn supports_input(&self) -> bool {
|
||||
self.data_flow() == Audio::eCapture
|
||||
}
|
||||
|
||||
fn supports_output(&self) -> bool {
|
||||
self.data_flow() == Audio::eRender
|
||||
}
|
||||
|
||||
fn supported_input_configs(
|
||||
&self,
|
||||
) -> Result<Self::SupportedInputConfigs, SupportedStreamConfigsError> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue