MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / UpdateMinMaxLabels

Function UpdateMinMaxLabels

plugins/scripting/utils/properties-view.cpp:1429–1466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1427}
1428
1429static void UpdateMinMaxLabels(OBSFrameRatePropertyWidget *w)
1430{
1431 auto Hide = [&](bool hide) {
1432 w->minLabel->setHidden(hide);
1433 w->maxLabel->setHidden(hide);
1434 };
1435
1436 auto variant = w->modeSelect->currentData();
1437 if (!variant.canConvert<frame_rate_tag>() ||
1438 variant.value<frame_rate_tag>().type != frame_rate_tag::RATIONAL) {
1439 Hide(true);
1440 return;
1441 }
1442
1443 variant = w->fpsRange->currentData();
1444 if (!variant.canConvert<size_t>()) {
1445 Hide(true);
1446 return;
1447 }
1448
1449 auto idx = variant.value<size_t>();
1450 if (idx >= w->fps_ranges.size()) {
1451 Hide(true);
1452 return;
1453 }
1454
1455 Hide(false);
1456
1457 auto min = w->fps_ranges[idx].first;
1458 auto max = w->fps_ranges[idx].second;
1459
1460 w->minLabel->setText(QString("Min FPS: %1/%2")
1461 .arg(min.numerator)
1462 .arg(min.denominator));
1463 w->maxLabel->setText(QString("Max FPS: %1/%2")
1464 .arg(max.numerator)
1465 .arg(max.denominator));
1466}
1467
1468static void UpdateFPSLabels(OBSFrameRatePropertyWidget *w)
1469{

Callers 1

UpdateFPSLabelsFunction · 0.85

Calls 2

sizeMethod · 0.80
setTextMethod · 0.80

Tested by

no test coverage detected