Platinum: switch to NPT_UInt64 for bitmask flags
authorAlasdair Campbell <alcoheca@gmail.com>
Fri, 26 Oct 2012 11:30:04 +0000 (12:30 +0100)
committerAlasdair Campbell <alcoheca@gmail.com>
Fri, 26 Oct 2012 12:01:26 +0000 (13:01 +0100)
lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h

index 6ad2ec4..6f72dda 100644 (file)
@@ -56,7 +56,7 @@ const char* didl_namespace_dlna = "urn:schemas-dlna-org:metadata-1-0/";
 /*----------------------------------------------------------------------
 |   PLT_Didl::ConvertFilterToMask
 +---------------------------------------------------------------------*/
-NPT_UInt32 
+NPT_UInt64
 PLT_Didl::ConvertFilterToMask(const NPT_String& filter)
 {
     // easy out
@@ -66,7 +66,7 @@ PLT_Didl::ConvertFilterToMask(const NPT_String& filter)
     // a given DIDL property (or set of properties).  
     // These fields are or start with: upnp:, @, res@, res, dc:, container@
 
-    NPT_UInt32  mask = 0;
+    NPT_UInt64  mask = 0;
     const char* s = filter;
     int         i = 0;
 
@@ -301,7 +301,7 @@ PLT_Didl::ParseTimeStamp(const NPT_String& timestamp, NPT_UInt32& seconds)
 NPT_Result
 PLT_Didl::ToDidl(PLT_MediaObject& object, const NPT_String& filter, NPT_String& didl)
 {
-    NPT_UInt32 mask = ConvertFilterToMask(filter);
+    NPT_UInt64 mask = ConvertFilterToMask(filter);
 
     // Allocate enough space for the didl
     didl.Reserve(2048);
index 8d9704f..29ce9ca 100644 (file)
 /*----------------------------------------------------------------------
 |   constants
 +---------------------------------------------------------------------*/
-#define PLT_FILTER_MASK_ALL                         0xFFFFFFFF
+#define PLT_FILTER_MASK_ALL                         0xFFFFFFFFFFFFFFFF
 
-#define PLT_FILTER_MASK_CREATOR                     0x00000001
-#define PLT_FILTER_MASK_ARTIST                      0x00000002
-#define PLT_FILTER_MASK_ALBUM                       0x00000004
-#define PLT_FILTER_MASK_GENRE                       0x00000008
-#define PLT_FILTER_MASK_ALBUMARTURI                 0x00000010
-#define PLT_FILTER_MASK_DESCRIPTION                 0x00000020
-#define PLT_FILTER_MASK_SEARCHABLE                  0x00000040
-#define PLT_FILTER_MASK_CHILDCOUNT                  0x00000080
-#define PLT_FILTER_MASK_ORIGINALTRACK               0x00000100
-#define PLT_FILTER_MASK_ACTOR                       0x00000200
-#define PLT_FILTER_MASK_AUTHOR                      0x00000400
-#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_CREATOR                     0x0000000000000001
+#define PLT_FILTER_MASK_ARTIST                      0x0000000000000002
+#define PLT_FILTER_MASK_ALBUM                       0x0000000000000004
+#define PLT_FILTER_MASK_GENRE                       0x0000000000000008
+#define PLT_FILTER_MASK_ALBUMARTURI                 0x0000000000000010
+#define PLT_FILTER_MASK_DESCRIPTION                 0x0000000000000020
+#define PLT_FILTER_MASK_SEARCHABLE                  0x0000000000000040
+#define PLT_FILTER_MASK_CHILDCOUNT                  0x0000000000000080
+#define PLT_FILTER_MASK_ORIGINALTRACK               0x0000000000000100
+#define PLT_FILTER_MASK_ACTOR                       0x0000000000000200
+#define PLT_FILTER_MASK_AUTHOR                      0x0000000000000400
+#define PLT_FILTER_MASK_DIRECTOR                    0x0000000000000800
+#define PLT_FILTER_MASK_DATE                        0x0000000000001000
+#define PLT_FILTER_MASK_PROGRAMTITLE                0x0000000000002000
+#define PLT_FILTER_MASK_SERIESTITLE                 0x0000000000004000
+#define PLT_FILTER_MASK_EPISODE                     0x0000000000008000
+#define PLT_FILTER_MASK_TITLE                       0x0000000000010000
 
-#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_RES                         0x0000000000020000
+#define PLT_FILTER_MASK_RES_DURATION                0x0000000000040000
+#define PLT_FILTER_MASK_RES_SIZE                    0x0000000000080000
+#define PLT_FILTER_MASK_RES_PROTECTION              0x0000000000100000
+#define PLT_FILTER_MASK_RES_RESOLUTION              0x0000000000200000
+#define PLT_FILTER_MASK_RES_BITRATE                 0x0000000000400000
+#define PLT_FILTER_MASK_RES_BITSPERSAMPLE           0x0000000000800000
+#define PLT_FILTER_MASK_RES_NRAUDIOCHANNELS         0x0000000001000000
+#define PLT_FILTER_MASK_RES_SAMPLEFREQUENCY         0x0000000002000000
 
-#define PLT_FILTER_MASK_LONGDESCRIPTION             0x04000000
-#define PLT_FILTER_MASK_ICON                        0x08000000
-#define PLT_FILTER_MASK_RATING                      0x10000000
+#define PLT_FILTER_MASK_LONGDESCRIPTION             0x0000000004000000
+#define PLT_FILTER_MASK_ICON                        0x0000000008000000
+#define PLT_FILTER_MASK_RATING                      0x0000000010000000
 
-#define PLT_FILTER_MASK_TOC                         0x20000000
-#define PLT_FILTER_MASK_SEARCHCLASS                 0x40000000
-#define PLT_FILTER_MASK_REFID                       0x80000000
+#define PLT_FILTER_MASK_TOC                         0x0000000020000000
+#define PLT_FILTER_MASK_SEARCHCLASS                 0x0000000040000000
+#define PLT_FILTER_MASK_REFID                       0x0000000080000000
 
 #define PLT_FILTER_FIELD_TITLE                      "dc:title"
 #define PLT_FILTER_FIELD_CREATOR                    "dc:creator"
@@ -156,7 +156,7 @@ public:
         return res;
     }
 
-    static NPT_UInt32  ConvertFilterToMask(const NPT_String& filter);
+    static NPT_UInt64  ConvertFilterToMask(const NPT_String& filter);
 };
 
 #endif /* _PLT_DIDL_H_ */
