1 |
/* |
2 |
Copyright (C) 2010 - 2013 Christian Schoenebeck |
3 |
*/ |
4 |
|
5 |
#ifndef LS_LADSPAEFFECT_H |
6 |
#define LS_LADSPAEFFECT_H |
7 |
|
8 |
#include "Effect.h" |
9 |
#include "EffectInfo.h" |
10 |
#include "../common/ladspa.h" |
11 |
#include "../common/Exception.h" |
12 |
#include <vector> |
13 |
|
14 |
namespace LinuxSampler { |
15 |
|
16 |
class LadspaEffectInfo; |
17 |
class AudioOutputDevice; |
18 |
|
19 |
/** |
20 |
* Implementation of internal effects using the LADSPA effect system. |
21 |
* |
22 |
* @e Note: this class is only sampler internal and won't be exported to the |
23 |
* external C++ API of the sampler. Use the static class EffectFactory instead |
24 |
* for managing LADSPA effects by external applications. |
25 |
*/ |
26 |
class LadspaEffect : public Effect { |
27 |
public: |
28 |
LadspaEffect(EffectInfo* pInfo) throw (Exception); |
29 |
~LadspaEffect(); |
30 |
EffectInfo* GetEffectInfo() OVERRIDE; |
31 |
void RenderAudio(uint Samples) OVERRIDE; |
32 |
void InitEffect(AudioOutputDevice* pDevice) throw (Exception) OVERRIDE; |
33 |
static std::vector<EffectInfo*> AvailableEffects(); |
34 |
|
35 |
private: |
36 |
LadspaEffectInfo* pInfo; |
37 |
void* hDLL; |
38 |
const LADSPA_Descriptor* pDescriptor; |
39 |
LADSPA_Handle hEffect; |
40 |
AudioOutputDevice* pDevice; |
41 |
|
42 |
float getLowerB(int iPort) const; |
43 |
float getUpperB(int iPort) const; |
44 |
}; |
45 |
|
46 |
} // namespace LinuxSampler |
47 |
|
48 |
#endif // LS_LADSPAEFFECT_H |