upnpbrowser.cpp: -add albumArtURI parse

This commit is contained in:
Jacek Jendrzej
2014-03-19 18:35:10 +01:00
parent 80d7cc186d
commit 98bdb43608
2 changed files with 11 additions and 5 deletions

View File

@@ -260,7 +260,7 @@ std::vector<UPnPEntry> *CUpnpBrowserGui::decodeResult(std::string result)
for (node=root->GetChild(); node; node=node->GetNext()) for (node=root->GetChild(); node; node=node->GetNext())
{ {
bool isdir; bool isdir;
std::string title, artist = "", album = "", id, children; std::string title, artist = "", album = "", albumArtURI = "", id, children;
const char *type, *p; const char *type, *p;
if (!strcmp(node->GetType(), "container")) if (!strcmp(node->GetType(), "container"))
@@ -291,7 +291,7 @@ std::vector<UPnPEntry> *CUpnpBrowserGui::decodeResult(std::string result)
p = ""; p = "";
children=std::string(p); children=std::string(p);
UPnPEntry entry={id, isdir, title, artist, album, children, resources, -1}; UPnPEntry entry={id, isdir, title, artist, album, albumArtURI, children, resources, -1};
entries->push_back(entry); entries->push_back(entry);
} }
if (!strcmp(node->GetType(), "item")) if (!strcmp(node->GetType(), "item"))
@@ -330,6 +330,13 @@ std::vector<UPnPEntry> *CUpnpBrowserGui::decodeResult(std::string result)
p = ""; p = "";
album=std::string(p); album=std::string(p);
} }
else if (!strcmp(type,"albumArtURI"))
{
p=snode->GetData();
if (!p)
p = "";
albumArtURI=std::string(p);
}
else if (!strcmp(type,"res")) else if (!strcmp(type,"res"))
{ {
p = snode->GetData(); p = snode->GetData();
@@ -416,8 +423,7 @@ std::vector<UPnPEntry> *CUpnpBrowserGui::decodeResult(std::string result)
p = ""; p = "";
children=std::string(p); children=std::string(p);
UPnPEntry entry={id, isdir, title, artist, album, children, resources, preferred}; UPnPEntry entry={id, isdir, title, artist, album, albumArtURI, children, resources, preferred};
entries->push_back(entry); entries->push_back(entry);
} }
} }
@@ -1140,7 +1146,6 @@ void CUpnpBrowserGui::paintDetails(std::vector<UPnPEntry> *entry, unsigned int i
// Foot info // Foot info
int top = m_y + (m_height - m_info_height - 1 * m_buttonHeight) + 2; int top = m_y + (m_height - m_info_height - 1 * m_buttonHeight) + 2;
int text_start = m_x + 10; int text_start = m_x + 10;
printf("paintDetails: index %d use_playing %d shown %d\n", index, use_playing, m_playing_entry_is_shown); printf("paintDetails: index %d use_playing %d shown %d\n", index, use_playing, m_playing_entry_is_shown);
if ((!use_playing) && ((*entry)[index].isdir)) if ((!use_playing) && ((*entry)[index].isdir))
{ {

View File

@@ -57,6 +57,7 @@ struct UPnPEntry
std::string title; std::string title;
std::string artist; std::string artist;
std::string album; std::string album;
std::string albumArtURI;
std::string children; std::string children;
std::vector<UPnPResource> resources; std::vector<UPnPResource> resources;
int preferred; int preferred;