Struct libpulse_binding::channelmap::Map
source · Expand description
A channel map which can be used to attach labels to specific channels of a stream. These values are relevant for conversion and mixing of streams.
Fields
channels: u8Number of channels mapped
map: [Position; 32]Channel labels
Implementations
sourceimpl Map
impl Map
sourcepub fn new_from_string(s: &str) -> Self
pub fn new_from_string(s: &str) -> Self
sourcepub fn init(&mut self) -> &mut Self
pub fn init(&mut self) -> &mut Self
Initialize the specified channel map and return a pointer to it. The map will have a defined
state but is_valid will fail for it.
sourcepub fn init_mono(&mut self) -> &mut Self
pub fn init_mono(&mut self) -> &mut Self
Initialize the specified channel map for monaural audio and return a pointer to it.
sourcepub fn init_stereo(&mut self) -> &mut Self
pub fn init_stereo(&mut self) -> &mut Self
Initialize the specified channel map for stereophonic audio and return a pointer to it.
sourcepub fn init_auto(&mut self, channels: u32, def: MapDef) -> Option<&mut Self>
pub fn init_auto(&mut self, channels: u32, def: MapDef) -> Option<&mut Self>
Initialize the specified channel map for the specified number of channels using default labels and return a pointer to it.
This call will fail (return None) if there is no default channel map known for this
specific number of channels and mapping.
sourcepub fn init_extend(&mut self, channels: u32, def: MapDef) -> &mut Self
pub fn init_extend(&mut self, channels: u32, def: MapDef) -> &mut Self
Similar to init_auto but instead of failing if no default mapping is
known with the specified parameters it will synthesize a mapping based on a known mapping
with fewer channels and fill up the rest with AUX0…AUX31 channels.
sourcepub fn is_equal_to(&self, to: &Self) -> bool
pub fn is_equal_to(&self, to: &Self) -> bool
Compare whether or not two maps are equal.
sourcepub fn is_compatible_with_sample_spec(&self, ss: &Spec) -> bool
pub fn is_compatible_with_sample_spec(&self, ss: &Spec) -> bool
Checks whether or not the specified map is compatible with the specified sample spec.
sourcepub fn is_superset_of(&self, of: &Self) -> bool
pub fn is_superset_of(&self, of: &Self) -> bool
Checks whether every channel defined in of is also defined in self.
sourcepub fn can_balance(&self) -> bool
pub fn can_balance(&self) -> bool
Checks whether or not it makes sense to apply a volume “balance” with this mapping, i.e. if there are left/right channels available.
sourcepub fn can_fade(&self) -> bool
pub fn can_fade(&self) -> bool
Checks whether or not it makes sense to apply a volume “fade” (i.e. “balance” between front and rear) with this mapping, i.e. if there are front/rear channels available.
sourcepub fn can_lfe_balance(&self) -> bool
pub fn can_lfe_balance(&self) -> bool
Checks whether or not it makes sense to apply a volume “LFE balance” (i.e. “balance” between LFE and non-LFE channels) with this mapping, i.e. if there are LFE and non-LFE channels available.
sourcepub fn to_name(&self) -> Option<Cow<'static, str>>
pub fn to_name(&self) -> Option<Cow<'static, str>>
Tries to find a well-known channel mapping name for this channel mapping, i.e. “stereo”,
“surround-71” and so on. This name can be parsed with
new_from_string.
sourcepub fn to_pretty_name(&self) -> Option<String>
pub fn to_pretty_name(&self) -> Option<String>
Similar to to_name, but returning prettier, human readable text labels,
i.e. “Stereo”, “Surround 7.1” and so on.
sourcepub fn has_position(&self, p: Position) -> bool
pub fn has_position(&self, p: Position) -> bool
Checks whether or not the specified channel position is available at least once in the map.
sourcepub fn get_mask(&self) -> PositionMask
pub fn get_mask(&self) -> PositionMask
Generates a bit mask from a map.