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:
parent
5d0fe30feb
commit
9d7fd1804e
6 changed files with 51 additions and 2 deletions
|
@ -37,6 +37,9 @@ void* codec_malloc(size_t size)
|
|||
{
|
||||
void* x;
|
||||
|
||||
if (mem_ptr + size > bufsize)
|
||||
return NULL;
|
||||
|
||||
x=&mallocbuf[mem_ptr];
|
||||
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;
|
||||
x = codec_malloc(nmemb*size);
|
||||
if (x == NULL)
|
||||
return NULL;
|
||||
local_rb->memset(x,0,nmemb*size);
|
||||
return(x);
|
||||
}
|
||||
|
|
|
@ -3262,3 +3262,27 @@ desc: in browse_id3
|
|||
eng: " (VBR)"
|
||||
voice ""
|
||||
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:
|
||||
|
|
|
@ -1654,13 +1654,15 @@ void audio_thread(void)
|
|||
|
||||
case 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);
|
||||
break ;
|
||||
|
||||
case 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);
|
||||
break;
|
||||
|
||||
|
|
|
@ -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_noclip), false, "replaygain noclip", off_on },
|
||||
{8 | SIGNED, S_O(replaygain_preamp), 0, "replaygain preamp", NULL },
|
||||
{2, S_O(beep), 0, "off,weak,moderate,strong", NULL },
|
||||
#endif
|
||||
|
||||
/* If values are just added to the end, no need to bump the version. */
|
||||
|
|
|
@ -335,6 +335,7 @@ struct user_settings
|
|||
bool replaygain_track; /* true for track gain, false for album gain */
|
||||
bool replaygain_noclip; /* scale to prevent clips */
|
||||
int replaygain_preamp; /* scale replaygained tracks by this */
|
||||
int beep; /* system beep volume when changing tracks etc. */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
@ -1269,6 +1269,21 @@ static bool replaygain_settings_menu(void)
|
|||
menu_exit(m);
|
||||
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
|
||||
|
||||
static bool playback_settings_menu(void)
|
||||
|
@ -1288,6 +1303,7 @@ static bool playback_settings_menu(void)
|
|||
{ ID2P(LANG_CROSSFADE), crossfade },
|
||||
{ ID2P(LANG_CROSSFADE_DURATION), crossfade_duration },
|
||||
{ ID2P(LANG_REPLAYGAIN), replaygain_settings_menu },
|
||||
{ ID2P(LANG_BEEP), beep },
|
||||
#endif
|
||||
#ifdef HAVE_SPDIF_POWER
|
||||
{ ID2P(LANG_SPDIF_ENABLE), spdif },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue