New upstream version 25.0.3+dfsg1
This commit is contained in:
parent
04fe0efc67
commit
8b2e5f2130
569 changed files with 62491 additions and 5875 deletions
|
|
@ -50,6 +50,9 @@
|
|||
#include <util/platform.h>
|
||||
#include "ui-config.h"
|
||||
|
||||
#define ENCODER_HIDE_FLAGS \
|
||||
(OBS_ENCODER_CAP_DEPRECATED | OBS_ENCODER_CAP_INTERNAL)
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Used for QVariant in codec comboboxes
|
||||
|
|
@ -95,6 +98,11 @@ struct CodecDesc {
|
|||
Q_DECLARE_METATYPE(FormatDesc)
|
||||
Q_DECLARE_METATYPE(CodecDesc)
|
||||
|
||||
static inline bool ResTooHigh(uint32_t cx, uint32_t cy)
|
||||
{
|
||||
return cx > 16384 || cy > 16384;
|
||||
}
|
||||
|
||||
/* parses "[width]x[height]", string, i.e. 1024x768 */
|
||||
static bool ConvertResText(const char *res, uint32_t &cx, uint32_t &cy)
|
||||
{
|
||||
|
|
@ -129,6 +137,11 @@ static bool ConvertResText(const char *res, uint32_t &cx, uint32_t &cy)
|
|||
if (lexer_getbasetoken(lex, &token, IGNORE_WHITESPACE))
|
||||
return false;
|
||||
|
||||
if (ResTooHigh(cx, cy)) {
|
||||
cx = cy = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -247,6 +260,25 @@ static void PopulateAACBitrates(initializer_list<QComboBox *> boxes)
|
|||
}
|
||||
}
|
||||
|
||||
static int gcd(int a, int b)
|
||||
{
|
||||
return b == 0 ? a : gcd(b, a % b);
|
||||
}
|
||||
|
||||
static std::tuple<int, int> aspect_ratio(int cx, int cy)
|
||||
{
|
||||
int common = gcd(cx, cy);
|
||||
int newCX = cx / common;
|
||||
int newCY = cy / common;
|
||||
|
||||
if (newCX == 8 && newCY == 5) {
|
||||
newCX = 16;
|
||||
newCY = 10;
|
||||
}
|
||||
|
||||
return std::make_tuple(newCX, newCY);
|
||||
}
|
||||
|
||||
void RestrictResetBitrates(initializer_list<QComboBox *> boxes, int maxbitrate);
|
||||
|
||||
void OBSBasicSettings::HookWidget(QWidget *widget, const char *signal,
|
||||
|
|
@ -286,10 +318,10 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
|
||||
EnableThreadedMessageBoxes(true);
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
main->EnableOutputs(false);
|
||||
|
||||
PopulateAACBitrates({ui->simpleOutputABitrate, ui->advOutTrack1Bitrate,
|
||||
|
|
@ -325,6 +357,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
HookWidget(ui->overflowHide, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->overflowAlwaysVisible,CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->overflowSelectionHide,CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->automaticSearch, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->doubleClickSwitch, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->studioPortraitLayout, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->prevProgLabelToggle, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
|
|
@ -337,6 +370,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
HookWidget(ui->customServer, EDIT_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->key, EDIT_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->bandwidthTestEnable, CHECK_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->twitchAddonDropdown, COMBO_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->mixerAddonDropdown, COMBO_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->useAuth, CHECK_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->authUsername, EDIT_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->authPw, EDIT_CHANGED, STREAM1_CHANGED);
|
||||
|
|
@ -381,6 +416,12 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
HookWidget(ui->advOutRecTrack4, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutRecTrack5, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutRecTrack6, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->flvTrack1, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->flvTrack2, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->flvTrack3, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->flvTrack4, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->flvTrack5, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->flvTrack6, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFType, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFRecPath, EDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFNoSpace, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
|
|
@ -754,6 +795,14 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
UpdateAutomaticReplayBufferCheckboxes();
|
||||
|
||||
App()->DisableHotkeys();
|
||||
|
||||
channelIndex = ui->channelSetup->currentIndex();
|
||||
sampleRateIndex = ui->sampleRate->currentIndex();
|
||||
|
||||
QRegExp rx("\\d{1,5}x\\d{1,5}");
|
||||
QValidator *validator = new QRegExpValidator(rx, this);
|
||||
ui->baseResolution->lineEdit()->setValidator(validator);
|
||||
ui->outputResolution->lineEdit()->setValidator(validator);
|
||||
}
|
||||
|
||||
OBSBasicSettings::~OBSBasicSettings()
|
||||
|
|
@ -841,7 +890,7 @@ void OBSBasicSettings::LoadEncoderTypes()
|
|||
break;
|
||||
}
|
||||
}
|
||||
if ((caps & OBS_ENCODER_CAP_DEPRECATED) != 0)
|
||||
if ((caps & ENCODER_HIDE_FLAGS) != 0)
|
||||
continue;
|
||||
|
||||
QString qName = QT_UTF8(name);
|
||||
|
|
@ -886,7 +935,7 @@ void OBSBasicSettings::LoadFormats()
|
|||
audio ? AUDIO_STR : VIDEO_STR);
|
||||
|
||||
ui->advOutFFFormat->addItem(
|
||||
itemText, qVariantFromValue(formatDesc));
|
||||
itemText, QVariant::fromValue(formatDesc));
|
||||
}
|
||||
|
||||
format = ff_format_desc_next(format);
|
||||
|
|
@ -909,7 +958,7 @@ static void AddCodec(QComboBox *combo, const ff_codec_desc *codec_desc)
|
|||
CodecDesc cd(ff_codec_desc_name(codec_desc),
|
||||
ff_codec_desc_id(codec_desc));
|
||||
|
||||
combo->addItem(itemText, qVariantFromValue(cd));
|
||||
combo->addItem(itemText, QVariant::fromValue(cd));
|
||||
}
|
||||
|
||||
#define AV_ENCODER_DEFAULT_STR \
|
||||
|
|
@ -925,7 +974,7 @@ static void AddDefaultCodec(QComboBox *combo, const ff_format_desc *formatDesc,
|
|||
combo->removeItem(existingIdx);
|
||||
|
||||
combo->addItem(QString("%1 (%2)").arg(cd.name, AV_ENCODER_DEFAULT_STR),
|
||||
qVariantFromValue(cd));
|
||||
QVariant::fromValue(cd));
|
||||
}
|
||||
|
||||
#define AV_ENCODER_DISABLE_STR \
|
||||
|
|
@ -972,7 +1021,7 @@ void OBSBasicSettings::ReloadCodecs(const ff_format_desc *formatDesc)
|
|||
ui->advOutFFAEncoder->model()->sort(0);
|
||||
ui->advOutFFVEncoder->model()->sort(0);
|
||||
|
||||
QVariant disable = qVariantFromValue(CodecDesc());
|
||||
QVariant disable = QVariant::fromValue(CodecDesc());
|
||||
|
||||
ui->advOutFFAEncoder->insertItem(0, AV_ENCODER_DISABLE_STR, disable);
|
||||
ui->advOutFFVEncoder->insertItem(0, AV_ENCODER_DISABLE_STR, disable);
|
||||
|
|
@ -1156,6 +1205,10 @@ void OBSBasicSettings::LoadGeneralSettings()
|
|||
GetGlobalConfig(), "BasicWindow", "OverflowSelectionHidden");
|
||||
ui->overflowSelectionHide->setChecked(overflowSelectionHide);
|
||||
|
||||
bool automaticSearch = config_get_bool(GetGlobalConfig(), "General",
|
||||
"AutomaticCollectionSearch");
|
||||
ui->automaticSearch->setChecked(automaticSearch);
|
||||
|
||||
bool doubleClickSwitch = config_get_bool(
|
||||
GetGlobalConfig(), "BasicWindow", "TransitionOnDoubleClick");
|
||||
ui->doubleClickSwitch->setChecked(doubleClickSwitch);
|
||||
|
|
@ -1199,6 +1252,11 @@ void OBSBasicSettings::LoadGeneralSettings()
|
|||
ui->multiviewLayout->setCurrentIndex(config_get_int(
|
||||
GetGlobalConfig(), "BasicWindow", "MultiviewLayout"));
|
||||
|
||||
prevLangIndex = ui->language->currentIndex();
|
||||
|
||||
if (obs_video_active())
|
||||
ui->language->setEnabled(false);
|
||||
|
||||
loading = false;
|
||||
}
|
||||
|
||||
|
|
@ -1308,10 +1366,13 @@ void OBSBasicSettings::ResetDownscales(uint32_t cx, uint32_t cy)
|
|||
float outputAspect = float(out_cx) / float(out_cy);
|
||||
|
||||
bool closeAspect = close_float(baseAspect, outputAspect, 0.01f);
|
||||
if (closeAspect)
|
||||
if (closeAspect) {
|
||||
ui->outputResolution->lineEdit()->setText(oldOutputRes);
|
||||
else
|
||||
on_outputResolution_editTextChanged(oldOutputRes);
|
||||
} else {
|
||||
ui->outputResolution->lineEdit()->setText(bestScale.c_str());
|
||||
on_outputResolution_editTextChanged(bestScale.c_str());
|
||||
}
|
||||
|
||||
ui->outputResolution->blockSignals(false);
|
||||
|
||||
|
|
@ -1391,6 +1452,13 @@ void OBSBasicSettings::LoadResolutionLists()
|
|||
ResetDownscales(cx, cy);
|
||||
|
||||
ui->outputResolution->lineEdit()->setText(outputResString.c_str());
|
||||
|
||||
std::tuple<int, int> aspect = aspect_ratio(cx, cy);
|
||||
|
||||
ui->baseAspect->setText(
|
||||
QTStr("AspectRatio")
|
||||
.arg(QString::number(std::get<0>(aspect)),
|
||||
QString::number(std::get<1>(aspect))));
|
||||
}
|
||||
|
||||
static inline void LoadFPSCommon(OBSBasic *main, Ui::OBSBasicSettings *ui)
|
||||
|
|
@ -1664,7 +1732,7 @@ void OBSBasicSettings::LoadAdvOutputStreamingEncoderProperties()
|
|||
|
||||
if (!SetComboByValue(ui->advOutEncoder, type)) {
|
||||
uint32_t caps = obs_get_encoder_caps(type);
|
||||
if ((caps & OBS_ENCODER_CAP_DEPRECATED) != 0) {
|
||||
if ((caps & ENCODER_HIDE_FLAGS) != 0) {
|
||||
const char *name = obs_encoder_get_display_name(type);
|
||||
|
||||
ui->advOutEncoder->insertItem(0, QT_UTF8(name),
|
||||
|
|
@ -1692,6 +1760,7 @@ void OBSBasicSettings::LoadAdvOutputRecordingSettings()
|
|||
const char *muxCustom =
|
||||
config_get_string(main->Config(), "AdvOut", "RecMuxerCustom");
|
||||
int tracks = config_get_int(main->Config(), "AdvOut", "RecTracks");
|
||||
int flvTrack = config_get_int(main->Config(), "AdvOut", "FLVTrack");
|
||||
|
||||
int typeIndex = (astrcmpi(type, "FFmpeg") == 0) ? 1 : 0;
|
||||
ui->advOutRecType->setCurrentIndex(typeIndex);
|
||||
|
|
@ -1710,6 +1779,30 @@ void OBSBasicSettings::LoadAdvOutputRecordingSettings()
|
|||
ui->advOutRecTrack4->setChecked(tracks & (1 << 3));
|
||||
ui->advOutRecTrack5->setChecked(tracks & (1 << 4));
|
||||
ui->advOutRecTrack6->setChecked(tracks & (1 << 5));
|
||||
|
||||
switch (flvTrack) {
|
||||
case 1:
|
||||
ui->flvTrack1->setChecked(true);
|
||||
break;
|
||||
case 2:
|
||||
ui->flvTrack2->setChecked(true);
|
||||
break;
|
||||
case 3:
|
||||
ui->flvTrack3->setChecked(true);
|
||||
break;
|
||||
case 4:
|
||||
ui->flvTrack4->setChecked(true);
|
||||
break;
|
||||
case 5:
|
||||
ui->flvTrack5->setChecked(true);
|
||||
break;
|
||||
case 6:
|
||||
ui->flvTrack6->setChecked(true);
|
||||
break;
|
||||
default:
|
||||
ui->flvTrack1->setChecked(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasicSettings::LoadAdvOutputRecordingEncoderProperties()
|
||||
|
|
@ -1732,7 +1825,7 @@ void OBSBasicSettings::LoadAdvOutputRecordingEncoderProperties()
|
|||
|
||||
if (!SetComboByValue(ui->advOutRecEncoder, type)) {
|
||||
uint32_t caps = obs_get_encoder_caps(type);
|
||||
if ((caps & OBS_ENCODER_CAP_DEPRECATED) != 0) {
|
||||
if ((caps & ENCODER_HIDE_FLAGS) != 0) {
|
||||
const char *name = obs_encoder_get_display_name(type);
|
||||
|
||||
ui->advOutRecEncoder->insertItem(1, QT_UTF8(name),
|
||||
|
|
@ -2037,6 +2130,11 @@ void OBSBasicSettings::LoadAudioDevices()
|
|||
LoadListValues(ui->desktopAudioDevice2, outputs, 2);
|
||||
obs_properties_destroy(output_props);
|
||||
}
|
||||
|
||||
if (obs_video_active()) {
|
||||
ui->sampleRate->setEnabled(false);
|
||||
ui->channelSetup->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
#define NBSP "\xC2\xA0"
|
||||
|
|
@ -2045,7 +2143,7 @@ void OBSBasicSettings::LoadAudioSources()
|
|||
{
|
||||
if (ui->audioSourceLayout->rowCount() > 0) {
|
||||
QLayoutItem *forDeletion = ui->audioSourceLayout->takeAt(0);
|
||||
delete forDeletion->widget();
|
||||
forDeletion->widget()->deleteLater();
|
||||
delete forDeletion;
|
||||
}
|
||||
auto layout = new QFormLayout();
|
||||
|
|
@ -2150,10 +2248,12 @@ void OBSBasicSettings::LoadAudioSources()
|
|||
label->setMinimumSize(QSize(170, 0));
|
||||
label->setAlignment(Qt::AlignRight | Qt::AlignTrailing |
|
||||
Qt::AlignVCenter);
|
||||
connect(label, &OBSSourceLabel::Removed,
|
||||
[=]() { LoadAudioSources(); });
|
||||
connect(label, &OBSSourceLabel::Destroyed,
|
||||
[=]() { LoadAudioSources(); });
|
||||
connect(label, &OBSSourceLabel::Removed, [=]() {
|
||||
QMetaObject::invokeMethod(this, "ReloadAudioSources");
|
||||
});
|
||||
connect(label, &OBSSourceLabel::Destroyed, [=]() {
|
||||
QMetaObject::invokeMethod(this, "ReloadAudioSources");
|
||||
});
|
||||
|
||||
layout->addRow(label, form);
|
||||
return true;
|
||||
|
|
@ -2163,7 +2263,8 @@ void OBSBasicSettings::LoadAudioSources()
|
|||
obs_enum_sources(
|
||||
[](void *data, obs_source_t *source) {
|
||||
auto &AddSource = *static_cast<AddSource_t *>(data);
|
||||
AddSource(source);
|
||||
if (!obs_source_removed(source))
|
||||
AddSource(source);
|
||||
return true;
|
||||
},
|
||||
static_cast<void *>(&AddSource));
|
||||
|
|
@ -2334,10 +2435,13 @@ void OBSBasicSettings::LoadAdvancedSettings()
|
|||
|
||||
ui->enableNewSocketLoop->setChecked(enableNewSocketLoop);
|
||||
ui->enableLowLatencyMode->setChecked(enableLowLatencyMode);
|
||||
ui->enableLowLatencyMode->setToolTip(
|
||||
QTStr("Basic.Settings.Advanced.Network.TCPPacing.Tooltip"));
|
||||
|
||||
bool browserHWAccel = config_get_bool(App()->GlobalConfig(), "General",
|
||||
"BrowserHWAccel");
|
||||
ui->browserHWAccel->setChecked(browserHWAccel);
|
||||
prevBrowserAccel = ui->browserHWAccel->isChecked();
|
||||
#endif
|
||||
|
||||
SetComboByValue(ui->hotkeyFocusType, hotkeyFocusType);
|
||||
|
|
@ -2776,6 +2880,10 @@ void OBSBasicSettings::SaveGeneralSettings()
|
|||
config_set_bool(GetGlobalConfig(), "BasicWindow",
|
||||
"TransitionOnDoubleClick",
|
||||
ui->doubleClickSwitch->isChecked());
|
||||
if (WidgetChanged(ui->automaticSearch))
|
||||
config_set_bool(GetGlobalConfig(), "General",
|
||||
"AutomaticCollectionSearch",
|
||||
ui->automaticSearch->isChecked());
|
||||
|
||||
config_set_bool(GetGlobalConfig(), "BasicWindow",
|
||||
"WarnBeforeStartingStream",
|
||||
|
|
@ -3171,6 +3279,8 @@ void OBSBasicSettings::SaveOutputSettings()
|
|||
(ui->advOutRecTrack5->isChecked() ? (1 << 4) : 0) |
|
||||
(ui->advOutRecTrack6->isChecked() ? (1 << 5) : 0));
|
||||
|
||||
config_set_int(main->Config(), "AdvOut", "FLVTrack", CurrentFLVTrack());
|
||||
|
||||
config_set_bool(main->Config(), "AdvOut", "FFOutputToFile",
|
||||
ui->advOutFFType->currentIndex() == 0 ? true : false);
|
||||
SaveEdit(ui->advOutFFRecPath, "AdvOut", "FFFilePath");
|
||||
|
|
@ -3422,6 +3532,18 @@ void OBSBasicSettings::SaveSettings()
|
|||
blog(LOG_INFO, "Settings changed (%s)", changed.c_str());
|
||||
blog(LOG_INFO, MINOR_SEPARATOR);
|
||||
}
|
||||
|
||||
bool langChanged = (ui->language->currentIndex() != prevLangIndex);
|
||||
bool audioRestart = (ui->channelSetup->currentIndex() != channelIndex ||
|
||||
ui->sampleRate->currentIndex() != sampleRateIndex);
|
||||
bool browserHWAccelChanged =
|
||||
(ui->browserHWAccel &&
|
||||
ui->browserHWAccel->isChecked() != prevBrowserAccel);
|
||||
|
||||
if (langChanged || audioRestart || browserHWAccelChanged)
|
||||
restart = true;
|
||||
else
|
||||
restart = false;
|
||||
}
|
||||
|
||||
bool OBSBasicSettings::QueryChanges()
|
||||
|
|
@ -3443,6 +3565,7 @@ bool OBSBasicSettings::QueryChanges()
|
|||
if (toggleAero)
|
||||
SetAeroEnabled(!aeroWasDisabled);
|
||||
#endif
|
||||
restart = false;
|
||||
}
|
||||
|
||||
ClearChanged();
|
||||
|
|
@ -3453,6 +3576,12 @@ void OBSBasicSettings::closeEvent(QCloseEvent *event)
|
|||
{
|
||||
if (Changed() && !QueryChanges())
|
||||
event->ignore();
|
||||
|
||||
if (forceAuthReload) {
|
||||
main->auth->Save();
|
||||
main->auth->Load();
|
||||
forceAuthReload = false;
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasicSettings::on_theme_activated(int idx)
|
||||
|
|
@ -3493,7 +3622,8 @@ void OBSBasicSettings::on_buttonBox_clicked(QAbstractButton *button)
|
|||
if (val == QDialogButtonBox::AcceptRole ||
|
||||
val == QDialogButtonBox::RejectRole) {
|
||||
if (val == QDialogButtonBox::RejectRole) {
|
||||
App()->SetTheme(savedTheme);
|
||||
if (savedTheme != App()->GetTheme())
|
||||
App()->SetTheme(savedTheme);
|
||||
#ifdef _WIN32
|
||||
if (toggleAero)
|
||||
SetAeroEnabled(!aeroWasDisabled);
|
||||
|
|
@ -3553,16 +3683,8 @@ void OBSBasicSettings::on_advOutEncoder_currentIndexChanged(int idx)
|
|||
ui->advOutputStreamTab->layout()->addWidget(streamEncoderProps);
|
||||
}
|
||||
|
||||
uint32_t caps = obs_get_encoder_caps(QT_TO_UTF8(encoder));
|
||||
|
||||
if (caps & OBS_ENCODER_CAP_PASS_TEXTURE) {
|
||||
ui->advOutUseRescale->setChecked(false);
|
||||
ui->advOutUseRescale->setVisible(false);
|
||||
ui->advOutRescale->setVisible(false);
|
||||
} else {
|
||||
ui->advOutUseRescale->setVisible(true);
|
||||
ui->advOutRescale->setVisible(true);
|
||||
}
|
||||
ui->advOutUseRescale->setVisible(true);
|
||||
ui->advOutRescale->setVisible(true);
|
||||
|
||||
UNUSED_PARAMETER(idx);
|
||||
}
|
||||
|
|
@ -3593,16 +3715,8 @@ void OBSBasicSettings::on_advOutRecEncoder_currentIndexChanged(int idx)
|
|||
SLOT(AdvReplayBufferChanged()));
|
||||
}
|
||||
|
||||
uint32_t caps = obs_get_encoder_caps(QT_TO_UTF8(encoder));
|
||||
|
||||
if (caps & OBS_ENCODER_CAP_PASS_TEXTURE) {
|
||||
ui->advOutRecUseRescale->setChecked(false);
|
||||
ui->advOutRecUseRescale->setVisible(false);
|
||||
ui->advOutRecRescaleContainer->setVisible(false);
|
||||
} else {
|
||||
ui->advOutRecUseRescale->setVisible(true);
|
||||
ui->advOutRecRescaleContainer->setVisible(true);
|
||||
}
|
||||
ui->advOutRecUseRescale->setVisible(true);
|
||||
ui->advOutRecRescaleContainer->setVisible(true);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::on_advOutFFIgnoreCompat_stateChanged(int)
|
||||
|
|
@ -3711,6 +3825,13 @@ void OBSBasicSettings::RecalcOutputResPixels(const char *resText)
|
|||
if (newCX && newCY) {
|
||||
outputCX = newCX;
|
||||
outputCY = newCY;
|
||||
|
||||
std::tuple<int, int> aspect = aspect_ratio(outputCX, outputCY);
|
||||
|
||||
ui->scaledAspect->setText(
|
||||
QTStr("AspectRatio")
|
||||
.arg(QString::number(std::get<0>(aspect)),
|
||||
QString::number(std::get<1>(aspect))));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3742,6 +3863,14 @@ void OBSBasicSettings::on_baseResolution_editTextChanged(const QString &text)
|
|||
uint32_t cx, cy;
|
||||
|
||||
ConvertResText(QT_TO_UTF8(baseResolution), cx, cy);
|
||||
|
||||
std::tuple<int, int> aspect = aspect_ratio(cx, cy);
|
||||
|
||||
ui->baseAspect->setText(
|
||||
QTStr("AspectRatio")
|
||||
.arg(QString::number(std::get<0>(aspect)),
|
||||
QString::number(std::get<1>(aspect))));
|
||||
|
||||
ResetDownscales(cx, cy);
|
||||
}
|
||||
}
|
||||
|
|
@ -3785,10 +3914,22 @@ void OBSBasicSettings::AudioChanged()
|
|||
void OBSBasicSettings::AudioChangedRestart()
|
||||
{
|
||||
if (!loading) {
|
||||
audioChanged = true;
|
||||
ui->audioMsg->setText(QTStr("Basic.Settings.ProgramRestart"));
|
||||
sender()->setProperty("changed", QVariant(true));
|
||||
EnableApplyButton(true);
|
||||
int currentChannelIndex = ui->channelSetup->currentIndex();
|
||||
int currentSampleRateIndex = ui->sampleRate->currentIndex();
|
||||
|
||||
if (currentChannelIndex != channelIndex ||
|
||||
currentSampleRateIndex != sampleRateIndex) {
|
||||
audioChanged = true;
|
||||
ui->audioMsg->setText(
|
||||
QTStr("Basic.Settings.ProgramRestart"));
|
||||
sender()->setProperty("changed", QVariant(true));
|
||||
EnableApplyButton(true);
|
||||
} else {
|
||||
audioChanged = false;
|
||||
ui->audioMsg->setText("");
|
||||
sender()->setProperty("changed", QVariant(false));
|
||||
EnableApplyButton(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3953,13 +4094,6 @@ void OBSBasicSettings::AdvOutRecCheckWarnings()
|
|||
Checked(ui->advOutRecTrack3) + Checked(ui->advOutRecTrack4) +
|
||||
Checked(ui->advOutRecTrack5) + Checked(ui->advOutRecTrack6);
|
||||
|
||||
if (tracks == 0) {
|
||||
errorMsg = QTStr("OutputWarnings.NoTracksSelected");
|
||||
|
||||
} else if (tracks > 1) {
|
||||
warningMsg = QTStr("OutputWarnings.MultiTrackRecording");
|
||||
}
|
||||
|
||||
bool useStreamEncoder = ui->advOutRecEncoder->currentIndex() == 0;
|
||||
if (useStreamEncoder) {
|
||||
if (!warningMsg.isEmpty())
|
||||
|
|
@ -3967,6 +4101,15 @@ void OBSBasicSettings::AdvOutRecCheckWarnings()
|
|||
warningMsg += QTStr("OutputWarnings.CannotPause");
|
||||
}
|
||||
|
||||
if (ui->advOutRecFormat->currentText().compare("flv") == 0) {
|
||||
ui->advRecTrackWidget->setCurrentWidget(ui->flvTracks);
|
||||
} else {
|
||||
ui->advRecTrackWidget->setCurrentWidget(ui->recTracks);
|
||||
|
||||
if (tracks == 0)
|
||||
errorMsg = QTStr("OutputWarnings.NoTracksSelected");
|
||||
}
|
||||
|
||||
if (ui->advOutRecFormat->currentText().compare("mp4") == 0 ||
|
||||
ui->advOutRecFormat->currentText().compare("mov") == 0) {
|
||||
if (!warningMsg.isEmpty())
|
||||
|
|
@ -4609,3 +4752,21 @@ void OBSBasicSettings::SetAdvancedIcon(const QIcon &icon)
|
|||
{
|
||||
ui->listWidget->item(6)->setIcon(icon);
|
||||
}
|
||||
|
||||
int OBSBasicSettings::CurrentFLVTrack()
|
||||
{
|
||||
if (ui->flvTrack1->isChecked())
|
||||
return 1;
|
||||
else if (ui->flvTrack2->isChecked())
|
||||
return 2;
|
||||
else if (ui->flvTrack3->isChecked())
|
||||
return 3;
|
||||
else if (ui->flvTrack4->isChecked())
|
||||
return 4;
|
||||
else if (ui->flvTrack5->isChecked())
|
||||
return 5;
|
||||
else if (ui->flvTrack6->isChecked())
|
||||
return 6;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue