add seperate scroll options for remote. Patch by Alexander Spyridakis which fixes bug #5348. Changes CONFIG_BLOCK_VERSION so save your settings..
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9974 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
9ad02de623
commit
a86919ae29
6 changed files with 89 additions and 47 deletions
|
@ -8515,3 +8515,17 @@
|
|||
*: "Invalid Filename"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_REMOTE_SCROLL_SETS
|
||||
desc: "Remote Scrolling Options" Submenu in "Scrolling Options" menu
|
||||
user:
|
||||
<source>
|
||||
*: "Remote Scrolling Options"
|
||||
</source>
|
||||
<dest>
|
||||
*: "Remote Scrolling Options"
|
||||
</dest>
|
||||
<voice>
|
||||
*: "Remote Scrolling Options"
|
||||
</voice>
|
||||
</phrase>
|
||||
|
|
|
@ -147,6 +147,8 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
|
|||
screen->drawline=&lcd_drawline;
|
||||
screen->vline=&lcd_vline;
|
||||
screen->hline=&lcd_hline;
|
||||
screen->scroll_speed=&lcd_scroll_speed;
|
||||
screen->scroll_delay=&lcd_scroll_delay;
|
||||
screen->scroll_step=&lcd_scroll_step;
|
||||
screen->invertscroll=&lcd_invertscroll;
|
||||
screen->puts_offset=&lcd_puts_offset;
|
||||
|
@ -173,8 +175,6 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
|
|||
screen->init=&lcd_init;
|
||||
screen->puts_scroll=&lcd_puts_scroll;
|
||||
screen->stop_scroll=&lcd_stop_scroll;
|
||||
screen->scroll_speed=&lcd_scroll_speed;
|
||||
screen->scroll_delay=&lcd_scroll_delay;
|
||||
screen->clear_display=&lcd_clear_display;
|
||||
#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
|
||||
screen->update=&lcd_update;
|
||||
|
@ -207,26 +207,3 @@ void screen_access_init(void)
|
|||
FOR_NB_SCREENS(i)
|
||||
screen_init(&screens[i], i);
|
||||
}
|
||||
|
||||
void screen_lcd_scroll_speed(int speed)
|
||||
{
|
||||
int i;
|
||||
FOR_NB_SCREENS(i)
|
||||
screens[i].scroll_speed(speed);
|
||||
}
|
||||
|
||||
void screen_lcd_scroll_delay(int ms)
|
||||
{
|
||||
int i;
|
||||
FOR_NB_SCREENS(i)
|
||||
screens[i].scroll_delay(ms);
|
||||
}
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
void screen_lcd_scroll_step(int pixels)
|
||||
{
|
||||
int i;
|
||||
FOR_NB_SCREENS(i)
|
||||
screens[i].scroll_step(pixels);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -185,13 +185,4 @@ extern void screen_access_init(void);
|
|||
*/
|
||||
extern struct screen screens[NB_SCREENS];
|
||||
|
||||
|
||||
/*
|
||||
* Functions to apply LCD settings across all screens
|
||||
*/
|
||||
void screen_lcd_scroll_speed(int speed);
|
||||
void screen_lcd_scroll_delay(int ms);
|
||||
void screen_lcd_scroll_step(int pixels);
|
||||
|
||||
|
||||
#endif /*_SCREEN_ACCESS_H_*/
|
||||
|
|
|
@ -94,7 +94,7 @@ const char rec_base_directory[] = REC_BASE_DIR;
|
|||
#include "dsp.h"
|
||||
#endif
|
||||
|
||||
#define CONFIG_BLOCK_VERSION 43
|
||||
#define CONFIG_BLOCK_VERSION 44
|
||||
#define CONFIG_BLOCK_SIZE 512
|
||||
#define RTC_BLOCK_SIZE 44
|
||||
|
||||
|
@ -359,6 +359,13 @@ static const struct bit_entry hd_bits[] =
|
|||
{4, S_O(scroll_speed), 9, "scroll speed", NULL }, /* 0...15 */
|
||||
{8, S_O(scroll_delay), 100, "scroll delay", NULL }, /* 0...250 */
|
||||
{8, S_O(bidir_limit), 50, "bidir limit", NULL }, /* 0...200 */
|
||||
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
{4, S_O(remote_scroll_speed), 9, "remote scroll speed", NULL }, /* 0...15 */
|
||||
{8, S_O(remote_scroll_step), 6, "remote scroll step", NULL }, /* 1...160 */
|
||||
{8, S_O(remote_scroll_delay), 100, "remote scroll delay", NULL }, /* 0...250 */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
{1, S_O(offset_out_of_view), false, "Screen Scrolls Out Of View", off_on },
|
||||
#if LCD_WIDTH > 255
|
||||
|
@ -1004,9 +1011,9 @@ void settings_apply(void)
|
|||
lcd_remote_set_contrast(global_settings.remote_contrast);
|
||||
lcd_remote_set_invert_display(global_settings.remote_invert);
|
||||
lcd_remote_set_flip(global_settings.remote_flip_display);
|
||||
lcd_remote_scroll_speed(global_settings.scroll_speed);
|
||||
lcd_remote_scroll_step(global_settings.scroll_step);
|
||||
lcd_remote_scroll_delay(global_settings.scroll_delay * (HZ/10));
|
||||
lcd_remote_scroll_speed(global_settings.remote_scroll_speed);
|
||||
lcd_remote_scroll_step(global_settings.remote_scroll_step);
|
||||
lcd_remote_scroll_delay(global_settings.remote_scroll_delay * (HZ/10));
|
||||
#ifdef HAVE_REMOTE_LCD_TICKING
|
||||
lcd_remote_emireduce(global_settings.remote_reduce_ticking);
|
||||
#endif
|
||||
|
|
|
@ -301,7 +301,6 @@ struct user_settings
|
|||
int volume_type; /* how volume is displayed: 0=graphic, 1=percent */
|
||||
int battery_display; /* how battery is displayed: 0=graphic, 1=percent */
|
||||
int timeformat; /* time format: 0=24 hour clock, 1=12 hour clock */
|
||||
int scroll_speed; /* long texts scrolling speed: 1-30 */
|
||||
bool playlist_shuffle;
|
||||
bool play_selected; /* Plays selected file even in shuffle mode */
|
||||
int ff_rewind_min_step; /* FF/Rewind minimum step size */
|
||||
|
@ -334,9 +333,16 @@ struct user_settings
|
|||
int runtime; /* current runtime since last charge */
|
||||
int topruntime; /* top known runtime */
|
||||
|
||||
int scroll_speed; /* long texts scrolling speed: 1-30 */
|
||||
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_REMOTE_LCD
|
||||
int remote_scroll_speed; /* long texts scrolling speed: 1-30 */
|
||||
int remote_scroll_delay; /* delay (in 1/10s) before starting scroll */
|
||||
int remote_scroll_step; /* pixels to advance per update */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
bool offset_out_of_view;
|
||||
int screen_scroll_step;
|
||||
|
|
|
@ -55,7 +55,6 @@
|
|||
#include "yesno.h"
|
||||
#include "list.h"
|
||||
#include "color_picker.h"
|
||||
#include "screen_access.h"
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
#include "peakmeter.h"
|
||||
|
@ -843,7 +842,7 @@ static bool scroll_speed(void)
|
|||
{
|
||||
return set_int(str(LANG_SCROLL), "", UNIT_INT,
|
||||
&global_settings.scroll_speed,
|
||||
&screen_lcd_scroll_speed, 1, 0, 15, NULL );
|
||||
&lcd_scroll_speed, 1, 0, 15, NULL );
|
||||
}
|
||||
|
||||
static bool scroll_delay(void)
|
||||
|
@ -851,11 +850,37 @@ static bool scroll_delay(void)
|
|||
int dummy = global_settings.scroll_delay * (HZ/10);
|
||||
int rc = set_int(str(LANG_SCROLL_DELAY), "ms", UNIT_MS,
|
||||
&dummy,
|
||||
&screen_lcd_scroll_delay, 100, 0, 2500, NULL );
|
||||
&lcd_scroll_delay, 100, 0, 2500, NULL );
|
||||
global_settings.scroll_delay = dummy / (HZ/10);
|
||||
return rc;
|
||||
}
|
||||
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
static bool remote_scroll_speed(void)
|
||||
{
|
||||
return set_int(str(LANG_SCROLL), "", UNIT_INT,
|
||||
&global_settings.remote_scroll_speed,
|
||||
&lcd_remote_scroll_speed, 1, 0, 15, NULL );
|
||||
}
|
||||
|
||||
static bool remote_scroll_step(void)
|
||||
{
|
||||
return set_int(str(LANG_SCROLL_STEP_EXAMPLE), str(LANG_PIXELS), UNIT_PIXEL,
|
||||
&global_settings.remote_scroll_step,
|
||||
&lcd_remote_scroll_step, 1, 1, LCD_WIDTH, NULL );
|
||||
}
|
||||
|
||||
static bool remote_scroll_delay(void)
|
||||
{
|
||||
int dummy = global_settings.remote_scroll_delay * (HZ/10);
|
||||
int rc = set_int(str(LANG_SCROLL_DELAY), "ms", UNIT_MS,
|
||||
&dummy,
|
||||
&lcd_remote_scroll_delay, 100, 0, 2500, NULL );
|
||||
global_settings.remote_scroll_delay = dummy / (HZ/10);
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
static bool screen_scroll(void)
|
||||
{
|
||||
|
@ -875,7 +900,7 @@ static bool scroll_step(void)
|
|||
{
|
||||
return set_int(str(LANG_SCROLL_STEP_EXAMPLE), str(LANG_PIXELS), UNIT_PIXEL,
|
||||
&global_settings.scroll_step,
|
||||
&screen_lcd_scroll_step, 1, 1, LCD_WIDTH, NULL );
|
||||
&lcd_scroll_step, 1, 1, LCD_WIDTH, NULL );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1645,6 +1670,25 @@ static bool fileview_settings_menu(void)
|
|||
return result;
|
||||
}
|
||||
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
static bool remote_scroll_sets(void)
|
||||
{
|
||||
int m;
|
||||
bool result;
|
||||
|
||||
static const struct menu_item items[] = {
|
||||
{ ID2P(LANG_SCROLL_SPEED), remote_scroll_speed },
|
||||
{ ID2P(LANG_SCROLL_DELAY), remote_scroll_delay },
|
||||
{ ID2P(LANG_SCROLL_STEP), remote_scroll_step },
|
||||
};
|
||||
|
||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
||||
NULL, NULL, NULL);
|
||||
result = menu_run(m);
|
||||
menu_exit(m);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
static bool scroll_settings_menu(void)
|
||||
{
|
||||
|
@ -1656,6 +1700,9 @@ static bool scroll_settings_menu(void)
|
|||
{ ID2P(LANG_SCROLL_DELAY), scroll_delay },
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
{ ID2P(LANG_SCROLL_STEP), scroll_step },
|
||||
#endif
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
{ ID2P(LANG_REMOTE_SCROLL_SETS), remote_scroll_sets },
|
||||
#endif
|
||||
{ ID2P(LANG_BIDIR_SCROLL), bidir_limit },
|
||||
#ifdef HAVE_LCD_CHARCELLS
|
||||
|
|
Loading…
Reference in a new issue