[XMP] Make volume atomic, fixed issue with invalid SetVolume received from guest
- Replaced invalid log
This commit is contained in:
@@ -688,6 +688,9 @@ void EmulatorWindow::XMPConfigDialog::OnDraw(ImGuiIO& io) {
|
||||
}
|
||||
}
|
||||
|
||||
volume_ =
|
||||
emulator_window_.emulator_->audio_media_player()->GetVolume()->load();
|
||||
|
||||
if (ImGui::SliderFloat("Audio player volume", &volume_, 0.0f, 1.0f)) {
|
||||
audio_player->SetVolume(volume_);
|
||||
}
|
||||
|
||||
@@ -215,7 +215,9 @@ class EmulatorWindow {
|
||||
EmulatorWindow& emulator_window)
|
||||
: ui::ImGuiDialog(imgui_drawer), emulator_window_(emulator_window) {
|
||||
if (emulator_window_.emulator_->audio_media_player()) {
|
||||
volume_ = emulator_window_.emulator_->audio_media_player()->GetVolume();
|
||||
volume_ = emulator_window_.emulator_->audio_media_player()
|
||||
->GetVolume()
|
||||
->load();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user