Skip to content

Commit a2f6c87

Browse files
committed
Implemented frequency, level and note display for filters and splits in the UI
1 parent c26da03 commit a2f6c87

7 files changed

Lines changed: 366 additions & 20 deletions

File tree

include/private/meta/deesser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ namespace lsp
8181
static constexpr float PF_Q_MIN = 0.0f;
8282
static constexpr float PF_Q_MAX = 10.0f;
8383
static constexpr float PF_Q_DFL = 0.0f;
84-
static constexpr float PF_Q_STEP = 0.0125f;
84+
static constexpr float PF_Q_STEP = 0.025f;
8585

8686
static constexpr float PEAK1_FREQ_MIN = 1000.0f;
8787
static constexpr float PEAK1_FREQ_MAX = 10000.0f;

include/private/ui/deesser.h

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*
2+
* Copyright (C) 2026 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2026 Vladimir Sadovnikov <sadko4u@gmail.com>
4+
*
5+
* This file is part of lsp-plugins-deesser
6+
* Created on: 27 июн. 2026 г.
7+
*
8+
* lsp-plugins-deesser is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU Lesser General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* any later version.
12+
*
13+
* lsp-plugins-deesser is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Lesser General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Lesser General Public License
19+
* along with lsp-plugins-deesser. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
22+
#ifndef PRIVATE_UI_DEESSER_H_
23+
#define PRIVATE_UI_DEESSER_H_
24+
25+
#include <lsp-plug.in/plug-fw/ui.h>
26+
#include <lsp-plug.in/tk/tk.h>
27+
#include <lsp-plug.in/lltl/darray.h>
28+
29+
namespace lsp
30+
{
31+
namespace plugui
32+
{
33+
/**
34+
* UI for Deesser plugin series
35+
*/
36+
class deesser_ui: public ui::Module, public ui::IPortListener
37+
{
38+
protected:
39+
typedef struct filter_label_t
40+
{
41+
ui::IPort *pFreq; // Port that contains frequency value
42+
ui::IPort *pLevel; // Port that contains amplification value
43+
tk::Widget *wWidget; // Associated widget
44+
tk::GraphText *wText; // Associated text
45+
const char *sLcKey; // Localization key
46+
uint32_t nID; // ID
47+
} filter_label_t;
48+
49+
typedef struct filter_label_meta_t
50+
{
51+
const uint32_t id;
52+
const char *freq_id;
53+
const char *lvl_id;
54+
const char *widget_id;
55+
const char *text_id;
56+
const char *lc_key;
57+
} filter_label_meta_t;
58+
59+
protected:
60+
static const filter_label_meta_t filter_label_meta[];
61+
62+
protected:
63+
lltl::darray<filter_label_t> vFilterLabels;
64+
65+
protected:
66+
static status_t slot_filter_label_mouse_in(tk::Widget *sender, void *ptr, void *data);
67+
static status_t slot_filter_label_mouse_out(tk::Widget *sender, void *ptr, void *data);
68+
69+
protected:
70+
void add_filter_label(const filter_label_meta_t * meta);
71+
void update_filter_label_text(filter_label_t *label);
72+
73+
public:
74+
explicit deesser_ui(const meta::plugin_t *meta);
75+
deesser_ui(const deesser_ui &) = delete;
76+
deesser_ui(deesser_ui &&) = delete;
77+
virtual ~deesser_ui() override;
78+
79+
deesser_ui & operator = (const deesser_ui &) = delete;
80+
deesser_ui & operator = (deesser_ui &&) = delete;
81+
82+
public:
83+
virtual status_t post_init() override;
84+
85+
virtual void notify(ui::IPort *port, size_t flags) override;
86+
};
87+
} /* namespace plugui */
88+
} /* namespace lsp */
89+
90+
91+
#endif /* PRIVATE_UI_DEESSER_H_ */

res/main/i18n/default/lists.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@
66
"modern": "Modern",
77
"off": "Off"
88
},
9+
"notes": {
10+
"hpf": {
11+
"full": "Hi-pass #{@id}\n{@frequency%.2f} Hz\n{@note}{@octave}{@cents}",
12+
"unknown": "Hi-pass #{@id}\n{@frequency%.2f} Hz"
13+
},
14+
"lpf": {
15+
"full": "Lo-pass #{@id}\n{@frequency%.2f} Hz\n{@note}{@octave}{@cents}",
16+
"unknown": "Lo-pass #{@id}\n{@frequency%.2f} Hz"
17+
},
18+
"peak": {
19+
"full": "Peak #{@id}\n{@frequency%.2f} Hz\n{@note}{@octave}{@cents}\n{@gain%.2f} dB",
20+
"unknown": "Peak #{@id}\n{@frequency%.2f} Hz\n{@gain%.2f} dB"
21+
},
22+
"split": {
23+
"full": "Split #{@id}\n{@frequency%.2f} Hz\n{@note}{@octave}{@cents}",
24+
"unknown": "Split #{@id}\n{@frequency%.2f} Hz"
25+
}
26+
},
927
"slope": {
1028
"12dbo": "LR2 (12 dB/oct)",
1129
"24dbo": "LR4 (24 dB/oct)",

res/main/i18n/ru/lists.json

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,28 @@
66
"modern": "Современный",
77
"off": "Выключен"
88
},
9+
"notes": {
10+
"hpf": {
11+
"full": "НЧ срез\n{@frequency%.2f} Гц\n{@note}{@octave}{@cents}",
12+
"unknown": "НЧ срез #{@id}\n{@frequency%.2f} Гц"
13+
},
14+
"lpf": {
15+
"full": "ВЧ срез\n{@frequency%.2f} Гц\n{@note}{@octave}{@cents}",
16+
"unknown": "ВЧ срез\n{@frequency%.2f} Гц"
17+
},
18+
"peak": {
19+
"full": "Пик #{@id}\n{@frequency%.2f} Гц\n{@note}{@octave}{@cents}\n{@gain%.2f} дБ",
20+
"unknown": "Пик #{@id}\n{@frequency%.2f} Гц\n{@gain%.2f} дБ"
21+
},
22+
"split": {
23+
"full": "Раздел\n{@frequency%.2f} Гц\n{@note}{@octave}{@cents}",
24+
"unknown": "Раздел\n{@frequency%.2f} Гц"
25+
}
26+
},
927
"slope": {
10-
"12dbo": "LR2 (12 dB/oct)",
11-
"24dbo": "LR4 (24 dB/oct)",
12-
"48dbo": "LR8 (48 dB/oct)"
28+
"12dbo": "LR2 (12 дБ/окт)",
29+
"24dbo": "LR4 (24 дБ/окт)",
30+
"48dbo": "LR8 (48 дБ/окт)"
1331
}
1432
}
1533
}

