Handle channels positionning
This commit is contained in:
parent
0960f3c37d
commit
48282a068d
3 changed files with 125 additions and 11 deletions
27
src/lib.rs
27
src/lib.rs
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue