[][src]Struct libpulse_binding::volume::Volume

pub struct Volume(pub pa_volume_t);

Software volume expressed as an integer

Methods

impl Volume[src]

pub fn is_muted(&self) -> bool[src]

pub fn is_normal(&self) -> bool[src]

pub fn is_max(&self) -> bool[src]

pub fn ui_max() -> Self[src]

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]

Check if volume is valid.

pub fn clamp(&mut self)[src]

Clamp volume to the permitted range.

pub fn multiply(a: Self, b: Self) -> Self[src]

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]

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]

Pretty print a volume

pub fn print_db(&self) -> String[src]

Pretty print a volume but show dB values.

pub fn print_verbose(&self, print_db: bool) -> String[src]

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 PartialOrd<Volume> for Volume[src]

impl Copy for Volume[src]

impl PartialEq<Volume> for Volume[src]

impl Default for Volume[src]

impl From<VolumeDB> for Volume[src]

Convert a decibel value to a volume (amplitude, not power). This is only valid for software volumes!

impl From<Volume> for VolumeDB[src]

Convert a volume to a decibel value (amplitude, not power). This is only valid for software volumes!

impl From<VolumeLinear> for Volume[src]

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!

impl From<Volume> for VolumeLinear[src]

Convert a volume to a linear factor. This is only valid for software volumes!

impl Clone for Volume[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Ord for Volume[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl Eq for Volume[src]

impl Display for Volume[src]

impl Debug for Volume[src]

Auto Trait Implementations

impl Send for Volume

impl Sync for Volume

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]