Qmmp
|
00001 /*************************************************************************** 00002 * Copyright (C) 2007-2014 by Ilya Kotov * 00003 * forkotov02@hotmail.ru * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 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