Skip to content

Commit cb2cf0b

Browse files
committed
Working on UI
1 parent d76a233 commit cb2cf0b

3 files changed

Lines changed: 316 additions & 7 deletions

File tree

res/main/ui/util/ringmod_sc.xml

Lines changed: 306 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,309 @@
11
<plugin resizable="true">
2+
<vbox>
3+
<!-- Top part -->
4+
<grid rows="3" cols="2" hspacing="4">
5+
<group ui:inject="GraphGroup" ipadding="0" expand="true" fill="true" text="labels.graphs.time">
6+
<!-- Time graph -->
7+
<graph width.min="560" height.min="280" expand="true">
8+
<origin hpos="1" vpos="-1" visible="false"/>
29

10+
<!-- Gray grid -->
11+
<marker v="-12 db" ox="1" oy="0" color="graph_alt_1"/>
12+
<marker v="-36 db" ox="1" oy="0" color="graph_alt_1"/>
13+
<marker v="-60 db" ox="1" oy="0" color="graph_alt_1"/>
14+
<ui:for id="t" first="0" last="4">
15+
<marker v="${t}.5" ox="0" oy="1" color="graph_alt_1"/>
16+
</ui:for>
17+
<!-- Yellow grid -->
18+
<marker v="-24 db" ox="1" oy="0" color="graph_sec"/>
19+
<ui:for id="t" first="1" last="4">
20+
<marker v="${t}" ox="0" oy="1" color="graph_sec"/>
21+
</ui:for>
22+
23+
<!-- Axis -->
24+
<axis min="0" max="5" color="graph_prim" angle="1.0" log="false" visibility="false"/>
25+
<axis min="-48 db" max="12 db" color="graph_prim" angle="0.5" log="true" visibility="false"/>
26+
27+
<!-- Baseline -->
28+
<marker v="0 db" ox="1" oy="0" color="graph_prim" width="2"/>
29+
30+
<!-- Meshes -->
31+
<ui:with id="mg" xi="0">
32+
<!-- Mono -->
33+
<ui:if test="!ex :in_r">
34+
<mesh yi="1" width="0" color="left_in" fcolor="left_in" fcolor.a="0.8" fill="true" visibility=":ilv"/>
35+
<mesh yi="4" width="2" color="left" visibility=":olv"/>
36+
<mesh yi="2" width="2" color="sidechain_1" visibility=":slv"/>
37+
<mesh yi="3" width="2" color="bright_blue" visibility=":grv" fcolor="bright_blue" fcolor.a="0.8" fill="true"/>
38+
</ui:if>
39+
40+
<!-- Stereo -->
41+
<ui:if test="ex :in_r">
42+
<mesh yi="1" width="0" color="left_in" fcolor="left_in" fcolor.a="0.8" fill="true" visibility=":ilv_l"/>
43+
<mesh yi="5" width="0" color="right_in" fcolor="right_in" fcolor.a="0.8" fill="true" visibility=":ilv_r"/>
44+
<mesh yi="4" width="2" color="left" visibility=":olv_l"/>
45+
<mesh yi="8" width="2" color="right" visibility=":olv_r"/>
46+
<mesh yi="2" width="2" color="sidechain_1" visibility=":slv_l"/>
47+
<mesh yi="6" width="2" color="sidechain_2" visibility=":slv_r"/>
48+
<mesh yi="3" width="2" color="bright_blue" visibility=":grv_l" fcolor="bright_blue" fcolor.a="0.8" fill="true"/>
49+
<mesh yi="7" width="2" color="bright_blue" visibility=":grv_r" fcolor="bright_blue" fcolor.a="0.8" fill="true"/>
50+
</ui:if>
51+
</ui:with>
52+
53+
<!-- Text -->
54+
<ui:attributes x="5" halign="1" valign="-1">
55+
<text y="12 db" text="graph.values.x:db" text:value="12"/>
56+
<text y="0 db" text="0"/>
57+
<text y="-12 db" text="-12"/>
58+
<text y="-24 db" text="-24"/>
59+
<text y="-36 db" text="-36"/>
60+
<text y="-48 db" text="graph.units.s" valign="1"/>
61+
</ui:attributes>
62+
<ui:for id="t" first="0" last="4">
63+
<text x="${t}" y="-48 db" text="${t}" halign="-1" valign="1"/>
64+
<text x="${t}.5" y="-48 db" text="${t}.5" halign="-1" valign="1"/>
65+
</ui:for>
66+
</graph>
67+
</group>
68+
69+
<grid rows="3" cols="4" hfill="false" hexpand="false" hspacing="4">
70+
<ui:with bg.color="bg_schema">
71+
<label text="labels.sc.SC" padding="4"/>
72+
<label text="labels.gain_" padding="4"/>
73+
<label text="labels.chan.in" padding="4"/>
74+
<label text="labels.chan.out" padding="4"/>
75+
76+
<!-- Mono -->
77+
<ui:if test="!ex :in_r">
78+
<button id="slv" height="10" width="22" ui:inject="Button_orange" led="true"/>
79+
<button id="grv" height="10" width="22" ui:inject="Button_blue" led="true"/>
80+
<button id="ilv" height="10" width="22" ui:inject="Button_left" led="true"/>
81+
<button id="olv" height="10" width="22" ui:inject="Button_left" led="true"/>
82+
</ui:if>
83+
84+
<!-- Stereo -->
85+
<ui:if test="ex :in_r">
86+
<hbox spacing="2">
87+
<button id="slv_l" size="10" ui:inject="Button_orange" led="true"/>
88+
<button id="slv_r" size="10" ui:inject="Button_orange" led="true"/>
89+
</hbox>
90+
91+
<hbox spacing="2">
92+
<button id="grv_l" size="10" ui:inject="Button_blue" led="true"/>
93+
<button id="grv_r" size="10" ui:inject="Button_blue" led="true"/>
94+
</hbox>
95+
96+
<hbox spacing="2">
97+
<button id="ilv_l" size="10" ui:inject="Button_left" led="true"/>
98+
<button id="ilv_r" size="10" ui:inject="Button_right" led="true"/>
99+
</hbox>
100+
101+
<hbox spacing="2">
102+
<button id="olv_l" size="10" ui:inject="Button_left" led="true"/>
103+
<button id="olv_r" size="10" ui:inject="Button_right" led="true"/>
104+
</hbox>
105+
</ui:if>
106+
</ui:with>
107+
108+
<!-- Sidechain signal meter mono-->
109+
<ui:if test="!ex :in_r">
110+
<ledmeter vexpand="true" height.min="256" angle="1">
111+
<ledchannel id="slm" min="-48 db" max="0 db" log="true" type="peak" activity=":slv" value.color="sidechain_1"/>
112+
</ledmeter>
113+
114+
<!-- Gain signal meter -->
115+
<ledmeter vexpand="true" height.min="256" angle="1">
116+
<ledchannel id="grm" min="-48 db" max="0 db" log="true" type="peak" balance="0 db" balance.visibility="true" activity=":grv" value.color="blue"/>
117+
</ledmeter>
118+
119+
<!-- Input signal meter -->
120+
<ledmeter vexpand="true" height.min="256" angle="1">
121+
<ledchannel id="ilm" min="-48 db" max="0 db" log="true" type="rms_peak" peak.visibility="true" activity=":ilv" value.color="left_in"/>
122+
</ledmeter>
123+
124+
<!-- Output signal meter -->
125+
<ledmeter vexpand="true" height.min="256" angle="1">
126+
<ledchannel id="olm" min="-48 db" max="0 db" log="true" type="rms_peak" peak.visibility="true" activity=":olv" value.color="left"/>
127+
</ledmeter>
128+
</ui:if>
129+
130+
<!-- Sidechain signal meter stereo -->
131+
<ui:if test="ex :in_r">
132+
<ledmeter vexpand="true" height.min="256" angle="1">
133+
<ledchannel id="slm_l" min="-48 db" max="0 db" log="true" type="peak" activity=":slv_l" value.color="sidechain_1"/>
134+
<ledchannel id="slm_r" min="-48 db" max="0 db" log="true" type="peak" activity=":slv_r" value.color="sidechain_2"/>
135+
</ledmeter>
136+
137+
<!-- Gain signal meter -->
138+
<ledmeter vexpand="true" height.min="256" angle="1">
139+
<ledchannel id="grm_l" min="-48 db" max="0 db" log="true" type="peak" balance="0 db" balance.visibility="true" activity=":grv_l" value.color="blue"/>
140+
<ledchannel id="grm_r" min="-48 db" max="0 db" log="true" type="peak" balance="0 db" balance.visibility="true" activity=":grv_r" value.color="blue"/>
141+
</ledmeter>
142+
143+
<!-- Input signal meter -->
144+
<ledmeter vexpand="true" height.min="256" angle="1">
145+
<ledchannel id="ilm_l" min="-48 db" max="0 db" log="true" type="rms_peak" peak.visibility="true" activity=":ilv_l" value.color="left_in"/>
146+
<ledchannel id="ilm_r" min="-48 db" max="0 db" log="true" type="rms_peak" peak.visibility="true" activity=":ilv_r" value.color="right_in"/>
147+
</ledmeter>
148+
149+
<!-- Output signal meter -->
150+
<ledmeter vexpand="true" height.min="256" angle="1">
151+
<ledchannel id="olm_l" min="-48 db" max="0 db" log="true" type="rms_peak" peak.visibility="true" activity=":olv_l" value.color="left"/>
152+
<ledchannel id="olm_r" min="-48 db" max="0 db" log="true" type="rms_peak" peak.visibility="true" activity=":olv_r" value.color="right"/>
153+
</ledmeter>
154+
</ui:if>
155+
</grid>
156+
157+
<cell cols="2">
158+
<void bg.color="bg" vexpand="false" fill="false" pad.v="2"/>
159+
</cell>
160+
<cell cols="2">
161+
<hbox spacing="4" bg.color="bg_schema" pad.h="6" >
162+
<label text="labels.sc.type"/>
163+
<combo id="type" pad.r="12" pad.v="4"/>
164+
<ui:if test="ex :in_r">
165+
<label text="labels.sc.source"/>
166+
<combo id="source" pad.r="12"/>
167+
</ui:if>
168+
169+
<void hexpand="true" />
170+
171+
<button ui:id="premix_trigger" id="showpmx" text="labels.premix" size="22" />
172+
<button ui:id="mix_trigger" id="showmx" text="labels.mix" size="22" pad.v="4"/>
173+
174+
<!-- button id="pause" height="22" width="48" text="labels.pause" ui:inject="Button_green"/>
175+
<button id="clear" height="22" width="48" text="labels.clear" ui:inject="Button_red" pad.r="2"/-->
176+
177+
<vsep pad.h="2" bg.color="bg" reduce="true"/>
178+
<shmlink id="link" pad.l="2"/>
179+
</hbox>
180+
</cell>
181+
182+
</grid>
183+
184+
<!-- Separator -->
185+
<void bg.color="bg" fill="true" pad.v="2" reduce="true"/>
186+
187+
<!-- Bottom part -->
188+
<hbox spacing="4" vreduce="true">
189+
<!-- Ringmod setup -->
190+
<group text="groups.processor" ipadding="0" >
191+
<grid rows="3" cols="${(ex :in_r) ? 11 : 9}">
192+
<!-- row 1 -->
193+
<label text="labels.sc.lookahead" pad.h="6" pad.t="6" fill="false" hexpand="true" vreduce="true"/>
194+
<cell rows="3" hreduce="true" pad.h="2"><vsep/></cell>
195+
<label text="labels.sc.ducking" pad.h="6" pad.t="6" fill="false" hexpand="true" vreduce="true"/>
196+
<cell rows="3" hreduce="true" pad.h="2"><vsep/></cell>
197+
<label text="labels.hold" pad.h="6" pad.t="6" fill="false" hexpand="true" vreduce="true"/>
198+
<cell rows="3" hreduce="true" pad.h="2"><vsep/></cell>
199+
<label text="labels.release" pad.h="6" pad.t="6" fill="false" hexpand="true" vreduce="true"/>
200+
<cell rows="3" hreduce="true" pad.h="2"><vsep/></cell>
201+
<label text="labels.amount" pad.h="6" pad.t="6" fill="false" hexpand="true" vreduce="true"/>
202+
203+
<ui:if test="ex :in_r" >
204+
<cell rows="3" hreduce="true" pad.h="2"><vsep/></cell>
205+
<label text="labels.stereo_link" pad.h="6" pad.t="4" fill="false" hexpand="true" vreduce="true"/>
206+
</ui:if>
207+
208+
<!-- row 2 -->
209+
<knob id="lk" pad.t="5" pad.b="4" pad.h="6"/>
210+
<knob id="duck" pad.t="5" pad.b="4" pad.h="6"/>
211+
<knob id="hold" pad.t="5" pad.b="4" pad.h="6"/>
212+
<knob id="release" pad.t="5" pad.b="4" pad.h="6"/>
213+
<knob id="amount" pad.t="5" pad.b="4" pad.h="6"/>
214+
215+
<ui:if test="ex :in_r" >
216+
<knob id="slink" scolor="balance"/>
217+
</ui:if>
218+
219+
<!-- row 3 -->
220+
<value id="lk" pad.b="6" pad.h="6"/>
221+
<value id="duck" pad.b="6" pad.h="6"/>
222+
<value id="hold" pad.b="6" pad.h="6"/>
223+
<value id="release" pad.b="6" pad.h="6"/>
224+
<value id="amount" pad.b="6" pad.h="6"/>
225+
<ui:if test="ex :in_r" >
226+
<value id="slink" pad.b="6" pad.h="6"/>
227+
</ui:if>
228+
</grid>
229+
</group>
230+
231+
<!-- Signal control -->
232+
<group text="groups.signal">
233+
<grid rows="3" cols="2">
234+
<ui:with pad.h="6" fill="false" hexpand="true" vreduce="true">
235+
<label text="labels.input"/>
236+
<label text="labels.output"/>
237+
</ui:with>
238+
<ui:with pad.t="5" pad.b="4">
239+
<knob id="g_in"/>
240+
<knob id="g_out"/>
241+
</ui:with>
242+
243+
<value id="g_in"/>
244+
<value id="g_out"/>
245+
</grid>
246+
</group>
247+
</hbox>
248+
</vbox>
249+
250+
<!-- Premix overlay -->
251+
<overlay id="showpmx" trigger="premix_trigger" hpos="1" vpos="1" halign="-1" valign="1" ipadding.t="4">
252+
<group text="groups.premix" vexpand="false" ipadding="0">
253+
<grid rows="3" cols="8" spacing="0" bg.color="bg_schema" transpose="true">
254+
<label text="labels.premix.in_to_sc" pad.h="6" pad.v="4" />
255+
<knob id="in2sc" />
256+
<value id="in2sc" pad.h="6" pad.v="4" />
257+
258+
<label text="labels.premix.in_to_link" pad.h="6" pad.v="4" />
259+
<knob id="in2lk" />
260+
<value id="in2lk" />
261+
262+
<cell rows="3"><vsep pad.h="2" bg.color="bg" reduce="true" /></cell>
263+
264+
<label text="labels.premix.sc_to_in" pad.h="6" pad.v="4" />
265+
<knob id="sc2in" />
266+
<value id="sc2in" pad.h="6" pad.v="4" />
267+
268+
<label text="labels.premix.sc_to_link" pad.h="6" pad.v="4" />
269+
<knob id="sc2lk" />
270+
<value id="sc2lk" pad.h="6" pad.v="4" />
271+
272+
<cell rows="3"><vsep pad.h="2" bg.color="bg" reduce="true" /></cell>
273+
274+
<label text="labels.premix.link_to_in" pad.h="6" pad.v="4" />
275+
<knob id="lk2in" />
276+
<value id="lk2in" pad.h="6" pad.v="4" />
277+
278+
<label text="labels.premix.link_to_sc" pad.h="6" pad.v="4" />
279+
<knob id="lk2sc" />
280+
<value id="lk2sc" pad.h="6" pad.v="4" />
281+
</grid>
282+
</group>
283+
</overlay>
284+
285+
<!-- Mix overlay -->
286+
<overlay id="showmx" trigger="mix_trigger" hpos="1" vpos="1" halign="-1" valign="1" ipadding.t="4">
287+
<group text="groups.mix" vexpand="false" ipadding="0">
288+
<grid rows="3" cols="4" spacing="0" bg.color="bg_schema" height="139">
289+
<!-- Row 1 -->
290+
<ui:with width.min="56" pad.t="8">
291+
<label text="labels.signal.dry" pad.h="6" width="44" pad.v="4"/>
292+
<label text="labels.signal.wet" pad.h="6" width="44" pad.v="4"/>
293+
<cell rows="3" bg.color="bg" pad.h="2" hreduce="true"><vsep/></cell>
294+
<label text="labels.signal.drywet" pad.h="6" width="44" pad.v="4"/>
295+
</ui:with>
296+
297+
<!-- Row 2 -->
298+
<knob id="dry" size="20" scolor="dry"/>
299+
<knob id="wet" size="20" scolor="wet"/>
300+
<knob id="drywet" size="20" scolor="drywet"/>
301+
302+
<!-- Row 3 -->
303+
<value id="dry" pad.v="4"/>
304+
<value id="wet" pad.v="4"/>
305+
<value id="drywet" pad.v="4"/>
306+
</grid>
307+
</group>
308+
</overlay>
3309
</plugin>

