1 |
schoenebeck |
2124 |
/* |
2 |
|
|
Copyright (C) 2010 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 |
|
|
void RenderAudio(uint Samples); |
31 |
|
|
void InitEffect(AudioOutputDevice* pDevice) throw (Exception); |
32 |
|
|
static std::vector<EffectInfo*> AvailableEffects(); |
33 |
|
|
|
34 |
|
|
private: |
35 |
|
|
LadspaEffectInfo* pInfo; |
36 |
|
|
void* hDLL; |
37 |
|
|
const LADSPA_Descriptor* pDescriptor; |
38 |
|
|
LADSPA_Handle hEffect; |
39 |
|
|
AudioOutputDevice* pDevice; |
40 |
|
|
|
41 |
|
|
float getLowerB(int iPort) const; |
42 |
|
|
float getUpperB(int iPort) const; |
43 |
|
|
}; |
44 |
|
|
|
45 |
|
|
} // namespace LinuxSampler |
46 |
|
|
|
47 |
|
|
#endif // LS_LADSPAEFFECT_H |