File indexing completed on 2024-12-01 04:21:25

0001 /*
0002     Copyright (C) 2007-2008 Tanguy Krotoff <tkrotoff@gmail.com>
0003     Copyright (C) 2008 Lukas Durfina <lukas.durfina@gmail.com>
0004     Copyright (C) 2009 Fathi Boudra <fabo@kde.org>
0005     Copyright (C) 2009-2011 vlc-phonon AUTHORS <kde-multimedia@kde.org>
0006 
0007     This library is free software; you can redistribute it and/or
0008     modify it under the terms of the GNU Lesser General Public
0009     License as published by the Free Software Foundation; either
0010     version 2.1 of the License, or (at your option) any later version.
0011 
0012     This library is distributed in the hope that it will be useful,
0013     but WITHOUT ANY WARRANTY; without even the implied warranty of
0014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015     Lesser General Public License for more details.
0016 
0017     You should have received a copy of the GNU Lesser General Public
0018     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
0019 */
0020 
0021 #ifndef PHONON_VLC_EFFECT_H
0022 #define PHONON_VLC_EFFECT_H
0023 
0024 #include "sinknode.h"
0025 #include "effectmanager.h"
0026 
0027 #include <phonon/effectinterface.h>
0028 #include <phonon/effectparameter.h>
0029 
0030 namespace Phonon
0031 {
0032 namespace VLC
0033 {
0034 
0035 class EffectManager;
0036 
0037 /** \brief Effect implementation for Phonon-VLC
0038  *
0039  * There are methods to get or set the effect parameters, implemented for
0040  * the EffectInterface. See the Phonon documentation for details.
0041  *
0042  * As a sink node, it provides methods to handle the connection to a media object.
0043  *
0044  * An effect manager is the parent of each effect.
0045  *
0046  * \see EffectManager
0047  * \see VolumeFaderEffect
0048  */
0049 class Effect : public QObject, public SinkNode, public EffectInterface
0050 {
0051     Q_OBJECT
0052     Q_INTERFACES(Phonon::EffectInterface)
0053 
0054 public:
0055 
0056     Effect(EffectManager *p_em, int i_effectId, QObject *p_parent);
0057     ~Effect();
0058 
0059     void setupEffectParams();
0060     QList<EffectParameter> parameters() const override;
0061     QVariant parameterValue(const EffectParameter &param) const override;
0062     void setParameterValue(const EffectParameter &param, const QVariant &newValue) override;
0063 
0064     /** \reimp */
0065     void handleConnectToMediaObject(MediaObject *p_media_object) override;
0066     /** \reimp */
0067     void handleDisconnectFromMediaObject(MediaObject *p_media_object) override;
0068 
0069 private:
0070 
0071     EffectManager *p_effectManager;
0072     int i_effect_filter;
0073     EffectInfo::Type effect_type;
0074     QList<Phonon::EffectParameter> parameterList;
0075 };
0076 
0077 }
0078 } // Namespace Phonon::VLC
0079 
0080 #endif // PHONON_VLC_EFFECT_H