aboutsummaryrefslogtreecommitdiff
path: root/src/mpris-controller.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-07-15 13:23:52 +0100
committerConor Curran <conor.curran@canonical.com>2010-07-15 13:23:52 +0100
commit6bab9d75b22aa21ed27e4961e6dbf4bbcdd2e94c (patch)
tree480a4f12b9434a404bbcf8afc8a72b32ae6f856e /src/mpris-controller.vala
parent4823b3c35b8e8c1334ad947286abf0d88b6de701 (diff)
downloadayatana-indicator-sound-6bab9d75b22aa21ed27e4961e6dbf4bbcdd2e94c.tar.gz
ayatana-indicator-sound-6bab9d75b22aa21ed27e4961e6dbf4bbcdd2e94c.tar.bz2
ayatana-indicator-sound-6bab9d75b22aa21ed27e4961e6dbf4bbcdd2e94c.zip
label text updating according to position and duration and scrub bar positioning now working
Diffstat (limited to 'src/mpris-controller.vala')
-rw-r--r--src/mpris-controller.vala17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mpris-controller.vala b/src/mpris-controller.vala
index f40614c..5e4dce2 100644
--- a/src/mpris-controller.vala
+++ b/src/mpris-controller.vala
@@ -50,23 +50,38 @@ public class MprisController : GLib.Object
this.mpris_player.TrackChange += onTrackChange;
this.mpris_player.StatusChange += onStatusChange;
+ initial_update();
+ }
+ private void initial_update()
+ {
status st = this.mpris_player.GetStatus();
int play_state = st.playback;
debug("GetStatusChange - play state %i", play_state);
(this.owner.custom_items[PlayerController.widget_order.TRANSPORT] as TransportMenuitem).change_play_state(play_state);
this.owner.custom_items[PlayerController.widget_order.METADATA].update(this.mpris_player.GetMetadata(),
MetadataMenuitem.attributes_format());
+ 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());
}
-
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());
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());
}
public void transport_event(TransportMenuitem.action command)