1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
|
From 501fb90b02537c45837526677220c67b8d8eb3f3 Mon Sep 17 00:00:00 2001
From: Alasdair Campbell <alcoheca@gmail.com>
Date: Sun, 7 Oct 2012 10:46:54 +0100
Subject: [PATCH 10/24] platinum: use PersonRole for directors. Also fixes
::FromDidl for authors, actors, directors -
previously duplicate entries were present
---
.../Platinum/Source/Devices/MediaServer/PltDidl.h | 40 ++++++++++++----------
.../Source/Devices/MediaServer/PltMediaItem.cpp | 12 +++++++
.../Source/Devices/MediaServer/PltMediaItem.h | 2 +-
3 files changed, 34 insertions(+), 20 deletions(-)
diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
index f6eaf14..c50d450 100644
--- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
+++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
@@ -61,28 +61,29 @@
#define PLT_FILTER_MASK_ORIGINALTRACK 0x00000100
#define PLT_FILTER_MASK_ACTOR 0x00000200
#define PLT_FILTER_MASK_AUTHOR 0x00000400
-#define PLT_FILTER_MASK_DATE 0x00000800
-#define PLT_FILTER_MASK_PROGRAMTITLE 0x00001000
-#define PLT_FILTER_MASK_SERIESTITLE 0x00002000
-#define PLT_FILTER_MASK_EPISODE 0x00004000
-#define PLT_FILTER_MASK_TITLE 0x00008000
+#define PLT_FILTER_MASK_DIRECTOR 0x00000800
+#define PLT_FILTER_MASK_DATE 0x00001000
+#define PLT_FILTER_MASK_PROGRAMTITLE 0x00002000
+#define PLT_FILTER_MASK_SERIESTITLE 0x00004000
+#define PLT_FILTER_MASK_EPISODE 0x00008000
+#define PLT_FILTER_MASK_TITLE 0x00010000
-#define PLT_FILTER_MASK_RES 0x00010000
-#define PLT_FILTER_MASK_RES_DURATION 0x00020000
-#define PLT_FILTER_MASK_RES_SIZE 0x00040000
-#define PLT_FILTER_MASK_RES_PROTECTION 0x00080000
-#define PLT_FILTER_MASK_RES_RESOLUTION 0x00100000
-#define PLT_FILTER_MASK_RES_BITRATE 0x00200000
-#define PLT_FILTER_MASK_RES_BITSPERSAMPLE 0x00400000
-#define PLT_FILTER_MASK_RES_NRAUDIOCHANNELS 0x00800000
-#define PLT_FILTER_MASK_RES_SAMPLEFREQUENCY 0x01000000
+#define PLT_FILTER_MASK_RES 0x00020000
+#define PLT_FILTER_MASK_RES_DURATION 0x00040000
+#define PLT_FILTER_MASK_RES_SIZE 0x00080000
+#define PLT_FILTER_MASK_RES_PROTECTION 0x00100000
+#define PLT_FILTER_MASK_RES_RESOLUTION 0x00200000
+#define PLT_FILTER_MASK_RES_BITRATE 0x00400000
+#define PLT_FILTER_MASK_RES_BITSPERSAMPLE 0x00800000
+#define PLT_FILTER_MASK_RES_NRAUDIOCHANNELS 0x01000000
+#define PLT_FILTER_MASK_RES_SAMPLEFREQUENCY 0x02000000
-#define PLT_FILTER_MASK_LONGDESCRIPTION 0x02000000
-#define PLT_FILTER_MASK_ICON 0x04000000
+#define PLT_FILTER_MASK_LONGDESCRIPTION 0x04000000
+#define PLT_FILTER_MASK_ICON 0x08000000
-#define PLT_FILTER_MASK_TOC 0x02000000
-#define PLT_FILTER_MASK_SEARCHCLASS 0x04000000
-#define PLT_FILTER_MASK_REFID 0x08000000
+#define PLT_FILTER_MASK_TOC 0x10000000
+#define PLT_FILTER_MASK_SEARCHCLASS 0x20000000
+#define PLT_FILTER_MASK_REFID 0x40000000
#define PLT_FILTER_FIELD_TITLE "dc:title"
#define PLT_FILTER_FIELD_CREATOR "dc:creator"
@@ -90,6 +91,7 @@
#define PLT_FILTER_FIELD_ARTIST "upnp:artist"
#define PLT_FILTER_FIELD_ACTOR "upnp:actor"
#define PLT_FILTER_FIELD_AUTHOR "upnp:author"
+#define PLT_FILTER_FIELD_DIRECTOR "upnp:director"
#define PLT_FILTER_FIELD_ALBUM "upnp:album"
#define PLT_FILTER_FIELD_GENRE "upnp:genre"
#define PLT_FILTER_FIELD_ALBUMARTURI "upnp:albumArtURI"
diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
index 3ec7696..d46d1a5 100644
--- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
+++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
@@ -253,6 +253,11 @@ PLT_MediaObject::ToDidl(NPT_UInt32 mask, NPT_String& didl)
m_People.authors.ToDidl(didl, "author");
}
+ // director
+ if (mask & PLT_FILTER_MASK_DIRECTOR) {
+ m_People.directors.ToDidl(didl, "director");
+ }
+
// album
if ((mask & PLT_FILTER_MASK_ALBUM) && !m_Affiliation.album.IsEmpty()) {
didl += "<upnp:album>";
@@ -488,15 +493,22 @@ PLT_MediaObject::FromDidl(NPT_XmlElementNode* entry)
m_Title = m_Title.SubString(0, 256);
m_ObjectClass.type = m_ObjectClass.type.SubString(0, 256);
+ children.Clear();
PLT_XmlHelper::GetChildren(entry, children, "artist", didl_namespace_upnp);
m_People.artists.FromDidl(children);
+ children.Clear();
PLT_XmlHelper::GetChildren(entry, children, "author", didl_namespace_upnp);
m_People.authors.FromDidl(children);
+ children.Clear();
PLT_XmlHelper::GetChildren(entry, children, "actor", didl_namespace_upnp);
m_People.actors.FromDidl(children);
+ children.Clear();
+ PLT_XmlHelper::GetChildren(entry, children, "director", didl_namespace_upnp);
+ m_People.directors.FromDidl(children);
+
PLT_XmlHelper::GetChildText(entry, "album", m_Affiliation.album, didl_namespace_upnp, 256);
PLT_XmlHelper::GetChildText(entry, "programTitle", m_Recorded.program_title, didl_namespace_upnp);
PLT_XmlHelper::GetChildText(entry, "seriesTitle", m_Recorded.series_title, didl_namespace_upnp);
diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
index cc3bdf9..fe04f34 100644
--- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
+++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
@@ -91,7 +91,7 @@ typedef struct {
PLT_PersonRoles actors;
PLT_PersonRoles authors;
NPT_String producer; //TODO: can be multiple
- NPT_String director; //TODO: can be multiple
+ PLT_PersonRoles directors;
NPT_String publisher; //TODO: can be multiple
NPT_String contributor; // should match m_Creator (dc:creator) //TODO: can be multiple
} PLT_PeopleInfo;
--
1.7.11.msysgit.0
|