GUI M8f: Event-driven updates, deferred link restoration, routing rules UI
This commit is contained in:
parent
e8d3f63f4d
commit
b819d6fd65
6 changed files with 440 additions and 121 deletions
|
|
@ -1252,3 +1252,75 @@ TEST_CASE("volume state cleaned up on node deletion") {
|
|||
REQUIRE(state.volume == Catch::Approx(1.0f));
|
||||
REQUIRE_FALSE(state.mute);
|
||||
}
|
||||
|
||||
TEST_CASE("GraphEditorWidget has RULES tab") {
|
||||
auto tc = TestClient::Create();
|
||||
if (!tc.available()) { SUCCEED("PipeWire unavailable"); return; }
|
||||
ensureApp();
|
||||
|
||||
GraphEditorWidget widget(tc.client.get());
|
||||
auto *sidebar = widget.findChild<QTabWidget *>();
|
||||
REQUIRE(sidebar != nullptr);
|
||||
bool found = false;
|
||||
for (int i = 0; i < sidebar->count(); ++i) {
|
||||
if (sidebar->tabText(i) == "RULES") {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
REQUIRE(found);
|
||||
}
|
||||
|
||||
TEST_CASE("SetChangeCallback fires on node insert") {
|
||||
auto tc = TestClient::Create();
|
||||
if (!tc.available()) { SUCCEED("PipeWire unavailable"); return; }
|
||||
|
||||
std::atomic<int> count{0};
|
||||
tc.client->SetChangeCallback([&count]() { ++count; });
|
||||
|
||||
REQUIRE(tc.client->Test_InsertNode(
|
||||
MakeNode(100800, "cb-test-node", "Audio/Sink")).ok());
|
||||
REQUIRE(count.load() >= 1);
|
||||
}
|
||||
|
||||
TEST_CASE("SetChangeCallback fires on node remove") {
|
||||
auto tc = TestClient::Create();
|
||||
if (!tc.available()) { SUCCEED("PipeWire unavailable"); return; }
|
||||
|
||||
REQUIRE(tc.client->Test_InsertNode(
|
||||
MakeNode(100810, "cb-remove-node", "Audio/Sink")).ok());
|
||||
|
||||
std::atomic<int> count{0};
|
||||
tc.client->SetChangeCallback([&count]() { ++count; });
|
||||
|
||||
REQUIRE(tc.client->Test_RemoveGlobal(100810).ok());
|
||||
REQUIRE(count.load() >= 1);
|
||||
}
|
||||
|
||||
TEST_CASE("SetChangeCallback can be cleared") {
|
||||
auto tc = TestClient::Create();
|
||||
if (!tc.available()) { SUCCEED("PipeWire unavailable"); return; }
|
||||
|
||||
std::atomic<int> count{0};
|
||||
tc.client->SetChangeCallback([&count]() { ++count; });
|
||||
tc.client->SetChangeCallback(nullptr);
|
||||
|
||||
REQUIRE(tc.client->Test_InsertNode(
|
||||
MakeNode(100820, "cb-clear-node", "Audio/Sink")).ok());
|
||||
REQUIRE(count.load() == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("sidebar tab order is METERS MIXER PRESETS RULES") {
|
||||
auto tc = TestClient::Create();
|
||||
if (!tc.available()) { SUCCEED("PipeWire unavailable"); return; }
|
||||
ensureApp();
|
||||
|
||||
GraphEditorWidget widget(tc.client.get());
|
||||
auto *sidebar = widget.findChild<QTabWidget *>();
|
||||
REQUIRE(sidebar != nullptr);
|
||||
REQUIRE(sidebar->count() >= 4);
|
||||
REQUIRE(sidebar->tabText(0) == "METERS");
|
||||
REQUIRE(sidebar->tabText(1) == "MIXER");
|
||||
REQUIRE(sidebar->tabText(2) == "PRESETS");
|
||||
REQUIRE(sidebar->tabText(3) == "RULES");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue