gstreamer-rs/gstreamer-audio/src/auto/stream_volume.rs
Sebastian Dröge 6b11b8b751 Explicitely ignore native endianness audio formats
We have to handle them separately depending on the current
configuration, and do so. Also fix things up there.
2017-08-10 10:51:22 +03:00

68 lines
1.6 KiB
Rust

// This file was generated by gir (cf27827) from gir-files (???)
// 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);
}
}
}