| 1 | /* |
| 2 | Copyright (C) 2007-2008 Tanguy Krotoff <tkrotoff@gmail.com> |
| 3 | Copyright (C) 2008 Lukas Durfina <lukas.durfina@gmail.com> |
| 4 | Copyright (C) 2009 Fathi Boudra <fabo@kde.org> |
| 5 | Copyright (C) 2009-2011 vlc-phonon AUTHORS <kde-multimedia@kde.org> |
| 6 | Copyright (C) 2011 Harald Sitter <sitter@kde.org> |
| 7 | |
| 8 | This library is free software; you can redistribute it and/or |
| 9 | modify it under the terms of the GNU Lesser General Public |
| 10 | License as published by the Free Software Foundation; either |
| 11 | version 2.1 of the License, or (at your option) any later version. |
| 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 | #ifndef Phonon_VLC_EFFECTMANAGER_H |
| 23 | #define Phonon_VLC_EFFECTMANAGER_H |
| 24 | |
| 25 | #include <QtCore/QObject> |
| 26 | |
| 27 | namespace Phonon { |
| 28 | namespace VLC { |
| 29 | |
| 30 | class Backend; |
| 31 | class EffectManager; |
| 32 | |
| 33 | /// Holds information about an effect |
| 34 | class EffectInfo |
| 35 | { |
| 36 | public: |
| 37 | |
| 38 | enum Type {AudioEffect, VideoEffect}; |
| 39 | |
| 40 | EffectInfo(const QString &name, |
| 41 | const QString &description, |
| 42 | const QString &author, |
| 43 | int filter, |
| 44 | Type type); |
| 45 | |
| 46 | QString name() const { |
| 47 | return m_name; |
| 48 | } |
| 49 | |
| 50 | QString description() const { |
| 51 | return m_description; |
| 52 | } |
| 53 | |
| 54 | QString author() const { |
| 55 | return m_author; |
| 56 | } |
| 57 | |
| 58 | int filter() const { |
| 59 | return m_filter; |
| 60 | } |
| 61 | |
| 62 | Type type() const { |
| 63 | return m_type; |
| 64 | } |
| 65 | |
| 66 | private: |
| 67 | QString m_name; |
| 68 | QString m_description; |
| 69 | QString m_author; |
| 70 | int m_filter; |
| 71 | Type m_type; |
| 72 | }; |
| 73 | |
| 74 | /** \brief Manages a list of effects. |
| 75 | * |
| 76 | * \see EffectInfo |
| 77 | */ |
| 78 | class EffectManager : public QObject |
| 79 | { |
| 80 | Q_OBJECT |
| 81 | public: |
| 82 | /** |
| 83 | * Creates a new effect manager. It creates the lists of effects. |
| 84 | * |
| 85 | * \param backend A parent backend object for the effect manager |
| 86 | * |
| 87 | * \warning Currently it doesn't add any effects, everything is disabled. |
| 88 | * \see EffectInfo |
| 89 | */ |
| 90 | explicit EffectManager(QObject *parent = nullptr); |
| 91 | |
| 92 | /// Deletes all the effects from the lists and destroys the effect manager. |
| 93 | ~EffectManager(); |
| 94 | |
| 95 | /// Returns a list of available audio effects |
| 96 | const QList<EffectInfo> audioEffects() const; |
| 97 | |
| 98 | /// Returns a list of available video effects |
| 99 | const QList<EffectInfo> videoEffects() const; |
| 100 | |
| 101 | /// Returns a list of available effects |
| 102 | const QList<EffectInfo> effects() const; |
| 103 | |
| 104 | QObject *createEffect(int id, QObject *parent); |
| 105 | |
| 106 | private: |
| 107 | /// Generates the aggegated list of effects from both video and audio |
| 108 | void updateEffects(); |
| 109 | |
| 110 | QList<EffectInfo> m_effectList; |
| 111 | QList<EffectInfo> m_audioEffectList; |
| 112 | QList<EffectInfo> m_videoEffectList; |
| 113 | bool m_equalizerEnabled; |
| 114 | }; |
| 115 | |
| 116 | } // namespace VLC |
| 117 | } // namespace Phonon |
| 118 | |
| 119 | #endif // Phonon_VLC_EFFECTMANAGER_H |
| 120 | |