index 01cf13f..a3561fd 100644 (file)
@@ -215,7 +215,7 @@ PLT_MediaObject::ToDidl(const NPT_String& filter, NPT_String& didl)
 |   PLT_MediaObject::ToDidl
 +---------------------------------------------------------------------*/
 NPT_Result
-PLT_MediaObject::ToDidl(NPT_UInt32 mask, NPT_String& didl)
+PLT_MediaObject::ToDidl(NPT_UInt64 mask, NPT_String& didl)
 {
     // title is required
     didl += "<dc:title>";
@@ -683,7 +683,7 @@ PLT_MediaItem::ToDidl(const NPT_String& filter, NPT_String& didl)
 |   PLT_MediaItem::ToDidl
 +---------------------------------------------------------------------*/
 NPT_Result
-PLT_MediaItem::ToDidl(NPT_UInt32 mask, NPT_String& didl)
+PLT_MediaItem::ToDidl(NPT_UInt64 mask, NPT_String& didl)
 {
     didl += "<item id=\"";
 
@@ -774,7 +774,7 @@ PLT_MediaContainer::ToDidl(const NPT_String& filter, NPT_String& didl)
 |   PLT_MediaContainer::ToDidl
 +---------------------------------------------------------------------*/
 NPT_Result
-PLT_MediaContainer::ToDidl(NPT_UInt32 mask, NPT_String& didl)
+PLT_MediaContainer::ToDidl(NPT_UInt64 mask, NPT_String& didl)
 {
        // container id property
     didl += "<container id=\"";
index 84704b1..6cd597d 100644 (file)
@@ -196,7 +196,7 @@ public:
 
     virtual NPT_Result Reset();
     virtual NPT_Result ToDidl(const NPT_String& filter, NPT_String& didl);
-    virtual NPT_Result ToDidl(NPT_UInt32 mask, NPT_String& didl);
+    virtual NPT_Result ToDidl(NPT_UInt64 mask, NPT_String& didl);
     virtual NPT_Result FromDidl(NPT_XmlElementNode* entry);
 
 public:
@@ -248,7 +248,7 @@ public:
 
     // PLT_MediaObject methods
     NPT_Result ToDidl(const NPT_String& filter, NPT_String& didl);
-    NPT_Result ToDidl(NPT_UInt32 mask, NPT_String& didl);
+    NPT_Result ToDidl(NPT_UInt64 mask, NPT_String& didl);
     NPT_Result FromDidl(NPT_XmlElementNode* entry);
 };
 
@@ -271,7 +271,7 @@ public:
     // PLT_MediaObject methods
     NPT_Result Reset();
     NPT_Result ToDidl(const NPT_String& filter, NPT_String& didl);
-    NPT_Result ToDidl(NPT_UInt32 mask, NPT_String& didl);
+    NPT_Result ToDidl(NPT_UInt64 mask, NPT_String& didl);
     NPT_Result FromDidl(NPT_XmlElementNode* entry);
 
 public:
index 5722b82..e83a73b 100644 (file)
@@ -118,7 +118,7 @@ protected:
                           NPT_Int32                index, 
                           NPT_Int32                count,
                           bool                     browse_metadata = false,
-                          const char*              filter = "dc:date,dc:description,upnp:longDescription,upnp:genre,res,res@duration,res@size,upnp:albumArtURI,upnp:rating,upnp:episodeNumber,upnp:programTitle,upnp:seriesTitle,upnp:album,upnp:artist,upnp:author,upnp:director,searchable,childCount", // explicitely specify res otherwise WMP won't return a URL!
+                          const char*              filter = "dc:date,dc:description,upnp:longDescription,upnp:genre,res,res@duration,res@size,upnp:albumArtURI,upnp:rating,upnp:lastPlaybackPosition,upnp:lastPlaybackTime,upnp:playbackCount,upnp:originalTrackNumber,upnp:episodeNumber,upnp:programTitle,upnp:seriesTitle,upnp:album,upnp:artist,upnp:author,upnp:director,searchable,childCount", // explicitely specify res otherwise WMP won't return a URL!
                           const char*              sort = "");
 private:
     NPT_Result Find(const char* ip, PLT_DeviceDataReference& device);