Improve setting type consistency
This commit is contained in:
parent
9116be8d9c
commit
ad4b581112
@ -87,7 +87,7 @@ bool OBSApp::InitGlobalConfigDefaults()
|
||||
config_set_default_uint(globalConfig, "Video", "OutputCX", cx);
|
||||
config_set_default_uint(globalConfig, "Video", "OutputCY", cy);
|
||||
|
||||
config_set_default_int(globalConfig, "Video", "FPSType", 0);
|
||||
config_set_default_uint(globalConfig, "Video", "FPSType", 0);
|
||||
config_set_default_string(globalConfig, "Video", "FPSCommon", "30");
|
||||
config_set_default_uint(globalConfig, "Video", "FPSInt", 30);
|
||||
config_set_default_uint(globalConfig, "Video", "FPSNum", 30);
|
||||
@ -233,13 +233,13 @@ void OBSApp::GetFPSNanoseconds(uint32_t &num, uint32_t &den) const
|
||||
|
||||
void OBSApp::GetConfigFPS(uint32_t &num, uint32_t &den) const
|
||||
{
|
||||
const char *type = config_get_string(globalConfig, "Video", "FPSType");
|
||||
uint32_t type = config_get_uint(globalConfig, "Video", "FPSType");
|
||||
|
||||
if (astrcmpi(type, "Integer") == 0)
|
||||
if (type == 1) //"Integer"
|
||||
GetFPSInteger(num, den);
|
||||
else if (astrcmpi(type, "Fraction") == 0)
|
||||
else if (type == 2) //"Fraction"
|
||||
GetFPSFraction(num, den);
|
||||
else if (astrcmpi(type, "Nanoseconds") == 0)
|
||||
else if (false) //"Nanoseconds", currently not implemented
|
||||
GetFPSNanoseconds(num, den);
|
||||
else
|
||||
GetFPSCommon(num, den);
|
||||
|
@ -223,14 +223,14 @@ static inline void LoadFPSCommon(Ui::OBSBasicSettings *ui)
|
||||
|
||||
static inline void LoadFPSInteger(Ui::OBSBasicSettings *ui)
|
||||
{
|
||||
int val = config_get_int(GetGlobalConfig(), "Video", "FPSInt");
|
||||
uint32_t val = config_get_uint(GetGlobalConfig(), "Video", "FPSInt");
|
||||
ui->fpsInteger->setValue(val);
|
||||
}
|
||||
|
||||
static inline void LoadFPSFraction(Ui::OBSBasicSettings *ui)
|
||||
{
|
||||
int num = config_get_int(GetGlobalConfig(), "Video", "FPSNum");
|
||||
int den = config_get_int(GetGlobalConfig(), "Video", "FPSDen");
|
||||
uint32_t num = config_get_uint(GetGlobalConfig(), "Video", "FPSNum");
|
||||
uint32_t den = config_get_uint(GetGlobalConfig(), "Video", "FPSDen");
|
||||
|
||||
ui->fpsNumerator->setValue(num);
|
||||
ui->fpsDenominator->setValue(den);
|
||||
@ -242,8 +242,9 @@ void OBSBasicSettings::LoadFPSData()
|
||||
LoadFPSInteger(ui.get());
|
||||
LoadFPSFraction(ui.get());
|
||||
|
||||
int fpsType = config_get_int(GetGlobalConfig(), "Video", "FPSType");
|
||||
if (fpsType < 0 || fpsType > 2) fpsType = 0;
|
||||
uint32_t fpsType = config_get_uint(GetGlobalConfig(), "Video",
|
||||
"FPSType");
|
||||
if (fpsType > 2) fpsType = 0;
|
||||
|
||||
ui->fpsType->setCurrentIndex(fpsType);
|
||||
ui->fpsTypes->setCurrentIndex(fpsType);
|
||||
|
Loading…
x
Reference in New Issue
Block a user