blob: cc0a6cda0a86a179175fc78fc292eea621c187fc (
plain) (
blame)
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
|
#include "lv2/core/lv2.h"
#include <iostream>
const char * ACCELERATION_URI = "https://www.airwindows.com/acceleration";
enum PortIndex {
ACCELERATION_LIMIT = 0,
ACCELERATION_DRYWET = 1,
ACCELERATION_IN = 2,
ACCELERATION_OUT = 3
};
struct acceleration {
const float * limit;
const float * drywet;
const float * in;
float * out;
};
static LV2_Handle instantiate(
const LV2_Descriptor * d,
double rate,
const char * path,
const LV2_Feature * const * features)
{
return calloc(1, sizeof(acceleration));
}
static void connect_port(
LV2_Handle instance,
uint32_t port,
void * data)
{
struct acceleration * accel = (struct acceleration *) instance;
switch (port) {
case ACCELERATION_LIMIT:
accel->limit = (const float *) data;
break;
case ACCELERATION_DRYWET:
accel->limit = (const float *) data;
break;
case ACCELERATION_IN:
accel->in = (const float *) data;
break;
case ACCELERATION_OUT:
accel->out = (float *) data;
break;
default:
std::cerr << "Invalid port " << port << ": ignoring." << std::endl;
}
}
static void activate(LV2_Handle instance)
{
}
static void run(LV2_Handle instance, uint32_t num_samples)
{
auto accel = (acceleration *) instance;
}
|