Qmmp
/usr/src/RPM/BUILD/qmmp-0.8-svn/src/qmmp/effect.h
00001 /***************************************************************************
00002  *   Copyright (C) 2007-2013 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 "buffer.h"
00027 
00028 class EffectFactory;
00029 class QmmpPluginCache;
00030 
00034 class Effect
00035 {
00036 public:
00040     Effect();
00044     virtual ~Effect();
00049     virtual void applyEffect(Buffer *b) = 0;
00057     virtual void configure(quint32 srate = 44100, int chan = 2, Qmmp::AudioFormat f = Qmmp::PCM_S16LE);
00061     quint32 sampleRate();
00065     int channels();
00069     Qmmp::AudioFormat format();
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_chan;
00112     Qmmp::AudioFormat m_format;
00113     static void loadPlugins();
00114     static QList<QmmpPluginCache*> *m_cache;
00115     static QStringList m_enabledNames;
00116 };
00117 
00118 #endif
 All Classes Functions Variables Enumerations Enumerator