added more settings

This commit is contained in:
georgemoralis 2025-12-25 18:15:19 +02:00
parent d6f769f0b6
commit a8f1e2e63f
5 changed files with 15 additions and 37 deletions

View File

@ -156,8 +156,6 @@ static ConfigEntry<bool> backgroundControllerInput(false);
// Audio
static ConfigEntry<string> micDevice("Default Device");
static ConfigEntry<string> mainOutputDevice("Default Device");
static ConfigEntry<string> padSpkOutputDevice("Default Device");
// GPU
static ConfigEntry<u32> windowWidth(1280);
@ -275,14 +273,6 @@ string getMicDevice() {
return micDevice.get();
}
std::string getMainOutputDevice() {
return mainOutputDevice.get();
}
std::string getPadSpkOutputDevice() {
return padSpkOutputDevice.get();
}
u32 getWindowWidth() {
return windowWidth.get();
}
@ -504,14 +494,6 @@ void setMicDevice(std::string device, bool is_game_specific) {
micDevice.set(device, is_game_specific);
}
void setMainOutputDevice(std::string device, bool is_game_specific) {
mainOutputDevice.set(device, is_game_specific);
}
void setPadSpkOutputDevice(std::string device, bool is_game_specific) {
padSpkOutputDevice.set(device, is_game_specific);
}
void setLanguage(u32 language, bool is_game_specific) {
m_language.set(language, is_game_specific);
}
@ -634,8 +616,6 @@ void load(const std::filesystem::path& path, bool is_game_specific) {
const toml::value& audio = data.at("Audio");
micDevice.setFromToml(audio, "micDevice", is_game_specific);
mainOutputDevice.setFromToml(audio, "mainOutputDevice", is_game_specific);
padSpkOutputDevice.setFromToml(audio, "padSpkOutputDevice", is_game_specific);
}
if (data.contains("GPU")) {
@ -762,8 +742,6 @@ void save(const std::filesystem::path& path, bool is_game_specific) {
usbDeviceBackend.setTomlValue(data, "Input", "usbDeviceBackend", is_game_specific);
micDevice.setTomlValue(data, "Audio", "micDevice", is_game_specific);
mainOutputDevice.setTomlValue(data, "Audio", "mainOutputDevice", is_game_specific);
padSpkOutputDevice.setTomlValue(data, "Audio", "padSpkOutputDevice", is_game_specific);
windowWidth.setTomlValue(data, "GPU", "screenWidth", is_game_specific);
windowHeight.setTomlValue(data, "GPU", "screenHeight", is_game_specific);
@ -877,10 +855,6 @@ void setDefaultValues(bool is_game_specific) {
controllerCustomColorRGB[1] = 0;
controllerCustomColorRGB[2] = 255;
// TODO: Change to be game specific
mainOutputDevice = "Default Device";
padSpkOutputDevice = "Default Device";
// GPU
shouldPatchShaders.base_value = false;
internalScreenWidth.base_value = 1280;

View File

@ -78,10 +78,6 @@ void setRdocEnabled(bool enable, bool is_game_specific = false);
void setPipelineCacheEnabled(bool enable, bool is_game_specific = false);
void setPipelineCacheArchived(bool enable, bool is_game_specific = false);
int getCursorHideTimeout();
std::string getMainOutputDevice();
void setMainOutputDevice(std::string device, bool is_game_specific = false);
std::string getPadSpkOutputDevice();
void setPadSpkOutputDevice(std::string device, bool is_game_specific = false);
std::string getMicDevice();
void setCursorHideTimeout(int newcursorHideTimeout, bool is_game_specific = false);
void setMicDevice(std::string device, bool is_game_specific = false);

View File

@ -88,10 +88,10 @@ struct GeneralSettings {
Setting<bool> psn_signed_in{false};
Setting<bool> trophy_popup_disabled{false};
Setting<double> trophy_notification_duration{6.0};
Setting<std::string> trophy_notification_side{"right"};
Setting<std::string> log_filter{""};
Setting<std::string> log_type{"sync"};
Setting<bool> show_splash{false};
Setting<std::string> trophy_notification_side{"right"};
Setting<bool> connected_to_network{false};
Setting<bool> discord_rpc_enabled{false};
@ -186,7 +186,10 @@ struct AudioSettings {
// TODO add overrides
std::vector<OverrideItem> GetOverrideableFields() const {
return std::vector<OverrideItem>{};
return std::vector<OverrideItem>{
make_override<AudioSettings>("main_output_device", &AudioSettings::main_output_device),
make_override<AudioSettings>("padSpk_output_device",
&AudioSettings::padSpk_output_device)};
}
};
@ -340,7 +343,11 @@ public:
SETTING_FORWARD(m_general, LogFilter, log_filter)
SETTING_FORWARD(m_general, LogType, log_type)
SETTING_FORWARD_BOOL(m_general, ConnectedToNetwork, connected_to_network)
SETTING_FORWARD_BOOL(m_general, DiscorRPCEnabled, discord_rpc_enabled)
SETTING_FORWARD_BOOL(m_general, DiscordRPCEnabled, discord_rpc_enabled)
// Audio settings
SETTING_FORWARD(m_audio, MainOutputDevice, main_output_device)
SETTING_FORWARD(m_audio, PadSpkOutputDevice, padSpk_output_device)
// Debug settings
SETTING_FORWARD_BOOL(m_debug, SeparateLoggingEnabled, separate_logging_enabled)

View File

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm>
@ -8,6 +8,7 @@
#include "common/config.h"
#include "common/logging/log.h"
#include "core/emulator_settings.h"
#include "core/libraries/audio/audioout.h"
#include "core/libraries/audio/audioout_backend.h"
@ -26,8 +27,8 @@ public:
// Determine port type
std::string port_name = port.type == OrbisAudioOutPort::PadSpk
? Config::getPadSpkOutputDevice()
: Config::getMainOutputDevice();
? EmulatorSettings::GetInstance()->GetPadSpkOutputDevice()
: EmulatorSettings::GetInstance()->GetMainOutputDevice();
SDL_AudioDeviceID dev_id = SDL_INVALID_AUDIODEVICEID;
if (port_name == "None") {
stream = nullptr;

View File

@ -360,7 +360,7 @@ void Emulator::Run(std::filesystem::path file, std::vector<std::string> args,
#ifdef ENABLE_DISCORD_RPC
// Discord RPC
if (EmulatorSettings::GetInstance()->IsDiscorRPCEnabled()) {
if (EmulatorSettings::GetInstance()->IsDiscordRPCEnabled()) {
auto* rpc = Common::Singleton<DiscordRPCHandler::RPC>::Instance();
if (rpc->getRPCEnabled() == false) {
rpc->init();