00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef EFFECT_H
00021 #define EFFECT_H
00022
00023 #include <QList>
00024 #include <QStringList>
00025 #include "audioparameters.h"
00026 #include "channelmap.h"
00027 #include "buffer.h"
00028
00029 class EffectFactory;
00030 class QmmpPluginCache;
00031
00035 class Effect
00036 {
00037 public:
00041 Effect();
00045 virtual ~Effect();
00050 virtual void applyEffect(Buffer *b) = 0;
00057 virtual void configure(quint32 srate, ChannelMap map);
00061 quint32 sampleRate() const;
00065 int channels() const;
00069 const ChannelMap channelMap() const;
00073 const AudioParameters audioParameters() const;
00077 EffectFactory* factory() const;
00082 static Effect* create(EffectFactory *factory);
00086 static QList<EffectFactory*> factories();
00090 static QList<EffectFactory*> enabledFactories();
00095 static QString file(EffectFactory *factory);
00101 static void setEnabled(EffectFactory* factory, bool enable = true);
00106 static bool isEnabled(EffectFactory* factory);
00107
00108 private:
00109 EffectFactory *m_factory;
00110 quint32 m_freq;
00111 int m_channels;
00112 ChannelMap m_chan_map;
00113 static void loadPlugins();
00114 static QList<QmmpPluginCache*> *m_cache;
00115 static QStringList m_enabledNames;
00116 };
00117
00118 #endif