New upstream version 19.0.3+dfsg1
This commit is contained in:
parent
3708b8e092
commit
1f1bbb3518
534 changed files with 13862 additions and 2459 deletions
|
|
@ -151,6 +151,23 @@ static inline bool SetComboByValue(QComboBox *combo, const char *name)
|
|||
return false;
|
||||
}
|
||||
|
||||
static inline bool SetInvalidValue(QComboBox *combo, const char *name,
|
||||
const char *data = nullptr)
|
||||
{
|
||||
combo->insertItem(0, name, data);
|
||||
|
||||
QStandardItemModel *model =
|
||||
dynamic_cast<QStandardItemModel*>(combo->model());
|
||||
if (!model)
|
||||
return false;
|
||||
|
||||
QStandardItem *item = model->item(0);
|
||||
item->setFlags(Qt::NoItemFlags);
|
||||
|
||||
combo->setCurrentIndex(0);
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline QString GetComboData(QComboBox *combo)
|
||||
{
|
||||
int idx = combo->currentIndex();
|
||||
|
|
@ -260,6 +277,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
|
||||
ui->setupUi(this);
|
||||
|
||||
main->EnableOutputs(false);
|
||||
|
||||
PopulateAACBitrates({ui->simpleOutputABitrate,
|
||||
ui->advOutTrack1Bitrate, ui->advOutTrack2Bitrate,
|
||||
ui->advOutTrack3Bitrate, ui->advOutTrack4Bitrate,
|
||||
|
|
@ -274,6 +293,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
HookWidget(ui->language, COMBO_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->theme, COMBO_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->enableAutoUpdates, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->openStatsOnStartup, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->warnBeforeStreamStart,CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->warnBeforeStreamStop, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->hideProjectorCursor, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
|
|
@ -392,6 +412,9 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
HookWidget(ui->resetOSXVSync, CHECK_CHANGED, ADV_CHANGED);
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
HookWidget(ui->monitoringDevice, COMBO_CHANGED, ADV_CHANGED);
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
HookWidget(ui->disableAudioDucking, CHECK_CHANGED, ADV_CHANGED);
|
||||
#endif
|
||||
HookWidget(ui->filenameFormatting, EDIT_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->overwriteIfExists, CHECK_CHANGED, ADV_CHANGED);
|
||||
|
|
@ -461,6 +484,9 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
delete ui->advancedGeneralGroupBox;
|
||||
delete ui->enableNewSocketLoop;
|
||||
delete ui->enableLowLatencyMode;
|
||||
#ifdef __APPLE__
|
||||
delete ui->disableAudioDucking;
|
||||
#endif
|
||||
ui->rendererLabel = nullptr;
|
||||
ui->renderer = nullptr;
|
||||
ui->adapterLabel = nullptr;
|
||||
|
|
@ -470,6 +496,9 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
ui->advancedGeneralGroupBox = nullptr;
|
||||
ui->enableNewSocketLoop = nullptr;
|
||||
ui->enableLowLatencyMode = nullptr;
|
||||
#ifdef __APPLE__
|
||||
ui->disableAudioDucking = nullptr;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __APPLE__
|
||||
|
|
@ -627,6 +656,11 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
UpdateAutomaticReplayBufferCheckboxes();
|
||||
}
|
||||
|
||||
OBSBasicSettings::~OBSBasicSettings()
|
||||
{
|
||||
main->EnableOutputs(true);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SaveCombo(QComboBox *widget, const char *section,
|
||||
const char *value)
|
||||
{
|
||||
|
|
@ -931,6 +965,9 @@ void OBSBasicSettings::LoadGeneralSettings()
|
|||
"General", "EnableAutoUpdates");
|
||||
ui->enableAutoUpdates->setChecked(enableAutoUpdates);
|
||||
#endif
|
||||
bool openStatsOnStartup = config_get_bool(main->Config(),
|
||||
"General", "OpenStatsOnStartup");
|
||||
ui->openStatsOnStartup->setChecked(openStatsOnStartup);
|
||||
|
||||
bool recordWhenStreaming = config_get_bool(GetGlobalConfig(),
|
||||
"BasicWindow", "RecordWhenStreaming");
|
||||
|
|
@ -1041,18 +1078,20 @@ void OBSBasicSettings::LoadRendererList()
|
|||
"Renderer");
|
||||
|
||||
ui->renderer->addItem(QT_UTF8("Direct3D 11"));
|
||||
ui->renderer->addItem(QT_UTF8("OpenGL"));
|
||||
if (opt_allow_opengl || strcmp(renderer, "OpenGL") == 0)
|
||||
ui->renderer->addItem(QT_UTF8("OpenGL"));
|
||||
|
||||
int idx = ui->renderer->findText(QT_UTF8(renderer));
|
||||
if (idx == -1)
|
||||
idx = 0;
|
||||
|
||||
if (strcmp(renderer, "OpenGL") == 0) {
|
||||
delete ui->adapter;
|
||||
delete ui->adapterLabel;
|
||||
ui->adapter = nullptr;
|
||||
ui->adapterLabel = nullptr;
|
||||
}
|
||||
// the video adapter selection is not currently implemented, hide for now
|
||||
// to avoid user confusion. was previously protected by
|
||||
// if (strcmp(renderer, "OpenGL") == 0)
|
||||
delete ui->adapter;
|
||||
delete ui->adapterLabel;
|
||||
ui->adapter = nullptr;
|
||||
ui->adapterLabel = nullptr;
|
||||
|
||||
ui->renderer->setCurrentIndex(idx);
|
||||
#endif
|
||||
|
|
@ -1206,12 +1245,21 @@ void OBSBasicSettings::LoadResolutionLists()
|
|||
|
||||
ui->baseResolution->clear();
|
||||
|
||||
auto addRes = [this] (int cx, int cy)
|
||||
{
|
||||
QString res = ResString(cx, cy).c_str();
|
||||
if (ui->baseResolution->findText(res) == -1)
|
||||
ui->baseResolution->addItem(res);
|
||||
};
|
||||
|
||||
for (QScreen* screen: QGuiApplication::screens()) {
|
||||
QSize as = screen->size();
|
||||
string res = ResString(as.width(), as.height());
|
||||
ui->baseResolution->addItem(res.c_str());
|
||||
addRes(as.width(), as.height());
|
||||
}
|
||||
|
||||
addRes(1920, 1080);
|
||||
addRes(1280, 720);
|
||||
|
||||
string outputResString = ResString(out_cx, out_cy);
|
||||
|
||||
ui->baseResolution->lineEdit()->setText(ResString(cx, cy).c_str());
|
||||
|
|
@ -2012,22 +2060,8 @@ void OBSBasicSettings::LoadAdvancedSettings()
|
|||
LoadRendererList();
|
||||
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
QComboBox *cb = ui->monitoringDevice;
|
||||
idx = cb->findData(monDevId);
|
||||
if (idx == -1) {
|
||||
cb->insertItem(0, monDevName, monDevId);
|
||||
|
||||
QStandardItemModel *model =
|
||||
dynamic_cast<QStandardItemModel*>(cb->model());
|
||||
if (!model)
|
||||
return;
|
||||
|
||||
QStandardItem *item = model->item(0);
|
||||
item->setFlags(Qt::NoItemFlags);
|
||||
|
||||
idx = 0;
|
||||
}
|
||||
cb->setCurrentIndex(idx);
|
||||
if (!SetComboByValue(ui->monitoringDevice, monDevId))
|
||||
SetInvalidValue(ui->monitoringDevice, monDevName, monDevId);
|
||||
#endif
|
||||
|
||||
ui->filenameFormatting->setText(filename);
|
||||
|
|
@ -2048,7 +2082,8 @@ void OBSBasicSettings::LoadAdvancedSettings()
|
|||
SetComboByName(ui->colorSpace, videoColorSpace);
|
||||
SetComboByValue(ui->colorRange, videoColorRange);
|
||||
|
||||
SetComboByValue(ui->bindToIP, bindIP);
|
||||
if (!SetComboByValue(ui->bindToIP, bindIP))
|
||||
SetInvalidValue(ui->bindToIP, bindIP, bindIP);
|
||||
|
||||
if (video_output_active(obs_get_video())) {
|
||||
ui->advancedVideoContainer->setEnabled(false);
|
||||
|
|
@ -2063,6 +2098,10 @@ void OBSBasicSettings::LoadAdvancedSettings()
|
|||
ui->resetOSXVSync->setChecked(resetOSXVSync);
|
||||
ui->resetOSXVSync->setEnabled(disableOSXVSync);
|
||||
#elif _WIN32
|
||||
bool disableAudioDucking = config_get_bool(App()->GlobalConfig(),
|
||||
"Audio", "DisableAudioDucking");
|
||||
ui->disableAudioDucking->setChecked(disableAudioDucking);
|
||||
|
||||
const char *processPriority = config_get_string(App()->GlobalConfig(),
|
||||
"General", "ProcessPriority");
|
||||
bool enableNewSocketLoop = config_get_bool(main->Config(), "Output",
|
||||
|
|
@ -2410,6 +2449,10 @@ void OBSBasicSettings::SaveGeneralSettings()
|
|||
"EnableAutoUpdates",
|
||||
ui->enableAutoUpdates->isChecked());
|
||||
#endif
|
||||
if (WidgetChanged(ui->openStatsOnStartup))
|
||||
config_set_bool(main->Config(), "General",
|
||||
"OpenStatsOnStartup",
|
||||
ui->openStatsOnStartup->isChecked());
|
||||
if (WidgetChanged(ui->snappingEnabled))
|
||||
config_set_bool(GetGlobalConfig(), "BasicWindow",
|
||||
"SnappingEnabled",
|
||||
|
|
@ -2583,6 +2626,16 @@ void OBSBasicSettings::SaveAdvancedSettings()
|
|||
SaveCombo(ui->monitoringDevice, "Audio", "MonitoringDeviceName");
|
||||
SaveComboData(ui->monitoringDevice, "Audio", "MonitoringDeviceId");
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
if (WidgetChanged(ui->disableAudioDucking)) {
|
||||
bool disable = ui->disableAudioDucking->isChecked();
|
||||
config_set_bool(App()->GlobalConfig(),
|
||||
"Audio", "DisableAudioDucking", disable);
|
||||
DisableAudioDucking(disable);
|
||||
}
|
||||
#endif
|
||||
|
||||
SaveEdit(ui->filenameFormatting, "Output", "FilenameFormatting");
|
||||
SaveEdit(ui->simpleRBPrefix, "SimpleOutput", "RecRBPrefix");
|
||||
SaveEdit(ui->simpleRBSuffix, "SimpleOutput", "RecRBSuffix");
|
||||
|
|
@ -2968,7 +3021,7 @@ bool OBSBasicSettings::QueryChanges()
|
|||
{
|
||||
QMessageBox::StandardButton button;
|
||||
|
||||
button = QMessageBox::question(this,
|
||||
button = OBSMessageBox::question(this,
|
||||
QTStr("Basic.Settings.ConfirmTitle"),
|
||||
QTStr("Basic.Settings.Confirm"),
|
||||
QMessageBox::Yes | QMessageBox::No |
|
||||
|
|
@ -3833,10 +3886,9 @@ void OBSBasicSettings::SimpleRecordingQualityLosslessWarning(int idx)
|
|||
QString("\n\n") +
|
||||
SIMPLE_OUTPUT_WARNING("Lossless.Msg");
|
||||
|
||||
button = QMessageBox::question(this,
|
||||
button = OBSMessageBox::question(this,
|
||||
SIMPLE_OUTPUT_WARNING("Lossless.Title"),
|
||||
warningString,
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
warningString);
|
||||
|
||||
if (button == QMessageBox::No) {
|
||||
QMetaObject::invokeMethod(ui->simpleOutRecQuality,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue