yuzu qt: Remove global system instances from config, WaitTree, main
This commit is contained in:
parent
d40819cfb1
commit
3aec34df0a
69 changed files with 688 additions and 636 deletions
|
|
@ -37,17 +37,14 @@ constexpr std::array<std::array<bool, 4>, 8> led_patterns{{
|
|||
}};
|
||||
|
||||
void UpdateController(Settings::ControllerType controller_type, std::size_t npad_index,
|
||||
bool connected) {
|
||||
Core::System& system{Core::System::GetInstance()};
|
||||
|
||||
bool connected, Core::System& system) {
|
||||
if (!system.IsPoweredOn()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Service::SM::ServiceManager& sm = system.ServiceManager();
|
||||
|
||||
auto& npad =
|
||||
sm.GetService<Service::HID::Hid>("hid")
|
||||
system.ServiceManager()
|
||||
.GetService<Service::HID::Hid>("hid")
|
||||
->GetAppletResource()
|
||||
->GetController<Service::HID::Controller_NPad>(Service::HID::HidController::NPad);
|
||||
|
||||
|
|
@ -79,10 +76,10 @@ bool IsControllerCompatible(Settings::ControllerType controller_type,
|
|||
|
||||
QtControllerSelectorDialog::QtControllerSelectorDialog(
|
||||
QWidget* parent, Core::Frontend::ControllerParameters parameters_,
|
||||
InputCommon::InputSubsystem* input_subsystem_)
|
||||
InputCommon::InputSubsystem* input_subsystem_, Core::System& system_)
|
||||
: QDialog(parent), ui(std::make_unique<Ui::QtControllerSelectorDialog>()),
|
||||
parameters(std::move(parameters_)), input_subsystem{input_subsystem_},
|
||||
input_profiles(std::make_unique<InputProfiles>()) {
|
||||
input_profiles(std::make_unique<InputProfiles>(system_)), system{system_} {
|
||||
ui->setupUi(this);
|
||||
|
||||
player_widgets = {
|
||||
|
|
@ -245,7 +242,7 @@ int QtControllerSelectorDialog::exec() {
|
|||
void QtControllerSelectorDialog::ApplyConfiguration() {
|
||||
const bool pre_docked_mode = Settings::values.use_docked_mode.GetValue();
|
||||
Settings::values.use_docked_mode.SetValue(ui->radioDocked->isChecked());
|
||||
OnDockedModeChanged(pre_docked_mode, Settings::values.use_docked_mode.GetValue());
|
||||
OnDockedModeChanged(pre_docked_mode, Settings::values.use_docked_mode.GetValue(), system);
|
||||
|
||||
Settings::values.vibration_enabled.SetValue(ui->vibrationGroup->isChecked());
|
||||
Settings::values.motion_enabled.SetValue(ui->motionGroup->isChecked());
|
||||
|
|
@ -293,7 +290,7 @@ void QtControllerSelectorDialog::CallConfigureMotionTouchDialog() {
|
|||
}
|
||||
|
||||
void QtControllerSelectorDialog::CallConfigureInputProfileDialog() {
|
||||
ConfigureInputProfileDialog dialog(this, input_subsystem, input_profiles.get());
|
||||
ConfigureInputProfileDialog dialog(this, input_subsystem, input_profiles.get(), system);
|
||||
|
||||
dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint |
|
||||
Qt::WindowSystemMenuHint);
|
||||
|
|
@ -533,7 +530,7 @@ void QtControllerSelectorDialog::UpdateControllerState(std::size_t player_index)
|
|||
}
|
||||
|
||||
// Disconnect the controller first.
|
||||
UpdateController(controller_type, player_index, false);
|
||||
UpdateController(controller_type, player_index, false, system);
|
||||
|
||||
player.controller_type = controller_type;
|
||||
player.connected = player_connected;
|
||||
|
|
@ -548,7 +545,7 @@ void QtControllerSelectorDialog::UpdateControllerState(std::size_t player_index)
|
|||
}
|
||||
handheld.connected = player_groupboxes[player_index]->isChecked() &&
|
||||
controller_type == Settings::ControllerType::Handheld;
|
||||
UpdateController(Settings::ControllerType::Handheld, 8, handheld.connected);
|
||||
UpdateController(Settings::ControllerType::Handheld, 8, handheld.connected, system);
|
||||
}
|
||||
|
||||
if (!player.connected) {
|
||||
|
|
@ -560,7 +557,7 @@ void QtControllerSelectorDialog::UpdateControllerState(std::size_t player_index)
|
|||
using namespace std::chrono_literals;
|
||||
std::this_thread::sleep_for(60ms);
|
||||
|
||||
UpdateController(controller_type, player_index, player_connected);
|
||||
UpdateController(controller_type, player_index, player_connected, system);
|
||||
}
|
||||
|
||||
void QtControllerSelectorDialog::UpdateLEDPattern(std::size_t player_index) {
|
||||
|
|
@ -659,7 +656,8 @@ void QtControllerSelectorDialog::DisableUnsupportedPlayers() {
|
|||
for (std::size_t index = max_supported_players; index < NUM_PLAYERS; ++index) {
|
||||
// Disconnect any unsupported players here and disable or hide them if applicable.
|
||||
Settings::values.players.GetValue()[index].connected = false;
|
||||
UpdateController(Settings::values.players.GetValue()[index].controller_type, index, false);
|
||||
UpdateController(Settings::values.players.GetValue()[index].controller_type, index, false,
|
||||
system);
|
||||
// Hide the player widgets when max_supported_controllers is less than or equal to 4.
|
||||
if (max_supported_players <= 4) {
|
||||
player_widgets[index]->hide();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include <array>
|
||||
#include <memory>
|
||||
#include <QDialog>
|
||||
#include "core/core.h"
|
||||
#include "core/frontend/applets/controller.h"
|
||||
|
||||
class GMainWindow;
|
||||
|
|
@ -36,7 +37,8 @@ class QtControllerSelectorDialog final : public QDialog {
|
|||
public:
|
||||
explicit QtControllerSelectorDialog(QWidget* parent,
|
||||
Core::Frontend::ControllerParameters parameters_,
|
||||
InputCommon::InputSubsystem* input_subsystem_);
|
||||
InputCommon::InputSubsystem* input_subsystem_,
|
||||
Core::System& system_);
|
||||
~QtControllerSelectorDialog() override;
|
||||
|
||||
int exec() override;
|
||||
|
|
@ -103,6 +105,8 @@ private:
|
|||
|
||||
std::unique_ptr<InputProfiles> input_profiles;
|
||||
|
||||
Core::System& system;
|
||||
|
||||
// This is true if and only if all parameters are met. Otherwise, this is false.
|
||||
// This determines whether the "OK" button can be clicked to exit the applet.
|
||||
bool parameters_met{false};
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
#include "yuzu/bootmanager.h"
|
||||
#include "yuzu/main.h"
|
||||
|
||||
EmuThread::EmuThread() = default;
|
||||
EmuThread::EmuThread(Core::System& system_) : system{system_} {}
|
||||
|
||||
EmuThread::~EmuThread() = default;
|
||||
|
||||
|
|
@ -51,7 +51,6 @@ void EmuThread::run() {
|
|||
MicroProfileOnThreadCreate(name.c_str());
|
||||
Common::SetCurrentThreadName(name.c_str());
|
||||
|
||||
auto& system = Core::System::GetInstance();
|
||||
auto& gpu = system.GPU();
|
||||
auto stop_token = stop_source.get_token();
|
||||
|
||||
|
|
@ -285,8 +284,10 @@ static Core::Frontend::EmuWindow::WindowSystemInfo GetWindowSystemInfo(QWindow*
|
|||
}
|
||||
|
||||
GRenderWindow::GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_,
|
||||
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_)
|
||||
: QWidget(parent), emu_thread(emu_thread_), input_subsystem{std::move(input_subsystem_)} {
|
||||
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_,
|
||||
Core::System& system_)
|
||||
: QWidget(parent),
|
||||
emu_thread(emu_thread_), input_subsystem{std::move(input_subsystem_)}, system{system_} {
|
||||
setWindowTitle(QStringLiteral("yuzu %1 | %2-%3")
|
||||
.arg(QString::fromUtf8(Common::g_build_name),
|
||||
QString::fromUtf8(Common::g_scm_branch),
|
||||
|
|
@ -629,8 +630,7 @@ void GRenderWindow::ReleaseRenderTarget() {
|
|||
}
|
||||
|
||||
void GRenderWindow::CaptureScreenshot(u32 res_scale, const QString& screenshot_path) {
|
||||
auto& renderer = Core::System::GetInstance().Renderer();
|
||||
|
||||
VideoCore::RendererBase& renderer = system.Renderer();
|
||||
if (res_scale == 0) {
|
||||
res_scale = VideoCore::GetResolutionScaleFactor(renderer);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,13 +34,14 @@ enum class MouseButton;
|
|||
|
||||
namespace VideoCore {
|
||||
enum class LoadCallbackStage;
|
||||
}
|
||||
class RendererBase;
|
||||
} // namespace VideoCore
|
||||
|
||||
class EmuThread final : public QThread {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EmuThread();
|
||||
explicit EmuThread(Core::System& system_);
|
||||
~EmuThread() override;
|
||||
|
||||
/**
|
||||
|
|
@ -101,6 +102,7 @@ private:
|
|||
std::condition_variable_any running_cv;
|
||||
Common::Event running_wait{};
|
||||
std::atomic_bool running_guard{false};
|
||||
Core::System& system;
|
||||
|
||||
signals:
|
||||
/**
|
||||
|
|
@ -131,7 +133,8 @@ class GRenderWindow : public QWidget, public Core::Frontend::EmuWindow {
|
|||
|
||||
public:
|
||||
explicit GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_,
|
||||
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_);
|
||||
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_,
|
||||
Core::System& system_);
|
||||
~GRenderWindow() override;
|
||||
|
||||
// EmuWindow implementation.
|
||||
|
|
@ -232,6 +235,8 @@ private:
|
|||
|
||||
std::array<std::size_t, 16> touch_ids{};
|
||||
|
||||
Core::System& system;
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent* event) override;
|
||||
bool eventFilter(QObject* object, QEvent* event) override;
|
||||
|
|
|
|||
|
|
@ -8,14 +8,13 @@
|
|||
#include <QtConcurrent/qtconcurrentrun.h>
|
||||
#include "common/logging/log.h"
|
||||
#include "common/telemetry.h"
|
||||
#include "core/core.h"
|
||||
#include "core/telemetry_session.h"
|
||||
#include "ui_compatdb.h"
|
||||
#include "yuzu/compatdb.h"
|
||||
|
||||
CompatDB::CompatDB(QWidget* parent)
|
||||
CompatDB::CompatDB(Core::TelemetrySession& telemetry_session_, QWidget* parent)
|
||||
: QWizard(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint),
|
||||
ui{std::make_unique<Ui::CompatDB>()} {
|
||||
ui{std::make_unique<Ui::CompatDB>()}, telemetry_session{telemetry_session_} {
|
||||
ui->setupUi(this);
|
||||
connect(ui->radioButton_Perfect, &QRadioButton::clicked, this, &CompatDB::EnableNext);
|
||||
connect(ui->radioButton_Great, &QRadioButton::clicked, this, &CompatDB::EnableNext);
|
||||
|
|
@ -53,16 +52,15 @@ void CompatDB::Submit() {
|
|||
case CompatDBPage::Final:
|
||||
back();
|
||||
LOG_DEBUG(Frontend, "Compatibility Rating: {}", compatibility->checkedId());
|
||||
Core::System::GetInstance().TelemetrySession().AddField(
|
||||
Common::Telemetry::FieldType::UserFeedback, "Compatibility",
|
||||
compatibility->checkedId());
|
||||
telemetry_session.AddField(Common::Telemetry::FieldType::UserFeedback, "Compatibility",
|
||||
compatibility->checkedId());
|
||||
|
||||
button(NextButton)->setEnabled(false);
|
||||
button(NextButton)->setText(tr("Submitting"));
|
||||
button(CancelButton)->setVisible(false);
|
||||
|
||||
testcase_watcher.setFuture(QtConcurrent::run(
|
||||
[] { return Core::System::GetInstance().TelemetrySession().SubmitTestcase(); }));
|
||||
testcase_watcher.setFuture(
|
||||
QtConcurrent::run([this] { return telemetry_session.SubmitTestcase(); }));
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR(Frontend, "Unexpected page: {}", currentId());
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include <memory>
|
||||
#include <QFutureWatcher>
|
||||
#include <QWizard>
|
||||
#include "core/telemetry_session.h"
|
||||
|
||||
namespace Ui {
|
||||
class CompatDB;
|
||||
|
|
@ -16,7 +17,7 @@ class CompatDB : public QWizard {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CompatDB(QWidget* parent = nullptr);
|
||||
explicit CompatDB(Core::TelemetrySession& telemetry_session_, QWidget* parent = nullptr);
|
||||
~CompatDB();
|
||||
|
||||
private:
|
||||
|
|
@ -27,4 +28,6 @@ private:
|
|||
void Submit();
|
||||
void OnTestcaseSubmitted();
|
||||
void EnableNext();
|
||||
|
||||
Core::TelemetrySession& telemetry_session;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@
|
|||
|
||||
namespace FS = Common::FS;
|
||||
|
||||
Config::Config(const std::string& config_name, ConfigType config_type) : type(config_type) {
|
||||
Config::Config(Core::System& system_, const std::string& config_name, ConfigType config_type)
|
||||
: type(config_type), system{system_} {
|
||||
global = config_type == ConfigType::GlobalConfig;
|
||||
|
||||
Initialize(config_name);
|
||||
|
|
@ -1593,7 +1594,7 @@ void Config::Reload() {
|
|||
ReadValues();
|
||||
// To apply default value changes
|
||||
SaveValues();
|
||||
Core::System::GetInstance().ApplySettings();
|
||||
system.ApplySettings();
|
||||
}
|
||||
|
||||
void Config::Save() {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@
|
|||
|
||||
class QSettings;
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
class Config {
|
||||
public:
|
||||
enum class ConfigType {
|
||||
|
|
@ -22,7 +26,7 @@ public:
|
|||
InputProfile,
|
||||
};
|
||||
|
||||
explicit Config(const std::string& config_name = "qt-config",
|
||||
explicit Config(Core::System& system_, const std::string& config_name = "qt-config",
|
||||
ConfigType config_type = ConfigType::GlobalConfig);
|
||||
~Config();
|
||||
|
||||
|
|
@ -176,6 +180,8 @@ private:
|
|||
std::unique_ptr<QSettings> qt_config;
|
||||
std::string qt_config_loc;
|
||||
bool global;
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
// These metatype declarations cannot be in common/settings.h because core is devoid of QT
|
||||
|
|
|
|||
|
|
@ -41,120 +41,8 @@
|
|||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>11</number>
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<widget class="ConfigureGeneral" name="generalTab">
|
||||
<property name="accessibleName">
|
||||
<string>General</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>General</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureUi" name="uiTab">
|
||||
<property name="accessibleName">
|
||||
<string>UI</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Game List</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureSystem" name="systemTab">
|
||||
<property name="accessibleName">
|
||||
<string>System</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>System</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureProfileManager" name="profileManagerTab">
|
||||
<property name="accessibleName">
|
||||
<string>Profiles</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Profiles</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureFilesystem" name="filesystemTab">
|
||||
<property name="accessibleName">
|
||||
<string>Filesystem</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Filesystem</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureInput" name="inputTab">
|
||||
<property name="accessibleName">
|
||||
<string>Controls</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Controls</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureHotkeys" name="hotkeysTab">
|
||||
<property name="accessibleName">
|
||||
<string>Hotkeys</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Hotkeys</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureCpu" name="cpuTab">
|
||||
<property name="accessibleName">
|
||||
<string>CPU</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>CPU</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureGraphics" name="graphicsTab">
|
||||
<property name="accessibleName">
|
||||
<string>Graphics</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Graphics</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureGraphicsAdvanced" name="graphicsAdvancedTab">
|
||||
<property name="accessibleName">
|
||||
<string>Advanced</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>GraphicsAdvanced</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureAudio" name="audioTab">
|
||||
<property name="accessibleName">
|
||||
<string>Audio</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Audio</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureDebugTab" name="debugTab">
|
||||
<property name="accessibleName">
|
||||
<string>Debug</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Debug</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureWeb" name="webTab">
|
||||
<property name="accessibleName">
|
||||
<string>Web</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Web</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureNetwork" name="networkTab">
|
||||
<property name="accessibleName">
|
||||
<string>Network</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Network</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
@ -168,92 +56,6 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ConfigureGeneral</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configuration/configure_general.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureSystem</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configuration/configure_system.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureProfileManager</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configuration/configure_profile_manager.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureFilesystem</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configuration/configure_filesystem.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureAudio</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configuration/configure_audio.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureCpu</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configuration/configure_cpu.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureGraphics</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configuration/configure_graphics.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureGraphicsAdvanced</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configuration/configure_graphics_advanced.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureWeb</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configuration/configure_web.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureUi</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configuration/configure_ui.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureInput</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configuration/configure_input.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureHotkeys</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configuration/configure_hotkeys.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureNetwork</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configuration/configure_network.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureDebugTab</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configuration/configure_debug_tab.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@
|
|||
#include "yuzu/configuration/configuration_shared.h"
|
||||
#include "yuzu/configuration/configure_audio.h"
|
||||
|
||||
ConfigureAudio::ConfigureAudio(QWidget* parent)
|
||||
: QWidget(parent), ui(std::make_unique<Ui::ConfigureAudio>()) {
|
||||
ConfigureAudio::ConfigureAudio(Core::System& system_, QWidget* parent)
|
||||
: QWidget(parent), ui(std::make_unique<Ui::ConfigureAudio>()), system{system_} {
|
||||
ui->setupUi(this);
|
||||
|
||||
InitializeAudioOutputSinkComboBox();
|
||||
|
|
@ -32,7 +32,7 @@ ConfigureAudio::ConfigureAudio(QWidget* parent)
|
|||
|
||||
SetConfiguration();
|
||||
|
||||
const bool is_powered_on = Core::System::GetInstance().IsPoweredOn();
|
||||
const bool is_powered_on = system.IsPoweredOn();
|
||||
ui->output_sink_combo_box->setEnabled(!is_powered_on);
|
||||
ui->audio_device_combo_box->setEnabled(!is_powered_on);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@
|
|||
#include <memory>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace ConfigurationShared {
|
||||
enum class CheckState;
|
||||
}
|
||||
|
|
@ -19,10 +23,11 @@ class ConfigureAudio : public QWidget {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureAudio(QWidget* parent = nullptr);
|
||||
explicit ConfigureAudio(Core::System& system_, QWidget* parent = nullptr);
|
||||
~ConfigureAudio() override;
|
||||
|
||||
void ApplyConfiguration();
|
||||
void SetConfiguration();
|
||||
|
||||
private:
|
||||
void changeEvent(QEvent* event) override;
|
||||
|
|
@ -33,7 +38,6 @@ private:
|
|||
|
||||
void UpdateAudioDevices(int sink_index);
|
||||
|
||||
void SetConfiguration();
|
||||
void SetOutputSinkFromSinkID();
|
||||
void SetAudioDeviceFromDeviceID();
|
||||
void SetVolumeIndicatorText(int percentage);
|
||||
|
|
@ -41,4 +45,6 @@ private:
|
|||
void SetupPerGameUI();
|
||||
|
||||
std::unique_ptr<Ui::ConfigureAudio> ui;
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@
|
|||
<height>368</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string>Audio</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@
|
|||
#include "yuzu/configuration/configuration_shared.h"
|
||||
#include "yuzu/configuration/configure_cpu.h"
|
||||
|
||||
ConfigureCpu::ConfigureCpu(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureCpu) {
|
||||
ConfigureCpu::ConfigureCpu(Core::System& system_, QWidget* parent)
|
||||
: QWidget(parent), ui(new Ui::ConfigureCpu), system{system_} {
|
||||
ui->setupUi(this);
|
||||
|
||||
SetupPerGameUI();
|
||||
|
|
@ -27,7 +28,7 @@ ConfigureCpu::ConfigureCpu(QWidget* parent) : QWidget(parent), ui(new Ui::Config
|
|||
ConfigureCpu::~ConfigureCpu() = default;
|
||||
|
||||
void ConfigureCpu::SetConfiguration() {
|
||||
const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
|
||||
const bool runtime_lock = !system.IsPoweredOn();
|
||||
|
||||
ui->accuracy->setEnabled(runtime_lock);
|
||||
ui->cpuopt_unsafe_unfuse_fma->setEnabled(runtime_lock);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@
|
|||
#include <QWidget>
|
||||
#include "common/settings.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace ConfigurationShared {
|
||||
enum class CheckState;
|
||||
}
|
||||
|
|
@ -20,10 +24,11 @@ class ConfigureCpu : public QWidget {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureCpu(QWidget* parent = nullptr);
|
||||
explicit ConfigureCpu(Core::System& system_, QWidget* parent = nullptr);
|
||||
~ConfigureCpu() override;
|
||||
|
||||
void ApplyConfiguration();
|
||||
void SetConfiguration();
|
||||
|
||||
private:
|
||||
void changeEvent(QEvent* event) override;
|
||||
|
|
@ -31,8 +36,6 @@ private:
|
|||
|
||||
void UpdateGroup(int index);
|
||||
|
||||
void SetConfiguration();
|
||||
|
||||
void SetupPerGameUI();
|
||||
|
||||
std::unique_ptr<Ui::ConfigureCpu> ui;
|
||||
|
|
@ -42,4 +45,6 @@ private:
|
|||
ConfigurationShared::CheckState cpuopt_unsafe_ignore_standard_fpcr;
|
||||
ConfigurationShared::CheckState cpuopt_unsafe_inaccurate_nan;
|
||||
ConfigurationShared::CheckState cpuopt_unsafe_fastmem_check;
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,12 +7,15 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>448</width>
|
||||
<height>433</height>
|
||||
<height>439</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string>CPU</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout">
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
#include "ui_configure_cpu_debug.h"
|
||||
#include "yuzu/configuration/configure_cpu_debug.h"
|
||||
|
||||
ConfigureCpuDebug::ConfigureCpuDebug(QWidget* parent)
|
||||
: QWidget(parent), ui(new Ui::ConfigureCpuDebug) {
|
||||
ConfigureCpuDebug::ConfigureCpuDebug(Core::System& system_, QWidget* parent)
|
||||
: QWidget(parent), ui(new Ui::ConfigureCpuDebug), system{system_} {
|
||||
ui->setupUi(this);
|
||||
|
||||
SetConfiguration();
|
||||
|
|
@ -21,7 +21,7 @@ ConfigureCpuDebug::ConfigureCpuDebug(QWidget* parent)
|
|||
ConfigureCpuDebug::~ConfigureCpuDebug() = default;
|
||||
|
||||
void ConfigureCpuDebug::SetConfiguration() {
|
||||
const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
|
||||
const bool runtime_lock = !system.IsPoweredOn();
|
||||
|
||||
ui->cpuopt_page_tables->setEnabled(runtime_lock);
|
||||
ui->cpuopt_page_tables->setChecked(Settings::values.cpuopt_page_tables.GetValue());
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@
|
|||
#include <memory>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureCpuDebug;
|
||||
}
|
||||
|
|
@ -15,7 +19,7 @@ class ConfigureCpuDebug : public QWidget {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureCpuDebug(QWidget* parent = nullptr);
|
||||
explicit ConfigureCpuDebug(Core::System& system_, QWidget* parent = nullptr);
|
||||
~ConfigureCpuDebug() override;
|
||||
|
||||
void ApplyConfiguration();
|
||||
|
|
@ -27,4 +31,6 @@ private:
|
|||
void SetConfiguration();
|
||||
|
||||
std::unique_ptr<Ui::ConfigureCpuDebug> ui;
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@
|
|||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string>CPU</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout">
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@
|
|||
#include "yuzu/debugger/console.h"
|
||||
#include "yuzu/uisettings.h"
|
||||
|
||||
ConfigureDebug::ConfigureDebug(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureDebug) {
|
||||
ConfigureDebug::ConfigureDebug(Core::System& system_, QWidget* parent)
|
||||
: QWidget(parent), ui(new Ui::ConfigureDebug), system{system_} {
|
||||
ui->setupUi(this);
|
||||
SetConfiguration();
|
||||
|
||||
|
|
@ -28,7 +29,7 @@ ConfigureDebug::ConfigureDebug(QWidget* parent) : QWidget(parent), ui(new Ui::Co
|
|||
ConfigureDebug::~ConfigureDebug() = default;
|
||||
|
||||
void ConfigureDebug::SetConfiguration() {
|
||||
const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
|
||||
const bool runtime_lock = !system.IsPoweredOn();
|
||||
|
||||
ui->toggle_console->setEnabled(runtime_lock);
|
||||
ui->toggle_console->setChecked(UISettings::values.show_console.GetValue());
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@
|
|||
#include <memory>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureDebug;
|
||||
}
|
||||
|
|
@ -15,7 +19,7 @@ class ConfigureDebug : public QWidget {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureDebug(QWidget* parent = nullptr);
|
||||
explicit ConfigureDebug(Core::System& system_, QWidget* parent = nullptr);
|
||||
~ConfigureDebug() override;
|
||||
|
||||
void ApplyConfiguration();
|
||||
|
|
@ -27,4 +31,6 @@ private:
|
|||
void SetConfiguration();
|
||||
|
||||
std::unique_ptr<Ui::ConfigureDebug> ui;
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue