mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00:00 
			
		
		
		
	
						commit
						aedf5a84b0
					
				
					 16 changed files with 714 additions and 60 deletions
				
			
		|  | @ -198,6 +198,10 @@ void Config::ReadValues() { | |||
|     Settings::values.audio_device_id = | ||||
|         ReadSetting("output_device", "auto").toString().toStdString(); | ||||
|     Settings::values.volume = ReadSetting("volume", 1).toFloat(); | ||||
|     Settings::values.mic_input_type = | ||||
|         static_cast<Settings::MicInputType>(ReadSetting("mic_input_type", 0).toInt()); | ||||
|     Settings::values.mic_input_device = | ||||
|         ReadSetting("mic_input_device", "Default").toString().toStdString(); | ||||
|     qt_config->endGroup(); | ||||
| 
 | ||||
|     using namespace Service::CAM; | ||||
|  | @ -480,6 +484,9 @@ void Config::SaveValues() { | |||
|     WriteSetting("enable_audio_stretching", Settings::values.enable_audio_stretching, true); | ||||
|     WriteSetting("output_device", QString::fromStdString(Settings::values.audio_device_id), "auto"); | ||||
|     WriteSetting("volume", Settings::values.volume, 1.0f); | ||||
|     WriteSetting("mic_input_device", QString::fromStdString(Settings::values.mic_input_device), | ||||
|                  "Default"); | ||||
|     WriteSetting("mic_input_type", static_cast<int>(Settings::values.mic_input_type), 0); | ||||
|     qt_config->endGroup(); | ||||
| 
 | ||||
|     using namespace Service::CAM; | ||||
|  |  | |||
|  | @ -3,6 +3,10 @@ | |||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #include <memory> | ||||
| #include <QtGlobal> | ||||
| #ifdef HAVE_CUBEB | ||||
| #include "audio_core/cubeb_input.h" | ||||
| #endif | ||||
| #include "audio_core/sink.h" | ||||
| #include "audio_core/sink_details.h" | ||||
| #include "citra_qt/configuration/configure_audio.h" | ||||
|  | @ -28,10 +32,19 @@ ConfigureAudio::ConfigureAudio(QWidget* parent) | |||
|     connect(ui->volume_slider, &QSlider::valueChanged, this, | ||||
|             &ConfigureAudio::setVolumeIndicatorText); | ||||
| 
 | ||||
|     ui->input_device_combo_box->clear(); | ||||
|     ui->input_device_combo_box->addItem(tr("Default")); | ||||
| #ifdef HAVE_CUBEB | ||||
|     for (const auto& device : AudioCore::ListCubebInputDevices()) { | ||||
|         ui->input_device_combo_box->addItem(QString::fromStdString(device)); | ||||
|     } | ||||
| #endif | ||||
|     connect(ui->input_type_combo_box, qOverload<int>(&QComboBox::currentIndexChanged), this, | ||||
|             &ConfigureAudio::updateAudioInputDevices); | ||||
| 
 | ||||
|     this->setConfiguration(); | ||||
|     connect(ui->output_sink_combo_box, | ||||
|             static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, | ||||
|             &ConfigureAudio::updateAudioDevices); | ||||
|     connect(ui->output_sink_combo_box, qOverload<int>(&QComboBox::currentIndexChanged), this, | ||||
|             &ConfigureAudio::updateAudioOutputDevices); | ||||
| } | ||||
| 
 | ||||
| ConfigureAudio::~ConfigureAudio() {} | ||||
|  | @ -40,7 +53,7 @@ void ConfigureAudio::setConfiguration() { | |||
|     setOutputSinkFromSinkID(); | ||||
| 
 | ||||
|     // The device list cannot be pre-populated (nor listed) until the output sink is known.
 | ||||
|     updateAudioDevices(ui->output_sink_combo_box->currentIndex()); | ||||
|     updateAudioOutputDevices(ui->output_sink_combo_box->currentIndex()); | ||||
| 
 | ||||
|     setAudioDeviceFromDeviceID(); | ||||
| 
 | ||||
|  | @ -59,6 +72,12 @@ void ConfigureAudio::setConfiguration() { | |||
|         selection = 0; | ||||
|     } | ||||
|     ui->emulation_combo_box->setCurrentIndex(selection); | ||||
| 
 | ||||
|     int index = static_cast<int>(Settings::values.mic_input_type); | ||||
|     ui->input_type_combo_box->setCurrentIndex(index); | ||||
|     ui->input_device_combo_box->setCurrentText( | ||||
|         QString::fromStdString(Settings::values.mic_input_device)); | ||||
|     updateAudioInputDevices(index); | ||||
| } | ||||
| 
 | ||||
| void ConfigureAudio::setOutputSinkFromSinkID() { | ||||
|  | @ -105,9 +124,12 @@ void ConfigureAudio::applyConfiguration() { | |||
|         static_cast<float>(ui->volume_slider->sliderPosition()) / ui->volume_slider->maximum(); | ||||
|     Settings::values.enable_dsp_lle = ui->emulation_combo_box->currentIndex() != 0; | ||||
|     Settings::values.enable_dsp_lle_multithread = ui->emulation_combo_box->currentIndex() == 2; | ||||
|     Settings::values.mic_input_type = | ||||
|         static_cast<Settings::MicInputType>(ui->input_type_combo_box->currentIndex()); | ||||
|     Settings::values.mic_input_device = ui->input_device_combo_box->currentText().toStdString(); | ||||
| } | ||||
| 
 | ||||
| void ConfigureAudio::updateAudioDevices(int sink_index) { | ||||
| void ConfigureAudio::updateAudioOutputDevices(int sink_index) { | ||||
|     ui->audio_device_combo_box->clear(); | ||||
|     ui->audio_device_combo_box->addItem(AudioCore::auto_device_name); | ||||
| 
 | ||||
|  | @ -117,6 +139,8 @@ void ConfigureAudio::updateAudioDevices(int sink_index) { | |||
|     } | ||||
| } | ||||
| 
 | ||||
| void ConfigureAudio::updateAudioInputDevices(int index) {} | ||||
| 
 | ||||
| void ConfigureAudio::retranslateUi() { | ||||
|     ui->retranslateUi(this); | ||||
| } | ||||
|  |  | |||
|  | @ -23,7 +23,8 @@ public: | |||
|     void setConfiguration(); | ||||
| 
 | ||||
| private: | ||||
|     void updateAudioDevices(int sink_index); | ||||
|     void updateAudioOutputDevices(int sink_index); | ||||
|     void updateAudioInputDevices(int index); | ||||
| 
 | ||||
|     void setOutputSinkFromSinkID(); | ||||
|     void setAudioDeviceFromDeviceID(); | ||||
|  |  | |||
|  | @ -6,8 +6,8 @@ | |||
|    <rect> | ||||
|     <x>0</x> | ||||
|     <y>0</y> | ||||
|     <width>188</width> | ||||
|     <height>246</height> | ||||
|     <width>329</width> | ||||
|     <height>332</height> | ||||
|    </rect> | ||||
|   </property> | ||||
|   <layout class="QVBoxLayout"> | ||||
|  | @ -39,7 +39,7 @@ | |||
|         <item> | ||||
|          <widget class="QLabel" name="label1"> | ||||
|           <property name="text"> | ||||
|            <string>Output Engine:</string> | ||||
|            <string>Output Engine</string> | ||||
|           </property> | ||||
|          </widget> | ||||
|         </item> | ||||
|  | @ -63,7 +63,7 @@ | |||
|         <item> | ||||
|          <widget class="QLabel" name="label2"> | ||||
|           <property name="text"> | ||||
|            <string>Audio Device:</string> | ||||
|            <string>Audio Device</string> | ||||
|           </property> | ||||
|          </widget> | ||||
|         </item> | ||||
|  | @ -137,6 +137,59 @@ | |||
|      </layout> | ||||
|     </widget> | ||||
|    </item> | ||||
|    <item> | ||||
|     <widget class="QGroupBox" name="groupBox_2"> | ||||
|      <property name="title"> | ||||
|       <string>Microphone</string> | ||||
|      </property> | ||||
|      <layout class="QVBoxLayout" name="verticalLayout"> | ||||
|       <item> | ||||
|        <layout class="QHBoxLayout" name="horizontalLayout"> | ||||
|         <item> | ||||
|          <widget class="QLabel" name="label_2"> | ||||
|           <property name="text"> | ||||
|            <string>Input Type</string> | ||||
|           </property> | ||||
|          </widget> | ||||
|         </item> | ||||
|         <item> | ||||
|          <widget class="QComboBox" name="input_type_combo_box"> | ||||
|           <item> | ||||
|            <property name="text"> | ||||
|             <string>None</string> | ||||
|            </property> | ||||
|           </item> | ||||
|           <item> | ||||
|            <property name="text"> | ||||
|             <string>Real Device</string> | ||||
|            </property> | ||||
|           </item> | ||||
|           <item> | ||||
|            <property name="text"> | ||||
|             <string>Static Noise</string> | ||||
|            </property> | ||||
|           </item> | ||||
|          </widget> | ||||
|         </item> | ||||
|        </layout> | ||||
|       </item> | ||||
|       <item> | ||||
|        <layout class="QHBoxLayout" name="horizontalLayout_3"> | ||||
|         <item> | ||||
|          <widget class="QLabel" name="label_3"> | ||||
|           <property name="text"> | ||||
|            <string>Input Device</string> | ||||
|           </property> | ||||
|          </widget> | ||||
|         </item> | ||||
|         <item> | ||||
|          <widget class="QComboBox" name="input_device_combo_box"/> | ||||
|         </item> | ||||
|        </layout> | ||||
|       </item> | ||||
|      </layout> | ||||
|     </widget> | ||||
|    </item> | ||||
|    <item> | ||||
|     <spacer> | ||||
|      <property name="orientation"> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue