aboutsummaryrefslogtreecommitdiff
path: root/src/mpris-controller.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-08-11 20:04:04 +0100
committerConor Curran <conor.curran@canonical.com>2010-08-11 20:04:04 +0100
commitb63691637ebc766e90c0da44e76cc7b9cc49872e (patch)
tree2c745c8bfa45f3d45402ce5e21308f5391e11de2 /src/mpris-controller.vala
parent9244bd84d655fae8bbb2772d4aac1550b57a7c1c (diff)
downloadayatana-indicator-sound-b63691637ebc766e90c0da44e76cc7b9cc49872e.tar.gz
ayatana-indicator-sound-b63691637ebc766e90c0da44e76cc7b9cc49872e.tar.bz2
ayatana-indicator-sound-b63691637ebc766e90c0da44e76cc7b9cc49872e.zip
mpris2 working for now, but its all going to change again
Diffstat (limited to 'src/mpris-controller.vala')
-rw-r--r--src/mpris-controller.vala16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mpris-controller.vala b/src/mpris-controller.vala
index 8ecd20a..c70c6d5 100644
--- a/src/mpris-controller.vala
+++ b/src/mpris-controller.vala
@@ -124,17 +124,23 @@ public class MprisController : GLib.Object
private void onTrackChange(dynamic DBus.Object mpris_client, HashTable<string,Value?> ht)
{
debug("onTrackChange");
+
this.owner.custom_items[PlayerController.widget_order.METADATA].reset(MetadataMenuitem.attributes_format());
this.owner.custom_items[PlayerController.widget_order.SCRUB].reset(ScrubMenuitem.attributes_format());
+ HashTable<string, Value?> status_hash = new HashTable<string, Value?>(str_hash, str_equal);
+
+ status st = this.mpris_player.GetStatus();
+ int play_state = st.playback;
+ debug("GetStatusChange, about to update scrub with play state - %i", play_state);
+
+ ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem;
+ scrub.update_playstate(play_state);
+ this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris_player.GetMetadata(),
+ ScrubMenuitem.attributes_format());
this.owner.custom_items[PlayerController.widget_order.METADATA].update(ht,
MetadataMenuitem.attributes_format());
debug("about to update the duration on the scrub bar");
- this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.mpris_player.GetMetadata(),
- ScrubMenuitem.attributes_format());
// temporary fix
- ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem;
scrub.update_position(this.mpris_player.PositionGet());
}
-
-
}