2024-10-10 10:12:43 +00:00
|
|
|
using Gtk 4.0;
|
|
|
|
using Adw 1;
|
|
|
|
|
2024-10-13 09:41:01 +00:00
|
|
|
template $UiWindow: Adw.ApplicationWindow {
|
2024-10-12 20:52:29 +00:00
|
|
|
title: _("audrey");
|
2024-10-10 10:12:43 +00:00
|
|
|
default-width: 800;
|
|
|
|
default-height: 600;
|
|
|
|
|
|
|
|
content: Box {
|
|
|
|
orientation: vertical;
|
|
|
|
|
|
|
|
Adw.OverlaySplitView {
|
|
|
|
vexpand: true;
|
|
|
|
|
|
|
|
[sidebar]
|
|
|
|
Adw.NavigationPage {
|
|
|
|
width-request: 100;
|
2024-10-12 20:52:29 +00:00
|
|
|
title: _("audrey");
|
2024-10-10 10:12:43 +00:00
|
|
|
|
|
|
|
Adw.ToolbarView {
|
|
|
|
[top]
|
2024-10-12 19:06:15 +00:00
|
|
|
Adw.HeaderBar {
|
|
|
|
[end]
|
|
|
|
Button {
|
|
|
|
icon-name: "applications-system";
|
|
|
|
clicked => $show_setup_dialog ();
|
|
|
|
}
|
|
|
|
}
|
2024-10-10 10:12:43 +00:00
|
|
|
|
|
|
|
content: Box {
|
|
|
|
orientation: vertical;
|
|
|
|
|
|
|
|
ListBox sidebar {
|
|
|
|
styles [
|
|
|
|
"navigation-sidebar",
|
|
|
|
]
|
|
|
|
|
2024-10-11 08:22:05 +00:00
|
|
|
row-activated => $on_sidebar_row_activated();
|
|
|
|
|
2024-10-10 10:12:43 +00:00
|
|
|
ListBoxRow sidebar_play_queue {
|
|
|
|
Label {
|
|
|
|
xalign: 0;
|
2024-10-10 10:16:23 +00:00
|
|
|
label: _("Play queue");
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {}
|
|
|
|
|
|
|
|
ListBox {
|
|
|
|
selection-mode: none;
|
|
|
|
|
|
|
|
styles [
|
|
|
|
"navigation-sidebar",
|
|
|
|
]
|
|
|
|
|
2024-10-10 10:51:12 +00:00
|
|
|
Adw.ButtonRow shuffle_all_tracks {
|
2024-10-10 10:16:23 +00:00
|
|
|
title: _("Shuffle all tracks");
|
2024-10-10 10:12:43 +00:00
|
|
|
start-icon-name: "media-playlist-shuffle";
|
2024-10-10 10:51:12 +00:00
|
|
|
sensitive: false;
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
}
|
2024-10-12 18:08:20 +00:00
|
|
|
|
|
|
|
Separator {
|
|
|
|
styles [
|
|
|
|
"spacer",
|
|
|
|
]
|
|
|
|
vexpand: true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Picture {
|
2024-10-13 15:21:29 +00:00
|
|
|
paintable: bind template.playing_cover_art;
|
2024-10-12 18:08:20 +00:00
|
|
|
}
|
2024-10-10 10:12:43 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[content]
|
|
|
|
Stack stack {
|
|
|
|
StackPage {
|
|
|
|
name: "play_queue";
|
2024-10-10 10:16:23 +00:00
|
|
|
title: _("Play queue");
|
2024-10-10 10:12:43 +00:00
|
|
|
|
2024-10-15 11:27:47 +00:00
|
|
|
child: $UiPlayQueue play_queue {
|
2024-10-16 09:43:11 +00:00
|
|
|
store: bind template.play_queue_store;
|
2024-10-15 11:27:47 +00:00
|
|
|
};
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[bottom]
|
2024-10-12 18:55:15 +00:00
|
|
|
CenterBox {
|
2024-10-10 10:12:43 +00:00
|
|
|
styles [
|
|
|
|
"toolbar",
|
|
|
|
]
|
|
|
|
|
2024-10-12 18:55:15 +00:00
|
|
|
[start]
|
2024-10-10 10:12:43 +00:00
|
|
|
Box {
|
|
|
|
orientation: vertical;
|
|
|
|
valign: center;
|
|
|
|
|
|
|
|
Label {
|
2024-10-12 19:08:40 +00:00
|
|
|
styles [ "heading" ]
|
2024-10-13 17:00:47 +00:00
|
|
|
xalign: 0;
|
2024-10-10 10:12:43 +00:00
|
|
|
halign: start;
|
2024-10-16 10:37:39 +00:00
|
|
|
label: bind $song_title (template.playbin as <$Playbin>.current_song) as <string>;
|
2024-10-13 08:03:05 +00:00
|
|
|
ellipsize: end;
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
|
2024-10-13 17:00:47 +00:00
|
|
|
Label {
|
|
|
|
styles [ "caption" ]
|
|
|
|
xalign: 0;
|
2024-10-16 10:37:39 +00:00
|
|
|
label: bind $song_artist (template.playbin as <$Playbin>.current_song) as <string>;
|
2024-10-13 17:00:47 +00:00
|
|
|
ellipsize: end;
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
styles [ "caption" ]
|
|
|
|
xalign: 0;
|
2024-10-16 10:37:39 +00:00
|
|
|
label: bind $song_album (template.playbin as <$Playbin>.current_song) as <string>;
|
2024-10-13 17:00:47 +00:00
|
|
|
ellipsize: end;
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
2024-10-12 18:13:22 +00:00
|
|
|
}
|
|
|
|
|
2024-10-12 18:55:15 +00:00
|
|
|
[center]
|
2024-10-12 18:13:22 +00:00
|
|
|
Box {
|
|
|
|
orientation: vertical;
|
2024-10-12 18:55:15 +00:00
|
|
|
halign: center;
|
|
|
|
hexpand: true;
|
2024-10-10 10:12:43 +00:00
|
|
|
|
2024-10-13 08:05:18 +00:00
|
|
|
CenterBox {
|
|
|
|
[start]
|
2024-10-11 06:57:01 +00:00
|
|
|
Label play_position_label {
|
|
|
|
styles [
|
2024-10-11 07:53:30 +00:00
|
|
|
"caption",
|
2024-10-11 06:57:01 +00:00
|
|
|
"numeric",
|
|
|
|
]
|
|
|
|
|
2024-10-16 20:24:48 +00:00
|
|
|
label: bind $format_timestamp (template.playbin as <$Playbin>.position) as <string>;
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
|
2024-10-13 08:05:18 +00:00
|
|
|
[center]
|
2024-10-11 06:57:01 +00:00
|
|
|
Scale play_position {
|
2024-10-12 18:41:03 +00:00
|
|
|
name: "seek-scale";
|
2024-10-10 10:12:43 +00:00
|
|
|
orientation: horizontal;
|
2024-10-12 18:55:15 +00:00
|
|
|
width-request: 400;
|
2024-10-16 10:05:47 +00:00
|
|
|
sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as <bool>;
|
2024-10-10 10:12:43 +00:00
|
|
|
|
|
|
|
adjustment: Adjustment {
|
|
|
|
lower: 0;
|
2024-10-16 20:24:48 +00:00
|
|
|
value: bind template.playbin as <$Playbin>.position;
|
2024-10-16 10:03:32 +00:00
|
|
|
upper: bind template.playbin as <$Playbin>.duration;
|
2024-10-10 10:12:43 +00:00
|
|
|
};
|
2024-10-12 12:28:05 +00:00
|
|
|
|
|
|
|
change-value => $on_play_position_seek ();
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
|
2024-10-13 08:05:18 +00:00
|
|
|
[end]
|
2024-10-11 06:57:01 +00:00
|
|
|
Label play_duration {
|
|
|
|
styles [
|
2024-10-11 07:53:30 +00:00
|
|
|
"caption",
|
2024-10-11 06:57:01 +00:00
|
|
|
"numeric",
|
|
|
|
]
|
|
|
|
|
2024-10-16 10:03:32 +00:00
|
|
|
label: bind $format_timestamp (template.playbin as <$Playbin>.duration) as <string>;
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
Box {
|
|
|
|
halign: center;
|
|
|
|
orientation: horizontal;
|
2024-10-10 10:12:43 +00:00
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
Button {
|
|
|
|
icon-name: "media-skip-backward";
|
|
|
|
valign: center;
|
2024-10-15 20:33:39 +00:00
|
|
|
sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as <bool>;
|
2024-10-10 10:12:43 +00:00
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
clicked => $on_skip_backward_clicked ();
|
|
|
|
}
|
2024-10-12 13:36:47 +00:00
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
Button {
|
|
|
|
icon-name: "media-seek-backward";
|
|
|
|
valign: center;
|
2024-10-15 20:33:39 +00:00
|
|
|
sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as <bool>;
|
2024-10-13 08:14:40 +00:00
|
|
|
|
|
|
|
clicked => $seek_backward ();
|
2024-10-12 18:13:22 +00:00
|
|
|
}
|
2024-10-10 10:12:43 +00:00
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
Button {
|
2024-10-15 20:33:39 +00:00
|
|
|
icon-name: bind $play_pause_icon_name (template.playbin as <$Playbin>.state as <$PlaybinState>) as <string>;
|
2024-10-12 18:13:22 +00:00
|
|
|
valign: center;
|
2024-10-15 20:33:39 +00:00
|
|
|
sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as <bool>;
|
2024-10-12 12:28:05 +00:00
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
clicked => $on_play_pause_clicked ();
|
|
|
|
}
|
2024-10-10 10:12:43 +00:00
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
Button {
|
|
|
|
icon-name: "media-seek-forward";
|
|
|
|
valign: center;
|
2024-10-15 20:33:39 +00:00
|
|
|
sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as <bool>;
|
2024-10-13 08:14:40 +00:00
|
|
|
|
|
|
|
clicked => $seek_forward ();
|
2024-10-12 18:13:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
icon-name: "media-skip-forward";
|
|
|
|
valign: center;
|
2024-10-15 20:33:39 +00:00
|
|
|
sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as <bool>;
|
2024-10-12 13:36:47 +00:00
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
clicked => $on_skip_forward_clicked ();
|
|
|
|
}
|
|
|
|
}
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
|
2024-10-12 18:55:15 +00:00
|
|
|
[end]
|
|
|
|
Box {
|
|
|
|
Button {
|
|
|
|
icon-name: "non-starred";
|
|
|
|
valign: center;
|
|
|
|
}
|
2024-10-10 10:12:43 +00:00
|
|
|
|
2024-10-12 18:55:15 +00:00
|
|
|
Button {
|
|
|
|
icon-name: bind $mute_button_icon_name (template.mute) as <string>;
|
|
|
|
valign: center;
|
2024-10-12 16:35:42 +00:00
|
|
|
|
2024-10-12 18:55:15 +00:00
|
|
|
clicked => $on_mute_toggle ();
|
|
|
|
}
|
2024-10-10 10:12:43 +00:00
|
|
|
|
2024-10-12 18:55:15 +00:00
|
|
|
Scale {
|
|
|
|
name: "volume-scale";
|
|
|
|
orientation: horizontal;
|
|
|
|
width-request: 130;
|
2024-10-10 10:12:43 +00:00
|
|
|
|
2024-10-12 18:55:15 +00:00
|
|
|
adjustment: Adjustment {
|
|
|
|
lower: 0.0;
|
|
|
|
value: bind template.volume bidirectional;
|
|
|
|
upper: 1.0;
|
|
|
|
};
|
|
|
|
}
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|