2007-02-08 04:33:41 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
2007-02-13 00:32:17 +00:00
|
|
|
* $Id$
|
2007-02-08 04:33:41 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Jonathan Gordon
|
|
|
|
*
|
|
|
|
* All files in this archive are subject to the GNU General Public License.
|
|
|
|
* See the file COPYING in the source tree root for full license agreement.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <limits.h>
|
2007-02-13 07:50:47 +00:00
|
|
|
#include <string.h>
|
2007-02-08 04:33:41 +00:00
|
|
|
#include "config.h"
|
|
|
|
#include "lang.h"
|
|
|
|
#include "action.h"
|
|
|
|
#include "settings.h"
|
|
|
|
#include "menu.h"
|
|
|
|
#include "sound_menu.h"
|
2007-02-13 07:50:47 +00:00
|
|
|
#include "exported_menus.h"
|
|
|
|
#include "tree.h"
|
|
|
|
#include "tagtree.h"
|
|
|
|
#include "usb.h"
|
|
|
|
#include "splash.h"
|
|
|
|
#include "talk.h"
|
|
|
|
#include "sprintf.h"
|
2008-04-20 18:28:25 +00:00
|
|
|
#include "powermgmt.h"
|
|
|
|
#if CONFIG_CODEC == SWCODEC
|
|
|
|
#include "playback.h"
|
|
|
|
#endif
|
2007-02-28 21:55:11 +00:00
|
|
|
#ifdef HAVE_RTC_ALARM
|
2007-02-13 07:50:47 +00:00
|
|
|
#include "alarm_menu.h"
|
|
|
|
#endif
|
2007-03-07 08:56:20 +00:00
|
|
|
#if CONFIG_TUNER
|
|
|
|
#include "radio.h"
|
|
|
|
#endif
|
2008-04-20 18:28:25 +00:00
|
|
|
#if CONFIG_RTC
|
|
|
|
#include "screens.h"
|
|
|
|
#endif
|
2007-02-13 07:50:47 +00:00
|
|
|
|
|
|
|
/***********************************/
|
|
|
|
/* TAGCACHE MENU */
|
|
|
|
#ifdef HAVE_TAGCACHE
|
2007-03-07 19:56:15 +00:00
|
|
|
|
|
|
|
static void tagcache_rebuild_with_splash(void)
|
|
|
|
{
|
|
|
|
tagcache_rebuild();
|
2007-08-06 13:08:36 +00:00
|
|
|
gui_syncsplash(HZ*2, ID2P(LANG_TAGCACHE_FORCE_UPDATE_SPLASH));
|
2007-03-07 19:56:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void tagcache_update_with_splash(void)
|
|
|
|
{
|
|
|
|
tagcache_update();
|
2007-08-06 13:08:36 +00:00
|
|
|
gui_syncsplash(HZ*2, ID2P(LANG_TAGCACHE_FORCE_UPDATE_SPLASH));
|
2007-03-07 19:56:15 +00:00
|
|
|
}
|
|
|
|
|
2007-02-13 07:50:47 +00:00
|
|
|
#ifdef HAVE_TC_RAMCACHE
|
|
|
|
MENUITEM_SETTING(tagcache_ram, &global_settings.tagcache_ram, NULL);
|
|
|
|
#endif
|
|
|
|
MENUITEM_SETTING(tagcache_autoupdate, &global_settings.tagcache_autoupdate, NULL);
|
2007-03-17 12:33:34 +00:00
|
|
|
MENUITEM_FUNCTION(tc_init, 0, ID2P(LANG_TAGCACHE_FORCE_UPDATE),
|
|
|
|
(int(*)(void))tagcache_rebuild_with_splash,
|
2007-03-18 07:03:43 +00:00
|
|
|
NULL, NULL, Icon_NOICON);
|
2007-03-17 12:33:34 +00:00
|
|
|
MENUITEM_FUNCTION(tc_update, 0, ID2P(LANG_TAGCACHE_UPDATE),
|
|
|
|
(int(*)(void))tagcache_update_with_splash,
|
2007-03-18 07:03:43 +00:00
|
|
|
NULL, NULL, Icon_NOICON);
|
2007-02-13 07:50:47 +00:00
|
|
|
MENUITEM_SETTING(runtimedb, &global_settings.runtimedb, NULL);
|
2007-03-17 12:33:34 +00:00
|
|
|
MENUITEM_FUNCTION(tc_export, 0, ID2P(LANG_TAGCACHE_EXPORT),
|
2007-03-18 07:03:43 +00:00
|
|
|
(int(*)(void))tagtree_export, NULL,
|
2007-03-17 12:33:34 +00:00
|
|
|
NULL, Icon_NOICON);
|
|
|
|
MENUITEM_FUNCTION(tc_import, 0, ID2P(LANG_TAGCACHE_IMPORT),
|
2007-03-18 07:03:43 +00:00
|
|
|
(int(*)(void))tagtree_import, NULL,
|
2007-03-17 12:33:34 +00:00
|
|
|
NULL, Icon_NOICON);
|
2007-03-03 13:52:14 +00:00
|
|
|
MAKE_MENU(tagcache_menu, ID2P(LANG_TAGCACHE), 0, Icon_NOICON,
|
2007-02-13 07:50:47 +00:00
|
|
|
#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);
|
2007-08-13 19:29:49 +00:00
|
|
|
MENUITEM_SETTING(show_filename_ext, &global_settings.show_filename_ext, NULL);
|
2007-02-13 07:50:47 +00:00
|
|
|
MENUITEM_SETTING(browse_current, &global_settings.browse_current, NULL);
|
2008-01-13 09:29:45 +00:00
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2007-02-13 07:50:47 +00:00
|
|
|
MENUITEM_SETTING(show_path_in_browser, &global_settings.show_path_in_browser, NULL);
|
2008-01-13 09:29:45 +00:00
|
|
|
#endif
|
2007-02-13 07:50:47 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2007-03-03 13:52:14 +00:00
|
|
|
MAKE_MENU(file_menu, ID2P(LANG_FILE), 0, Icon_file_view_menu,
|
2007-02-14 06:58:30 +00:00
|
|
|
&sort_case, &sort_dir, &sort_file,
|
2007-08-13 19:29:49 +00:00
|
|
|
&dirfilter, &show_filename_ext, &browse_current,
|
2008-01-13 09:29:45 +00:00
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
&show_path_in_browser
|
|
|
|
#endif
|
|
|
|
);
|
2007-02-13 07:50:47 +00:00
|
|
|
/* FILE VIEW MENU */
|
|
|
|
/***********************************/
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************/
|
|
|
|
/* SYSTEM MENU */
|
|
|
|
|
|
|
|
/* Battery */
|
2007-07-15 03:56:04 +00:00
|
|
|
#if BATTERY_CAPACITY_INC > 0
|
2007-02-13 07:50:47 +00:00
|
|
|
MENUITEM_SETTING(battery_capacity, &global_settings.battery_capacity, NULL);
|
2007-07-15 03:56:04 +00:00
|
|
|
#endif
|
|
|
|
#if BATTERY_TYPES_COUNT > 1
|
2007-02-13 07:50:47 +00:00
|
|
|
MENUITEM_SETTING(battery_type, &global_settings.battery_type, NULL);
|
2007-07-15 03:56:04 +00:00
|
|
|
#endif
|
2007-02-13 07:50:47 +00:00
|
|
|
#ifdef HAVE_USB_POWER
|
2007-02-18 05:32:06 +00:00
|
|
|
#if CONFIG_CHARGING
|
2007-02-13 07:50:47 +00:00
|
|
|
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
|
2007-03-03 13:52:14 +00:00
|
|
|
MAKE_MENU(battery_menu, ID2P(LANG_BATTERY_MENU), 0, Icon_NOICON,
|
2007-07-15 03:56:04 +00:00
|
|
|
#if BATTERY_CAPACITY_INC > 0
|
|
|
|
&battery_capacity,
|
|
|
|
#endif
|
2007-02-13 07:50:47 +00:00
|
|
|
#if BATTERY_TYPES_COUNT > 1
|
|
|
|
&battery_type,
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_USB_POWER
|
2007-02-18 05:32:06 +00:00
|
|
|
#if CONFIG_CHARGING
|
2007-02-13 07:50:47 +00:00
|
|
|
&usb_charging,
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
);
|
|
|
|
/* Disk */
|
2007-08-01 08:50:44 +00:00
|
|
|
#ifndef HAVE_FLASH_STORAGE
|
2007-02-13 07:50:47 +00:00
|
|
|
MENUITEM_SETTING(disk_spindown, &global_settings.disk_spindown, NULL);
|
2007-08-01 08:50:44 +00:00
|
|
|
#endif
|
2007-02-13 07:50:47 +00:00
|
|
|
#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())
|
2007-08-06 13:08:36 +00:00
|
|
|
gui_syncsplash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
|
2007-02-13 07:50:47 +00:00
|
|
|
break;
|
|
|
|
case false:
|
|
|
|
if (dircache_is_enabled())
|
|
|
|
dircache_disable();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return action;
|
|
|
|
}
|
|
|
|
MENUITEM_SETTING(dircache, &global_settings.dircache, dircache_callback);
|
|
|
|
#endif
|
2007-08-01 08:50:44 +00:00
|
|
|
#if defined(HAVE_DIRCACHE) || !defined(HAVE_FLASH_STORAGE)
|
2007-03-03 13:52:14 +00:00
|
|
|
MAKE_MENU(disk_menu, ID2P(LANG_DISK_MENU), 0, Icon_NOICON,
|
2007-08-01 08:50:44 +00:00
|
|
|
#ifndef HAVE_FLASH_STORAGE
|
2007-02-13 07:50:47 +00:00
|
|
|
&disk_spindown,
|
2007-08-01 08:50:44 +00:00
|
|
|
#endif
|
2007-02-13 07:50:47 +00:00
|
|
|
#ifdef HAVE_DIRCACHE
|
|
|
|
&dircache,
|
|
|
|
#endif
|
|
|
|
);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Time & Date */
|
2007-03-16 23:47:03 +00:00
|
|
|
#if CONFIG_RTC
|
2007-02-13 07:50:47 +00:00
|
|
|
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))
|
|
|
|
{
|
2007-03-31 13:04:22 +00:00
|
|
|
/* Macros to convert a 2-digit string to a decimal constant.
|
|
|
|
(YEAR), MONTH and DAY are set by the date command, which outputs
|
|
|
|
DAY as 00..31 and MONTH as 01..12. The leading zero would lead to
|
|
|
|
misinterpretation as an octal constant. */
|
|
|
|
#define S100(x) 1 ## x
|
|
|
|
#define C2DIG2DEC(x) (S100(x)-100)
|
|
|
|
|
2007-02-13 07:50:47 +00:00
|
|
|
tm.tm_hour = 0;
|
|
|
|
tm.tm_min = 0;
|
|
|
|
tm.tm_sec = 0;
|
2007-03-31 13:04:22 +00:00
|
|
|
tm.tm_mday = C2DIG2DEC(DAY);
|
|
|
|
tm.tm_mon = C2DIG2DEC(MONTH)-1;
|
2007-02-13 07:50:47 +00:00
|
|
|
tm.tm_wday = 1;
|
2007-03-31 13:04:22 +00:00
|
|
|
tm.tm_year = YEAR-1900;
|
2007-02-13 07:50:47 +00:00
|
|
|
}
|
|
|
|
|
2007-08-05 19:19:39 +00:00
|
|
|
result = (int)set_time_screen(str(LANG_SET_TIME), &tm);
|
2007-02-13 07:50:47 +00:00
|
|
|
|
|
|
|
if(tm.tm_year != -1) {
|
|
|
|
set_time(&tm);
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2007-08-05 19:19:39 +00:00
|
|
|
MENUITEM_FUNCTION(time_set, 0, ID2P(LANG_SET_TIME),
|
2007-03-18 07:03:43 +00:00
|
|
|
timedate_set, NULL, NULL, Icon_NOICON);
|
2007-02-13 07:50:47 +00:00
|
|
|
MENUITEM_SETTING(timeformat, &global_settings.timeformat, NULL);
|
2007-03-03 13:52:14 +00:00
|
|
|
MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), 0, Icon_NOICON, &time_set, &timeformat);
|
2007-02-13 07:50:47 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* System menu */
|
|
|
|
MENUITEM_SETTING(poweroff, &global_settings.poweroff, NULL);
|
|
|
|
|
2007-02-28 21:55:11 +00:00
|
|
|
#ifdef HAVE_RTC_ALARM
|
2007-03-17 12:33:34 +00:00
|
|
|
MENUITEM_FUNCTION(alarm_screen_call, 0, ID2P(LANG_ALARM_MOD_ALARM_MENU),
|
2007-03-18 07:03:43 +00:00
|
|
|
(menu_function)alarm_screen, NULL, NULL, Icon_NOICON);
|
2007-03-07 07:36:04 +00:00
|
|
|
#if CONFIG_TUNER || defined(HAVE_RECORDING)
|
|
|
|
|
|
|
|
#if CONFIG_TUNER && !defined(HAVE_RECORDING)
|
|
|
|
/* This need only be shown if we dont have recording, because if we do
|
|
|
|
then always show the setting item, because there will always be at least
|
|
|
|
2 items */
|
|
|
|
static int alarm_callback(int action,const struct menu_item_ex *this_item)
|
|
|
|
{
|
|
|
|
(void)this_item;
|
|
|
|
switch (action)
|
|
|
|
{
|
|
|
|
case ACTION_REQUEST_MENUITEM:
|
|
|
|
if (radio_hardware_present() == 0)
|
|
|
|
return ACTION_EXIT_MENUITEM;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return action;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define alarm_callback NULL
|
|
|
|
#endif /* CONFIG_TUNER && !HAVE_RECORDING */
|
|
|
|
/* have to do this manually because the setting screen
|
|
|
|
doesnt handle variable item count */
|
|
|
|
static int alarm_setting(void)
|
|
|
|
{
|
|
|
|
struct opt_items items[ALARM_START_COUNT];
|
|
|
|
int i = 0;
|
|
|
|
items[i].string = str(LANG_RESUME_PLAYBACK);
|
|
|
|
items[i].voice_id = LANG_RESUME_PLAYBACK;
|
|
|
|
i++;
|
|
|
|
#if CONFIG_TUNER
|
|
|
|
if (radio_hardware_present())
|
|
|
|
{
|
|
|
|
items[i].string = str(LANG_FM_RADIO);
|
|
|
|
items[i].voice_id = LANG_FM_RADIO;
|
|
|
|
i++;
|
|
|
|
}
|
2007-03-07 01:16:25 +00:00
|
|
|
#endif
|
2007-03-07 07:36:04 +00:00
|
|
|
#ifdef HAVE_RECORDING
|
|
|
|
items[i].string = str(LANG_RECORDING);
|
|
|
|
items[i].voice_id = LANG_RECORDING;
|
|
|
|
i++;
|
2007-02-13 07:50:47 +00:00
|
|
|
#endif
|
2007-03-07 07:36:04 +00:00
|
|
|
return set_option(str(LANG_ALARM_WAKEUP_SCREEN),
|
|
|
|
&global_settings.alarm_wake_up_screen,
|
|
|
|
INT, items, i, NULL);
|
|
|
|
}
|
|
|
|
|
2007-03-17 12:33:34 +00:00
|
|
|
MENUITEM_FUNCTION(alarm_wake_up_screen, 0, ID2P(LANG_ALARM_WAKEUP_SCREEN),
|
2007-03-18 07:03:43 +00:00
|
|
|
alarm_setting, NULL, alarm_callback, Icon_Menu_setting);
|
2007-03-07 07:36:04 +00:00
|
|
|
#endif /* CONFIG_TUNER || defined(HAVE_RECORDING) */
|
|
|
|
#endif /* HAVE_RTC_ALARM */
|
2007-02-13 07:50:47 +00:00
|
|
|
|
|
|
|
/* 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);
|
2007-03-03 13:52:14 +00:00
|
|
|
MAKE_MENU(limits_menu, ID2P(LANG_LIMITS_MENU), 0, Icon_NOICON,
|
2007-02-13 07:50:47 +00:00
|
|
|
&max_files_in_dir, &max_files_in_playlist);
|
|
|
|
|
2008-01-21 09:48:44 +00:00
|
|
|
|
|
|
|
/* Keyclick menu */
|
|
|
|
#if CONFIG_CODEC == SWCODEC
|
|
|
|
MENUITEM_SETTING(keyclick, &global_settings.keyclick, NULL);
|
|
|
|
MENUITEM_SETTING(keyclick_repeats, &global_settings.keyclick_repeats, NULL);
|
|
|
|
MAKE_MENU(keyclick_menu, ID2P(LANG_KEYCLICK), 0, Icon_NOICON,
|
|
|
|
&keyclick, &keyclick_repeats);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2007-02-13 07:50:47 +00:00
|
|
|
#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
|
2007-02-18 05:32:06 +00:00
|
|
|
#if CONFIG_CHARGING
|
2007-02-13 07:50:47 +00:00
|
|
|
MENUITEM_SETTING(car_adapter_mode, &global_settings.car_adapter_mode, NULL);
|
|
|
|
#endif
|
2008-04-20 18:28:25 +00:00
|
|
|
#ifdef HAVE_ACCESSORY_SUPPLY
|
|
|
|
MENUITEM_SETTING(accessory_supply, &global_settings.accessory_supply, NULL);
|
|
|
|
#endif
|
2007-03-01 11:14:46 +00:00
|
|
|
MENUITEM_SETTING(start_screen, &global_settings.start_in_screen, NULL);
|
2007-02-13 07:50:47 +00:00
|
|
|
|
2007-04-22 13:02:24 +00:00
|
|
|
#ifdef HAVE_BUTTON_LIGHT
|
2007-10-07 15:02:02 +00:00
|
|
|
MENUITEM_SETTING(buttonlight_timeout, &global_settings.buttonlight_timeout, NULL);
|
2007-04-22 13:02:24 +00:00
|
|
|
#endif
|
|
|
|
|
2007-05-08 06:45:38 +00:00
|
|
|
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
|
|
|
|
MENUITEM_SETTING(buttonlight_brightness, &global_settings.buttonlight_brightness, NULL);
|
|
|
|
#endif
|
|
|
|
|
2008-05-29 21:27:44 +00:00
|
|
|
#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
|
|
|
|
MENUITEM_SETTING(touchpad_sensitivity, &global_settings.touchpad_sensitivity, NULL);
|
|
|
|
#endif
|
|
|
|
|
2008-01-21 09:48:44 +00:00
|
|
|
|
2007-02-14 06:58:30 +00:00
|
|
|
MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
|
2007-03-03 13:52:14 +00:00
|
|
|
0, Icon_System_menu,
|
2007-03-01 11:14:46 +00:00
|
|
|
&start_screen,
|
2007-08-12 19:49:03 +00:00
|
|
|
#if (BATTERY_CAPACITY_INC > 0) || (BATTERY_TYPES_COUNT > 1)
|
2007-02-13 07:50:47 +00:00
|
|
|
&battery_menu,
|
|
|
|
#endif
|
2007-08-01 09:05:42 +00:00
|
|
|
#if defined(HAVE_DIRCACHE) || !defined(HAVE_FLASH_STORAGE)
|
2007-02-13 07:50:47 +00:00
|
|
|
&disk_menu,
|
|
|
|
#endif
|
2007-03-16 23:47:03 +00:00
|
|
|
#if CONFIG_RTC
|
2007-02-13 07:50:47 +00:00
|
|
|
&time_menu,
|
|
|
|
#endif
|
|
|
|
&poweroff,
|
2007-02-28 21:55:11 +00:00
|
|
|
#ifdef HAVE_RTC_ALARM
|
2007-02-13 07:50:47 +00:00
|
|
|
&alarm_screen_call,
|
2007-03-07 01:16:25 +00:00
|
|
|
#if defined(HAVE_RECORDING) || CONFIG_TUNER
|
|
|
|
&alarm_wake_up_screen,
|
|
|
|
#endif
|
2007-02-13 07:50:47 +00:00
|
|
|
#endif
|
|
|
|
&limits_menu,
|
|
|
|
#if CONFIG_CODEC == MAS3507D
|
|
|
|
&line_in,
|
|
|
|
#endif
|
2007-02-18 05:32:06 +00:00
|
|
|
#if CONFIG_CHARGING
|
2007-02-13 07:50:47 +00:00
|
|
|
&car_adapter_mode,
|
2007-04-22 13:02:24 +00:00
|
|
|
#endif
|
2008-04-20 18:28:25 +00:00
|
|
|
#ifdef HAVE_ACCESSORY_SUPPLY
|
|
|
|
&accessory_supply,
|
|
|
|
#endif
|
2007-04-22 13:02:24 +00:00
|
|
|
#ifdef HAVE_BUTTON_LIGHT
|
2007-10-07 15:02:02 +00:00
|
|
|
&buttonlight_timeout,
|
2007-05-08 06:45:38 +00:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
|
2008-01-21 09:48:44 +00:00
|
|
|
&buttonlight_brightness,
|
|
|
|
#endif
|
|
|
|
#if CONFIG_CODEC == SWCODEC
|
|
|
|
&keyclick_menu,
|
2008-05-29 21:27:44 +00:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
|
|
|
|
&touchpad_sensitivity,
|
2007-02-13 07:50:47 +00:00
|
|
|
#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,
|
2007-03-03 13:52:14 +00:00
|
|
|
Icon_Bookmark,
|
2007-02-13 07:50:47 +00:00
|
|
|
&autocreatebookmark, &autoloadbookmark, &usemrb);
|
|
|
|
/* BOOKMARK MENU */
|
|
|
|
/***********************************/
|
|
|
|
|
|
|
|
/***********************************/
|
|
|
|
/* VOICE MENU */
|
|
|
|
static int talk_callback(int action,const struct menu_item_ex *this_item);
|
2007-06-07 09:24:53 +00:00
|
|
|
MENUITEM_SETTING(talk_menu_item, &global_settings.talk_menu, NULL);
|
|
|
|
MENUITEM_SETTING(talk_dir_item, &global_settings.talk_dir, NULL);
|
|
|
|
MENUITEM_SETTING(talk_dir_clip_item, &global_settings.talk_dir_clip, talk_callback);
|
|
|
|
MENUITEM_SETTING(talk_file_item, &global_settings.talk_file, NULL);
|
|
|
|
MENUITEM_SETTING(talk_file_clip_item, &global_settings.talk_file_clip, talk_callback);
|
2007-02-13 07:50:47 +00:00
|
|
|
static int talk_callback(int action,const struct menu_item_ex *this_item)
|
|
|
|
{
|
|
|
|
static int oldval = 0;
|
|
|
|
switch (action)
|
|
|
|
{
|
|
|
|
case ACTION_ENTER_MENUITEM:
|
2007-06-07 09:24:53 +00:00
|
|
|
oldval = global_settings.talk_file_clip;
|
2007-02-13 07:50:47 +00:00
|
|
|
break;
|
|
|
|
case ACTION_EXIT_MENUITEM:
|
|
|
|
#if CONFIG_CODEC == SWCODEC
|
|
|
|
audio_set_crossfade(global_settings.crossfade);
|
|
|
|
#endif
|
2007-06-07 09:24:53 +00:00
|
|
|
if (this_item == &talk_dir_clip_item)
|
2007-02-13 07:50:47 +00:00
|
|
|
break;
|
2007-06-07 09:24:53 +00:00
|
|
|
if (!oldval && global_settings.talk_file_clip)
|
|
|
|
{
|
|
|
|
/* force reload if newly talking thumbnails,
|
2007-02-13 07:50:47 +00:00
|
|
|
because the clip presence is cached only if enabled */
|
|
|
|
reload_directory();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return action;
|
|
|
|
}
|
2007-11-07 03:25:33 +00:00
|
|
|
MENUITEM_SETTING(talk_filetype_item, &global_settings.talk_filetype, NULL);
|
2007-11-03 05:00:49 +00:00
|
|
|
MENUITEM_SETTING(talk_battery_level_item,
|
|
|
|
&global_settings.talk_battery_level, NULL);
|
2007-03-03 13:52:14 +00:00
|
|
|
MAKE_MENU(voice_settings_menu, ID2P(LANG_VOICE), 0, Icon_Voice,
|
2007-06-07 09:24:53 +00:00
|
|
|
&talk_menu_item, &talk_dir_item, &talk_dir_clip_item,
|
2007-11-07 03:25:33 +00:00
|
|
|
&talk_file_item, &talk_file_clip_item, &talk_filetype_item,
|
2007-11-03 05:00:49 +00:00
|
|
|
&talk_battery_level_item);
|
2007-02-13 07:50:47 +00:00
|
|
|
/* VOICE MENU */
|
|
|
|
/***********************************/
|
|
|
|
|
2007-08-27 16:04:32 +00:00
|
|
|
/***********************************/
|
|
|
|
|
2007-02-13 07:50:47 +00:00
|
|
|
/***********************************/
|
|
|
|
/* SETTINGS MENU */
|
|
|
|
static int language_browse(void)
|
|
|
|
{
|
|
|
|
return (int)rockbox_browse(LANG_DIR, SHOW_LNG);
|
|
|
|
}
|
2007-03-17 12:33:34 +00:00
|
|
|
MENUITEM_FUNCTION(browse_langs, 0, ID2P(LANG_LANGUAGE), language_browse,
|
2007-03-18 07:03:43 +00:00
|
|
|
NULL, NULL, Icon_Language);
|
2007-02-08 04:33:41 +00:00
|
|
|
|
2007-02-13 07:50:47 +00:00
|
|
|
MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0,
|
2007-03-03 13:52:14 +00:00
|
|
|
Icon_General_settings_menu,
|
2008-05-22 08:02:48 +00:00
|
|
|
&playback_settings, &playlist_settings, &file_menu,
|
2007-03-01 17:39:15 +00:00
|
|
|
#ifdef HAVE_TAGCACHE
|
|
|
|
&tagcache_menu,
|
|
|
|
#endif
|
2007-03-01 11:14:46 +00:00
|
|
|
&display_menu, &system_menu,
|
2007-08-27 16:04:32 +00:00
|
|
|
&bookmark_settings_menu, &browse_langs, &voice_settings_menu
|
|
|
|
);
|
2007-02-13 07:50:47 +00:00
|
|
|
/* SETTINGS MENU */
|
|
|
|
/***********************************/
|