Add SupportedFormat (#168)

This commit is contained in:
tomaka 2017-10-20 21:18:40 +02:00 • committed by GitHub
parent 393206bde9
commit 87949d859b
9 changed files with 75 additions and 30 deletions

View file

@ -1,6 +1,7 @@
use super::Endpoint;
use Format;
use SupportedFormat;
use std::vec::IntoIter as VecIntoIter;
@ -33,4 +34,4 @@ pub fn default_endpoint() -> Option<Endpoint> {
Some(Endpoint)
}
pub type SupportedFormatsIterator = VecIntoIter<Format>;
pub type SupportedFormatsIterator = VecIntoIter<SupportedFormat>;

View file

@ -7,6 +7,7 @@ use FormatsEnumerationError;
use Sample;
use SampleFormat;
use SamplesRate;
use SupportedFormat;
use UnknownTypeBuffer;
use std::mem;
@ -30,9 +31,10 @@ impl Endpoint {
-> Result<SupportedFormatsIterator, FormatsEnumerationError> {
Ok(
vec![
Format {
SupportedFormat {
channels: vec![ChannelPosition::FrontLeft, ChannelPosition::FrontRight],
samples_rate: SamplesRate(44100),
min_samples_rate: SamplesRate(44100),
max_samples_rate: SamplesRate(44100),
data_type: SampleFormat::F32,
},
].into_iter(),