Skip to content

Loading…

[UPnP] device icons #1604

Merged
1 commit merged into from

1 participant

@alcoheca

This isn't particularly important if it's going to be a pain merging it after the window.

@ghost ghost merged commit 0e28ce4 into xbmc:master
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 11, 2012
  1. @alcoheca

    [UPnP] device icons

    alcoheca committed
View
2 xbmc/filesystem/UPnPDirectory.cpp
@@ -275,7 +275,7 @@ CUPnPDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items)
CFileItemPtr pItem(new CFileItem((const char*)name));
pItem->SetPath(CStdString((const char*) "upnp://" + uuid + "/"));
pItem->m_bIsFolder = true;
- pItem->SetArt("thumb", (const char*)(*device)->GetIconUrl("image/jpeg"));
+ pItem->SetArt("thumb", (const char*)(*device)->GetIconUrl("image/png"));
items.Add(pItem);
View
18 xbmc/network/upnp/UPnPRenderer.cpp
@@ -5,6 +5,7 @@
#include "Application.h"
#include "ApplicationMessenger.h"
#include "FileItem.h"
+#include "filesystem/SpecialProtocol.h"
#include "GUIInfoManager.h"
#include "guilib/GUIWindowManager.h"
#include "pictures/GUIWindowSlideShow.h"
@@ -317,6 +318,23 @@ CUPnPRenderer::UpdateState()
}
/*----------------------------------------------------------------------
+| CUPnPRenderer::SetupIcons
++---------------------------------------------------------------------*/
+NPT_Result
+CUPnPRenderer::SetupIcons()
+{
+ NPT_String file_root = CSpecialProtocol::TranslatePath("special://xbmc/media/").c_str();
+ printf("%s\n", (const char*) file_root);
+ AddIcon(
+ PLT_DeviceIcon("image/png", 256, 256, 32, "/icon.png"),
+ file_root);
+ AddIcon(
+ PLT_DeviceIcon("image/png", 32, 32, 32, "/icon32x32.png"),
+ file_root);
+ return NPT_SUCCESS;
+}
+
+/*----------------------------------------------------------------------
| CUPnPRenderer::GetMetadata
+---------------------------------------------------------------------*/
NPT_Result
View
1 xbmc/network/upnp/UPnPRenderer.h
@@ -64,6 +64,7 @@ class CUPnPRenderer : public PLT_MediaRenderer
private:
NPT_Result SetupServices();
+ NPT_Result SetupIcons();
NPT_Result GetMetadata(NPT_String& meta);
NPT_Result PlayMedia(const char* uri,
const char* metadata = NULL,
View
18 xbmc/network/upnp/UPnPServer.cpp
@@ -7,6 +7,7 @@
#include "interfaces/AnnouncementManager.h"
#include "filesystem/Directory.h"
#include "filesystem/MusicDatabaseDirectory.h"
+#include "filesystem/SpecialProtocol.h"
#include "filesystem/VideoDatabaseDirectory.h"
#include "guilib/Key.h"
#include "music/tags/MusicInfoTag.h"
@@ -165,6 +166,23 @@ CUPnPServer::PropagateUpdates()
}
/*----------------------------------------------------------------------
+| CUPnPServer::SetupIcons
++---------------------------------------------------------------------*/
+NPT_Result
+CUPnPServer::SetupIcons()
+{
+ NPT_String file_root = CSpecialProtocol::TranslatePath("special://xbmc/media/").c_str();
+ printf("%s\n", (const char*) file_root);
+ AddIcon(
+ PLT_DeviceIcon("image/png", 256, 256, 32, "/icon.png"),
+ file_root);
+ AddIcon(
+ PLT_DeviceIcon("image/png", 32, 32, 32, "/icon32x32.png"),
+ file_root);
+ return NPT_SUCCESS;
+}
+
+/*----------------------------------------------------------------------
| CUPnPServer::BuildSafeResourceUri
+---------------------------------------------------------------------*/
NPT_String CUPnPServer::BuildSafeResourceUri(const NPT_HttpUrl &rooturi,
View
1 xbmc/network/upnp/UPnPServer.h
@@ -75,6 +75,7 @@ class CUPnPServer : public PLT_MediaConnect,
NPT_HttpResponse& response);
virtual NPT_Result SetupServices();
+ virtual NPT_Result SetupIcons();
NPT_String BuildSafeResourceUri(const NPT_HttpUrl &rooturi,
const char* host,
const char* file_path);
Something went wrong with that request. Please try again.