1
0
Fork 0
forked from len0rd/rockbox

Now beep can be disabled.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7365 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Miika Pekkarinen 2005-08-20 21:17:41 +00:00
parent 5d0fe30feb
commit 9d7fd1804e
6 changed files with 51 additions and 2 deletions

View file

@ -37,6 +37,9 @@ void* codec_malloc(size_t size)
{ {
void* x; void* x;
if (mem_ptr + size > bufsize)
return NULL;
x=&mallocbuf[mem_ptr]; x=&mallocbuf[mem_ptr];
mem_ptr+=(size+3)&~3; /* Keep memory 32-bit aligned */ mem_ptr+=(size+3)&~3; /* Keep memory 32-bit aligned */
@ -47,6 +50,8 @@ void* codec_calloc(size_t nmemb, size_t size)
{ {
void* x; void* x;
x = codec_malloc(nmemb*size); x = codec_malloc(nmemb*size);
if (x == NULL)
return NULL;
local_rb->memset(x,0,nmemb*size); local_rb->memset(x,0,nmemb*size);
return(x); return(x);
} }

View file

@ -3262,3 +3262,27 @@ desc: in browse_id3
eng: " (VBR)" eng: " (VBR)"
voice "" voice ""
new: new:
id: LANG_BEEP
desc: in playback settings
eng: "Beep volume"
voice "Beep volume"
new:
id: LANG_WEAK
desc: in beep volume in playback settings
eng: "Weak"
voice "Weak"
new:
id: LANG_MODERATE
desc: in beep volume in playback settings
eng: "Moderate"
voice "Moderate"
new:
id: LANG_STRONG
desc: in beep volume in playback settings
eng: "Strong"
voice "Strong"
new:

View file

@ -1654,13 +1654,15 @@ void audio_thread(void)
case AUDIO_NEXT: case AUDIO_NEXT:
logf("audio_next"); logf("audio_next");
pcmbuf_beep(5000, 100, 5000); if (global_settings.beep)
pcmbuf_beep(5000, 100, 2500*global_settings.beep);
initiate_track_change(1); initiate_track_change(1);
break ; break ;
case AUDIO_PREV: case AUDIO_PREV:
logf("audio_prev"); logf("audio_prev");
pcmbuf_beep(5000, 100, 5000); if (global_settings.beep)
pcmbuf_beep(5000, 100, 2500*global_settings.beep);
initiate_track_change(-1); initiate_track_change(-1);
break; break;

View file

@ -432,6 +432,7 @@ static const struct bit_entry hd_bits[] =
{1, S_O(replaygain_track), false, "replaygain type", "track,album" }, {1, S_O(replaygain_track), false, "replaygain type", "track,album" },
{1, S_O(replaygain_noclip), false, "replaygain noclip", off_on }, {1, S_O(replaygain_noclip), false, "replaygain noclip", off_on },
{8 | SIGNED, S_O(replaygain_preamp), 0, "replaygain preamp", NULL }, {8 | SIGNED, S_O(replaygain_preamp), 0, "replaygain preamp", NULL },
{2, S_O(beep), 0, "off,weak,moderate,strong", NULL },
#endif #endif
/* If values are just added to the end, no need to bump the version. */ /* If values are just added to the end, no need to bump the version. */

View file

@ -335,6 +335,7 @@ struct user_settings
bool replaygain_track; /* true for track gain, false for album gain */ bool replaygain_track; /* true for track gain, false for album gain */
bool replaygain_noclip; /* scale to prevent clips */ bool replaygain_noclip; /* scale to prevent clips */
int replaygain_preamp; /* scale replaygained tracks by this */ int replaygain_preamp; /* scale replaygained tracks by this */
int beep; /* system beep volume when changing tracks etc. */
#endif #endif
}; };

View file

@ -1269,6 +1269,21 @@ static bool replaygain_settings_menu(void)
menu_exit(m); menu_exit(m);
return result; return result;
} }
static bool beep(void)
{
static const struct opt_items names[] = {
{ STR(LANG_OFF) },
{ STR(LANG_WEAK) },
{ STR(LANG_MODERATE) },
{ STR(LANG_STRONG) },
};
bool ret;
ret=set_option( str(LANG_BEEP),
&global_settings.beep, INT, names, 4, NULL);
return ret;
}
#endif #endif
static bool playback_settings_menu(void) static bool playback_settings_menu(void)
@ -1288,6 +1303,7 @@ static bool playback_settings_menu(void)
{ ID2P(LANG_CROSSFADE), crossfade }, { ID2P(LANG_CROSSFADE), crossfade },
{ ID2P(LANG_CROSSFADE_DURATION), crossfade_duration }, { ID2P(LANG_CROSSFADE_DURATION), crossfade_duration },
{ ID2P(LANG_REPLAYGAIN), replaygain_settings_menu }, { ID2P(LANG_REPLAYGAIN), replaygain_settings_menu },
{ ID2P(LANG_BEEP), beep },
#endif #endif
#ifdef HAVE_SPDIF_POWER #ifdef HAVE_SPDIF_POWER
{ ID2P(LANG_SPDIF_ENABLE), spdif }, { ID2P(LANG_SPDIF_ENABLE), spdif },