1
0
Fork 0
forked from hanez/xtc

Phase 24: add mix buses, coherent peak meters and master clipping indicators

This commit is contained in:
Johannes Findeisen 2026-10-27 16:15:34 +01:00
commit 2fd7724065
32 changed files with 632 additions and 61 deletions

View file

@ -30,7 +30,7 @@ static Fl_Widget *button(Fl_Group &group, const std::string &label)
{
for (int i = 0; i < group.children(); ++i) {
auto *child = group.child(i);
if (child->label() && label == child->label()) return child;
if (child->label() && (label == child->label() || (label.compare(0, 7, "Master ") == 0 && std::string(child->label()).compare(0, label.size(), label) == 0))) return child;
if (auto *nested = dynamic_cast<Fl_Group *>(child))
if (auto *match = button(*nested, label)) return match;
}
@ -142,12 +142,13 @@ int main(int argc, char **argv)
press(window, "Play"); pump();
CHECK(!button(window, "Play")->active() && button(window, "Pause")->active());
CHECK(timeline->position() > 1920);
auto *left_meter = dynamic_cast<Fl_Progress *>(button(window, "Output L"));
auto *right_meter = dynamic_cast<Fl_Progress *>(button(window, "Output R"));
CHECK(left_meter && right_meter && left_meter->value() > 0 && right_meter->value() > 0);
auto *left_meter = dynamic_cast<Fl_Progress *>(button(window, "Master L"));
auto *right_meter = dynamic_cast<Fl_Progress *>(button(window, "Master R"));
CHECK(left_meter && right_meter && left_meter->value() > -90 && right_meter->value() > -90);
const double playing_left = left_meter->value(), playing_right = right_meter->value();
CHECK(window.pause_playback() == XTC_OK);
pump(); // Fade completion is acknowledged by the GUI timer.
CHECK(left_meter->value() == 0 && right_meter->value() == 0);
CHECK(left_meter->value() < playing_left && right_meter->value() < playing_right);
uint64_t paused = timeline->position(); pump();
CHECK(timeline->position() == paused);
press(window, "Play"); pump();