[rygel] external: Utilize optional MediaItem properties
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Subject: [rygel] external: Utilize optional MediaItem properties
- Date: Sun, 5 Jul 2009 11:50:18 +0000 (UTC)
commit 609b78b75fac6de6b72d490f73b60418b3211cc7
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Sun Jul 5 12:39:14 2009 +0300
external: Utilize optional MediaItem properties
Now we utilize all MediaItem properties except for:
* Genre
* Thumbnail
* AlbumArt
src/plugins/external/rygel-external-item.vala | 78 +++++++++++++++++++++++--
1 files changed, 73 insertions(+), 5 deletions(-)
---
diff --git a/src/plugins/external/rygel-external-item.vala b/src/plugins/external/rygel-external-item.vala
index 92c9599..834a5c5 100644
--- a/src/plugins/external/rygel-external-item.vala
+++ b/src/plugins/external/rygel-external-item.vala
@@ -71,11 +71,6 @@ public class Rygel.ExternalItem : MediaItem {
value = item_props.lookup ("MIMEType");
this.mime_type = value.get_string ();
- value = item_props.lookup ("DLNAProfile");
- if (value != null) {
- this.dlna_profile = value.get_string ();
- }
-
value = item_props.lookup ("URLs");
weak string[] uris = (string[]) value.get_boxed ();
@@ -84,6 +79,79 @@ public class Rygel.ExternalItem : MediaItem {
this.uris.add (tmp);
}
+
+ // Optional properties
+ //
+ // FIXME: Handle:
+ //
+ // MeidaItem1.Genre
+ // MediaItem1.Thumbnail
+ // MediaItem1.AlbumArt
+ //
+
+ value = item_props.lookup ("DLNAProfile");
+ if (value != null) {
+ this.dlna_profile = value.get_string ();
+ }
+
+ value = item_props.lookup ("Size");
+ if (value != null) {
+ this.size = value.get_int ();
+ }
+
+ value = item_props.lookup ("Artist");
+ if (value != null) {
+ this.author = value.get_string ();
+ }
+
+ value = item_props.lookup ("Album");
+ if (value != null) {
+ this.album = value.get_string ();
+ }
+
+ value = item_props.lookup ("Date");
+ if (value != null) {
+ this.date = value.get_string ();
+ }
+
+ // Properties specific to video and audio/music
+
+ value = item_props.lookup ("Duration");
+ if (value != null) {
+ this.duration = value.get_int ();
+ }
+
+ value = item_props.lookup ("Bitrate");
+ if (value != null) {
+ this.bitrate = value.get_int ();
+ }
+
+ value = item_props.lookup ("SampleRate");
+ if (value != null) {
+ this.sample_freq = value.get_int ();
+ }
+
+ value = item_props.lookup ("BitsPerSample");
+ if (value != null) {
+ this.bits_per_sample = value.get_int ();
+ }
+
+ // Properties specific to video and image
+
+ value = item_props.lookup ("Width");
+ if (value != null) {
+ this.width = value.get_int ();
+ }
+
+ value = item_props.lookup ("Height");
+ if (value != null) {
+ this.height = value.get_int ();
+ }
+
+ value = item_props.lookup ("ColorDepth");
+ if (value != null) {
+ this.color_depth = value.get_int ();
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]