1
0
Fork 0
forked from len0rd/rockbox

corrected inability to reset settings

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2611 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Hak 2002-10-14 09:12:52 +00:00
parent 36dc9c1c13
commit ea8a4cfc2f

View file

@ -36,6 +36,7 @@
#include "powermgmt.h" #include "powermgmt.h"
#include "rtc.h" #include "rtc.h"
#include "ata.h" #include "ata.h"
#include "usb.h"
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
#include "peakmeter.h" #include "peakmeter.h"
#endif #endif
@ -51,7 +52,8 @@ static bool contrast(void)
/** /**
* Menu to set the hold time of normal peaks. * Menu to set the hold time of normal peaks.
*/ */
static bool peak_meter_hold(void) { static bool peak_meter_hold(void)
{
char* names[] = { str(LANG_OFF), char* names[] = { str(LANG_OFF),
"200 ms ", "300 ms ", "500 ms ", "1 s ", "2 s ", "200 ms ", "300 ms ", "500 ms ", "1 s ", "2 s ",
"3 s ", "4 s ", "5 s ", "6 s ", "7 s", "3 s ", "4 s ", "5 s ", "6 s ", "7 s",
@ -66,7 +68,8 @@ static bool peak_meter_hold(void) {
/** /**
* Menu to set the hold time of clips. * Menu to set the hold time of clips.
*/ */
static bool peak_meter_clip_hold(void) { static bool peak_meter_clip_hold(void)
{
char* names[] = { str(LANG_PM_ETERNAL), char* names[] = { str(LANG_PM_ETERNAL),
"1s ", "2s ", "3s ", "4s ", "5s ", "1s ", "2s ", "3s ", "4s ", "5s ",
"6s ", "7s ", "8s ", "9s ", "10s", "6s ", "7s ", "8s ", "9s ", "10s",
@ -74,6 +77,7 @@ static bool peak_meter_clip_hold(void) {
"60s", "90s", "2min", "3min", "5min", "60s", "90s", "2min", "3min", "5min",
"10min", "20min", "45min", "90min" "10min", "20min", "45min", "90min"
}; };
return set_option( str(LANG_PM_CLIP_HOLD), return set_option( str(LANG_PM_CLIP_HOLD),
&global_settings.peak_meter_clip_hold, names, &global_settings.peak_meter_clip_hold, names,
25, peak_meter_set_clip_hold); 25, peak_meter_set_clip_hold);
@ -82,7 +86,8 @@ static bool peak_meter_clip_hold(void) {
/** /**
* Menu to set the release time of the peak meter. * Menu to set the release time of the peak meter.
*/ */
static bool peak_meter_release(void) { static bool peak_meter_release(void)
{
return set_int( str(LANG_PM_RELEASE), str(LANG_PM_UNITS_PER_READ), return set_int( str(LANG_PM_RELEASE), str(LANG_PM_UNITS_PER_READ),
&global_settings.peak_meter_release, &global_settings.peak_meter_release,
NULL, 1, 1, LCD_WIDTH); NULL, 1, 1, LCD_WIDTH);
@ -142,6 +147,7 @@ static bool dir_filter(void)
char* names[] = { str(LANG_FILTER_ALL), char* names[] = { str(LANG_FILTER_ALL),
str(LANG_FILTER_SUPPORTED), str(LANG_FILTER_SUPPORTED),
str(LANG_FILTER_MUSIC) }; str(LANG_FILTER_MUSIC) };
return set_option( str(LANG_FILTER), &global_settings.dirfilter, return set_option( str(LANG_FILTER), &global_settings.dirfilter,
names, 3, NULL ); names, 3, NULL );
} }
@ -156,6 +162,7 @@ static bool resume(void)
char* names[] = { str(LANG_SET_BOOL_NO), char* names[] = { str(LANG_SET_BOOL_NO),
str(LANG_RESUME_SETTING_ASK), str(LANG_RESUME_SETTING_ASK),
str(LANG_SET_BOOL_YES) }; str(LANG_SET_BOOL_YES) };
return set_option( str(LANG_RESUME), &global_settings.resume, return set_option( str(LANG_RESUME), &global_settings.resume,
names, 3, NULL ); names, 3, NULL );
} }
@ -175,6 +182,7 @@ static bool backlight_timer(void)
"6s ", "7s ", "8s ", "9s ", "10s", "6s ", "7s ", "8s ", "9s ", "10s",
"15s", "20s", "25s", "30s", "45s", "15s", "20s", "25s", "30s", "45s",
"60s", "90s"}; "60s", "90s"};
return set_option(str(LANG_BACKLIGHT), &global_settings.backlight_timeout, return set_option(str(LANG_BACKLIGHT), &global_settings.backlight_timeout,
names, 19, backlight_set_timeout ); names, 19, backlight_set_timeout );
} }
@ -185,6 +193,7 @@ static bool poweroff_idle_timer(void)
"1m ", "2m ", "3m ", "4m ", "5m ", "1m ", "2m ", "3m ", "4m ", "5m ",
"6m ", "7m ", "8m ", "9m ", "10m", "6m ", "7m ", "8m ", "9m ", "10m",
"15m", "30m", "45m", "60m"}; "15m", "30m", "45m", "60m"};
return set_option(str(LANG_POWEROFF_IDLE), &global_settings.poweroff, return set_option(str(LANG_POWEROFF_IDLE), &global_settings.poweroff,
names, 15, set_poweroff_timeout); names, 15, set_poweroff_timeout);
} }
@ -290,6 +299,7 @@ static bool ff_rewind_min_step(void)
"5s", "6s", "8s", "10s", "5s", "6s", "8s", "10s",
"15s", "20s", "25s", "30s", "15s", "20s", "25s", "30s",
"45s", "60s" }; "45s", "60s" };
return set_option(str(LANG_FFRW_STEP), &global_settings.ff_rewind_min_step, return set_option(str(LANG_FFRW_STEP), &global_settings.ff_rewind_min_step,
names, 14, NULL ); names, 14, NULL );
} }
@ -300,6 +310,7 @@ static bool ff_rewind_accel(void)
"2x/4s", "2x/5s", "2x/6s", "2x/7s", "2x/4s", "2x/5s", "2x/6s", "2x/7s",
"2x/8s", "2x/9s", "2x/10s", "2x/11s", "2x/8s", "2x/9s", "2x/10s", "2x/11s",
"2x/12s", "2x/13s", "2x/14s", "2x/15s", }; "2x/12s", "2x/13s", "2x/14s", "2x/15s", };
return set_option(str(LANG_FFRW_ACCEL), &global_settings.ff_rewind_accel, return set_option(str(LANG_FFRW_ACCEL), &global_settings.ff_rewind_accel,
names, 16, NULL ); names, 16, NULL );
} }
@ -345,35 +356,52 @@ static bool playback_settings_menu(void)
static bool reset_settings(void) static bool reset_settings(void)
{ {
int button = 0; bool done=false;
int line;
lcd_clear_display(); lcd_clear_display();
#ifdef HAVE_LCD_CHARCELLS #ifdef HAVE_LCD_CHARCELLS
lcd_puts(0,0,str(LANG_RESET_ASK_PLAYER)); line = 0;
lcd_puts(0,1,str(LANG_RESET_CONFIRM_PLAYER));
#else #else
line = 1;
lcd_puts(0,0,str(LANG_RESET_ASK_RECORDER)); lcd_puts(0,0,str(LANG_RESET_ASK_RECORDER));
lcd_puts(0,1,str(LANG_RESET_CONFIRM_RECORDER));
lcd_puts(0,2,str(LANG_RESET_CANCEL_RECORDER));
#endif #endif
lcd_puts(0,line,str(LANG_RESET_CONFIRM));
lcd_puts(0,line+1,str(LANG_RESET_CANCEL));
lcd_update(); lcd_update();
button = button_get(true);
if (button == BUTTON_PLAY) { lcd_clear_display();
while(!done) {
switch(button_get(true)) {
case BUTTON_PLAY:
settings_reset(); settings_reset();
settings_apply(); settings_apply();
lcd_clear_display();
lcd_puts(0,0,str(LANG_RESET_DONE_SETTING));
lcd_puts(0,1,str(LANG_RESET_DONE_CLEAR)); lcd_puts(0,1,str(LANG_RESET_DONE_CLEAR));
lcd_update(); done = true;
sleep(HZ); break;
return(true);
} else { #ifdef HAVE_LCD_BITMAP
lcd_clear_display(); case BUTTON_OFF:
lcd_puts(0,0,str(LANG_RESET_DONE_CANCEL)); #else
lcd_update(); case BUTTON_STOP:
sleep(HZ); #endif
return(false); lcd_puts(0,1,str(LANG_RESET_DONE_CANCEL));
done = true;
break;
case SYS_USB_CONNECTED:
usb_screen();
return true;
} }
}
lcd_puts(0,0,str(LANG_RESET_DONE_SETTING));
lcd_update();
sleep(HZ);
return false;
} }
static bool fileview_settings_menu(void) static bool fileview_settings_menu(void)
@ -454,3 +482,9 @@ bool settings_menu(void)
menu_exit(m); menu_exit(m);
return result; return result;
} }
/* -----------------------------------------------------------------
* local variables:
* eval: (load-file "../firmware/rockbox-mode.el")
* end:
*/