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:
1 parent
1bde8809dd
commit
5c2c221777
5 files changed
+41
-7
No files matched your search
+14
-4
@@ -366,7 +366,7 @@ std::string math_node_text(const MathNode& node) {
|
||||
std::ostringstream o;
|
||||
o << kind << '|' << node.source << '|' << node.in_a << '|' << node.in_b << '|' << node.gain << '|'
|
||||
<< node.offset << '|' << node.fc << '|' << node.q << '|' << node.lo << '|' << node.hi << '|'
|
||||
<< node.x << '|' << node.y;
|
||||
<< node.x << '|' << node.y << '|' << node.med_n;
|
||||
return o.str();
|
||||
}
|
||||
|
||||
@@ -382,7 +382,9 @@ bool math_node_from_text(const std::string& text, MathNode& out) {
|
||||
}
|
||||
}
|
||||
f.push_back(cur);
|
||||
if (f.size() != 12u) return false;
|
||||
// Twelve fields is a session file written before the de-noise node existed; its `med_n` stays at the
|
||||
// struct's default, which is what that file meant.
|
||||
if (f.size() != 12u && f.size() != 13u) return false;
|
||||
const auto number = [&](std::size_t i, double& v) {
|
||||
try {
|
||||
v = std::stod(f[i]);
|
||||
@@ -402,8 +404,16 @@ bool math_node_from_text(const std::string& text, MathNode& out) {
|
||||
out.source = f[1];
|
||||
out.in_a = static_cast<int>(in_a);
|
||||
out.in_b = static_cast<int>(in_b);
|
||||
return number(4, out.gain) && number(5, out.offset) && number(6, out.fc) && number(7, out.q) &&
|
||||
number(8, out.lo) && number(9, out.hi) && number(10, out.x) && number(11, out.y);
|
||||
if (!(number(4, out.gain) && number(5, out.offset) && number(6, out.fc) && number(7, out.q) &&
|
||||
number(8, out.lo) && number(9, out.hi) && number(10, out.x) && number(11, out.y))) {
|
||||
return false;
|
||||
}
|
||||
if (f.size() == 13u) {
|
||||
double med = 0.0;
|
||||
if (!number(12, med)) return false;
|
||||
out.med_n = static_cast<int>(med);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool load_layout(const std::string& path, LayoutState& out) {
|
||||
|
||||
Reference in new issue
Block a user