diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2020-07-15 22:17:26 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2020-07-15 22:17:26 +0200 |
commit | 15b62ea6eea93d395fff743fa33795823ab0447c (patch) | |
tree | db1a74801b5aef4d3e6e54b5760225bed563cae9 | |
parent | d640cfdd7103f2c7231e4a0f94727dd505efd3fb (diff) | |
download | airwindows-lv2-port-15b62ea6eea93d395fff743fa33795823ab0447c.tar.gz airwindows-lv2-port-15b62ea6eea93d395fff743fa33795823ab0447c.tar.bz2 airwindows-lv2-port-15b62ea6eea93d395fff743fa33795823ab0447c.zip |
LV2: Add stereo ports to Acceleration.
-rw-r--r-- | plugins/LV2/src/Acceleration/Acceleration.cpp | 33 | ||||
-rw-r--r-- | plugins/LV2/src/Acceleration/Acceleration.ttl | 20 |
2 files changed, 37 insertions, 16 deletions
diff --git a/plugins/LV2/src/Acceleration/Acceleration.cpp b/plugins/LV2/src/Acceleration/Acceleration.cpp index 2fc0237..7128859 100644 --- a/plugins/LV2/src/Acceleration/Acceleration.cpp +++ b/plugins/LV2/src/Acceleration/Acceleration.cpp @@ -7,17 +7,19 @@ namespace { const char * ACCELERATION_URI = "https://www.airwindows.com/acceleration"; enum PortIndex { - ACCELERATION_LIMIT = 0, - ACCELERATION_DRYWET = 1, - ACCELERATION_IN = 2, - ACCELERATION_OUT = 3 + ACCELERATION_LIMIT, + ACCELERATION_DRYWET, + ACCELERATION_IN_L, + ACCELERATION_IN_R, + ACCELERATION_OUT_L, + ACCELERATION_OUT_R, }; struct acceleration { const float * limit; const float * drywet; - const float * in; - float * out; + const float * in[2]; + float * out[2]; }; LV2_Handle instantiate( @@ -45,12 +47,20 @@ void connect_port( accel->limit = (const float *) data; break; - case ACCELERATION_IN: - accel->in = (const float *) data; + case ACCELERATION_IN_L: + accel->in[0] = (const float *) data; break; - case ACCELERATION_OUT: - accel->out = (float *) data; + case ACCELERATION_IN_R: + accel->in[1] = (const float *) data; + break; + + case ACCELERATION_OUT_L: + accel->out[0] = (float *) data; + break; + + case ACCELERATION_OUT_R: + accel->out[1] = (float *) data; break; default: @@ -66,7 +76,8 @@ void run(LV2_Handle instance, uint32_t num_samples) { auto accel = (acceleration *) instance; for (auto i = 0u; i < num_samples; i++) { - *accel->out++ = *accel->in++; + *accel->out[0]++ = *accel->in[0]++; + *accel->out[1]++ = *accel->in[1]++; } } diff --git a/plugins/LV2/src/Acceleration/Acceleration.ttl b/plugins/LV2/src/Acceleration/Acceleration.ttl index 9560858..aede82a 100644 --- a/plugins/LV2/src/Acceleration/Acceleration.ttl +++ b/plugins/LV2/src/Acceleration/Acceleration.ttl @@ -36,11 +36,21 @@ ] , [ a lv2:InputPort , lv2:AudioPort ; lv2:index 2 ; - lv2:symbol "in" ; - lv2:name "In" ; + lv2:symbol "in_l" ; + lv2:name "In left" ; ] , [ - a lv2:OutputPort , lv2:AudioPort ; + a lv2:InputPort , lv2:AudioPort ; lv2:index 3 ; - lv2:symbol "out" ; - lv2:name "Out" ; + lv2:symbol "in_r" ; + lv2:name "In right" ; + ] , [ + a lv2:OutputPort , lv2:AudioPort ; + lv2:index 4 ; + lv2:symbol "out_l" ; + lv2:name "Out left" ; + ] , [ + a lv2:OutputPort , lv2:AudioPort ; + lv2:index 5 ; + lv2:symbol "out_r" ; + lv2:name "Out right" ; ] . |