UI: Refactor to make it easier to get service object

Refactors a bit of code to make it easier to get the current stream
service object in the settings
master
jp9000 2020-11-11 09:46:52 -08:00
parent fb7747c56e
commit 005863a346
3 changed files with 8 additions and 7 deletions

View File

@ -650,3 +650,8 @@ void OBSBasicSettings::UpdateVodTrackSetting()
vodTrack[i]->setChecked((i + 1) == trackIndex); vodTrack[i]->setChecked((i + 1) == trackIndex);
} }
} }
OBSService OBSBasicSettings::GetStream1Service()
{
return stream1Changed ? SpawnTempService() : main->GetService();
}

View File

@ -4604,13 +4604,7 @@ void OBSBasicSettings::SimpleRecordingEncoderChanged()
QString warning; QString warning;
bool advanced = ui->simpleOutAdvanced->isChecked(); bool advanced = ui->simpleOutAdvanced->isChecked();
bool enforceBitrate = ui->simpleOutEnforce->isChecked() || !advanced; bool enforceBitrate = ui->simpleOutEnforce->isChecked() || !advanced;
OBSService service; OBSService service = GetStream1Service();
if (stream1Changed) {
service = SpawnTempService();
} else {
service = main->GetService();
}
delete simpleOutRecWarning; delete simpleOutRecWarning;

View File

@ -316,6 +316,8 @@ private:
int CurrentFLVTrack(); int CurrentFLVTrack();
OBSService GetStream1Service();
private slots: private slots:
void on_theme_activated(int idx); void on_theme_activated(int idx);