mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-29 23:41:19 -06:00
fix real-time volume adjustment with game-specific configs (#4259)
This commit is contained in:
parent
cead66d3c6
commit
b12ca606c8
@ -73,8 +73,13 @@ struct Setting {
|
||||
|
||||
/// Write v to the base layer.
|
||||
/// Game-specific overrides are applied exclusively via Load(serial)
|
||||
void set(const T& v) {
|
||||
value = v;
|
||||
/// Set proper value as base or game_specific
|
||||
void set(const T& v, bool game_specific = false) {
|
||||
if (game_specific) {
|
||||
game_specific_value = v;
|
||||
} else {
|
||||
value = v;
|
||||
}
|
||||
}
|
||||
|
||||
/// Discard the game-specific override; subsequent get(Default) will
|
||||
@ -526,15 +531,15 @@ public:
|
||||
auto Get##Name() const { \
|
||||
return (group).field.get(m_configMode); \
|
||||
} \
|
||||
void Set##Name(const decltype((group).field.value)& v) { \
|
||||
(group).field.value = v; \
|
||||
void Set##Name(const decltype((group).field.value)& v, bool specific = false) { \
|
||||
(group).field.set(v, specific); \
|
||||
}
|
||||
#define SETTING_FORWARD_BOOL(group, Name, field) \
|
||||
bool Is##Name() const { \
|
||||
return (group).field.get(m_configMode); \
|
||||
} \
|
||||
void Set##Name(bool v) { \
|
||||
(group).field.value = v; \
|
||||
void Set##Name(bool v, bool specific = false) { \
|
||||
(group).field.set(v, specific); \
|
||||
}
|
||||
#define SETTING_FORWARD_BOOL_READONLY(group, Name, field) \
|
||||
bool Is##Name() const { \
|
||||
|
||||
@ -153,7 +153,7 @@ void IPC::InputLoop() {
|
||||
} else if (cmd == "ADJUST_VOLUME") {
|
||||
int value = static_cast<int>(next_u64());
|
||||
bool is_game_specific = next_u64() != 0;
|
||||
EmulatorSettings.SetVolumeSlider(value);
|
||||
EmulatorSettings.SetVolumeSlider(value, is_game_specific);
|
||||
Libraries::AudioOut::AdjustVol();
|
||||
} else if (cmd == "SET_FSR") {
|
||||
bool use_fsr = next_u64() != 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user