[−][src]Struct libpulse_binding::volume::Volume
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]
Get the 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 const fn is_valid(&self) -> bool
[src]
Checks if volume is valid.
pub fn clamp(&mut self)
[src]
Clamps volume to the permitted range.
pub fn multiply(a: Self, b: Self) -> Self
[src]
Multiplies two software volumes, returning 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]
Divides two software volumes, returning the result.
This uses VOLUME_NORM
as neutral element of division. If a
division by zero is tried the result will be 0
.
This is only valid for software volumes!
pub fn print(&self) -> String
[src]
Pretty prints a volume.
pub fn print_db(&self) -> String
[src]
Pretty prints a volume but showing dB values.
pub fn print_verbose(&self, print_db: bool) -> String
[src]
Pretty prints 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 From<VolumeDB> for Volume
[src]
Converts a decibel value to a volume (amplitude, not power).
This is only valid for software volumes!
impl From<Volume> for VolumeDB
[src]
Converts a volume to a decibel value (amplitude, not power).
This is only valid for software volumes!
impl From<VolumeLinear> for Volume
[src]
Converts 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]
impl From<Volume> for VolumeLinear
[src]
Converts a volume to a linear factor.
This is only valid for software volumes!
impl Ord for Volume
[src]
fn cmp(&self, other: &Volume) -> Ordering
[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
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl PartialOrd<Volume> for Volume
[src]
fn partial_cmp(&self, other: &Volume) -> Option<Ordering>
[src]
fn lt(&self, other: &Volume) -> bool
[src]
fn le(&self, other: &Volume) -> bool
[src]
fn gt(&self, other: &Volume) -> bool
[src]
fn ge(&self, other: &Volume) -> bool
[src]
impl Default for Volume
[src]
impl Clone for Volume
[src]
fn clone(&self) -> Volume
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<Volume> for Volume
[src]
impl PartialEq<Volume> for ChannelVolumes
[src]
fn eq(&self, v: &Volume) -> bool
[src]
Returns true
if the volume of all channels are equal to the specified value.
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Eq for Volume
[src]
impl Copy for Volume
[src]
impl Debug for Volume
[src]
impl Display for Volume
[src]
Auto Trait Implementations
impl Unpin for Volume
impl Send for Volume
impl Sync for Volume
impl RefUnwindSafe for Volume
impl UnwindSafe for Volume
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,