mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-11 06:08:34 +00:00
Volume slider that adjusts how loud games are on a global level (#3240)
* Update config.cpp * Update config.h * Update sdl_audio.cpp * Update settings_dialog.cpp * Update settings_dialog.h * Update settings_dialog.ui * Update gui_settings.h * Update audioout.cpp * Update audioout.h * Update settings_dialog.cpp * remove leftover settings_dialog.ui * Update settings_dialog.ui --------- Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
This commit is contained in:
@@ -32,6 +32,7 @@ std::filesystem::path find_fs_path_or(const basic_value<TC>& v, const K& ky,
|
||||
namespace Config {
|
||||
|
||||
// General
|
||||
static int volumeSlider = 100;
|
||||
static bool isNeo = false;
|
||||
static bool isDevKit = false;
|
||||
static bool isPSNSignedIn = false;
|
||||
@@ -108,6 +109,9 @@ static std::string trophyKey = "";
|
||||
// Expected number of items in the config file
|
||||
static constexpr u64 total_entries = 54;
|
||||
|
||||
int getVolumeSlider() {
|
||||
return volumeSlider;
|
||||
}
|
||||
bool allowHDR() {
|
||||
return isHDRAllowed;
|
||||
}
|
||||
@@ -157,6 +161,10 @@ std::filesystem::path GetSaveDataPath() {
|
||||
return save_data_path;
|
||||
}
|
||||
|
||||
void setVolumeSlider(int volumeValue) {
|
||||
volumeSlider = volumeValue;
|
||||
}
|
||||
|
||||
void setLoadGameSizeEnabled(bool enable) {
|
||||
load_game_size = enable;
|
||||
}
|
||||
@@ -611,6 +619,7 @@ void load(const std::filesystem::path& path) {
|
||||
if (data.contains("General")) {
|
||||
const toml::value& general = data.at("General");
|
||||
|
||||
volumeSlider = toml::find_or<int>(general, "volumeSlider", volumeSlider);
|
||||
isNeo = toml::find_or<bool>(general, "isPS4Pro", isNeo);
|
||||
isDevKit = toml::find_or<bool>(general, "isDevKit", isDevKit);
|
||||
isPSNSignedIn = toml::find_or<bool>(general, "isPSNSignedIn", isPSNSignedIn);
|
||||
@@ -806,6 +815,7 @@ void save(const std::filesystem::path& path) {
|
||||
fmt::print("Saving new configuration file {}\n", fmt::UTF(path.u8string()));
|
||||
}
|
||||
|
||||
data["General"]["volumeSlider"] = volumeSlider;
|
||||
data["General"]["isPS4Pro"] = isNeo;
|
||||
data["General"]["isDevKit"] = isDevKit;
|
||||
data["General"]["isPSNSignedIn"] = isPSNSignedIn;
|
||||
@@ -901,6 +911,7 @@ void save(const std::filesystem::path& path) {
|
||||
|
||||
void setDefaultValues() {
|
||||
// General
|
||||
volumeSlider = 100;
|
||||
isNeo = false;
|
||||
isDevKit = false;
|
||||
isPSNSignedIn = false;
|
||||
|
||||
Reference in New Issue
Block a user