3 * Copyright (C) 2012-2013 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
22 #include "utils/StdString.h"
24 #include "NptReferences.h"
25 #include "NptStrings.h"
31 class PLT_HttpRequestContext;
32 class PLT_MediaItemResource;
33 class PLT_MediaObject;
35 namespace MUSIC_INFO {
42 class CResourceFinder {
44 CResourceFinder(const char* protocol, const char* content = NULL);
45 bool operator()(const PLT_MediaItemResource& resource) const;
47 NPT_String m_Protocol;
53 ECLIENTQUIRKS_NONE = 0x0
55 /* Client requires folder's to be marked as storageFolers as verndor type (360)*/
56 , ECLIENTQUIRKS_ONLYSTORAGEFOLDER = 0x01
58 /* Client can't handle subtypes for videoItems (360) */
59 , ECLIENTQUIRKS_BASICVIDEOCLASS = 0x02
61 /* Client requires album to be set to [Unknown Series] to show title (WMP) */
62 , ECLIENTQUIRKS_UNKNOWNSERIES = 0x04
65 EClientQuirks GetClientQuirks(const PLT_HttpRequestContext* context);
67 const char* GetMimeTypeFromExtension(const char* extension, const PLT_HttpRequestContext* context = NULL);
68 NPT_String GetMimeType(const CFileItem& item, const PLT_HttpRequestContext* context = NULL);
69 NPT_String GetMimeType(const char* filename, const PLT_HttpRequestContext* context = NULL);
70 const NPT_String GetProtocolInfo(const CFileItem& item, const char* protocol, const PLT_HttpRequestContext* context = NULL);
73 const CStdString& CorrectAllItemsSortHack(const CStdString &item);
75 NPT_Result PopulateTagFromObject(MUSIC_INFO::CMusicInfoTag& tag,
76 PLT_MediaObject& object,
77 PLT_MediaItemResource* resource = NULL);
78 NPT_Result PopulateTagFromObject(CVideoInfoTag& tag,
79 PLT_MediaObject& object,
80 PLT_MediaItemResource* resource = NULL);
82 NPT_Result PopulateObjectFromTag(MUSIC_INFO::CMusicInfoTag& tag,
83 PLT_MediaObject& object,
84 NPT_String* file_path,
85 PLT_MediaItemResource* resource,
86 EClientQuirks quirks);
87 NPT_Result PopulateObjectFromTag(CVideoInfoTag& tag,
88 PLT_MediaObject& object,
89 NPT_String* file_path,
90 PLT_MediaItemResource* resource,
91 EClientQuirks quirks);
93 PLT_MediaObject* BuildObject(CFileItem& item,
94 NPT_String& file_path,
96 NPT_Reference<CThumbLoader>& thumb_loader,
97 const PLT_HttpRequestContext* context = NULL,
98 CUPnPServer* upnp_server = NULL);
100 CFileItemPtr BuildObject(PLT_MediaObject* entry);
102 bool GetResource(const PLT_MediaObject* entry, CFileItem& item);
103 CFileItemPtr GetFileItem(const NPT_String& uri, const NPT_String& meta);