forked from len0rd/rockbox
Move the General Settings menu (excluding the display submenu) to the
new system. Drops another 1200bytes off the recorder build git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12295 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ffbdb25e67
commit
cd2d62c690
3 changed files with 444 additions and 696 deletions
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* __________ __ ___.
|
* __________ __ ___.
|
||||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
@ -21,13 +20,360 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <string.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
#include "action.h"
|
#include "action.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
#include "sound_menu.h"
|
#include "sound_menu.h"
|
||||||
|
#include "exported_menus.h"
|
||||||
|
#include "tree.h"
|
||||||
|
#include "tagtree.h"
|
||||||
|
#include "usb.h"
|
||||||
|
#include "splash.h"
|
||||||
|
#include "talk.h"
|
||||||
|
#include "sprintf.h"
|
||||||
|
#include "powermgmt.h"
|
||||||
|
#ifdef HAVE_ALARM_MOD
|
||||||
|
#include "alarm_menu.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "settings_menu.h"
|
/***********************************/
|
||||||
MENUITEM_FUNCTION(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS),
|
/* TAGCACHE MENU */
|
||||||
(menu_function)settings_menu, NULL);
|
#ifdef HAVE_TAGCACHE
|
||||||
|
#ifdef HAVE_TC_RAMCACHE
|
||||||
|
MENUITEM_SETTING(tagcache_ram, &global_settings.tagcache_ram, NULL);
|
||||||
|
#endif
|
||||||
|
MENUITEM_SETTING(tagcache_autoupdate, &global_settings.tagcache_autoupdate, NULL);
|
||||||
|
MENUITEM_FUNCTION(tc_init, ID2P(LANG_TAGCACHE_FORCE_UPDATE),
|
||||||
|
(int(*)(void))tagcache_rebuild, NULL);
|
||||||
|
MENUITEM_FUNCTION(tc_update, ID2P(LANG_TAGCACHE_UPDATE),
|
||||||
|
(int(*)(void))tagcache_update, NULL);
|
||||||
|
MENUITEM_SETTING(runtimedb, &global_settings.runtimedb, NULL);
|
||||||
|
MENUITEM_FUNCTION(tc_export, ID2P(LANG_TAGCACHE_EXPORT),
|
||||||
|
(int(*)(void))tagtree_export, NULL);
|
||||||
|
MENUITEM_FUNCTION(tc_import, ID2P(LANG_TAGCACHE_IMPORT),
|
||||||
|
(int(*)(void))tagtree_import, NULL);
|
||||||
|
MAKE_MENU(tagcache_menu, ID2P(LANG_TAGCACHE), 0,
|
||||||
|
#ifdef HAVE_TC_RAMCACHE
|
||||||
|
&tagcache_ram,
|
||||||
|
#endif
|
||||||
|
&tagcache_autoupdate, &tc_init, &tc_update, &runtimedb,
|
||||||
|
&tc_export, &tc_import);
|
||||||
|
#endif /* HAVE_TAGCACHE */
|
||||||
|
/* TAGCACHE MENU */
|
||||||
|
/***********************************/
|
||||||
|
|
||||||
|
/***********************************/
|
||||||
|
/* FILE VIEW MENU */
|
||||||
|
static int fileview_callback(int action,const struct menu_item_ex *this_item);
|
||||||
|
MENUITEM_SETTING(sort_case, &global_settings.sort_case, NULL);
|
||||||
|
MENUITEM_SETTING(sort_dir, &global_settings.sort_dir, fileview_callback);
|
||||||
|
MENUITEM_SETTING(sort_file, &global_settings.sort_file, fileview_callback);
|
||||||
|
MENUITEM_SETTING(dirfilter, &global_settings.dirfilter, NULL);
|
||||||
|
MENUITEM_SETTING(browse_current, &global_settings.browse_current, NULL);
|
||||||
|
MENUITEM_SETTING(show_icons, &global_settings.show_icons, NULL);
|
||||||
|
MENUITEM_SETTING(show_path_in_browser, &global_settings.show_path_in_browser, NULL);
|
||||||
|
static int fileview_callback(int action,const struct menu_item_ex *this_item)
|
||||||
|
{
|
||||||
|
static int oldval;
|
||||||
|
int *variable = this_item->variable;
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case ACTION_ENTER_MENUITEM: /* on entering an item */
|
||||||
|
oldval = *variable;
|
||||||
|
break;
|
||||||
|
case ACTION_EXIT_MENUITEM: /* on exit */
|
||||||
|
if (*variable != oldval)
|
||||||
|
reload_directory(); /* force reload if this has changed */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
|
||||||
|
MAKE_MENU(file_menu, ID2P(LANG_FILE), 0, &sort_case, &sort_dir, &sort_file,
|
||||||
|
&dirfilter, &browse_current, &show_icons, &show_path_in_browser,
|
||||||
|
#ifdef HAVE_TAGCACHE
|
||||||
|
&tagcache_menu
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
/* FILE VIEW MENU */
|
||||||
|
/***********************************/
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************/
|
||||||
|
/* SYSTEM MENU */
|
||||||
|
|
||||||
|
/* Battery */
|
||||||
|
#ifndef SIMULATOR
|
||||||
|
MENUITEM_SETTING(battery_capacity, &global_settings.battery_capacity, NULL);
|
||||||
|
MENUITEM_SETTING(battery_type, &global_settings.battery_type, NULL);
|
||||||
|
#ifdef HAVE_USB_POWER
|
||||||
|
#ifdef CONFIG_CHARGING
|
||||||
|
static int usbcharging_callback(int action,const struct menu_item_ex *this_item)
|
||||||
|
{
|
||||||
|
(void)this_item;
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case ACTION_EXIT_MENUITEM: /* on exit */
|
||||||
|
usb_charging_enable(global_settings.usb_charging);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
MENUITEM_SETTING(usb_charging, &global_settings.usb_charging, usbcharging_callback);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
MAKE_MENU(battery_menu, ID2P(LANG_BATTERY_MENU), 0,
|
||||||
|
&battery_capacity,
|
||||||
|
#if BATTERY_TYPES_COUNT > 1
|
||||||
|
&battery_type,
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_USB_POWER
|
||||||
|
#ifdef CONFIG_CHARGING
|
||||||
|
&usb_charging,
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
#endif /* SIMULATOR */
|
||||||
|
/* Disk */
|
||||||
|
#ifndef HAVE_MMC
|
||||||
|
MENUITEM_SETTING(disk_spindown, &global_settings.disk_spindown, NULL);
|
||||||
|
#ifdef HAVE_DIRCACHE
|
||||||
|
static int dircache_callback(int action,const struct menu_item_ex *this_item)
|
||||||
|
{
|
||||||
|
(void)this_item;
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case ACTION_EXIT_MENUITEM: /* on exit */
|
||||||
|
switch (global_settings.dircache)
|
||||||
|
{
|
||||||
|
case true:
|
||||||
|
if (!dircache_is_enabled())
|
||||||
|
gui_syncsplash(HZ*2, true, str(LANG_PLEASE_REBOOT));
|
||||||
|
break;
|
||||||
|
case false:
|
||||||
|
if (dircache_is_enabled())
|
||||||
|
dircache_disable();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
MENUITEM_SETTING(dircache, &global_settings.dircache, dircache_callback);
|
||||||
|
#endif
|
||||||
|
MAKE_MENU(disk_menu, ID2P(LANG_DISK_MENU), 0,
|
||||||
|
&disk_spindown,
|
||||||
|
#ifdef HAVE_DIRCACHE
|
||||||
|
&dircache,
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Time & Date */
|
||||||
|
#ifdef CONFIG_RTC
|
||||||
|
static int timedate_set(void)
|
||||||
|
{
|
||||||
|
struct tm tm;
|
||||||
|
int result;
|
||||||
|
|
||||||
|
/* Make a local copy of the time struct */
|
||||||
|
memcpy(&tm, get_time(), sizeof(struct tm));
|
||||||
|
|
||||||
|
/* do some range checks */
|
||||||
|
/* This prevents problems with time/date setting after a power loss */
|
||||||
|
if (!valid_time(&tm))
|
||||||
|
{
|
||||||
|
/* hour */
|
||||||
|
tm.tm_hour = 0;
|
||||||
|
tm.tm_min = 0;
|
||||||
|
tm.tm_sec = 0;
|
||||||
|
tm.tm_mday = 1;
|
||||||
|
tm.tm_mon = 0;
|
||||||
|
tm.tm_wday = 1;
|
||||||
|
tm.tm_year = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
result = (int)set_time_screen(str(LANG_TIME), &tm);
|
||||||
|
|
||||||
|
if(tm.tm_year != -1) {
|
||||||
|
set_time(&tm);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
MENUITEM_FUNCTION(time_set, ID2P(LANG_TIME), timedate_set, NULL);
|
||||||
|
MENUITEM_SETTING(timeformat, &global_settings.timeformat, NULL);
|
||||||
|
MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), 0, &time_set, &timeformat);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* System menu */
|
||||||
|
MENUITEM_SETTING(poweroff, &global_settings.poweroff, NULL);
|
||||||
|
|
||||||
|
/* sleep Menu */
|
||||||
|
static void sleep_timer_formatter(char* buffer, int buffer_size, int value,
|
||||||
|
const char* unit)
|
||||||
|
{
|
||||||
|
int minutes, hours;
|
||||||
|
|
||||||
|
(void) unit;
|
||||||
|
|
||||||
|
if (value) {
|
||||||
|
hours = value / 60;
|
||||||
|
minutes = value - (hours * 60);
|
||||||
|
snprintf(buffer, buffer_size, "%d:%02d", hours, minutes);
|
||||||
|
} else {
|
||||||
|
snprintf(buffer, buffer_size, "%s", str(LANG_OFF));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sleep_timer_set(int minutes)
|
||||||
|
{
|
||||||
|
set_sleep_timer(minutes * 60);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int sleep_timer(void)
|
||||||
|
{
|
||||||
|
int minutes = (get_sleep_timer() + 59) / 60; /* round up */
|
||||||
|
return (int)set_int(str(LANG_SLEEP_TIMER), "", UNIT_MIN, &minutes,
|
||||||
|
&sleep_timer_set, 5, 0, 300, sleep_timer_formatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
MENUITEM_FUNCTION(sleep_timer_call, ID2P(LANG_SLEEP_TIMER), sleep_timer, NULL);
|
||||||
|
#ifdef HAVE_ALARM_MOD
|
||||||
|
MENUITEM_FUNCTION(alarm_screen_call, ID2P(LANG_ALARM_MOD_ALARM_MENU),
|
||||||
|
(menu_function)alarm_screen, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Limits menu */
|
||||||
|
MENUITEM_SETTING(max_files_in_dir, &global_settings.max_files_in_dir, NULL);
|
||||||
|
MENUITEM_SETTING(max_files_in_playlist, &global_settings.max_files_in_playlist, NULL);
|
||||||
|
MAKE_MENU(limits_menu, ID2P(LANG_LIMITS_MENU), 0,
|
||||||
|
&max_files_in_dir, &max_files_in_playlist);
|
||||||
|
|
||||||
|
#if CONFIG_CODEC == MAS3507D
|
||||||
|
void dac_line_in(bool enable);
|
||||||
|
static int linein_callback(int action,const struct menu_item_ex *this_item)
|
||||||
|
{
|
||||||
|
(void)this_item;
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case ACTION_EXIT_MENUITEM: /* on exit */
|
||||||
|
#ifndef SIMULATOR
|
||||||
|
dac_line_in(global_settings.line_in);
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
MENUITEM_SETTING(line_in, &global_settings.line_in, linein_callback);
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_CHARGING
|
||||||
|
MENUITEM_SETTING(car_adapter_mode, &global_settings.car_adapter_mode, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
MAKE_MENU(system_menu, ID2P(LANG_SYSTEM), 0,
|
||||||
|
#ifndef SIMULATOR
|
||||||
|
&battery_menu,
|
||||||
|
#endif
|
||||||
|
#ifndef HAVE_MMC
|
||||||
|
&disk_menu,
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_RTC
|
||||||
|
&time_menu,
|
||||||
|
#endif
|
||||||
|
&poweroff,
|
||||||
|
&sleep_timer_call,
|
||||||
|
#ifdef HAVE_ALARM_MOD
|
||||||
|
&alarm_screen_call,
|
||||||
|
#endif
|
||||||
|
&limits_menu,
|
||||||
|
#if CONFIG_CODEC == MAS3507D
|
||||||
|
&line_in,
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_CHARGING
|
||||||
|
&car_adapter_mode,
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
|
/* SYSTEM MENU */
|
||||||
|
/***********************************/
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************/
|
||||||
|
/* BOOKMARK MENU */
|
||||||
|
static int bmark_callback(int action,const struct menu_item_ex *this_item)
|
||||||
|
{
|
||||||
|
(void)this_item;
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case ACTION_EXIT_MENUITEM: /* on exit */
|
||||||
|
if(global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_YES ||
|
||||||
|
global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_ASK)
|
||||||
|
{
|
||||||
|
if(global_settings.usemrb == BOOKMARK_NO)
|
||||||
|
global_settings.usemrb = BOOKMARK_YES;
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
MENUITEM_SETTING(autocreatebookmark,
|
||||||
|
&global_settings.autocreatebookmark, bmark_callback);
|
||||||
|
MENUITEM_SETTING(autoloadbookmark, &global_settings.autoloadbookmark, NULL);
|
||||||
|
MENUITEM_SETTING(usemrb, &global_settings.usemrb, NULL);
|
||||||
|
MAKE_MENU(bookmark_settings_menu, ID2P(LANG_BOOKMARK_SETTINGS), 0,
|
||||||
|
&autocreatebookmark, &autoloadbookmark, &usemrb);
|
||||||
|
/* BOOKMARK MENU */
|
||||||
|
/***********************************/
|
||||||
|
|
||||||
|
/***********************************/
|
||||||
|
/* VOICE MENU */
|
||||||
|
static int talk_callback(int action,const struct menu_item_ex *this_item);
|
||||||
|
MENUITEM_SETTING(talk_menu, &global_settings.talk_menu, NULL);
|
||||||
|
MENUITEM_SETTING(talk_dir, &global_settings.talk_dir, talk_callback);
|
||||||
|
MENUITEM_SETTING(talk_file_item, &global_settings.talk_file, talk_callback);
|
||||||
|
static int talk_callback(int action,const struct menu_item_ex *this_item)
|
||||||
|
{
|
||||||
|
static int oldval = 0;
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case ACTION_ENTER_MENUITEM:
|
||||||
|
oldval = global_settings.talk_file;
|
||||||
|
break;
|
||||||
|
case ACTION_EXIT_MENUITEM:
|
||||||
|
#if CONFIG_CODEC == SWCODEC
|
||||||
|
audio_set_crossfade(global_settings.crossfade);
|
||||||
|
#endif
|
||||||
|
if (this_item == &talk_dir)
|
||||||
|
break;
|
||||||
|
if (oldval != 3 && global_settings.talk_file == 3)
|
||||||
|
{ /* force reload if newly talking thumbnails,
|
||||||
|
because the clip presence is cached only if enabled */
|
||||||
|
reload_directory();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
MAKE_MENU(voice_settings_menu, ID2P(LANG_VOICE), 0,
|
||||||
|
&talk_menu, &talk_dir, &talk_file_item);
|
||||||
|
/* VOICE MENU */
|
||||||
|
/***********************************/
|
||||||
|
|
||||||
|
/***********************************/
|
||||||
|
/* SETTINGS MENU */
|
||||||
|
static int language_browse(void)
|
||||||
|
{
|
||||||
|
return (int)rockbox_browse(LANG_DIR, SHOW_LNG);
|
||||||
|
}
|
||||||
|
MENUITEM_FUNCTION(browse_langs, ID2P(LANG_LANGUAGE), language_browse, NULL);
|
||||||
|
|
||||||
|
MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0,
|
||||||
|
&playback_menu_item, &file_menu, &display_menu, &system_menu,
|
||||||
|
&bookmark_settings_menu, &browse_langs, &voice_settings_menu );
|
||||||
|
/* SETTINGS MENU */
|
||||||
|
/***********************************/
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "ata.h"
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
#include "talk.h"
|
#include "talk.h"
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
|
@ -31,6 +32,7 @@
|
||||||
#include "mpeg.h"
|
#include "mpeg.h"
|
||||||
#include "audio.h"
|
#include "audio.h"
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
|
#include "powermgmt.h"
|
||||||
|
|
||||||
/* some sets of values which are used more than once, to save memory */
|
/* some sets of values which are used more than once, to save memory */
|
||||||
static const char off_on[] = "off,on";
|
static const char off_on[] = "off,on";
|
||||||
|
@ -107,7 +109,23 @@ static void scanaccel_formatter(char *buffer, int buffer_size,
|
||||||
else
|
else
|
||||||
snprintf(buffer, buffer_size, "2x/%ds", val);
|
snprintf(buffer, buffer_size, "2x/%ds", val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int poweroff_idle_timer_times[] = {0,1,2,3,4,5,6,7,8,9,10,15,30,45,60};
|
||||||
|
static long poweroff_idle_timer_getlang(int value)
|
||||||
|
{
|
||||||
|
if (value == 0)
|
||||||
|
return LANG_OFF;
|
||||||
|
return TALK_ID(poweroff_idle_timer_times[value], UNIT_MIN);
|
||||||
|
}
|
||||||
|
static void poweroff_idle_timer_formatter(char *buffer, int buffer_size,
|
||||||
|
int val, const char *unit)
|
||||||
|
{
|
||||||
|
(void)unit;
|
||||||
|
if (val == 0)
|
||||||
|
strcpy(buffer, str(LANG_OFF));
|
||||||
|
else
|
||||||
|
snprintf(buffer, buffer_size, "%dm", poweroff_idle_timer_times[val]);
|
||||||
|
}
|
||||||
|
|
||||||
#define NVRAM(bytes) (bytes<<F_NVRAM_MASK_SHIFT)
|
#define NVRAM(bytes) (bytes<<F_NVRAM_MASK_SHIFT)
|
||||||
/** NOTE: NVRAM_CONFIG_VERSION is in settings_list.h
|
/** NOTE: NVRAM_CONFIG_VERSION is in settings_list.h
|
||||||
|
@ -316,32 +334,43 @@ const struct settings_list settings[] = {
|
||||||
"volume display",graphic_numeric,UNUSED},
|
"volume display",graphic_numeric,UNUSED},
|
||||||
{F_T_INT,&global_settings.battery_display, LANG_BATTERY_DISPLAY, INT(0),
|
{F_T_INT,&global_settings.battery_display, LANG_BATTERY_DISPLAY, INT(0),
|
||||||
"battery display",graphic_numeric,UNUSED},
|
"battery display",graphic_numeric,UNUSED},
|
||||||
{F_T_INT,&global_settings.timeformat, LANG_TIMEFORMAT, INT(0),
|
CHOICE_SETTING(0, timeformat, LANG_TIMEFORMAT, 0,
|
||||||
"time format","24hour,12hour",UNUSED},
|
"time format", "24hour,12hour", NULL, 2,
|
||||||
|
ID2P(LANG_24_HOUR_CLOCK), ID2P(LANG_12_HOUR_CLOCK)),
|
||||||
#endif /* HAVE_LCD_BITMAP */
|
#endif /* HAVE_LCD_BITMAP */
|
||||||
OFFON_SETTING(0,show_icons, LANG_SHOW_ICONS ,true,"show icons", NULL),
|
OFFON_SETTING(0,show_icons, LANG_SHOW_ICONS ,true,"show icons", NULL),
|
||||||
/* system */
|
/* system */
|
||||||
{F_T_INT,&global_settings.poweroff,LANG_POWEROFF_IDLE, INT(10),"idle poweroff",
|
INT_SETTING_W_CFGVALS(0, poweroff, LANG_POWEROFF_IDLE, 10, "idle poweroff",
|
||||||
"off,1,2,3,4,5,6,7,8,9,10,15,30,45,60",UNUSED},
|
"off,1,2,3,4,5,6,7,8,9,10,15,30,45,60", UNIT_MIN,
|
||||||
|
0, 14, 1, poweroff_idle_timer_formatter,
|
||||||
|
poweroff_idle_timer_getlang, set_poweroff_timeout),
|
||||||
SYSTEM_SETTING(NVRAM(4),runtime,0),
|
SYSTEM_SETTING(NVRAM(4),runtime,0),
|
||||||
SYSTEM_SETTING(NVRAM(4),topruntime,0),
|
SYSTEM_SETTING(NVRAM(4),topruntime,0),
|
||||||
|
|
||||||
|
INT_SETTING(0,max_files_in_playlist,LANG_MAX_FILES_IN_PLAYLIST,
|
||||||
#if MEM > 1
|
#if MEM > 1
|
||||||
INT_SETTING(0,max_files_in_playlist,LANG_MAX_FILES_IN_PLAYLIST,10000,
|
10000,
|
||||||
"max files in playlist", UNIT_INT,1000,20000,1000,NULL,NULL,NULL),
|
|
||||||
{F_T_INT,&global_settings.max_files_in_dir,LANG_MAX_FILES_IN_DIR,
|
|
||||||
INT(400),"max files in dir",NULL,UNUSED},
|
|
||||||
#else
|
#else
|
||||||
{F_T_INT,&global_settings.max_files_in_playlist,LANG_MAX_FILES_IN_PLAYLIST,
|
400,
|
||||||
INT(1000),"max files in playlist",NULL,UNUSED},
|
#endif
|
||||||
{F_T_INT,&global_settings.max_files_in_dir,LANG_MAX_FILES_IN_DIR,
|
"max files in playlist", UNIT_INT,1000,20000,1000,NULL,NULL,NULL),
|
||||||
INT(200),"max files in dir",NULL,UNUSED},
|
INT_SETTING(0,max_files_in_dir,LANG_MAX_FILES_IN_DIR,
|
||||||
|
#if MEM > 1
|
||||||
|
1000,
|
||||||
|
#else
|
||||||
|
200,
|
||||||
|
#endif
|
||||||
|
"max files in dir", UNIT_INT,50,10000,50,NULL,NULL,NULL),
|
||||||
|
#ifndef SIMULATOR
|
||||||
|
|
||||||
|
INT_SETTING(0, battery_capacity, LANG_BATTERY_CAPACITY, BATTERY_CAPACITY_DEFAULT,
|
||||||
|
"battery capacity", UNIT_MAH,
|
||||||
|
BATTERY_CAPACITY_MIN, BATTERY_CAPACITY_MAX, BATTERY_CAPACITY_INC,
|
||||||
|
NULL, NULL, NULL),
|
||||||
#endif
|
#endif
|
||||||
{F_T_INT,&global_settings.battery_capacity,LANG_BATTERY_CAPACITY,
|
|
||||||
INT(BATTERY_CAPACITY_DEFAULT),
|
|
||||||
"battery capacity",NULL,UNUSED},
|
|
||||||
#ifdef CONFIG_CHARGING
|
#ifdef CONFIG_CHARGING
|
||||||
OFFON_SETTING(NVRAM(1), car_adapter_mode,
|
OFFON_SETTING(NVRAM(1), car_adapter_mode,
|
||||||
LANG_CAR_ADAPTER_MODE,false,"car adapter mode", NULL),
|
LANG_CAR_ADAPTER_MODE, false, "car adapter mode", NULL),
|
||||||
#endif
|
#endif
|
||||||
/* tuner */
|
/* tuner */
|
||||||
#ifdef CONFIG_TUNER
|
#ifdef CONFIG_TUNER
|
||||||
|
@ -351,8 +380,9 @@ const struct settings_list settings[] = {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BATTERY_TYPES_COUNT > 1
|
#if BATTERY_TYPES_COUNT > 1
|
||||||
{F_T_INT,&global_settings.battery_type, LANG_BATTERY_TYPE, INT(0),
|
CHOICE_SETTING(0, battery_type, LANG_BATTERY_TYPE, 0,
|
||||||
"battery type","alkaline,nimh",UNUSED},
|
"battery type","alkaline,nimh", NULL, 2,
|
||||||
|
ID2P(LANG_BATTERY_TYPE_ALKALINE), ID2P(LANG_BATTERY_TYPE_NIMH)),
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
/* remote lcd */
|
/* remote lcd */
|
||||||
|
@ -461,20 +491,26 @@ const struct settings_list settings[] = {
|
||||||
TALK_ID(30, UNIT_SEC), TALK_ID(1, UNIT_MIN), TALK_ID(2, UNIT_MIN),
|
TALK_ID(30, UNIT_SEC), TALK_ID(1, UNIT_MIN), TALK_ID(2, UNIT_MIN),
|
||||||
TALK_ID(3, UNIT_MIN), TALK_ID(5, UNIT_MIN), TALK_ID(10, UNIT_MIN)),
|
TALK_ID(3, UNIT_MIN), TALK_ID(5, UNIT_MIN), TALK_ID(10, UNIT_MIN)),
|
||||||
#else
|
#else
|
||||||
INT_SETTING(0, buffer_margin, LANG_MP3BUFFER_MARGIN, 0, "antiskip", \
|
INT_SETTING(0, buffer_margin, LANG_MP3BUFFER_MARGIN, 0, "antiskip",
|
||||||
UNIT_SEC, 0, 7, 1, NULL, NULL, audio_set_buffer_margin),
|
UNIT_SEC, 0, 7, 1, NULL, NULL, audio_set_buffer_margin),
|
||||||
#endif
|
#endif
|
||||||
/* disk */
|
/* disk */
|
||||||
#ifndef HAVE_MMC
|
#ifndef HAVE_MMC
|
||||||
|
INT_SETTING(0, disk_spindown, LANG_SPINDOWN, 5, "disk spindown",
|
||||||
|
UNIT_SEC, 3, 254, 1, NULL, NULL, ata_spindown),
|
||||||
{F_T_INT,&global_settings.disk_spindown,LANG_SPINDOWN,INT(5),"disk spindown",NULL,UNUSED},
|
{F_T_INT,&global_settings.disk_spindown,LANG_SPINDOWN,INT(5),"disk spindown",NULL,UNUSED},
|
||||||
#endif /* HAVE_MMC */
|
#endif /* HAVE_MMC */
|
||||||
/* browser */
|
/* browser */
|
||||||
{F_T_INT,&global_settings.dirfilter,LANG_FILTER,INT(SHOW_SUPPORTED),"show files",
|
CHOICE_SETTING(0, dirfilter, LANG_FILTER, SHOW_SUPPORTED, "show files",
|
||||||
"all,supported,music,playlists"
|
#ifndef HAVE_TAGCACHE
|
||||||
#ifdef HAVE_TAGCACHE
|
"all,supported,music,playlists", NULL, 4, ID2P(LANG_FILTER_ALL),
|
||||||
",id3 database"
|
ID2P(LANG_FILTER_SUPPORTED), ID2P(LANG_FILTER_MUSIC), ID2P(LANG_FILTER_PLAYLIST)
|
||||||
|
#else
|
||||||
|
"all,supported,music,playlists,id3 database", NULL, 5, ID2P(LANG_FILTER_ALL),
|
||||||
|
ID2P(LANG_FILTER_SUPPORTED), ID2P(LANG_FILTER_MUSIC),
|
||||||
|
ID2P(LANG_FILTER_PLAYLIST), ID2P(LANG_FILTER_ID3DB)
|
||||||
#endif
|
#endif
|
||||||
,UNUSED},
|
),
|
||||||
OFFON_SETTING(0,sort_case,LANG_SORT_CASE,false,"sort case",NULL),
|
OFFON_SETTING(0,sort_case,LANG_SORT_CASE,false,"sort case",NULL),
|
||||||
OFFON_SETTING(0,browse_current,LANG_FOLLOW,false,"follow playlist",NULL),
|
OFFON_SETTING(0,browse_current,LANG_FOLLOW,false,"follow playlist",NULL),
|
||||||
OFFON_SETTING(0,playlist_viewer_icons,LANG_SHOW_ICONS,true,
|
OFFON_SETTING(0,playlist_viewer_icons,LANG_SHOW_ICONS,true,
|
||||||
|
@ -487,14 +523,19 @@ const struct settings_list settings[] = {
|
||||||
"recursive directory insert", off_on_ask, NULL , 3 ,
|
"recursive directory insert", off_on_ask, NULL , 3 ,
|
||||||
ID2P(LANG_OFF), ID2P(LANG_ON), ID2P(LANG_RESUME_SETTING_ASK)),
|
ID2P(LANG_OFF), ID2P(LANG_ON), ID2P(LANG_RESUME_SETTING_ASK)),
|
||||||
/* bookmarks */
|
/* bookmarks */
|
||||||
{F_T_INT,&global_settings.autocreatebookmark,LANG_BOOKMARK_SETTINGS_AUTOCREATE,
|
CHOICE_SETTING(0, autocreatebookmark, LANG_BOOKMARK_SETTINGS_AUTOCREATE,
|
||||||
INT(BOOKMARK_NO),"autocreate bookmarks",
|
BOOKMARK_NO, "autocreate bookmarks",
|
||||||
"off,on,ask,recent only - on,recent only - ask",UNUSED},
|
"off,on,ask,recent only - on,recent only - ask", NULL, 5,
|
||||||
{F_T_INT,&global_settings.autoloadbookmark,LANG_BOOKMARK_SETTINGS_AUTOLOAD,
|
ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES),
|
||||||
INT(BOOKMARK_NO), "autoload bookmarks",off_on_ask,UNUSED},
|
ID2P(LANG_RESUME_SETTING_ASK), ID2P(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_YES),
|
||||||
{F_T_INT,&global_settings.usemrb,LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS,
|
ID2P(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_ASK)),
|
||||||
INT(BOOKMARK_NO),
|
CHOICE_SETTING(0, autoloadbookmark, LANG_BOOKMARK_SETTINGS_AUTOLOAD,
|
||||||
"use most-recent-bookmarks","off,on,unique only",UNUSED},
|
BOOKMARK_NO, "autoload bookmarks", off_on_ask, NULL, 3,
|
||||||
|
ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES), ID2P(LANG_RESUME_SETTING_ASK)),
|
||||||
|
CHOICE_SETTING(0, usemrb, LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS,
|
||||||
|
BOOKMARK_NO, "use most-recent-bookmarks", "off,on,unique only", NULL, 3,
|
||||||
|
ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES),
|
||||||
|
ID2P(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY)),
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
/* peak meter */
|
/* peak meter */
|
||||||
{F_T_INT, &global_settings.peak_meter_clip_hold, LANG_PM_CLIP_HOLD,
|
{F_T_INT, &global_settings.peak_meter_clip_hold, LANG_PM_CLIP_HOLD,
|
||||||
|
@ -526,17 +567,25 @@ const struct settings_list settings[] = {
|
||||||
OFFON_SETTING(0,line_in,LANG_LINE_IN,false,"line in",NULL),
|
OFFON_SETTING(0,line_in,LANG_LINE_IN,false,"line in",NULL),
|
||||||
#endif
|
#endif
|
||||||
/* voice */
|
/* voice */
|
||||||
{F_T_INT,&global_settings.talk_dir,LANG_VOICE_DIR,INT(0),
|
CHOICE_SETTING(0, talk_dir, LANG_VOICE_DIR, 0,
|
||||||
"talk dir",off_number_spell_hover,UNUSED},
|
"talk dir", off_number_spell_hover, NULL, 4,
|
||||||
{F_T_INT,&global_settings.talk_file,LANG_VOICE_FILE,INT(0),
|
ID2P(LANG_OFF), ID2P(LANG_VOICE_NUMBER),
|
||||||
"talk file",off_number_spell_hover,UNUSED},
|
ID2P(LANG_VOICE_SPELL), ID2P(LANG_VOICE_DIR_HOVER)),
|
||||||
OFFON_SETTING(0,talk_menu,LANG_VOICE_MENU,true,"talk menu",NULL),
|
CHOICE_SETTING(0, talk_file, LANG_VOICE_FILE, 0,
|
||||||
|
"talk file", off_number_spell_hover, NULL, 4,
|
||||||
|
ID2P(LANG_OFF), ID2P(LANG_VOICE_NUMBER),
|
||||||
|
ID2P(LANG_VOICE_SPELL), ID2P(LANG_VOICE_DIR_HOVER)),
|
||||||
|
OFFON_SETTING(F_TEMPVAR, talk_menu, LANG_VOICE_MENU, true, "talk menu", NULL),
|
||||||
|
|
||||||
/* file sorting */
|
/* file sorting */
|
||||||
{F_T_INT,&global_settings.sort_file,LANG_SORT_FILE,INT(0),
|
CHOICE_SETTING(0, sort_file, LANG_SORT_FILE, 0 ,
|
||||||
"sort files","alpha,oldest,newest,type",UNUSED},
|
"sort files", "alpha,oldest,newest,type", NULL, 4,
|
||||||
{F_T_INT,&global_settings.sort_dir,LANG_SORT_DIR,INT(0),
|
ID2P(LANG_SORT_ALPHA), ID2P(LANG_SORT_DATE),
|
||||||
"sort dirs","alpha,oldest,newest",UNUSED},
|
ID2P(LANG_SORT_DATE_REVERSE) , ID2P(LANG_SORT_TYPE)),
|
||||||
|
CHOICE_SETTING(0, sort_dir, LANG_SORT_DIR, 0 ,
|
||||||
|
"sort dirs", "alpha,oldest,newest", NULL, 3,
|
||||||
|
ID2P(LANG_SORT_ALPHA), ID2P(LANG_SORT_DATE),
|
||||||
|
ID2P(LANG_SORT_DATE_REVERSE)),
|
||||||
BOOL_SETTING(0, id3_v1_first, LANG_ID3_ORDER, false,
|
BOOL_SETTING(0, id3_v1_first, LANG_ID3_ORDER, false,
|
||||||
"id3 tag priority", "v2-v1,v1-v2",
|
"id3 tag priority", "v2-v1,v1-v2",
|
||||||
LANG_ID3_V2_FIRST, LANG_ID3_V1_FIRST, mpeg_id3_options),
|
LANG_ID3_V2_FIRST, LANG_ID3_V1_FIRST, mpeg_id3_options),
|
||||||
|
@ -798,8 +847,9 @@ const struct settings_list settings[] = {
|
||||||
|
|
||||||
OFFON_SETTING(0,hold_lr_for_scroll_in_list,-1,true,
|
OFFON_SETTING(0,hold_lr_for_scroll_in_list,-1,true,
|
||||||
"hold_lr_for_scroll_in_list",NULL),
|
"hold_lr_for_scroll_in_list",NULL),
|
||||||
{F_T_INT,&global_settings.show_path_in_browser,LANG_SHOW_PATH,INT(SHOW_PATH_OFF),
|
CHOICE_SETTING(0, show_path_in_browser, LANG_SHOW_PATH, SHOW_PATH_OFF,
|
||||||
"show path in browser","off,current directory,full path",UNUSED},
|
"show path in browser", "off,current directory,full path", NULL, 3,
|
||||||
|
ID2P(LANG_OFF), ID2P(LANG_SHOW_PATH_CURRENT), ID2P(LANG_SHOW_PATH_FULL)),
|
||||||
|
|
||||||
#ifdef HAVE_AGC
|
#ifdef HAVE_AGC
|
||||||
{F_T_INT,&global_settings.rec_agc_preset_mic,LANG_RECORD_AGC_PRESET,INT(1),
|
{F_T_INT,&global_settings.rec_agc_preset_mic,LANG_RECORD_AGC_PRESET,INT(1),
|
||||||
|
|
|
@ -66,9 +66,6 @@
|
||||||
#if CONFIG_CODEC == MAS3507D
|
#if CONFIG_CODEC == MAS3507D
|
||||||
void dac_line_in(bool enable);
|
void dac_line_in(bool enable);
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ALARM_MOD
|
|
||||||
#include "alarm_menu.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
#include "lcd-remote.h"
|
#include "lcd-remote.h"
|
||||||
|
@ -85,34 +82,6 @@ void dac_line_in(bool enable);
|
||||||
#endif
|
#endif
|
||||||
#include "menus/exported_menus.h"
|
#include "menus/exported_menus.h"
|
||||||
|
|
||||||
#ifdef CONFIG_CHARGING
|
|
||||||
static bool car_adapter_mode(void)
|
|
||||||
{
|
|
||||||
return set_bool( str(LANG_CAR_ADAPTER_MODE),
|
|
||||||
&global_settings.car_adapter_mode );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Menu to set icon visibility
|
|
||||||
*/
|
|
||||||
static bool show_icons(void)
|
|
||||||
{
|
|
||||||
return set_bool( (char *)str(LANG_SHOW_ICONS), &global_settings.show_icons );
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool show_path(void)
|
|
||||||
{
|
|
||||||
static const struct opt_items names[3] = {
|
|
||||||
{ STR(LANG_OFF) },
|
|
||||||
{ STR(LANG_SHOW_PATH_CURRENT) },
|
|
||||||
{ STR(LANG_SHOW_PATH_FULL) },
|
|
||||||
};
|
|
||||||
|
|
||||||
return set_option(str(LANG_SHOW_PATH),
|
|
||||||
&global_settings.show_path_in_browser,
|
|
||||||
INT, names, 3, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Menu to set the option to scroll paginated
|
* Menu to set the option to scroll paginated
|
||||||
|
@ -451,22 +420,6 @@ static bool reset_color(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_USB_POWER
|
|
||||||
#ifdef CONFIG_CHARGING
|
|
||||||
/**
|
|
||||||
* Menu to switch the USB charging on or off
|
|
||||||
*/
|
|
||||||
static bool usb_charging(void)
|
|
||||||
{
|
|
||||||
bool rc = set_bool(str(LANG_USB_CHARGING),
|
|
||||||
&global_settings.usb_charging);
|
|
||||||
/* if (usb_charging_enabled() != global_settings.usb_charging) */
|
|
||||||
usb_charging_enable(global_settings.usb_charging);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Menu to configure the battery display on status bar
|
* Menu to configure the battery display on status bar
|
||||||
*/
|
*/
|
||||||
|
@ -734,164 +687,6 @@ static bool peak_meter_menu(void)
|
||||||
}
|
}
|
||||||
#endif /* HAVE_LCD_BITMAP */
|
#endif /* HAVE_LCD_BITMAP */
|
||||||
|
|
||||||
static bool dir_filter(void)
|
|
||||||
{
|
|
||||||
static const struct opt_items names[] = {
|
|
||||||
{ STR(LANG_FILTER_ALL) },
|
|
||||||
{ STR(LANG_FILTER_SUPPORTED) },
|
|
||||||
{ STR(LANG_FILTER_MUSIC) },
|
|
||||||
{ STR(LANG_FILTER_PLAYLIST) },
|
|
||||||
#ifdef HAVE_TAGCACHE
|
|
||||||
{ STR(LANG_FILTER_ID3DB) }
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
#ifdef HAVE_TAGCACHE
|
|
||||||
return set_option( str(LANG_FILTER), &global_settings.dirfilter, INT,
|
|
||||||
names, 5, NULL );
|
|
||||||
#else
|
|
||||||
return set_option( str(LANG_FILTER), &global_settings.dirfilter, INT,
|
|
||||||
names, 4, NULL );
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool sort_case(void)
|
|
||||||
{
|
|
||||||
return set_bool( str(LANG_SORT_CASE), &global_settings.sort_case );
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool sort_file(void)
|
|
||||||
{
|
|
||||||
int oldval = global_settings.sort_file;
|
|
||||||
bool ret;
|
|
||||||
static const struct opt_items names[] = {
|
|
||||||
{ STR(LANG_SORT_ALPHA) },
|
|
||||||
{ STR(LANG_SORT_DATE) },
|
|
||||||
{ STR(LANG_SORT_DATE_REVERSE) },
|
|
||||||
{ STR(LANG_SORT_TYPE) }
|
|
||||||
};
|
|
||||||
ret = set_option( str(LANG_SORT_FILE), &global_settings.sort_file, INT,
|
|
||||||
names, 4, NULL );
|
|
||||||
if (global_settings.sort_file != oldval)
|
|
||||||
reload_directory(); /* force reload if this has changed */
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool sort_dir(void)
|
|
||||||
{
|
|
||||||
int oldval = global_settings.sort_dir;
|
|
||||||
bool ret;
|
|
||||||
static const struct opt_items names[] = {
|
|
||||||
{ STR(LANG_SORT_ALPHA) },
|
|
||||||
{ STR(LANG_SORT_DATE) },
|
|
||||||
{ STR(LANG_SORT_DATE_REVERSE) }
|
|
||||||
};
|
|
||||||
ret = set_option( str(LANG_SORT_DIR), &global_settings.sort_dir, INT,
|
|
||||||
names, 3, NULL );
|
|
||||||
if (global_settings.sort_dir != oldval)
|
|
||||||
reload_directory(); /* force reload if this has changed */
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool autocreatebookmark(void)
|
|
||||||
{
|
|
||||||
bool retval = false;
|
|
||||||
static const struct opt_items names[] = {
|
|
||||||
{ STR(LANG_SET_BOOL_NO) },
|
|
||||||
{ STR(LANG_SET_BOOL_YES) },
|
|
||||||
{ STR(LANG_RESUME_SETTING_ASK) },
|
|
||||||
{ STR(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_YES) },
|
|
||||||
{ STR(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_ASK) }
|
|
||||||
};
|
|
||||||
|
|
||||||
retval = set_option( str(LANG_BOOKMARK_SETTINGS_AUTOCREATE),
|
|
||||||
&global_settings.autocreatebookmark, INT,
|
|
||||||
names, 5, NULL );
|
|
||||||
if(global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_YES ||
|
|
||||||
global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_ASK)
|
|
||||||
{
|
|
||||||
if(global_settings.usemrb == BOOKMARK_NO)
|
|
||||||
global_settings.usemrb = BOOKMARK_YES;
|
|
||||||
|
|
||||||
}
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool autoloadbookmark(void)
|
|
||||||
{
|
|
||||||
static const struct opt_items names[] = {
|
|
||||||
{ STR(LANG_SET_BOOL_NO) },
|
|
||||||
{ STR(LANG_SET_BOOL_YES) },
|
|
||||||
{ STR(LANG_RESUME_SETTING_ASK) }
|
|
||||||
};
|
|
||||||
return set_option( str(LANG_BOOKMARK_SETTINGS_AUTOLOAD),
|
|
||||||
&global_settings.autoloadbookmark, INT,
|
|
||||||
names, 3, NULL );
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool useMRB(void)
|
|
||||||
{
|
|
||||||
static const struct opt_items names[] = {
|
|
||||||
{ STR(LANG_SET_BOOL_NO) },
|
|
||||||
{ STR(LANG_SET_BOOL_YES) },
|
|
||||||
{ STR(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY) }
|
|
||||||
};
|
|
||||||
return set_option( str(LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS),
|
|
||||||
&global_settings.usemrb, INT,
|
|
||||||
names, 3, NULL );
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool poweroff_idle_timer(void)
|
|
||||||
{
|
|
||||||
static const struct opt_items names[] = {
|
|
||||||
{ STR(LANG_OFF) },
|
|
||||||
{ "1m ", TALK_ID(1, UNIT_MIN) },
|
|
||||||
{ "2m ", TALK_ID(2, UNIT_MIN) },
|
|
||||||
{ "3m ", TALK_ID(3, UNIT_MIN) },
|
|
||||||
{ "4m ", TALK_ID(4, UNIT_MIN) },
|
|
||||||
{ "5m ", TALK_ID(5, UNIT_MIN) },
|
|
||||||
{ "6m ", TALK_ID(6, UNIT_MIN) },
|
|
||||||
{ "7m ", TALK_ID(7, UNIT_MIN) },
|
|
||||||
{ "8m ", TALK_ID(8, UNIT_MIN) },
|
|
||||||
{ "9m ", TALK_ID(9, UNIT_MIN) },
|
|
||||||
{ "10m", TALK_ID(10, UNIT_MIN) },
|
|
||||||
{ "15m", TALK_ID(15, UNIT_MIN) },
|
|
||||||
{ "30m", TALK_ID(30, UNIT_MIN) },
|
|
||||||
{ "45m", TALK_ID(45, UNIT_MIN) },
|
|
||||||
{ "60m", TALK_ID(60, UNIT_MIN) }
|
|
||||||
};
|
|
||||||
return set_option(str(LANG_POWEROFF_IDLE), &global_settings.poweroff,
|
|
||||||
INT, names, 15, set_poweroff_timeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void sleep_timer_formatter(char* buffer, int buffer_size, int value,
|
|
||||||
const char* unit)
|
|
||||||
{
|
|
||||||
int minutes, hours;
|
|
||||||
|
|
||||||
(void) unit;
|
|
||||||
|
|
||||||
if (value) {
|
|
||||||
hours = value / 60;
|
|
||||||
minutes = value - (hours * 60);
|
|
||||||
snprintf(buffer, buffer_size, "%d:%02d", hours, minutes);
|
|
||||||
} else {
|
|
||||||
snprintf(buffer, buffer_size, "%s", str(LANG_OFF));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void sleep_timer_set(int minutes)
|
|
||||||
{
|
|
||||||
set_sleep_timer(minutes * 60);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool sleep_timer(void)
|
|
||||||
{
|
|
||||||
int minutes = (get_sleep_timer() + 59) / 60; /* round up */
|
|
||||||
|
|
||||||
return set_int(str(LANG_SLEEP_TIMER), "", UNIT_MIN, &minutes,
|
|
||||||
&sleep_timer_set, 5, 0, 300, sleep_timer_formatter);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool scroll_speed(void)
|
static bool scroll_speed(void)
|
||||||
{
|
{
|
||||||
return set_int(str(LANG_SCROLL), "", UNIT_INT,
|
return set_int(str(LANG_SCROLL), "", UNIT_INT,
|
||||||
|
@ -1000,108 +795,6 @@ static bool jump_scroll_delay(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
|
||||||
/**
|
|
||||||
* Menu to set the battery capacity
|
|
||||||
*/
|
|
||||||
static bool battery_capacity(void)
|
|
||||||
{
|
|
||||||
return set_int(str(LANG_BATTERY_CAPACITY), "mAh", UNIT_MAH,
|
|
||||||
&global_settings.battery_capacity,
|
|
||||||
&set_battery_capacity, BATTERY_CAPACITY_INC, BATTERY_CAPACITY_MIN,
|
|
||||||
BATTERY_CAPACITY_MAX, NULL );
|
|
||||||
}
|
|
||||||
|
|
||||||
#if BATTERY_TYPES_COUNT > 1
|
|
||||||
static bool battery_type(void)
|
|
||||||
{
|
|
||||||
static const struct opt_items names[] = {
|
|
||||||
{ STR(LANG_BATTERY_TYPE_ALKALINE) },
|
|
||||||
{ STR(LANG_BATTERY_TYPE_NIMH) }
|
|
||||||
};
|
|
||||||
|
|
||||||
return set_option(str(LANG_BATTERY_TYPE), &global_settings.battery_type,
|
|
||||||
INT, names, 2, set_battery_type);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_RTC
|
|
||||||
static bool timedate_set(void)
|
|
||||||
{
|
|
||||||
struct tm tm;
|
|
||||||
bool result;
|
|
||||||
|
|
||||||
/* Make a local copy of the time struct */
|
|
||||||
memcpy(&tm, get_time(), sizeof(struct tm));
|
|
||||||
|
|
||||||
/* do some range checks */
|
|
||||||
/* This prevents problems with time/date setting after a power loss */
|
|
||||||
if (!valid_time(&tm))
|
|
||||||
{
|
|
||||||
/* hour */
|
|
||||||
tm.tm_hour = 0;
|
|
||||||
tm.tm_min = 0;
|
|
||||||
tm.tm_sec = 0;
|
|
||||||
tm.tm_mday = 1;
|
|
||||||
tm.tm_mon = 0;
|
|
||||||
tm.tm_wday = 1;
|
|
||||||
tm.tm_year = 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = set_time_screen(str(LANG_TIME), &tm);
|
|
||||||
|
|
||||||
if(tm.tm_year != -1) {
|
|
||||||
set_time(&tm);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool timeformat_set(void)
|
|
||||||
{
|
|
||||||
static const struct opt_items names[] = {
|
|
||||||
{ STR(LANG_24_HOUR_CLOCK) },
|
|
||||||
{ STR(LANG_12_HOUR_CLOCK) }
|
|
||||||
};
|
|
||||||
return set_option(str(LANG_TIMEFORMAT), &global_settings.timeformat,
|
|
||||||
INT, names, 2, NULL);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_MMC
|
|
||||||
static bool spindown(void)
|
|
||||||
{
|
|
||||||
return set_int(str(LANG_SPINDOWN), "s", UNIT_SEC,
|
|
||||||
&global_settings.disk_spindown,
|
|
||||||
ata_spindown, 1, 3, 254, NULL );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* !HAVE_MMC */
|
|
||||||
|
|
||||||
#if CONFIG_CODEC == MAS3507D
|
|
||||||
static bool line_in(void)
|
|
||||||
{
|
|
||||||
bool rc = set_bool(str(LANG_LINE_IN), &global_settings.line_in);
|
|
||||||
#ifndef SIMULATOR
|
|
||||||
dac_line_in(global_settings.line_in);
|
|
||||||
#endif
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static bool max_files_in_dir(void)
|
|
||||||
{
|
|
||||||
return set_int(str(LANG_MAX_FILES_IN_DIR), "", UNIT_INT,
|
|
||||||
&global_settings.max_files_in_dir,
|
|
||||||
NULL, 50, 50, 10000, NULL );
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool max_files_in_playlist(void)
|
|
||||||
{
|
|
||||||
return set_int(str(LANG_MAX_FILES_IN_PLAYLIST), "", UNIT_INT,
|
|
||||||
&global_settings.max_files_in_playlist,
|
|
||||||
NULL, 1000, 1000, 20000, NULL );
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_BACKLIGHT
|
#ifdef CONFIG_BACKLIGHT
|
||||||
static bool set_bl_filter_first_keypress(void)
|
static bool set_bl_filter_first_keypress(void)
|
||||||
|
@ -1122,11 +815,6 @@ static bool set_remote_bl_filter_first_keypress(void)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool browse_current(void)
|
|
||||||
{
|
|
||||||
return set_bool( str(LANG_FOLLOW), &global_settings.browse_current );
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool custom_wps_browse(void)
|
static bool custom_wps_browse(void)
|
||||||
{
|
{
|
||||||
return rockbox_browse(WPS_DIR, SHOW_WPS);
|
return rockbox_browse(WPS_DIR, SHOW_WPS);
|
||||||
|
@ -1144,75 +832,6 @@ static bool custom_cfg_browse(void)
|
||||||
return rockbox_browse(ROCKBOX_DIR, SHOW_CFG);
|
return rockbox_browse(ROCKBOX_DIR, SHOW_CFG);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool language_browse(void)
|
|
||||||
{
|
|
||||||
return rockbox_browse(LANG_DIR, SHOW_LNG);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool voice_menus(void)
|
|
||||||
{
|
|
||||||
bool ret;
|
|
||||||
bool temp = global_settings.talk_menu;
|
|
||||||
/* work on a temp variable first, avoid "life" disabling */
|
|
||||||
ret = set_bool( str(LANG_VOICE_MENU), &temp );
|
|
||||||
global_settings.talk_menu = temp;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* this is used 2 times below, so it saves memory to put it in global scope */
|
|
||||||
static const struct opt_items voice_names[] = {
|
|
||||||
{ STR(LANG_OFF) },
|
|
||||||
{ STR(LANG_VOICE_NUMBER) },
|
|
||||||
{ STR(LANG_VOICE_SPELL) },
|
|
||||||
{ STR(LANG_VOICE_DIR_HOVER) }
|
|
||||||
};
|
|
||||||
|
|
||||||
static bool voice_dirs(void)
|
|
||||||
{
|
|
||||||
bool ret = set_option( str(LANG_VOICE_DIR),
|
|
||||||
&global_settings.talk_dir, INT, voice_names, 4, NULL);
|
|
||||||
#if CONFIG_CODEC == SWCODEC
|
|
||||||
audio_set_crossfade(global_settings.crossfade);
|
|
||||||
#endif
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool voice_files(void)
|
|
||||||
{
|
|
||||||
int oldval = global_settings.talk_file;
|
|
||||||
bool ret;
|
|
||||||
|
|
||||||
ret = set_option( str(LANG_VOICE_FILE),
|
|
||||||
&global_settings.talk_file, INT, voice_names, 4, NULL);
|
|
||||||
#if CONFIG_CODEC == SWCODEC
|
|
||||||
audio_set_crossfade(global_settings.crossfade);
|
|
||||||
#endif
|
|
||||||
if (oldval != 3 && global_settings.talk_file == 3)
|
|
||||||
{ /* force reload if newly talking thumbnails,
|
|
||||||
because the clip presence is cached only if enabled */
|
|
||||||
reload_directory();
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool voice_menu(void)
|
|
||||||
{
|
|
||||||
int m;
|
|
||||||
bool result;
|
|
||||||
|
|
||||||
static const struct menu_item items[] = {
|
|
||||||
{ ID2P(LANG_VOICE_MENU), voice_menus },
|
|
||||||
{ ID2P(LANG_VOICE_DIR), voice_dirs },
|
|
||||||
{ ID2P(LANG_VOICE_FILE), voice_files }
|
|
||||||
};
|
|
||||||
|
|
||||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
|
||||||
NULL, NULL, NULL);
|
|
||||||
result = menu_run(m);
|
|
||||||
menu_exit(m);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
static bool font_browse(void)
|
static bool font_browse(void)
|
||||||
{
|
{
|
||||||
|
@ -1259,107 +878,6 @@ static bool codepage_setting(void)
|
||||||
INT, names, 13, set_codepage );
|
INT, names, 13, set_codepage );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_DIRCACHE
|
|
||||||
static bool dircache(void)
|
|
||||||
{
|
|
||||||
bool result = set_bool_options(str(LANG_DIRCACHE_ENABLE),
|
|
||||||
&global_settings.dircache,
|
|
||||||
STR(LANG_ON),
|
|
||||||
STR(LANG_OFF),
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
if (!dircache_is_enabled() && global_settings.dircache)
|
|
||||||
gui_syncsplash(HZ*2, true, str(LANG_PLEASE_REBOOT));
|
|
||||||
|
|
||||||
if (!result)
|
|
||||||
dircache_disable();
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
#endif /* HAVE_DIRCACHE */
|
|
||||||
|
|
||||||
#ifdef HAVE_TAGCACHE
|
|
||||||
#ifdef HAVE_TC_RAMCACHE
|
|
||||||
static bool tagcache_ram(void)
|
|
||||||
{
|
|
||||||
bool result = set_bool_options(str(LANG_TAGCACHE_RAM),
|
|
||||||
&global_settings.tagcache_ram,
|
|
||||||
STR(LANG_SET_BOOL_YES),
|
|
||||||
STR(LANG_SET_BOOL_NO),
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static bool tagcache_autoupdate(void)
|
|
||||||
{
|
|
||||||
bool rc = set_bool_options(str(LANG_TAGCACHE_AUTOUPDATE),
|
|
||||||
&global_settings.tagcache_autoupdate,
|
|
||||||
STR(LANG_ON),
|
|
||||||
STR(LANG_OFF),
|
|
||||||
NULL);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool tagcache_runtimedb(void)
|
|
||||||
{
|
|
||||||
bool rc = set_bool_options(str(LANG_RUNTIMEDB_ACTIVE),
|
|
||||||
&global_settings.runtimedb,
|
|
||||||
STR(LANG_ON),
|
|
||||||
STR(LANG_OFF),
|
|
||||||
NULL);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool tagcache_settings_menu(void)
|
|
||||||
{
|
|
||||||
int m;
|
|
||||||
bool result;
|
|
||||||
|
|
||||||
static const struct menu_item items[] = {
|
|
||||||
#ifdef HAVE_TC_RAMCACHE
|
|
||||||
{ ID2P(LANG_TAGCACHE_RAM), tagcache_ram },
|
|
||||||
#endif
|
|
||||||
{ ID2P(LANG_TAGCACHE_AUTOUPDATE), tagcache_autoupdate },
|
|
||||||
{ ID2P(LANG_TAGCACHE_FORCE_UPDATE), tagcache_rebuild },
|
|
||||||
{ ID2P(LANG_TAGCACHE_UPDATE), tagcache_update },
|
|
||||||
{ ID2P(LANG_RUNTIMEDB_ACTIVE), tagcache_runtimedb },
|
|
||||||
{ ID2P(LANG_TAGCACHE_EXPORT), tagtree_export },
|
|
||||||
{ ID2P(LANG_TAGCACHE_IMPORT), tagtree_import },
|
|
||||||
};
|
|
||||||
|
|
||||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
|
||||||
NULL, NULL, NULL);
|
|
||||||
result = menu_run(m);
|
|
||||||
menu_exit(m);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool playback_settings_menu(void)
|
|
||||||
{
|
|
||||||
return do_menu(&playback_menu_item);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool bookmark_settings_menu(void)
|
|
||||||
{
|
|
||||||
int m;
|
|
||||||
bool result;
|
|
||||||
|
|
||||||
static const struct menu_item items[] = {
|
|
||||||
{ ID2P(LANG_BOOKMARK_SETTINGS_AUTOCREATE), autocreatebookmark},
|
|
||||||
{ ID2P(LANG_BOOKMARK_SETTINGS_AUTOLOAD), autoloadbookmark},
|
|
||||||
{ ID2P(LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS), useMRB},
|
|
||||||
};
|
|
||||||
|
|
||||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
|
||||||
NULL, NULL, NULL);
|
|
||||||
result = menu_run(m);
|
|
||||||
menu_exit(m);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
static bool reset_settings(void)
|
static bool reset_settings(void)
|
||||||
{
|
{
|
||||||
unsigned char *lines[]={str(LANG_RESET_ASK_RECORDER)};
|
unsigned char *lines[]={str(LANG_RESET_ASK_RECORDER)};
|
||||||
|
@ -1387,30 +905,6 @@ static bool reset_settings(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool fileview_settings_menu(void)
|
|
||||||
{
|
|
||||||
int m;
|
|
||||||
bool result;
|
|
||||||
|
|
||||||
static const struct menu_item items[] = {
|
|
||||||
{ ID2P(LANG_SORT_CASE), sort_case },
|
|
||||||
{ ID2P(LANG_SORT_DIR), sort_dir },
|
|
||||||
{ ID2P(LANG_SORT_FILE), sort_file },
|
|
||||||
{ ID2P(LANG_FILTER), dir_filter },
|
|
||||||
{ ID2P(LANG_FOLLOW), browse_current },
|
|
||||||
{ ID2P(LANG_SHOW_ICONS), show_icons },
|
|
||||||
{ ID2P(LANG_SHOW_PATH), show_path },
|
|
||||||
#ifdef HAVE_TAGCACHE
|
|
||||||
{ ID2P(LANG_TAGCACHE), tagcache_settings_menu},
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
|
||||||
NULL, NULL, NULL);
|
|
||||||
result = menu_run(m);
|
|
||||||
menu_exit(m);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
static bool remote_scroll_sets(void)
|
static bool remote_scroll_sets(void)
|
||||||
|
@ -1611,75 +1105,6 @@ bool display_settings_menu(void)
|
||||||
menu_exit(m);
|
menu_exit(m);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static bool battery_settings_menu(void)
|
|
||||||
{
|
|
||||||
int m;
|
|
||||||
bool result;
|
|
||||||
|
|
||||||
static const struct menu_item items[] = {
|
|
||||||
#ifndef SIMULATOR
|
|
||||||
{ ID2P(LANG_BATTERY_CAPACITY), battery_capacity },
|
|
||||||
#if BATTERY_TYPES_COUNT > 1
|
|
||||||
{ ID2P(LANG_BATTERY_TYPE), battery_type },
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_USB_POWER
|
|
||||||
#ifdef CONFIG_CHARGING
|
|
||||||
{ ID2P(LANG_USB_CHARGING), usb_charging },
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
{ "Dummy", NULL }, /* to have an entry at all, in the simulator */
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
|
||||||
NULL, NULL, NULL);
|
|
||||||
result = menu_run(m);
|
|
||||||
menu_exit(m);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef HAVE_MMC
|
|
||||||
static bool disk_settings_menu(void)
|
|
||||||
{
|
|
||||||
int m;
|
|
||||||
bool result;
|
|
||||||
|
|
||||||
static const struct menu_item items[] = {
|
|
||||||
{ ID2P(LANG_SPINDOWN), spindown },
|
|
||||||
#ifdef HAVE_DIRCACHE
|
|
||||||
{ ID2P(LANG_DIRCACHE_ENABLE), dircache },
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
|
||||||
NULL, NULL, NULL);
|
|
||||||
result = menu_run(m);
|
|
||||||
menu_exit(m);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
#endif /* !HAVE_MMC */
|
|
||||||
|
|
||||||
#ifdef CONFIG_RTC
|
|
||||||
static bool time_settings_menu(void)
|
|
||||||
{
|
|
||||||
int m;
|
|
||||||
bool result;
|
|
||||||
|
|
||||||
static const struct menu_item items[] = {
|
|
||||||
{ ID2P(LANG_TIME), timedate_set },
|
|
||||||
{ ID2P(LANG_TIMEFORMAT), timeformat_set },
|
|
||||||
};
|
|
||||||
|
|
||||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
|
||||||
NULL, NULL, NULL);
|
|
||||||
result = menu_run(m);
|
|
||||||
menu_exit(m);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
static bool manage_settings_write_config(void)
|
static bool manage_settings_write_config(void)
|
||||||
{
|
{
|
||||||
return settings_save_config(SETTINGS_SAVE_ALL);
|
return settings_save_config(SETTINGS_SAVE_ALL);
|
||||||
|
@ -1708,76 +1133,3 @@ bool manage_settings_menu(void)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool limits_settings_menu(void)
|
|
||||||
{
|
|
||||||
int m;
|
|
||||||
bool result;
|
|
||||||
|
|
||||||
static const struct menu_item items[] = {
|
|
||||||
{ ID2P(LANG_MAX_FILES_IN_DIR), max_files_in_dir },
|
|
||||||
{ ID2P(LANG_MAX_FILES_IN_PLAYLIST), max_files_in_playlist },
|
|
||||||
};
|
|
||||||
|
|
||||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
|
||||||
NULL, NULL, NULL);
|
|
||||||
result = menu_run(m);
|
|
||||||
menu_exit(m);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static bool system_settings_menu(void)
|
|
||||||
{
|
|
||||||
int m;
|
|
||||||
bool result;
|
|
||||||
|
|
||||||
static const struct menu_item items[] = {
|
|
||||||
{ ID2P(LANG_BATTERY_MENU), battery_settings_menu },
|
|
||||||
#ifndef HAVE_MMC
|
|
||||||
{ ID2P(LANG_DISK_MENU), disk_settings_menu },
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_RTC
|
|
||||||
{ ID2P(LANG_TIME_MENU), time_settings_menu },
|
|
||||||
#endif
|
|
||||||
{ ID2P(LANG_POWEROFF_IDLE), poweroff_idle_timer },
|
|
||||||
{ ID2P(LANG_SLEEP_TIMER), sleep_timer },
|
|
||||||
#ifdef HAVE_ALARM_MOD
|
|
||||||
{ ID2P(LANG_ALARM_MOD_ALARM_MENU), alarm_screen },
|
|
||||||
#endif
|
|
||||||
{ ID2P(LANG_LIMITS_MENU), limits_settings_menu },
|
|
||||||
#if CONFIG_CODEC == MAS3507D
|
|
||||||
{ ID2P(LANG_LINE_IN), line_in },
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_CHARGING
|
|
||||||
{ ID2P(LANG_CAR_ADAPTER_MODE), car_adapter_mode },
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
|
||||||
NULL, NULL, NULL);
|
|
||||||
result = menu_run(m);
|
|
||||||
menu_exit(m);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool settings_menu(void)
|
|
||||||
{
|
|
||||||
int m;
|
|
||||||
bool result;
|
|
||||||
|
|
||||||
static const struct menu_item items[] = {
|
|
||||||
{ ID2P(LANG_PLAYBACK), playback_settings_menu },
|
|
||||||
{ ID2P(LANG_FILE), fileview_settings_menu },
|
|
||||||
{ ID2P(LANG_DISPLAY), display_settings_menu },
|
|
||||||
{ ID2P(LANG_SYSTEM), system_settings_menu },
|
|
||||||
{ ID2P(LANG_BOOKMARK_SETTINGS),bookmark_settings_menu },
|
|
||||||
{ ID2P(LANG_LANGUAGE), language_browse },
|
|
||||||
{ ID2P(LANG_VOICE), voice_menu },
|
|
||||||
};
|
|
||||||
|
|
||||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
|
||||||
NULL, NULL, NULL);
|
|
||||||
result = menu_run(m);
|
|
||||||
menu_exit(m);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue