@@ -40,28 +40,106 @@ namespace lsp
4040 {
4141 // -------------------------------------------------------------------------
4242 // Plugin metadata
43+ static const port_item_t matcher_fft_ranks[] =
44+ {
45+ { " 256" , NULL },
46+ { " 512" , NULL },
47+ { " 1024" , NULL },
48+ { " 2048" , NULL },
49+ { " 4096" , NULL },
50+ { " 8192" , NULL },
51+ { " 16384" , NULL },
52+ { NULL , NULL }
53+ };
4354
44- static const port_t matcher_mono_ports [] =
55+ static const port_item_t matcher_references [] =
4556 {
46- PORTS_MONO_PLUGIN,
47- BYPASS,
57+ { " Capture" , " matcher.ref.capture" },
58+ { " File" , " matcher.ref.file" },
59+ { " Sidechain" , " matcher.ref.sidechain" },
60+ { " Link" , " matcher.ref.link" },
61+ { NULL , NULL }
62+ };
4863
49- PORTS_END
64+ static const port_item_t sc_matcher_references[] =
65+ {
66+ { " Capture" , " matcher.ref.capture" },
67+ { " File" , " matcher.ref.file" },
68+ { " Sidechain" , " matcher.ref.sidechain" },
69+ { " Link" , " matcher.ref.link" },
70+ { NULL , NULL }
5071 };
5172
52- static const port_t sc_matcher_mono_ports[] =
73+ static const port_item_t matcher_capture_source[] =
74+ {
75+ { " In" , " matcher.capture.in" },
76+ { " Link" , " matcher.capture.link" },
77+ { NULL , NULL }
78+ };
79+
80+ static const port_item_t sc_matcher_capture_source[] =
81+ {
82+ { " In" , " matcher.capture.in" },
83+ { " Sidehcain" , " matcher.capture.sidechain" },
84+ { " Link" , " matcher.capture.link" },
85+ { NULL , NULL }
86+ };
87+
88+
89+ #define MATCHER_COMMON (sources, captures, cap_default ) \
90+ BYPASS, \
91+ AMP_GAIN100 (" input" , " Input gain" , " Input gain" , 1 .0f ), \
92+ COMBO (" fft" , " FFT size" , " FFT size" , matcher::FFT_RANK_IDX_DFL, matcher_fft_ranks), \
93+ SWITCH (" profile" , " Profile" , " Profile" , 1 .0f ), \
94+ LOG_CONTROL (" p_react" , " Profile reactivity" , " Prof react" , U_SEC, matcher::PROFILE_REACT_TIME), \
95+ PERCENTS (" slink" , " Stereo link" , " Stereo link" , 100 .0f , 0 .1f ), \
96+ COMBO (" refer" , " Reference source" , " Reference" , 0 , sources), \
97+ SWITCH (" capture" , " Capture" , " Capture" , 0 .0f ), \
98+ SWITCH (" listen" , " Listen Capture" , " Listen" , 1 .0f ), \
99+ COMBO (" cap_src" , " Capture source" , " Capture Src" , cap_default, captures)
100+
101+ #define MATCHER_EQ_BAND (id, freq ) \
102+ CONTROL (" amp_" #id, " Amplification " freq " Hz" , " Amp " freq " Hz" , U_DB, matcher::BAND_AMP_GAIN), \
103+ CONTROL (" rej_" #id, " Reduction " freq " Hz" , " Red " freq " Hz" , U_DB, matcher::BAND_RED_GAIN), \
104+ CONTROL (" spd_" #id, " Reactivity " freq " Hz" , " Red " freq " Hz" , U_DB, matcher::BAND_REACT)
105+
106+ #define MATCHER_EQ \
107+ TRIGGER (" match" , " Perform immediate match" , " Match" ), \
108+ MATCHER_EQ_BAND (0 , " 25" ), \
109+ MATCHER_EQ_BAND (1 , " 50" ), \
110+ MATCHER_EQ_BAND (2 , " 107" ), \
111+ MATCHER_EQ_BAND (3 , " 227" ), \
112+ MATCHER_EQ_BAND (4 , " 484" ), \
113+ MATCHER_EQ_BAND (5 , " 1 k" ), \
114+ MATCHER_EQ_BAND (6 , " 2.2 k" ), \
115+ MATCHER_EQ_BAND (7 , " 4.7 k" ), \
116+ MATCHER_EQ_BAND (8 , " 9 k" ), \
117+ MATCHER_EQ_BAND (9 , " 16 k" )
118+
119+ static const port_t matcher_mono_ports[] =
53120 {
54121 PORTS_MONO_PLUGIN,
55- PORTS_MONO_SIDECHAIN ,
56- BYPASS ,
122+ MATCHER_COMMON (matcher_references, matcher_capture_source, 0 ) ,
123+ MATCHER_EQ ,
57124
58125 PORTS_END
59126 };
60127
61128 static const port_t matcher_stereo_ports[] =
62129 {
63130 PORTS_STEREO_PLUGIN,
64- BYPASS,
131+ MATCHER_COMMON (matcher_references, matcher_capture_source, 0 ),
132+ MATCHER_EQ,
133+
134+ PORTS_END
135+ };
136+
137+ static const port_t sc_matcher_mono_ports[] =
138+ {
139+ PORTS_MONO_PLUGIN,
140+ PORTS_MONO_SIDECHAIN,
141+ MATCHER_COMMON (sc_matcher_references, sc_matcher_capture_source, 1 ),
142+ MATCHER_EQ,
65143
66144 PORTS_END
67145 };
@@ -70,7 +148,8 @@ namespace lsp
70148 {
71149 PORTS_STEREO_PLUGIN,
72150 PORTS_STEREO_SIDECHAIN,
73- BYPASS,
151+ MATCHER_COMMON (sc_matcher_references, sc_matcher_capture_source, 1 ),
152+ MATCHER_EQ,
74153
75154 PORTS_END
76155 };
0 commit comments