Finally commit FS#5111 - piezo clicker for ipods!

Origional implementation by Robert Keevil with contributions from Frederik Vestre,  Stoyan Stratev, Craig Elliott, Michael Sparmann,  Thomas Schott, Rosso Maltese, and syncs from a bunch of other people!

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30995 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2011-11-16 10:25:43 +00:00
parent b7508a766d
commit be716c0be8
20 changed files with 481 additions and 2 deletions

View file

@ -94,6 +94,10 @@
#endif
#endif
#ifdef HAVE_HARDWARE_CLICK
#include "piezo.h"
#endif
/* units used with output_dyn_value */
const unsigned char * const byte_units[] =
{
@ -873,14 +877,32 @@ void system_sound_play(enum system_sound sound)
void keyclick_click(int button)
{
/* Settings filters */
if (global_settings.keyclick &&
(global_settings.keyclick_repeats || !(button & BUTTON_REPEAT)))
if (
#ifdef HAVE_HARDWARE_CLICK
(global_settings.keyclick || global_settings.keyclick_hardware)
#else
global_settings.keyclick
#endif
&& (global_settings.keyclick_repeats || !(button & BUTTON_REPEAT)))
{
/* Button filters */
if (button != BUTTON_NONE && !(button & BUTTON_REL)
&& !(button & (SYS_EVENT|BUTTON_MULTIMEDIA)) )
{
#ifdef HAVE_HARDWARE_CLICK
if (global_settings.keyclick)
{
system_sound_play(SOUND_KEYCLICK);
}
if (global_settings.keyclick_hardware)
{
#if !defined(SIMULATOR)
piezo_button_beep(false, false);
#endif
}
#else
system_sound_play(SOUND_KEYCLICK);
#endif
}
}
}