From 7f93296d158095f59169d12c4181af060f4b9884 Mon Sep 17 00:00:00 2001 From: Alasdair Campbell Date: Fri, 26 Oct 2012 12:30:04 +0100 Subject: [PATCH 14/24] platinum: switch to NPT_UInt64 for bitmask flags --- .../Source/Devices/MediaServer/PltDidl.cpp | 6 +- .../Platinum/Source/Devices/MediaServer/PltDidl.h | 68 +++++++++++----------- .../Source/Devices/MediaServer/PltMediaItem.cpp | 6 +- .../Source/Devices/MediaServer/PltMediaItem.h | 6 +- .../Devices/MediaServer/PltSyncMediaBrowser.h | 2 +- 5 files changed, 44 insertions(+), 44 deletions(-) diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp index 6ad2ec4..6f72dda 100644 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp @@ -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); diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h index 8d9704f..29ce9ca 100644 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h @@ -48,43 +48,43 @@ /*---------------------------------------------------------------------- | 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_ */ diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp index b10d75a..31bc16c 100644 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp @@ -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 += ""; @@ -682,7 +682,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 += "