mod song; pub use song::Song; mod state; pub use state::State; mod ffi { use gtk::glib; #[repr(C)] pub struct AudreyPlaybin { parent_instance: glib::gobject_ffi::GObject, } #[repr(C)] pub struct AudreyPlaybinClass { parent_class: glib::gobject_ffi::GObjectClass, } extern "C" { pub fn audrey_playbin_get_type() -> glib::ffi::GType; pub fn audrey_playbin_get_state(self_: *mut AudreyPlaybin) -> super::state::ffi::State; pub fn audrey_playbin_pause(self_: *mut AudreyPlaybin); pub fn audrey_playbin_play(self_: *mut AudreyPlaybin); } } use gtk::glib; glib::wrapper! { pub struct Playbin(Object); match fn { type_ => || ffi::audrey_playbin_get_type(), } } impl Playbin { pub fn get_state(&self) -> State { use glib::translate::ToGlibPtr; unsafe { glib::translate::from_glib(ffi::audrey_playbin_get_state(self.to_glib_none().0)) } } pub fn pause(&self) { use glib::translate::ToGlibPtr; unsafe { ffi::audrey_playbin_pause(self.to_glib_none().0) } } pub fn play(&self) { use glib::translate::ToGlibPtr; unsafe { ffi::audrey_playbin_play(self.to_glib_none().0) } } }