diff options
| author | Björn Stenberg <bjorn@haxx.se> | 2002-12-12 15:20:37 +0000 |
|---|---|---|
| committer | Björn Stenberg <bjorn@haxx.se> | 2002-12-12 15:20:37 +0000 |
| commit | a2e98c1cd926efdbfd0fd9f43005068b7684efbe (patch) | |
| tree | 66185d3ff83eac6daa66fd9ba0cfe4f464fa19f8 /apps | |
| parent | 2950f6c1e72cf7d600dc03b8cdec162aa5ba4676 (diff) | |
| download | rockbox-a2e98c1cd926efdbfd0fd9f43005068b7684efbe.zip rockbox-a2e98c1cd926efdbfd0fd9f43005068b7684efbe.tar.gz rockbox-a2e98c1cd926efdbfd0fd9f43005068b7684efbe.tar.bz2 rockbox-a2e98c1cd926efdbfd0fd9f43005068b7684efbe.tar.xz | |
Merged Uwe Freese's bidirectional scrolling patch. Added configurable scroll step size and scroll start delay.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2974 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/lang/english.lang | 20 | ||||
| -rw-r--r-- | apps/settings.c | 25 | ||||
| -rw-r--r-- | apps/settings.h | 4 | ||||
| -rw-r--r-- | apps/settings_menu.c | 39 |
4 files changed, 85 insertions, 3 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 595e4cc..a6f1705 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -1176,3 +1176,23 @@ id: LANG_MP3BUFFER_MARGIN desc: MP3 buffer margin time eng: "Anti-skip buffer" new: + +id: LANG_BIDIR_SCROLL +desc: Bidirectional scroll limit +eng: "Bidirectional Scroll Limit" +new: + +id: LANG_SCROLL_DELAY +desc: Delay before scrolling +eng: "Scroll Start Delay" +new: + +id: LANG_SCROLL_STEP +desc: Pixels to advance per scroll +eng: "Scroll Step Size" +new: + +id: LANG_SCROLL_STEP_EXAMPLE +desc: Pixels to advance per scroll +eng: "Scroll Step Size Setting Example Text" +new: diff --git a/apps/settings.c b/apps/settings.c index 2c97e20..8f3bbbc 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -125,6 +125,9 @@ modified unless the header & checksum test fails. Rest of config block, only saved to disk: +0xB5 scroll step in pixels +0xB6 scroll start and endpoint delay +0xB7 bidir scroll setting (bidi if 0-200% longer than screen width) 0xB8 (char[20]) WPS file 0xCC (char[20]) Lang file 0xE0 (char[20]) Font file @@ -363,6 +366,10 @@ int settings_save( void ) config_block[0x29]=(unsigned char)(global_settings.topruntime >> 8); } + config_block[0xb5]=(unsigned char)global_settings.scroll_step; + config_block[0xb6]=(unsigned char)global_settings.scroll_delay; + config_block[0xb7]=(unsigned char)global_settings.bidir_limit; + strncpy(&config_block[0xb8], global_settings.wps_file, MAX_FILENAME); strncpy(&config_block[0xcc], global_settings.lang_file, MAX_FILENAME); strncpy(&config_block[0xe0], global_settings.font_file, MAX_FILENAME); @@ -481,7 +488,11 @@ void settings_apply(void) } else font_reset(); + + lcd_bidir_scroll(global_settings.bidir_limit); + lcd_scroll_step(global_settings.scroll_step); #endif + lcd_scroll_delay(global_settings.scroll_delay * (HZ/10)); if ( global_settings.lang_file[0] && global_settings.lang_file[0] != 0xff ) { @@ -489,6 +500,8 @@ void settings_apply(void) global_settings.lang_file); lang_load(buf); } + + } /* @@ -633,6 +646,15 @@ void settings_load(void) global_settings.topruntime = config_block[0x28] | (config_block[0x29] << 8); + if (config_block[0xb5] != 0xff) + global_settings.scroll_step = config_block[0xb5]; + + if (config_block[0xb6] != 0xff) + global_settings.scroll_delay = config_block[0xb6]; + + if (config_block[0xb7] != 0xff) + global_settings.bidir_limit = config_block[0xb7]; + memcpy(&global_settings.resume_first_index, &config_block[0xF4], 4); memcpy(&global_settings.resume_seed, &config_block[0xF8], 4); @@ -818,6 +840,9 @@ void settings_reset(void) { global_settings.volume_type = 0; global_settings.battery_type = 0; global_settings.scroll_speed = 8; + global_settings.bidir_limit = 50; + global_settings.scroll_delay = 500; + global_settings.scroll_step = 6; global_settings.ff_rewind_min_step = DEFAULT_FF_REWIND_MIN_STEP; global_settings.ff_rewind_accel = DEFAULT_FF_REWIND_ACCEL_SETTING; global_settings.resume_index = -1; diff --git a/apps/settings.h b/apps/settings.h index 012131e..b42b68a 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -134,6 +134,10 @@ struct user_settings int runtime; /* current runtime since last charge */ int topruntime; /* top known runtime */ + + 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 */ }; /* prototypes */ diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 4342e9b..95d3fea 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -399,10 +399,36 @@ static bool poweroff_idle_timer(void) static bool scroll_speed(void) { - return set_int(str(LANG_SCROLL), "", &global_settings.scroll_speed, - &lcd_scroll_speed, 1, 1, 30 ); + return set_int(str(LANG_SCROLL), "Hz", &global_settings.scroll_speed, + &lcd_scroll_speed, 1, 1, 10 ); } +#ifdef HAVE_LCD_BITMAP +static bool scroll_step(void) +{ + return set_int(str(LANG_SCROLL_STEP_EXAMPLE), "pixels", + &global_settings.scroll_step, + &lcd_scroll_step, 1, 1, LCD_WIDTH ); +} +#endif + +static bool scroll_delay(void) +{ + int dummy = global_settings.scroll_delay * (HZ/10); + int rc = set_int(str(LANG_SCROLL_DELAY), "ms", &dummy, + &lcd_scroll_delay, 100, 0, 2500 ); + global_settings.scroll_delay = dummy / (HZ/10); + return rc; +} + +#ifdef HAVE_LCD_BITMAP +static bool bidir_limit(void) +{ + return set_int(str(LANG_BIDIR_SCROLL), "%", &global_settings.bidir_limit, + &lcd_bidir_scroll, 25, 0, 200 ); +} +#endif + #ifdef HAVE_CHARGE_CTRL static bool deep_discharge(void) { @@ -636,7 +662,14 @@ static bool display_settings_menu(void) bool result; struct menu_items items[] = { - { str(LANG_SCROLL_MENU), scroll_speed }, + { str(LANG_SCROLL_MENU), scroll_speed }, +#ifdef HAVE_LCD_BITMAP + { str(LANG_SCROLL_STEP), scroll_step }, +#endif + { str(LANG_SCROLL_DELAY), scroll_delay }, +#ifdef HAVE_LCD_BITMAP + { str(LANG_BIDIR_SCROLL), bidir_limit }, +#endif { str(LANG_BACKLIGHT), backlight_timer }, { str(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_on_when_charging }, { str(LANG_CONTRAST), contrast }, |