diff options
author | Johannes Mueller <github@johannes-mueller.org> | 2017-08-04 14:07:01 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-06-20 21:06:16 +0200 |
commit | ef978d1b350e4ccc7cb9b00a501a1793298482ed (patch) | |
tree | 2c5bad25bac31e8632c16dd1b10e3ac928192bfc /libs/plugins | |
parent | 87ea757a5de4b966ed2026f4ee9b04e6d80adcbb (diff) |
Inlevel output port to visualize the input level in the generic GUI
Diffstat (limited to 'libs/plugins')
-rw-r--r-- | libs/plugins/a-comp.lv2/a-comp#stereo.ttl.in | 32 | ||||
-rw-r--r-- | libs/plugins/a-comp.lv2/a-comp.c | 8 | ||||
-rw-r--r-- | libs/plugins/a-comp.lv2/a-comp.ttl.in | 20 |
3 files changed, 44 insertions, 16 deletions
diff --git a/libs/plugins/a-comp.lv2/a-comp#stereo.ttl.in b/libs/plugins/a-comp.lv2/a-comp#stereo.ttl.in index efc5b7b54e..cb45647936 100644 --- a/libs/plugins/a-comp.lv2/a-comp#stereo.ttl.in +++ b/libs/plugins/a-comp.lv2/a-comp#stereo.ttl.in @@ -102,19 +102,29 @@ lv2:maximum 0.000000 ; unit:unit unit:db ; ] , + [ + a lv2:OutputPort, lv2:ControlPort ; + lv2:index 8 ; + lv2:name "Input Level" ; + lv2:symbol "inlevel" ; + lv2:default -45.000000 ; + lv2:minimum -45.000000 ; + lv2:maximum 0.000000 ; + unit:unit unit:db ; + ] , [ a lv2:InputPort, lv2:ControlPort ; - lv2:index 8 ; + lv2:index 9 ; lv2:name "Sidechain" ; lv2:symbol "sidech" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 1 ; + lv2:default 0.000000 ; + lv2:minimum 0.000000 ; + lv2:maximum 1.000000 ; lv2:portProperty lv2:integer, lv2:toggled ; ] , [ a lv2:InputPort, lv2:ControlPort ; - lv2:index 9 ; + lv2:index 10 ; lv2:name "Enable" ; lv2:symbol "enable" ; lv2:default 1 ; @@ -122,36 +132,36 @@ lv2:maximum 1 ; lv2:portProperty lv2:integer, lv2:toggled ; lv2:designation lv2:enabled; - ] ; + ]; lv2:port [ a lv2:InputPort, lv2:AudioPort ; - lv2:index 10 ; + lv2:index 11 ; lv2:symbol "in_1" ; lv2:name "Audio Input 1" ; ] , [ a lv2:InputPort, lv2:AudioPort ; - lv2:index 11 ; + lv2:index 12 ; lv2:symbol "in_2" ; lv2:name "Audio Input 2" ; ] , [ a lv2:InputPort, lv2:AudioPort ; - lv2:index 12 ; + lv2:index 13 ; lv2:symbol "sidechain_in" ; lv2:name "Sidechain Input" ; lv2:portProperty lv2:isSideChain ; ] , [ a lv2:OutputPort, lv2:AudioPort ; - lv2:index 13 ; + lv2:index 14 ; lv2:symbol "out_1" ; lv2:name "Audio Output 1" ; ], [ a lv2:OutputPort, lv2:AudioPort ; - lv2:index 14 ; + lv2:index 15 ; lv2:symbol "out_2" ; lv2:name "Audio Output 2" ; ] ; diff --git a/libs/plugins/a-comp.lv2/a-comp.c b/libs/plugins/a-comp.lv2/a-comp.c index f495e7f2a0..a104022c0d 100644 --- a/libs/plugins/a-comp.lv2/a-comp.c +++ b/libs/plugins/a-comp.lv2/a-comp.c @@ -48,6 +48,7 @@ typedef enum { ACOMP_GAINR, ACOMP_OUTLEVEL, + ACOMP_INLEVEL, ACOMP_SIDECHAIN, ACOMP_ENABLE, @@ -68,6 +69,7 @@ typedef struct { float* gainr; float* outlevel; + float* inlevel; float* sidechain; float* enable; @@ -161,6 +163,9 @@ connect_port(LV2_Handle instance, case ACOMP_OUTLEVEL: acomp->outlevel = (float*)data; break; + case ACOMP_INLEVEL: + acomp->inlevel = (float*)data; + break; case ACOMP_SIDECHAIN: acomp->sidechain = (float*)data; break; @@ -250,6 +255,7 @@ activate(LV2_Handle instance) *(acomp->gainr) = 0.0f; *(acomp->outlevel) = -70.0f; + *(acomp->inlevel) = -160.f; } static void @@ -373,6 +379,7 @@ run_mono(LV2_Handle instance, uint32_t n_samples) } *(acomp->outlevel) = (max < 0.0056f) ? -70.f : to_dB(max); + *(acomp->inlevel) = in_peak_db; acomp->makeup_gain = makeup_gain; #ifdef LV2_EXTENDED @@ -537,6 +544,7 @@ run_stereo(LV2_Handle instance, uint32_t n_samples) } *(acomp->outlevel) = (max < 0.0056f) ? -70.f : to_dB(max); + *(acomp->inlevel) = in_peak_db; acomp->makeup_gain = makeup_gain; #ifdef LV2_EXTENDED diff --git a/libs/plugins/a-comp.lv2/a-comp.ttl.in b/libs/plugins/a-comp.lv2/a-comp.ttl.in index 2ada2fda4f..bbc860ee14 100644 --- a/libs/plugins/a-comp.lv2/a-comp.ttl.in +++ b/libs/plugins/a-comp.lv2/a-comp.ttl.in @@ -103,8 +103,18 @@ unit:unit unit:db ; ] , [ - a lv2:InputPort, lv2:ControlPort ; + a lv2:OutputPort, lv2:ControlPort ; lv2:index 8 ; + lv2:name "Input Level" ; + lv2:symbol "inlevel" ; + lv2:default -45.000000 ; + lv2:minimum -45.000000 ; + lv2:maximum 0.000000 ; + unit:unit unit:db ; + ] , + [ + a lv2:InputPort, lv2:ControlPort ; + lv2:index 9 ; lv2:name "Sidechain" ; lv2:symbol "sidech" ; lv2:default 0.000000 ; @@ -114,7 +124,7 @@ ] , [ a lv2:InputPort, lv2:ControlPort ; - lv2:index 9 ; + lv2:index 10 ; lv2:name "Enable" ; lv2:symbol "enable" ; lv2:default 1 ; @@ -126,20 +136,20 @@ lv2:port [ a lv2:InputPort, lv2:AudioPort ; - lv2:index 10 ; + lv2:index 11 ; lv2:symbol "lv2_audio_in_1" ; lv2:name "Audio Input 1" ; ] , [ a lv2:InputPort, lv2:AudioPort ; - lv2:index 11 ; + lv2:index 12 ; lv2:symbol "lv2_sidechain_in" ; lv2:name "Sidechain Input" ; lv2:portProperty lv2:isSideChain ; ], [ a lv2:OutputPort, lv2:AudioPort ; - lv2:index 12 ; + lv2:index 13 ; lv2:symbol "lv2_audio_out_1" ; lv2:name "Audio Output 1" ; ] ; |