Skip to content

Commit aa22075

Browse files
committed
overlays: use enum for sound effects
1 parent 9deb6cd commit aa22075

14 files changed

+69
-41
lines changed

rpcs3/Emu/RSX/Overlays/FriendsList/overlay_friends_list_dialog.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "stdafx.h"
22
#include "../overlay_manager.h"
33
#include "overlay_friends_list_dialog.h"
4-
#include "Emu/System.h"
54
#include "Emu/NP/rpcn_config.h"
65
#include "Emu/vfs_config.h"
76

@@ -306,11 +305,11 @@ namespace rsx
306305
}
307306
}
308307

309-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
308+
play_sound(sound_effect::accept);
310309
return;
311310
}
312311
case pad_button::circle:
313-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
312+
play_sound(sound_effect::cancel);
314313
close_dialog = true;
315314
break;
316315
case pad_button::square:
@@ -359,7 +358,7 @@ namespace rsx
359358
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
360359
else if (!is_auto_repeat || m_auto_repeat_ms_interval >= m_auto_repeat_ms_interval_default)
361360
{
362-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
361+
play_sound(sound_effect::cursor);
363362
}
364363
}
365364

rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_message_box.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "stdafx.h"
22
#include "overlay_home_menu_message_box.h"
3-
#include "Emu/System.h"
43
#include "Emu/system_config.h"
54

65
namespace rsx
@@ -77,7 +76,7 @@ namespace rsx
7776
{
7877
case pad_button::cross:
7978
{
80-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
79+
play_sound(sound_effect::accept);
8180
if (m_on_accept)
8281
{
8382
m_on_accept();
@@ -86,7 +85,7 @@ namespace rsx
8685
}
8786
case pad_button::circle:
8887
{
89-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
88+
play_sound(sound_effect::cancel);
9089
if (m_on_cancel)
9190
{
9291
m_on_cancel();

rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_page.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ namespace rsx
160160
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
161161
if (!is_auto_repeat || auto_repeat_interval_ms >= user_interface::m_auto_repeat_ms_interval_default)
162162
{
163-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
163+
play_sound(sound_effect::accept);
164164
}
165165
return func(button_press);
166166
}
@@ -169,7 +169,7 @@ namespace rsx
169169
}
170170
case pad_button::circle:
171171
{
172-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
172+
play_sound(sound_effect::cancel);
173173
if (parent)
174174
{
175175
set_current_page(parent);
@@ -244,7 +244,7 @@ namespace rsx
244244
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
245245
if (!is_auto_repeat || auto_repeat_interval_ms >= user_interface::m_auto_repeat_ms_interval_default)
246246
{
247-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
247+
play_sound(sound_effect::cursor);
248248
}
249249
return page_navigation::stay;
250250
}

rpcs3/Emu/RSX/Overlays/Network/overlay_recvmessage_dialog.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ namespace rsx
127127
{
128128
return_code = selection_code::error;
129129
}
130-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
130+
play_sound(sound_effect::accept);
131131
close_dialog = true;
132132
break;
133133
case pad_button::circle:
134-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
134+
play_sound(sound_effect::cancel);
135135
close_dialog = true;
136136
break;
137137
case pad_button::dpad_up:
@@ -167,7 +167,7 @@ namespace rsx
167167
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
168168
else if (!is_auto_repeat || m_auto_repeat_ms_interval >= m_auto_repeat_ms_interval_default)
169169
{
170-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
170+
play_sound(sound_effect::cursor);
171171
}
172172
}
173173

rpcs3/Emu/RSX/Overlays/Network/overlay_sendmessage_dialog.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ namespace rsx
8282
if (m_list->m_items.empty() || is_auto_repeat)
8383
break;
8484

85-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
85+
play_sound(sound_effect::accept);
8686

8787
if (!get_current_selection().empty())
8888
{
@@ -95,7 +95,7 @@ namespace rsx
9595
close_dialog = true;
9696
break;
9797
case pad_button::circle:
98-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
98+
play_sound(sound_effect::cancel);
9999
close_dialog = true;
100100
break;
101101
case pad_button::dpad_up:
@@ -131,7 +131,7 @@ namespace rsx
131131
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
132132
else if (!is_auto_repeat || m_auto_repeat_ms_interval >= m_auto_repeat_ms_interval_default)
133133
{
134-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
134+
play_sound(sound_effect::cursor);
135135
}
136136
}
137137

rpcs3/Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ namespace rsx
132132
switch (button_press)
133133
{
134134
case pad_button::circle:
135-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
135+
play_sound(sound_effect::cancel);
136136
close_dialog = true;
137137
break;
138138
case pad_button::square:
@@ -172,7 +172,7 @@ namespace rsx
172172
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
173173
else if (!is_auto_repeat || m_auto_repeat_ms_interval >= m_auto_repeat_ms_interval_default)
174174
{
175-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
175+
play_sound(sound_effect::cursor);
176176
}
177177
}
178178

rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "overlay_media_list_dialog.h"
55

66
#include "Emu/Cell/Modules/cellMusic.h"
7-
#include "Emu/System.h"
87
#include "Emu/VFS.h"
98
#include "Utilities/StrUtil.h"
109
#include "Utilities/Thread.h"
@@ -154,13 +153,13 @@ namespace rsx
154153
return_code = m_list->get_selected_index();
155154
m_stop_input_loop = true;
156155
play_cursor_sound = false;
157-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
156+
play_sound(sound_effect::accept);
158157
break;
159158
case pad_button::circle:
160159
return_code = selection_code::canceled;
161160
m_stop_input_loop = true;
162161
play_cursor_sound = false;
163-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
162+
play_sound(sound_effect::cancel);
164163
break;
165164
case pad_button::dpad_up:
166165
m_list->select_previous();
@@ -182,7 +181,7 @@ namespace rsx
182181
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
183182
if (play_cursor_sound && (!is_auto_repeat || m_auto_repeat_ms_interval >= m_auto_repeat_ms_interval_default))
184183
{
185-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
184+
play_sound(sound_effect::cursor);
186185
}
187186
}
188187

rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ namespace rsx
155155
return_code = CELL_MSGDIALOG_BUTTON_YES;
156156
}
157157

