[longomatch] Update time label with current seek pos
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Update time label with current seek pos
- Date: Mon, 4 Aug 2014 11:54:02 +0000 (UTC)
commit 62b5e6502a273f6f60493b1c659b17b1e5e67b75
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Mon Aug 4 13:47:55 2014 +0200
Update time label with current seek pos
LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs b/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
index b627b18..e9fbe16 100644
--- a/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
@@ -414,17 +414,21 @@ namespace LongoMatch.Gui
}
void SeekFromTimescale (double pos) {
+ Time seekPos, duration;
+ SeekType seekType;
+
if(SegmentLoaded) {
- Time duration = segment.Stop - segment.Start;
- Time seekPos = segment.Start + duration * pos;
- seeker.Seek (SeekType.Accurate, seekPos);
- timelabel.Text = seekPos.ToMSecondsString() + "/" +
duration.ToMSecondsString();
+ duration = segment.Stop - segment.Start;
+ seekPos = segment.Start + duration * pos;
+ seekType = SeekType.Accurate;
}
else {
- seeker.Seek (SeekType.Keyframe, length * pos);
- timelabel.Text = player.CurrentTime.ToMSecondsString () + "/" +
- length.ToMSecondsString();
+ duration = length;
+ seekPos = length * pos;
+ seekType = SeekType.Keyframe;
}
+ seeker.Seek (seekType, seekPos);
+ timelabel.Text = seekPos.ToMSecondsString() + "/" + duration.ToMSecondsString();
}
void CreatePlayer ()
@@ -453,7 +457,7 @@ namespace LongoMatch.Gui
}
}
- void StateChanged (bool playing)
+ void DoStateChanged (bool playing)
{
if (playing) {
ReconfigureTimeout (20);
@@ -494,7 +498,7 @@ namespace LongoMatch.Gui
void OnStateChanged(bool playing) {
Application.Invoke (delegate {
- StateChanged (playing);});
+ DoStateChanged (playing);});
}
void OnReadyToSeek() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]