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

pub struct Volume(pub pa_volume_t);

Software volume expressed as an integer

Methods

impl Volume
[src]

[src]

[src]

[src]

[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.

[src]

Check if volume is valid.

[src]

Clamp volume to the permitted range.

[src]

Multiply two software volumes, return the result. This uses VOLUME_NORM as neutral element of multiplication. This is only valid for software volumes!

[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.

[src]

Pretty print a volume

[src]

Pretty print a volume but show dB values.

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

[src]

Formats the value using the given formatter. Read more

impl Copy for Volume
[src]

impl Clone for Volume
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for Volume
[src]

[src]

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

[src]

This method tests for !=.

impl Eq for Volume
[src]

impl PartialOrd for Volume
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

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]

[src]

This method returns an Ordering between self and other. Read more

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl Default for Volume
[src]

[src]

Returns the "default value" for a type. Read more

impl From<VolumeDB> for Volume
[src]

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

[src]

Performs the conversion.

impl From<Volume> for VolumeDB
[src]

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

[src]

Performs the conversion.

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!

[src]

Performs the conversion.

impl From<Volume> for VolumeLinear
[src]

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

[src]

Performs the conversion.

impl Display for Volume
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Volume

impl Sync for Volume