mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-19 20:32:15 +02:00
UI: Disallow exiting settings with no track in advanced mode
This commit is contained in:
parent
2bc368349f
commit
4b37692939
@ -1806,6 +1806,10 @@ inline void AdvancedOutput::SetupRecording()
|
||||
unsigned int cy = 0;
|
||||
int idx = 0;
|
||||
|
||||
/* Hack to allow recordings without any audio tracks selected. It is no
|
||||
* longer possible to select such a configuration in settings, but legacy
|
||||
* configurations might still have this configured and we don't want to
|
||||
* just break them. */
|
||||
if (tracks == 0)
|
||||
tracks = config_get_int(main->Config(), "AdvOut", "TrackIndex");
|
||||
|
||||
|
@ -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) {
|
||||
@ -6177,6 +6175,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. */
|
||||
|
@ -376,6 +376,7 @@ private:
|
||||
|
||||
int CurrentFLVTrack();
|
||||
int SimpleOutGetSelectedAudioTracks();
|
||||
int AdvOutGetSelectedAudioTracks();
|
||||
|
||||
OBSService GetStream1Service();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user