ui: the node editor offers the de-noise node and persists its window

The form gains a `median samples` row, shown only for `DeNoise`; the corner row widens to
anything that reads `fc` (`math_op_uses_fc()`) while `q` stays band-pass-only, and the wiring
row keeps its place at the end so the form's order is unchanged for every existing op.

The session format gains a thirteenth field, `med_n`, after `y`. A twelve-field node -- a file
written before this node existed -- still loads, with `med_n` left at the struct's default,
which is what such a file meant; the reader's `return number(...) && ...` chain had to become a
guarded sequence so the thirteenth field could be read conditionally.

The math probe enables the channel it builds its graphs from, the same self-sufficiency rule
the noise and measurement probes already follow: `enable_all_probe` ends by switching one
signal off, and with `sine` gone the graphs landed on `square`, changing a documented line for
reasons unrelated to the math.

Readings: `[math-probe] 2 math channels on 'sine' and 'noise'`, `pane add: 'math3' sources
'sine'`, `graph edit: stored_slots 31000 -> 32000`, `dialog build: nodes=2, output after add=1`
and the rest of the suite unchanged; no `Gtk-CRITICAL`.
This commit is contained in:
Martino Ferrari committed 2026-10-13 15:50:58 +02:00
1 parent 1bde8809dd
commit 5c2c221777
5 files changed
+41 -7

No files matched your search

+6 -1
View File
@@ -835,6 +835,7 @@ void on_math_param_changed(GtkWidget*, gpointer user) {
n.offset = gtk_spin_button_get_value(GTK_SPIN_BUTTON(d->offset));
n.fc = gtk_spin_button_get_value(GTK_SPIN_BUTTON(d->fc));
n.q = gtk_spin_button_get_value(GTK_SPIN_BUTTON(d->q));
n.med_n = static_cast<int>(gtk_spin_button_get_value(GTK_SPIN_BUTTON(d->med)));
n.lo = gtk_spin_button_get_value(GTK_SPIN_BUTTON(d->lo));
n.hi = gtk_spin_button_get_value(GTK_SPIN_BUTTON(d->hi));
if (d->source_drop != nullptr) {
@@ -930,14 +931,18 @@ void math_dialog_sync_form(MathDialog* d) {
const bool source = op == MathOp::Source;
gtk_widget_set_visible(d->rows[0], source); // the source channel
gtk_widget_set_visible(d->rows[1], gain);
gtk_widget_set_visible(d->rows[2], filter);
// The corner row is shown for anything that reads `fc`, which is now the three biquads *and* the
// de-noise node; `q` stays a band-pass-only row.
gtk_widget_set_visible(d->rows[2], math_op_uses_fc(op));
gtk_widget_set_visible(d->rows[3], filter && op == MathOp::BandPass);
gtk_widget_set_visible(d->rows[4], clamp);
gtk_widget_set_visible(d->rows[5], true); // the inputs, always: they say what is wired
gtk_widget_set_visible(d->rows[6], math_op_uses_median(op));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(d->gain), n.gain);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(d->offset), n.offset);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(d->fc), n.fc);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(d->q), n.q);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(d->med), static_cast<double>(n.med_n));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(d->lo), n.lo);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(d->hi), n.hi);
if (d->source_drop != nullptr) {