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

Method GetCurrentValueClicked

plugins/base/macro-action-obs-settings.cpp:314–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314void MacroActionOBSSettingsEdit::GetCurrentValueClicked()
315{
316 const auto setSpinVideoValue = [this](VariableSpinBox *spin,
317 const char *name) {
318 auto value = getConfigValueHelper(config_get_uint,
319 config_get_default_uint,
320 "Video", name);
321 if (!value) {
322 return;
323 }
324 spin->SetFixedValue(static_cast<int>(*value));
325 };
326 const auto setFpsValue = [&](const char *name) {
327 setSpinVideoValue(_fpsIntValue, name);
328 };
329 const auto setCanvasValue = [&](const char *name) {
330 setSpinVideoValue(_canvasSizeValue, name);
331 };
332
333 switch (_entryData->_action) {
334 case MacroActionOBSSettings::Action::FPS_COMMON_VALUE: {
335 auto value = getConfigValueHelper(config_get_string,
336 config_get_default_string,
337 "Video", "FPSCommon");
338 if (!value) {
339 break;
340 }
341 _fpsStringValue->setText(QString(*value));
342 break;
343 }
344 case MacroActionOBSSettings::Action::FPS_INT_VALUE:
345 setFpsValue("FPSInt");
346 break;
347 case MacroActionOBSSettings::Action::FPS_NUM_VALUE:
348 setFpsValue("FPSNum");
349 break;
350 case MacroActionOBSSettings::Action::FPS_DEN_VALUE:
351 setFpsValue("FPSDen");
352 break;
353 case MacroActionOBSSettings::Action::BASE_CANVAS_X_VALUE:
354 setCanvasValue("BaseCX");
355 break;
356 case MacroActionOBSSettings::Action::BASE_CANVAS_Y_VALUE:
357 setCanvasValue("BaseCY");
358 break;
359 case MacroActionOBSSettings::Action::OUTPUT_X_VALUE:
360 setCanvasValue("OutputCX");
361 break;
362 case MacroActionOBSSettings::Action::OUTPUT_Y_VALUE:
363 setCanvasValue("OutputCY");
364 break;
365 default:
366 break;
367 }
368}
369
370void MacroActionOBSSettingsEdit::SetWidgetVisibility()
371{

Callers

nothing calls this directly

Calls 3

getConfigValueHelperFunction · 0.85
SetFixedValueMethod · 0.80
setTextMethod · 0.80

Tested by

no test coverage detected