source: trunk/src/3rdparty/phonon/mmf/effectparameter.h

Last change on this file was 651, checked in by Dmitry A. Kuminov, 16 years ago

trunk: Merged in qt 4.6.2 sources.

File size: 2.4 KB
Line 
1/* This file is part of the KDE project.
2
3Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4
5This library is free software: you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation, either version 2.1 or 3 of the License.
8
9This library is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU Lesser General Public License for more details.
13
14You should have received a copy of the GNU Lesser General Public License
15along with this library. If not, see <http://www.gnu.org/licenses/>.
16
17*/
18
19#ifndef PHONON_MMF_EFFECTPARAMETER_H
20#define PHONON_MMF_EFFECTPARAMETER_H
21
22#include <phonon/effectparameter.h>
23
24QT_BEGIN_NAMESPACE
25
26namespace Phonon
27{
28namespace MMF
29{
30
31/**
32 * @short Parameter value for an audio effect
33 *
34 * The base class is extended in order to work around a shortcoming
35 * in Phonon::EffectWidget. This widget only displays sliders for
36 * parameters with numeric values if the variant type of the parameter
37 * is QReal and the range is exactly -1.0 to +1.0; otherwise, a
38 * spinbox is used to set numeric parameters. This is rather
39 * inconvenient for many effects, such as the audio equalizer, for
40 * which a slider is a much more natural UI control.
41 *
42 * For many such parameters, we therefore report the type to be QReal
43 * and the range to be -1.0 to +1.0. This class stores the actual
44 * integer range for the parameter, and provides the toInternalValue
45 * function for converting between the client-side floating point
46 * value and the internal integer value.
47 */
48class EffectParameter : public Phonon::EffectParameter
49{
50public:
51 EffectParameter();
52 EffectParameter(int parameterId, const QString &name, Hints hints,
53 const QVariant &defaultValue, const QVariant &min = QVariant(),
54 const QVariant &max = QVariant(), const QVariantList &values = QVariantList(),
55 const QString &description = QString());
56
57 void setInternalRange(qint32 min, qint32 max);
58 qint32 toInternalValue(qreal external) const;
59
60 static qreal toExternalValue(qint32 value, qint32 min, qint32 max);
61
62private:
63 bool m_hasInternalRange;
64 QPair<qint32, qint32> m_internalRange;
65
66};
67
68}
69}
70
71QT_END_NAMESPACE
72
73#endif
74
Note: See TracBrowser for help on using the repository browser.