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

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp_av/src/transport/hseekinfo.h

  • 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
#ifndef HSEEKINFO_H_
 
23
#define HSEEKINFO_H_
 
24
 
 
25
#include <HUpnpAv/HUpnpAv>
 
26
 
 
27
#include <QtCore/QString>
 
28
#include <QtCore/QSharedDataPointer>
 
29
 
 
30
namespace Herqq
 
31
{
 
32
 
 
33
namespace Upnp
 
34
{
 
35
 
 
36
namespace Av
 
37
{
 
38
 
 
39
/*!
 
40
 * \brief This is a convenience class for working with Seek Modes defined in the
 
41
 * AVTransport:2 specification.
 
42
 *
 
43
 * \headerfile hseekinfo.h HSeekMode
 
44
 *
 
45
 * \ingroup hupnp_av_avt
 
46
 *
 
47
 * \remarks This class is not thread-safe.
 
48
 */
 
49
class H_UPNP_AV_EXPORT HSeekMode
 
50
{
 
51
 
 
52
public:
 
53
 
 
54
    /*!
 
55
     * \brief This enumeration specifies the Seek Modes defined in the
 
56
     * AVTransport:2 specification.
 
57
     *
 
58
     * \remarks Many of the descriptions here are more or less direct quotes
 
59
     * from the AV Transport:2 specification, section 2.4.13.
 
60
     */
 
61
    enum Type
 
62
    {
 
63
        /*!
 
64
         * The seek mode is undefined.
 
65
         */
 
66
        Unknown = -1,
 
67
 
 
68
        /*!
 
69
         * Track number.
 
70
         *
 
71
         * Seeks to the beginning of a particular track number.
 
72
         *
 
73
         * For track-unaware media, special track number "0" is used to indicate
 
74
         * the end of the media and thus it is equivalent to the common
 
75
         * \e FastReverse VCR functionality. Similarly, track number "1" is
 
76
         * equivalent to the common \e FastForward functionality.
 
77
         */
 
78
        TrackNr = 0,
 
79
 
 
80
        /*!
 
81
         * Absolute time.
 
82
         *
 
83
         * The range is from "00:00:00" to the duration of the current media.
 
84
         */
 
85
        AbsTime,
 
86
 
 
87
        /*!
 
88
         * Relative time.
 
89
         *
 
90
         * Seeks within the current track on the current media. The range is
 
91
         * from "00:00:00" to the duration of the current track.
 
92
         */
 
93
        RelTime,
 
94
 
 
95
        /*!
 
96
         * Absolute count.
 
97
         *
 
98
         * The range is from 0 to 2147483646, where 0 corresponds to the beginning
 
99
         * of the media.
 
100
         */
 
101
        AbsCount,
 
102
 
 
103
        /*!
 
104
         * Relative count.
 
105
         *
 
106
         * Seeks within the current track on the current media. The range is
 
107
         * from 0 to the vendor-defined value that corresponds to the end
 
108
         * of the current track.
 
109
         */
 
110
        RelCount,
 
111
 
 
112
        /*!
 
113
         * Channel frequency.
 
114
         *
 
115
         * Seeks to the specified channel frequency.
 
116
         */
 
117
        ChannelFreq,
 
118
 
 
119
        /*!
 
120
         * Seeks to the pre-defined index at the current media, measured
 
121
         * from the beginning of the media.
 
122
         *
 
123
         * This value applies only track-unaware media and it assumes that the
 
124
         * media contains a set of subsequent "marks" that indicate some
 
125
         * relevant position on the media.
 
126
         *
 
127
         * For more information, see the AV Transport:2 specification, section
 
128
         * 2.4.13.
 
129
         */
 
130
        TapeIndex,
 
131
 
 
132
        /*!
 
133
         * Seeks to the pre-defined index at the current media, measured
 
134
         * from the current position on the media.
 
135
         *
 
136
         * This value applies only track-unaware media and it assumes that the
 
137
         * media contains a set of subsequent "marks" that indicate some
 
138
         * relevant position on the media.
 
139
         *
 
140
         * For more information, see the AV Transport:2 specification, section
 
141
         * 2.4.13.
 
142
         */
 
143
        RelTapeIndex,
 
144
 
 
145
        /*!
 
146
         * Seeks to the desired position, in terms of frames, measured
 
147
         * from the beginning of the media. The range of the target value
 
148
         * is from "0" to the total duration of the current media, expressed
 
149
         * in frames. The value has to be positive.
 
150
         */
 
151
        Frame,
 
152
 
 
153
        /*!
 
154
         * For track-aware media, seeks to the desired position in the current
 
155
         * track, in terms of frames, measured from the
 
156
         * beginning of the current track. The range for the target value
 
157
         * is from "0" to the duration of the current track,
 
158
         * measured in number of frames. For track-aware media, the target value
 
159
         * has to be positive.
 
160
         *
 
161
         * For track-unaware media (e.g. a single tape), the target value
 
162
         * contains the desired position, in terms of frames, measured from a
 
163
         * zero reference point on the media. The range for the Target
 
164
         * argument is from the beginning of the media, measured from the zero
 
165
         * reference point to the end of the media, also measured from the
 
166
         * zero reference point. For track-unaware media, the target value
 
167
         * can be negative. Indeed, when the zero reference point
 
168
         * does not coincide with the beginning of the media, all positions
 
169
         * before the zero reference point are expressed as negative
 
170
         * values.
 
171
         */
 
172
        RelFrame,
 
173
 
 
174
        /*!
 
175
         * Vendor-defined.
 
176
         */
 
177
        VendorDefined
 
178
    };
 
179
 
 
180
    Type m_type;
 
181
    QString m_typeAsString;
 
182
 
 
183
public:
 
184
 
 
185
    /*!
 
186
     * Creates a new, invalid instance.
 
187
     *
 
188
     * \sa isValid()
 
189
     */
 
190
    HSeekMode();
 
191
 
 
192
    /*!
 
193
     * \brief Creates a new instance.
 
194
     *
 
195
     * \param type specifies the seek mode.
 
196
     *
 
197
     * \sa isValid()
 
198
     */
 
199
    HSeekMode(Type type);
 
200
 
 
201
    /*!
 
202
     * Creates a new instance from the specified string.
 
203
     *
 
204
     * \param arg specifies the record quality mode. If the specified string does not
 
205
     * correspond to any Type value and the string is not empty, the type() is set to
 
206
     * HSeekMode::VendorDefined.
 
207
     *
 
208
     * \sa isValid()
 
209
     */
 
210
    HSeekMode(const QString&);
 
211
 
 
212
    /*!
 
213
     * \brief Indicates if the object is valid.
 
214
     *
 
215
     * \return \e true in case the object is valid, i.e. the type() is
 
216
     * not HSeekMode::Undefined.
 
217
     */
 
218
    inline bool isValid() const { return m_type != Unknown; }
 
219
 
 
220
    /*!
 
221
     * \brief Returns a string representation of the object.
 
222
     *
 
223
     * \return a string representation of the object.
 
224
     */
 
225
    QString toString() const;
 
226
 
 
227
    /*!
 
228
     * \brief Returns the Type value.
 
229
     *
 
230
     * \return The Type value.
 
231
     */
 
232
    inline Type type() const { return m_type; }
 
233
 
 
234
    /*!
 
235
     * Converts the specified Type value to string.
 
236
     *
 
237
     * \param type specifies the Type value to be converted to string.
 
238
     *
 
239
     * \return a string representation of the specified Type value.
 
240
     */
 
241
    static QString toString(Type type);
 
242
 
 
243
    /*!
 
244
     * \brief Returns a Type value corresponding to the specified string, if any.
 
245
     *
 
246
     * \param type specifies the Type as string.
 
247
     *
 
248
     * \return a Type value corresponding to the specified string, if any.
 
249
     */
 
250
    static Type fromString(const QString& type);
 
251
};
 
252
 
 
253
/*!
 
254
 * Compares the two objects for equality.
 
255
 *
 
256
 * \return \e true in case the objects are logically equivalent.
 
257
 *
 
258
 * \relates HSeekMode
 
259
 */
 
260
H_UPNP_AV_EXPORT bool operator==(const HSeekMode& obj1, const HSeekMode& obj2);
 
261
 
 
262
/*!
 
263
 * Compares the two objects for inequality.
 
264
 *
 
265
 * \return \e true in case the objects are not logically equivalent.
 
266
 *
 
267
 * \relates HSeekMode
 
268
 */
 
269
inline bool operator!=(const HSeekMode& obj1, const HSeekMode& obj2)
 
270
{
 
271
    return !(obj1 == obj2);
 
272
}
 
273
 
 
274
class HSeekInfoPrivate;
 
275
 
 
276
/*!
 
277
 * \brief This class is used to contain information that is required to run a
 
278
 * AVTransport seek() operation.
 
279
 *
 
280
 * \headerfile hseekinfo.h HSeekInfo
 
281
 *
 
282
 * \ingroup hupnp_av_avt
 
283
 *
 
284
 * \remarks This class is not thread-safe.
 
285
 *
 
286
 * \sa HAbstractTransportService::seek(), HAvTransportAdapter::seek()
 
287
 */
 
288
class H_UPNP_AV_EXPORT HSeekInfo
 
289
{
 
290
 
 
291
private:
 
292
 
 
293
    QSharedDataPointer<HSeekInfoPrivate> h_ptr;
 
294
 
 
295
public:
 
296
 
 
297
    /*!
 
298
     * Creates a new, invalid instance.
 
299
     *
 
300
     * \sa isValid()
 
301
     */
 
302
    HSeekInfo();
 
303
 
 
304
    /*!
 
305
     * \brief Creates a new instance.
 
306
     *
 
307
     * \param unit specifies how the \a target value should be interpreted.
 
308
     *
 
309
     * \param target specifies the value that indicates the target position.
 
310
     *
 
311
     * \sa isValid()
 
312
     */
 
313
    HSeekInfo(const HSeekMode& unit, const QString& target);
 
314
 
 
315
    /*!
 
316
     * \brief Copy constructor.
 
317
     *
 
318
     * Creates a copy of \c other.
 
319
     */
 
320
    HSeekInfo(const HSeekInfo&);
 
321
 
 
322
    /*!
 
323
     * \brief Assignment operator.
 
324
     *
 
325
     * Copies the contents of \c other to this.
 
326
     *
 
327
     * \return a reference to this.
 
328
     */
 
329
    HSeekInfo& operator=(const HSeekInfo&);
 
330
 
 
331
    /*!
 
332
     * \brief Destroys the instance.
 
333
     */
 
334
    ~HSeekInfo();
 
335
 
 
336
    /*!
 
337
     * \brief Indicates if the object is valid.
 
338
     *
 
339
     * \return \e true in case the object is valid, i.e. unit() is
 
340
     * not valid.
 
341
     */
 
342
    bool isValid() const;
 
343
 
 
344
    /*!
 
345
     * \brief Returns the seek mode, which indicates how the target() value should be
 
346
     * interpreted.
 
347
     *
 
348
     * \return The seek mode, which indicates how the target() value should be
 
349
     * interpreted.
 
350
     */
 
351
    HSeekMode unit() const;
 
352
 
 
353
    /*!
 
354
     * \brief Returns the value that indicates the target position.
 
355
     *
 
356
     * \return The value that indicates the target position.
 
357
     */
 
358
    QString target() const;
 
359
};
 
360
 
 
361
/*!
 
362
 * Compares the two objects for equality.
 
363
 *
 
364
 * \return \e true in case the objects are logically equivalent.
 
365
 *
 
366
 * \relates HSeekInfo
 
367
 */
 
368
H_UPNP_AV_EXPORT bool operator==(const HSeekInfo& obj1, const HSeekInfo& obj2);
 
369
 
 
370
/*!
 
371
 * Compares the two objects for inequality.
 
372
 *
 
373
 * \return \e true in case the objects are not logically equivalent.
 
374
 *
 
375
 * \relates HSeekInfo
 
376
 */
 
377
inline bool operator!=(const HSeekInfo& obj1, const HSeekInfo& obj2)
 
378
{
 
379
    return !(obj1 == obj2);
 
380
}
 
381
 
 
382
}
 
383
}
 
384
}
 
385
 
 
386
#endif /* HSEEKINFO_H_ */