Phonon  4.7.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
effectparameter.h
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 
31 
32 #ifndef QT_NO_PHONON_EFFECT
33 
34 namespace Phonon
35 {
36 
37 class Effect;
38 class EffectParameterPrivate;
39 
47 class PHONON_EXPORT EffectParameter
48 {
49  friend class BrightnessControl;
50  public:
57 
63  const QString &name() const;
64 
74  const QString &description() const;
75 
82  QVariant::Type type() const;
83 
89  bool isLogarithmicControl() const;
90 
97  QVariant minimumValue() const;
98 
105  QVariant maximumValue() const;
106 
110  QVariant defaultValue() const;
111 
118  QVariantList possibleValues() const;
119 
124  bool operator<(const EffectParameter &rhs) const;
125 
130  bool operator>(const EffectParameter &rhs) const;
131 
136  bool operator==(const EffectParameter &rhs) const;
137 
138  /* dtor, cctor and operator= for forward decl of EffectParameterPrivate */
139  ~EffectParameter();
140  EffectParameter(const EffectParameter &rhs);
141  EffectParameter &operator=(const EffectParameter &rhs);
142 
151  enum Hint {
158  ToggledHint = 0x04,
159 
160  /* LADSPA's SAMPLE_RATE hint needs to be translated by the backend
161  * to normal bounds, as the backend knows the sample rate - and the
162  * frontend doesn't */
163 
167  LogarithmicHint = 0x10,
171  IntegerHint = 0x20
172  };
173  Q_DECLARE_FLAGS(Hints, Hint)
174 
175 
199  EffectParameter(int parameterId, const QString &name, Hints hints,
200  const QVariant &defaultValue, const QVariant &min = QVariant(),
201  const QVariant &max = QVariant(), const QVariantList &values = QVariantList(),
202  const QString &description = QString());
203 
209  int id() const;
210 
211  protected:
215  QExplicitlySharedDataPointer<EffectParameterPrivate> d;
216 };
217 
218 uint PHONON_EXPORT qHash(const Phonon::EffectParameter &param);
219 
220 } // namespace Phonon
221 
222 #if defined(Q_CC_MSVC) && _MSC_VER <= 1300
223 //this ensures that code outside Phonon can use the hash function
224 //it also a workaround for some compilers
225 inline uint qHash(const Phonon::EffectParameter &param) { return Phonon::qHash(param); } //krazy:exclude=inline
226 #endif
227 Q_DECLARE_OPERATORS_FOR_FLAGS(Phonon::EffectParameter::Hints)
228 
229 #endif //QT_NO_PHONON_EFFECT
230 
231 
232 #endif // PHONON_EFFECTPARAMETER_H
233 // vim: sw=4 ts=4 tw=80