UI: Add pause support

Adds support for pausing recordings.  When settings are eligible for
recordings, a pause button will appear next to the recording button.  If
the settings are not eligible, it will warn the user in the output
settings that they cannot pause recordings if those settings are used.
This commit is contained in:
jp9000
2019-07-07 15:47:29 -07:00
parent 942ca6f709
commit eab10d48b2
22 changed files with 385 additions and 42 deletions

View File

@@ -729,6 +729,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
SLOT(AdvOutRecCheckWarnings()));
connect(ui->advOutRecFormat, SIGNAL(currentIndexChanged(int)), this,
SLOT(AdvOutRecCheckWarnings()));
connect(ui->advOutRecEncoder, SIGNAL(currentIndexChanged(int)), this,
SLOT(AdvOutRecCheckWarnings()));
AdvOutRecCheckWarnings();
ui->buttonBox->button(QDialogButtonBox::Apply)->setIcon(QIcon());
@@ -3929,6 +3931,13 @@ void OBSBasicSettings::AdvOutRecCheckWarnings()
warningMsg = QTStr("OutputWarnings.MultiTrackRecording");
}
bool useStreamEncoder = ui->advOutRecEncoder->currentIndex() == 0;
if (useStreamEncoder) {
if (!warningMsg.isEmpty())
warningMsg += "\n\n";
warningMsg += QTStr("OutputWarnings.CannotPause");
}
if (ui->advOutRecFormat->currentText().compare("mp4") == 0 ||
ui->advOutRecFormat->currentText().compare("mov") == 0) {
if (!warningMsg.isEmpty())
@@ -4387,6 +4396,10 @@ void OBSBasicSettings::SimpleRecordingEncoderChanged()
warning += "\n\n";
warning += SIMPLE_OUTPUT_WARNING("Encoder");
}
} else {
if (!warning.isEmpty())
warning += "\n\n";
warning += SIMPLE_OUTPUT_WARNING("CannotPause");
}
if (qual != "Lossless" &&