Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/jukeboxactivity.py
diff options
context:
space:
mode:
authorManuel Kaufmann <humitos@gmail.com>2012-06-26 19:11:24 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-06-27 15:01:16 (GMT)
commit7e53019d6433f7ed857480baba7d54e41d82fce8 (patch)
treed74ce9e66368ff65448f91d01600ff88ed5e0066 /jukeboxactivity.py
parentad4c9365fa030096f2ac07e3c7c0fdd812d283ed (diff)
Current and total time SL #3714
Added the current and total time of the actual stream in the toolbar and removed the separators to make them fit. Signed-off-by: Manuel Kaufmann <humitos@gmail.com> Reviewed-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'jukeboxactivity.py')
-rw-r--r--jukeboxactivity.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/jukeboxactivity.py b/jukeboxactivity.py
index a16fbd1..952a998 100644
--- a/jukeboxactivity.py
+++ b/jukeboxactivity.py
@@ -124,11 +124,6 @@ class JukeboxActivity(activity.Activity):
self.control = Control(toolbar_box.toolbar, self)
- separator = gtk.SeparatorToolItem()
- separator.props.draw = False
- separator.set_expand(True)
- toolbar_box.toolbar.insert(separator, -1)
-
toolbar_box.toolbar.insert(StopButton(self), -1)
self.set_toolbar_box(toolbar_box)
@@ -597,6 +592,18 @@ class JukeboxActivity(activity.Activity):
value = self.p_position * 100.0 / self.p_duration
self.control.adjustment.set_value(value)
+ # Update the current time
+ seconds = self.p_position * 10 ** -9
+ time = '%2d:%02d' % (int(seconds / 60), int(seconds % 60))
+ self.control.current_time_label.set_text(time)
+
+ # FIXME: this should be updated just once when the file starts
+ # the first time
+ if self.p_duration != gst.CLOCK_TIME_NONE:
+ seconds = self.p_duration * 10 ** -9
+ time = '%2d:%02d' % (int(seconds / 60), int(seconds % 60))
+ self.control.total_time_label.set_text(time)
+
return True
def _erase_playlist_entry_clicked_cb(self, widget):