mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-06 09:39:55 +00:00
Qt: add sound-effect to screenshots
This commit is contained in:
parent
5e436984a2
commit
d5ca9dacb6
@ -12,12 +12,13 @@
|
||||
#include "Emu/Cell/Modules/cellScreenshot.h"
|
||||
#include "Emu/RSX/rsx_utils.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QApplication>
|
||||
#include <QDateTime>
|
||||
#include <QKeyEvent>
|
||||
#include <QMessageBox>
|
||||
#include <QPainter>
|
||||
#include <QScreen>
|
||||
#include <QSound>
|
||||
|
||||
#include <string>
|
||||
#include <thread>
|
||||
@ -715,6 +716,19 @@ void gs_frame::take_screenshot(std::vector<u8> 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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user