diff options
Diffstat (limited to 'src/citra_qt')
-rw-r--r-- | src/citra_qt/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/citra_qt/config.cpp | 3 | ||||
-rw-r--r-- | src/citra_qt/configure_audio.cpp | 33 | ||||
-rw-r--r-- | src/citra_qt/configure_audio.h | 3 | ||||
-rw-r--r-- | src/citra_qt/configure_audio.ui | 15 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp | 7 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_vertex_shader.h | 1 | ||||
-rw-r--r-- | src/citra_qt/debugger/ramview.cpp | 12 | ||||
-rw-r--r-- | src/citra_qt/debugger/ramview.h | 17 | ||||
-rw-r--r-- | src/citra_qt/main.cpp | 3 |
10 files changed, 62 insertions, 36 deletions
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index 93f1c339d..d4460bf01 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -14,7 +14,6 @@ set(SRCS debugger/graphics/graphics_tracing.cpp debugger/graphics/graphics_vertex_shader.cpp debugger/profiler.cpp - debugger/ramview.cpp debugger/registers.cpp debugger/wait_tree.cpp util/spinbox.cpp @@ -48,7 +47,6 @@ set(HEADERS debugger/graphics/graphics_tracing.h debugger/graphics/graphics_vertex_shader.h debugger/profiler.h - debugger/ramview.h debugger/registers.h debugger/wait_tree.h util/spinbox.h @@ -100,7 +98,7 @@ if (APPLE) else() add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS}) endif() -target_link_libraries(citra-qt core video_core audio_core common qhexedit) +target_link_libraries(citra-qt core video_core audio_core common) target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS}) target_link_libraries(citra-qt ${PLATFORM_LIBRARIES} Threads::Threads) diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index 8021667d0..f776e16b2 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp @@ -63,6 +63,8 @@ void Config::ReadValues() { Settings::values.sink_id = qt_config->value("output_engine", "auto").toString().toStdString(); Settings::values.enable_audio_stretching = qt_config->value("enable_audio_stretching", true).toBool(); + Settings::values.audio_device_id = + qt_config->value("output_device", "auto").toString().toStdString(); qt_config->endGroup(); qt_config->beginGroup("Data Storage"); @@ -169,6 +171,7 @@ void Config::SaveValues() { qt_config->beginGroup("Audio"); qt_config->setValue("output_engine", QString::fromStdString(Settings::values.sink_id)); qt_config->setValue("enable_audio_stretching", Settings::values.enable_audio_stretching); + qt_config->setValue("output_device", QString::fromStdString(Settings::values.audio_device_id)); qt_config->endGroup(); qt_config->beginGroup("Data Storage"); diff --git a/src/citra_qt/configure_audio.cpp b/src/citra_qt/configure_audio.cpp index 3cdd4c780..3ddcf9232 100644 --- a/src/citra_qt/configure_audio.cpp +++ b/src/citra_qt/configure_audio.cpp @@ -2,6 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <memory> +#include "audio_core/audio_core.h" +#include "audio_core/sink.h" #include "audio_core/sink_details.h" #include "citra_qt/configure_audio.h" #include "core/settings.h" @@ -18,6 +21,8 @@ ConfigureAudio::ConfigureAudio(QWidget* parent) } this->setConfiguration(); + connect(ui->output_sink_combo_box, SIGNAL(currentIndexChanged(int)), this, + SLOT(updateAudioDevices(int))); } ConfigureAudio::~ConfigureAudio() {} @@ -33,6 +38,19 @@ void ConfigureAudio::setConfiguration() { ui->output_sink_combo_box->setCurrentIndex(new_sink_index); ui->toggle_audio_stretching->setChecked(Settings::values.enable_audio_stretching); + + // The device list cannot be pre-populated (nor listed) until the output sink is known. + updateAudioDevices(new_sink_index); + + int new_device_index = -1; + for (int index = 0; index < ui->audio_device_combo_box->count(); index++) { + if (ui->audio_device_combo_box->itemText(index).toStdString() == + Settings::values.audio_device_id) { + new_device_index = index; + break; + } + } + ui->audio_device_combo_box->setCurrentIndex(new_device_index); } void ConfigureAudio::applyConfiguration() { @@ -40,5 +58,20 @@ void ConfigureAudio::applyConfiguration() { ui->output_sink_combo_box->itemText(ui->output_sink_combo_box->currentIndex()) .toStdString(); Settings::values.enable_audio_stretching = ui->toggle_audio_stretching->isChecked(); + Settings::values.audio_device_id = + ui->audio_device_combo_box->itemText(ui->audio_device_combo_box->currentIndex()) + .toStdString(); Settings::Apply(); } + +void ConfigureAudio::updateAudioDevices(int sink_index) { + ui->audio_device_combo_box->clear(); + ui->audio_device_combo_box->addItem("auto"); + + std::string sink_id = ui->output_sink_combo_box->itemText(sink_index).toStdString(); + std::vector<std::string> device_list = + AudioCore::GetSinkDetails(sink_id).factory()->GetDeviceList(); + for (const auto& device : device_list) { + ui->audio_device_combo_box->addItem(device.c_str()); + } +} diff --git a/src/citra_qt/configure_audio.h b/src/citra_qt/configure_audio.h index 51df2e27b..8190e694f 100644 --- a/src/citra_qt/configure_audio.h +++ b/src/citra_qt/configure_audio.h @@ -20,6 +20,9 @@ public: void applyConfiguration(); +public slots: + void updateAudioDevices(int sink_index); + private: void setConfiguration(); diff --git a/src/citra_qt/configure_audio.ui b/src/citra_qt/configure_audio.ui index 3e2b4635f..dd870eb61 100644 --- a/src/citra_qt/configure_audio.ui +++ b/src/citra_qt/configure_audio.ui @@ -35,6 +35,21 @@ </property> </widget> </item> + <item> + <layout class="QHBoxLayout"> + <item> + <widget class="QLabel"> + <property name="text"> + <string>Audio Device:</string> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="audio_device_combo_box"> + </widget> + </item> + </layout> + </item> </layout> </widget> </item> diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp index ff2e7e363..f37524190 100644 --- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp @@ -18,7 +18,9 @@ #include "citra_qt/util/util.h" #include "video_core/pica.h" #include "video_core/pica_state.h" +#include "video_core/shader/debug_data.h" #include "video_core/shader/shader.h" +#include "video_core/shader/shader_interpreter.h" using nihstro::OpCode; using nihstro::Instruction; @@ -518,8 +520,9 @@ void GraphicsVertexShaderWidget::Reload(bool replace_vertex_data, void* vertex_d info.labels.insert({entry_point, "main"}); // Generate debug information - debug_data = Pica::g_state.vs.ProduceDebugInfo(input_vertex, num_attributes, shader_config, - shader_setup); + Pica::Shader::InterpreterEngine shader_engine; + shader_engine.SetupBatch(shader_setup, entry_point); + debug_data = shader_engine.ProduceDebugInfo(shader_setup, input_vertex, num_attributes); // Reload widget state for (int attr = 0; attr < num_attributes; ++attr) { diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.h b/src/citra_qt/debugger/graphics/graphics_vertex_shader.h index bedea0bed..3292573f3 100644 --- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.h +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.h @@ -8,6 +8,7 @@ #include <QTreeView> #include "citra_qt/debugger/graphics/graphics_breakpoint_observer.h" #include "nihstro/parser_shbin.h" +#include "video_core/shader/debug_data.h" #include "video_core/shader/shader.h" class QLabel; diff --git a/src/citra_qt/debugger/ramview.cpp b/src/citra_qt/debugger/ramview.cpp deleted file mode 100644 index 10a09dda8..000000000 --- a/src/citra_qt/debugger/ramview.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include "citra_qt/debugger/ramview.h" - -GRamView::GRamView(QWidget* parent) : QHexEdit(parent) {} - -void GRamView::OnCPUStepped() { - // TODO: QHexEdit doesn't show vertical scroll bars for > 10MB data streams... - // setData(QByteArray((const char*)Mem_RAM,sizeof(Mem_RAM)/8)); -} diff --git a/src/citra_qt/debugger/ramview.h b/src/citra_qt/debugger/ramview.h deleted file mode 100644 index d01cea93b..000000000 --- a/src/citra_qt/debugger/ramview.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include "qhexedit.h" - -class GRamView : public QHexEdit { - Q_OBJECT - -public: - explicit GRamView(QWidget* parent = nullptr); - -public slots: - void OnCPUStepped(); -}; diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 6d59cf640..f765c0147 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -12,6 +12,7 @@ #include <QFileDialog> #include <QMessageBox> #include <QtGui> +#include <QtWidgets> #include "citra_qt/bootmanager.h" #include "citra_qt/config.h" #include "citra_qt/configure_dialog.h" @@ -24,7 +25,6 @@ #include "citra_qt/debugger/graphics/graphics_tracing.h" #include "citra_qt/debugger/graphics/graphics_vertex_shader.h" #include "citra_qt/debugger/profiler.h" -#include "citra_qt/debugger/ramview.h" #include "citra_qt/debugger/registers.h" #include "citra_qt/debugger/wait_tree.h" #include "citra_qt/game_list.h" @@ -46,7 +46,6 @@ #include "core/gdbstub/gdbstub.h" #include "core/loader/loader.h" #include "core/settings.h" -#include "qhexedit.h" #include "video_core/video_core.h" #ifdef QT_STATICPLUGIN |