File indexing completed on 2024-04-21 04:43:15

0001 /*  This file is part of the KDE project
0002     Copyright (C) 2005-2007 Matthias Kretz <kretz@kde.org>
0003 
0004     This library is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU Lesser General Public
0006     License as published by the Free Software Foundation; either
0007     version 2.1 of the License, or (at your option) version 3, or any
0008     later version accepted by the membership of KDE e.V. (or its
0009     successor approved by the membership of KDE e.V.), Nokia Corporation
0010     (or its successors, if any) and the KDE Free Qt Foundation, which shall
0011     act as a proxy defined in Section 6 of version 3 of the license.
0012 
0013     This library is distributed in the hope that it will be useful,
0014     but WITHOUT ANY WARRANTY; without even the implied warranty of
0015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016     Lesser General Public License for more details.
0017 
0018     You should have received a copy of the GNU Lesser General Public
0019     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
0020 
0021 */
0022 
0023 
0024 #ifndef PHONON_EFFECT_H
0025 #define PHONON_EFFECT_H
0026 
0027 #include "phonondefs.h"
0028 #include <QObject>
0029 #include "objectdescription.h"
0030 #include "medianode.h"
0031 
0032 
0033 #ifndef QT_NO_PHONON_EFFECT
0034 
0035 class QString;
0036 template<class T> class QList;
0037 
0038 namespace Phonon
0039 {
0040     class EffectParameter;
0041     class EffectPrivate;
0042 
0043     /** \class Effect effect.h phonon/Effect
0044      * \short Effects that can be inserted into a Path.
0045      * An effect is a special object which can perform
0046      * transformations on the specified path. Examples may include simple
0047      * modifiers such as fading or pitch shifting, or more complex mathematical
0048      * transformations.
0049      *
0050      * In order to use an effect, insert it into the path as follows:
0051      * \code
0052      * Path path = Phonon::createPath(...);
0053      * Effect *effect = new Effect(this);
0054      * path.insertEffect(effect);
0055      * \endcode
0056      *
0057      * The effect will immediately begin applying it's transformations on
0058      * the path. To stop it, remove the Effect from the path.
0059      *
0060      * \ingroup PhononEffects
0061      * \author Matthias Kretz <kretz@kde.org>
0062      */
0063     class PHONON_EXPORT Effect : public QObject, public MediaNode
0064     {
0065         Q_OBJECT
0066         P_DECLARE_PRIVATE(Effect)
0067 
0068         public:
0069             ~Effect() override;
0070 
0071 //X             enum Type {
0072 //X                 AudioEffect,
0073 //X                 VideoEffect
0074 //X             };
0075 
0076             /**
0077              * QObject constructor.
0078              *
0079              * \param description An EffectDescription object to determine the
0080              * type of effect. See BackendCapabilities::availableAudioEffects().
0081              * \param parent QObject parent
0082              */
0083             explicit Effect(const EffectDescription &description, QObject *parent = nullptr);
0084 
0085 //X             Type type() const;
0086 
0087             /**
0088              * Returns the description of this effect. This is the same type as was
0089              * passed to the constructor.
0090              */
0091             EffectDescription description() const;
0092 
0093             /**
0094              * Returns a list of parameters that this effect provides to control
0095              * its behaviour.
0096              *
0097              * \see EffectParameter
0098              * \see EffectWidget
0099              */
0100             QList<EffectParameter> parameters() const;
0101 
0102             QVariant parameterValue(const EffectParameter&) const;
0103             void setParameterValue(const EffectParameter&, const QVariant &value);
0104 
0105         protected:
0106             Effect(EffectPrivate &dd, QObject *parent);
0107     };
0108 } //namespace Phonon
0109 
0110 #endif // QT_NO_EFFECT
0111 
0112 
0113 // vim: sw=4 ts=4 tw=80
0114 #endif // PHONON_EFFECT_H
0115