[longomatch] Add a new getter for the media file description



commit 2463e31458a91e8849a98561f1e312799d4e180e
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu Mar 20 17:29:30 2014 +0100

    Add a new getter for the media file description

 LongoMatch.Core/Store/MediaFile.cs |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch.Core/Store/MediaFile.cs b/LongoMatch.Core/Store/MediaFile.cs
index 1c097d5..2711dda 100644
--- a/LongoMatch.Core/Store/MediaFile.cs
+++ b/LongoMatch.Core/Store/MediaFile.cs
@@ -22,6 +22,7 @@ using System;
 using Mono.Unix;
 
 using LongoMatch.Common;
+using Newtonsoft.Json;
 
 namespace LongoMatch.Store
 {
@@ -196,6 +197,21 @@ namespace LongoMatch.Store
                        }
                }
                
+               [JsonIgnore]
+               public string Description {
+                       get {
+                               string desc = String.Format ("<b>File path</b>: {0}\n", FilePath);
+                               desc += String.Format ("<b>Format</b>: {0}x{1} @ {2}fps\n", VideoWidth,
+                                                      VideoHeight, Fps);
+                               desc += String.Format ("<b>Duration</b>: {0}\n",
+                                                      new Time {MSeconds=(int)Length}.ToSecondsString());
+                               desc += String.Format ("<b>Video Codec</b>: {0}\n", VideoCodec);
+                               desc += String.Format ("<b>Audio Codec</b>: {0}\n", AudioCodec);
+                               desc += String.Format ("<b>Container</b>: {0}\n", Container);
+                               return desc;
+                       }
+               }
+
                public uint GetFrames() {
                        return (uint)(Fps*Length/1000);
                }


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