Skip to main content

Layout

Enum Layout 

Source
#[non_exhaustive]
pub enum Layout {
Show 18 variants None, Mono, Stereo, Surround51, Surround71, Lcr, Quad, Surround50, Surround70, Surround512, Surround514, Surround712, Surround714, Surround916, Ambisonics1, Ambisonics2, Ambisonics3, Ambisonics4,
}
Expand description

Channel layout of an audio bus. Each layout has one channel order, listed on its variant. Formats whose native order differs are mapped explicitly; a layout a format cannot express is refused rather than approximated.

Ls and Rs are the surrounds of layouts without side channels. Layouts that also have side surrounds (Lss, Rss) list Ls and Rs as the rear surrounds before them. Height channels are top front (Ltf, Rtf), top middle (Ltm, Rtm) and top rear (Ltr, Rtr); Lw and Rw are the wides. A new variant also belongs in Layout::ALL, which formats search to recognize layouts.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

None

No bus, for example the input of an instrument.

§

Mono

One center channel.

§

Stereo

Left, right.

§

Surround51

L R C LFE Ls Rs

§

Surround71

L R C LFE Ls Rs Lss Rss (7.1 surround with side channels)

§

Lcr

L R C

§

Quad

L R Ls Rs

§

Surround50

L R C Ls Rs

§

Surround70

L R C Ls Rs Lss Rss

§

Surround512

L R C LFE Ls Rs Ltm Rtm

§

Surround514

L R C LFE Ls Rs Ltf Rtf Ltr Rtr

§

Surround712

L R C LFE Ls Rs Lss Rss Ltm Rtm

§

Surround714

L R C LFE Ls Rs Lss Rss Ltf Rtf Ltr Rtr

§

Surround916

L R C LFE Ls Rs Lss Rss Ltf Rtf Ltr Rtr Ltm Rtm Lw Rw

§

Ambisonics1

First-order ambisonics: ACN channel order, SN3D normalization.

§

Ambisonics2

Second-order ambisonics: ACN channel order, SN3D normalization.

§

Ambisonics3

Third-order ambisonics: ACN channel order, SN3D normalization.

§

Ambisonics4

Fourth-order ambisonics: ACN channel order, SN3D normalization.

Implementations§

Source§

impl Layout

Source

pub const ALL: [Layout; 18]

Every layout, in declaration order.

Source

pub fn channels(self) -> usize

Number of planar channels in this layout.

Trait Implementations§

Source§

impl Clone for Layout

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Layout

Source§

impl Debug for Layout

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Layout

Source§

impl Hash for Layout

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Layout

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Layout

Auto Trait Implementations§

§

impl Forget for Layout

§

impl Freeze for Layout

§

impl Move for Layout

§

impl RefUnwindSafe for Layout

§

impl Send for Layout

§

impl Sync for Layout

§

impl Unpin for Layout

§

impl UnsafeUnpin for Layout

§

impl UnwindSafe for Layout

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.