2
* Copyright (C) 2011 Tuomo Penttinen, all rights reserved.
4
* Author: Tuomo Penttinen <tp@herqq.org>
6
* This file is part of Herqq UPnP Av (HUPnPAv) library.
8
* Herqq UPnP Av is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
11
* (at your option) any later version.
13
* Herqq UPnP Av is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with Herqq UPnP Av. If not, see <http://www.gnu.org/licenses/>.
22
#include "hgenrecontainer.h"
23
#include "hgenrecontainer_p.h"
24
#include "../model_mgmt/hcdsproperties.h"
26
#include "../hgenre.h"
37
/*******************************************************************************
38
* HGenreContainerPrivate
39
******************************************************************************/
40
HGenreContainerPrivate::HGenreContainerPrivate(
41
const QString& clazz, HObject::CdsType cdsType) :
42
HContainerPrivate(clazz, cdsType)
44
const HCdsProperties& inst = HCdsProperties::instance();
45
insert(inst.get(HCdsProperties::upnp_genre));
46
insert(inst.get(HCdsProperties::upnp_longDescription));
47
insert(inst.get(HCdsProperties::dc_description));
50
/*******************************************************************************
52
******************************************************************************/
53
HGenreContainer::HGenreContainer(const QString& clazz, CdsType cdsType) :
54
HContainer(*new HGenreContainerPrivate(clazz, cdsType))
58
HGenreContainer::HGenreContainer(HGenreContainerPrivate& dd) :
63
HGenreContainer::HGenreContainer(
64
const QString& title, const QString& parentId, const QString& id) :
65
HContainer(*new HGenreContainerPrivate(sClass(), sType()))
67
init(title, parentId, id);
70
HGenreContainer::~HGenreContainer()
74
HGenreContainer* HGenreContainer::newInstance() const
76
return new HGenreContainer();
79
void HGenreContainer::setGenres(const QList<HGenre>& arg)
81
setCdsProperty(HCdsProperties::upnp_genre, toList(arg));
84
void HGenreContainer::setLongDescription(const QString& arg)
86
setCdsProperty(HCdsProperties::upnp_longDescription, arg);
89
void HGenreContainer::setDescription(const QString& arg)
91
setCdsProperty(HCdsProperties::dc_description, arg);
94
QList<HGenre> HGenreContainer::genres() const
97
getCdsProperty(HCdsProperties::upnp_genre, &value);
98
return toList<HGenre>(value.toList());
101
QString HGenreContainer::longDescription() const
104
getCdsProperty(HCdsProperties::upnp_longDescription, &value);
105
return value.toString();
108
QString HGenreContainer::description() const
111
getCdsProperty(HCdsProperties::dc_description, &value);
112
return value.toString();