Phonon

effectparameter.cpp
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#include "effectparameter.h"
24#include "effectparameter_p.h"
25
26#ifndef QT_NO_PHONON_EFFECT
27
28namespace Phonon
29{
30
31uint qHash(const Phonon::EffectParameter &param)
32{
33 return param.id();
34}
35
37 : d(new EffectParameterPrivate)
38{
39}
40
41EffectParameter::EffectParameter(int parameterId, const QString &name, Hints hints,
42 const QVariant &defaultValue, const QVariant &min, const QVariant &max,
43 const QVariantList &values, const QString &description)
44 : d(new EffectParameterPrivate)
45{
46 d->parameterId = parameterId;
47 d->min = min;
48 d->max = max;
49 d->defaultValue = defaultValue;
50 d->name = name;
51 d->possibleValues = values;
52 d->description = description;
53 d->hints = hints;
54}
55
56EffectParameter::~EffectParameter()
57{
58}
59
60EffectParameter::EffectParameter(const EffectParameter &rhs)
61 : d(rhs.d)
62{
63}
64
65EffectParameter &EffectParameter::operator=(const EffectParameter &rhs)
66{
67 d = rhs.d;
68 return *this;
69}
70
72{
73 return d->parameterId < rhs.d->parameterId;
74}
75
77{
78 return d->parameterId == rhs.d->parameterId;
79}
80
82{
83 return d->parameterId > rhs.d->parameterId;
84}
85
87{
88 return d->name;
89}
90
92{
93 return d->description;
94}
95
97{
98 return d->hints & LogarithmicHint;
99}
100
102{
103 if (d->possibleValues.isEmpty()) {
104 return d->defaultValue.type();
105 }
106 return QVariant::String;
107}
108
110{
111 return d->possibleValues;
112}
113
115{
116 return d->min;
117}
118
120{
121 return d->max;
122}
123
125{
126 return d->defaultValue;
127}
128
130{
131 return d->parameterId;
132}
133
134}
135
136#endif //QT_NO_PHONON_EFFECT
137
138// vim: sw=4 ts=4
This class describes one parameter of an effect.
bool isLogarithmicControl() const
Returns whether the parameter should be displayed using a logarithmic scale.
QVariant::Type type() const
Returns the parameter type.
QVariant defaultValue() const
The default value.
bool operator==(const EffectParameter &rhs) const
QVariantList possibleValues() const
The possible values to be used for the control to edit the parameter.
QVariant minimumValue() const
The minimum value to be used for the control to edit the parameter.
QVariant maximumValue() const
The maximum value to be used for the control to edit the parameter.
bool operator>(const EffectParameter &rhs) const
const QString & name() const
The name of the parameter.
const QString & description() const
The parameter may come with a description (LADSPA doesn't have a field for this, so don't expect many...
bool operator<(const EffectParameter &rhs) const
QExplicitlySharedDataPointer< EffectParameterPrivate > d
The data is implicitly shared.
KTEXTEDITOR_EXPORT size_t qHash(KTextEditor::Cursor cursor, size_t seed=0) noexcept
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.