src/main/meta/ringmod_sc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ namespace lsp
103103
COMBO("type", "Sidechain type", "Type", 1, ringmod_sc_types),
104104
CONTROL("hold", "Hold time", "Hold", U_MSEC, ringmod_sc::HOLD),
105105
CONTROL("release", "Release time", "Release", U_MSEC, ringmod_sc::RELEASE),
106-
CONTROL("lahead", "Lookahead time", "Lookahead", U_MSEC, ringmod_sc::RELEASE),
106+
CONTROL("lk", "Lookahead time", "Lookahead", U_MSEC, ringmod_sc::RELEASE),
107107
CONTROL("duck", "Ducking time", "Duck", U_MSEC, ringmod_sc::RELEASE),
108108
CONTROL("amount", "Amount", "Amount", U_DB, ringmod_sc::AMOUNT),
109109

@@ -135,7 +135,7 @@ namespace lsp
135135
PERCENTS("slink", "Stereo link", "Stereo link", 0.0f, 0.1f),
136136
CONTROL("hold", "Hold time", "Hold", U_MSEC, ringmod_sc::HOLD),
137137
CONTROL("release", "Release time", "Release", U_MSEC, ringmod_sc::RELEASE),
138-
CONTROL("lahead", "Lookahead time", "Lookahead", U_MSEC, ringmod_sc::RELEASE),
138+
CONTROL("lk", "Lookahead time", "Lookahead", U_MSEC, ringmod_sc::RELEASE),
139139
CONTROL("duck", "Ducking time", "Duck", U_MSEC, ringmod_sc::RELEASE),
140140
CONTROL("amount", "Amount", "Amount", U_DB, ringmod_sc::AMOUNT),
141141

