[banshee: 10/57] Added a bunch of resource options to trackinfo



commit 041079ea920e2ef8e26b993c50cd96fda858cc44
Author: Tobias Arrskog <topfs2 xbmc org>
Date:   Mon Jun 6 17:02:33 2011 +0200

    Added a bunch of resource options to trackinfo

 .../Banshee.UPnPClient/UPnPTrackInfo.cs            |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPTrackInfo.cs b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPTrackInfo.cs
index 5783673..beda097 100644
--- a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPTrackInfo.cs
+++ b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPTrackInfo.cs
@@ -28,6 +28,7 @@
 
 using System;
 using Mono.Unix;
+using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1;
 using Mono.Upnp.Dcp.MediaServer1.ContentDirectory1.AV;
 
 using Hyena;
@@ -54,7 +55,19 @@ namespace Banshee.UPnPClient
                 Genre = track.Genres.Count > 0 ? track.Genres[0] : "";
 
                 if (track.Resources.Count > 0)
-                    Uri = new SafeUri(track.Resources[0].Uri);
+                {
+                    Resource resource = track.Resources[0];
+
+                    BitRate = (int)resource.BitRate.GetValueOrDefault();
+                    BitsPerSample = (int)resource.BitsPerSample.GetValueOrDefault();
+                    Duration = resource.Duration.GetValueOrDefault();
+                    SampleRate = (int)resource.SampleFrequency.GetValueOrDefault();
+                    FileSize = (int)resource.Size.GetValueOrDefault();
+
+                    Uri = new SafeUri(resource.Uri);
+                }
+                else
+                    CanPlay = false;
             }
 
             ExternalId = ++id;



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