Qmmp
effect.h
1 /***************************************************************************
2  * Copyright (C) 2007-2020 by Ilya Kotov *
3  * forkotov02@ya.ru *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 #ifndef EFFECT_H
21 #define EFFECT_H
22 
23 #include <QList>
24 #include <QStringList>
25 #include "audioparameters.h"
26 #include "channelmap.h"
27 #include "buffer.h"
28 #include "effectfactory.h"
29 
30 class QmmpPluginCache;
31 
35 class QMMP_EXPORT Effect
36 {
37 public:
41  Effect();
45  virtual ~Effect();
50  virtual void applyEffect(Buffer *b) = 0;
57  virtual void configure(quint32 srate, ChannelMap map);
61  quint32 sampleRate() const;
65  int channels() const;
69  const ChannelMap channelMap() const;
73  const AudioParameters audioParameters() const;
77  EffectFactory* factory() const;
82  static Effect* create(EffectFactory *factory);
86  static QList<EffectFactory*> factories();
90  static QList<EffectFactory*> enabledFactories();
95  static QString file(const EffectFactory *factory);
101  static void setEnabled(EffectFactory *factory, bool enable = true);
106  static bool isEnabled(const EffectFactory* factory);
111  static EffectFactory *findFactory(const QString &shortName);
112 
113 private:
114  EffectFactory *m_factory;
115  quint32 m_freq;
116  int m_channels;
117  ChannelMap m_chan_map;
118  static void loadPlugins();
119  static QList<QmmpPluginCache*> *m_cache;
120  static QStringList m_enabledNames;
121 };
122 
123 #endif
The Effect class provides the base interface class of audio effects.
Definition: effect.h:35
The AudioParameters class keeps information about audio settings.
Definition: audioparameters.h:31
Effect plugin interface (effect factory).
Definition: effectfactory.h:55
Audio buffer class.
Definition: buffer.h:20