~ubuntu-branches/ubuntu/vivid/digikam/vivid

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp_av/src/cds_model/model_mgmt/hcdsproperties.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 "hcdsproperties.h"
 
23
 
 
24
#include <HUpnpAv/HStateVariableCollection>
 
25
#include <HUpnpAv/HCdsPropertyInfo>
 
26
#include <HUpnpAv/HChannelGroupName>
 
27
#include <HUpnpAv/HForeignMetadata>
 
28
#include <HUpnpAv/HContentDuration>
 
29
#include <HUpnpAv/HScheduledTime>
 
30
#include <HUpnpAv/HDateTimeRange>
 
31
#include <HUpnpAv/HProgramCode>
 
32
#include <HUpnpAv/HMatchingId>
 
33
#include <HUpnpAv/HDeviceUdn>
 
34
#include <HUpnpAv/HRadioBand>
 
35
#include <HUpnpAv/HChannelId>
 
36
#include <HUpnpAv/HObject>
 
37
#include <HUpnpAv/HPrice>
 
38
 
 
39
#include <QtCore/QHash>
 
40
#include <QtCore/QMutex>
 
41
#include <QtCore/QVector>
 
42
#include <QtCore/QString>
 
43
#include <QtCore/QVariant>
 
44
#include <QtCore/QMutexLocker>
 
45
 
 
46
namespace Herqq
 
47
{
 
48
 
 
49
namespace Upnp
 
50
{
 
51
 
 
52
namespace Av
 
53
{
 
54
 
 
55
HCdsProperties* HCdsProperties::s_instance = 0;
 
56
QMutex* HCdsProperties::s_instanceLock = new QMutex();
 
57
 
 
58
class HCdsPropertiesPrivate
 
59
{
 
60
H_DISABLE_COPY(HCdsPropertiesPrivate)
 
61
 
 
62
public:
 
63
 
 
64
    QVector<const HCdsPropertyInfo*> m_propertyInfos;
 
65
    QHash<const QString, const HCdsPropertyInfo*> m_propertyInfosHash;
 
66
 
 
67
    inline HCdsPropertiesPrivate(){}
 
68
    inline ~HCdsPropertiesPrivate()
 
69
    {
 
70
        qDeleteAll(m_propertyInfos);
 
71
    }
 
72
 
 
73
    inline void insert(HCdsPropertyInfo* obj)
 
74
    {
 
75
        Q_ASSERT(obj);
 
76
        m_propertyInfos.append(obj);
 
77
        m_propertyInfosHash.insert(obj->name(), obj);
 
78
    }
 
79
};
 
80
 
 
81
namespace
 
82
{
 
83
bool lessThan(const HCdsPropertyInfo* obj1, const HCdsPropertyInfo* obj2)
 
84
{
 
85
     return obj1->name() < obj2->name();
 
86
}
 
87
}
 
88
 
 
89
HCdsProperties::HCdsProperties() :
 
90
    h_ptr(new HCdsPropertiesPrivate())
 
91
{
 
92
    h_ptr->m_propertyInfos.reserve(92);
 
93
 
 
94
    HCdsPropertyInfo* obj = new HCdsPropertyInfo(HCdsPropertyInfo::empty());
 
95
    h_ptr->insert(obj);
 
96
 
 
97
    obj = HCdsPropertyInfo::create(
 
98
        "@id", HCdsProperties::dlite_id, QVariant::String,
 
99
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::Mandatory) | HCdsPropertyInfo::StandardType);
 
100
    h_ptr->insert(obj);
 
101
 
 
102
    obj = HCdsPropertyInfo::create(
 
103
        "@parentID", HCdsProperties::dlite_id, QVariant::String,
 
104
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::Mandatory) | HCdsPropertyInfo::StandardType);
 
105
    h_ptr->insert(obj);
 
106
 
 
107
    obj = HCdsPropertyInfo::create(
 
108
        "@restricted", HCdsProperties::dlite_restricted, QVariant::Bool,
 
109
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::Mandatory) | HCdsPropertyInfo::StandardType);
 
110
    h_ptr->insert(obj);
 
111
 
 
112
    obj = HCdsPropertyInfo::create(
 
113
        "res", HCdsProperties::dlite_res, QVariant::List,
 
114
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::StandardType) | HCdsPropertyInfo::MultiValued);
 
115
    h_ptr->insert(obj);
 
116
 
 
117
    obj = HCdsPropertyInfo::create(
 
118
        "@refID", HCdsProperties::dlite_refId, QVariant::String, HCdsPropertyInfo::StandardType);
 
119
    h_ptr->insert(obj);
 
120
 
 
121
    obj = HCdsPropertyInfo::create(
 
122
        "@childCount", HCdsProperties::dlite_childCount, QVariant::Int, HCdsPropertyInfo::StandardType);
 
123
    h_ptr->insert(obj);
 
124
 
 
125
    obj = HCdsPropertyInfo::create(
 
126
        "@searchable", HCdsProperties::dlite_searchable, QVariant::Bool, HCdsPropertyInfo::StandardType);
 
127
    h_ptr->insert(obj);
 
128
 
 
129
    obj = HCdsPropertyInfo::create(
 
130
        "@neverPlayable", HCdsProperties::dlite_neverPlayable, QVariant::Bool, HCdsPropertyInfo::StandardType);
 
131
    h_ptr->insert(obj);
 
132
 
 
133
    obj = HCdsPropertyInfo::create(
 
134
        "dc:title", HCdsProperties::dc_title, QVariant::String,
 
135
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::StandardType) | HCdsPropertyInfo::Mandatory);
 
136
    h_ptr->insert(obj);
 
137
 
 
138
    obj = HCdsPropertyInfo::create(
 
139
        "dc:creator", HCdsProperties::dc_creator, QVariant::String, HCdsPropertyInfo::StandardType);
 
140
    h_ptr->insert(obj);
 
141
 
 
142
    obj = HCdsPropertyInfo::create(
 
143
        "dc:description", HCdsProperties::dc_description, QVariant::String, HCdsPropertyInfo::StandardType);
 
144
    h_ptr->insert(obj);
 
145
 
 
146
    obj = HCdsPropertyInfo::create(
 
147
        "dc:publisher", HCdsProperties::dc_publisher, QVariant::StringList,
 
148
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::StandardType) | HCdsPropertyInfo::MultiValued);
 
149
    h_ptr->insert(obj);
 
150
 
 
151
    obj = HCdsPropertyInfo::create(
 
152
        "dc:date", HCdsProperties::dc_date, QVariant::DateTime, HCdsPropertyInfo::StandardType);
 
153
    h_ptr->insert(obj);
 
154
 
 
155
    obj = HCdsPropertyInfo::create(
 
156
        "dc:rights", HCdsProperties::dc_rights, QVariant::StringList,
 
157
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::MultiValued) | HCdsPropertyInfo::StandardType);
 
158
    h_ptr->insert(obj);
 
159
 
 
160
    obj = HCdsPropertyInfo::create(
 
161
        "dc:relation", HCdsProperties::dc_relation, QVariant::StringList,
 
162
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::MultiValued) | HCdsPropertyInfo::StandardType);
 
163
    h_ptr->insert(obj);
 
164
 
 
165
    obj = HCdsPropertyInfo::create(
 
166
        "dc:language", HCdsProperties::dc_language, QVariant::StringList,
 
167
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::MultiValued) | HCdsPropertyInfo::StandardType);
 
168
    h_ptr->insert(obj);
 
169
 
 
170
    obj = HCdsPropertyInfo::create(
 
171
        "dc:contributor", HCdsProperties::dc_contributor, QVariant::StringList,
 
172
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::MultiValued) | HCdsPropertyInfo::StandardType);
 
173
    h_ptr->insert(obj);
 
174
 
 
175
    obj = HCdsPropertyInfo::create(
 
176
        "upnp:class", HCdsProperties::upnp_class, QVariant::String,
 
177
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::Mandatory) | HCdsPropertyInfo::StandardType);
 
178
     h_ptr->insert(obj);
 
179
 
 
180
    obj = HCdsPropertyInfo::create(
 
181
        "upnp:writeStatus", HCdsProperties::upnp_writeStatus, QVariant::fromValue(HObject::UnknownWriteStatus),
 
182
        HCdsPropertyInfo::StandardType);
 
183
    h_ptr->insert(obj);
 
184
 
 
185
    obj = HCdsPropertyInfo::create(
 
186
        "upnp:objectUpdateID", HCdsProperties::upnp_objectUpdateID, QVariant::UInt,
 
187
        HCdsPropertyInfo::StandardType | HCdsPropertyInfo::Disableable);
 
188
     h_ptr->insert(obj);
 
189
 
 
190
    obj = HCdsPropertyInfo::create(
 
191
        "upnp:bookmarkID", HCdsProperties::upnp_bookmarkID, QVariant::StringList, HCdsPropertyInfo::StandardType);
 
192
    h_ptr->insert(obj);
 
193
 
 
194
    obj = HCdsPropertyInfo::create(
 
195
        "upnp:longDescription", HCdsProperties::upnp_longDescription, QVariant::String, HCdsPropertyInfo::StandardType);
 
196
     h_ptr->insert(obj);
 
197
 
 
198
    obj = HCdsPropertyInfo::create(
 
199
        "upnp:rating", HCdsProperties::upnp_rating, QVariant::List,
 
200
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::MultiValued) | HCdsPropertyInfo::StandardType);
 
201
    h_ptr->insert(obj);
 
202
 
 
203
    obj = HCdsPropertyInfo::create(
 
204
        "upnp:album", HCdsProperties::upnp_album, QVariant::StringList,
 
205
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::MultiValued) | HCdsPropertyInfo::StandardType);
 
206
    h_ptr->insert(obj);
 
207
 
 
208
    obj = HCdsPropertyInfo::create(
 
209
        "upnp:genre", HCdsProperties::upnp_genre, QVariant::List,
 
210
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::MultiValued) | HCdsPropertyInfo::StandardType);
 
211
    h_ptr->insert(obj);
 
212
 
 
213
    obj = HCdsPropertyInfo::create(
 
214
        "upnp:artist", HCdsProperties::upnp_artist, QVariant::List,
 
215
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::MultiValued) | HCdsPropertyInfo::StandardType);
 
216
    h_ptr->insert(obj);
 
217
 
 
218
    obj = HCdsPropertyInfo::create(
 
219
        "upnp:originalTrackNumber", HCdsProperties::upnp_originalTrackNumber, QVariant::UInt, HCdsPropertyInfo::StandardType);
 
220
    h_ptr->insert(obj);
 
221
 
 
222
    obj = HCdsPropertyInfo::create(
 
223
        "upnp:producer", HCdsProperties::upnp_producer, QVariant::StringList,
 
224
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::MultiValued) | HCdsPropertyInfo::StandardType);
 
225
    h_ptr->insert(obj);
 
226
 
 
227
    obj = HCdsPropertyInfo::create(
 
228
        "upnp:actor", HCdsProperties::upnp_actor, QVariant::List,
 
229
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::MultiValued) | HCdsPropertyInfo::StandardType);
 
230
    h_ptr->insert(obj);
 
231
 
 
232
    obj = HCdsPropertyInfo::create(
 
233
        "upnp:playList", HCdsProperties::upnp_playList, QVariant::StringList,
 
234
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::MultiValued) | HCdsPropertyInfo::StandardType);
 
235
    h_ptr->insert(obj);
 
236
 
 
237
    obj = HCdsPropertyInfo::create(
 
238
        "upnp:director", HCdsProperties::upnp_director, QVariant::StringList,
 
239
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::MultiValued) | HCdsPropertyInfo::StandardType);
 
240
     h_ptr->insert(obj);
 
241
 
 
242
    obj = HCdsPropertyInfo::create(
 
243
        "upnp:playbackCount", HCdsProperties::upnp_playbackCount, QVariant::UInt, HCdsPropertyInfo::StandardType);
 
244
    h_ptr->insert(obj);
 
245
 
 
246
    obj = HCdsPropertyInfo::create(
 
247
        "upnp:lastPlaybackTime", HCdsProperties::upnp_lastPlaybackTime, QVariant::DateTime, HCdsPropertyInfo::StandardType);
 
248
    h_ptr->insert(obj);
 
249
 
 
250
    obj = HCdsPropertyInfo::create(
 
251
        "upnp:lastPlaybackPosition", HCdsProperties::upnp_lastPlaybackPosition, QVariant::fromValue(HContentDuration()), HCdsPropertyInfo::StandardType);
 
252
    h_ptr->insert(obj);
 
253
 
 
254
    obj = HCdsPropertyInfo::create(
 
255
        "upnp:recordedStartDateTime", HCdsProperties::upnp_recordedStartDateTime, QVariant::DateTime, HCdsPropertyInfo::StandardType);
 
256
    h_ptr->insert(obj);
 
257
 
 
258
    obj = HCdsPropertyInfo::create(
 
259
        "upnp:recordedDuration", HCdsProperties::upnp_recordedDuration, QVariant::fromValue(HContentDuration()), HCdsPropertyInfo::StandardType);
 
260
    h_ptr->insert(obj);
 
261
 
 
262
    obj = HCdsPropertyInfo::create(
 
263
        "upnp:recordedDayOfWeek", HCdsProperties::upnp_recordedDayOfWeek, QVariant::fromValue(Undefined_DayOfWeek),
 
264
        HCdsPropertyInfo::StandardType);
 
265
    h_ptr->insert(obj);
 
266
 
 
267
    obj = HCdsPropertyInfo::create(
 
268
        "upnp:srsRecordScheduleID", HCdsProperties::upnp_srsRecordScheduleID, QVariant::String, HCdsPropertyInfo::StandardType);
 
269
    h_ptr->insert(obj);
 
270
 
 
271
    obj = HCdsPropertyInfo::create(
 
272
        "upnp:srsRecordTaskID", HCdsProperties::upnp_srsRecordTaskID, QVariant::String, HCdsPropertyInfo::StandardType);
 
273
    h_ptr->insert(obj);
 
274
 
 
275
    obj = HCdsPropertyInfo::create(
 
276
        "upnp:author", HCdsProperties::upnp_author, QVariant::List,
 
277
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::MultiValued) | HCdsPropertyInfo::StandardType);
 
278
    h_ptr->insert(obj);
 
279
 
 
280
    obj = HCdsPropertyInfo::create(
 
281
        "upnp:storageMedium", HCdsProperties::upnp_storageMedium, QVariant::String, HCdsPropertyInfo::StandardType);
 
282
    h_ptr->insert(obj);
 
283
 
 
284
    obj = HCdsPropertyInfo::create(
 
285
        "upnp:storageTotal", HCdsProperties::upnp_storageTotal, QVariant::ULongLong, HCdsPropertyInfo::StandardType);
 
286
    h_ptr->insert(obj);
 
287
 
 
288
    obj = HCdsPropertyInfo::create(
 
289
        "upnp:storageUsed", HCdsProperties::upnp_storageUsed, QVariant::ULongLong, HCdsPropertyInfo::StandardType);
 
290
    h_ptr->insert(obj);
 
291
 
 
292
    obj = HCdsPropertyInfo::create(
 
293
        "upnp:storageFree", HCdsProperties::upnp_storageFree, QVariant::ULongLong, HCdsPropertyInfo::StandardType);
 
294
    h_ptr->insert(obj);
 
295
 
 
296
    obj = HCdsPropertyInfo::create(
 
297
        "upnp:storageMaxPartition", HCdsProperties::upnp_storageMaxPartition, QVariant::ULongLong, HCdsPropertyInfo::StandardType);
 
298
    h_ptr->insert(obj);
 
299
 
 
300
    obj = HCdsPropertyInfo::create(
 
301
        "upnp:containerUpdateID", HCdsProperties::upnp_containerUpdateID, QVariant::String,
 
302
        HCdsPropertyInfo::StandardType | HCdsPropertyInfo::Disableable);
 
303
    h_ptr->insert(obj);
 
304
 
 
305
    obj = HCdsPropertyInfo::create(
 
306
        "upnp:totalDeletedChildCount", HCdsProperties::upnp_totalDeletedChildCount, QVariant::UInt,
 
307
        HCdsPropertyInfo::StandardType | HCdsPropertyInfo::Disableable);
 
308
    h_ptr->insert(obj);
 
309
 
 
310
    obj = HCdsPropertyInfo::create(
 
311
        "upnp:createClass", HCdsProperties::upnp_createClass, QVariant::List,
 
312
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::MultiValued) | HCdsPropertyInfo::StandardType);
 
313
    h_ptr->insert(obj);
 
314
 
 
315
    obj = HCdsPropertyInfo::create(
 
316
        "upnp:searchClass", HCdsProperties::upnp_searchClass, QVariant::List,
 
317
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::MultiValued) | HCdsPropertyInfo::StandardType);
 
318
    h_ptr->insert(obj);
 
319
 
 
320
    obj = HCdsPropertyInfo::create(
 
321
        "upnp:region", HCdsProperties::upnp_region, QVariant::String, HCdsPropertyInfo::StandardType);
 
322
    h_ptr->insert(obj);
 
323
 
 
324
    obj = HCdsPropertyInfo::create(
 
325
        "upnp:radioCallSign", HCdsProperties::upnp_radioCallSign, QVariant::String, HCdsPropertyInfo::StandardType);
 
326
    h_ptr->insert(obj);
 
327
 
 
328
    obj = HCdsPropertyInfo::create(
 
329
        "upnp:radioStationID", HCdsProperties::upnp_radioStationID, QVariant::String, HCdsPropertyInfo::StandardType);
 
330
    h_ptr->insert(obj);
 
331
 
 
332
    obj = HCdsPropertyInfo::create(
 
333
        "upnp:radioBand", HCdsProperties::upnp_radioBand, QVariant::fromValue(HRadioBand()), HCdsPropertyInfo::StandardType);
 
334
    h_ptr->insert(obj);
 
335
 
 
336
    obj = HCdsPropertyInfo::create(
 
337
        "upnp:channelNr", HCdsProperties::upnp_channelNr, QVariant::Int, HCdsPropertyInfo::StandardType);
 
338
    h_ptr->insert(obj);
 
339
 
 
340
    obj = HCdsPropertyInfo::create(
 
341
        "upnp:signalStrength", HCdsProperties::upnp_signalStrength, QVariant::Int, HCdsPropertyInfo::StandardType);
 
342
    h_ptr->insert(obj);
 
343
 
 
344
    obj = HCdsPropertyInfo::create(
 
345
        "upnp:signalLocked", HCdsProperties::upnp_signalLocked, QVariant::Bool, HCdsPropertyInfo::StandardType);
 
346
    h_ptr->insert(obj);
 
347
 
 
348
    obj = HCdsPropertyInfo::create(
 
349
        "upnp:tuned", HCdsProperties::upnp_tuned, QVariant::Bool, HCdsPropertyInfo::StandardType);
 
350
    h_ptr->insert(obj);
 
351
 
 
352
    obj = HCdsPropertyInfo::create(
 
353
        "upnp:recordable", HCdsProperties::upnp_recordable, QVariant::Bool, HCdsPropertyInfo::StandardType);
 
354
    h_ptr->insert(obj);
 
355
 
 
356
    obj = HCdsPropertyInfo::create(
 
357
        "upnp:DVDRegionCode", HCdsProperties::upnp_dvdRegionCode, QVariant::String, HCdsPropertyInfo::StandardType);
 
358
    h_ptr->insert(obj);
 
359
 
 
360
    obj = HCdsPropertyInfo::create(
 
361
        "upnp:channelName", HCdsProperties::upnp_channelName, QVariant::String, HCdsPropertyInfo::StandardType);
 
362
    h_ptr->insert(obj);
 
363
 
 
364
    obj = HCdsPropertyInfo::create(
 
365
        "upnp:scheduledStartTime", HCdsProperties::upnp_scheduledStartTime, QVariant::fromValue(HScheduledTime()), HCdsPropertyInfo::StandardType);
 
366
    h_ptr->insert(obj);
 
367
 
 
368
    obj = HCdsPropertyInfo::create(
 
369
        "upnp:scheduledEndTime", HCdsProperties::upnp_scheduledEndTime, QVariant::fromValue(HScheduledTime()), HCdsPropertyInfo::StandardType);
 
370
    h_ptr->insert(obj);
 
371
 
 
372
    obj = HCdsPropertyInfo::create(
 
373
        "upnp:scheduledDuration", HCdsProperties::upnp_scheduledDuration, QVariant::String, HCdsPropertyInfo::StandardType);
 
374
    h_ptr->insert(obj);
 
375
 
 
376
    obj = HCdsPropertyInfo::create(
 
377
        "upnp:programTitle", HCdsProperties::upnp_programTitle, QVariant::String, HCdsPropertyInfo::StandardType);
 
378
    h_ptr->insert(obj);
 
379
 
 
380
    obj = HCdsPropertyInfo::create(
 
381
        "upnp:seriesTitle", HCdsProperties::upnp_seriesTitle, QVariant::String, HCdsPropertyInfo::StandardType);
 
