Struct lofty::properties::ChannelMask
source · pub struct ChannelMask(/* private fields */);Expand description
Channel mask
A mask of (at least) 18 bits, one for each channel.
- Standard speaker channels: https://en.wikipedia.org/wiki/Surround_sound#Channel_notation
- CAF channel bitmap: https://developer.apple.com/library/archive/documentation/MusicAudio/Reference/CAFSpec/CAF_spec/CAF_spec.html#//apple_ref/doc/uid/TP40001862-CH210-BCGBHHHI
- WAV default channel ordering: https://learn.microsoft.com/en-us/previous-versions/windows/hardware/design/dn653308(v=vs.85)
- FFmpeg: https://ffmpeg.org/doxygen/trunk/group__channel__masks.html
Implementations§
source§impl ChannelMask
impl ChannelMask
pub const FRONT_LEFT: Self = _
pub const FRONT_RIGHT: Self = _
pub const FRONT_CENTER: Self = _
pub const LOW_FREQUENCY: Self = _
pub const BACK_LEFT: Self = _
pub const BACK_RIGHT: Self = _
pub const FRONT_LEFT_OF_CENTER: Self = _
pub const FRONT_RIGHT_OF_CENTER: Self = _
pub const BACK_CENTER: Self = _
pub const SIDE_LEFT: Self = _
pub const SIDE_RIGHT: Self = _
pub const TOP_CENTER: Self = _
pub const TOP_FRONT_LEFT: Self = _
pub const TOP_FRONT_CENTER: Self = _
pub const TOP_FRONT_RIGHT: Self = _
pub const TOP_BACK_LEFT: Self = _
pub const TOP_BACK_CENTER: Self = _
pub const TOP_BACK_RIGHT: Self = _
source§impl ChannelMask
impl ChannelMask
sourcepub const fn linear_surround() -> Self
pub const fn linear_surround() -> Self
Front left+right+center channels
sourcepub const fn from_opus_channels(channels: u8) -> Option<Self>
pub const fn from_opus_channels(channels: u8) -> Option<Self>
Create a channel mask from the number of channels in an Opus file
See https://datatracker.ietf.org/doc/html/rfc7845#section-5.1.1.2 for the mapping.
sourcepub const fn from_mp4_channels(channels: u8) -> Option<Self>
pub const fn from_mp4_channels(channels: u8) -> Option<Self>
Create a channel mask from the number of channels in an MP4 file
See https://wiki.multimedia.cx/index.php/MPEG-4_Audio#Channel_Configurations for the mapping.
Trait Implementations§
source§impl BitAnd for ChannelMask
impl BitAnd for ChannelMask
source§impl BitOr for ChannelMask
impl BitOr for ChannelMask
source§impl Clone for ChannelMask
impl Clone for ChannelMask
source§fn clone(&self) -> ChannelMask
fn clone(&self) -> ChannelMask
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for ChannelMask
impl Debug for ChannelMask
source§impl Default for ChannelMask
impl Default for ChannelMask
source§fn default() -> ChannelMask
fn default() -> ChannelMask
Returns the “default value” for a type. Read more
source§impl PartialEq for ChannelMask
impl PartialEq for ChannelMask
source§fn eq(&self, other: &ChannelMask) -> bool
fn eq(&self, other: &ChannelMask) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Copy for ChannelMask
impl Eq for ChannelMask
impl StructuralPartialEq for ChannelMask
Auto Trait Implementations§
impl Freeze for ChannelMask
impl RefUnwindSafe for ChannelMask
impl Send for ChannelMask
impl Sync for ChannelMask
impl Unpin for ChannelMask
impl UnwindSafe for ChannelMask
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more