[longomatch] Add rate information to timeline and playlist desc Ideally we might want to add some more visual rep



commit 700d143420f8916c0eefa115876cb6d00a4bb1ef
Author: Julien Moutte <julien fluendo com>
Date:   Mon Feb 9 21:33:34 2015 +0100

    Add rate information to timeline and playlist desc
    Ideally we might want to add some more visual representation of the playback rate, that will be for a 
future improvement.

 .../Store/Playlists/PlaylistPlayElement.cs         |   12 +++++++++++-
 LongoMatch.Core/Store/TimeNode.cs                  |    6 ++++++
 LongoMatch.Core/Store/TimelineEvent.cs             |    6 +++++-
 3 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/LongoMatch.Core/Store/Playlists/PlaylistPlayElement.cs 
b/LongoMatch.Core/Store/Playlists/PlaylistPlayElement.cs
index dea3ee4..e6a389b 100644
--- a/LongoMatch.Core/Store/Playlists/PlaylistPlayElement.cs
+++ b/LongoMatch.Core/Store/Playlists/PlaylistPlayElement.cs
@@ -63,6 +63,12 @@ namespace LongoMatch.Core.Store.Playlists
                        set;
                }
 
+               public string RateString {
+                       get {
+                               return String.Format ("{0}X", Rate);
+                       }
+               }
+
                public MediaFileSet FileSet {
                        get;
                        set;
@@ -76,7 +82,11 @@ namespace LongoMatch.Core.Store.Playlists
                [JsonIgnore]
                public string Description {
                        get {
-                               return Title + " " + Play.Start.ToSecondsString () + " " + 
Play.Stop.ToSecondsString ();
+                               if (Rate != 1) {
+                                       return Title + " " + Play.Start.ToSecondsString () + " " + 
Play.Stop.ToSecondsString () + " (" + RateString + ")";
+                               } else {
+                                       return Title + " " + Play.Start.ToSecondsString () + " " + 
Play.Stop.ToSecondsString ();
+                               }
                        }
                }
 
diff --git a/LongoMatch.Core/Store/TimeNode.cs b/LongoMatch.Core/Store/TimeNode.cs
index 5a8bc63..8ad53a2 100644
--- a/LongoMatch.Core/Store/TimeNode.cs
+++ b/LongoMatch.Core/Store/TimeNode.cs
@@ -110,6 +110,12 @@ namespace LongoMatch.Core.Store
                        set;
                }
 
+               public string RateString {
+                       get {
+                               return String.Format ("{0}X", Rate);
+                       }
+               }
+
                public void Move (Time diff)
                {
                        if (start != null) {
diff --git a/LongoMatch.Core/Store/TimelineEvent.cs b/LongoMatch.Core/Store/TimelineEvent.cs
index 298f2f4..ad5edbb 100644
--- a/LongoMatch.Core/Store/TimelineEvent.cs
+++ b/LongoMatch.Core/Store/TimelineEvent.cs
@@ -173,7 +173,11 @@ namespace LongoMatch.Core.Store
                public string TimesDesription ()
                {
                        if (Start != null && Stop != null) {
-                               return Start.ToMSecondsString () + " - " + Stop.ToMSecondsString ();
+                               if (Rate != 1) {
+                                       return Start.ToMSecondsString () + " - " + Stop.ToMSecondsString () + 
" (" + RateString + ")";
+                               } else {
+                                       return Start.ToMSecondsString () + " - " + Stop.ToMSecondsString ();
+                               }
                        } else if (EventType != null) {
                                return EventTime.ToMSecondsString ();
                        } else {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]