mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
cellMusic: fix volume. Qt needs a value between 0 and 1
This commit is contained in:
parent
2b92df6320
commit
a2b2b84365
1 changed files with 4 additions and 4 deletions
|
@ -177,8 +177,8 @@ void qt_music_handler::set_volume(f32 volume)
|
|||
|
||||
Emu.BlockingCallFromMainThread([&volume, this]()
|
||||
{
|
||||
const int new_volume = std::max<int>(0, std::min<int>(volume * 100, 100));
|
||||
music_log.notice("Setting volume to %d%%", new_volume);
|
||||
const f32 new_volume = std::clamp(volume, 0.0f, 1.0f);
|
||||
music_log.notice("Setting volume to %f", new_volume);
|
||||
m_media_player->audioOutput()->setVolume(new_volume);
|
||||
});
|
||||
}
|
||||
|
@ -190,8 +190,8 @@ f32 qt_music_handler::get_volume() const
|
|||
|
||||
Emu.BlockingCallFromMainThread([&volume, this]()
|
||||
{
|
||||
volume = std::max(0.f, std::min(m_media_player->audioOutput()->volume(), 1.f));
|
||||
music_log.notice("Getting volume: %d%%", volume);
|
||||
volume = std::clamp(m_media_player->audioOutput()->volume(), 0.0f, 1.0f);
|
||||
music_log.notice("Getting volume: %f", volume);
|
||||
});
|
||||
|
||||
return volume;
|
||||
|
|
Loading…
Add table
Reference in a new issue