From d5ca9dacb64c6ca2f6ac6a540089dd3e6c47cfa3 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sun, 24 Oct 2021 11:45:56 +0200 Subject: [PATCH] Qt: add sound-effect to screenshots --- rpcs3/rpcs3qt/gs_frame.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/rpcs3/rpcs3qt/gs_frame.cpp b/rpcs3/rpcs3qt/gs_frame.cpp index 660f9974ee..badeb472c0 100644 --- a/rpcs3/rpcs3qt/gs_frame.cpp +++ b/rpcs3/rpcs3qt/gs_frame.cpp @@ -12,12 +12,13 @@ #include "Emu/Cell/Modules/cellScreenshot.h" #include "Emu/RSX/rsx_utils.h" -#include +#include #include #include #include #include #include +#include #include #include @@ -715,6 +716,19 @@ void gs_frame::take_screenshot(std::vector data, const u32 sshot_width, cons screenshot_log.success("Successfully saved cell screenshot to %s", cell_sshot_filename); } + // Play a sound + Emu.CallAfter([]() + { + if (const std::string sound_path = fs::get_config_dir() + "sounds/screenshot.wav"; fs::is_file(sound_path)) + { + QSound::play(qstr(sound_path)); + } + else + { + QApplication::beep(); + } + }); + return; }, std::move(data))