-
Notifications
You must be signed in to change notification settings - Fork 0
/
PluginControl.h
67 lines (48 loc) · 1.36 KB
/
PluginControl.h
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
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef __PLUGIN_CONTROL_H
#define __PLUGIN_CONTROL_H
#include <cstdlib>
#include "logging_macros.h"
#include "ladspa.h"
#include "lv2.h"
#include "json.hpp"
class PluginControl {
const LADSPA_PortDescriptor *desc;
const LADSPA_PortRangeHint *hint;
/* values selected in the interface */
LADSPA_Data sel;
/* value range */
struct { LADSPA_Data fine; LADSPA_Data coarse; } inc;
unsigned long sample_rate = 48000;
enum Type {
FLOAT = 0,
INT = 1,
TOGGLE = 2
};
public:
unsigned long port;
LADSPA_Data min;
LADSPA_Data max;
LADSPA_Data default_value = 1; // 1 == no change in signal
/* value in the plugin */
LADSPA_Data val;
LADSPA_Data *def;
LADSPA_Data presetValue = -1;
Type type ;
std::string lv2_name ;
bool name_allocated = false ;
LADSPA_Data control_rounding(LADSPA_Data _val);
void setValue(float value);
void setSampleRate(unsigned long rate);
LADSPA_Data getMin();
LADSPA_Data getMax();
LADSPA_Data getDefault();
LADSPA_Data getValue();
PluginControl(const LADSPA_Descriptor *descriptor, int _port);
PluginControl(const LV2_Descriptor *descriptor, nlohmann::json j);
void print();
// unsigned long ctrl;
const char *name;
void freeMemory();
void setPresetValue(float value);
};
#endif // __PLUGIN_CONTROL_H