~ubuntu-branches/ubuntu/trusty/digikam/trusty

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp_av/src/cds_model/cds_objects/hvideoitem.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-11-26 18:24:20 UTC
  • mfrom: (1.9.1) (3.1.23 experimental)
  • Revision ID: package-import@ubuntu.com-20121126182420-qoy6z0nx4ai0wzcl
Tags: 4:3.0.0~beta3-0ubuntu1
* New upstream release
  - Add build-deps :  libhupnp-dev, libqtgstreamer-dev, libmagickcore-dev
* Merge from debian, remaining changes:
  - Make sure libqt4-opengl-dev, libgl1-mesa-dev and libglu1-mesa-dev only
    install on i386,amd64 and powerpc
  - Depend on libtiff-dev instead of libtiff4-dev
  - Drop digikam breaks/replaces kipi-plugins-common since we're past the
    LTS release now
  - digikam to recommend mplayerthumbs | ffmpegthumbs. We currently only
    have latter in the archives, even though former is also supposed to
    be part of kdemultimedia. (LP: #890059)
  - kipi-plugins to recommend www-browser rather than konqueror directly
    since 2.8 no direct usage of konqueror is present in the flickr
    plugin anymore (LP: #1011211)
  - Keep kubuntu_mysqld_executable_name.diff
  - Don't install libkipi translations
  - Keep deps on libcv-dev, libcvaux-dev
  - Keep split packaging of libraries
  - Replace icons from KDE 3 time in debian/xpm.d/*.xpm with the new
    versions (LP: #658047)
* Update debian/not-installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2011 Tuomo Penttinen, all rights reserved.
 
3
 *
 
4
 *  Author: Tuomo Penttinen <tp@herqq.org>
 
5
 *
 
6
 *  This file is part of Herqq UPnP Av (HUPnPAv) library.
 
7
 *
 
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.
 
12
 *
 
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.
 
17
 *
 
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/>.
 
20
 */
 
21
 
 
22
#include "hvideoitem.h"
 
23
#include "hvideoitem_p.h"
 
24
 
 
25
#include "../hgenre.h"
 
26
#include "../hpersonwithrole.h"
 
27
#include "../hcontentduration.h"
 
28
 
 
29
#include "../../common/hrating.h"
 
30
#include "../model_mgmt/hcdsproperties.h"
 
31
 
 
32
#include <QtCore/QUrl>
 
33
#include <QtCore/QDateTime>
 
34
 
 
35
namespace Herqq
 
36
{
 
37
 
 
38
namespace Upnp
 
39
{
 
40
 
 
41
namespace Av
 
42
{
 
43
 
 
44
/*******************************************************************************
 
45
 * HVideoItemPrivate
 
46
 ******************************************************************************/
 
47
HVideoItemPrivate::HVideoItemPrivate(
 
48
    const QString& clazz, HObject::CdsType cdsType) :
 
49
        HItemPrivate(clazz, cdsType)
 
50
{
 
51
    const HCdsProperties& inst = HCdsProperties::instance();
 
52
    insert(inst.get(HCdsProperties::upnp_genre));
 
53
    insert(inst.get(HCdsProperties::upnp_longDescription));
 
54
    insert(inst.get(HCdsProperties::upnp_producer));
 
55
    insert(inst.get(HCdsProperties::upnp_rating));
 
56
    insert(inst.get(HCdsProperties::upnp_actor));
 
57
    insert(inst.get(HCdsProperties::upnp_director));
 
58
    insert(inst.get(HCdsProperties::dc_description));
 
59
    insert(inst.get(HCdsProperties::dc_publisher));
 
60
    insert(inst.get(HCdsProperties::dc_language));
 
61
    insert(inst.get(HCdsProperties::dc_relation));
 
62
    insert(inst.get(HCdsProperties::upnp_playbackCount));
 
63
    insert(inst.get(HCdsProperties::upnp_lastPlaybackTime));
 
64
    insert(inst.get(HCdsProperties::upnp_lastPlaybackPosition));
 
65
    insert(inst.get(HCdsProperties::upnp_recordedDayOfWeek));
 
66
    insert(inst.get(HCdsProperties::upnp_srsRecordScheduleID));
 
67
}
 
68
 
 
69
/*******************************************************************************
 
70
 * HVideoItem
 
71
 ******************************************************************************/
 
72
HVideoItem::HVideoItem(const QString& clazz, CdsType cdsType) :
 
73
    HItem(*new HVideoItemPrivate(clazz, cdsType))
 
74
{
 
75
}
 
76
 
 
77
HVideoItem::HVideoItem(HVideoItemPrivate& dd) :
 
78
    HItem(dd)
 
79
{
 
80
}
 
81
 
 
82
HVideoItem::HVideoItem(
 
83
    const QString& title, const QString& parentId, const QString& id) :
 
84
        HItem(*new HVideoItemPrivate(sClass(), sType()))
 
85
{
 
86
    init(title, parentId, id);
 
87
}
 
88
 
 
89
HVideoItem::~HVideoItem()
 
90
{
 
91
}
 
92
 
 
93
HVideoItem* HVideoItem::newInstance() const
 
94
{
 
95
    return new HVideoItem();
 
96
}
 
97
 
 
98
void HVideoItem::setGenres(const QList<HGenre>& arg)
 
99
{
 
100
    setCdsProperty(HCdsProperties::upnp_genre, toList(arg));
 
101
}
 
102
 
 
103
void HVideoItem::setLongDescription(const QString& arg)
 
104
{
 
105
    setCdsProperty(HCdsProperties::upnp_longDescription, arg);
 
106
}
 
107
 
 
108
void HVideoItem::setProducers(const QStringList& arg)
 
109
{
 
110
    setCdsProperty(HCdsProperties::upnp_producer, arg);
 
111
}
 
112
 
 
113
void HVideoItem::setRatings(const QList<HRating>& arg)
 
114
{
 
115
    setCdsProperty(HCdsProperties::upnp_rating, toList(arg));
 
116
}
 
117
 
 
118
void HVideoItem::setActors(const QList<HPersonWithRole>& arg)
 
119
{
 
120
    setCdsProperty(HCdsProperties::upnp_actor, toList(arg));
 
121
}
 
122
 
 
123
void HVideoItem::setDirectors(const QStringList& arg)
 
124
{
 
125
    setCdsProperty(HCdsProperties::upnp_director, arg);
 
126
}
 
127
 
 
128
void HVideoItem::setDescription(const QString& arg)
 
129
{
 
130
    setCdsProperty(HCdsProperties::dc_description, arg);
 
131
}
 
132
 
 
133
void HVideoItem::setPublishers(const QStringList& arg)
 
134
{
 
135
    setCdsProperty(HCdsProperties::dc_publisher, arg);
 
136
}
 
137
 
 
138
void HVideoItem::setLanguages(const QStringList& arg)
 
139
{
 
140
    setCdsProperty(HCdsProperties::dc_language, arg);
 
141
}
 
142
 
 
143
void HVideoItem::setRelations(const QList<QUrl>& arg)
 
144
{
 
145
    setCdsProperty(HCdsProperties::dc_relation, toList(arg));
 
146
}
 
147
 
 
148
void HVideoItem::setPlaybackCount(qint32 arg)
 
149
{
 
150
    setCdsProperty(HCdsProperties::upnp_playbackCount, arg);
 
151
}
 
152
 
 
153
void HVideoItem::setLastPlaybackTime(const QDateTime& arg)
 
154
{
 
155
    setCdsProperty(HCdsProperties::upnp_lastPlaybackTime, arg);
 
156
}
 
157
 
 
158
void HVideoItem::setLastPlaybackPosition(const HContentDuration& arg)
 
159
{
 
160
    setCdsProperty(HCdsProperties::upnp_lastPlaybackPosition, QVariant::fromValue(arg));
 
161
}
 
162
 
 
163
void HVideoItem::setRecordedDayOfWeek(HDayOfWeek arg)
 
164
{
 
165
    setCdsProperty(HCdsProperties::upnp_recordedDayOfWeek, QVariant::fromValue(arg));
 
166
}
 
167
 
 
168
void HVideoItem::setSrsRecordScheduleId(const QString& arg)
 
169
{
 
170
    setCdsProperty(HCdsProperties::upnp_srsRecordScheduleID, arg);
 
171
}
 
172
 
 
173
QList<HGenre> HVideoItem::genres() const
 
174
{
 
175
    QVariant value;
 
176
    getCdsProperty(HCdsProperties::upnp_genre, &value);
 
177
    return toList<HGenre>(value.toList());
 
178
}
 
179
 
 
180
QString HVideoItem::longDescription() const
 
181
{
 
182
    QVariant value;
 
183
    getCdsProperty(HCdsProperties::upnp_longDescription, &value);
 
184
    return value.toString();
 
185
}
 
186
 
 
187
QStringList HVideoItem::producers() const
 
188
{
 
189
    QVariant value;
 
190
    getCdsProperty(HCdsProperties::upnp_producer, &value);
 
191
    return value.toStringList();
 
192
}
 
193
 
 
194
QList<HRating> HVideoItem::ratings() const
 
195
{
 
196
    QVariant value;
 
197
    getCdsProperty(HCdsProperties::upnp_rating, &value);
 
198
    return toList<HRating>(value.toList());
 
199
}
 
200
 
 
201
QList<HPersonWithRole> HVideoItem::actors() const
 
202
{
 
203
    QVariant value;
 
204
    getCdsProperty(HCdsProperties::upnp_actor, &value);
 
205
    return toList<HPersonWithRole>(value.toList());
 
206
}
 
207
 
 
208
QStringList HVideoItem::directors() const
 
209
{
 
210
    QVariant value;
 
211
    getCdsProperty(HCdsProperties::upnp_director, &value);
 
212
    return value.toStringList();
 
213
}
 
214
 
 
215
QString HVideoItem::description() const
 
216
{
 
217
    QVariant value;
 
218
    getCdsProperty(HCdsProperties::dc_description, &value);
 
219
    return value.toString();
 
220
}
 
221
 
 
222
QStringList HVideoItem::publishers() const
 
223
{
 
224
    QVariant value;
 
225
    getCdsProperty(HCdsProperties::dc_publisher, &value);
 
226
    return value.toStringList();
 
227
}
 
228
 
 
229
QStringList HVideoItem::languages() const
 
230
{
 
231
    QVariant value;
 
232
    getCdsProperty(HCdsProperties::dc_language, &value);
 
233
    return value.toStringList();
 
234
}
 
235
 
 
236
QList<QUrl> HVideoItem::relations() const
 
237
{
 
238
    QVariant value;
 
239
    getCdsProperty(HCdsProperties::dc_relation, &value);
 
240
    return toList<QUrl>(value.toList());
 
241
}
 
242
 
 
243
qint32 HVideoItem::playbackCount() const
 
244
{
 
245
    QVariant value;
 
246
    getCdsProperty(HCdsProperties::upnp_playbackCount, &value);
 
247
    return value.toInt();
 
248
}
 
249
 
 
250
QDateTime HVideoItem::lastPlaybackTime() const
 
251
{
 
252
    QVariant value;
 
253
    getCdsProperty(HCdsProperties::upnp_lastPlaybackTime, &value);
 
254
    return value.toDateTime();
 
255
}
 
256
 
 
257
HContentDuration HVideoItem::lastPlaybackPosition() const
 
258
{
 
259
    QVariant value;
 
260
    getCdsProperty(HCdsProperties::upnp_lastPlaybackPosition, &value);
 
261
    return value.value<HContentDuration>();
 
262
}
 
263
 
 
264
HDayOfWeek HVideoItem::recordedDayOfWeek() const
 
265
{
 
266
    QVariant value;
 
267
    getCdsProperty(HCdsProperties::upnp_recordedDayOfWeek, &value);
 
268
    return value.value<HDayOfWeek>();
 
269
}
 
270
 
 
271
QString HVideoItem::srsRecordScheduleId() const
 
272
{
 
273
    QVariant value;
 
274
    getCdsProperty(HCdsProperties::upnp_srsRecordScheduleID, &value);
 
275
    return value.toString();
 
276
}
 
277
 
 
278
}
 
279
}
 
280
}