summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/lang/english.lang5
-rw-r--r--apps/settings.c7
-rw-r--r--apps/settings.h1
-rw-r--r--apps/settings_menu.c22
4 files changed, 31 insertions, 4 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 604a77bd2e..a35db446ec 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -1532,3 +1532,8 @@ id: LANG_ALWAYS
desc: (player) the jump scroll shall be done "always"
eng: "Always"
new:
+
+id: LANG_JUMP_SCROLL_DELAY
+desc: (player) Delay before making a jump scroll
+eng: "Jump Scroll Delay"
+new:
diff --git a/apps/settings.c b/apps/settings.c
index 5c7ef7e645..5c12422056 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -145,6 +145,7 @@ Rest of config block, only saved to disk:
0xF8 (int) Playlist shuffle seed
0xFC (char[260]) Resume playlist (path/to/dir or path/to/playlist.m3u)
0xFD (char)jump scroll mode (only for player)
+0xFE (char)jump scroll delay (only for player)
*************************************/
@@ -414,6 +415,7 @@ int settings_save( void )
strncpy(&config_block[0xFC], global_settings.resume_file, MAX_PATH);
#ifdef HAVE_LCD_CHARCELLS
config_block[0xfd]=(unsigned char)global_settings.jump_scroll;
+ config_block[0xfe]=(unsigned char)global_settings.jump_scroll_delay;
#endif
DEBUGF( "+Resume file %s\n",global_settings.resume_file );
DEBUGF( "+Resume index %X offset %X\n",
@@ -533,6 +535,7 @@ void settings_apply(void)
lcd_scroll_step(global_settings.scroll_step);
#else
lcd_jump_scroll(global_settings.jump_scroll);
+ lcd_jump_scroll_delay(global_settings.jump_scroll_delay);
#endif
lcd_bidir_scroll(global_settings.bidir_limit);
lcd_scroll_delay(global_settings.scroll_delay * (HZ/10));
@@ -735,6 +738,8 @@ void settings_load(void)
#ifdef HAVE_LCD_CHARSCELLS
if (config_block[0xfd] != 0xff)
global_settings.jump_scroll = config_block[0xfd];
+ if (config_block[0xfe] != 0xff)
+ global_settings.jump_scroll_delay = config_block[0xfe];
#endif
global_settings.resume_file[MAX_PATH]=0;
}
@@ -1228,6 +1233,7 @@ bool settings_save_config(void)
fprintf(fd, "scroll step: %d\r\n", global_settings.scroll_step);
#else
fprintf(fd, "jump scroll: %d\r\n", global_settings.jump_scroll);
+ fprintf(fd, "jump scroll delay: %d\r\n", global_settings.jump_scroll_delay);
#endif
fprintf(fd, "bidir limit: %d\r\n", global_settings.bidir_limit);
@@ -1406,6 +1412,7 @@ void settings_reset(void) {
global_settings.bidir_limit = 50;
#ifdef HAVE_LCD_CHARCELLS
global_settings.jump_scroll = 1;
+ global_settings.jump_scroll_delay = 50;
#endif
global_settings.scroll_delay = 100;
global_settings.scroll_step = 6;
diff --git a/apps/settings.h b/apps/settings.h
index 2d4d9fac2f..56bba8878d 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -153,6 +153,7 @@ struct user_settings
int scroll_step; /* pixels to advance per update */
#ifdef HAVE_LCD_CHARCELLS
int jump_scroll; /* Fast jump when scrolling */
+ int jump_scroll_delay; /* Delay between jump scroll screens */
#endif
bool fade_on_stop; /* fade on pause/unpause/stop */
bool caption_backlight; /* turn on backlight at end and start of track */
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index 52b8d86aac..db6499a313 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -459,10 +459,23 @@ static bool bidir_limit(void)
#ifdef HAVE_LCD_CHARCELLS
static bool jump_scroll(void)
{
- char* names[] = { str(LANG_OFF), str(LANG_ONE_TIME), str(LANG_ALWAYS)};
-
- return set_option(str(LANG_JUMP_SCROLL), &global_settings.jump_scroll,
- names, 3, lcd_jump_scroll);
+ char* names[] = { str(LANG_OFF), str(LANG_ONE_TIME), "2",
+ "3", "4", str(LANG_ALWAYS)};
+ bool ret;
+ ret=set_option(str(LANG_JUMP_SCROLL), &global_settings.jump_scroll,
+ names, 6, lcd_jump_scroll);
+ if (!ret && global_settings.jump_scroll>=JUMP_SCROLL_ALWAYS) {
+ global_settings.jump_scroll=254; /* Nice future "safe" value */
+ }
+ return ret;
+}
+static bool jump_scroll_delay(void)
+{
+ int dummy = global_settings.jump_scroll_delay * (HZ/10);
+ int rc = set_int(str(LANG_JUMP_SCROLL_DELAY), "ms", &dummy,
+ &lcd_jump_scroll_delay, 100, 0, 2500 );
+ global_settings.jump_scroll_delay = dummy / (HZ/10);
+ return rc;
}
#endif
@@ -761,6 +774,7 @@ static bool scroll_settings_menu(void)
{ str(LANG_BIDIR_SCROLL), bidir_limit },
#ifdef HAVE_LCD_CHARCELLS
{ str(LANG_JUMP_SCROLL), jump_scroll },
+ { str(LANG_JUMP_SCROLL_DELAY), jump_scroll_delay },
#endif
};