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"
|
2006-08-15 12:27:07 +00:00
|
|
|
|
#include "action.h"
|
2002-05-21 15:14:15 +00:00
|
|
|
|
#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"
|
2007-02-18 02:16:03 +00:00
|
|
|
|
#if 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
|
|
|
|
|
|
2005-02-04 10:57:51 +00:00
|
|
|
|
#ifdef HAVE_RECORDING
|
2005-02-04 11:19:54 +00:00
|
|
|
|
|
2006-08-28 22:38:41 +00:00
|
|
|
|
static bool rec_menu_recording_screen(void)
|
|
|
|
|
{
|
|
|
|
|
return recording_screen(false);
|
|
|
|
|
}
|
|
|
|
|
|
2003-11-20 00:33:43 +00:00
|
|
|
|
static bool recording_settings(void)
|
|
|
|
|
{
|
2006-08-28 22:38:41 +00:00
|
|
|
|
bool ret;
|
|
|
|
|
#ifdef HAVE_FMRADIO_IN
|
|
|
|
|
int rec_source = global_settings.rec_source;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
ret = recording_menu(false);
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FMRADIO_IN
|
|
|
|
|
if (rec_source != global_settings.rec_source)
|
|
|
|
|
{
|
|
|
|
|
if (rec_source == AUDIO_SRC_FMRADIO)
|
|
|
|
|
radio_stop();
|
|
|
|
|
/* If AUDIO_SRC_FMRADIO was selected from something else,
|
|
|
|
|
the recording screen will start the radio */
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
return ret;
|
2003-11-20 00:33:43 +00:00
|
|
|
|
}
|
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[] = {
|
2006-08-28 22:38:41 +00:00
|
|
|
|
{ ID2P(LANG_RECORDING_MENU), rec_menu_recording_screen },
|
2004-07-23 23:01:20 +00:00
|
|
|
|
{ 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
|
|
|
|
|
|
|
|
|
|
|
2007-02-08 04:33:41 +00:00
|
|
|
|
#if 0
|
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
|
|
|
|
{
|
2006-10-25 10:17:57 +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;
|
2006-12-11 21:05:35 +00:00
|
|
|
|
static bool inside_menu = false;
|
|
|
|
|
|
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
|
|
|
|
|
2006-12-11 21:05:35 +00:00
|
|
|
|
if(inside_menu) return false;
|
|
|
|
|
inside_menu = true;
|
|
|
|
|
|
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
|
|
|
|
|
2006-12-11 21:05:35 +00:00
|
|
|
|
inside_menu = false;
|
|
|
|
|
|
2002-08-23 12:32:52 +00:00
|
|
|
|
return result;
|
2002-05-21 14:35:18 +00:00
|
|
|
|
}
|
2007-02-08 04:33:41 +00:00
|
|
|
|
#endif
|
2002-10-15 07:21:34 +00:00
|
|
|
|
/* -----------------------------------------------------------------
|
|
|
|
|
* vim: et sw=4 ts=8 sts=4 tw=78
|
|
|
|
|
*/
|