提交 f7be55e4 编写于 作者: D derrod

UI: Add warning about recording to mp4 format

上级 a18ac427
......@@ -649,3 +649,4 @@ SceneItemHide="Hide '%1'"
# Output warnings
OutputWarnings.NoTracksSelected="You must select at least one track"
OutputWarnings.MultiTrackRecording="Warning: Certain formats (such as FLV) do not support multiple tracks per recording"
OutputWarnings.MP4Recording="Warning: Recordings saved to MP4 will be unrecoverable if the file cannot be finalized (e.g. as a result of BSODs, power losses, etc.). If you want to record multiple audio tracks consider using MKV and remux the recording to mp4 after it is finished (File->Remux Recordings)"
......@@ -536,6 +536,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
this, SLOT(SimpleRecordingQualityChanged()));
connect(ui->simpleOutRecQuality, SIGNAL(currentIndexChanged(int)),
this, SLOT(SimpleRecordingQualityLosslessWarning(int)));
connect(ui->simpleOutRecFormat, SIGNAL(currentIndexChanged(int)),
this, SLOT(SimpleRecordingEncoderChanged()));
connect(ui->simpleOutStrEncoder, SIGNAL(currentIndexChanged(int)),
this, SLOT(SimpleStreamingEncoderChanged()));
connect(ui->simpleOutStrEncoder, SIGNAL(currentIndexChanged(int)),
......@@ -590,6 +592,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
this, SLOT(AdvOutRecCheckWarnings()));
connect(ui->advOutRecTrack6, SIGNAL(clicked()),
this, SLOT(AdvOutRecCheckWarnings()));
connect(ui->advOutRecFormat, SIGNAL(currentIndexChanged(int)),
this, SLOT(AdvOutRecCheckWarnings()));
AdvOutRecCheckWarnings();
SimpleRecordingQualityChanged();
......@@ -3274,7 +3278,8 @@ void OBSBasicSettings::AdvOutRecCheckWarnings()
return box->isChecked() ? 1 : 0;
};
QString msg;
QString errorMsg;
QString warningMsg;
uint32_t tracks =
Checked(ui->advOutRecTrack1) +
Checked(ui->advOutRecTrack2) +
......@@ -3282,22 +3287,30 @@ void OBSBasicSettings::AdvOutRecCheckWarnings()
Checked(ui->advOutRecTrack4) +
Checked(ui->advOutRecTrack5) +
Checked(ui->advOutRecTrack6);
const char *objectName = nullptr;
if (tracks == 0) {
msg = QTStr("OutputWarnings.NoTracksSelected");
objectName = "errorLabel";
errorMsg = QTStr("OutputWarnings.NoTracksSelected");
} else if (tracks > 1) {
msg = QTStr("OutputWarnings.MultiTrackRecording");
objectName = "warningLabel";
warningMsg = QTStr("OutputWarnings.MultiTrackRecording");
}
if (ui->advOutRecFormat->currentText().compare("mp4") == 0) {
if (!warningMsg.isEmpty())
warningMsg += "\n\n";
warningMsg += QTStr("OutputWarnings.MP4Recording");
}
delete advOutRecWarning;
if (!msg.isEmpty()) {
advOutRecWarning = new QLabel(msg, this);
advOutRecWarning->setObjectName(objectName);
if (!errorMsg.isEmpty() || !warningMsg.isEmpty()) {
advOutRecWarning = new QLabel(
errorMsg.isEmpty() ? warningMsg : errorMsg,
this);
advOutRecWarning->setObjectName(
errorMsg.isEmpty() ? "warningLabel" :
"errorLabel");
advOutRecWarning->setWordWrap(true);
QFormLayout *formLayout = reinterpret_cast<QFormLayout*>(
ui->advOutRecTopContainer->layout());
......@@ -3638,6 +3651,12 @@ void OBSBasicSettings::SimpleRecordingEncoderChanged()
}
}
if (ui->simpleOutRecFormat->currentText().compare("mp4") == 0) {
if (!warning.isEmpty())
warning += "\n\n";
warning += QTStr("OutputWarnings.MP4Recording");
}
if (warning.isEmpty())
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册