Struct libpulse_binding::volume::Volume [−][src]
pub struct Volume(pub pa_volume_t);
Software volume expressed as an integer
Methods
impl Volume
[src]
impl Volume
pub fn is_muted(&self) -> bool
[src]
pub fn is_muted(&self) -> bool
pub fn is_normal(&self) -> bool
[src]
pub fn is_normal(&self) -> bool
pub fn is_max(&self) -> bool
[src]
pub fn is_max(&self) -> bool
pub fn ui_max() -> Self
[src]
pub fn ui_max() -> Self
Recommended maximum volume to show in user facing UIs. Note: UIs should deal gracefully with volumes greater than this value and not cause feedback loops etc. - i.e. if the volume is more than this, the UI should not limit it and push the limited value back to the server.
pub fn is_valid(&self) -> bool
[src]
pub fn is_valid(&self) -> bool
Check if volume is valid.
pub fn clamp(&mut self)
[src]
pub fn clamp(&mut self)
Clamp volume to the permitted range.
pub fn multiply(a: Self, b: Self) -> Self
[src]
pub fn multiply(a: Self, b: Self) -> Self
Multiply two software volumes, return the result.
This uses VOLUME_NORM
as neutral element of multiplication.
This is only valid for software volumes!
pub fn divide(a: Self, b: Self) -> Self
[src]
pub fn divide(a: Self, b: Self) -> Self
Divide two software volumes, return the result.
This uses VOLUME_NORM
as neutral element of division. This is
only valid for software volumes! If a division by zero is tried the result will be 0
.
pub fn print(&self) -> String
[src]
pub fn print(&self) -> String
Pretty print a volume
pub fn print_db(&self) -> String
[src]
pub fn print_db(&self) -> String
Pretty print a volume but show dB values.
pub fn print_verbose(&self, print_db: bool) -> String
[src]
pub fn print_verbose(&self, print_db: bool) -> String
Pretty print a volume in a verbose way.
The volume is printed in several formats: the raw volume value, percentage, and if
print_db
is true, also the dB value.
Trait Implementations
impl Debug for Volume
[src]
impl Debug for Volume
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Copy for Volume
[src]
impl Copy for Volume
impl Clone for Volume
[src]
impl Clone for Volume
fn clone(&self) -> Volume
[src]
fn clone(&self) -> Volume
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for Volume
[src]
impl PartialEq for Volume
fn eq(&self, other: &Volume) -> bool
[src]
fn eq(&self, other: &Volume) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Volume) -> bool
[src]
fn ne(&self, other: &Volume) -> bool
This method tests for !=
.
impl Eq for Volume
[src]
impl Eq for Volume
impl PartialOrd for Volume
[src]
impl PartialOrd for Volume
fn partial_cmp(&self, other: &Volume) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Volume) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Volume) -> bool
[src]
fn lt(&self, other: &Volume) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Volume) -> bool
[src]
fn le(&self, other: &Volume) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Volume) -> bool
[src]
fn gt(&self, other: &Volume) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Volume) -> bool
[src]
fn ge(&self, other: &Volume) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Volume
[src]
impl Ord for Volume
fn cmp(&self, other: &Volume) -> Ordering
[src]
fn cmp(&self, other: &Volume) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Default for Volume
[src]
impl Default for Volume
impl From<VolumeDB> for Volume
[src]
impl From<VolumeDB> for Volume
Convert a decibel value to a volume (amplitude, not power). This is only valid for software volumes!
impl From<Volume> for VolumeDB
[src]
impl From<Volume> for VolumeDB
Convert a volume to a decibel value (amplitude, not power). This is only valid for software volumes!
impl From<VolumeLinear> for Volume
[src]
impl From<VolumeLinear> for Volume
Convert a linear factor to a volume.
0.0
and less is muted while 1.0
is VOLUME_NORM
.
This is only valid for software volumes!
fn from(v: VolumeLinear) -> Self
[src]
fn from(v: VolumeLinear) -> Self
Performs the conversion.
impl From<Volume> for VolumeLinear
[src]
impl From<Volume> for VolumeLinear
Convert a volume to a linear factor. This is only valid for software volumes!
impl Display for Volume
[src]
impl Display for Volume