Handle channels positionning

This commit is contained in:
Pierre Krieger 2015-09-10 11:44:19 +02:00
parent 0960f3c37d
commit 48282a068d
3 changed files with 125 additions and 11 deletions

View file

@ -107,14 +107,37 @@ impl Endpoint {
/// Number of channels.
pub type ChannelsCount = u16;
/// Possible position of a channel.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum ChannelPosition {
FrontLeft,
FrontRight,
FrontCenter,
LowFrequency,
BackLeft,
BackRight,
FrontLeftOfCenter,
FrontRightOfCenter,
BackCenter,
SideLeft,
SideRight,
TopCenter,
TopFrontLeft,
TopFrontCenter,
TopFrontRight,
TopBackLeft,
TopBackCenter,
TopBackRight,
}
///
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct SamplesRate(pub u32);
/// Describes a format.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Format {
pub channels: ChannelsCount,
pub channels: Vec<ChannelPosition>,
pub samples_rate: SamplesRate,
pub data_type: SampleFormat,
}