2017-08-10 07:51:22 +00:00
|
|
|
// This file was generated by gir (cf27827) from gir-files (???)
|
2017-08-09 22:28:29 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
|
|
|
use StreamVolumeFormat;
|
|
|
|
use ffi;
|
|
|
|
use glib::object::IsA;
|
|
|
|
use glib::translate::*;
|
|
|
|
use glib_ffi;
|
|
|
|
use gobject_ffi;
|
|
|
|
use std::mem;
|
|
|
|
use std::ptr;
|
|
|
|
|
|
|
|
glib_wrapper! {
|
|
|
|
pub struct StreamVolume(Object<ffi::GstStreamVolume>);
|
|
|
|
|
|
|
|
match fn {
|
|
|
|
get_type => || ffi::gst_stream_volume_get_type(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl StreamVolume {
|
|
|
|
pub fn convert_volume(from: StreamVolumeFormat, to: StreamVolumeFormat, val: f64) -> f64 {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
|
|
|
ffi::gst_stream_volume_convert_volume(from.to_glib(), to.to_glib(), val)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for StreamVolume {}
|
|
|
|
unsafe impl Sync for StreamVolume {}
|
|
|
|
|
|
|
|
pub trait StreamVolumeExt {
|
|
|
|
fn get_mute(&self) -> bool;
|
|
|
|
|
|
|
|
fn get_volume(&self, format: StreamVolumeFormat) -> f64;
|
|
|
|
|
|
|
|
fn set_mute(&self, mute: bool);
|
|
|
|
|
|
|
|
fn set_volume(&self, format: StreamVolumeFormat, val: f64);
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<O: IsA<StreamVolume>> StreamVolumeExt for O {
|
|
|
|
fn get_mute(&self) -> bool {
|
|
|
|
unsafe {
|
|
|
|
from_glib(ffi::gst_stream_volume_get_mute(self.to_glib_none().0))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_volume(&self, format: StreamVolumeFormat) -> f64 {
|
|
|
|
unsafe {
|
|
|
|
ffi::gst_stream_volume_get_volume(self.to_glib_none().0, format.to_glib())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_mute(&self, mute: bool) {
|
|
|
|
unsafe {
|
|
|
|
ffi::gst_stream_volume_set_mute(self.to_glib_none().0, mute.to_glib());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_volume(&self, format: StreamVolumeFormat, val: f64) {
|
|
|
|
unsafe {
|
|
|
|
ffi::gst_stream_volume_set_volume(self.to_glib_none().0, format.to_glib(), val);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|