Skip length: restore the ability to skip by just a few seconds

(which was the point of that feature).
See r18041.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18310 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Stéphane Doyon 2008-08-18 01:03:07 +00:00
parent 50512d696d
commit 58808b6216
3 changed files with 15 additions and 7 deletions

View file

@ -164,7 +164,7 @@ void play_hop(int direction)
if(!wps_state.id3 || !wps_state.id3->length
|| global_settings.skip_length == 0)
return;
#define STEP ((unsigned)global_settings.skip_length*60*1000)
#define STEP ((unsigned)global_settings.skip_length*1000)
if(direction == 1
&& wps_state.id3->length - wps_state.id3->elapsed < STEP+1000) {
#if CONFIG_CODEC == SWCODEC

View file

@ -414,7 +414,7 @@ long gui_wps_show(void)
else if (global_settings.skip_length > 0
&& current_tick -last_right < HZ)
{
prev_track(3+global_settings.skip_length*60);
prev_track(3+global_settings.skip_length);
update_track = true;
}
else ffwd_rew(ACTION_WPS_SEEKBACK);

View file

@ -260,18 +260,24 @@ static int32_t getlang_unit_0_is_off(int value, int unit)
static void formatter_unit_0_is_skip_track(char *buffer, size_t buffer_size,
int val, const char *unit)
{
(void)unit;
if (val == 0)
strcpy(buffer, str(LANG_SKIP_TRACK));
else if (val % 60 == 0)
snprintf(buffer, buffer_size, "%d min", val/60);
else
snprintf(buffer, buffer_size, "%d %s", val, unit);
snprintf(buffer, buffer_size, "%d s", val);
}
static int32_t getlang_unit_0_is_skip_track(int value, int unit)
{
(void)unit;
if (value == 0)
return LANG_SKIP_TRACK;
else if (value % 60 == 0)
return TALK_ID(value/60, UNIT_MIN);
else
return TALK_ID(value, unit);
return TALK_ID(value, UNIT_SEC);
}
#ifdef HAVE_BACKLIGHT
@ -1252,9 +1258,11 @@ const struct settings_list settings[] = {
OFFON_SETTING(0,cuesheet,LANG_CUESHEET_ENABLE,false,"cuesheet support",
NULL),
TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, skip_length,
LANG_SKIP_LENGTH, 0, "skip length", "track",
UNIT_MIN, formatter_unit_0_is_skip_track,
getlang_unit_0_is_skip_track, NULL, 8, 0,1,2,3,4,5,10,15),
LANG_SKIP_LENGTH, 0, "skip length",
"track,1s,2s,3s,5s,7s,10s,15s,20s,30s,45s,1min,90s,2min,3min,5min,10min,15min",
UNIT_SEC, formatter_unit_0_is_skip_track,
getlang_unit_0_is_skip_track, NULL,
18, 0,1,2,3,5,7,10,15,20,30,45,60,90,120,180,300,600,900),
CHOICE_SETTING(0, start_in_screen, LANG_START_SCREEN, 1,
"start in screen", "previous,root,files,db,wps,menu,"
#ifdef HAVE_RECORDING