158-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
158+
play_sound(sound_effect::accept);
159159
break;
160160
}
161161
case pad_button::circle:
@@ -175,7 +175,7 @@ namespace rsx
175175
return_code = CELL_MSGDIALOG_BUTTON_NO;
176176
}
177177

178-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
178+
play_sound(sound_effect::cancel);
179179
break;
180180
}
181181
default: return;
@@ -238,10 +238,7 @@ namespace rsx
238238

239239
if (!type.se_mute_on)
240240
{
241-
if (type.se_normal)
242-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_system_ok.wav");
243-
else
244-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_system_ng.wav");
241+
play_sound(type.se_normal ? sound_effect::dialog_ok : sound_effect::dialog_error);
245242
}
246243

247244
set_text(text);

rpcs3/Emu/RSX/Overlays/overlay_osk.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ namespace rsx
823823
}
824824
case pad_button::start:
825825
{
826-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_oskenter.wav");
826+
play_sound(sound_effect::osk_accept);
827827
Close(CELL_OSKDIALOG_CLOSE_CONFIRM);
828828
play_cursor_sound = false;
829829
break;
@@ -840,15 +840,15 @@ namespace rsx
840840
}
841841
case pad_button::cross:
842842
{
843-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_oskenter.wav");
843+
play_sound(sound_effect::osk_accept);
844844
on_accept();
845845
m_reset_pulse = true;
846846
play_cursor_sound = false;
847847
break;
848848
}
849849
case pad_button::circle:
850850
{
851-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_oskcancel.wav");
851+
play_sound(sound_effect::osk_cancel);
852852
Close(CELL_OSKDIALOG_CLOSE_CANCEL);
853853
play_cursor_sound = false;
854854
break;
@@ -890,7 +890,7 @@ namespace rsx
890890
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
891891
if (play_cursor_sound && (!is_auto_repeat || m_auto_repeat_ms_interval >= m_auto_repeat_ms_interval_default))
892892
{
893-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
893+
play_sound(sound_effect::cursor);
894894
}
895895

896896
if (m_reset_pulse)

rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include "overlay_save_dialog.h"
33
#include "overlay_video.h"
44
#include "Utilities/date_time.h"
5-
#include "Emu/System.h"
65

76
namespace rsx
87
{
@@ -133,11 +132,11 @@ namespace rsx
133132
if (m_no_saves)
134133
break;
135134
return_code = m_list->get_selected_index();
136-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_decide.wav");
135+
play_sound(sound_effect::accept);
137136
close_dialog = true;
138137
break;
139138
case pad_button::circle:
140-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cancel.wav");
139+
play_sound(sound_effect::cancel);
141140
close_dialog = true;
142141
break;
143142
case pad_button::dpad_up:
@@ -173,7 +172,7 @@ namespace rsx
173172
// Play a sound unless this is a fast auto repeat which would induce a nasty noise
174173
else if (!is_auto_repeat || m_auto_repeat_ms_interval >= m_auto_repeat_ms_interval_default)
175174
{
176-
Emu.GetCallbacks().play_sound(fs::get_config_dir() + "sounds/snd_cursor.wav");
175+
play_sound(sound_effect::cursor);
177176
}
178177
}
179178

0 commit comments

Comments
 (0)