2002-05-21 14:35:18 +00:00
|
|
|
|
/***************************************************************************
|
|
|
|
|
* __________ __ ___.
|
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 2002 Bj<EFBFBD>rn Stenberg
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
****************************************************************************/
|
2004-04-12 12:29:44 +00:00
|
|
|
|
#include <timefuncs.h>
|
2002-10-15 12:25:57 +00:00
|
|
|
|
#include "config.h"
|
2002-09-06 09:08:23 +00:00
|
|
|
|
#include "options.h"
|
|
|
|
|
|
2002-05-21 14:35:18 +00:00
|
|
|
|
#include "menu.h"
|
|
|
|
|
#include "tree.h"
|
2002-05-21 15:14:15 +00:00
|
|
|
|
#include "lcd.h"
|
2002-09-12 13:33:59 +00:00
|
|
|
|
#include "font.h"
|
2002-05-21 15:14:15 +00:00
|
|
|
|
#include "button.h"
|
|
|
|
|
#include "kernel.h"
|
2002-05-26 17:11:02 +00:00
|
|
|
|
#include "main_menu.h"
|
2002-07-15 11:02:12 +00:00
|
|
|
|
#include "debug_menu.h"
|
2002-05-31 20:27:40 +00:00
|
|
|
|
#include "sprintf.h"
|
|
|
|
|
#include <string.h>
|
2002-06-24 13:52:03 +00:00
|
|
|
|
#include "settings.h"
|
2002-06-24 21:40:41 +00:00
|
|
|
|
#include "settings_menu.h"
|
2002-08-12 11:08:50 +00:00
|
|
|
|
#include "power.h"
|
2002-08-07 11:23:36 +00:00
|
|
|
|
#include "powermgmt.h"
|
2002-06-24 21:40:41 +00:00
|
|
|
|
#include "sound_menu.h"
|
2002-10-15 12:56:05 +00:00
|
|
|
|
#include "status.h"
|
2002-11-12 11:32:26 +00:00
|
|
|
|
#include "fat.h"
|
2004-01-14 00:13:04 +00:00
|
|
|
|
#include "bookmark.h"
|
2003-05-09 16:01:21 +00:00
|
|
|
|
#include "buffer.h"
|
2003-06-01 01:01:37 +00:00
|
|
|
|
#include "screens.h"
|
2003-07-01 21:05:43 +00:00
|
|
|
|
#include "playlist_menu.h"
|
2004-03-19 22:15:53 +00:00
|
|
|
|
#include "talk.h"
|
2004-09-28 22:13:26 +00:00
|
|
|
|
#ifdef CONFIG_TUNER
|
2003-05-03 02:40:09 +00:00
|
|
|
|
#include "radio.h"
|
|
|
|
|
#endif
|
2004-07-24 21:26:41 +00:00
|
|
|
|
#include "misc.h"
|
2002-09-17 06:44:10 +00:00
|
|
|
|
#include "lang.h"
|
2005-05-30 13:00:43 +00:00
|
|
|
|
#include "logfdisp.h"
|
2005-09-02 05:39:09 +00:00
|
|
|
|
#include "plugin.h"
|
|
|
|
|
#include "filetypes.h"
|
2006-05-25 13:34:51 +00:00
|
|
|
|
#include "splash.h"
|
2002-09-17 06:44:10 +00:00
|
|
|
|
|
2005-02-04 10:57:51 +00:00
|
|
|
|
#ifdef HAVE_RECORDING
|
2002-11-10 16:42:31 +00:00
|
|
|
|
#include "recording.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-09-24 17:22:12 +00:00
|
|
|
|
bool show_credits(void)
|
2002-05-21 14:35:18 +00:00
|
|
|
|
{
|
2005-09-02 05:39:09 +00:00
|
|
|
|
plugin_load("/.rockbox/rocks/credits.rock",NULL);
|
2002-09-24 17:22:12 +00:00
|
|
|
|
return false;
|
2002-05-29 10:55:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-07-24 11:35:23 +00:00
|
|
|
|
#ifdef SIMULATOR
|
2002-09-24 17:22:12 +00:00
|
|
|
|
extern bool simulate_usb(void);
|
2002-07-24 11:35:23 +00:00
|
|
|
|
#endif
|
2005-05-06 18:12:16 +00:00
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
|
#define SIZE_FMT "%s%s"
|
|
|
|
|
#else
|
|
|
|
|
#define SIZE_FMT "%s %s"
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-09-24 17:22:12 +00:00
|
|
|
|
bool show_info(void)
|
2002-07-15 11:02:12 +00:00
|
|
|
|
{
|
2006-04-11 16:12:57 +00:00
|
|
|
|
char s[64], s1[32];
|
2006-05-25 13:34:51 +00:00
|
|
|
|
unsigned long size, free;
|
2005-04-05 11:33:58 +00:00
|
|
|
|
long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */
|
2002-10-15 07:21:34 +00:00
|
|
|
|
int key;
|
2006-05-25 13:34:51 +00:00
|
|
|
|
bool done = false;
|
|
|
|
|
bool new_info = true;
|
2005-05-06 18:12:16 +00:00
|
|
|
|
#ifdef HAVE_MULTIVOLUME
|
|
|
|
|
char s2[32];
|
2006-05-25 13:34:51 +00:00
|
|
|
|
unsigned long size2, free2;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
|
int page = 0;
|
2005-05-06 18:12:16 +00:00
|
|
|
|
#endif
|
2004-04-12 12:29:44 +00:00
|
|
|
|
|
2005-01-31 00:39:20 +00:00
|
|
|
|
const unsigned char *kbyte_units[] = {
|
|
|
|
|
ID2P(LANG_KILOBYTE),
|
|
|
|
|
ID2P(LANG_MEGABYTE),
|
|
|
|
|
ID2P(LANG_GIGABYTE)
|
|
|
|
|
};
|
2006-05-25 13:34:51 +00:00
|
|
|
|
|
|
|
|
|
while (!done)
|
|
|
|
|
{
|
|
|
|
|
int y=0;
|
2005-01-31 00:39:20 +00:00
|
|
|
|
|
2006-05-25 13:34:51 +00:00
|
|
|
|
if (new_info)
|
|
|
|
|
{
|
|
|
|
|
fat_size( IF_MV2(0,) &size, &free );
|
2005-05-06 18:12:16 +00:00
|
|
|
|
#ifdef HAVE_MULTIVOLUME
|
2006-05-25 13:34:51 +00:00
|
|
|
|
if (fat_ismounted(1))
|
|
|
|
|
fat_size( 1, &size2, &free2 );
|
|
|
|
|
else
|
|
|
|
|
size2 = 0;
|
2005-05-06 18:12:16 +00:00
|
|
|
|
#endif
|
2004-04-12 12:29:44 +00:00
|
|
|
|
|
2006-05-25 13:34:51 +00:00
|
|
|
|
if (global_settings.talk_menu)
|
|
|
|
|
{ /* say whatever is reasonable, no real connection to the screen */
|
|
|
|
|
bool enqueue = false; /* enqueue all but the first */
|
|
|
|
|
if (battery_level() >= 0)
|
|
|
|
|
{
|
|
|
|
|
talk_id(LANG_BATTERY_TIME, enqueue);
|
|
|
|
|
enqueue = true;
|
|
|
|
|
talk_value(battery_level(), UNIT_PERCENT, true);
|
|
|
|
|
}
|
2004-04-12 12:29:44 +00:00
|
|
|
|
|
2006-05-25 13:34:51 +00:00
|
|
|
|
talk_id(LANG_DISK_FREE_INFO, enqueue);
|
2005-05-06 18:12:16 +00:00
|
|
|
|
#ifdef HAVE_MULTIVOLUME
|
2006-05-25 13:34:51 +00:00
|
|
|
|
talk_id(LANG_DISK_NAME_INTERNAL, true);
|
|
|
|
|
output_dyn_value(NULL, 0, free, kbyte_units, true);
|
|
|
|
|
if (size2)
|
|
|
|
|
{
|
|
|
|
|
talk_id(LANG_DISK_NAME_MMC, true);
|
|
|
|
|
output_dyn_value(NULL, 0, free2, kbyte_units, true);
|
|
|
|
|
}
|
2005-05-06 18:12:16 +00:00
|
|
|
|
#else
|
2006-05-25 13:34:51 +00:00
|
|
|
|
output_dyn_value(NULL, 0, free, kbyte_units, true);
|
2005-05-06 18:12:16 +00:00
|
|
|
|
#endif
|
2004-04-12 12:29:44 +00:00
|
|
|
|
|
2005-12-04 15:23:47 +00:00
|
|
|
|
#ifdef CONFIG_RTC
|
2006-05-25 13:34:51 +00:00
|
|
|
|
{
|
|
|
|
|
struct tm* tm = get_time();
|
|
|
|
|
talk_id(VOICE_CURRENT_TIME, true);
|
|
|
|
|
talk_value(tm->tm_hour, UNIT_HOUR, true);
|
|
|
|
|
talk_value(tm->tm_min, UNIT_MIN, true);
|
|
|
|
|
talk_value(tm->tm_sec, UNIT_SEC, true);
|
|
|
|
|
talk_id(LANG_MONTH_JANUARY + tm->tm_mon, true);
|
|
|
|
|
talk_number(tm->tm_mday, true);
|
|
|
|
|
talk_number(1900 + tm->tm_year, true);
|
|
|
|
|
}
|
2004-04-12 12:29:44 +00:00
|
|
|
|
#endif
|
2006-05-25 13:34:51 +00:00
|
|
|
|
}
|
|
|
|
|
new_info = false;
|
|
|
|
|
}
|
2002-07-30 09:00:11 +00:00
|
|
|
|
|
|
|
|
|
lcd_clear_display();
|
2002-11-12 11:32:26 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
|
lcd_puts(0, y++, str(LANG_ROCKBOX_INFO));
|
|
|
|
|
y++;
|
|
|
|
|
#endif
|
|
|
|
|
|
2006-05-25 13:34:51 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
|
if (page == 0)
|
|
|
|
|
#endif
|
|
|
|
|
{
|
|
|
|
|
int integer = buflen / 1000;
|
|
|
|
|
int decimal = buflen % 1000;
|
|
|
|
|
|
2002-07-27 21:29:33 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
2005-12-05 22:44:42 +00:00
|
|
|
|
snprintf(s, sizeof(s), (char *)str(LANG_BUFFER_STAT_PLAYER),
|
2002-11-12 11:32:26 +00:00
|
|
|
|
integer, decimal);
|
2002-07-27 21:29:33 +00:00
|
|
|
|
#else
|
2005-12-05 22:44:42 +00:00
|
|
|
|
snprintf(s, sizeof(s), (char *)str(LANG_BUFFER_STAT_RECORDER),
|
2002-11-12 11:32:26 +00:00
|
|
|
|
integer, decimal);
|
2002-07-27 21:29:33 +00:00
|
|
|
|
#endif
|
2006-04-15 02:43:23 +00:00
|
|
|
|
lcd_puts_scroll(0, y++, (unsigned char *)s);
|
2005-05-06 18:12:16 +00:00
|
|
|
|
|
2002-08-12 11:08:50 +00:00
|
|
|
|
#ifdef HAVE_CHARGE_CTRL
|
2002-12-14 15:44:01 +00:00
|
|
|
|
if (charge_state == 1)
|
2005-12-05 22:44:42 +00:00
|
|
|
|
snprintf(s, sizeof(s), (char *)str(LANG_BATTERY_CHARGE));
|
2002-12-14 15:44:01 +00:00
|
|
|
|
else if (charge_state == 2)
|
2005-12-05 22:44:42 +00:00
|
|
|
|
snprintf(s, sizeof(s), (char *)str(LANG_BATTERY_TOPOFF_CHARGE));
|
2002-12-14 15:44:01 +00:00
|
|
|
|
else if (charge_state == 3)
|
2005-12-05 22:44:42 +00:00
|
|
|
|
snprintf(s, sizeof(s), (char *)str(LANG_BATTERY_TRICKLE_CHARGE));
|
2002-11-12 11:32:26 +00:00
|
|
|
|
else
|
2002-07-27 21:29:33 +00:00
|
|
|
|
#endif
|
2003-11-21 13:32:53 +00:00
|
|
|
|
if (battery_level() >= 0)
|
2005-12-05 22:44:42 +00:00
|
|
|
|
snprintf(s, sizeof(s), (char *)str(LANG_BATTERY_TIME), battery_level(),
|
2003-11-21 13:32:53 +00:00
|
|
|
|
battery_time() / 60, battery_time() % 60);
|
|
|
|
|
else
|
|
|
|
|
strncpy(s, "(n/a)", sizeof(s));
|
2006-04-15 02:43:23 +00:00
|
|
|
|
lcd_puts_scroll(0, y++, (unsigned char *)s);
|
2002-11-12 11:32:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-05-25 13:34:51 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
|
if (page == 1)
|
|
|
|
|
#endif
|
|
|
|
|
{
|
2005-05-06 18:12:16 +00:00
|
|
|
|
#ifdef HAVE_MULTIVOLUME
|
|
|
|
|
output_dyn_value(s1, sizeof s1, free, kbyte_units, true);
|
2005-01-31 00:39:20 +00:00
|
|
|
|
output_dyn_value(s2, sizeof s2, size, kbyte_units, true);
|
2005-05-06 18:12:16 +00:00
|
|
|
|
snprintf(s, sizeof s, "%s %s/%s", str(LANG_DISK_NAME_INTERNAL),
|
|
|
|
|
s1, s2);
|
2006-04-15 02:43:23 +00:00
|
|
|
|
lcd_puts_scroll(0, y++, (unsigned char *)s);
|
2005-01-31 00:39:20 +00:00
|
|
|
|
|
2005-05-06 18:12:16 +00:00
|
|
|
|
if (size2) {
|
|
|
|
|
output_dyn_value(s1, sizeof s1, free2, kbyte_units, true);
|
|
|
|
|
output_dyn_value(s2, sizeof s2, size2, kbyte_units, true);
|
|
|
|
|
snprintf(s, sizeof s, "%s %s/%s", str(LANG_DISK_NAME_MMC),
|
|
|
|
|
s1, s2);
|
2006-04-15 02:43:23 +00:00
|
|
|
|
lcd_puts_scroll(0, y++, (unsigned char *)s);
|
2005-05-06 18:12:16 +00:00
|
|
|
|
}
|
2005-01-31 01:27:48 +00:00
|
|
|
|
#else
|
2006-05-25 13:34:51 +00:00
|
|
|
|
output_dyn_value(s1, sizeof s1, size, kbyte_units, true);
|
|
|
|
|
snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_SIZE_INFO), s1);
|
|
|
|
|
lcd_puts_scroll(0, y++, (unsigned char *)s);
|
|
|
|
|
|
2005-05-06 18:12:16 +00:00
|
|
|
|
output_dyn_value(s1, sizeof s1, free, kbyte_units, true);
|
|
|
|
|
snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_FREE_INFO), s1);
|
2006-04-15 02:43:23 +00:00
|
|
|
|
lcd_puts_scroll(0, y++, (unsigned char *)s);
|
2005-05-06 18:12:16 +00:00
|
|
|
|
#endif
|
2002-11-12 11:32:26 +00:00
|
|
|
|
}
|
2006-05-25 13:34:51 +00:00
|
|
|
|
|
2002-07-30 09:00:11 +00:00
|
|
|
|
lcd_update();
|
2002-07-15 11:02:12 +00:00
|
|
|
|
|
2002-07-30 09:00:11 +00:00
|
|
|
|
/* Wait for a key to be pushed */
|
2002-11-12 11:32:26 +00:00
|
|
|
|
key = button_get_w_tmo(HZ*5);
|
|
|
|
|
switch(key) {
|
2004-09-24 17:46:38 +00:00
|
|
|
|
|
2004-09-19 21:58:37 +00:00
|
|
|
|
case SETTINGS_OK:
|
2004-09-24 17:46:38 +00:00
|
|
|
|
#ifdef SETTINGS_OK2
|
|
|
|
|
case SETTINGS_OK2:
|
|
|
|
|
#endif
|
2004-09-19 21:58:37 +00:00
|
|
|
|
case SETTINGS_CANCEL:
|
2002-11-12 11:32:26 +00:00
|
|
|
|
done = true;
|
2002-10-15 07:21:34 +00:00
|
|
|
|
break;
|
2002-11-12 11:32:26 +00:00
|
|
|
|
|
2006-05-25 13:34:51 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
2004-09-19 21:58:37 +00:00
|
|
|
|
case SETTINGS_INC:
|
|
|
|
|
case SETTINGS_DEC:
|
2006-05-25 13:34:51 +00:00
|
|
|
|
page = (page == 0) ? 1 : 0;
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
|
2006-05-25 13:52:24 +00:00
|
|
|
|
#ifndef SIMULATOR
|
2006-05-25 13:34:51 +00:00
|
|
|
|
#ifdef SETTINGS_ACCEPT
|
|
|
|
|
case SETTINGS_ACCEPT:
|
|
|
|
|
#else
|
|
|
|
|
case SETTINGS_INC: /* Ondio */
|
|
|
|
|
#endif
|
|
|
|
|
gui_syncsplash(0, true, str(LANG_DIRCACHE_BUILDING));
|
|
|
|
|
fat_recalc_free(IF_MV(0));
|
|
|
|
|
#ifdef HAVE_MULTIVOLUME
|
|
|
|
|
if (fat_ismounted(1))
|
|
|
|
|
fat_recalc_free(1);
|
|
|
|
|
#endif
|
|
|
|
|
new_info = true;
|
2002-10-15 07:21:34 +00:00
|
|
|
|
break;
|
2006-05-25 13:52:24 +00:00
|
|
|
|
#endif
|
2004-09-19 21:58:37 +00:00
|
|
|
|
|
2006-05-25 13:34:51 +00:00
|
|
|
|
default:
|
|
|
|
|
if (default_event_handler(key) == SYS_USB_CONNECTED)
|
|
|
|
|
return true;
|
|
|
|
|
break;
|
2002-10-15 07:21:34 +00:00
|
|
|
|
}
|
2002-07-30 09:00:11 +00:00
|
|
|
|
}
|
2002-08-23 12:32:52 +00:00
|
|
|
|
|
2002-09-24 17:22:12 +00:00
|
|
|
|
return false;
|
2002-07-23 06:21:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-09-29 21:26:53 +00:00
|
|
|
|
static bool plugin_browse(void)
|
|
|
|
|
{
|
2005-08-17 17:53:54 +00:00
|
|
|
|
return rockbox_browse(PLUGIN_DIR, SHOW_PLUGINS);
|
2003-09-29 21:26:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-11-18 15:33:05 +00:00
|
|
|
|
static bool custom_theme_browse(void)
|
|
|
|
|
{
|
|
|
|
|
return rockbox_browse(THEME_DIR, SHOW_CFG);
|
|
|
|
|
}
|
|
|
|
|
|
2005-02-04 10:57:51 +00:00
|
|
|
|
#ifdef HAVE_RECORDING
|
2005-02-04 11:19:54 +00:00
|
|
|
|
|
2003-11-20 00:33:43 +00:00
|
|
|
|
static bool recording_settings(void)
|
|
|
|
|
{
|
|
|
|
|
return recording_menu(false);
|
|
|
|
|
}
|
2004-03-12 10:20:33 +00:00
|
|
|
|
|
2004-01-14 14:42:31 +00:00
|
|
|
|
bool rec_menu(void)
|
|
|
|
|
{
|
|
|
|
|
int m;
|
|
|
|
|
bool result;
|
|
|
|
|
|
|
|
|
|
/* recording menu */
|
2004-07-23 23:01:20 +00:00
|
|
|
|
static const struct menu_item items[] = {
|
|
|
|
|
{ ID2P(LANG_RECORDING_MENU), recording_screen },
|
|
|
|
|
{ ID2P(LANG_RECORDING_SETTINGS), recording_settings},
|
2004-01-14 14:42:31 +00:00
|
|
|
|
};
|
|
|
|
|
|
2004-03-16 13:44:56 +00:00
|
|
|
|
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
|
|
|
|
NULL, NULL, NULL);
|
2004-01-14 14:42:31 +00:00
|
|
|
|
result = menu_run(m);
|
|
|
|
|
menu_exit(m);
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
bool info_menu(void)
|
|
|
|
|
{
|
|
|
|
|
int m;
|
|
|
|
|
bool result;
|
|
|
|
|
|
|
|
|
|
/* info menu */
|
2004-07-23 23:01:20 +00:00
|
|
|
|
static const struct menu_item items[] = {
|
|
|
|
|
{ ID2P(LANG_INFO_MENU), show_info },
|
|
|
|
|
{ ID2P(LANG_VERSION), show_credits },
|
2004-01-14 14:42:31 +00:00
|
|
|
|
#ifndef SIMULATOR
|
2004-07-23 23:01:20 +00:00
|
|
|
|
{ ID2P(LANG_DEBUG), debug_menu },
|
2004-01-14 14:42:31 +00:00
|
|
|
|
#else
|
2004-07-23 23:01:20 +00:00
|
|
|
|
{ ID2P(LANG_USB), simulate_usb },
|
2005-05-30 13:00:43 +00:00
|
|
|
|
#ifdef ROCKBOX_HAS_LOGF
|
|
|
|
|
{"logf", logfdisplay },
|
2005-06-01 13:07:37 +00:00
|
|
|
|
{"logfdump", logfdump },
|
2005-05-30 13:00:43 +00:00
|
|
|
|
#endif
|
2004-01-14 14:42:31 +00:00
|
|
|
|
#endif
|
|
|
|
|
};
|
|
|
|
|
|
2004-03-16 13:44:56 +00:00
|
|
|
|
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
|
|
|
|
NULL, NULL, NULL);
|
2004-01-14 14:42:31 +00:00
|
|
|
|
result = menu_run(m);
|
|
|
|
|
menu_exit(m);
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-05 00:03:18 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
2005-07-05 00:18:20 +00:00
|
|
|
|
static bool do_shutdown(void)
|
2005-07-05 00:03:18 +00:00
|
|
|
|
{
|
2005-09-14 09:08:26 +00:00
|
|
|
|
sys_poweroff();
|
2005-07-05 00:18:20 +00:00
|
|
|
|
return false;
|
2005-07-05 00:03:18 +00:00
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-09-24 17:22:12 +00:00
|
|
|
|
bool main_menu(void)
|
2002-05-21 14:35:18 +00:00
|
|
|
|
{
|
2002-05-26 17:11:02 +00:00
|
|
|
|
int m;
|
2002-09-24 17:22:12 +00:00
|
|
|
|
bool result;
|
2003-12-19 01:24:02 +00:00
|
|
|
|
int i = 0;
|
2002-05-26 17:11:02 +00:00
|
|
|
|
|
|
|
|
|
/* main menu */
|
2005-11-18 15:33:05 +00:00
|
|
|
|
struct menu_item items[11];
|
2004-01-14 00:13:04 +00:00
|
|
|
|
|
2005-06-23 01:31:26 +00:00
|
|
|
|
items[i].desc = ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS);
|
|
|
|
|
items[i++].function = bookmark_mrb_load;
|
2003-12-19 01:24:02 +00:00
|
|
|
|
|
2004-07-23 23:01:20 +00:00
|
|
|
|
items[i].desc = ID2P(LANG_SOUND_SETTINGS);
|
2003-12-19 01:24:02 +00:00
|
|
|
|
items[i++].function = sound_menu;
|
|
|
|
|
|
2004-07-23 23:01:20 +00:00
|
|
|
|
items[i].desc = ID2P(LANG_GENERAL_SETTINGS);
|
2003-12-19 01:24:02 +00:00
|
|
|
|
items[i++].function = settings_menu;
|
|
|
|
|
|
2005-07-04 09:24:31 +00:00
|
|
|
|
items[i].desc = ID2P(LANG_MANAGE_MENU);
|
|
|
|
|
items[i++].function = manage_settings_menu;
|
|
|
|
|
|
2005-11-18 15:33:05 +00:00
|
|
|
|
items[i].desc = ID2P(LANG_CUSTOM_THEME);
|
|
|
|
|
items[i++].function = custom_theme_browse;
|
|
|
|
|
|
2004-09-28 22:13:26 +00:00
|
|
|
|
#ifdef CONFIG_TUNER
|
2003-12-19 01:24:02 +00:00
|
|
|
|
if(radio_hardware_present()) {
|
2004-07-23 23:01:20 +00:00
|
|
|
|
items[i].desc = ID2P(LANG_FM_RADIO);
|
2003-12-19 01:24:02 +00:00
|
|
|
|
items[i++].function = radio_screen;
|
|
|
|
|
}
|
2003-05-03 02:40:09 +00:00
|
|
|
|
#endif
|
2003-12-19 01:24:02 +00:00
|
|
|
|
|
2005-02-04 11:19:54 +00:00
|
|
|
|
#ifdef HAVE_RECORDING
|
2004-07-23 23:01:20 +00:00
|
|
|
|
items[i].desc = ID2P(LANG_RECORDING);
|
2004-01-14 14:42:31 +00:00
|
|
|
|
items[i++].function = rec_menu;
|
2003-01-29 13:20:22 +00:00
|
|
|
|
#endif
|
2003-12-19 01:24:02 +00:00
|
|
|
|
|
2004-07-23 23:01:20 +00:00
|
|
|
|
items[i].desc = ID2P(LANG_PLAYLIST_MENU);
|
2003-12-19 01:24:02 +00:00
|
|
|
|
items[i++].function = playlist_menu;
|
|
|
|
|
|
2004-07-23 23:01:20 +00:00
|
|
|
|
items[i].desc = ID2P(LANG_PLUGINS);
|
2003-12-19 01:24:02 +00:00
|
|
|
|
items[i++].function = plugin_browse;
|
|
|
|
|
|
2004-07-23 23:01:20 +00:00
|
|
|
|
items[i].desc = ID2P(LANG_INFO);
|
2004-01-14 14:42:31 +00:00
|
|
|
|
items[i++].function = info_menu;
|
2002-05-26 17:11:02 +00:00
|
|
|
|
|
2004-10-12 10:59:04 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
2004-07-24 21:26:41 +00:00
|
|
|
|
items[i].desc = ID2P(LANG_SHUTDOWN);
|
2005-07-05 00:03:18 +00:00
|
|
|
|
items[i++].function = do_shutdown;
|
2004-10-12 10:59:04 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2004-03-16 13:44:56 +00:00
|
|
|
|
m=menu_init( items, i, NULL, NULL, NULL, NULL );
|
2002-08-13 09:16:18 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
2002-10-15 12:56:05 +00:00
|
|
|
|
status_set_param(true);
|
2002-08-13 09:16:18 +00:00
|
|
|
|
#endif
|
2002-08-23 12:32:52 +00:00
|
|
|
|
result = menu_run(m);
|
2002-08-13 09:16:18 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
2002-10-15 12:56:05 +00:00
|
|
|
|
status_set_param(false);
|
2002-08-13 09:16:18 +00:00
|
|
|
|
#endif
|
2002-05-26 17:11:02 +00:00
|
|
|
|
menu_exit(m);
|
2002-08-13 17:16:09 +00:00
|
|
|
|
|
|
|
|
|
settings_save();
|
2002-08-23 12:32:52 +00:00
|
|
|
|
return result;
|
2002-05-21 14:35:18 +00:00
|
|
|
|
}
|
2002-10-15 07:21:34 +00:00
|
|
|
|
|
|
|
|
|
/* -----------------------------------------------------------------
|
|
|
|
|
* vim: et sw=4 ts=8 sts=4 tw=78
|
|
|
|
|
*/
|