382
    h_ptr->insert(obj);
 
383
 
 
384
    obj = HCdsPropertyInfo::create(
 
385
        "upnp:episodeCount", HCdsProperties::upnp_episodeCount, QVariant::Int, HCdsPropertyInfo::StandardType);
 
386
    h_ptr->insert(obj);
 
387
 
 
388
    obj = HCdsPropertyInfo::create(
 
389
        "upnp:episodeNumber", HCdsProperties::upnp_episodeNumber, QVariant::Int, HCdsPropertyInfo::StandardType);
 
390
    h_ptr->insert(obj);
 
391
 
 
392
    obj = HCdsPropertyInfo::create(
 
393
        "upnp:icon", HCdsProperties::upnp_icon, QVariant::Url, HCdsPropertyInfo::StandardType);
 
394
    h_ptr->insert(obj);
 
395
 
 
396
    obj = HCdsPropertyInfo::create(
 
397
        "upnp:callSign", HCdsProperties::upnp_callSign, QVariant::String, HCdsPropertyInfo::StandardType);
 
398
    h_ptr->insert(obj);
 
399
 
 
400
    obj = HCdsPropertyInfo::create(
 
401
        "upnp:price", HCdsProperties::upnp_price, QVariant::fromValue(HPrice()), HCdsPropertyInfo::StandardType);
 
402
    h_ptr->insert(obj);
 
403
 
 
404
    obj = HCdsPropertyInfo::create(
 
405
        "upnp:payPerView", HCdsProperties::upnp_payPerView, QVariant::Bool, HCdsPropertyInfo::StandardType);
 
406
    h_ptr->insert(obj);
 
407
 
 
408
    obj = HCdsPropertyInfo::create(
 
409
        "upnp:bookmarkedObjectID", HCdsProperties::upnp_bookmarkedObjectID, QVariant::String, HCdsPropertyInfo::StandardType);
 
410
    h_ptr->insert(obj);
 
411
 
 
412
    obj = HCdsPropertyInfo::create(
 
413
        "upnp:deviceUDN", HCdsProperties::upnp_deviceUdn, QVariant::fromValue(HDeviceUdn()), HCdsPropertyInfo::StandardType);
 
414
    h_ptr->insert(obj);
 
415
 
 
416
    obj = HCdsPropertyInfo::create(
 
417
        "upnp:stateVariableCollection", HCdsProperties::upnp_stateVariableCollection,
 
418
        QVariant::fromValue(HStateVariableCollection()), HCdsPropertyInfo::StandardType);
 
419
    h_ptr->insert(obj);
 
420
 
 
421
    obj = HCdsPropertyInfo::create(
 
422
        "upnp:channelGroupName", HCdsProperties::upnp_channelGroupName, QVariant::fromValue(HChannelGroupName()), HCdsPropertyInfo::StandardType);
 
423
    h_ptr->insert(obj);
 
424
 
 
425
    obj = HCdsPropertyInfo::create(
 
426
        "upnp:epgProviderName", HCdsProperties::upnp_epgProviderName, QVariant::String, HCdsPropertyInfo::StandardType);
 
427
    h_ptr->insert(obj);
 
428
 
 
429
    obj = HCdsPropertyInfo::create(
 
430
        "upnp:dateTimeRange", HCdsProperties::upnp_dateTimeRange, QVariant::fromValue(HDateTimeRange()), HCdsPropertyInfo::StandardType);
 
431
    h_ptr->insert(obj);
 
432
 
 
433
    obj = HCdsPropertyInfo::create(
 
434
        "upnp:serviceProvider", HCdsProperties::upnp_serviceProvider, QVariant::String, HCdsPropertyInfo::StandardType);
 
435
    h_ptr->insert(obj);
 
436
 
 
437
    obj = HCdsPropertyInfo::create(
 
438
        "upnp:programID", HCdsProperties::upnp_programID, QVariant::fromValue(HMatchingId()), HCdsPropertyInfo::StandardType);
 
439
    h_ptr->insert(obj);
 
440
 
 
441
    obj = HCdsPropertyInfo::create(
 
442
        "upnp:seriesID", HCdsProperties::upnp_seriesID, QVariant::fromValue(HMatchingId()), HCdsPropertyInfo::StandardType);
 
443
    h_ptr->insert(obj);
 
444
 
 
445
    obj = HCdsPropertyInfo::create(
 
446
        "upnp:channelID", HCdsProperties::upnp_channelID, QVariant::fromValue(HChannelId()), HCdsPropertyInfo::StandardType);
 
447
    h_ptr->insert(obj);
 
448
 
 
449
    obj = HCdsPropertyInfo::create(
 
450
        "upnp:programCode", HCdsProperties::upnp_programCode, QVariant::fromValue(HProgramCode()), HCdsPropertyInfo::StandardType);
 
451
    h_ptr->insert(obj);
 
452
 
 
453
    obj = HCdsPropertyInfo::create(
 
454
        "upnp:episodeType", HCdsProperties::upnp_episodeType, QVariant::fromValue(HEpisodeType()), HCdsPropertyInfo::StandardType);
 
455
    h_ptr->insert(obj);
 
456
 
 
457
    obj = HCdsPropertyInfo::create(
 
458
        "upnp:networkAffiliation", HCdsProperties::upnp_networkAffiliation, QVariant::String, HCdsPropertyInfo::StandardType);
 
459
    h_ptr->insert(obj);
 
460
 
 
461
    obj = HCdsPropertyInfo::create(
 
462
        "upnp:foreignMetadata", HCdsProperties::upnp_foreignMetadata, QVariant::fromValue(HForeignMetadata()), HCdsPropertyInfo::StandardType);
 
463
    h_ptr->insert(obj);
 
464
 
 
465
    obj = HCdsPropertyInfo::create(
 
466
        "upnp:artistDiscographyURI", HCdsProperties::upnp_artistDiscographyURI, QVariant::Url, HCdsPropertyInfo::StandardType);
 
467
    h_ptr->insert(obj);
 
468
 
 
469
    obj = HCdsPropertyInfo::create(
 
470
        "upnp:lyricsURI", HCdsProperties::upnp_lyricsURI, QVariant::List, HCdsPropertyInfo::StandardType);
 
471
    h_ptr->insert(obj);
 
472
 
 
473
    obj = HCdsPropertyInfo::create(
 
474
        "upnp:albumArtURI", HCdsProperties::upnp_albumArtURI, QVariant::List,
 
475
        HCdsPropertyInfo::PropertyFlags(HCdsPropertyInfo::StandardType) | HCdsPropertyInfo::MultiValued);
 
476
    h_ptr->insert(obj);
 
477
 
 
478
    obj = HCdsPropertyInfo::create(
 
479
        "upnp:toc", HCdsProperties::upnp_toc, QVariant::String, HCdsPropertyInfo::StandardType);
 
480
    h_ptr->insert(obj);
 
481
 
 
482
    obj = HCdsPropertyInfo::create(
 
483
        "upnp:userAnnotation", HCdsProperties::upnp_userAnnotation, QVariant::List, HCdsPropertyInfo::StandardType);
 
484
    h_ptr->insert(obj);
 
485
 
 
486
    obj = HCdsPropertyInfo::create("desc", HCdsProperties::dlite_desc, QVariant::List, HCdsPropertyInfo::StandardType);
 
487
    h_ptr->insert(obj);
 
488
}
 
489
 
 
490
HCdsProperties::~HCdsProperties()
 
491
{
 
492
    delete h_ptr;
 
493
}
 
494
 
 
495
const HCdsProperties& HCdsProperties::instance()
 
496
{
 
497
    QMutexLocker locker(s_instanceLock);
 
498
    if (!s_instance)
 
499
    {
 
500
        s_instance = new HCdsProperties();
 
501
    }
 
502
    return *s_instance;
 
503
}
 
504
 
 
505
const HCdsPropertyInfo& HCdsProperties::get(Property property) const
 
506
{
 
507
    return *(*(h_ptr->m_propertyInfos.begin()+property));
 
508
}
 
509
 
 
510
const HCdsPropertyInfo& HCdsProperties::get(const QString& property) const
 
511
{
 
512
    if (h_ptr->m_propertyInfosHash.contains(property))
 
513
    {
 
514
        return *h_ptr->m_propertyInfosHash.value(property);
 
515
    }
 
516
    return HCdsPropertyInfo::empty();
 
517
}
 
518
 
 
519
}
 
520
}
 
521
}