Add setting for master volume

This commit is contained in:
msuih 2018-10-20 09:05:02 +03:00 committed by Ivan
parent 6829fa0286
commit 56ea45f9d5
2 changed files with 5 additions and 2 deletions

View File

@ -478,11 +478,11 @@ error_code cellAudioPortOpen(vm::ptr<CellAudioPortParam> audioParam, vm::ptr<u32
if (attr & CELL_AUDIO_PORTATTR_INITLEVEL)
{
port->level = audioParam->level;
port->level = audioParam->level * g_cfg.audio.volume / 100.0f;
}
else
{
port->level = 1.0f;
port->level = g_cfg.audio.volume / 100.0f;
}
port->level_set.store({ port->level, 0.0f });
@ -697,6 +697,8 @@ error_code cellAudioSetPortLevel(u32 portNum, float level)
return CELL_AUDIO_ERROR_PORT_NOT_OPEN;
}
level *= g_cfg.audio.volume / 100.0f;
if (level >= 0.0f)
{
port.level_set.exchange({ level, (port.level - level) / 624.0f });

View File

@ -508,6 +508,7 @@ struct cfg_root : cfg::node
cfg::_bool downmix_to_2ch{this, "Downmix to Stereo", true};
cfg::_int<2, 128> frames{this, "Buffer Count", 32};
cfg::_int<1, 128> startt{this, "Start Threshold", 1};
cfg::_int<0, 200> volume{this, "Master Volume", 100};
} audio{this};