Have mpegplayer use the mixer (the playback channel, since it's mutually exclusive to audio playback) so the clicks and skip beep can be used according to user settings. Introduce some system sound functions to make easier playing event sounds from various places and convert files calling 'beep_play' to use 'system_sound_play' and 'keyclick_click'. Event sound could be become themeable.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30130 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2011-07-08 22:31:15 +00:00
parent f1a5a25dac
commit 5663e1cd0a
10 changed files with 149 additions and 48 deletions

View file

@ -100,9 +100,6 @@ int clamp_value_wrap(int value, int max, int min);
#endif
#endif
void beep_play(unsigned int frequency, unsigned int duration,
unsigned int amplitude);
enum current_activity {
ACTIVITY_UNKNOWN = 0,
ACTIVITY_MAINMENU,
@ -118,6 +115,25 @@ enum current_activity {
ACTIVITY_PITCHSCREEN,
ACTIVITY_OPTIONSELECT
};
#if CONFIG_CODEC == SWCODEC
void beep_play(unsigned int frequency, unsigned int duration,
unsigned int amplitude);
enum system_sound
{
SOUND_KEYCLICK = 0,
SOUND_TRACK_SKIP,
SOUND_TRACK_NO_MORE,
};
/* Play a standard sound */
void system_sound_play(enum system_sound sound);
/* Produce keyclick based upon button and global settings */
void keyclick_click(int button);
#endif /* CONFIG_CODEC == SWCODEC */
void push_current_activity(enum current_activity screen);
void pop_current_activity(void);
enum current_activity get_current_activity(void);