mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-08 12:24:09 +00:00
UI: Disallow exiting settings with no track in simple mode
This commit is contained in:
parent
63e0bff5e6
commit
2bc368349f
|
@ -1323,6 +1323,8 @@ SceneItemHide="Hide '%1'"
|
|||
|
||||
# Output warnings
|
||||
OutputWarnings.NoTracksSelected="You must select at least one track"
|
||||
OutputWarnings.NoTracksSelectedOnExit.Title="Output Settings Error"
|
||||
OutputWarnings.NoTracksSelectedOnExit.Text="All outputs must have at least one audio track selected."
|
||||
OutputWarnings.MP4Recording="Warning: Recordings saved to MP4/MOV 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/MOV after it is finished (File → Remux Recordings)"
|
||||
OutputWarnings.CannotPause="Warning: Recordings cannot be paused if the recording encoder is set to \"(Use stream encoder)\""
|
||||
OutputWarnings.CodecIncompatible="The audio or video encoder selection was reset due to incompatibility. Please select a compatible encoder from the list."
|
||||
|
|
|
@ -3853,14 +3853,8 @@ void OBSBasicSettings::SaveOutputSettings()
|
|||
SaveCheckBox(ui->simpleReplayBuf, "SimpleOutput", "RecRB");
|
||||
SaveSpinBox(ui->simpleRBSecMax, "SimpleOutput", "RecRBTime");
|
||||
SaveSpinBox(ui->simpleRBMegsMax, "SimpleOutput", "RecRBSize");
|
||||
config_set_int(
|
||||
main->Config(), "SimpleOutput", "RecTracks",
|
||||
(ui->simpleOutRecTrack1->isChecked() ? (1 << 0) : 0) |
|
||||
(ui->simpleOutRecTrack2->isChecked() ? (1 << 1) : 0) |
|
||||
(ui->simpleOutRecTrack3->isChecked() ? (1 << 2) : 0) |
|
||||
(ui->simpleOutRecTrack4->isChecked() ? (1 << 3) : 0) |
|
||||
(ui->simpleOutRecTrack5->isChecked() ? (1 << 4) : 0) |
|
||||
(ui->simpleOutRecTrack6->isChecked() ? (1 << 5) : 0));
|
||||
config_set_int(main->Config(), "SimpleOutput", "RecTracks",
|
||||
SimpleOutGetSelectedAudioTracks());
|
||||
|
||||
curAdvStreamEncoder = GetComboData(ui->advOutEncoder);
|
||||
|
||||
|
@ -4219,6 +4213,7 @@ bool OBSBasicSettings::QueryAllowedToClose()
|
|||
|
||||
bool invalidEncoder = false;
|
||||
bool invalidFormat = false;
|
||||
bool invalidTracks = false;
|
||||
if (simple) {
|
||||
if (ui->simpleOutRecEncoder->currentIndex() == -1 ||
|
||||
ui->simpleOutStrEncoder->currentIndex() == -1 ||
|
||||
|
@ -4228,6 +4223,14 @@ bool OBSBasicSettings::QueryAllowedToClose()
|
|||
|
||||
if (ui->simpleOutRecFormat->currentIndex() == -1)
|
||||
invalidFormat = true;
|
||||
|
||||
QString qual =
|
||||
ui->simpleOutRecQuality->currentData().toString();
|
||||
QString format =
|
||||
ui->simpleOutRecFormat->currentData().toString();
|
||||
if (SimpleOutGetSelectedAudioTracks() == 0 &&
|
||||
qual != "Stream" && format != "flv")
|
||||
invalidTracks = true;
|
||||
} else {
|
||||
if (ui->advOutRecEncoder->currentIndex() == -1 ||
|
||||
ui->advOutEncoder->currentIndex() == -1 ||
|
||||
|
@ -4246,6 +4249,12 @@ bool OBSBasicSettings::QueryAllowedToClose()
|
|||
this, QTStr("CodecCompat.ContainerMissingOnExit.Title"),
|
||||
QTStr("CodecCompat.ContainerMissingOnExit.Text"));
|
||||
return false;
|
||||
} else if (invalidTracks) {
|
||||
OBSMessageBox::warning(
|
||||
this,
|
||||
QTStr("OutputWarnings.NoTracksSelectedOnExit.Title"),
|
||||
QTStr("OutputWarnings.NoTracksSelectedOnExit.Text"));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -6157,6 +6166,17 @@ int OBSBasicSettings::CurrentFLVTrack()
|
|||
return 0;
|
||||
}
|
||||
|
||||
int OBSBasicSettings::SimpleOutGetSelectedAudioTracks()
|
||||
{
|
||||
int tracks = (ui->simpleOutRecTrack1->isChecked() ? (1 << 0) : 0) |
|
||||
(ui->simpleOutRecTrack2->isChecked() ? (1 << 1) : 0) |
|
||||
(ui->simpleOutRecTrack3->isChecked() ? (1 << 2) : 0) |
|
||||
(ui->simpleOutRecTrack4->isChecked() ? (1 << 3) : 0) |
|
||||
(ui->simpleOutRecTrack5->isChecked() ? (1 << 4) : 0) |
|
||||
(ui->simpleOutRecTrack6->isChecked() ? (1 << 5) : 0);
|
||||
return tracks;
|
||||
}
|
||||
|
||||
/* Using setEditable(true) on a QComboBox when there's a custom style in use
|
||||
* does not work properly, so instead completely recreate the widget, which
|
||||
* seems to work fine. */
|
||||
|
|
|
@ -375,6 +375,7 @@ private:
|
|||
QIcon GetAdvancedIcon() const;
|
||||
|
||||
int CurrentFLVTrack();
|
||||
int SimpleOutGetSelectedAudioTracks();
|
||||
|
||||
OBSService GetStream1Service();
|
||||
|
||||
|
|
Loading…
Reference in a new issue