src/main/plug/ringmod_sc.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,10 @@ namespace lsp
333333
c->sScDelay.init(sc_max_delay + BUFFER_SIZE);
334334

335335
for (size_t j=0; j<MG_TOTAL; ++j)
336+
{
337+
c->vGraph[j].init(meta::ringmod_sc::TIME_MESH_SIZE, samples_per_dot);
336338
c->vGraph[j].set_period(samples_per_dot);
339+
}
337340
}
338341
}
339342

@@ -474,14 +477,14 @@ namespace lsp
474477
}
475478
}
476479

477-
void ringmod_sc::process_sidechain_type(float **sc, io_buffers_t * io, size_t samples)
480+
void ringmod_sc::process_sidechain_type(float **sc, io_buffers_t *io, size_t samples)
478481
{
479482
// Select the source for the specific type of sidechain
480483
for (size_t i=0; i<nChannels; ++i)
481484
{
482-
float *buf = (nType == SC_TYPE_EXTERNAL) ? io->vScIn :
483-
(nType == SC_TYPE_SHM_LINK) ? io->vShmIn :
484-
io->vIn;
485+
float *buf = (nType == SC_TYPE_EXTERNAL) ? io[i].vScIn :
486+
(nType == SC_TYPE_SHM_LINK) ? io[i].vShmIn :
487+
io[i].vIn;
485488

486489
sc[i] = (buf != NULL) ? buf : vEmptyBuffer;
487490
}
@@ -702,7 +705,7 @@ namespace lsp
702705
void ringmod_sc::output_meshes()
703706
{
704707
plug::mesh_t *mesh = (pGraphMesh != NULL) ? pGraphMesh->buffer<plug::mesh_t>() : NULL;
705-
if ((mesh != NULL) && (!mesh->isEmpty()))
708+
if ((mesh != NULL) && (mesh->isEmpty()))
706709
{
707710
size_t index = 0;
708711
float *v = mesh->pvData[index++];

0 commit comments

Comments
 (0)