UI: Increase maximum audio tracks to 6
This commit is contained in:
parent
f10e2c6740
commit
c4ec1bc28a
@ -35,6 +35,8 @@ OBSAdvAudioCtrl::OBSAdvAudioCtrl(QGridLayout *layout, obs_source_t *source_)
|
||||
mixer2 = new QCheckBox();
|
||||
mixer3 = new QCheckBox();
|
||||
mixer4 = new QCheckBox();
|
||||
mixer5 = new QCheckBox();
|
||||
mixer6 = new QCheckBox();
|
||||
|
||||
volChangedSignal.Connect(handler, "volume", OBSSourceVolumeChanged,
|
||||
this);
|
||||
@ -93,6 +95,10 @@ OBSAdvAudioCtrl::OBSAdvAudioCtrl(QGridLayout *layout, obs_source_t *source_)
|
||||
mixer3->setChecked(mixers & (1<<2));
|
||||
mixer4->setText("4");
|
||||
mixer4->setChecked(mixers & (1<<3));
|
||||
mixer5->setText("5");
|
||||
mixer5->setChecked(mixers & (1<<4));
|
||||
mixer6->setText("6");
|
||||
mixer6->setChecked(mixers & (1<<5));
|
||||
|
||||
panningContainer->layout()->addWidget(labelL);
|
||||
panningContainer->layout()->addWidget(panning);
|
||||
@ -103,6 +109,8 @@ OBSAdvAudioCtrl::OBSAdvAudioCtrl(QGridLayout *layout, obs_source_t *source_)
|
||||
mixerContainer->layout()->addWidget(mixer2);
|
||||
mixerContainer->layout()->addWidget(mixer3);
|
||||
mixerContainer->layout()->addWidget(mixer4);
|
||||
mixerContainer->layout()->addWidget(mixer5);
|
||||
mixerContainer->layout()->addWidget(mixer6);
|
||||
|
||||
QWidget::connect(volume, SIGNAL(valueChanged(int)),
|
||||
this, SLOT(volumeChanged(int)));
|
||||
@ -120,6 +128,10 @@ OBSAdvAudioCtrl::OBSAdvAudioCtrl(QGridLayout *layout, obs_source_t *source_)
|
||||
this, SLOT(mixer3Changed(bool)));
|
||||
QWidget::connect(mixer4, SIGNAL(clicked(bool)),
|
||||
this, SLOT(mixer4Changed(bool)));
|
||||
QWidget::connect(mixer5, SIGNAL(clicked(bool)),
|
||||
this, SLOT(mixer5Changed(bool)));
|
||||
QWidget::connect(mixer6, SIGNAL(clicked(bool)),
|
||||
this, SLOT(mixer6Changed(bool)));
|
||||
|
||||
int lastRow = layout->rowCount();
|
||||
|
||||
@ -209,6 +221,8 @@ void OBSAdvAudioCtrl::SourceMixersChanged(uint32_t mixers)
|
||||
setCheckboxState(mixer2, mixers & (1<<1));
|
||||
setCheckboxState(mixer3, mixers & (1<<2));
|
||||
setCheckboxState(mixer4, mixers & (1<<3));
|
||||
setCheckboxState(mixer5, mixers & (1<<4));
|
||||
setCheckboxState(mixer6, mixers & (1<<5));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
@ -281,3 +295,13 @@ void OBSAdvAudioCtrl::mixer4Changed(bool checked)
|
||||
{
|
||||
setMixer(source, 3, checked);
|
||||
}
|
||||
|
||||
void OBSAdvAudioCtrl::mixer5Changed(bool checked)
|
||||
{
|
||||
setMixer(source, 4, checked);
|
||||
}
|
||||
|
||||
void OBSAdvAudioCtrl::mixer6Changed(bool checked)
|
||||
{
|
||||
setMixer(source, 5, checked);
|
||||
}
|
||||
|
@ -31,6 +31,8 @@ private:
|
||||
QPointer<QCheckBox> mixer2;
|
||||
QPointer<QCheckBox> mixer3;
|
||||
QPointer<QCheckBox> mixer4;
|
||||
QPointer<QCheckBox> mixer5;
|
||||
QPointer<QCheckBox> mixer6;
|
||||
|
||||
OBSSignal volChangedSignal;
|
||||
OBSSignal syncOffsetSignal;
|
||||
@ -62,4 +64,6 @@ public slots:
|
||||
void mixer2Changed(bool checked);
|
||||
void mixer3Changed(bool checked);
|
||||
void mixer4Changed(bool checked);
|
||||
void mixer5Changed(bool checked);
|
||||
void mixer6Changed(bool checked);
|
||||
};
|
||||
|
@ -1149,6 +1149,20 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="advOutTrack5">
|
||||
<property name="text">
|
||||
<string notr="true">5</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="advOutTrack6">
|
||||
<property name="text">
|
||||
<string notr="true">6</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1492,6 +1506,20 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="advOutRecTrack5">
|
||||
<property name="text">
|
||||
<string notr="true">5</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="advOutRecTrack6">
|
||||
<property name="text">
|
||||
<string notr="true">6</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1859,6 +1887,20 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="advOutFFTrack5">
|
||||
<property name="text">
|
||||
<string notr="true">5</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="advOutFFTrack6">
|
||||
<property name="text">
|
||||
<string notr="true">6</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -2442,6 +2484,236 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_9">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Basic.Settings.Output.Adv.Audio.Track5</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_25">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="labelAlignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_59">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>170</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.AudioBitrate</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>advOutTrack4Bitrate</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="advOutTrack5Bitrate">
|
||||
<property name="currentIndex">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>32</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>48</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>64</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>80</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>96</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>112</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>128</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>160</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>192</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>256</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>320</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_60">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>advOutTrack4Name</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="advOutTrack5Name"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_12">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Basic.Settings.Output.Adv.Audio.Track6</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_26">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="labelAlignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_61">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>170</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Output.AudioBitrate</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>advOutTrack4Bitrate</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="advOutTrack6Bitrate">
|
||||
<property name="currentIndex">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>32</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>48</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>64</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>80</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>96</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>112</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>128</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>160</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>192</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>256</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>320</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_62">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>advOutTrack4Name</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="advOutTrack6Name"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -2949,8 +3221,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>818</width>
|
||||
<height>697</height>
|
||||
<width>98</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="hotkeyLayout">
|
||||
@ -2996,7 +3268,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>803</width>
|
||||
<width>593</width>
|
||||
<height>709</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -894,7 +894,7 @@ bool SimpleOutput::ReplayBufferActive() const
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
struct AdvancedOutput : BasicOutputHandler {
|
||||
OBSEncoder aacTrack[4];
|
||||
OBSEncoder aacTrack[MAX_AUDIO_MIXES];
|
||||
OBSEncoder h264Streaming;
|
||||
OBSEncoder h264Recording;
|
||||
|
||||
@ -902,7 +902,7 @@ struct AdvancedOutput : BasicOutputHandler {
|
||||
bool ffmpegRecording;
|
||||
bool useStreamEncoder;
|
||||
|
||||
string aacEncoderID[4];
|
||||
string aacEncoderID[MAX_AUDIO_MIXES];
|
||||
|
||||
AdvancedOutput(OBSBasic *main_);
|
||||
|
||||
@ -999,7 +999,7 @@ AdvancedOutput::AdvancedOutput(OBSBasic *main_) : BasicOutputHandler(main_)
|
||||
"(advanced output)";
|
||||
obs_encoder_release(h264Streaming);
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < MAX_AUDIO_MIXES; i++) {
|
||||
char name[9];
|
||||
sprintf(name, "adv_aac%d", i);
|
||||
|
||||
@ -1094,7 +1094,7 @@ inline void AdvancedOutput::SetupStreaming()
|
||||
for (; i < trackCount; i++)
|
||||
obs_output_set_audio_encoder(streamOutput, aacTrack[i],
|
||||
i);
|
||||
for (; i < 4; i++)
|
||||
for (; i < MAX_AUDIO_MIXES; i++)
|
||||
obs_output_set_audio_encoder(streamOutput, nullptr, i);
|
||||
|
||||
} else {
|
||||
@ -1219,31 +1219,30 @@ static inline void SetEncoderName(obs_encoder_t *encoder, const char *name,
|
||||
|
||||
inline void AdvancedOutput::UpdateAudioSettings()
|
||||
{
|
||||
const char *name1 = config_get_string(main->Config(), "AdvOut",
|
||||
"Track1Name");
|
||||
const char *name2 = config_get_string(main->Config(), "AdvOut",
|
||||
"Track2Name");
|
||||
const char *name3 = config_get_string(main->Config(), "AdvOut",
|
||||
"Track3Name");
|
||||
const char *name4 = config_get_string(main->Config(), "AdvOut",
|
||||
"Track4Name");
|
||||
bool applyServiceSettings = config_get_bool(main->Config(), "AdvOut",
|
||||
"ApplyServiceSettings");
|
||||
int streamTrackIndex = config_get_int(main->Config(), "AdvOut",
|
||||
"TrackIndex");
|
||||
obs_data_t *settings[4];
|
||||
obs_data_t *settings[MAX_AUDIO_MIXES];
|
||||
|
||||
for (size_t i = 0; i < 4; i++) {
|
||||
for (size_t i = 0; i < MAX_AUDIO_MIXES; i++) {
|
||||
settings[i] = obs_data_create();
|
||||
obs_data_set_int(settings[i], "bitrate", GetAudioBitrate(i));
|
||||
}
|
||||
|
||||
SetEncoderName(aacTrack[0], name1, "Track1");
|
||||
SetEncoderName(aacTrack[1], name2, "Track2");
|
||||
SetEncoderName(aacTrack[2], name3, "Track3");
|
||||
SetEncoderName(aacTrack[3], name4, "Track4");
|
||||
for (size_t i = 0; i < MAX_AUDIO_MIXES; i++) {
|
||||
string cfg_name = "Track";
|
||||
cfg_name += to_string((int)i + 1);
|
||||
cfg_name += "Name";
|
||||
const char *name = config_get_string(main->Config(), "AdvOut",
|
||||
cfg_name.c_str());
|
||||
|
||||
for (size_t i = 0; i < 4; i++) {
|
||||
string def_name = "Track";
|
||||
def_name += to_string((int)i + 1);
|
||||
SetEncoderName(aacTrack[i], name, def_name.c_str());
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < MAX_AUDIO_MIXES; i++) {
|
||||
if (applyServiceSettings && (int)(i + 1) == streamTrackIndex)
|
||||
obs_service_apply_encoder_settings(main->GetService(),
|
||||
nullptr, settings[i]);
|
||||
@ -1258,10 +1257,8 @@ void AdvancedOutput::SetupOutputs()
|
||||
obs_encoder_set_video(h264Streaming, obs_get_video());
|
||||
if (h264Recording)
|
||||
obs_encoder_set_video(h264Recording, obs_get_video());
|
||||
obs_encoder_set_audio(aacTrack[0], obs_get_audio());
|
||||
obs_encoder_set_audio(aacTrack[1], obs_get_audio());
|
||||
obs_encoder_set_audio(aacTrack[2], obs_get_audio());
|
||||
obs_encoder_set_audio(aacTrack[3], obs_get_audio());
|
||||
for (size_t i = 0; i < MAX_AUDIO_MIXES; i++)
|
||||
obs_encoder_set_audio(aacTrack[i], obs_get_audio());
|
||||
|
||||
SetupStreaming();
|
||||
|
||||
@ -1273,9 +1270,10 @@ void AdvancedOutput::SetupOutputs()
|
||||
|
||||
int AdvancedOutput::GetAudioBitrate(size_t i) const
|
||||
{
|
||||
const char *names[] = {
|
||||
static const char *names[] = {
|
||||
"Track1Bitrate", "Track2Bitrate",
|
||||
"Track3Bitrate", "Track4Bitrate",
|
||||
"Track5Bitrate", "Track6Bitrate",
|
||||
};
|
||||
int bitrate = (int)config_get_uint(main->Config(), "AdvOut", names[i]);
|
||||
return FindClosestAvailableAACBitrate(bitrate);
|
||||
|
@ -262,7 +262,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
|
||||
PopulateAACBitrates({ui->simpleOutputABitrate,
|
||||
ui->advOutTrack1Bitrate, ui->advOutTrack2Bitrate,
|
||||
ui->advOutTrack3Bitrate, ui->advOutTrack4Bitrate});
|
||||
ui->advOutTrack3Bitrate, ui->advOutTrack4Bitrate,
|
||||
ui->advOutTrack5Bitrate, ui->advOutTrack6Bitrate});
|
||||
|
||||
ui->listWidget->setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
|
||||
@ -310,6 +311,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
HookWidget(ui->advOutTrack2, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutTrack3, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutTrack4, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutTrack5, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutTrack6, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutApplyService, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutRecType, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutRecPath, EDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
@ -323,6 +326,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
HookWidget(ui->advOutRecTrack2, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutRecTrack3, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutRecTrack4, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutRecTrack5, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutRecTrack6, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFType, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFRecPath, EDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFNoSpace, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
@ -339,6 +344,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
HookWidget(ui->advOutFFTrack2, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFTrack3, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFTrack4, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFTrack5, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFTrack6, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFAEncoder, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutFFACfg, EDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutTrack1Bitrate, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
@ -349,6 +356,10 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
HookWidget(ui->advOutTrack3Name, EDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutTrack4Bitrate, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutTrack4Name, EDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutTrack5Bitrate, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutTrack5Name, EDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutTrack6Bitrate, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->advOutTrack6Name, EDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->channelSetup, COMBO_CHANGED, AUDIO_RESTART);
|
||||
HookWidget(ui->sampleRate, COMBO_CHANGED, AUDIO_RESTART);
|
||||
HookWidget(ui->desktopAudioDevice1, COMBO_CHANGED, AUDIO_CHANGED);
|
||||
@ -457,6 +468,10 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
this, SLOT(UpdateStreamDelayEstimate()));
|
||||
connect(ui->advOutTrack4Bitrate, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(UpdateStreamDelayEstimate()));
|
||||
connect(ui->advOutTrack5Bitrate, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(UpdateStreamDelayEstimate()));
|
||||
connect(ui->advOutTrack6Bitrate, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(UpdateStreamDelayEstimate()));
|
||||
|
||||
//Apply button disabled until change.
|
||||
EnableApplyButton(false);
|
||||
@ -567,6 +582,10 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
this, SLOT(AdvOutRecCheckWarnings()));
|
||||
connect(ui->advOutRecTrack4, SIGNAL(clicked()),
|
||||
this, SLOT(AdvOutRecCheckWarnings()));
|
||||
connect(ui->advOutRecTrack5, SIGNAL(clicked()),
|
||||
this, SLOT(AdvOutRecCheckWarnings()));
|
||||
connect(ui->advOutRecTrack6, SIGNAL(clicked()),
|
||||
this, SLOT(AdvOutRecCheckWarnings()));
|
||||
AdvOutRecCheckWarnings();
|
||||
|
||||
SimpleRecordingQualityChanged();
|
||||
@ -1308,6 +1327,8 @@ void OBSBasicSettings::LoadAdvOutputStreamingSettings()
|
||||
case 2: ui->advOutTrack2->setChecked(true); break;
|
||||
case 3: ui->advOutTrack3->setChecked(true); break;
|
||||
case 4: ui->advOutTrack4->setChecked(true); break;
|
||||
case 5: ui->advOutTrack5->setChecked(true); break;
|
||||
case 6: ui->advOutTrack6->setChecked(true); break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1402,6 +1423,8 @@ void OBSBasicSettings::LoadAdvOutputRecordingSettings()
|
||||
ui->advOutRecTrack2->setChecked(tracks & (1<<1));
|
||||
ui->advOutRecTrack3->setChecked(tracks & (1<<2));
|
||||
ui->advOutRecTrack4->setChecked(tracks & (1<<3));
|
||||
ui->advOutRecTrack5->setChecked(tracks & (1<<4));
|
||||
ui->advOutRecTrack6->setChecked(tracks & (1<<5));
|
||||
}
|
||||
|
||||
void OBSBasicSettings::LoadAdvOutputRecordingEncoderProperties()
|
||||
@ -1516,6 +1539,8 @@ void OBSBasicSettings::LoadAdvOutputFFmpegSettings()
|
||||
case 2: ui->advOutFFTrack2->setChecked(true); break;
|
||||
case 3: ui->advOutFFTrack3->setChecked(true); break;
|
||||
case 4: ui->advOutFFTrack4->setChecked(true); break;
|
||||
case 5: ui->advOutFFTrack5->setChecked(true); break;
|
||||
case 6: ui->advOutFFTrack6->setChecked(true); break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1529,6 +1554,10 @@ void OBSBasicSettings::LoadAdvOutputAudioSettings()
|
||||
"Track3Bitrate");
|
||||
int track4Bitrate = config_get_uint(main->Config(), "AdvOut",
|
||||
"Track4Bitrate");
|
||||
int track5Bitrate = config_get_uint(main->Config(), "AdvOut",
|
||||
"Track5Bitrate");
|
||||
int track6Bitrate = config_get_uint(main->Config(), "AdvOut",
|
||||
"Track6Bitrate");
|
||||
const char *name1 = config_get_string(main->Config(), "AdvOut",
|
||||
"Track1Name");
|
||||
const char *name2 = config_get_string(main->Config(), "AdvOut",
|
||||
@ -1537,11 +1566,17 @@ void OBSBasicSettings::LoadAdvOutputAudioSettings()
|
||||
"Track3Name");
|
||||
const char *name4 = config_get_string(main->Config(), "AdvOut",
|
||||
"Track4Name");
|
||||
const char *name5 = config_get_string(main->Config(), "AdvOut",
|
||||
"Track5Name");
|
||||
const char *name6 = config_get_string(main->Config(), "AdvOut",
|
||||
"Track6Name");
|
||||
|
||||
track1Bitrate = FindClosestAvailableAACBitrate(track1Bitrate);
|
||||
track2Bitrate = FindClosestAvailableAACBitrate(track2Bitrate);
|
||||
track3Bitrate = FindClosestAvailableAACBitrate(track3Bitrate);
|
||||
track4Bitrate = FindClosestAvailableAACBitrate(track4Bitrate);
|
||||
track5Bitrate = FindClosestAvailableAACBitrate(track5Bitrate);
|
||||
track6Bitrate = FindClosestAvailableAACBitrate(track6Bitrate);
|
||||
|
||||
SetComboByName(ui->advOutTrack1Bitrate,
|
||||
std::to_string(track1Bitrate).c_str());
|
||||
@ -1551,11 +1586,17 @@ void OBSBasicSettings::LoadAdvOutputAudioSettings()
|
||||
std::to_string(track3Bitrate).c_str());
|
||||
SetComboByName(ui->advOutTrack4Bitrate,
|
||||
std::to_string(track4Bitrate).c_str());
|
||||
SetComboByName(ui->advOutTrack5Bitrate,
|
||||
std::to_string(track5Bitrate).c_str());
|
||||
SetComboByName(ui->advOutTrack6Bitrate,
|
||||
std::to_string(track6Bitrate).c_str());
|
||||
|
||||
ui->advOutTrack1Name->setText(name1);
|
||||
ui->advOutTrack2Name->setText(name2);
|
||||
ui->advOutTrack3Name->setText(name3);
|
||||
ui->advOutTrack4Name->setText(name4);
|
||||
ui->advOutTrack5Name->setText(name5);
|
||||
ui->advOutTrack6Name->setText(name6);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::LoadOutputSettings()
|
||||
@ -1612,6 +1653,8 @@ void OBSBasicSettings::SetAdvOutputFFmpegEnablement(
|
||||
ui->advOutFFTrack2->setEnabled(enabled);
|
||||
ui->advOutFFTrack3->setEnabled(enabled);
|
||||
ui->advOutFFTrack4->setEnabled(enabled);
|
||||
ui->advOutFFTrack5->setEnabled(enabled);
|
||||
ui->advOutFFTrack6->setEnabled(enabled);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -2440,12 +2483,16 @@ static void SaveTrackIndex(config_t *config, const char *section,
|
||||
QAbstractButton *check1,
|
||||
QAbstractButton *check2,
|
||||
QAbstractButton *check3,
|
||||
QAbstractButton *check4)
|
||||
QAbstractButton *check4,
|
||||
QAbstractButton *check5,
|
||||
QAbstractButton *check6)
|
||||
{
|
||||
if (check1->isChecked()) config_set_int(config, section, name, 1);
|
||||
else if (check2->isChecked()) config_set_int(config, section, name, 2);
|
||||
else if (check3->isChecked()) config_set_int(config, section, name, 3);
|
||||
else if (check4->isChecked()) config_set_int(config, section, name, 4);
|
||||
else if (check5->isChecked()) config_set_int(config, section, name, 5);
|
||||
else if (check6->isChecked()) config_set_int(config, section, name, 6);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SaveFormat(QComboBox *combo)
|
||||
@ -2534,7 +2581,8 @@ void OBSBasicSettings::SaveOutputSettings()
|
||||
SaveCombo(ui->advOutRescale, "AdvOut", "RescaleRes");
|
||||
SaveTrackIndex(main->Config(), "AdvOut", "TrackIndex",
|
||||
ui->advOutTrack1, ui->advOutTrack2,
|
||||
ui->advOutTrack3, ui->advOutTrack4);
|
||||
ui->advOutTrack3, ui->advOutTrack4,
|
||||
ui->advOutTrack5, ui->advOutTrack6);
|
||||
|
||||
config_set_string(main->Config(), "AdvOut", "RecType",
|
||||
RecTypeFromIdx(ui->advOutRecType->currentIndex()));
|
||||
@ -2553,7 +2601,9 @@ void OBSBasicSettings::SaveOutputSettings()
|
||||
(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->advOutRecTrack4->isChecked() ? (1<<3) : 0) |
|
||||
(ui->advOutRecTrack5->isChecked() ? (1<<4) : 0) |
|
||||
(ui->advOutRecTrack6->isChecked() ? (1<<5) : 0));
|
||||
|
||||
config_set_bool(main->Config(), "AdvOut", "FFOutputToFile",
|
||||
ui->advOutFFType->currentIndex() == 0 ? true : false);
|
||||
@ -2572,16 +2622,21 @@ void OBSBasicSettings::SaveOutputSettings()
|
||||
SaveEdit(ui->advOutFFACfg, "AdvOut", "FFACustom");
|
||||
SaveTrackIndex(main->Config(), "AdvOut", "FFAudioTrack",
|
||||
ui->advOutFFTrack1, ui->advOutFFTrack2,
|
||||
ui->advOutFFTrack3, ui->advOutFFTrack4);
|
||||
ui->advOutFFTrack3, ui->advOutFFTrack4,
|
||||
ui->advOutFFTrack5, ui->advOutFFTrack6);
|
||||
|
||||
SaveCombo(ui->advOutTrack1Bitrate, "AdvOut", "Track1Bitrate");
|
||||
SaveCombo(ui->advOutTrack2Bitrate, "AdvOut", "Track2Bitrate");
|
||||
SaveCombo(ui->advOutTrack3Bitrate, "AdvOut", "Track3Bitrate");
|
||||
SaveCombo(ui->advOutTrack4Bitrate, "AdvOut", "Track4Bitrate");
|
||||
SaveCombo(ui->advOutTrack5Bitrate, "AdvOut", "Track5Bitrate");
|
||||
SaveCombo(ui->advOutTrack6Bitrate, "AdvOut", "Track6Bitrate");
|
||||
SaveEdit(ui->advOutTrack1Name, "AdvOut", "Track1Name");
|
||||
SaveEdit(ui->advOutTrack2Name, "AdvOut", "Track2Name");
|
||||
SaveEdit(ui->advOutTrack3Name, "AdvOut", "Track3Name");
|
||||
SaveEdit(ui->advOutTrack4Name, "AdvOut", "Track4Name");
|
||||
SaveEdit(ui->advOutTrack5Name, "AdvOut", "Track5Name");
|
||||
SaveEdit(ui->advOutTrack6Name, "AdvOut", "Track6Name");
|
||||
|
||||
WriteJsonData(streamEncoderProps, "streamEncoder.json");
|
||||
WriteJsonData(recordEncoderProps, "recordEncoder.json");
|
||||
@ -3183,7 +3238,9 @@ void OBSBasicSettings::AdvOutRecCheckWarnings()
|
||||
Checked(ui->advOutRecTrack1) +
|
||||
Checked(ui->advOutRecTrack2) +
|
||||
Checked(ui->advOutRecTrack3) +
|
||||
Checked(ui->advOutRecTrack4);
|
||||
Checked(ui->advOutRecTrack4) +
|
||||
Checked(ui->advOutRecTrack5) +
|
||||
Checked(ui->advOutRecTrack6);
|
||||
const char *objectName = nullptr;
|
||||
|
||||
if (tracks == 0) {
|
||||
@ -3241,6 +3298,8 @@ void OBSBasicSettings::UpdateAdvOutStreamDelayEstimate()
|
||||
case 2: aBitrateText = ui->advOutTrack2Bitrate->currentText(); break;
|
||||
case 3: aBitrateText = ui->advOutTrack3Bitrate->currentText(); break;
|
||||
case 4: aBitrateText = ui->advOutTrack4Bitrate->currentText(); break;
|
||||
case 5: aBitrateText = ui->advOutTrack5Bitrate->currentText(); break;
|
||||
case 6: aBitrateText = ui->advOutTrack6Bitrate->currentText(); break;
|
||||
}
|
||||
|
||||
int seconds = ui->streamDelaySec->value();
|
||||
|
Loading…
x
Reference in New Issue
Block a user