directly provide playqueue list model
This commit is contained in:
parent
35aa3e3101
commit
c227e8caea
1 changed files with 10 additions and 5 deletions
|
@ -5,7 +5,7 @@ mod state;
|
|||
pub use state::State;
|
||||
|
||||
pub mod ffi {
|
||||
use gtk::glib;
|
||||
use gtk::{gio, glib};
|
||||
|
||||
#[repr(C)]
|
||||
pub struct AudreyPlaybin {
|
||||
|
@ -43,13 +43,14 @@ pub mod ffi {
|
|||
);
|
||||
pub fn audrey_playbin_remove_track(self_: *mut AudreyPlaybin, position: std::ffi::c_uint);
|
||||
pub fn audrey_playbin_select_track(self_: *mut AudreyPlaybin, position: std::ffi::c_uint);
|
||||
pub fn audrey_playbin_get_play_queue(
|
||||
self_: *mut AudreyPlaybin,
|
||||
) -> *mut gio::ffi::GListModel;
|
||||
}
|
||||
}
|
||||
|
||||
use glib::translate::from_glib;
|
||||
use glib::translate::IntoGlib;
|
||||
use glib::translate::ToGlibPtr;
|
||||
use gtk::glib;
|
||||
use glib::translate::{from_glib, from_glib_none, IntoGlib, ToGlibPtr};
|
||||
use gtk::{gio, glib};
|
||||
|
||||
glib::wrapper! {
|
||||
pub struct Playbin(Object<ffi::AudreyPlaybin, ffi::AudreyPlaybinClass>);
|
||||
|
@ -131,4 +132,8 @@ impl Playbin {
|
|||
pub fn stop(&self) {
|
||||
unsafe { ffi::audrey_playbin_stop(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn play_queue(&self) -> gio::ListModel {
|
||||
unsafe { from_glib_none(ffi::audrey_playbin_get_play_queue(self.to_glib_none().0)) }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue