forked from len0rd/rockbox
Add a option to skip length which lets you skip 5s before the end of a song, which can be useful on gapless albums.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23229 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
88b1efd925
commit
a7c888c48e
3 changed files with 40 additions and 10 deletions
|
@ -71,7 +71,7 @@
|
|||
#define RESTORE_WPS_INSTANTLY 0l
|
||||
#define RESTORE_WPS_NEXT_SECOND ((long)(HZ+current_tick))
|
||||
/* in milliseconds */
|
||||
#define DEFAULT_SKIP_TRESH 3000ul
|
||||
#define DEFAULT_SKIP_TRESH 3000l
|
||||
|
||||
|
||||
#define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */
|
||||
|
@ -494,11 +494,26 @@ static void next_track(void)
|
|||
|
||||
static void play_hop(int direction)
|
||||
{
|
||||
unsigned long step = ((unsigned long)global_settings.skip_length)*1000;
|
||||
unsigned long elapsed = wps_state.id3->elapsed;
|
||||
unsigned long remaining = wps_state.id3->length - elapsed;
|
||||
long step = global_settings.skip_length*1000;
|
||||
long elapsed = wps_state.id3->elapsed;
|
||||
long remaining = wps_state.id3->length - elapsed;
|
||||
|
||||
if (!global_settings.prevent_skip &&
|
||||
if (step < 0)
|
||||
{
|
||||
if (direction < 0)
|
||||
{
|
||||
prev_track(DEFAULT_SKIP_TRESH);
|
||||
return;
|
||||
}
|
||||
else if (remaining < DEFAULT_SKIP_TRESH*2)
|
||||
{
|
||||
next_track();
|
||||
return;
|
||||
}
|
||||
else
|
||||
elapsed += (remaining - DEFAULT_SKIP_TRESH*2);
|
||||
}
|
||||
else if (!global_settings.prevent_skip &&
|
||||
(!step ||
|
||||
(direction > 0 && step >= remaining) ||
|
||||
(direction < 0 && elapsed < DEFAULT_SKIP_TRESH)))
|
||||
|
@ -509,8 +524,7 @@ static void play_hop(int direction)
|
|||
prev_track(DEFAULT_SKIP_TRESH);
|
||||
return;
|
||||
}
|
||||
|
||||
if (direction == 1 && step >= remaining)
|
||||
else if (direction == 1 && step >= remaining)
|
||||
{
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
if(global_settings.beep)
|
||||
|
|
|
@ -13075,3 +13075,17 @@
|
|||
swcodec: "Release Time"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_SKIP_OUTRO
|
||||
desc: skipping to the 5 seconds before the end of a track
|
||||
user: core
|
||||
<source>
|
||||
*: "Skip to Outro"
|
||||
</source>
|
||||
<dest>
|
||||
*: "Skip to Outro"
|
||||
</dest>
|
||||
<voice>
|
||||
*: "Skip to Outro"
|
||||
</voice>
|
||||
</phrase>
|
||||
|
|
|
@ -291,7 +291,9 @@ static const char* formatter_unit_0_is_skip_track(char *buffer, size_t buffer_si
|
|||
int val, const char *unit)
|
||||
{
|
||||
(void)unit;
|
||||
if (val == 0)
|
||||
if (val == -1)
|
||||
return str(LANG_SKIP_OUTRO);
|
||||
else if (val == 0)
|
||||
return str(LANG_SKIP_TRACK);
|
||||
else if (val % 60 == 0)
|
||||
snprintf(buffer, buffer_size, "%d min", val/60);
|
||||
|
@ -1459,10 +1461,10 @@ const struct settings_list settings[] = {
|
|||
NULL),
|
||||
TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, skip_length,
|
||||
LANG_SKIP_LENGTH, 0, "skip length",
|
||||
"track,1s,2s,3s,5s,7s,10s,15s,20s,30s,45s,1min,90s,2min,3min,5min,10min,15min",
|
||||
"outro,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),
|
||||
19, -1,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,"
|
||||
#ifdef HAVE_TAGCACHE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue