overlays: add system sounds

This commit is contained in:
Megamouse 2021-10-31 00:48:41 +02:00
parent 59b1c324a9
commit ff5e31f396
8 changed files with 37 additions and 9 deletions

View file

@ -124,6 +124,7 @@ namespace rsx
return_code = CELL_MSGDIALOG_BUTTON_YES; return_code = CELL_MSGDIALOG_BUTTON_YES;
} }
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_system_ok.wav");
break; break;
} }
case pad_button::circle: case pad_button::circle:
@ -143,6 +144,7 @@ namespace rsx
return_code = CELL_MSGDIALOG_BUTTON_NO; return_code = CELL_MSGDIALOG_BUTTON_NO;
} }
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
break; break;
} }
default: return; default: return;

View file

@ -420,6 +420,8 @@ namespace rsx
} }
}; };
bool play_cursor_sound = true;
switch (button_press) switch (button_press)
{ {
case pad_button::L1: case pad_button::L1:
@ -522,7 +524,9 @@ namespace rsx
} }
case pad_button::start: case pad_button::start:
{ {
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_system_ok.wav");
Close(CELL_OSKDIALOG_CLOSE_CONFIRM); Close(CELL_OSKDIALOG_CLOSE_CONFIRM);
play_cursor_sound = false;
break; break;
} }
case pad_button::triangle: case pad_button::triangle:
@ -537,13 +541,17 @@ namespace rsx
} }
case pad_button::cross: case pad_button::cross:
{ {
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
on_accept(); on_accept();
m_reset_pulse = true; m_reset_pulse = true;
play_cursor_sound = false;
break; break;
} }
case pad_button::circle: case pad_button::circle:
{ {
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
Close(CELL_OSKDIALOG_CLOSE_CANCEL); Close(CELL_OSKDIALOG_CLOSE_CANCEL);
play_cursor_sound = false;
break; break;
} }
case pad_button::L2: case pad_button::L2:
@ -560,6 +568,11 @@ namespace rsx
break; break;
} }
if (play_cursor_sound)
{
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
}
if (m_reset_pulse) if (m_reset_pulse)
{ {
m_update = true; m_update = true;

View file

@ -1,6 +1,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "overlay_save_dialog.h" #include "overlay_save_dialog.h"
#include "Utilities/date_time.h" #include "Utilities/date_time.h"
#include "Emu/System.h"
namespace rsx namespace rsx
{ {
@ -120,10 +121,13 @@ namespace rsx
if (m_no_saves) if (m_no_saves)
break; break;
return_code = m_list->get_selected_index(); return_code = m_list->get_selected_index();
[[fallthrough]]; Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_system_ok.wav");
case pad_button::circle:
close(true, true); close(true, true);
break; return;
case pad_button::circle:
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
close(true, true);
return;
case pad_button::dpad_up: case pad_button::dpad_up:
m_list->select_previous(); m_list->select_previous();
break; break;
@ -140,6 +144,8 @@ namespace rsx
rsx_log.trace("[ui] Button %d pressed", static_cast<u8>(button_press)); rsx_log.trace("[ui] Button %d pressed", static_cast<u8>(button_press));
break; break;
} }
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
} }
compiled_resource save_dialog::get_compiled() compiled_resource save_dialog::get_compiled()

View file

@ -71,7 +71,7 @@ namespace rsx
{ {
// First tick // First tick
creation_time = t; creation_time = t;
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/trophy.wav"); Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_trophy.wav");
return; return;
} }

View file

@ -2,6 +2,7 @@
#include "overlay_user_list_dialog.h" #include "overlay_user_list_dialog.h"
#include "Emu/vfs_config.h" #include "Emu/vfs_config.h"
#include "Emu/system_utils.hpp" #include "Emu/system_utils.hpp"
#include "Emu/System.h"
#include "Utilities/StrUtil.h" #include "Utilities/StrUtil.h"
#include "Utilities/Thread.h" #include "Utilities/Thread.h"
@ -98,10 +99,13 @@ namespace rsx
{ {
return_code = selection_code::error; return_code = selection_code::error;
} }
[[fallthrough]]; Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_system_ok.wav");
case pad_button::circle:
close(true, true); close(true, true);
break; return;
case pad_button::circle:
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
close(true, true);
return;
case pad_button::dpad_up: case pad_button::dpad_up:
m_list->select_previous(); m_list->select_previous();
break; break;
@ -118,6 +122,8 @@ namespace rsx
rsx_log.trace("[ui] Button %d pressed", static_cast<u8>(button_press)); rsx_log.trace("[ui] Button %d pressed", static_cast<u8>(button_press));
break; break;
} }
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
} }
compiled_resource user_list_dialog::get_compiled() compiled_resource user_list_dialog::get_compiled()

View file

@ -277,6 +277,7 @@ void Emulator::Init(bool add_only)
make_path_verbose(fs::get_cache_dir() + "shaderlog/"); make_path_verbose(fs::get_cache_dir() + "shaderlog/");
make_path_verbose(fs::get_cache_dir() + "spu_progs/"); make_path_verbose(fs::get_cache_dir() + "spu_progs/");
make_path_verbose(fs::get_config_dir() + "captures/"); make_path_verbose(fs::get_config_dir() + "captures/");
make_path_verbose(fs::get_config_dir() + "sounds/");
make_path_verbose(patch_engine::get_patches_path()); make_path_verbose(patch_engine::get_patches_path());
if (add_only) if (add_only)

View file

@ -722,7 +722,7 @@ void gs_frame::take_screenshot(std::vector<u8> data, const u32 sshot_width, cons
// Play a sound // Play a sound
Emu.CallAfter([]() Emu.CallAfter([]()
{ {
if (const std::string sound_path = fs::get_config_dir() + "sounds/screenshot.wav"; fs::is_file(sound_path)) if (const std::string sound_path = fs::get_config_dir() + "sounds/snd_screenshot.wav"; fs::is_file(sound_path))
{ {
QSound::play(qstr(sound_path)); QSound::play(qstr(sound_path));
} }

View file

@ -29,7 +29,7 @@ s32 trophy_notification_helper::ShowTrophyNotification(const SceNpTrophyDetails&
trophy_notification->move(m_game_window->mapToGlobal(QPoint(0, 0))); trophy_notification->move(m_game_window->mapToGlobal(QPoint(0, 0)));
trophy_notification->show(); trophy_notification->show();
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/trophy.wav"); Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_trophy.wav");
}); });
return 0; return 0;