[−][src]Struct libpulse_binding::channelmap::Map
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: u8
do not access directly, use methods from now on
Number of channels mapped.
map: [Position; 32]
do not access directly, use methods from now on
Channel labels.
Methods
impl Map
[src]
pub fn new_from_string(s: &str) -> Result<Self, ()>
[src]
Parses a channel position list or well-known mapping name into a channel map structure.
pub fn init(&mut self) -> &mut Self
[src]
Initializes the specified channel map and returns a pointer to it.
The map will have a defined state but is_valid
will fail for it.
pub fn init_mono(&mut self) -> &mut Self
[src]
Initializes the specified channel map for monaural audio and returns a pointer to it.
pub fn init_stereo(&mut self) -> &mut Self
[src]
Initializes the specified channel map for stereophonic audio and returns a pointer to it.
pub fn init_auto(&mut self, channels: u32, def: MapDef) -> Option<&mut Self>
[src]
Initializes the specified channel map for the specified number of channels using default labels and returns 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.
pub fn init_extend(&mut self, channels: u32, def: MapDef) -> &mut Self
[src]
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.
pub fn is_valid(&self) -> bool
[src]
Checks whether or not the map is considered valid.
pub fn len(&self) -> u8
[src]
Gets the number of active channels.
pub fn set_len(&mut self, channels: u8)
[src]
Sets the number of active channels.
Positions for up to sample::CHANNELS_MAX
channels can be held. This sets the portion of
the internal array considered “active” and thus available for reading/writing (i.e. when
borrowing self
as a slice).
Panics if the number of channels specified is greater than sample::CHANNELS_MAX
.
pub fn get(&self) -> &[Position]
[src]
Gets an immutable slice of the set of “active” channels.
pub fn get_mut(&mut self) -> &mut [Position]
[src]
Gets a mutable slice of the set of “active” channels.
pub fn print(&self) -> String
[src]
Makes a human readable string from the map.
pub fn is_equal_to(&self, to: &Self) -> bool
[src]
use the PartialEq
implementation instead
Compares whether or not two maps are equal.
pub fn is_compatible_with_sample_spec(&self, ss: &Spec) -> bool
[src]
Checks whether or not the specified map is compatible with the specified sample spec.
pub fn is_superset_of(&self, of: &Self) -> bool
[src]
Checks whether every channel defined in of
is also defined in self.
pub fn can_balance(&self) -> bool
[src]
Checks whether or not it makes sense to apply a volume “balance” with this mapping, i.e. if there are left/right channels available.
pub fn can_fade(&self) -> bool
[src]
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.
pub fn can_lfe_balance(&self) -> bool
[src]
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.
Available since PA version 8.
pub fn to_name(&self) -> Option<Cow<'static, str>>
[src]
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
.
pub fn to_pretty_name(&self) -> Option<String>
[src]
Similar to to_name
, but returning prettier, human readable text labels,
i.e. “Stereo”, “Surround 7.1” and so on.
pub fn has_position(&self, p: Position) -> bool
[src]
Checks whether or not the specified channel position is available at least once in the map.
pub fn get_mask(&self) -> PositionMask
[src]
Generates a bit mask from a map.
Trait Implementations
impl AsRef<pa_channel_map> for Map
[src]
fn as_ref(&self) -> &pa_channel_map
[src]
impl AsRef<Map> for pa_channel_map
[src]
impl AsMut<pa_channel_map> for Map
[src]
fn as_mut(&mut self) -> &mut pa_channel_map
[src]
impl From<pa_channel_map> for Map
[src]
fn from(m: pa_channel_map) -> Self
[src]
impl Clone for Map
[src]
impl Copy for Map
[src]
impl Default for Map
[src]
impl PartialEq<Map> for Map
[src]
impl Debug for Map
[src]
impl Borrow<[Position]> for Map
[src]
impl BorrowMut<[Position]> for Map
[src]
fn borrow_mut(&mut self) -> &mut [Position]
[src]
Auto Trait Implementations
impl Send for Map
impl Sync for Map
impl Unpin for Map
impl UnwindSafe for Map
impl RefUnwindSafe for Map
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,