UI: Add 4th aux audio input device

Closes obsproject/obs-studio#1343
This commit is contained in:
Marvin Scholz 2018-06-26 20:41:32 +02:00 committed by jp9000
parent 7bbdace1a9
commit 8c4b496ea0
5 changed files with 48 additions and 20 deletions

View File

@ -726,6 +726,7 @@ Basic.Settings.Audio.DesktopDevice2="Desktop Audio Device 2"
Basic.Settings.Audio.AuxDevice="Mic/Auxiliary Audio Device"
Basic.Settings.Audio.AuxDevice2="Mic/Auxiliary Audio Device 2"
Basic.Settings.Audio.AuxDevice3="Mic/Auxiliary Audio Device 3"
Basic.Settings.Audio.AuxDevice4="Mic/Auxiliary Audio Device 4"
Basic.Settings.Audio.EnablePushToMute="Enable Push-to-mute"
Basic.Settings.Audio.PushToMuteDelay="Push-to-mute delay"
Basic.Settings.Audio.EnablePushToTalk="Enable Push-to-talk"

View File

@ -3426,7 +3426,7 @@
</property>
</widget>
</item>
<item row="7" column="0">
<item row="8" column="0">
<widget class="QLabel" name="label_65">
<property name="text">
<string>Basic.Settings.Audio.MeterDecayRate</string>
@ -3436,7 +3436,7 @@
</property>
</widget>
</item>
<item row="7" column="1">
<item row="8" column="1">
<widget class="QComboBox" name="meterDecayRate">
<property name="currentText">
<string>Basic.Settings.Audio.MeterDecayRate.Fast</string>
@ -3461,14 +3461,17 @@
</item>
</widget>
</item>
<item row="8" column="0">
<item row="9" column="0">
<widget class="QLabel" name="label_66">
<property name="text">
<string>Basic.Settings.Audio.PeakMeterType</string>
</property>
<property name="buddy">
<cstring>peakMeterType</cstring>
</property>
</widget>
</item>
<item row="8" column="1">
<item row="9" column="1">
<widget class="QComboBox" name="peakMeterType">
<property name="currentIndex">
<number>0</number>
@ -3485,7 +3488,7 @@
</item>
</widget>
</item>
<item row="9" column="0" colspan="2">
<item row="10" column="0" colspan="2">
<widget class="QScrollArea" name="audioSourceScrollArea">
<property name="widgetResizable">
<bool>true</bool>
@ -3502,7 +3505,7 @@
</widget>
</widget>
</item>
<item row="10" column="1">
<item row="11" column="1">
<widget class="QLabel" name="audioMsg">
<property name="text">
<string notr="true"/>
@ -3515,7 +3518,7 @@
</property>
</widget>
</item>
<item row="11" column="1">
<item row="12" column="1">
<widget class="QLabel" name="audioMsg_2">
<property name="text">
<string notr="true"/>
@ -3528,7 +3531,7 @@
</property>
</widget>
</item>
<item row="12" column="1">
<item row="13" column="1">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -3541,6 +3544,23 @@
</property>
</spacer>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="auxAudioDevice4">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_67">
<property name="text">
<string>Basic.Settings.Audio.AuxDevice4</string>
</property>
<property name="buddy">
<cstring>auxAudioDevice4</cstring>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="videoPage">
@ -3823,15 +3843,15 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="themeID" stdset="0">
<string>error</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="themeID" stdset="0">
<string>error</string>
</property>
</widget>
</item>
</layout>
@ -3845,8 +3865,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">
@ -3892,7 +3912,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>803</width>
<width>594</width>
<height>807</height>
</rect>
</property>
@ -4668,28 +4688,28 @@
</property>
<item>
<widget class="QLabel" name="advancedMsg">
<property name="themeID" stdset="0">
<string>error</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="themeID" stdset="0">
<string>error</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="advancedMsg2">
<property name="themeID" stdset="0">
<string>error</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="themeID" stdset="0">
<string>error</string>
</property>
</widget>
</item>
</layout>

View File

@ -368,6 +368,7 @@ static obs_data_t *GenerateSaveData(obs_data_array_t *sceneOrder,
SaveAudioDevice(AUX_AUDIO_1, 3, saveData, audioSources);
SaveAudioDevice(AUX_AUDIO_2, 4, saveData, audioSources);
SaveAudioDevice(AUX_AUDIO_3, 5, saveData, audioSources);
SaveAudioDevice(AUX_AUDIO_4, 6, saveData, audioSources);
/* -------------------------------- */
/* save non-group sources */
@ -833,6 +834,7 @@ void OBSBasic::Load(const char *file)
LoadAudioDevice(AUX_AUDIO_1, 3, data);
LoadAudioDevice(AUX_AUDIO_2, 4, data);
LoadAudioDevice(AUX_AUDIO_3, 5, data);
LoadAudioDevice(AUX_AUDIO_4, 6, data);
if (!sources) {
sources = groups;

View File

@ -53,6 +53,7 @@ class OBSBasicStats;
#define AUX_AUDIO_1 Str("AuxAudioDevice1")
#define AUX_AUDIO_2 Str("AuxAudioDevice2")
#define AUX_AUDIO_3 Str("AuxAudioDevice3")
#define AUX_AUDIO_4 Str("AuxAudioDevice4")
#define SIMPLE_ENCODER_X264 "x264"
#define SIMPLE_ENCODER_X264_LOWCPU "x264_lowcpu"

View File

@ -410,6 +410,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
HookWidget(ui->auxAudioDevice1, COMBO_CHANGED, AUDIO_CHANGED);
HookWidget(ui->auxAudioDevice2, COMBO_CHANGED, AUDIO_CHANGED);
HookWidget(ui->auxAudioDevice3, COMBO_CHANGED, AUDIO_CHANGED);
HookWidget(ui->auxAudioDevice4, COMBO_CHANGED, AUDIO_CHANGED);
HookWidget(ui->baseResolution, CBEDIT_CHANGED, VIDEO_RES);
HookWidget(ui->outputResolution, CBEDIT_CHANGED, VIDEO_RES);
HookWidget(ui->downscaleFilter, COMBO_CHANGED, VIDEO_CHANGED);
@ -2004,6 +2005,7 @@ void OBSBasicSettings::LoadAudioDevices()
LoadListValues(ui->auxAudioDevice1, inputs, 3);
LoadListValues(ui->auxAudioDevice2, inputs, 4);
LoadListValues(ui->auxAudioDevice3, inputs, 5);
LoadListValues(ui->auxAudioDevice4, inputs, 6);
obs_properties_destroy(input_props);
}
@ -3266,6 +3268,8 @@ void OBSBasicSettings::SaveAudioSettings()
"Basic.AuxDevice2", 4);
UpdateAudioDevice(true, ui->auxAudioDevice3,
"Basic.AuxDevice3", 5);
UpdateAudioDevice(true, ui->auxAudioDevice4,
"Basic.AuxDevice4", 6);
main->SaveProject();
}