2 * Copyright (C) 2012-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
22 #include "utils/StdString.h"
24 #include "NptReferences.h"
25 #include "NptStrings.h"
32 class PLT_HttpRequestContext;
33 class PLT_MediaItemResource;
34 class PLT_MediaObject;
36 namespace MUSIC_INFO {
43 class CResourceFinder {
45 CResourceFinder(const char* protocol, const char* content = NULL);
46 bool operator()(const PLT_MediaItemResource& resource) const;
48 NPT_String m_Protocol;
54 ECLIENTQUIRKS_NONE = 0x0
56 /* Client requires folder's to be marked as storageFolers as verndor type (360)*/
57 , ECLIENTQUIRKS_ONLYSTORAGEFOLDER = 0x01
59 /* Client can't handle subtypes for videoItems (360) */
60 , ECLIENTQUIRKS_BASICVIDEOCLASS = 0x02
62 /* Client requires album to be set to [Unknown Series] to show title (WMP) */
63 , ECLIENTQUIRKS_UNKNOWNSERIES = 0x04
66 EClientQuirks GetClientQuirks(const PLT_HttpRequestContext* context);
68 enum EMediaControllerQuirks
70 EMEDIACONTROLLERQUIRKS_NONE = 0x00
72 /* Media Controller expects MIME type video/x-mkv instead of video/x-matroska (Samsung) */
73 , EMEDIACONTROLLERQUIRKS_X_MKV = 0x01
76 EMediaControllerQuirks GetMediaControllerQuirks(const PLT_DeviceData *device);
78 const char* GetMimeTypeFromExtension(const char* extension, const PLT_HttpRequestContext* context = NULL);
79 NPT_String GetMimeType(const CFileItem& item, const PLT_HttpRequestContext* context = NULL);
80 NPT_String GetMimeType(const char* filename, const PLT_HttpRequestContext* context = NULL);
81 const NPT_String GetProtocolInfo(const CFileItem& item, const char* protocol, const PLT_HttpRequestContext* context = NULL);
84 const CStdString& CorrectAllItemsSortHack(const CStdString &item);
86 NPT_Result PopulateTagFromObject(MUSIC_INFO::CMusicInfoTag& tag,
87 PLT_MediaObject& object,
88 PLT_MediaItemResource* resource = NULL);
89 NPT_Result PopulateTagFromObject(CVideoInfoTag& tag,
90 PLT_MediaObject& object,
91 PLT_MediaItemResource* resource = NULL);
93 NPT_Result PopulateObjectFromTag(MUSIC_INFO::CMusicInfoTag& tag,
94 PLT_MediaObject& object,
95 NPT_String* file_path,
96 PLT_MediaItemResource* resource,
97 EClientQuirks quirks);
98 NPT_Result PopulateObjectFromTag(CVideoInfoTag& tag,
99 PLT_MediaObject& object,
100 NPT_String* file_path,
101 PLT_MediaItemResource* resource,
102 EClientQuirks quirks);
104 PLT_MediaObject* BuildObject(CFileItem& item,
105 NPT_String& file_path,
107 NPT_Reference<CThumbLoader>& thumb_loader,
108 const PLT_HttpRequestContext* context = NULL,
109 CUPnPServer* upnp_server = NULL);
111 CFileItemPtr BuildObject(PLT_MediaObject* entry);
113 bool GetResource(const PLT_MediaObject* entry, CFileItem& item);
114 CFileItemPtr GetFileItem(const NPT_String& uri, const NPT_String& meta);