Skip to content

Commit a32a288

Browse files
committed
limiter: added the lookahead control to the window
1 parent f43a9f0 commit a32a288

File tree

5 files changed

+74
-61
lines changed

5 files changed

+74
-61
lines changed

src/contents/ui/Limiter.qml

+68-54
Original file line numberDiff line numberDiff line change
@@ -214,74 +214,88 @@ Kirigami.ScrollablePage {
214214
contentItem: Column {
215215
id: cardSideChainColumn
216216

217-
FormCard.FormComboBoxDelegate {
218-
id: sidechainType
219-
220-
text: i18n("Type")
221-
displayMode: FormCard.FormComboBoxDelegate.ComboBox
222-
currentIndex: pluginDB.sidechainType
223-
editable: false
224-
model: [i18n("Internal"), i18n("External"), i18n("Link")]
225-
onActivated: (idx) => {
226-
pluginDB.sidechainType = idx;
227-
}
217+
GridLayout {
218+
columns: 2
219+
uniformCellWidths: true
228220

229221
anchors {
230222
left: parent.left
231223
right: parent.right
232224
}
233225

234-
}
235-
236-
FormCard.FormComboBoxDelegate {
237-
id: comboSideChainInputDevice
238-
239-
text: i18n("Input Device")
240-
displayMode: FormCard.FormComboBoxDelegate.ComboBox
241-
editable: false
242-
model: PW.ModelNodes
243-
textRole: "description"
244-
enabled: sidechainType.currentIndex === 1
245-
currentIndex: {
246-
for (let n = 0; n < PW.ModelNodes.rowCount(); n++) {
247-
if (PW.ModelNodes.getNodeName(n) === pluginDB.sidechainInputDevice)
248-
return n;
249-
226+
FormCard.FormComboBoxDelegate {
227+
id: sidechainType
228+
229+
Layout.columnSpan: 2
230+
text: i18n("Type")
231+
displayMode: FormCard.FormComboBoxDelegate.ComboBox
232+
currentIndex: pluginDB.sidechainType
233+
editable: false
234+
model: [i18n("Internal"), i18n("External"), i18n("Link")]
235+
onActivated: (idx) => {
236+
pluginDB.sidechainType = idx;
250237
}
251-
return 0;
252238
}
253-
onActivated: (idx) => {
254-
let selectedName = PW.ModelNodes.getNodeName(idx);
255-
if (selectedName !== pluginDB.sidechainInputDevice)
256-
pluginDB.sidechainInputDevice = selectedName;
257239

258-
}
240+
FormCard.FormComboBoxDelegate {
241+
id: comboSideChainInputDevice
242+
243+
Layout.columnSpan: 2
244+
text: i18n("Input Device")
245+
displayMode: FormCard.FormComboBoxDelegate.ComboBox
246+
editable: false
247+
model: PW.ModelNodes
248+
textRole: "description"
249+
enabled: sidechainType.currentIndex === 1
250+
currentIndex: {
251+
for (let n = 0; n < PW.ModelNodes.rowCount(); n++) {
252+
if (PW.ModelNodes.getNodeName(n) === pluginDB.sidechainInputDevice)
253+
return n;
254+
255+
}
256+
return 0;
257+
}
258+
onActivated: (idx) => {
259+
let selectedName = PW.ModelNodes.getNodeName(idx);
260+
if (selectedName !== pluginDB.sidechainInputDevice)
261+
pluginDB.sidechainInputDevice = selectedName;
259262

260-
anchors {
261-
left: parent.left
262-
right: parent.right
263+
}
263264
}
264265

265-
}
266-
267-
EeSpinBox {
268-
id: sidechainPreamp
269-
270-
label: i18n("Preamp")
271-
from: pluginDB.getMinValue("sidechainPreamp")
272-
to: pluginDB.getMaxValue("sidechainPreamp")
273-
value: pluginDB.sidechainPreamp
274-
decimals: 2
275-
stepSize: 0.01
276-
unit: "dB"
277-
minusInfinityMode: true
278-
onValueModified: (v) => {
279-
pluginDB.sidechainPreamp = v;
266+
EeSpinBox {
267+
id: sidechainPreamp
268+
269+
label: i18n("Preamp")
270+
labelAbove: true
271+
spinboxLayoutFillWidth: true
272+
from: pluginDB.getMinValue("sidechainPreamp")
273+
to: pluginDB.getMaxValue("sidechainPreamp")
274+
value: pluginDB.sidechainPreamp
275+
decimals: 2
276+
stepSize: 0.01
277+
unit: "dB"
278+
minusInfinityMode: true
279+
onValueModified: (v) => {
280+
pluginDB.sidechainPreamp = v;
281+
}
280282
}
281283

282-
anchors {
283-
left: parent.left
284-
right: parent.right
284+
EeSpinBox {
285+
id: lookahead
286+
287+
label: i18n("Lookahead")
288+
labelAbove: true
289+
spinboxLayoutFillWidth: true
290+
from: pluginDB.getMinValue("lookahead")
291+
to: pluginDB.getMaxValue("lookahead")
292+
value: pluginDB.lookahead
293+
decimals: 2
294+
stepSize: 0.01
295+
unit: "ms"
296+
onValueModified: (v) => {
297+
pluginDB.lookahead = v;
298+
}
285299
}
286300

287301
}

src/plugin_base.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ void on_process(void* userdata, spa_io_position* position) {
7777
std::ranges::fill(d->pb->dummy_left, 0.0F);
7878
std::ranges::fill(d->pb->dummy_right, 0.0F);
7979

80-
d->pb->clock_start = std::chrono::system_clock::now();
81-
8280
d->pb->setup();
8381
}
8482

src/plugin_base.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <sys/types.h>
2727
#include <QTimer>
2828
#include <atomic>
29-
#include <chrono>
3029
#include <memory>
3130
#include <mutex>
3231
#include <span>
@@ -106,8 +105,6 @@ class PluginBase : public QObject {
106105
float input_peak_left = 0.0F, input_peak_right = 0.0F;
107106
float output_peak_left = 0.0F, output_peak_right = 0.0F;
108107

109-
std::chrono::time_point<std::chrono::system_clock> clock_start;
110-
111108
std::vector<float> dummy_left, dummy_right;
112109

113110
[[nodiscard]] auto get_node_id() const -> uint;

src/pw_manager.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,6 @@ void Manager::load_virtual_devices() {
13451345
pw_properties_set(props_sink, PW_KEY_NODE_NAME, tags::pipewire::ee_sink_name);
13461346
pw_properties_set(props_sink, PW_KEY_NODE_DESCRIPTION, "Easy Effects Sink");
13471347
pw_properties_set(props_sink, PW_KEY_NODE_VIRTUAL, "true");
1348-
pw_properties_set(props_sink, PW_KEY_NODE_PASSIVE, "out");
13491348
pw_properties_set(props_sink, "factory.name", "support.null-audio-sink");
13501349
pw_properties_set(props_sink, PW_KEY_MEDIA_CLASS, tags::pipewire::media_class::sink);
13511350
pw_properties_set(props_sink, "audio.position", "FL,FR");

util/debug.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
QT_LOGGING_RULES="qt.qml.binding.removal.info=true"
1+
QT_LOGGING_RULES="qt.qml.binding.removal.info=true"
2+
3+
Creating test files
4+
5+
sox -n -c 2 -r 48000 -b 16 pink_noise.wav synth 10 pinknoise gain -12
6+
sox -n -c 2 -r 48000 -b 16 silence.wav trim 0 10

0 commit comments

Comments
 (0)