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
#ifndef HSTATEVARIABLECOLLECTION_H_
23
#define HSTATEVARIABLECOLLECTION_H_
25
#include <HUpnpAv/HUpnpAv>
26
#include <HUpnpAv/HChannel>
28
#include <QtCore/QMetaType>
29
#include <QtCore/QSharedDataPointer>
41
* Encapsulates the state of a single state variable.
43
* \headerfile hstatevariablecollection.h HStateVariableData
45
* \ingroup hupnp_av_cds_common
47
* \remarks This class is not thread-safe.
49
class H_UPNP_AV_EXPORT HStateVariableData
53
QString m_svName, m_svValue;
59
* Creates a new, invalid instance.
66
* Creates a new, invalid instance.
68
* \param name specifies the name of the state variable.
70
* \param value specifies the value of the state variable.
75
const QString& name, const QString& value, const HChannel& = HChannel());
78
* \brief Indicates if the object is valid.
80
* \return \e true if the object is valid, i.e. name() is defined.
85
* \brief Returns the name of the state variable.
87
* \return The name of the state variable.
89
inline QString name() const
95
* \brief Returns the value of the state variable.
97
* \return The value of the state variable.
99
inline QString value() const
105
* \brief Returns the associated channel of audio stream, if any.
107
* \return The associated channel of audio stream, if any.
109
inline const HChannel& channel() const
115
* \brief Specifies the name of the state variable.
117
* \param arg specifies the name of the state variable.
119
void setName(const QString& arg);
122
* \brief Specifies the value of the state variable.
124
* \param arg specifies the value of the state variable.
126
void setValue(const QString& arg);
129
* \brief Specifies the associated channel of audio stream.
131
* \param arg specifies the associated channel of audio stream.
133
void setChannel(const HChannel& arg);
137
* Compares the two objects for equality.
139
* \return \e true in case the objects are logically equivalent.
141
* \relates HStateVariableData
143
H_UPNP_AV_EXPORT bool operator==(const HStateVariableData& obj1, const HStateVariableData& obj2);
146
* Compares the two objects for inequality.
148
* \return \e true in case the objects are not logically equivalent.
150
* \relates HStateVariableData
152
inline bool operator!=(const HStateVariableData& obj1, const HStateVariableData& obj2)
154
return !(obj1 == obj2);
157
class HStateVariableCollectionPrivate;
160
* \brief This class is used to encapsulate the state of a set of state variables.
162
* \headerfile hstatevariablecollection.h HStateVariableCollection
164
* \ingroup hupnp_av_cds_common
166
* \remarks This class is not thread-safe.
168
class H_UPNP_AV_EXPORT HStateVariableCollection
172
QSharedDataPointer<HStateVariableCollectionPrivate> h_ptr;
177
* \brief This enumeration specifies whether a RenderingControl service instance
178
* is pre-mix or post-mix.
180
* \see ContentDirectory:3, Appendix B.13.5.2.
185
* The RCS instance type is not defined.
201
* Creates a new, invalid instance.
205
HStateVariableCollection();
208
* Creates a new, invalid instance.
212
HStateVariableCollection(
213
const QString& serviceName, RcsInstanceType rcsInstanceType = Undefined);
216
* \brief Destroys the instance.
218
~HStateVariableCollection();
221
* \brief Copy constructor.
223
* Creates a copy of \c other.
225
HStateVariableCollection(const HStateVariableCollection&);
228
* \brief Assignment operator.
230
* Copies the contents of \c other to this.
232
HStateVariableCollection& operator=(const HStateVariableCollection&);
235
* \brief Indicates if the object is valid.
237
* \return \e true if the object is valid, i.e. serviceName() is defined.
239
bool isValid() const;
242
* Converts the specified RcsInstanceType value to string.
244
* \param type specifies the RcsInstanceType value to be converted to string.
246
* \return a string representation of the specified RcsInstanceType value.
248
static QString toString(RcsInstanceType type);
251
* \brief Returns a RcsInstanceType value corresponding to the specified string, if any.
253
* \param type specifies the RcsInstanceType as string.
255
* \return a RcsInstanceType value corresponding to the specified string, if any.
257
static RcsInstanceType fromString(const QString& type);
260
* \brief Returns the name of the service from which the state variables were retrieved.
262
* \return The name of the service from which the state variables were retrieved.
264
QString serviceName() const;
267
* \brief Indicates whether a RenderingControl service instance
268
* is pre-mix or post-mix.
270
* \return a value indicating whether a RenderingControl service instance
271
* is pre-mix or post-mix.
273
RcsInstanceType rcsInstanceType() const;
276
* \brief Returns the state variable data.
278
* \return The state variable data.
280
* \sa setStateVariables()
282
QList<HStateVariableData> stateVariables() const;
285
* \brief Specifies whether a RenderingControl service instance
286
* is pre-mix or post-mix.
288
* \param arg specifies whether a RenderingControl service instance
289
* is pre-mix or post-mix.
291
* \sa rcsInstanceType()
293
void setRcsInstanceType(RcsInstanceType arg);
296
* \brief Specifies the state variable data.
298
* \param arg specifies the state variable data.
300
* \sa stateVariables()
302
void setStateVariables(const QList<HStateVariableData>& arg);
305
* Adds a new state variable data instance to the collection.
307
* \param arg specifies the state variable data instance to add.
309
* \sa setStateVariables()
311
* \remarks only valid HStateVariableData instances are added.
313
void add(const HStateVariableData& arg);
317
* Compares the two objects for equality.
319
* \return \e true in case the objects are logically equivalent.
321
* \relates HStateVariableCollection
323
H_UPNP_AV_EXPORT bool operator==(const HStateVariableCollection& obj1, const HStateVariableCollection& obj2);
326
* Compares the two objects for inequality.
328
* \return \e true in case the objects are not logically equivalent.
330
* \relates HStateVariableCollection
332
inline bool operator!=(const HStateVariableCollection& obj1, const HStateVariableCollection& obj2)
334
return !(obj1 == obj2);
341
Q_DECLARE_METATYPE(Herqq::Upnp::Av::HStateVariableCollection)
343
#endif /* HSTATEVARIABLECOLLECTION_H_ */