phonon/effectparameter.h Source File

effectparameter.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 2006 Matthias Kretz <kretz@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) version 3, or any
8  later version accepted by the membership of KDE e.V. (or its
9  successor approved by the membership of KDE e.V.), Nokia Corporation
10  (or its successors, if any) and the KDE Free Qt Foundation, which shall
11  act as a proxy defined in Section 6 of version 3 of the license.
12 
13  This library 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 GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #ifndef PHONON_EFFECTPARAMETER_H
24 #define PHONON_EFFECTPARAMETER_H
25 
26 #include "phonon_export.h"
27 
28 #include <QtCore/QExplicitlySharedDataPointer>
29 #include <QtCore/QVariant>
30 
33 
34 #ifndef QT_NO_PHONON_EFFECT
35 
36 namespace Phonon
37 {
38 
39 class Effect;
40 class EffectParameterPrivate;
41 
50 {
51  friend class BrightnessControl;
52  public:
59 
65  const QString &name() const;
66 
76  const QString &description() const;
77 
84  QVariant::Type type() const;
85 
91  bool isLogarithmicControl() const;
92 
99  QVariant minimumValue() const;
100 
107  QVariant maximumValue() const;
108 
112  QVariant defaultValue() const;
113 
120  QVariantList possibleValues() const;
121 
126  bool operator<(const EffectParameter &rhs) const;
127 
132  bool operator>(const EffectParameter &rhs) const;
133 
138  bool operator==(const EffectParameter &rhs) const;
139 
140  /* dtor, cctor and operator= for forward decl of EffectParameterPrivate */
141  ~EffectParameter();
142  EffectParameter(const EffectParameter &rhs);
143  EffectParameter &operator=(const EffectParameter &rhs);
144 
153  enum Hint {
160  ToggledHint = 0x04,
161 
162  /* LADSPA's SAMPLE_RATE hint needs to be translated by the backend
163  * to normal bounds, as the backend knows the sample rate - and the
164  * frontend doesn't */
165 
169  LogarithmicHint = 0x10,
173  IntegerHint = 0x20
174  };
175  Q_DECLARE_FLAGS(Hints, Hint)
176 
177 
201  EffectParameter(int parameterId, const QString &name, Hints hints,
202  const QVariant &defaultValue, const QVariant &min = QVariant(),
203  const QVariant &max = QVariant(), const QVariantList &values = QVariantList(),
204  const QString &description = QString());
205 
211  int id() const;
212 
213  protected:
217  QExplicitlySharedDataPointer<EffectParameterPrivate> d;
218 };
219 
221 
222 } // namespace Phonon
223 
224 #if defined(Q_CC_MSVC) && _MSC_VER <= 1300
225 //this ensures that code outside Phonon can use the hash function
226 //it also a workaround for some compilers
227 inline uint qHash(const Phonon::EffectParameter &param) { return Phonon::qHash(param); } //krazy:exclude=inline
228 #endif
229 Q_DECLARE_OPERATORS_FOR_FLAGS(Phonon::EffectParameter::Hints)
230 
231 #endif //QT_NO_PHONON_EFFECT
232 
235 
236 #endif // PHONON_EFFECTPARAMETER_H
237 // vim: sw=4 ts=4 tw=80
GLuint GLuint GLsizei GLenum type
Definition: GLee.h:872
uint PHONON_EXPORT qHash(const Phonon::EffectParameter &param)
#define QT_END_NAMESPACE
Definition: qglobal.h:128
int int * max
Definition: GLee.h:10568
#define QT_BEGIN_HEADER
Definition: qglobal.h:141
bool operator>(const QByteArray &a1, const QByteArray &a2)
Definition: qbytearray.h:551
Hint
Only for backend developers:
bool operator==(const Attribute &cA, const AttributeInstance< type > &cB)
This operator compares the two attributes and NOT their values.
Definition: node.h:577
#define QT_BEGIN_NAMESPACE
Definition: qglobal.h:127
This class describes one parameter of an effect.
GLuint const GLchar * name
Definition: GLee.h:1704
The KDE Multimedia classes.
bool operator<(const QByteArray &a1, const QByteArray &a2)
Definition: qbytearray.h:539
GLboolean GLenum GLenum GLvoid * values
Definition: GLee.h:895
#define PHONON_EXPORT
Definition: phonon_export.h:38
#define QT_END_HEADER
Definition: qglobal.h:142
GLfloat param
Definition: GLee.h:1364