From 676d8bb624ef9fb7a8a4983b258d07787efec6b1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 14 Jan 2014 21:25:43 +0100 Subject: db/upnp/Object: add attribute "tag" Replaces "m_title" and "m_props". More bloat removed. --- src/db/upnp/Object.hxx | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) (limited to 'src/db/upnp/Object.hxx') diff --git a/src/db/upnp/Object.hxx b/src/db/upnp/Object.hxx index 1d32d0401..39b8f94f9 100644 --- a/src/db/upnp/Object.hxx +++ b/src/db/upnp/Object.hxx @@ -20,8 +20,9 @@ #ifndef MPD_UPNP_OBJECT_HXX #define MPD_UPNP_OBJECT_HXX +#include "tag/Tag.hxx" + #include -#include /** * UpnP Media Server directory entry, converted from XML data. @@ -61,43 +62,21 @@ public: std::string m_title; // dc:title. Directory name for a container. Type type; ItemClass item_class; - // Properties as gathered from the XML document (url, artist, etc.) - // The map keys are the XML tag or attribute names. - std::map m_props; - /** - * Song duration in seconds. 0 if unknown. - */ - int duration; + Tag tag; UPnPDirObject() = default; UPnPDirObject(UPnPDirObject &&) = default; UPnPDirObject &operator=(UPnPDirObject &&) = default; - /** Get named property - * @param property name (e.g. upnp:artist, upnp:album, - * upnp:originalTrackNumber, upnp:genre). Use m_title instead - * for dc:title. - * @param[out] value - * @return true if found. - */ - const char *getprop(const char *_name) const { - auto it = m_props.find(_name); - if (it == m_props.end()) - return nullptr; - return it->second.c_str(); - } - void clear() { m_id.clear(); m_pid.clear(); url.clear(); - m_title.clear(); type = Type::UNKNOWN; item_class = ItemClass::UNKNOWN; - m_props.clear(); - duration = -1; + tag.Clear(); } }; -- cgit v1.2.3