-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAelEffects.h
More file actions
54 lines (47 loc) · 1.7 KB
/
AelEffects.h
File metadata and controls
54 lines (47 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef __AEL_EFFECTS__
#define __AEL_EFFECTS__
#include "AelAudioBuf.h"
using namespace std;
/////////////////////////////////////////////////////////////////////////
// Classe AelEffect
// Representa uma interface (classe base) para todos os efeitos criados
// Variáveis-Membro:
// ID(static int), effectId(const int), effectName(string), onoff(bool)
// sampleRate (int), wet_level (double), n_channels(int)
// Funções-Membro:
// 1 Construtores
// Métodos que retornam estado das variáveis membro
// Método que processa uma stream completa
// Método puramente virtual (processFrame) que processa uma frame
// Método puramente virtual (getCopy) que retorna uma cópia do efeito
// Métodos relativos ao estado do efeito (ON/OFF)
// Métodos realativos ao estado wet/level do efeito
/////////////////////////////////////////////////////////////////////////
namespace Ael {
class AelEffect{
protected:
static int ID;
const int effectId;
string effectName;
int sampleRate;
double wet_level;
int n_channels;
bool onoff;
public:
AelEffect(int n_ch=2, int sampleR = 44100) : n_channels(n_ch), sampleRate(sampleR), effectId(ID++), onoff(true), wet_level(1.0) {}
int getId() { return effectId; }
void setSampleRate(int sr) { sampleRate = sr; }
int getSampleRate() { return sampleRate; }
int getNChannels() {return n_channels; }
virtual AelFrame& processFrame(AelFrame&) = 0;
virtual AelAudioStream& processStream(AelAudioStream &);
virtual AelEffect* getCopy() = 0;
bool isOn() { return onoff; }
void m_turnOn(){ onoff = true; }
void m_turnOff() { onoff = false; }
void setWetLevel(double);
double getWetLevel() { return wet_level; }
virtual ~AelEffect() { }
};
}
#endif