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 });