Only allow for private construction of SupportedStreamConfig.
This should give the user a higher confidence that, if they have a `SupportedStreamConfig` format type that it is actually supported. Also updates the `raw` stream builder methods to take a `StreamConfig` and `SampleFormat` as separate arguments for flexibility. **Backends Updated** - [x] null - [x] alsa - [ ] emscripten - [ ] coreaudio - [ ] wasapi - [ ] asio
This commit is contained in:
parent
07b66f52f3
commit
476f6c4c2c
8 changed files with 92 additions and 58 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use crate::{
|
||||
BuildStreamError, Data, DefaultStreamConfigError, DeviceNameError, DevicesError,
|
||||
PauseStreamError, PlayStreamError, StreamError, SupportedStreamConfig,
|
||||
SupportedStreamConfigRange, SupportedStreamConfigsError,
|
||||
PauseStreamError, PlayStreamError, SampleFormat, StreamConfig, StreamError,
|
||||
SupportedStreamConfig, SupportedStreamConfigRange, SupportedStreamConfigsError,
|
||||
};
|
||||
use traits::{DeviceTrait, HostTrait, StreamTrait};
|
||||
|
||||
|
|
@ -68,7 +68,8 @@ impl DeviceTrait for Device {
|
|||
|
||||
fn build_input_stream_raw<D, E>(
|
||||
&self,
|
||||
_format: &SupportedStreamConfig,
|
||||
_config: &StreamConfig,
|
||||
_sample_format: SampleFormat,
|
||||
_data_callback: D,
|
||||
_error_callback: E,
|
||||
) -> Result<Self::Stream, BuildStreamError>
|
||||
|
|
@ -82,7 +83,8 @@ impl DeviceTrait for Device {
|
|||
/// Create an output stream.
|
||||
fn build_output_stream_raw<D, E>(
|
||||
&self,
|
||||
_format: &SupportedStreamConfig,
|
||||
_config: &StreamConfig,
|
||||
_sample_format: SampleFormat,
|
||||
_data_callback: D,
|
||||
_error_callback: E,
|
||||
) -> Result<Self::Stream, BuildStreamError>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue