Qmmp
Loading...
Searching...
No Matches
effect.h
1/***************************************************************************
2 * Copyright (C) 2007-2022 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
30class QmmpPluginCache;
31
35class QMMP_EXPORT Effect
36{
37public:
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;
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
113private:
114 EffectFactory *m_factory = nullptr;
115 quint32 m_freq = 0;
116 int m_channels = 0;
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 AudioParameters class keeps information about audio settings.
Definition audioparameters.h:32
Audio buffer class.
Definition buffer.h:21
This class represents audio channel mapping.
Definition channelmap.h:31
Effect plugin interface (effect factory).
Definition effectfactory.h:56
The Effect class provides the base interface class of audio effects.
Definition effect.h:36
static void setEnabled(EffectFactory *factory, bool enable=true)
virtual void configure(quint32 srate, ChannelMap map)
static Effect * create(EffectFactory *factory)
static EffectFactory * findFactory(const QString &shortName)
const AudioParameters audioParameters() const
quint32 sampleRate() const
int channels() const
static QList< EffectFactory * > factories()
static bool isEnabled(const EffectFactory *factory)
virtual void applyEffect(Buffer *b)=0
EffectFactory * factory() const
static QList< EffectFactory * > enabledFactories()
virtual ~Effect()
static QString file(const EffectFactory *factory)
const ChannelMap channelMap() const