From 70dcd571948ed3a805ccff70f42c4fa622008d3c Mon Sep 17 00:00:00 2001 From: Erica Z Date: Tue, 15 Oct 2024 22:48:41 +0200 Subject: [PATCH] buttons --- src/playbin.vala | 5 +++-- src/ui/window.vala | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/playbin.vala b/src/playbin.vala index deca3b9..1b40397 100644 --- a/src/playbin.vala +++ b/src/playbin.vala @@ -36,7 +36,7 @@ class Playbin : Object { public signal void now_playing (uint index, Song song, int64 duration); // FIXME this should be synced with the selection model, right?? - private uint playing_index; + public uint playing_index { get; private set; } private bool next_gapless; @@ -182,7 +182,8 @@ class Playbin : Object { } } else { // edge case - assert (false); // TODO + // just flush everything and pray next stream-start is fine + this.begin_playback (this.playing_index); } }); diff --git a/src/ui/window.vala b/src/ui/window.vala index 3419a83..a187846 100644 --- a/src/ui/window.vala +++ b/src/ui/window.vala @@ -189,11 +189,13 @@ class Ui.Window : Adw.ApplicationWindow { } [GtkCallback] private void on_skip_forward_clicked () { - //this.play_queue.skip_forward (); + this.playbin.begin_playback (this.playbin.playing_index+1); } [GtkCallback] private void on_skip_backward_clicked () { - //this.play_queue.skip_backward (); + if (this.playbin.playing_index > 0) { + this.playbin.begin_playback (this.playbin.playing_index-1); + } } [GtkCallback] private void show_setup_dialog () {