mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
Show current item in player bar
This commit is contained in:
parent
232faa6a2f
commit
2d4f3d73cf
6 changed files with 53 additions and 27 deletions
|
|
@ -16,8 +16,8 @@ mod imp {
|
|||
#[property(get, construct_only)]
|
||||
pub is_title: OnceCell<bool>,
|
||||
|
||||
#[property(get, construct_only, nullable)]
|
||||
pub title: OnceCell<Option<String>>,
|
||||
#[property(get, construct_only)]
|
||||
pub title: OnceCell<String>,
|
||||
|
||||
#[property(get, construct_only, nullable)]
|
||||
pub performers: OnceCell<Option<String>>,
|
||||
|
|
@ -45,25 +45,18 @@ glib::wrapper! {
|
|||
|
||||
impl PlaylistItem {
|
||||
pub fn new(
|
||||
is_title: bool,
|
||||
title: &str,
|
||||
performers: Option<&str>,
|
||||
part_title: Option<&str>,
|
||||
path: impl AsRef<Path>,
|
||||
) -> Self {
|
||||
glib::Object::builder()
|
||||
.property("is-title", true)
|
||||
.property("is-title", is_title)
|
||||
.property("title", title)
|
||||
.property("performers", performers)
|
||||
.property("part-title", part_title)
|
||||
.property("path", path.as_ref())
|
||||
.build()
|
||||
}
|
||||
|
||||
pub fn new_part(part_title: &str, path: impl AsRef<Path>) -> Self {
|
||||
glib::Object::builder()
|
||||
.property("is-title", false)
|
||||
.property("part-title", part_title)
|
||||
.property("path", path.as_ref())
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue