Show speaking waves for locally muted radio members
This commit is contained in:
1 parent
61818572cc
commit
d5174262d8
3 files changed
+16
-8
No files matched your search
@@ -151,11 +151,18 @@ private slots:
|
||||
QTRY_COMPARE_WITH_TIMEOUT(probe.results.size(), 1, 3000); QVERIFY(probe.results[0]);
|
||||
QCOMPARE(probe.updates, 1); QVERIFY(source.data(Qt::UserRole + 3).toInt() & CHAT_MEMBER_FLAG_RADIO_MUTED);
|
||||
QVERIFY(iconHasColor(QColor("#EF5350"))); QVERIFY(!iconHasColor(QColor("#4CAF50")));
|
||||
const QImage muted = iconImage();
|
||||
QVERIFY(muted.pixelColor(22, 6).red() > 180); // Красное перечёркивание правее корпуса динамика.
|
||||
const QImage mutedSpeaking = iconImage();
|
||||
auto redPixel = [](const QImage& image, int x, int y) {
|
||||
const QColor color = image.pixelColor(x, y);
|
||||
return color.red() > color.green() + 50;
|
||||
};
|
||||
QVERIFY(redPixel(mutedSpeaking, 21, 5)); // Красное перечёркивание правее корпуса динамика.
|
||||
QVERIFY(redPixel(mutedSpeaking, 23, 13)); // Волна видна и при локальном mute.
|
||||
post_talk(group, 42, false);
|
||||
QTRY_VERIFY(!source.data(MemberListModel::RadioSpeakingRole).toBool());
|
||||
QCOMPARE(iconImage(), muted); // Mute имеет приоритет над состоянием речи.
|
||||
const QImage mutedSilent = iconImage();
|
||||
QVERIFY(mutedSilent != mutedSpeaking);
|
||||
QVERIFY(redPixel(mutedSilent, 21, 5)); QVERIFY(!redPixel(mutedSilent, 23, 13));
|
||||
QVERIFY(other.data(MemberListModel::RadioSpeakingRole).toBool());
|
||||
QTest::mouseClick(view.viewport(), Qt::LeftButton, Qt::NoModifier, button);
|
||||
QCOMPARE(accepted, 0); QTRY_COMPARE_WITH_TIMEOUT(probe.results.size(), 2, 3000); QVERIFY(probe.results[1]);
|
||||
@@ -202,7 +209,7 @@ private slots:
|
||||
model.setChannel(QString(), false); QCOMPARE(model.rowCount(), 0);
|
||||
model.setChannel(probe.channel, false); QTRY_COMPARE_WITH_TIMEOUT(model.rowCount(), 3, 3000);
|
||||
QVERIFY(!memberIndex(42).data(MemberListModel::RadioSpeakingRole).toBool());
|
||||
DEBUG_INFO(DEBUG_CATEGORY_RADIO, "radio members test: shapes, mute priority, multiple speakers, refresh, self and reset PASS");
|
||||
DEBUG_INFO(DEBUG_CATEGORY_RADIO, "radio members test: shapes, speech while muted, multiple speakers, refresh, self and reset PASS");
|
||||
node.stop(); QVERIFY(!gui_bridge_is_uasync_ready());
|
||||
QCOMPARE(gui_bridge_toggle_member_radio_mute(probe.channel.toUtf8().constData(), 42), -1);
|
||||
gui_bridge_set_member_updated_cb(nullptr); gui_bridge_set_radio_mute_result_cb(nullptr); current = nullptr;
|
||||
|
||||
Reference in new issue
Block a user