Show current item in player bar

This commit is contained in:
Elias Projahn 2023-10-27 14:15:05 +02:00
parent 232faa6a2f
commit 2d4f3d73cf
6 changed files with 53 additions and 27 deletions

View file

@ -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()
}
}