1 |
schoenebeck |
2124 |
/* |
2 |
|
|
Copyright (C) 2010 Christian Schoenebeck |
3 |
|
|
*/ |
4 |
|
|
|
5 |
|
|
#ifndef LS_EFFECTCONTROL_H |
6 |
|
|
#define LS_EFFECTCONTROL_H |
7 |
|
|
|
8 |
|
|
#include "../common/Exception.h" |
9 |
|
|
#include "../common/optional.h" |
10 |
|
|
|
11 |
|
|
namespace LinuxSampler { |
12 |
|
|
|
13 |
|
|
// just symbol prototyping |
14 |
|
|
class Effect; |
15 |
|
|
|
16 |
|
|
/** |
17 |
|
|
* Represents an effect parameter. As the set of parameters an effect offers, |
18 |
|
|
* varies quite a bit, this class provides necessary informations about the |
19 |
|
|
* respective effect parameter. |
20 |
|
|
*/ |
21 |
|
|
class EffectControl { |
22 |
|
|
public: |
23 |
|
|
enum Type_t { |
24 |
|
|
TYPE_FLOAT, |
25 |
|
|
TYPE_INT, |
26 |
|
|
TYPE_BOOL |
27 |
|
|
}; |
28 |
|
|
|
29 |
|
|
EffectControl(); |
30 |
|
|
virtual void SetValue(float val) throw (Exception); |
31 |
|
|
virtual float& Value(); |
32 |
|
|
Type_t Type() const; |
33 |
|
|
String TypeAsString() const; |
34 |
|
|
String Description() const; |
35 |
|
|
optional<float> DefaultValue() const; |
36 |
|
|
optional<float> MinValue() const; |
37 |
|
|
optional<float> MaxValue() const; |
38 |
|
|
|
39 |
|
|
protected: |
40 |
|
|
void SetDefaultValue(float val); |
41 |
|
|
void SetMinValue(float val); |
42 |
|
|
void SetMaxValue(float val); |
43 |
|
|
void SetType(Type_t t); |
44 |
|
|
void SetDescription(String s); |
45 |
|
|
|
46 |
|
|
friend class Effect; |
47 |
|
|
|
48 |
|
|
private: |
49 |
|
|
float value; |
50 |
|
|
Type_t type; |
51 |
|
|
String description; |
52 |
|
|
optional<float> defaultValue; |
53 |
|
|
optional<float> minValue; |
54 |
|
|
optional<float> maxValue; |
55 |
|
|
}; |
56 |
|
|
|
57 |
|
|
} // namespace LinuxSampler |
58 |
|
|
|
59 |
|
|
#endif // LS_EFFECTCONTROL_H |