res/main/i18n/us/lists.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@
66
"modern": "Modern",
77
"off": "Off"
88
},
9+
"notes": {
10+
"hpf": {
11+
"full": "Hi-pass\n{@frequency%.2f} Hz\n{@note}{@octave}{@cents}",
12+
"unknown": "Hi-pass #{@id}\n{@frequency%.2f} Hz"
13+
},
14+
"lpf": {
15+
"full": "Lo-pass\n{@frequency%.2f} Hz\n{@note}{@octave}{@cents}",
16+
"unknown": "Lo-pass\n{@frequency%.2f} Hz"
17+
},
18+
"peak": {
19+
"full": "Peak #{@id}\n{@frequency%.2f} Hz\n{@note}{@octave}{@cents}\n{@gain%.2f} dB",
20+
"unknown": "Peak #{@id}\n{@frequency%.2f} Hz\n{@gain%.2f} dB"
21+
},
22+
"split": {
23+
"full": "Split\n{@frequency%.2f} Hz\n{@note}{@octave}{@cents}",
24+
"unknown": "Split\n{@frequency%.2f} Hz"
25+
}
26+
},
927
"slope": {
1028
"12dbo": "LR2 (12 dB/oct)",
1129
"24dbo": "LR4 (24 dB/oct)",

res/main/ui/plugins/dynamics/deesser.xml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@
274274
x.editable="true" y.editable="true" z.editable="true"
275275
x.astep="1" y.astep="1" >
276276
<dot
277-
ui:id="filter_dot_0"
277+
ui:id="filter_dot_hpf"
278278
x.id="hpf_f"
279279
y="1"
280280
z.id="hpf_q"
@@ -285,7 +285,7 @@
285285
bcolor.hue="0.0" hover.bcolor.hue="0.0"
286286
visibility=":hpf_s igt 0" />
287287
<dot
288-
ui:id="filter_dot_1"
288+
ui:id="filter_dot_pk1"
289289
x.id="pk1_f"
290290
y.id="pk1_g"
291291
z.id="pk1_q"
@@ -295,7 +295,7 @@
295295
bcolor.hue="0.25" hover.bcolor.hue="0.25"
296296
visibility=":pk1_on" />
297297
<dot
298-
ui:id="filter_dot_2"
298+
ui:id="filter_dot_pk2"
299299
x.id="pk2_f"
300300
y.id="pk2_g"
301301
z.id="pk2_q"
@@ -305,7 +305,7 @@
305305
bcolor.hue="0.5" hover.bcolor.hue="0.5"
306306
visibility=":pk2_on" />
307307
<dot
308-
ui:id="filter_dot_3"
308+
ui:id="filter_dot_lpf"
309309
x.id="lpf_f"
310310
y="1"
311311
z.id="lpf_q"
@@ -369,42 +369,42 @@
369369
<ui:with ox="0" oy="2" y="1" valign="-1" color="graph_marker_cycle" pad.h="4" font.bold="true">
370370
<text
371371
ui:id="hpf_note"
372-
visibility=":hpf_s igt 0"
372+
visibility="false"
373373
x=":hpf_f"
374-
text="HPF"
374+
text=""
375375
halign="(:hpf_f lt 500) ? 1 : -1"
376376
text.halign="(:hpf_f lt 500) ? -1 : 1"
377377
color.hue="0" />
378378
<text
379379
ui:id="pk1_note"
380-
visibility=":pk1_on"
380+
visibility="false"
381381
x=":pk1_f"
382-
text="PK1"
382+
text=""
383383
halign="(:pk1_f lt 500) ? 1 : -1"
384384
text.halign="(:pk1_f lt 500) ? -1 : 1"
385385
color.hue="0.25" />
386386
<text
387387
ui:id="pk2_note"
388-
visibility=":pk2_on"
388+
visibility="false"
389389
x=":pk2_f"
390-
text="PK2"
390+
text=""
391391
halign="(:pk2_f lt 500) ? 1 : -1"
392392
text.halign="(:pk2_f lt 500) ? -1 : 1"
393393
color.hue="0.5" />
394394
<text
395395
ui:id="lpf_note"
396-
visibility=":lpf_s igt 0"
396+
visibility="false"
397397
x=":lpf_f"
398-
text="LPF"
398+
text=""
399399
halign="(:lpf_f lt 500) ? 1 : -1"
400400
text.halign="(:lpf_f lt 500) ? -1 : 1"
401401
color.hue="0.75" />
402402

403403
<text
404404
ui:id="split_note"
405-
visibility=":xsplit"
405+
visibility="false"
406406
x=":split"
407-
text="SPLIT"
407+
text=""
408408
halign="(:split lt 500) ? 1 : -1"
409409
text.halign="(:split lt 500) ? -1 : 1"
410410
color.hue="0.5"/>
@@ -773,7 +773,7 @@
773773
<label text="labels.ratio" />
774774
<label text="labels.knee" />
775775
<label text="labels.split" activity=":xsplit igt 0" />
776-
<label text="labels.lpf_link" activity=":xsplit igt 0" />
776+
<label text="labels.lf_link" activity=":xsplit igt 0" />
777777
<ui:if test=":stereo">
778778
<label text="labels.link" activity=":ssplit" />
779779
</ui:if>

0 commit comments

Comments
 (0)