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/>.
25
#include <HUpnpAv/HUpnpAv>
27
#include <QtCore/QString>
28
#include <QtCore/QSharedDataPointer>
40
* \brief This is a convenience class for working with Seek Modes defined in the
41
* AVTransport:2 specification.
43
* \headerfile hseekinfo.h HSeekMode
45
* \ingroup hupnp_av_avt
47
* \remarks This class is not thread-safe.
49
class H_UPNP_AV_EXPORT HSeekMode
55
* \brief This enumeration specifies the Seek Modes defined in the
56
* AVTransport:2 specification.
58
* \remarks Many of the descriptions here are more or less direct quotes
59
* from the AV Transport:2 specification, section 2.4.13.
64
* The seek mode is undefined.
71
* Seeks to the beginning of a particular track number.
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.
83
* The range is from "00:00:00" to the duration of the current media.
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.
98
* The range is from 0 to 2147483646, where 0 corresponds to the beginning
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.
115
* Seeks to the specified channel frequency.
120
* Seeks to the pre-defined index at the current media, measured
121
* from the beginning of the media.
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.
127
* For more information, see the AV Transport:2 specification, section
133
* Seeks to the pre-defined index at the current media, measured
134
* from the current position on the media.
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.
140
* For more information, see the AV Transport:2 specification, section
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.
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.
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
181
QString m_typeAsString;
186
* Creates a new, invalid instance.
193
* \brief Creates a new instance.
195
* \param type specifies the seek mode.
199
HSeekMode(Type type);
202
* Creates a new instance from the specified string.
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.
210
HSeekMode(const QString&);
213
* \brief Indicates if the object is valid.
215
* \return \e true in case the object is valid, i.e. the type() is
216
* not HSeekMode::Undefined.
218
inline bool isValid() const { return m_type != Unknown; }
221
* \brief Returns a string representation of the object.
223
* \return a string representation of the object.
225
QString toString() const;
228
* \brief Returns the Type value.
230
* \return The Type value.
232
inline Type type() const { return m_type; }
235
* Converts the specified Type value to string.
237
* \param type specifies the Type value to be converted to string.
239
* \return a string representation of the specified Type value.
241
static QString toString(Type type);
244
* \brief Returns a Type value corresponding to the specified string, if any.
246
* \param type specifies the Type as string.
248
* \return a Type value corresponding to the specified string, if any.
250
static Type fromString(const QString& type);
254
* Compares the two objects for equality.
256
* \return \e true in case the objects are logically equivalent.
260
H_UPNP_AV_EXPORT bool operator==(const HSeekMode& obj1, const HSeekMode& obj2);
263
* Compares the two objects for inequality.
265
* \return \e true in case the objects are not logically equivalent.
269
inline bool operator!=(const HSeekMode& obj1, const HSeekMode& obj2)
271
return !(obj1 == obj2);
274
class HSeekInfoPrivate;
277
* \brief This class is used to contain information that is required to run a
278
* AVTransport seek() operation.
280
* \headerfile hseekinfo.h HSeekInfo
282
* \ingroup hupnp_av_avt
284
* \remarks This class is not thread-safe.
286
* \sa HAbstractTransportService::seek(), HAvTransportAdapter::seek()
288
class H_UPNP_AV_EXPORT HSeekInfo
293
QSharedDataPointer<HSeekInfoPrivate> h_ptr;
298
* Creates a new, invalid instance.
305
* \brief Creates a new instance.
307
* \param unit specifies how the \a target value should be interpreted.
309
* \param target specifies the value that indicates the target position.
313
HSeekInfo(const HSeekMode& unit, const QString& target);
316
* \brief Copy constructor.
318
* Creates a copy of \c other.
320
HSeekInfo(const HSeekInfo&);
323
* \brief Assignment operator.
325
* Copies the contents of \c other to this.
327
* \return a reference to this.
329
HSeekInfo& operator=(const HSeekInfo&);
332
* \brief Destroys the instance.
337
* \brief Indicates if the object is valid.
339
* \return \e true in case the object is valid, i.e. unit() is
342
bool isValid() const;
345
* \brief Returns the seek mode, which indicates how the target() value should be
348
* \return The seek mode, which indicates how the target() value should be
351
HSeekMode unit() const;
354
* \brief Returns the value that indicates the target position.
356
* \return The value that indicates the target position.
358
QString target() const;
362
* Compares the two objects for equality.
364
* \return \e true in case the objects are logically equivalent.
368
H_UPNP_AV_EXPORT bool operator==(const HSeekInfo& obj1, const HSeekInfo& obj2);
371
* Compares the two objects for inequality.
373
* \return \e true in case the objects are not logically equivalent.
377
inline bool operator!=(const HSeekInfo& obj1, const HSeekInfo& obj2)
379
return !(obj1 == obj2);
386
#endif /* HSEEKINFO_H_ */