Changes
1 changed files (+39/-15)
-
-
@@ -54,6 +54,9 @@ private unowned Artwork artwork;private Gee.HashMap<string, ZoneSelectorRow>zone_rows = new Gee.HashMap<string, ZoneSelectorRow>(); private bool is_seeking = false; private int64? next_seek = null; private string? zone_id = null; private Plac.Transport.Zone? zone {
-
@@ -73,6 +76,7 @@ zone_id = value.id;} zone_selected(value); next_seek = null; } }
-
@@ -87,9 +91,42 @@ zone_list_popover.popdown();this.render(); }); seek.set_increments(1, 10); this.render(); } private void dequeue_seek() { var conn = artwork.conn; if (conn == null || next_seek == null || zone == null) { is_seeking = false; return; } var position = next_seek; next_seek = null; conn.seek.begin(zone, position, (obj, res) => { var result = conn.seek.end(res); if (result != OK) { GLib.log("Plac", LEVEL_WARNING, "Failed to seek: %s", result.to_string()); } dequeue_seek(); }); } private void schedule_seek(int64 position) { next_seek = position; if (!is_seeking) { is_seeking = true; dequeue_seek(); } } public void listen(Plac.AsyncConnection conn) { artwork.conn = conn;
-
@@ -146,21 +183,8 @@ });}); seek.change_value.connect((scroll, value) => { var row = zone_rows[zone_id]; if (row == null) { return true; } this.disable_actions(); conn.seek.begin(row.zone, (int64) value, (obj, res) => { var result = conn.seek.end(res); if (result != OK) { GLib.log("Plac", LEVEL_WARNING, "Failed to seek: %s", result.to_string()); } this.enable_actions(); }); return true; schedule_seek((int64) value); return false; }); conn.zones_changed.connect((event) => {
-