Skip to content

Commit

Permalink
prepare surround-meter 3..8 chan, (add 3,5,8), fix port-symbol names
Browse files Browse the repository at this point in the history
  • Loading branch information
x42 committed Mar 11, 2016
1 parent 9fcb52a commit 2ddd69c
Show file tree
Hide file tree
Showing 6 changed files with 265 additions and 27 deletions.
4 changes: 4 additions & 0 deletions gui/surmeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,11 @@ instantiate(
*widget = NULL;

if (!strcmp(plugin_uri, MTR_URI "surround8")) { ui->n_chn = 8; }
else if (!strcmp(plugin_uri, MTR_URI "surround7")) { ui->n_chn = 7; }
else if (!strcmp(plugin_uri, MTR_URI "surround6")) { ui->n_chn = 6; }
else if (!strcmp(plugin_uri, MTR_URI "surround5")) { ui->n_chn = 5; }
else if (!strcmp(plugin_uri, MTR_URI "surround4")) { ui->n_chn = 4; }
else if (!strcmp(plugin_uri, MTR_URI "surround3")) { ui->n_chn = 3; }
else {
free(ui);
return NULL;
Expand Down
5 changes: 5 additions & 0 deletions lv2ttl/manifest.lv2.ttl.in
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,8 @@ mtr:surround5@URI_SUFFIX@
a lv2:Plugin ;
lv2:binary <@LV2NAME@@LIB_EXT@> ;
rdfs:seeAlso <@[email protected]> .

mtr:surround3@URI_SUFFIX@
a lv2:Plugin ;
lv2:binary <@LV2NAME@@LIB_EXT@> ;
rdfs:seeAlso <@[email protected]> .
230 changes: 224 additions & 6 deletions lv2ttl/meters.lv2.ttl.in
Original file line number Diff line number Diff line change
Expand Up @@ -3565,8 +3565,8 @@ mtr:surround8@URI_SUFFIX@
a lv2:ControlPort ,
lv2:OutputPort ;
lv2:index 20 ;
lv2:symbol "peak1" ;
lv2:name "Peak 1" ;
lv2:symbol "peak2" ;
lv2:name "Peak 2" ;
lv2:minimum 0.0 ;
lv2:maximum 1.0 ;
] , [
Expand Down Expand Up @@ -3925,8 +3925,8 @@ mtr:surround5@URI_SUFFIX@
a lv2:ControlPort ,
lv2:OutputPort ;
lv2:index 20 ;
lv2:symbol "peak1" ;
lv2:name "Peak 1" ;
lv2:symbol "peak2" ;
lv2:name "Peak 2" ;
lv2:minimum 0.0 ;
lv2:maximum 1.0 ;
] , [
Expand All @@ -3953,8 +3953,8 @@ mtr:surround5@URI_SUFFIX@
a lv2:ControlPort ,
lv2:OutputPort ;
lv2:index 24 ;
lv2:symbol "peak4" ;
lv2:name "Peak 4" ;
lv2:symbol "peak3" ;
lv2:name "Peak 3" ;
lv2:minimum 0.0 ;
lv2:maximum 1.0 ;
] , [
Expand Down Expand Up @@ -4016,3 +4016,221 @@ mtr:surround5@URI_SUFFIX@
] ;
rdfs:comment "..."
.

mtr:surround3@URI_SUFFIX@
a lv2:Plugin, lv2:AnalyserPlugin, doap:Project ;
doap:license <http://usefulinc.com/doap/licenses/gpl> ;
doap:name "Surround Level 3@NAME_SUFFIX@";
@VERSION@
lv2:project <http://gareus.org/oss/lv2/meters> ;
lv2:optionalFeature lv2:hardRTCapable ;
@SIGNATURE@
ui:ui @SURGUI@ ;
lv2:port [
a lv2:ControlPort ,
lv2:InputPort ;
lv2:index 0 ;
lv2:symbol "ref" ;
lv2:name "ui notification" ;
lv2:default -18.0 ;
lv2:minimum -21.0 ;
lv2:maximum -15.0 ;
lv2:portProperty pprop:notOnGUI ;
] , [
a lv2:ControlPort ,
lv2:InputPort ;
lv2:index 1 ;
lv2:symbol "cor1A" ;
lv2:name "Correlation 1, Input A" ;
lv2:default 0 ;
lv2:minimum 0 ;
lv2:maximum 7 ;
lv2:portProperty lv2:integer;
] , [
a lv2:ControlPort ,
lv2:InputPort ;
lv2:index 2 ;
lv2:symbol "cor1B" ;
lv2:name "Correlation 1, Input B" ;
lv2:default 1 ;
lv2:minimum 0 ;
lv2:maximum 7 ;
lv2:portProperty lv2:integer;
] , [
a lv2:ControlPort ,
lv2:OutputPort ;
lv2:index 3 ;
lv2:symbol "cor1" ;
lv2:name "Correlation 1" ;
lv2:minimum -1.0 ;
lv2:maximum 1.0 ;
] , [
a lv2:ControlPort ,
lv2:InputPort ;
lv2:index 4 ;
lv2:symbol "cor2A" ;
lv2:name "Correlation 2, Input A" ;
lv2:default 2 ;
lv2:minimum 0 ;
lv2:maximum 7 ;
lv2:portProperty lv2:integer;
] , [
a lv2:ControlPort ,
lv2:InputPort ;
lv2:index 5 ;
lv2:symbol "cor2B" ;
lv2:name "Correlation 2, Input B" ;
lv2:default 3 ;
lv2:minimum 0 ;
lv2:maximum 7 ;
lv2:portProperty lv2:integer;
] , [
a lv2:ControlPort ,
lv2:OutputPort ;
lv2:index 6 ;
lv2:symbol "cor2" ;
lv2:name "Correlation 2" ;
lv2:minimum -1.0 ;
lv2:maximum 1.0 ;
] , [
a lv2:ControlPort ,
lv2:InputPort ;
lv2:index 7 ;
lv2:symbol "cor3A" ;
lv2:name "Correlation 3, Input A" ;
lv2:default 4 ;
lv2:minimum 0 ;
lv2:maximum 7 ;
lv2:portProperty lv2:integer;
] , [
a lv2:ControlPort ,
lv2:InputPort ;
lv2:index 8 ;
lv2:symbol "cor3B" ;
lv2:name "Correlation 3, Input B" ;
lv2:default 5 ;
lv2:minimum 0 ;
lv2:maximum 7 ;
lv2:portProperty lv2:integer;
] , [
a lv2:ControlPort ,
lv2:OutputPort ;
lv2:index 9 ;
lv2:symbol "cor3" ;
lv2:name "Correlation 3" ;
lv2:minimum -1.0 ;
lv2:maximum 1.0 ;
] , [
a lv2:ControlPort ,
lv2:InputPort ;
lv2:index 10 ;
lv2:symbol "cor4A" ;
lv2:name "Correlation 4, Input A" ;
lv2:default 6 ;
lv2:minimum 0 ;
lv2:maximum 7 ;
lv2:portProperty lv2:integer;
] , [
a lv2:ControlPort ,
lv2:InputPort ;
lv2:index 11 ;
lv2:symbol "cor4B" ;
lv2:name "Correlation 4, Input B" ;
lv2:default 7 ;
lv2:minimum 0 ;
lv2:maximum 7 ;
lv2:portProperty lv2:integer;
] , [
a lv2:ControlPort ,
lv2:OutputPort ;
lv2:index 12 ;
lv2:symbol "cor4" ;
lv2:name "Correlation 4" ;
lv2:minimum -1.0 ;
lv2:maximum 1.0 ;
] , [
a lv2:AudioPort ,
lv2:InputPort ;
lv2:index 13;
lv2:symbol "in1" ;
lv2:name "In1"
] , [
a lv2:AudioPort ,
lv2:OutputPort ;
lv2:index 14 ;
lv2:symbol "out1" ;
lv2:name "Out1"
] , [
a lv2:ControlPort ,
lv2:OutputPort ;
lv2:index 15 ;
lv2:symbol "rms1" ;
lv2:name "RMS1" ;
lv2:minimum 0.0 ;
lv2:maximum 1.0 ;
] , [
a lv2:ControlPort ,
lv2:OutputPort ;
lv2:index 16 ;
lv2:symbol "peak1" ;
lv2:name "Peak 1" ;
lv2:minimum 0.0 ;
lv2:maximum 1.0 ;
] , [
a lv2:AudioPort ,
lv2:InputPort ;
lv2:index 17 ;
lv2:symbol "in2" ;
lv2:name "In2"
] , [
a lv2:AudioPort ,
lv2:OutputPort ;
lv2:index 18 ;
lv2:symbol "out2" ;
lv2:name "Out2"
] , [
a lv2:ControlPort ,
lv2:OutputPort ;
lv2:index 19 ;
lv2:symbol "rms2" ;
lv2:name "RMS 2" ;
lv2:minimum 0.0 ;
lv2:maximum 1.0 ;
] , [
a lv2:ControlPort ,
lv2:OutputPort ;
lv2:index 20 ;
lv2:symbol "peak2" ;
lv2:name "Peak 2" ;
lv2:minimum 0.0 ;
lv2:maximum 1.0 ;
] , [
a lv2:AudioPort ,
lv2:InputPort ;
lv2:index 21 ;
lv2:symbol "in3" ;
lv2:name "In3"
] , [
a lv2:AudioPort ,
lv2:OutputPort ;
lv2:index 22 ;
lv2:symbol "out3" ;
lv2:name "Out3"
] , [
a lv2:ControlPort ,
lv2:OutputPort ;
lv2:index 23 ;
lv2:symbol "rms3" ;
lv2:name "RMS 3" ;
lv2:minimum 0.0 ;
lv2:maximum 1.0 ;
] , [
a lv2:ControlPort ,
lv2:OutputPort ;
lv2:index 24 ;
lv2:symbol "peak3" ;
lv2:name "Peak 3" ;
lv2:minimum 0.0 ;
] ;
rdfs:comment "..."
.
2 changes: 1 addition & 1 deletion lv2ttl/surmeter.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static const RtkLv2Description _plugin_surmeter = {
{ "in2", AUDIO_IN, nan, nan, nan, "In2"},
{ "out2", AUDIO_OUT, nan, nan, nan, "Out2"},
{ "rms2", CONTROL_OUT, nan, 0.000000, 1.000000, "RMS 2"},
{ "peak1", CONTROL_OUT, nan, 0.000000, 1.000000, "Peak 1"},
{ "peak2", CONTROL_OUT, nan, 0.000000, 1.000000, "Peak 2"},
{ "in3", AUDIO_IN, nan, nan, nan, "In3"},
{ "out3", AUDIO_OUT, nan, nan, nan, "Out3"},
{ "rms3", CONTROL_OUT, nan, 0.000000, 1.000000, "RMS 3"},
Expand Down
6 changes: 5 additions & 1 deletion src/meters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,11 @@ lv2_descriptor(uint32_t index)
case 30: return &descriptorBBCMS;
case 31: return &descriptorBIM;
case 32: return &descriptorSUR8;
case 33: return &descriptorSUR5;
case 33: return &descriptorSUR7;
case 34: return &descriptorSUR6;
case 35: return &descriptorSUR5;
case 36: return &descriptorSUR4;
case 37: return &descriptorSUR3;
default: return NULL;
}
}
Expand Down
45 changes: 26 additions & 19 deletions src/surmeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,16 @@ sur_instantiate(

if ( !strcmp (descriptor->URI, MTR_URI "surround8")) {
self->chn = 8;
} else if (!strcmp (descriptor->URI, MTR_URI "surround7")) {
self->chn = 7;
} else if (!strcmp (descriptor->URI, MTR_URI "surround6")) {
self->chn = 6;
} else if (!strcmp (descriptor->URI, MTR_URI "surround5")) {
self->chn = 5;
} else if (!strcmp (descriptor->URI, MTR_URI "surround4")) {
self->chn = 4;
} else if (!strcmp (descriptor->URI, MTR_URI "surround3")) {
self->chn = 3;
} else {
free(self);
return NULL;
Expand Down Expand Up @@ -143,6 +151,7 @@ sur_run(LV2_Handle instance, uint32_t n_samples)
}
}
}

static void
sur_cleanup(LV2_Handle instance)
{
Expand All @@ -157,24 +166,22 @@ sur_cleanup(LV2_Handle instance)
free (self->mtr);
free(instance);
}
static const LV2_Descriptor descriptorSUR8 = {
MTR_URI "surround8",
sur_instantiate,
sur_connect_port,
NULL,
sur_run,
NULL,
sur_cleanup,
extension_data
};

static const LV2_Descriptor descriptorSUR5 = {
MTR_URI "surround5",
sur_instantiate,
sur_connect_port,
NULL,
sur_run,
NULL,
sur_cleanup,
extension_data
#define SurDesc(ID, NAME) \
static const LV2_Descriptor descriptor ## ID = { \
MTR_URI NAME, \
sur_instantiate, \
sur_connect_port, \
NULL, \
sur_run, \
NULL, \
sur_cleanup, \
extension_data \
};

SurDesc(SUR8, "surround8");
SurDesc(SUR7, "surround7");
SurDesc(SUR6, "surround6");
SurDesc(SUR5, "surround5");
SurDesc(SUR4, "surround4");
SurDesc(SUR3, "surround3");

0 comments on commit 2ddd69c

Please sign in to comment.