UI: Disallow exiting settings with no track in advanced mode
(cherry picked from commit 4b37692939)
This commit is contained in:
parent
85d22f5ff5
commit
3f3ff4fd92
3 changed files with 22 additions and 8 deletions
|
|
@ -3886,14 +3886,8 @@ void OBSBasicSettings::SaveOutputSettings()
|
|||
SaveSpinBox(ui->advOutSplitFileTime, "AdvOut", "RecSplitFileTime");
|
||||
SaveSpinBox(ui->advOutSplitFileSize, "AdvOut", "RecSplitFileSize");
|
||||
|
||||
config_set_int(
|
||||
main->Config(), "AdvOut", "RecTracks",
|
||||
(ui->advOutRecTrack1->isChecked() ? (1 << 0) : 0) |
|
||||
(ui->advOutRecTrack2->isChecked() ? (1 << 1) : 0) |
|
||||
(ui->advOutRecTrack3->isChecked() ? (1 << 2) : 0) |
|
||||
(ui->advOutRecTrack4->isChecked() ? (1 << 3) : 0) |
|
||||
(ui->advOutRecTrack5->isChecked() ? (1 << 4) : 0) |
|
||||
(ui->advOutRecTrack6->isChecked() ? (1 << 5) : 0));
|
||||
config_set_int(main->Config(), "AdvOut", "RecTracks",
|
||||
AdvOutGetSelectedAudioTracks());
|
||||
|
||||
config_set_int(main->Config(), "AdvOut", "FLVTrack", CurrentFLVTrack());
|
||||
|
||||
|
|
@ -4237,6 +4231,10 @@ bool OBSBasicSettings::QueryAllowedToClose()
|
|||
ui->advOutRecAEncoder->currentIndex() == -1 ||
|
||||
ui->advOutAEncoder->currentIndex() == -1)
|
||||
invalidEncoder = true;
|
||||
|
||||
QString format = ui->advOutRecFormat->currentData().toString();
|
||||
if (AdvOutGetSelectedAudioTracks() == 0 && format != "flv")
|
||||
invalidTracks = true;
|
||||
}
|
||||
|
||||
if (invalidEncoder) {
|
||||
|
|
@ -6179,6 +6177,17 @@ int OBSBasicSettings::SimpleOutGetSelectedAudioTracks()
|
|||
return tracks;
|
||||
}
|
||||
|
||||
int OBSBasicSettings::AdvOutGetSelectedAudioTracks()
|
||||
{
|
||||
int tracks = (ui->advOutRecTrack1->isChecked() ? (1 << 0) : 0) |
|
||||
(ui->advOutRecTrack2->isChecked() ? (1 << 1) : 0) |
|
||||
(ui->advOutRecTrack3->isChecked() ? (1 << 2) : 0) |
|
||||
(ui->advOutRecTrack4->isChecked() ? (1 << 3) : 0) |
|
||||
(ui->advOutRecTrack5->isChecked() ? (1 << 4) : 0) |
|
||||
(ui->advOutRecTrack6->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. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue