logo
#[repr(C)]
pub struct Map { /* private fields */ }
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.

Implementations

Maximum number of allowed channels.

Parses a channel position list or well-known mapping name into a channel map structure.

This turns the output of print() and to_name() back into a Map.

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.

Initializes the specified channel map for monaural audio and returns a pointer to it.

Initializes the specified channel map for stereophonic audio and returns a pointer to it.

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.

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.

Checks whether or not the map is considered valid.

Gets the number of active channels.

Sets the number of active channels.

Positions for up to Self::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 Self::CHANNELS_MAX.

Gets an immutable slice of the set of “active” channels.

Gets a mutable slice of the set of “active” channels.

Makes a human readable string from the map.

Checks whether or not the specified map is compatible with the specified sample spec.

Checks whether every channel defined in of is also defined in self.

Checks whether or not it makes sense to apply a volume “balance” with this mapping, i.e. if there are left/right channels available.

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.

This is supported on crate feature pa_v8 only.

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.

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().

Similar to to_name(), but returning prettier, human readable text labels, i.e. “Stereo”, “Surround 7.1” and so on.

Checks whether or not the specified channel position is available at least once in the map.

Generates a bit mask from a map.

Trait Implementations

Performs the conversion.

Performs the conversion.

Performs the conversion.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.