[longomatch] Implement Framerate{Up|Down} in the controller
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Implement Framerate{Up|Down} in the controller
- Date: Tue, 31 Mar 2015 17:31:43 +0000 (UTC)
commit 66d6d6fdeb901b78c7f1cada5fc9545e650d282e
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Mon Mar 23 14:53:57 2015 +0100
Implement Framerate{Up|Down} in the controller
LongoMatch.Services/Services/PlayerController.cs | 39 ++++++++++++++++++----
1 files changed, 32 insertions(+), 7 deletions(-)
---
diff --git a/LongoMatch.Services/Services/PlayerController.cs
b/LongoMatch.Services/Services/PlayerController.cs
index 84c1694..875545a 100644
--- a/LongoMatch.Services/Services/PlayerController.cs
+++ b/LongoMatch.Services/Services/PlayerController.cs
@@ -40,6 +40,7 @@ namespace LongoMatch.Services
public event PARChangedHandler PARChangedEvent;
const int TIMEOUT_MS = 20;
+ const int SCALE_FPS = 25;
IPlayer player;
TimelineEvent loadedEvent;
@@ -48,6 +49,7 @@ namespace LongoMatch.Services
Time streamLenght, videoTS, imageLoadedTS;
bool readyToSeek, stillimageLoaded, ready, delayedOpen;
+ double rate;
MediaFile activeFile;
Seeker seeker;
Segment loadedSegment;
@@ -124,7 +126,12 @@ namespace LongoMatch.Services
public double Rate {
set {
+ rate = value;
player.Rate = value;
+ Log.Debug ("Rate set to " + value);
+ }
+ get {
+ return rate;
}
}
@@ -365,23 +372,41 @@ namespace LongoMatch.Services
public void FramerateUp ()
{
- Log.Debug ("Framerate up");
if (!StillImageLoaded) {
+ float rate;
+
EmitLoadDrawings (null);
+ rate = (float)Rate;
+ if (rate >= 5) {
+ return;
+ }
+ Log.Debug ("Framerate up");
+ if (rate < 1) {
+ SetRate (rate + (float)1 / SCALE_FPS);
+ } else {
+ SetRate (rate + 1);
+ }
}
-
- /* FIXME */
- //vscale1.Adjustment.Value += vscale1.Adjustment.StepIncrement;
}
public void FramerateDown ()
{
- Log.Debug ("Framerate down");
+
if (!StillImageLoaded) {
+ float rate;
+
EmitLoadDrawings (null);
+ rate = (float)Rate;
+ if (rate <= (float)1 / SCALE_FPS) {
+ return;
+ }
+ Log.Debug ("Framerate down");
+ if (rate > 1) {
+ SetRate (rate - 1);
+ } else {
+ SetRate (rate - (float)1 / SCALE_FPS);
+ }
}
- /* FIXME */
- //vscale1.Adjustment.Value -= vscale1.Adjustment.StepIncrement;
}
public void Expose ()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]