oh my fucking godj ust comment it out for now

This commit is contained in:
Erica Z 2024-10-13 16:04:59 +00:00
parent dd0536e5dd
commit 7268b1bacf
3 changed files with 21 additions and 15 deletions

View file

@ -101,10 +101,6 @@ class Playbin : Object {
bus.message["stream-start"].connect ((message) => {
this.stream_counter += 1;
int64 new_duration;
assert (this.playbin.query_duration (Gst.Format.TIME, out new_duration));
this.duration = new_duration;
if (notify_next_transition) {
this.song_transition ((string) this.playbin.current_uri);
} else {
@ -112,6 +108,12 @@ class Playbin : Object {
}
});
bus.message["async-done"].connect ((message) => {
int64 new_duration;
assert (this.playbin.query_duration (Gst.Format.TIME, out new_duration));
this.duration = new_duration;
});
bus.message["eos"].connect ((message) => {
assert (notify_next_transition);
this.playback_finished ();

View file

@ -18,11 +18,11 @@ template $UiPlayQueue: Adw.NavigationPage {
ColumnView view {
styles [ "data-table" ]
ColumnViewColumn {
factory: SignalListItemFactory {
setup => $on_delete_cell_setup ();
};
}
//ColumnViewColumn {
// factory: SignalListItemFactory {
// setup => $on_delete_cell_setup ();
// };
//}
ColumnViewColumn {
title: _("Title");
@ -59,4 +59,3 @@ template $UiPlayQueue: Adw.NavigationPage {
}
}
}

View file

@ -74,9 +74,14 @@ class Ui.PlayQueueStore : Object, ListModel, Gtk.SelectionModel {
this.playing_index = position;
if (previous < this.inner.get_n_items ()) {
this.selection_changed (previous, 1);
if (previous < position) {
this.selection_changed (previous, position-previous+1);
} else if (previous > position) {
this.selection_changed (position, previous-position+1);
}
} else {
this.selection_changed (position, 1);
}
this.selection_changed (position, 1);
this.begin_playback ((Song) this.inner.get_item (this.playing_index));
this.prepare_next ((Song) this.inner.get_item (this.playing_index+1));
@ -168,14 +173,14 @@ public class Ui.PlayQueue : Adw.NavigationPage {
this.store.select_item (this.store.playing_index-1, true);
}
}
/*
[GtkCallback] private void on_delete_cell_setup (Object object) {
var cell = (Gtk.ColumnViewCell) object;
var button = new Gtk.Button.from_icon_name ("edit-delete");
button.add_css_class ("flat");
button.clicked.connect (() => {
this.store.inner.remove (cell.position);
//this.store.inner.remove (cell.position);
});
cell.child = button;
}
}*/
}