Struct gstreamer_audio::StreamVolume [−]
pub struct StreamVolume(_, _);
This interface is implemented by elements that provide a stream volume. Examples for
such elements are volume
and playbin
.
Applications can use this interface to get or set the current stream volume. For this
the "volume" gobject::Object
property can be used or the helper functions StreamVolume::set_volume
and StreamVolume::get_volume
. This volume is always a linear factor, i.e. 0.0 is muted
1.0 is 100%. For showing the volume in a GUI it might make sense to convert it to
a different format by using StreamVolume::convert_volume
. Volume sliders should usually
use a cubic volume.
Separate from the volume the stream can also be muted by the "mute" gobject::Object
property or
StreamVolume::set_mute
and StreamVolume::get_mute
.
Elements that provide some kind of stream volume should implement the "volume" and
"mute" gobject::Object
properties and handle setting and getting of them properly.
The volume property is defined to be a linear volume factor.
Implements
Methods
impl StreamVolume
[src]
impl StreamVolume
pub fn convert_volume(
from: StreamVolumeFormat,
to: StreamVolumeFormat,
val: f64
) -> f64
[src]
pub fn convert_volume(
from: StreamVolumeFormat,
to: StreamVolumeFormat,
val: f64
) -> f64
Trait Implementations
impl Clone for StreamVolume
impl Clone for StreamVolume
fn clone(&self) -> StreamVolume
fn clone(&self) -> StreamVolume
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 Hash for StreamVolume
impl Hash for StreamVolume
fn hash<__H: Hasher>(&self, state: &mut __H)
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Ord for StreamVolume
impl Ord for StreamVolume
fn cmp(&self, other: &StreamVolume) -> Ordering
fn cmp(&self, other: &StreamVolume) -> 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 StaticType for StreamVolume
impl StaticType for StreamVolume
fn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of Self
.
impl<T: IsA<Object>> PartialEq<T> for StreamVolume
impl<T: IsA<Object>> PartialEq<T> for StreamVolume
fn eq(&self, other: &T) -> bool
fn eq(&self, other: &T) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Eq for StreamVolume
impl Eq for StreamVolume
impl<T: IsA<Object>> PartialOrd<T> for StreamVolume
impl<T: IsA<Object>> PartialOrd<T> for StreamVolume
fn partial_cmp(&self, other: &T) -> Option<Ordering>
fn partial_cmp(&self, other: &T) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Debug for StreamVolume
impl Debug for StreamVolume
impl IsA<Object> for StreamVolume
impl IsA<Object> for StreamVolume
impl Send for StreamVolume
[src]
impl Send for StreamVolume
impl Sync for StreamVolume
[src]
impl Sync for StreamVolume