1
0
Fork 0
forked from len0rd/rockbox

New feature for player: Jump scroll!

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3693 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Kjell Ericson 2003-05-22 06:42:14 +00:00
parent 231ddff4bd
commit 53f156a6fc
6 changed files with 114 additions and 16 deletions

View file

@ -1517,3 +1517,18 @@ id: LANG_MAX_FILES_IN_PLAYLIST
desc: in settings_menu
eng: "Max playlist size"
new:
id: LANG_JUMP_SCROLL
desc: (player) menu altarnative for jump scroll
eng: "Jump scroll"
new:
id: LANG_ONE_TIME
desc: (player) the jump scroll shall be done "one time"
eng: "One time"
new:
id: LANG_ALWAYS
desc: (player) the jump scroll shall be done "always"
eng: "Always"
new:

View file

@ -1483,3 +1483,18 @@ id: LANG_MAX_FILES_IN_PLAYLIST
desc: in settings_menu
eng: "Max playlist size"
new: "Max storlek på spellistan"
id: LANG_JUMP_SCROLL
desc: (player) menu altarnative for jump scroll
eng: "Jump scroll"
new: "Hopprullning"
id: LANG_ONE_TIME
desc: (player) the jump scroll shall be done "one time"
eng: "One time"
new: "En gång"
id: LANG_ALWAYS
desc: (player) the jump scroll shall be done "always"
eng: "Always"
new: "Alltid"

View file

@ -144,6 +144,7 @@ Rest of config block, only saved to disk:
0xF4 (int) Playlist first index
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)
*************************************/
@ -411,7 +412,9 @@ int settings_save( void )
memcpy(&config_block[0xF8], &global_settings.resume_seed, 4);
strncpy(&config_block[0xFC], global_settings.resume_file, MAX_PATH);
#ifdef HAVE_LCD_CHARCELLS
config_block[0xfd]=(unsigned char)global_settings.jump_scroll;
#endif
DEBUGF( "+Resume file %s\n",global_settings.resume_file );
DEBUGF( "+Resume index %X offset %X\n",
global_settings.resume_index,
@ -528,6 +531,8 @@ void settings_apply(void)
font_reset();
lcd_scroll_step(global_settings.scroll_step);
#else
lcd_jump_scroll(global_settings.jump_scroll);
#endif
lcd_bidir_scroll(global_settings.bidir_limit);
lcd_scroll_delay(global_settings.scroll_delay * (HZ/10));
@ -727,6 +732,10 @@ void settings_load(void)
strncpy(global_settings.lang_file, &config_block[0xcc], MAX_FILENAME);
strncpy(global_settings.font_file, &config_block[0xe0], MAX_FILENAME);
strncpy(global_settings.resume_file, &config_block[0xFC], MAX_PATH);
#ifdef HAVE_LCD_CHARSCELLS
if (config_block[0xfd] != 0xff)
global_settings.jump_scroll = config_block[0xfd];
#endif
global_settings.resume_file[MAX_PATH]=0;
}
@ -1217,6 +1226,8 @@ bool settings_save_config(void)
#ifdef HAVE_LCD_BITMAP
fprintf(fd, "scroll step: %d\r\n", global_settings.scroll_step);
#else
fprintf(fd, "jump scroll: %d\r\n", global_settings.jump_scroll);
#endif
fprintf(fd, "bidir limit: %d\r\n", global_settings.bidir_limit);
@ -1393,6 +1404,9 @@ void settings_reset(void) {
global_settings.battery_type = 0;
global_settings.scroll_speed = 8;
global_settings.bidir_limit = 50;
#ifdef HAVE_LCD_CHARCELLS
global_settings.jump_scroll = 1;
#endif
global_settings.scroll_delay = 100;
global_settings.scroll_step = 6;
global_settings.ff_rewind_min_step = DEFAULT_FF_REWIND_MIN_STEP;

View file

@ -151,7 +151,9 @@ struct user_settings
int bidir_limit; /* bidir scroll length limit */
int scroll_delay; /* delay (in 1/10s) before starting scroll */
int scroll_step; /* pixels to advance per update */
#ifdef HAVE_LCD_CHARCELLS
int jump_scroll; /* Fast jump when scrolling */
#endif
bool fade_on_stop; /* fade on pause/unpause/stop */
bool caption_backlight; /* turn on backlight at end and start of track */

View file

@ -456,6 +456,16 @@ static bool bidir_limit(void)
&lcd_bidir_scroll, 25, 0, 200 );
}
#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);
}
#endif
#ifndef SIMULATOR
/**
* Menu to set the battery capacity
@ -748,7 +758,10 @@ static bool scroll_settings_menu(void)
#ifdef HAVE_LCD_BITMAP
{ str(LANG_SCROLL_STEP), scroll_step },
#endif
{ str(LANG_BIDIR_SCROLL), bidir_limit },
{ str(LANG_BIDIR_SCROLL), bidir_limit },
#ifdef HAVE_LCD_CHARCELLS
{ str(LANG_JUMP_SCROLL), jump_scroll },
#endif
};
m = menu_init( items, sizeof items / sizeof(struct menu_items) );