|
libupnpp 0.16.0
A C++ wrapper for the Portable UPnP reference library
|
UPnP Media Server directory entry, converted from XML data. More...
#include <cdircontent.hxx>
Public Member Functions | |
| bool | getprop (const std::string &name, std::string &value) const |
| Get named property. | |
| const std::string | getprop (const std::string &name) const |
| Get named property. | |
| const std::string & | getupropref (const std::string &name) const |
| Get reference to first (supposed unique) instance of property. | |
| bool | getRoledArtists (std::vector< std::pair< std::string, std::string > > &out) const |
| Specialized methods for artists, dealing with the role attribute and the special AlbumArtist role value. | |
| std::string | getAlbumArtist () const |
| std::string | getArtists () const |
| std::string | getAlbumArtistElseArtists () const |
| bool | getrprop (unsigned int ridx, const std::string &nm, std::string &val) const |
| Get named resource attribute. | |
| std::string | f2s (const std::string &nm, bool isresfield) |
| Simplified interface to retrieving values: we don't distinguish between non-existing and empty, and we only use the first ressource. | |
| int | getDurationSeconds (unsigned ridx=0) const |
| Return resource duration in seconds. | |
| std::string | getdidl () const |
| Get a DIDL document suitable for sending to a mediaserver. | |
| void | clear () |
| std::string | dump () const |
Public Attributes | |
| std::string | m_id |
| Object Id. | |
| std::string | m_pid |
| Parent Object Id. | |
| std::string | m_title |
| Value of dc:title. | |
| ObjType | m_type |
| Item or container. | |
| ItemClass | m_iclass |
| Item type details. | |
| std::multimap< std::string, std::string > | m_props |
| Storage for the properties. | |
| std::vector< UPnPResource > | m_resources |
| Resources: there may be several, for example for different audio formats of the same track, each with an URI and descriptor fields. | |
Friends | |
| class | UPnPDirParser |
UPnP Media Server directory entry, converted from XML data.
This is a dumb data holder class, a struct with helpers.
| std::string UPnPClient::UPnPDirObject::getAlbumArtist | ( | ) | const |
| std::string UPnPClient::UPnPDirObject::getAlbumArtistElseArtists | ( | ) | const |
| std::string UPnPClient::UPnPDirObject::getArtists | ( | ) | const |
| std::string UPnPClient::UPnPDirObject::getdidl | ( | ) | const |
Get a DIDL document suitable for sending to a mediaserver.
We may have missed useful stuff while parsing the data from the content directory, so we send the original if we can.
|
inline |
Return resource duration in seconds.
| ridx | resource index. |
| const std::string UPnPClient::UPnPDirObject::getprop | ( | const std::string & | name | ) | const |
Get named property.
Return empty value if it does not exist.
| name | (e.g. dc:description, upnp:album...). Use m_title instead for dc:title, and the specialized artist methods for upnp:artist. |
| bool UPnPClient::UPnPDirObject::getprop | ( | const std::string & | name, |
| std::string & | value | ||
| ) | const |
Get named property.
Discriminate non-existing from empty values
| name | (dc:description, upnp:album...). Use m_title instead for dc:title, and the specialized artist methods for upnp:artist. | |
| [out] | value | the parameter value if found |
| bool UPnPClient::UPnPDirObject::getRoledArtists | ( | std::vector< std::pair< std::string, std::string > > & | out | ) | const |
Specialized methods for artists, dealing with the role attribute and the special AlbumArtist role value.
return vector of {role, artist} pairs (role can be empty).
|
inline |
Get named resource attribute.
Field names: "bitrate", "duration" (H:mm:ss.ms), "nrAudioChannels", "protocolInfo", "sampleFrequency" (Hz), "size" (bytes).
| ridx | index in resources array. |
| nm | attribute name. |
| [output] | value if found. |
| const std::string & UPnPClient::UPnPDirObject::getupropref | ( | const std::string & | name | ) | const |
Get reference to first (supposed unique) instance of property.
Used for e.g. upnp:class
| std::multimap<std::string, std::string> UPnPClient::UPnPDirObject::m_props |
Storage for the properties.
Properties as gathered from the XML document (album, artist, etc.). In general, the multimap keys are the XML tag names, with exceptions: