Merge pull request #787 from derrod/mp4-warning

UI: Add warning for recording to mp4 format
master
Jim 2017-02-25 09:30:52 -08:00 committed by GitHub
commit 5c1984366e
2 changed files with 29 additions and 9 deletions

View File

@ -687,3 +687,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)"

View File

@ -560,6 +560,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)),
@ -614,6 +616,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();
@ -3387,7 +3391,8 @@ void OBSBasicSettings::AdvOutRecCheckWarnings()
return box->isChecked() ? 1 : 0;
};
QString msg;
QString errorMsg;
QString warningMsg;
uint32_t tracks =
Checked(ui->advOutRecTrack1) +
Checked(ui->advOutRecTrack2) +
@ -3395,22 +3400,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());
@ -3768,6 +3781,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;