2002-09-24 17:22:12 +00:00
|
|
|
|
/***************************************************************************
|
|
|
|
|
* __________ __ ___.
|
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
2007-02-28 01:36:32 +00:00
|
|
|
|
* Copyright (C) 2002 Bj<EFBFBD>rn Stenberg
|
2002-09-24 17:22:12 +00:00
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
****************************************************************************/
|
2005-11-22 21:55:05 +00:00
|
|
|
|
|
2002-09-24 17:22:12 +00:00
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include "backlight.h"
|
2006-08-15 12:27:07 +00:00
|
|
|
|
#include "action.h"
|
2002-09-24 17:22:12 +00:00
|
|
|
|
#include "lcd.h"
|
2006-10-12 20:45:31 +00:00
|
|
|
|
#ifdef HAVE_REMOTE_LCD
|
|
|
|
|
#include "lcd-remote.h"
|
|
|
|
|
#endif
|
2002-09-24 17:22:12 +00:00
|
|
|
|
#include "lang.h"
|
|
|
|
|
#include "icons.h"
|
|
|
|
|
#include "font.h"
|
2005-04-04 12:06:29 +00:00
|
|
|
|
#include "audio.h"
|
2004-01-05 20:42:51 +00:00
|
|
|
|
#include "mp3_playback.h"
|
2002-09-24 17:22:12 +00:00
|
|
|
|
#include "usb.h"
|
|
|
|
|
#include "settings.h"
|
2002-10-11 08:56:23 +00:00
|
|
|
|
#include "status.h"
|
2002-09-24 17:22:12 +00:00
|
|
|
|
#include "playlist.h"
|
2003-02-15 00:03:23 +00:00
|
|
|
|
#include "sprintf.h"
|
2003-06-29 16:33:04 +00:00
|
|
|
|
#include "kernel.h"
|
2003-07-17 20:29:51 +00:00
|
|
|
|
#include "power.h"
|
2003-07-18 22:01:13 +00:00
|
|
|
|
#include "system.h"
|
|
|
|
|
#include "powermgmt.h"
|
|
|
|
|
#include "adc.h"
|
2004-03-12 10:20:33 +00:00
|
|
|
|
#include "action.h"
|
2004-04-21 06:49:12 +00:00
|
|
|
|
#include "talk.h"
|
2004-07-24 21:26:41 +00:00
|
|
|
|
#include "misc.h"
|
2005-07-05 19:33:33 +00:00
|
|
|
|
#include "id3.h"
|
2004-10-12 00:02:51 +00:00
|
|
|
|
#include "screens.h"
|
2004-10-19 16:17:35 +00:00
|
|
|
|
#include "debug.h"
|
2005-02-19 16:23:30 +00:00
|
|
|
|
#include "led.h"
|
2005-04-01 13:41:03 +00:00
|
|
|
|
#include "sound.h"
|
2005-11-16 15:12:15 +00:00
|
|
|
|
#include "splash.h"
|
2005-11-20 01:02:14 +00:00
|
|
|
|
#include "statusbar.h"
|
2005-11-22 03:38:07 +00:00
|
|
|
|
#include "screen_access.h"
|
|
|
|
|
#include "quickscreen.h"
|
2006-04-21 06:20:02 +00:00
|
|
|
|
#include "pcmbuf.h"
|
2006-07-02 12:28:27 +00:00
|
|
|
|
#include "list.h"
|
2006-12-19 12:26:03 +00:00
|
|
|
|
#include "yesno.h"
|
2005-11-20 01:02:14 +00:00
|
|
|
|
|
2006-10-12 20:45:31 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
|
#include <bitmaps/usblogo.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_REMOTE_LCD
|
|
|
|
|
#include <bitmaps/remote_usblogo.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-02-19 16:23:30 +00:00
|
|
|
|
#ifdef HAVE_MMC
|
|
|
|
|
#include "ata_mmc.h"
|
|
|
|
|
#endif
|
2005-09-24 15:22:48 +00:00
|
|
|
|
#if CONFIG_CODEC == SWCODEC
|
|
|
|
|
#include "dsp.h"
|
|
|
|
|
#endif
|
2002-09-24 17:22:12 +00:00
|
|
|
|
|
2007-04-25 22:08:00 +00:00
|
|
|
|
#if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1))
|
2006-05-21 11:00:02 +00:00
|
|
|
|
#include "backdrop.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-10-11 08:56:23 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2005-08-11 18:21:14 +00:00
|
|
|
|
#define SCROLLBAR_WIDTH 6
|
2002-10-11 08:56:23 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2002-09-24 17:22:12 +00:00
|
|
|
|
void usb_screen(void)
|
|
|
|
|
{
|
2003-12-12 13:34:27 +00:00
|
|
|
|
#ifdef USB_NONE
|
|
|
|
|
/* nothing here! */
|
|
|
|
|
#else
|
2005-11-22 03:38:07 +00:00
|
|
|
|
int i;
|
2007-06-06 17:30:01 +00:00
|
|
|
|
#if LCD_DEPTH > 1
|
2006-05-21 11:00:02 +00:00
|
|
|
|
show_main_backdrop();
|
|
|
|
|
#endif
|
2007-04-25 21:44:56 +00:00
|
|
|
|
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
|
|
|
|
show_remote_main_backdrop();
|
|
|
|
|
#endif
|
2006-10-12 20:45:31 +00:00
|
|
|
|
|
|
|
|
|
FOR_NB_SCREENS(i)
|
2005-11-22 03:38:07 +00:00
|
|
|
|
screens[i].backlight_on();
|
2006-10-12 20:45:31 +00:00
|
|
|
|
|
|
|
|
|
#ifdef HAVE_REMOTE_LCD
|
|
|
|
|
lcd_remote_clear_display();
|
2006-10-30 11:33:38 +00:00
|
|
|
|
lcd_remote_bitmap(remote_usblogo,
|
2006-11-20 10:56:22 +00:00
|
|
|
|
(LCD_REMOTE_WIDTH-BMPWIDTH_remote_usblogo),
|
2006-10-12 20:45:31 +00:00
|
|
|
|
(LCD_REMOTE_HEIGHT-BMPHEIGHT_remote_usblogo)/2,
|
|
|
|
|
BMPWIDTH_remote_usblogo, BMPHEIGHT_remote_usblogo);
|
|
|
|
|
lcd_remote_update();
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
lcd_clear_display();
|
2006-10-21 12:02:14 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2006-11-20 10:56:22 +00:00
|
|
|
|
#ifdef HAVE_LCD_COLOR
|
|
|
|
|
lcd_bitmap_transparent(usblogo, (LCD_WIDTH-BMPWIDTH_usblogo),
|
|
|
|
|
(LCD_HEIGHT-BMPHEIGHT_usblogo)/2,
|
|
|
|
|
BMPWIDTH_usblogo, BMPHEIGHT_usblogo);
|
|
|
|
|
#else
|
|
|
|
|
lcd_bitmap(usblogo, (LCD_WIDTH-BMPWIDTH_usblogo),
|
2006-10-12 20:45:31 +00:00
|
|
|
|
(LCD_HEIGHT-BMPHEIGHT_usblogo)/2,
|
|
|
|
|
BMPWIDTH_usblogo, BMPHEIGHT_usblogo);
|
2006-11-20 10:56:22 +00:00
|
|
|
|
#endif /* HAVE_LCD_COLOR */
|
2006-10-12 20:45:31 +00:00
|
|
|
|
#else
|
|
|
|
|
lcd_double_height(false);
|
|
|
|
|
lcd_puts_scroll(0, 0, "[USB Mode]");
|
2005-11-22 03:38:07 +00:00
|
|
|
|
status_set_param(false);
|
|
|
|
|
status_set_audio(false);
|
|
|
|
|
status_set_usb(true);
|
|
|
|
|
#endif /* HAVE_LCD_BITMAP */
|
2007-04-06 22:55:00 +00:00
|
|
|
|
lcd_update();
|
2006-10-12 20:45:31 +00:00
|
|
|
|
|
2005-11-22 03:38:07 +00:00
|
|
|
|
gui_syncstatusbar_draw(&statusbars, true);
|
|
|
|
|
#ifdef SIMULATOR
|
|
|
|
|
while (button_get(true) & BUTTON_REL);
|
|
|
|
|
#else
|
2002-09-24 17:22:12 +00:00
|
|
|
|
usb_acknowledge(SYS_USB_CONNECTED_ACK);
|
2002-10-11 08:56:23 +00:00
|
|
|
|
while(usb_wait_for_disconnect_w_tmo(&button_queue, HZ)) {
|
|
|
|
|
if(usb_inserted()) {
|
2005-02-19 14:45:34 +00:00
|
|
|
|
#ifdef HAVE_MMC /* USB-MMC bridge can report activity */
|
|
|
|
|
led(mmc_usb_active(HZ));
|
2005-11-22 03:38:07 +00:00
|
|
|
|
#endif /* HAVE_MMC */
|
2005-11-20 01:02:14 +00:00
|
|
|
|
gui_syncstatusbar_draw(&statusbars, false);
|
2002-10-11 08:56:23 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2005-11-22 03:38:07 +00:00
|
|
|
|
#endif /* SIMULATOR */
|
2003-01-09 03:53:46 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
|
status_set_usb(false);
|
2005-11-22 03:38:07 +00:00
|
|
|
|
#endif /* HAVE_LCD_CHARCELLS */
|
|
|
|
|
FOR_NB_SCREENS(i)
|
|
|
|
|
screens[i].backlight_on();
|
2003-12-12 13:34:27 +00:00
|
|
|
|
#endif /* USB_NONE */
|
2002-09-24 17:22:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-10-12 00:02:51 +00:00
|
|
|
|
#ifdef HAVE_MMC
|
|
|
|
|
int mmc_remove_request(void)
|
|
|
|
|
{
|
|
|
|
|
struct event ev;
|
2005-11-22 04:15:27 +00:00
|
|
|
|
int i;
|
2005-11-22 03:38:07 +00:00
|
|
|
|
FOR_NB_SCREENS(i)
|
|
|
|
|
screens[i].clear_display();
|
2007-03-16 21:56:08 +00:00
|
|
|
|
gui_syncsplash(1, str(LANG_REMOVE_MMC));
|
2007-06-11 08:28:38 +00:00
|
|
|
|
if (talk_menus_enabled())
|
2004-11-12 22:19:29 +00:00
|
|
|
|
talk_id(LANG_REMOVE_MMC, false);
|
2005-07-05 19:33:33 +00:00
|
|
|
|
|
2004-10-12 00:02:51 +00:00
|
|
|
|
while (1)
|
|
|
|
|
{
|
|
|
|
|
queue_wait_w_tmo(&button_queue, &ev, HZ/2);
|
|
|
|
|
switch (ev.id)
|
|
|
|
|
{
|
2007-06-30 02:08:27 +00:00
|
|
|
|
case SYS_HOTSWAP_EXTRACTED:
|
|
|
|
|
return SYS_HOTSWAP_EXTRACTED;
|
2005-07-05 19:33:33 +00:00
|
|
|
|
|
2004-10-12 00:02:51 +00:00
|
|
|
|
case SYS_USB_DISCONNECTED:
|
|
|
|
|
return SYS_USB_DISCONNECTED;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2007-02-18 05:32:06 +00:00
|
|
|
|
#if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING)
|
2003-07-19 21:43:12 +00:00
|
|
|
|
|
2003-07-18 22:01:13 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2006-12-25 14:01:47 +00:00
|
|
|
|
static void charging_display_info(bool animate)
|
2003-07-18 22:01:13 +00:00
|
|
|
|
{
|
|
|
|
|
unsigned char charging_logo[36];
|
|
|
|
|
const int pox_x = (LCD_WIDTH - sizeof(charging_logo)) / 2;
|
2003-07-19 21:43:12 +00:00
|
|
|
|
const int pox_y = 32;
|
2003-07-18 22:01:13 +00:00
|
|
|
|
static unsigned phase = 3;
|
|
|
|
|
unsigned i;
|
|
|
|
|
char buf[32];
|
2003-12-03 07:05:13 +00:00
|
|
|
|
(void)buf;
|
2003-07-18 22:01:13 +00:00
|
|
|
|
|
2003-12-03 07:05:13 +00:00
|
|
|
|
#ifdef NEED_ATA_POWER_BATT_MEASURE
|
|
|
|
|
if (ide_powered()) /* FM and V2 can only measure when ATA power is on */
|
|
|
|
|
#endif
|
|
|
|
|
{
|
2006-10-30 11:33:38 +00:00
|
|
|
|
int battv = battery_voltage();
|
|
|
|
|
snprintf(buf, 32, " Batt: %d.%02dV %d%% ", battv / 100,
|
|
|
|
|
battv % 100, battery_level());
|
2003-12-03 07:05:13 +00:00
|
|
|
|
lcd_puts(0, 7, buf);
|
|
|
|
|
}
|
2003-07-18 22:01:13 +00:00
|
|
|
|
|
2006-06-06 22:23:52 +00:00
|
|
|
|
#if CONFIG_CHARGING == CHARGING_CONTROL
|
2003-07-19 21:43:12 +00:00
|
|
|
|
|
|
|
|
|
snprintf(buf, 32, "Charge mode:");
|
2003-07-18 22:01:13 +00:00
|
|
|
|
lcd_puts(0, 2, buf);
|
2003-07-19 21:43:12 +00:00
|
|
|
|
|
2006-06-06 22:23:52 +00:00
|
|
|
|
if (charge_state == CHARGING)
|
2003-07-19 21:43:12 +00:00
|
|
|
|
snprintf(buf, 32, str(LANG_BATTERY_CHARGE));
|
2006-06-06 22:23:52 +00:00
|
|
|
|
else if (charge_state == TOPOFF)
|
2003-07-19 21:43:12 +00:00
|
|
|
|
snprintf(buf, 32, str(LANG_BATTERY_TOPOFF_CHARGE));
|
2006-06-06 22:23:52 +00:00
|
|
|
|
else if (charge_state == TRICKLE)
|
2003-07-19 21:43:12 +00:00
|
|
|
|
snprintf(buf, 32, str(LANG_BATTERY_TRICKLE_CHARGE));
|
|
|
|
|
else
|
|
|
|
|
snprintf(buf, 32, "not charging");
|
|
|
|
|
|
|
|
|
|
lcd_puts(0, 3, buf);
|
2004-10-12 08:42:11 +00:00
|
|
|
|
if (!charger_enabled)
|
2003-07-18 22:01:13 +00:00
|
|
|
|
animate = false;
|
2006-06-06 22:23:52 +00:00
|
|
|
|
#endif /* CONFIG_CHARGING == CHARGING_CONTROL */
|
2003-07-18 22:01:13 +00:00
|
|
|
|
|
2005-07-05 19:33:33 +00:00
|
|
|
|
|
2003-07-18 22:01:13 +00:00
|
|
|
|
/* middle part */
|
|
|
|
|
memset(charging_logo+3, 0x00, 32);
|
|
|
|
|
charging_logo[0] = 0x3C;
|
|
|
|
|
charging_logo[1] = 0x24;
|
|
|
|
|
charging_logo[2] = charging_logo[35] = 0xFF;
|
2005-07-05 19:33:33 +00:00
|
|
|
|
|
2003-07-18 22:01:13 +00:00
|
|
|
|
if (!animate)
|
|
|
|
|
{ /* draw the outline */
|
|
|
|
|
/* middle part */
|
2005-07-06 22:58:02 +00:00
|
|
|
|
lcd_mono_bitmap(charging_logo, pox_x, pox_y + 8, sizeof(charging_logo), 8);
|
2005-06-28 23:15:47 +00:00
|
|
|
|
lcd_set_drawmode(DRMODE_FG);
|
2003-07-18 22:01:13 +00:00
|
|
|
|
/* upper line */
|
2005-07-05 19:33:33 +00:00
|
|
|
|
charging_logo[0] = charging_logo[1] = 0x00;
|
2003-07-18 22:01:13 +00:00
|
|
|
|
memset(charging_logo+2, 0x80, 34);
|
2005-07-06 22:58:02 +00:00
|
|
|
|
lcd_mono_bitmap(charging_logo, pox_x, pox_y, sizeof(charging_logo), 8);
|
2003-07-18 22:01:13 +00:00
|
|
|
|
/* lower line */
|
|
|
|
|
memset(charging_logo+2, 0x01, 34);
|
2005-07-06 22:58:02 +00:00
|
|
|
|
lcd_mono_bitmap(charging_logo, pox_x, pox_y + 16, sizeof(charging_logo), 8);
|
2005-06-28 23:15:47 +00:00
|
|
|
|
lcd_set_drawmode(DRMODE_SOLID);
|
2003-07-18 22:01:13 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{ /* animate the middle part */
|
|
|
|
|
for (i = 3; i<MIN(sizeof(charging_logo)-1, phase); i++)
|
|
|
|
|
{
|
|
|
|
|
if ((i-phase) % 8 == 0)
|
|
|
|
|
{ /* draw a "bubble" here */
|
|
|
|
|
unsigned bitpos;
|
|
|
|
|
bitpos = (phase + i/8) % 15; /* "bounce" effect */
|
2005-07-05 19:33:33 +00:00
|
|
|
|
if (bitpos > 7)
|
2003-07-18 22:01:13 +00:00
|
|
|
|
bitpos = 14 - bitpos;
|
|
|
|
|
charging_logo[i] = 0x01 << bitpos;
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-07-06 22:58:02 +00:00
|
|
|
|
lcd_mono_bitmap(charging_logo, pox_x, pox_y + 8, sizeof(charging_logo), 8);
|
2003-07-18 22:01:13 +00:00
|
|
|
|
phase++;
|
|
|
|
|
}
|
|
|
|
|
lcd_update();
|
|
|
|
|
}
|
2003-07-19 21:43:12 +00:00
|
|
|
|
#else /* not HAVE_LCD_BITMAP */
|
2004-11-21 00:17:59 +00:00
|
|
|
|
|
2007-03-26 07:52:13 +00:00
|
|
|
|
static unsigned long logo_chars[4];
|
2004-11-21 00:17:59 +00:00
|
|
|
|
static const unsigned char logo_pattern[] = {
|
2007-03-26 07:52:13 +00:00
|
|
|
|
0x07, 0x04, 0x1c, 0x14, 0x1c, 0x04, 0x07, 0, /* char 1 */
|
|
|
|
|
0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0, /* char 2 */
|
|
|
|
|
0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0, /* char 3 */
|
|
|
|
|
0x1f, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f, 0, /* char 4 */
|
2004-11-21 00:17:59 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static void logo_lock_patterns(bool on)
|
|
|
|
|
{
|
2005-07-05 19:33:33 +00:00
|
|
|
|
int i;
|
2004-11-21 00:17:59 +00:00
|
|
|
|
|
|
|
|
|
if (on)
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
logo_chars[i] = lcd_get_locked_pattern();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
lcd_unlock_pattern(logo_chars[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2006-12-25 14:01:47 +00:00
|
|
|
|
static void charging_display_info(bool animate)
|
2003-07-18 22:01:13 +00:00
|
|
|
|
{
|
2006-10-30 11:33:38 +00:00
|
|
|
|
int battv;
|
2004-11-21 00:17:59 +00:00
|
|
|
|
unsigned i, ypos;
|
|
|
|
|
static unsigned phase = 3;
|
2007-03-26 07:52:13 +00:00
|
|
|
|
char buf[32];
|
2004-11-21 00:17:59 +00:00
|
|
|
|
|
2006-10-30 11:33:38 +00:00
|
|
|
|
battv = battery_voltage();
|
2007-03-26 07:52:13 +00:00
|
|
|
|
snprintf(buf, sizeof(buf), " %d.%02dV", battv / 100, battv % 100);
|
|
|
|
|
lcd_puts(4, 1, buf);
|
2005-07-05 19:33:33 +00:00
|
|
|
|
|
2007-03-26 07:52:13 +00:00
|
|
|
|
memcpy(buf, logo_pattern, 32); /* copy logo patterns */
|
2004-11-21 00:17:59 +00:00
|
|
|
|
|
|
|
|
|
if (!animate) /* build the screen */
|
|
|
|
|
{
|
|
|
|
|
lcd_double_height(false);
|
|
|
|
|
lcd_puts(0, 0, "[Charging]");
|
2007-03-26 07:52:13 +00:00
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
lcd_putc(i, 1, logo_chars[i]);
|
2004-11-21 00:17:59 +00:00
|
|
|
|
}
|
|
|
|
|
else /* animate the logo */
|
|
|
|
|
{
|
|
|
|
|
for (i = 3; i < MIN(19, phase); i++)
|
|
|
|
|
{
|
|
|
|
|
if ((i - phase) % 5 == 0)
|
|
|
|
|
{ /* draw a "bubble" here */
|
|
|
|
|
ypos = (phase + i/5) % 9; /* "bounce" effect */
|
|
|
|
|
if (ypos > 4)
|
|
|
|
|
ypos = 8 - ypos;
|
2007-03-26 07:52:13 +00:00
|
|
|
|
buf[5 - ypos + 8 * (i/5)] |= 0x10 >> (i%5);
|
2004-11-21 00:17:59 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
phase++;
|
|
|
|
|
}
|
2005-07-05 19:33:33 +00:00
|
|
|
|
|
2004-11-21 00:17:59 +00:00
|
|
|
|
for (i = 0; i < 4; i++)
|
2007-03-26 07:52:13 +00:00
|
|
|
|
lcd_define_pattern(logo_chars[i], buf + 8 * i);
|
2007-04-06 22:55:00 +00:00
|
|
|
|
|
|
|
|
|
lcd_update();
|
2003-07-18 22:01:13 +00:00
|
|
|
|
}
|
2004-11-21 00:44:44 +00:00
|
|
|
|
#endif /* (not) HAVE_LCD_BITMAP */
|
2003-07-18 22:01:13 +00:00
|
|
|
|
|
2003-07-17 20:29:51 +00:00
|
|
|
|
/* blocks while charging, returns on event:
|
|
|
|
|
1 if charger cable was removed
|
|
|
|
|
2 if Off/Stop key was pressed
|
|
|
|
|
3 if On key was pressed
|
|
|
|
|
4 if USB was connected */
|
2006-10-30 11:33:38 +00:00
|
|
|
|
|
2003-07-17 20:29:51 +00:00
|
|
|
|
int charging_screen(void)
|
|
|
|
|
{
|
2005-02-12 12:51:06 +00:00
|
|
|
|
unsigned int button;
|
2003-07-17 20:29:51 +00:00
|
|
|
|
int rc = 0;
|
|
|
|
|
|
|
|
|
|
ide_power_enable(false); /* power down the disk, else would be spinning */
|
|
|
|
|
|
|
|
|
|
lcd_clear_display();
|
2004-11-20 22:43:38 +00:00
|
|
|
|
backlight_set_timeout(global_settings.backlight_timeout);
|
2005-05-30 05:57:19 +00:00
|
|
|
|
#ifdef HAVE_REMOTE_LCD
|
2005-05-30 00:00:22 +00:00
|
|
|
|
remote_backlight_set_timeout(global_settings.remote_backlight_timeout);
|
2005-05-30 05:57:19 +00:00
|
|
|
|
#endif
|
2005-11-23 20:12:33 +00:00
|
|
|
|
backlight_set_timeout_plugged(global_settings.backlight_timeout_plugged);
|
2005-11-20 01:02:14 +00:00
|
|
|
|
gui_syncstatusbar_draw(&statusbars, true);
|
2003-07-17 20:29:51 +00:00
|
|
|
|
|
2004-11-21 00:17:59 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
|
logo_lock_patterns(true);
|
2003-07-17 20:29:51 +00:00
|
|
|
|
#endif
|
2004-11-21 00:17:59 +00:00
|
|
|
|
charging_display_info(false);
|
|
|
|
|
|
2003-07-17 20:29:51 +00:00
|
|
|
|
do
|
|
|
|
|
{
|
2005-11-20 01:02:14 +00:00
|
|
|
|
gui_syncstatusbar_draw(&statusbars, false);
|
2003-07-18 22:01:13 +00:00
|
|
|
|
charging_display_info(true);
|
2006-08-15 12:27:07 +00:00
|
|
|
|
button = get_action(CONTEXT_STD,HZ/3);
|
|
|
|
|
if (button == ACTION_STD_OK)
|
2003-07-17 20:29:51 +00:00
|
|
|
|
rc = 2;
|
2005-07-11 19:14:26 +00:00
|
|
|
|
else if (usb_detect())
|
|
|
|
|
rc = 3;
|
|
|
|
|
else if (!charger_inserted())
|
|
|
|
|
rc = 1;
|
2003-07-17 20:29:51 +00:00
|
|
|
|
} while (!rc);
|
|
|
|
|
|
2004-11-21 00:17:59 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
|
logo_lock_patterns(false);
|
|
|
|
|
#endif
|
2006-08-15 12:27:07 +00:00
|
|
|
|
action_signalscreenchange();
|
2003-07-17 20:29:51 +00:00
|
|
|
|
return rc;
|
|
|
|
|
}
|
2006-06-06 22:23:52 +00:00
|
|
|
|
#endif /* CONFIG_CHARGING && !HAVE_POWEROFF_WHILE_CHARGING */
|
2003-07-17 20:29:51 +00:00
|
|
|
|
|
2006-08-16 13:25:45 +00:00
|
|
|
|
#ifdef HAVE_PITCHSCREEN
|
2006-11-06 09:19:40 +00:00
|
|
|
|
|
|
|
|
|
#define PITCH_MAX 2000
|
|
|
|
|
#define PITCH_MIN 500
|
|
|
|
|
#define PITCH_SMALL_DELTA 1
|
|
|
|
|
#define PITCH_BIG_DELTA 10
|
|
|
|
|
#define PITCH_NUDGE_DELTA 20
|
|
|
|
|
|
|
|
|
|
#define PITCH_MODE_ABSOLUTE 1
|
|
|
|
|
#define PITCH_MODE_SEMITONE -PITCH_MODE_ABSOLUTE
|
|
|
|
|
|
|
|
|
|
static int pitch_mode = PITCH_MODE_ABSOLUTE; /* 1 - absolute, -1 - semitone */
|
|
|
|
|
|
2002-09-24 17:22:12 +00:00
|
|
|
|
/* returns:
|
|
|
|
|
0 if no key was pressed
|
2006-03-21 07:59:23 +00:00
|
|
|
|
1 if USB was connected */
|
2006-04-21 06:11:24 +00:00
|
|
|
|
|
2006-12-25 14:01:47 +00:00
|
|
|
|
static void pitch_screen_draw(struct screen *display, int pitch, int pitch_mode)
|
2006-04-21 06:11:24 +00:00
|
|
|
|
{
|
|
|
|
|
unsigned char* ptr;
|
|
|
|
|
unsigned char buf[32];
|
|
|
|
|
int w, h;
|
|
|
|
|
|
2006-09-03 11:33:03 +00:00
|
|
|
|
display->clear_display();
|
2006-10-30 11:33:38 +00:00
|
|
|
|
|
2006-09-03 11:33:03 +00:00
|
|
|
|
if (display->nb_lines < 4) /* very small screen, just show the pitch value */
|
|
|
|
|
{
|
|
|
|
|
w = snprintf((char *)buf, sizeof(buf), "%s: %d.%d%%",str(LANG_SYSFONT_PITCH),
|
|
|
|
|
pitch / 10, pitch % 10 );
|
|
|
|
|
display->putsxy((display->width-(w*display->char_width))/2,
|
|
|
|
|
display->nb_lines/2,buf);
|
|
|
|
|
}
|
|
|
|
|
else /* bigger screen, show everything... */
|
|
|
|
|
{
|
2006-04-21 06:11:24 +00:00
|
|
|
|
|
2006-09-03 11:33:03 +00:00
|
|
|
|
/* UP: Pitch Up */
|
2006-11-06 09:19:40 +00:00
|
|
|
|
if (pitch_mode == PITCH_MODE_ABSOLUTE) {
|
|
|
|
|
ptr = str(LANG_SYSFONT_PITCH_UP);
|
|
|
|
|
} else {
|
|
|
|
|
ptr = str(LANG_SYSFONT_PITCH_UP_SEMITONE);
|
|
|
|
|
}
|
2006-09-03 11:33:03 +00:00
|
|
|
|
display->getstringsize(ptr,&w,&h);
|
|
|
|
|
display->putsxy((display->width-w)/2, 0, ptr);
|
|
|
|
|
display->mono_bitmap(bitmap_icons_7x8[Icon_UpArrow],
|
|
|
|
|
display->width/2 - 3, h, 7, 8);
|
|
|
|
|
|
|
|
|
|
/* DOWN: Pitch Down */
|
2006-11-06 09:19:40 +00:00
|
|
|
|
if (pitch_mode == PITCH_MODE_ABSOLUTE) {
|
|
|
|
|
ptr = str(LANG_SYSFONT_PITCH_DOWN);
|
|
|
|
|
} else {
|
|
|
|
|
ptr = str(LANG_SYSFONT_PITCH_DOWN_SEMITONE);
|
|
|
|
|
}
|
2006-09-03 11:33:03 +00:00
|
|
|
|
display->getstringsize(ptr,&w,&h);
|
|
|
|
|
display->putsxy((display->width-w)/2, display->height - h, ptr);
|
|
|
|
|
display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow],
|
|
|
|
|
display->width/2 - 3, display->height - h*2, 7, 8);
|
2006-10-30 11:33:38 +00:00
|
|
|
|
|
2006-09-03 11:33:03 +00:00
|
|
|
|
/* RIGHT: +2% */
|
|
|
|
|
ptr = "+2%";
|
|
|
|
|
display->getstringsize(ptr,&w,&h);
|
|
|
|
|
display->putsxy(display->width-w, (display->height-h)/2, ptr);
|
|
|
|
|
display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward],
|
|
|
|
|
display->width-w-8, (display->height-h)/2, 7, 8);
|
2006-10-30 11:33:38 +00:00
|
|
|
|
|
2006-09-03 11:33:03 +00:00
|
|
|
|
/* LEFT: -2% */
|
|
|
|
|
ptr = "-2%";
|
|
|
|
|
display->getstringsize(ptr,&w,&h);
|
|
|
|
|
display->putsxy(0, (display->height-h)/2, ptr);
|
|
|
|
|
display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward],
|
|
|
|
|
w+1, (display->height-h)/2, 7, 8);
|
2006-10-30 11:33:38 +00:00
|
|
|
|
|
2006-09-03 11:33:03 +00:00
|
|
|
|
/* "Pitch" */
|
|
|
|
|
snprintf((char *)buf, sizeof(buf), str(LANG_SYSFONT_PITCH));
|
|
|
|
|
display->getstringsize(buf,&w,&h);
|
|
|
|
|
display->putsxy((display->width-w)/2, (display->height/2)-h, buf);
|
|
|
|
|
/* "XX.X%" */
|
|
|
|
|
snprintf((char *)buf, sizeof(buf), "%d.%d%%",
|
|
|
|
|
pitch / 10, pitch % 10 );
|
|
|
|
|
display->getstringsize(buf,&w,&h);
|
|
|
|
|
display->putsxy((display->width-w)/2, display->height/2, buf);
|
|
|
|
|
}
|
2006-04-21 06:11:24 +00:00
|
|
|
|
|
2006-09-03 11:33:03 +00:00
|
|
|
|
display->update();
|
2006-04-21 06:11:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-11-06 09:19:40 +00:00
|
|
|
|
static int pitch_increase(int pitch, int delta,
|
|
|
|
|
bool allow_cutoff, bool redraw_screens) {
|
|
|
|
|
int new_pitch;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
if (delta < 0) {
|
|
|
|
|
if (pitch + delta >= PITCH_MIN) {
|
|
|
|
|
new_pitch = pitch + delta;
|
|
|
|
|
} else {
|
|
|
|
|
if (!allow_cutoff) {
|
|
|
|
|
return pitch;
|
|
|
|
|
}
|
|
|
|
|
new_pitch = PITCH_MIN;
|
|
|
|
|
}
|
|
|
|
|
} else if (delta > 0) {
|
|
|
|
|
if (pitch + delta <= PITCH_MAX) {
|
|
|
|
|
new_pitch = pitch + delta;
|
|
|
|
|
} else {
|
|
|
|
|
if (!allow_cutoff) {
|
|
|
|
|
return pitch;
|
|
|
|
|
}
|
|
|
|
|
new_pitch = PITCH_MAX;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
/* delta == 0 -> no real change */
|
|
|
|
|
return pitch;
|
|
|
|
|
}
|
|
|
|
|
sound_set_pitch(new_pitch);
|
|
|
|
|
|
|
|
|
|
if (redraw_screens) {
|
|
|
|
|
FOR_NB_SCREENS(i)
|
|
|
|
|
pitch_screen_draw(&screens[i], pitch, pitch_mode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new_pitch;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Factor for changing the pitch one half tone up.
|
|
|
|
|
The exact value is 2^(1/12) = 1.05946309436
|
|
|
|
|
But we use only integer arithmetics, so take
|
|
|
|
|
rounded factor multiplied by 10^5=100,000. This is
|
|
|
|
|
enough to get the same promille values as if we
|
|
|
|
|
had used floating point (checked with a spread
|
|
|
|
|
sheet).
|
|
|
|
|
*/
|
|
|
|
|
#define PITCH_SEMITONE_FACTOR 105946L
|
|
|
|
|
|
|
|
|
|
/* Some helpful constants. K is the scaling factor for SEMITONE.
|
|
|
|
|
N is for more accurate rounding
|
|
|
|
|
KN is K * N
|
|
|
|
|
*/
|
|
|
|
|
#define PITCH_K_FCT 100000UL
|
|
|
|
|
#define PITCH_N_FCT 10
|
|
|
|
|
#define PITCH_KN_FCT 1000000UL
|
|
|
|
|
|
|
|
|
|
static int pitch_increase_semitone(int pitch, bool up) {
|
|
|
|
|
uint32_t tmp;
|
|
|
|
|
uint32_t round_fct; /* How much to scale down at the end */
|
|
|
|
|
tmp = pitch;
|
|
|
|
|
if (up) {
|
|
|
|
|
tmp = tmp * PITCH_SEMITONE_FACTOR;
|
|
|
|
|
round_fct = PITCH_K_FCT;
|
|
|
|
|
} else {
|
|
|
|
|
tmp = (tmp * PITCH_KN_FCT) / PITCH_SEMITONE_FACTOR;
|
|
|
|
|
round_fct = PITCH_N_FCT;
|
|
|
|
|
}
|
|
|
|
|
/* Scaling down with rounding */
|
|
|
|
|
tmp = (tmp + round_fct / 2) / round_fct;
|
|
|
|
|
return pitch_increase(pitch, tmp - pitch, false, false);
|
|
|
|
|
}
|
|
|
|
|
|
2006-03-21 07:59:23 +00:00
|
|
|
|
bool pitch_screen(void)
|
2002-09-24 17:22:12 +00:00
|
|
|
|
{
|
2004-07-26 16:06:59 +00:00
|
|
|
|
int button;
|
2005-05-22 12:45:35 +00:00
|
|
|
|
int pitch = sound_get_pitch();
|
2006-11-06 09:19:40 +00:00
|
|
|
|
int new_pitch;
|
|
|
|
|
bool nudged = false;
|
2002-09-24 17:22:12 +00:00
|
|
|
|
bool exit = false;
|
2006-09-03 11:33:03 +00:00
|
|
|
|
int i;
|
2002-09-24 17:22:12 +00:00
|
|
|
|
|
2006-04-21 06:11:24 +00:00
|
|
|
|
#if CONFIG_CODEC == SWCODEC
|
2006-04-21 06:20:02 +00:00
|
|
|
|
pcmbuf_set_low_latency(true);
|
2006-04-21 06:11:24 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2006-08-16 13:25:45 +00:00
|
|
|
|
action_signalscreenchange();
|
2006-04-21 06:11:24 +00:00
|
|
|
|
while (!exit)
|
|
|
|
|
{
|
2006-09-03 11:33:03 +00:00
|
|
|
|
FOR_NB_SCREENS(i)
|
2006-11-06 09:19:40 +00:00
|
|
|
|
pitch_screen_draw(&screens[i], pitch, pitch_mode);
|
2006-04-21 06:11:24 +00:00
|
|
|
|
|
2006-08-16 13:25:45 +00:00
|
|
|
|
button = get_action(CONTEXT_PITCHSCREEN,TIMEOUT_BLOCK);
|
2004-07-26 16:06:59 +00:00
|
|
|
|
switch (button) {
|
2006-08-16 14:14:16 +00:00
|
|
|
|
case ACTION_PS_INC_SMALL:
|
2006-11-06 09:19:40 +00:00
|
|
|
|
if (pitch_mode == PITCH_MODE_ABSOLUTE) {
|
|
|
|
|
pitch = pitch_increase(pitch, PITCH_SMALL_DELTA, true, false);
|
|
|
|
|
} else {
|
|
|
|
|
pitch = pitch_increase_semitone(pitch, true);
|
|
|
|
|
}
|
2002-09-24 17:22:12 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2006-08-16 14:14:16 +00:00
|
|
|
|
case ACTION_PS_INC_BIG:
|
2006-11-06 09:19:40 +00:00
|
|
|
|
if (pitch_mode == PITCH_MODE_ABSOLUTE) {
|
|
|
|
|
pitch = pitch_increase(pitch, PITCH_BIG_DELTA, true, false);
|
|
|
|
|
}
|
2006-04-21 06:11:24 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2006-08-16 14:14:16 +00:00
|
|
|
|
case ACTION_PS_DEC_SMALL:
|
2006-11-06 09:19:40 +00:00
|
|
|
|
if (pitch_mode == PITCH_MODE_ABSOLUTE) {
|
|
|
|
|
pitch = pitch_increase(pitch, -PITCH_SMALL_DELTA, true, false);
|
|
|
|
|
} else {
|
|
|
|
|
pitch = pitch_increase_semitone(pitch, false);
|
|
|
|
|
}
|
2002-09-24 17:22:12 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2006-08-16 14:14:16 +00:00
|
|
|
|
case ACTION_PS_DEC_BIG:
|
2006-11-06 09:19:40 +00:00
|
|
|
|
if (pitch_mode == PITCH_MODE_ABSOLUTE) {
|
|
|
|
|
pitch = pitch_increase(pitch, -PITCH_BIG_DELTA, true, false);
|
|
|
|
|
}
|
2006-04-21 06:11:24 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2006-08-16 13:25:45 +00:00
|
|
|
|
case ACTION_PS_NUDGE_RIGHT:
|
2006-11-06 09:19:40 +00:00
|
|
|
|
new_pitch = pitch_increase(pitch, PITCH_NUDGE_DELTA, false, true);
|
|
|
|
|
nudged = (new_pitch != pitch);
|
|
|
|
|
pitch = new_pitch;
|
2002-10-18 12:05:15 +00:00
|
|
|
|
break;
|
2006-08-16 13:25:45 +00:00
|
|
|
|
case ACTION_PS_NUDGE_RIGHTOFF:
|
2006-11-06 09:19:40 +00:00
|
|
|
|
if (nudged) {
|
|
|
|
|
pitch = pitch_increase(pitch, -PITCH_NUDGE_DELTA, false, false);
|
|
|
|
|
}
|
|
|
|
|
nudged = false;
|
2006-08-16 13:25:45 +00:00
|
|
|
|
break;
|
2002-10-18 12:05:15 +00:00
|
|
|
|
|
2006-08-16 13:25:45 +00:00
|
|
|
|
case ACTION_PS_NUDGE_LEFT:
|
2006-11-06 09:19:40 +00:00
|
|
|
|
new_pitch = pitch_increase(pitch, -PITCH_NUDGE_DELTA, false, true);
|
|
|
|
|
nudged = (new_pitch != pitch);
|
|
|
|
|
pitch = new_pitch;
|
2006-08-16 14:14:16 +00:00
|
|
|
|
break;
|
2006-11-06 09:19:40 +00:00
|
|
|
|
|
2006-08-16 13:25:45 +00:00
|
|
|
|
case ACTION_PS_NUDGE_LEFTOFF:
|
2006-11-06 09:19:40 +00:00
|
|
|
|
if (nudged) {
|
|
|
|
|
pitch = pitch_increase(pitch, PITCH_NUDGE_DELTA, false, false);
|
|
|
|
|
}
|
|
|
|
|
nudged = false;
|
2002-09-24 17:22:12 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2006-08-16 13:25:45 +00:00
|
|
|
|
case ACTION_PS_RESET:
|
2006-03-04 15:35:29 +00:00
|
|
|
|
pitch = 1000;
|
|
|
|
|
sound_set_pitch( pitch );
|
|
|
|
|
break;
|
|
|
|
|
|
2006-11-06 09:19:40 +00:00
|
|
|
|
case ACTION_PS_TOGGLE_MODE:
|
|
|
|
|
pitch_mode = -pitch_mode;
|
|
|
|
|
break;
|
|
|
|
|
|
2006-08-16 14:14:16 +00:00
|
|
|
|
case ACTION_PS_EXIT:
|
2006-03-21 07:59:23 +00:00
|
|
|
|
exit = true;
|
|
|
|
|
break;
|
|
|
|
|
|
2004-07-26 16:06:59 +00:00
|
|
|
|
default:
|
|
|
|
|
if(default_event_handler(button) == SYS_USB_CONNECTED)
|
2006-03-21 07:59:23 +00:00
|
|
|
|
return 1;
|
2004-07-26 16:06:59 +00:00
|
|
|
|
break;
|
2002-09-24 17:22:12 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2006-04-21 06:11:24 +00:00
|
|
|
|
#if CONFIG_CODEC == SWCODEC
|
|
|
|
|
pcmbuf_set_low_latency(false);
|
|
|
|
|
#endif
|
2002-10-02 10:58:31 +00:00
|
|
|
|
lcd_setfont(FONT_UI);
|
2006-08-15 12:27:07 +00:00
|
|
|
|
action_signalscreenchange();
|
2006-03-21 07:59:23 +00:00
|
|
|
|
return 0;
|
2002-09-24 17:22:12 +00:00
|
|
|
|
}
|
2006-08-16 13:25:45 +00:00
|
|
|
|
#endif /* HAVE_PITCHSCREEN */
|
2006-03-21 07:59:23 +00:00
|
|
|
|
|
2006-04-10 03:51:17 +00:00
|
|
|
|
#ifdef HAVE_QUICKSCREEN
|
|
|
|
|
|
2005-11-22 03:38:07 +00:00
|
|
|
|
#define bool_to_int(b)\
|
|
|
|
|
b?1:0
|
|
|
|
|
#define int_to_bool(i)\
|
|
|
|
|
i==0?false:true
|
2004-03-12 10:20:33 +00:00
|
|
|
|
|
2006-12-25 14:01:47 +00:00
|
|
|
|
static void quick_screen_quick_apply(struct gui_quickscreen *qs)
|
2005-11-22 03:38:07 +00:00
|
|
|
|
{
|
2005-12-05 23:37:14 +00:00
|
|
|
|
global_settings.playlist_shuffle=int_to_bool(qs->left_option->option);
|
|
|
|
|
global_settings.dirfilter=qs->bottom_option->option;
|
|
|
|
|
global_settings.repeat_mode=qs->right_option->option;
|
2005-11-22 03:38:07 +00:00
|
|
|
|
}
|
2005-08-21 23:01:12 +00:00
|
|
|
|
|
2005-11-22 21:55:05 +00:00
|
|
|
|
bool quick_screen_quick(int button_enter)
|
2005-11-22 03:38:07 +00:00
|
|
|
|
{
|
2006-04-20 15:41:24 +00:00
|
|
|
|
bool res, oldshuffle;
|
2005-11-22 03:38:07 +00:00
|
|
|
|
struct option_select left_option;
|
|
|
|
|
struct option_select bottom_option;
|
|
|
|
|
struct option_select right_option;
|
2006-04-20 15:41:24 +00:00
|
|
|
|
int oldrepeat, old_x_margin, old_y_margin;
|
2006-04-02 10:41:16 +00:00
|
|
|
|
|
2005-11-22 08:46:21 +00:00
|
|
|
|
static const struct opt_items left_items[] = {
|
2006-08-07 21:24:22 +00:00
|
|
|
|
[0]={ STR(LANG_SYSFONT_OFF) },
|
|
|
|
|
[1]={ STR(LANG_SYSFONT_ON) }
|
2005-11-22 03:38:07 +00:00
|
|
|
|
};
|
2005-11-22 08:44:53 +00:00
|
|
|
|
static const struct opt_items bottom_items[] = {
|
2006-08-07 21:24:22 +00:00
|
|
|
|
[SHOW_ALL]={ STR(LANG_SYSFONT_FILTER_ALL) },
|
|
|
|
|
[SHOW_SUPPORTED]={ STR(LANG_SYSFONT_FILTER_SUPPORTED) },
|
|
|
|
|
[SHOW_MUSIC]={ STR(LANG_SYSFONT_FILTER_MUSIC) },
|
|
|
|
|
[SHOW_PLAYLIST]={ STR(LANG_SYSFONT_FILTER_PLAYLIST) },
|
2005-11-22 03:38:07 +00:00
|
|
|
|
};
|
2005-11-22 08:44:53 +00:00
|
|
|
|
static const struct opt_items right_items[] = {
|
2006-08-07 21:24:22 +00:00
|
|
|
|
[REPEAT_OFF]={ STR(LANG_SYSFONT_OFF) },
|
|
|
|
|
[REPEAT_ALL]={ STR(LANG_SYSFONT_REPEAT_ALL) },
|
|
|
|
|
[REPEAT_ONE]={ STR(LANG_SYSFONT_REPEAT_ONE) },
|
|
|
|
|
[REPEAT_SHUFFLE]={ STR(LANG_SYSFONT_SHUFFLE) },
|
2007-02-17 23:07:39 +00:00
|
|
|
|
#ifdef AB_REPEAT_ENABLE
|
2006-08-07 21:24:22 +00:00
|
|
|
|
[REPEAT_AB]={ STR(LANG_SYSFONT_REPEAT_AB) }
|
2005-08-21 23:01:12 +00:00
|
|
|
|
#endif
|
2005-11-22 03:38:07 +00:00
|
|
|
|
};
|
|
|
|
|
struct gui_quickscreen qs;
|
|
|
|
|
|
2006-05-24 07:32:36 +00:00
|
|
|
|
old_x_margin = lcd_getxmargin();
|
|
|
|
|
old_y_margin = lcd_getymargin();
|
|
|
|
|
lcd_setmargins(0, 0);
|
|
|
|
|
|
2005-11-22 03:38:07 +00:00
|
|
|
|
option_select_init_items(&left_option,
|
2006-08-07 21:24:22 +00:00
|
|
|
|
(char *)str(LANG_SYSFONT_SHUFFLE),
|
2005-11-22 03:38:07 +00:00
|
|
|
|
bool_to_int(global_settings.playlist_shuffle),
|
|
|
|
|
left_items,
|
|
|
|
|
2);
|
|
|
|
|
option_select_init_items(&bottom_option,
|
2006-08-07 21:24:22 +00:00
|
|
|
|
(char *)str(LANG_SYSFONT_FILTER),
|
2005-11-22 03:38:07 +00:00
|
|
|
|
global_settings.dirfilter,
|
|
|
|
|
bottom_items,
|
|
|
|
|
sizeof(bottom_items)/sizeof(struct opt_items));
|
|
|
|
|
option_select_init_items(&right_option,
|
2006-08-07 21:24:22 +00:00
|
|
|
|
(char *)str(LANG_SYSFONT_REPEAT),
|
2005-11-22 03:38:07 +00:00
|
|
|
|
global_settings.repeat_mode,
|
|
|
|
|
right_items,
|
|
|
|
|
sizeof(right_items)/sizeof(struct opt_items));
|
|
|
|
|
|
|
|
|
|
gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option,
|
2006-04-11 06:38:10 +00:00
|
|
|
|
&quick_screen_quick_apply);
|
2005-11-22 03:38:07 +00:00
|
|
|
|
oldrepeat=global_settings.repeat_mode;
|
2005-12-23 00:55:01 +00:00
|
|
|
|
oldshuffle=global_settings.playlist_shuffle;
|
2005-11-22 21:55:05 +00:00
|
|
|
|
res=gui_syncquickscreen_run(&qs, button_enter);
|
2005-11-22 03:38:07 +00:00
|
|
|
|
if(!res)
|
|
|
|
|
{
|
|
|
|
|
if ( oldrepeat != global_settings.repeat_mode &&
|
|
|
|
|
(audio_status() & AUDIO_STATUS_PLAY) )
|
|
|
|
|
audio_flush_and_reload_tracks();
|
2005-12-23 00:55:01 +00:00
|
|
|
|
if(oldshuffle != global_settings.playlist_shuffle
|
2005-11-22 03:38:07 +00:00
|
|
|
|
&& audio_status() & AUDIO_STATUS_PLAY)
|
|
|
|
|
{
|
2005-09-24 15:56:33 +00:00
|
|
|
|
#if CONFIG_CODEC == SWCODEC
|
2007-02-24 17:06:36 +00:00
|
|
|
|
dsp_set_replaygain();
|
2005-06-26 20:16:26 +00:00
|
|
|
|
#endif
|
2005-11-22 03:38:07 +00:00
|
|
|
|
if (global_settings.playlist_shuffle)
|
|
|
|
|
playlist_randomise(NULL, current_tick, true);
|
|
|
|
|
else
|
|
|
|
|
playlist_sort(NULL, true);
|
2002-09-24 17:22:12 +00:00
|
|
|
|
}
|
2005-11-22 03:38:07 +00:00
|
|
|
|
settings_save();
|
2002-09-24 17:22:12 +00:00
|
|
|
|
}
|
2006-04-02 10:41:16 +00:00
|
|
|
|
lcd_setmargins(old_x_margin, old_y_margin);
|
2005-11-22 03:38:07 +00:00
|
|
|
|
return(res);
|
|
|
|
|
}
|
2002-09-24 17:22:12 +00:00
|
|
|
|
|
2005-11-22 08:44:53 +00:00
|
|
|
|
#ifdef BUTTON_F3
|
2006-12-25 14:01:47 +00:00
|
|
|
|
static void quick_screen_f3_apply(struct gui_quickscreen *qs)
|
2005-11-22 03:38:07 +00:00
|
|
|
|
{
|
2005-12-06 00:53:58 +00:00
|
|
|
|
global_settings.scrollbar=int_to_bool(qs->left_option->option);
|
2004-03-12 10:20:33 +00:00
|
|
|
|
|
2005-12-06 00:53:58 +00:00
|
|
|
|
global_settings.flip_display=int_to_bool(qs->bottom_option->option);
|
2005-11-22 03:38:07 +00:00
|
|
|
|
button_set_flip(global_settings.flip_display);
|
|
|
|
|
lcd_set_flip(global_settings.flip_display);
|
2005-07-05 19:33:33 +00:00
|
|
|
|
|
2005-12-06 00:53:58 +00:00
|
|
|
|
global_settings.statusbar=int_to_bool(qs->right_option->option);
|
2005-11-22 03:38:07 +00:00
|
|
|
|
gui_syncstatusbar_draw(&statusbars, true);
|
|
|
|
|
}
|
2002-09-24 17:22:12 +00:00
|
|
|
|
|
2005-11-22 21:55:05 +00:00
|
|
|
|
bool quick_screen_f3(int button_enter)
|
2005-11-22 03:38:07 +00:00
|
|
|
|
{
|
|
|
|
|
bool res;
|
|
|
|
|
struct option_select left_option;
|
|
|
|
|
struct option_select bottom_option;
|
|
|
|
|
struct option_select right_option;
|
2006-04-02 10:41:16 +00:00
|
|
|
|
int old_x_margin, old_y_margin;
|
|
|
|
|
|
2005-11-22 08:44:53 +00:00
|
|
|
|
static const struct opt_items onoff_items[] = {
|
2006-08-07 21:24:22 +00:00
|
|
|
|
[0]={ STR(LANG_SYSFONT_OFF) },
|
|
|
|
|
[1]={ STR(LANG_SYSFONT_ON) }
|
2005-11-22 03:38:07 +00:00
|
|
|
|
};
|
2005-11-22 08:44:53 +00:00
|
|
|
|
static const struct opt_items yesno_items[] = {
|
2006-08-07 21:24:22 +00:00
|
|
|
|
[0]={ STR(LANG_SYSFONT_SET_BOOL_NO) },
|
|
|
|
|
[1]={ STR(LANG_SYSFONT_SET_BOOL_YES) }
|
2005-11-22 03:38:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct gui_quickscreen qs;
|
|
|
|
|
|
2006-05-24 07:32:36 +00:00
|
|
|
|
old_x_margin = lcd_getxmargin();
|
|
|
|
|
old_y_margin = lcd_getymargin();
|
|
|
|
|
lcd_setmargins(0, 0);
|
|
|
|
|
|
2005-11-22 03:38:07 +00:00
|
|
|
|
option_select_init_items(&left_option,
|
2006-08-07 21:24:22 +00:00
|
|
|
|
str(LANG_SYSFONT_SCROLL_BAR),
|
2005-11-22 03:38:07 +00:00
|
|
|
|
bool_to_int(global_settings.scrollbar),
|
|
|
|
|
onoff_items,
|
|
|
|
|
2);
|
|
|
|
|
option_select_init_items(&bottom_option,
|
2006-08-07 21:24:22 +00:00
|
|
|
|
str(LANG_SYSFONT_FLIP_DISPLAY),
|
2005-11-22 03:38:07 +00:00
|
|
|
|
bool_to_int(global_settings.flip_display),
|
|
|
|
|
yesno_items,
|
|
|
|
|
2);
|
|
|
|
|
option_select_init_items(&right_option,
|
2006-08-07 21:24:22 +00:00
|
|
|
|
str(LANG_SYSFONT_STATUS_BAR),
|
2005-11-22 03:38:07 +00:00
|
|
|
|
bool_to_int(global_settings.statusbar),
|
|
|
|
|
onoff_items,
|
|
|
|
|
2);
|
|
|
|
|
gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option,
|
2006-04-11 06:38:10 +00:00
|
|
|
|
&quick_screen_f3_apply);
|
2005-11-22 21:55:05 +00:00
|
|
|
|
res=gui_syncquickscreen_run(&qs, button_enter);
|
2005-11-22 03:38:07 +00:00
|
|
|
|
if(!res)
|
|
|
|
|
settings_save();
|
2006-04-02 10:41:16 +00:00
|
|
|
|
lcd_setmargins(old_x_margin, old_y_margin);
|
2005-11-22 03:38:07 +00:00
|
|
|
|
return(res);
|
2002-09-24 17:22:12 +00:00
|
|
|
|
}
|
2005-11-22 08:44:53 +00:00
|
|
|
|
#endif /* BUTTON_F3 */
|
|
|
|
|
#endif /* CONFIG_KEYPAD in (RECORDER_PAD |IRIVER_H100_PAD | IRIVER_H300_PAD) */
|
2003-03-17 19:32:12 +00:00
|
|
|
|
|
2007-02-18 05:32:06 +00:00
|
|
|
|
#if CONFIG_CHARGING || defined(SIMULATOR)
|
2003-12-04 00:08:25 +00:00
|
|
|
|
void charging_splash(void)
|
|
|
|
|
{
|
2007-03-16 21:56:08 +00:00
|
|
|
|
gui_syncsplash(2*HZ, (unsigned char *)str(LANG_BATTERY_CHARGE));
|
2005-01-26 22:48:25 +00:00
|
|
|
|
button_clear_queue();
|
2003-12-04 00:08:25 +00:00
|
|
|
|
}
|
2005-05-07 01:30:16 +00:00
|
|
|
|
#endif
|
2004-04-21 06:49:12 +00:00
|
|
|
|
|
|
|
|
|
|
2007-03-16 23:47:03 +00:00
|
|
|
|
#if defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0)
|
2004-04-21 06:49:12 +00:00
|
|
|
|
|
2006-03-18 22:42:02 +00:00
|
|
|
|
const int dayname[] = {
|
|
|
|
|
LANG_WEEKDAY_SUNDAY,
|
|
|
|
|
LANG_WEEKDAY_MONDAY,
|
|
|
|
|
LANG_WEEKDAY_TUESDAY,
|
|
|
|
|
LANG_WEEKDAY_WEDNESDAY,
|
|
|
|
|
LANG_WEEKDAY_THURSDAY,
|
|
|
|
|
LANG_WEEKDAY_FRIDAY,
|
|
|
|
|
LANG_WEEKDAY_SATURDAY
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const int monthname[] = {
|
|
|
|
|
LANG_MONTH_JANUARY,
|
|
|
|
|
LANG_MONTH_FEBRUARY,
|
|
|
|
|
LANG_MONTH_MARCH,
|
|
|
|
|
LANG_MONTH_APRIL,
|
|
|
|
|
LANG_MONTH_MAY,
|
|
|
|
|
LANG_MONTH_JUNE,
|
|
|
|
|
LANG_MONTH_JULY,
|
|
|
|
|
LANG_MONTH_AUGUST,
|
|
|
|
|
LANG_MONTH_SEPTEMBER,
|
|
|
|
|
LANG_MONTH_OCTOBER,
|
|
|
|
|
LANG_MONTH_NOVEMBER,
|
|
|
|
|
LANG_MONTH_DECEMBER
|
|
|
|
|
};
|
|
|
|
|
|
2004-04-21 06:49:12 +00:00
|
|
|
|
/* little helper function for voice output */
|
2004-08-18 01:09:31 +00:00
|
|
|
|
static void say_time(int cursorpos, const struct tm *tm)
|
2004-04-21 06:49:12 +00:00
|
|
|
|
{
|
2004-08-26 20:30:22 +00:00
|
|
|
|
static const int unit[] = { UNIT_HOUR, UNIT_MIN, UNIT_SEC, 0, 0, 0 };
|
2004-04-21 06:49:12 +00:00
|
|
|
|
int value = 0;
|
|
|
|
|
|
2007-06-11 08:28:38 +00:00
|
|
|
|
if (!talk_menus_enabled())
|
2004-04-21 06:49:12 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
switch(cursorpos)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
value = tm->tm_hour;
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
value = tm->tm_min;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
value = tm->tm_sec;
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
value = tm->tm_year + 1900;
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
value = tm->tm_mday;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2005-07-05 19:33:33 +00:00
|
|
|
|
|
2004-04-21 06:49:12 +00:00
|
|
|
|
if (cursorpos == 4) /* month */
|
2004-04-21 21:40:26 +00:00
|
|
|
|
talk_id(LANG_MONTH_JANUARY + tm->tm_mon, false);
|
2004-04-21 06:49:12 +00:00
|
|
|
|
else
|
|
|
|
|
talk_value(value, unit[cursorpos], false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define INDEX_X 0
|
|
|
|
|
#define INDEX_Y 1
|
|
|
|
|
#define INDEX_WIDTH 2
|
2007-07-01 12:08:45 +00:00
|
|
|
|
|
|
|
|
|
#define SEPARATOR ":"
|
|
|
|
|
#define MONTHNAME_LEN 3
|
|
|
|
|
#define DAYNAME_LEN 3
|
|
|
|
|
bool set_time_screen(const char* title, struct tm *tm)
|
2004-04-21 06:49:12 +00:00
|
|
|
|
{
|
|
|
|
|
bool done = false;
|
|
|
|
|
int button;
|
2007-07-01 12:08:45 +00:00
|
|
|
|
int i;
|
2004-04-21 06:49:12 +00:00
|
|
|
|
int cursorpos = 0;
|
|
|
|
|
int lastcursorpos = !cursorpos;
|
2007-07-01 12:08:45 +00:00
|
|
|
|
unsigned int julianday;
|
|
|
|
|
unsigned int realyear;
|
|
|
|
|
unsigned int min = 0, steps = 0;
|
|
|
|
|
unsigned int statusbar_height;
|
2004-04-21 06:49:12 +00:00
|
|
|
|
unsigned int width, height;
|
|
|
|
|
unsigned int separator_width, weekday_width;
|
|
|
|
|
unsigned int line_height, prev_line_height;
|
2007-07-01 12:08:45 +00:00
|
|
|
|
unsigned char daysinmonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
|
|
|
|
unsigned char buffer[25];
|
2004-08-26 20:30:22 +00:00
|
|
|
|
|
2007-07-01 12:08:45 +00:00
|
|
|
|
/* 6 possible cursor possitions, 3 values stored for each: x, y, width */
|
|
|
|
|
unsigned char cursor[6][3];
|
|
|
|
|
memset(cursor, 0, sizeof(cursor));
|
2004-04-21 06:49:12 +00:00
|
|
|
|
|
|
|
|
|
int *valptr = NULL;
|
|
|
|
|
|
2007-07-01 12:08:45 +00:00
|
|
|
|
/* for easy acess in the drawing loop */
|
|
|
|
|
unsigned char *ptr[6];
|
|
|
|
|
ptr[0] = buffer; /* hours */
|
|
|
|
|
ptr[1] = buffer + 3; /* minutes */
|
|
|
|
|
ptr[2] = buffer + 6; /* seconds */
|
|
|
|
|
ptr[3] = buffer + 10 + DAYNAME_LEN; /* year (dayname is before year in the
|
|
|
|
|
buffer but is not drawn in the loop) */
|
|
|
|
|
ptr[4] = buffer + 15 + DAYNAME_LEN; /* monthname */
|
|
|
|
|
ptr[5] = buffer + 16 + DAYNAME_LEN + MONTHNAME_LEN; /* day of month */
|
|
|
|
|
|
2004-04-21 06:49:12 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
|
if(global_settings.statusbar)
|
2007-07-01 12:08:45 +00:00
|
|
|
|
statusbar_height = STATUSBAR_HEIGHT;
|
2004-04-21 06:49:12 +00:00
|
|
|
|
else
|
|
|
|
|
#endif
|
2007-07-01 12:08:45 +00:00
|
|
|
|
statusbar_height = 0;
|
2004-04-21 06:49:12 +00:00
|
|
|
|
|
|
|
|
|
while ( !done ) {
|
|
|
|
|
/* calculate the number of days in febuary */
|
|
|
|
|
realyear = tm->tm_year + 1900;
|
|
|
|
|
if((realyear % 4 == 0 && !(realyear % 100 == 0)) || realyear % 400 == 0)
|
|
|
|
|
daysinmonth[1] = 29;
|
|
|
|
|
else
|
|
|
|
|
daysinmonth[1] = 28;
|
|
|
|
|
|
|
|
|
|
/* fix day if month or year changed */
|
|
|
|
|
if (tm->tm_mday > daysinmonth[tm->tm_mon])
|
|
|
|
|
tm->tm_mday = daysinmonth[tm->tm_mon];
|
|
|
|
|
|
|
|
|
|
/* calculate day of week */
|
|
|
|
|
julianday = 0;
|
|
|
|
|
for(i = 0; i < tm->tm_mon; i++) {
|
|
|
|
|
julianday += daysinmonth[i];
|
|
|
|
|
}
|
|
|
|
|
julianday += tm->tm_mday;
|
|
|
|
|
tm->tm_wday = (realyear + julianday + (realyear - 1) / 4 -
|
|
|
|
|
(realyear - 1) / 100 + (realyear - 1) / 400 + 7 - 1) % 7;
|
|
|
|
|
|
2007-07-01 12:08:45 +00:00
|
|
|
|
/* copy all the stuff we want from the tm struct to buffer */
|
|
|
|
|
snprintf(buffer, sizeof(buffer), "%02d " "%02d " "%02d " "%s " "%04d " "%s " "%02d",
|
|
|
|
|
tm->tm_hour, tm->tm_min, tm->tm_sec,
|
|
|
|
|
str(dayname[tm->tm_wday]), tm->tm_year+1900,
|
|
|
|
|
str(monthname[tm->tm_mon]), tm->tm_mday);
|
|
|
|
|
|
2004-04-21 06:49:12 +00:00
|
|
|
|
/* recalculate the positions and offsets */
|
2007-07-01 12:08:45 +00:00
|
|
|
|
lcd_getstringsize(title, &width, &prev_line_height);
|
2004-04-21 06:49:12 +00:00
|
|
|
|
lcd_getstringsize(buffer, &width, &line_height);
|
2007-07-01 12:08:45 +00:00
|
|
|
|
lcd_getstringsize(SEPARATOR, &separator_width, &height);
|
|
|
|
|
|
|
|
|
|
/* convert spaces in the buffer to \0 to make it possible to work
|
|
|
|
|
directly on the buffer */
|
|
|
|
|
buffer[2] = '\0';
|
|
|
|
|
buffer[5] = '\0';
|
|
|
|
|
buffer[8] = '\0';
|
|
|
|
|
buffer[9 + DAYNAME_LEN] = '\0';
|
|
|
|
|
buffer[14 + DAYNAME_LEN] = '\0';
|
|
|
|
|
buffer[15 + DAYNAME_LEN + MONTHNAME_LEN] = '\0';
|
2004-04-21 06:49:12 +00:00
|
|
|
|
|
|
|
|
|
/* hour */
|
2007-07-01 12:08:45 +00:00
|
|
|
|
lcd_getstringsize(buffer, &width, &height);
|
|
|
|
|
/* cursor[0][INDEX_X] is already 0 because of the memset */
|
|
|
|
|
cursor[0][INDEX_Y] = prev_line_height + statusbar_height;
|
2004-04-21 06:49:12 +00:00
|
|
|
|
cursor[0][INDEX_WIDTH] = width;
|
|
|
|
|
|
|
|
|
|
/* minute */
|
2007-07-01 12:08:45 +00:00
|
|
|
|
lcd_getstringsize(buffer + 3, &width, &height);
|
2004-04-21 06:49:12 +00:00
|
|
|
|
cursor[1][INDEX_X] = cursor[0][INDEX_WIDTH] + separator_width;
|
2007-07-01 12:08:45 +00:00
|
|
|
|
cursor[1][INDEX_Y] = prev_line_height + statusbar_height;
|
2004-04-21 06:49:12 +00:00
|
|
|
|
cursor[1][INDEX_WIDTH] = width;
|
|
|
|
|
|
|
|
|
|
/* second */
|
2007-07-01 12:08:45 +00:00
|
|
|
|
lcd_getstringsize(buffer + 6, &width, &height);
|
2004-04-21 06:49:12 +00:00
|
|
|
|
cursor[2][INDEX_X] = cursor[0][INDEX_WIDTH] + separator_width +
|
|
|
|
|
cursor[1][INDEX_WIDTH] + separator_width;
|
2007-07-01 12:08:45 +00:00
|
|
|
|
cursor[2][INDEX_Y] = prev_line_height + statusbar_height;
|
2004-04-21 06:49:12 +00:00
|
|
|
|
|
|
|
|
|
/* weekday */
|
2007-07-01 12:08:45 +00:00
|
|
|
|
lcd_getstringsize(buffer + 9, &weekday_width, &height);
|
2004-04-21 06:49:12 +00:00
|
|
|
|
lcd_getstringsize(" ", &separator_width, &height);
|
|
|
|
|
|
|
|
|
|
/* year */
|
2007-07-01 12:08:45 +00:00
|
|
|
|
lcd_getstringsize(buffer + 10 + DAYNAME_LEN, &width, &height);
|
2004-04-21 06:49:12 +00:00
|
|
|
|
cursor[3][INDEX_X] = weekday_width + separator_width;
|
|
|
|
|
cursor[3][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height;
|
|
|
|
|
cursor[3][INDEX_WIDTH] = width;
|
|
|
|
|
|
|
|
|
|
/* month */
|
2007-07-01 12:08:45 +00:00
|
|
|
|
lcd_getstringsize(buffer + 15 + DAYNAME_LEN, &width, &height);
|
|
|
|
|
cursor[4][INDEX_X] = weekday_width + 2 * separator_width +
|
|
|
|
|
cursor[3][INDEX_WIDTH];
|
2004-04-21 06:49:12 +00:00
|
|
|
|
cursor[4][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height;
|
|
|
|
|
cursor[4][INDEX_WIDTH] = width;
|
|
|
|
|
|
|
|
|
|
/* day */
|
2007-07-01 12:08:45 +00:00
|
|
|
|
lcd_getstringsize(buffer + 16 + DAYNAME_LEN + MONTHNAME_LEN, &width, &height);
|
|
|
|
|
cursor[5][INDEX_X] = weekday_width + 3 * separator_width +
|
|
|
|
|
cursor[3][INDEX_WIDTH] +
|
|
|
|
|
cursor[4][INDEX_WIDTH];
|
2004-04-21 06:49:12 +00:00
|
|
|
|
cursor[5][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height;
|
|
|
|
|
|
2007-07-01 12:08:45 +00:00
|
|
|
|
/* draw the screen */
|
2005-06-24 22:33:21 +00:00
|
|
|
|
lcd_set_drawmode(DRMODE_SOLID);
|
2007-07-01 12:08:45 +00:00
|
|
|
|
lcd_clear_display();
|
|
|
|
|
/* display the screen title */
|
|
|
|
|
lcd_puts_scroll(0, 0, title);
|
|
|
|
|
|
|
|
|
|
/* these are not selectable, so we draw them outside the loop */
|
|
|
|
|
lcd_putsxy(0, cursor[3][INDEX_Y], buffer + 9); /* name of the week day */
|
|
|
|
|
lcd_putsxy(cursor[1][INDEX_X] - separator_width, cursor[0][INDEX_Y],
|
|
|
|
|
SEPARATOR);
|
|
|
|
|
lcd_putsxy(cursor[2][INDEX_X] - separator_width, cursor[0][INDEX_Y],
|
|
|
|
|
SEPARATOR);
|
|
|
|
|
|
|
|
|
|
/* draw the selected item with drawmode set to
|
|
|
|
|
DRMODE_SOLID|DRMODE_INVERSEVID, all other selectable
|
|
|
|
|
items with drawmode DRMODE_SOLID */
|
|
|
|
|
for(i=0; i<6; i++)
|
|
|
|
|
{
|
|
|
|
|
if (cursorpos == i)
|
|
|
|
|
lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
|
|
|
|
|
else
|
|
|
|
|
lcd_set_drawmode(DRMODE_SOLID);
|
2004-04-21 06:49:12 +00:00
|
|
|
|
|
2007-07-01 12:08:45 +00:00
|
|
|
|
lcd_putsxy(cursor[i][INDEX_X], cursor[i][INDEX_Y], ptr[i]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* print help text */
|
2004-04-21 06:49:12 +00:00
|
|
|
|
lcd_puts(0, 4, str(LANG_TIME_SET));
|
|
|
|
|
lcd_puts(0, 5, str(LANG_TIME_REVERT));
|
2007-07-01 12:08:45 +00:00
|
|
|
|
|
2004-04-21 06:49:12 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2005-11-20 01:02:14 +00:00
|
|
|
|
gui_syncstatusbar_draw(&statusbars, true);
|
2004-04-21 06:49:12 +00:00
|
|
|
|
#endif
|
|
|
|
|
lcd_update();
|
|
|
|
|
|
|
|
|
|
/* calculate the minimum and maximum for the number under cursor */
|
|
|
|
|
if(cursorpos!=lastcursorpos) {
|
|
|
|
|
lastcursorpos=cursorpos;
|
|
|
|
|
switch(cursorpos) {
|
|
|
|
|
case 0: /* hour */
|
|
|
|
|
min = 0;
|
|
|
|
|
steps = 24;
|
|
|
|
|
valptr = &tm->tm_hour;
|
|
|
|
|
break;
|
|
|
|
|
case 1: /* minute */
|
|
|
|
|
min = 0;
|
|
|
|
|
steps = 60;
|
|
|
|
|
valptr = &tm->tm_min;
|
|
|
|
|
break;
|
|
|
|
|
case 2: /* second */
|
|
|
|
|
min = 0;
|
|
|
|
|
steps = 60;
|
|
|
|
|
valptr = &tm->tm_sec;
|
|
|
|
|
break;
|
|
|
|
|
case 3: /* year */
|
|
|
|
|
min = 1;
|
|
|
|
|
steps = 200;
|
|
|
|
|
valptr = &tm->tm_year;
|
|
|
|
|
break;
|
|
|
|
|
case 4: /* month */
|
|
|
|
|
min = 0;
|
|
|
|
|
steps = 12;
|
|
|
|
|
valptr = &tm->tm_mon;
|
|
|
|
|
break;
|
|
|
|
|
case 5: /* day */
|
|
|
|
|
min = 1;
|
|
|
|
|
steps = daysinmonth[tm->tm_mon];
|
|
|
|
|
valptr = &tm->tm_mday;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
say_time(cursorpos, tm);
|
|
|
|
|
}
|
|
|
|
|
|
2006-08-21 07:03:15 +00:00
|
|
|
|
button = get_action(CONTEXT_SETTINGS_TIME,HZ/2);
|
2004-04-21 06:49:12 +00:00
|
|
|
|
switch ( button ) {
|
2006-08-15 12:27:07 +00:00
|
|
|
|
case ACTION_STD_PREV:
|
2004-04-21 06:49:12 +00:00
|
|
|
|
cursorpos = (cursorpos + 6 - 1) % 6;
|
|
|
|
|
break;
|
2006-08-15 12:27:07 +00:00
|
|
|
|
case ACTION_STD_NEXT:
|
2004-04-21 06:49:12 +00:00
|
|
|
|
cursorpos = (cursorpos + 6 + 1) % 6;
|
|
|
|
|
break;
|
2006-08-15 12:27:07 +00:00
|
|
|
|
case ACTION_SETTINGS_INC:
|
2006-08-21 07:03:15 +00:00
|
|
|
|
case ACTION_SETTINGS_INCREPEAT:
|
2004-04-21 06:49:12 +00:00
|
|
|
|
*valptr = (*valptr + steps - min + 1) %
|
|
|
|
|
steps + min;
|
|
|
|
|
if(*valptr == 0)
|
|
|
|
|
*valptr = min;
|
|
|
|
|
say_time(cursorpos, tm);
|
|
|
|
|
break;
|
2006-08-15 12:27:07 +00:00
|
|
|
|
case ACTION_SETTINGS_DEC:
|
2006-08-21 07:03:15 +00:00
|
|
|
|
case ACTION_SETTINGS_DECREPEAT:
|
2005-07-05 19:33:33 +00:00
|
|
|
|
*valptr = (*valptr + steps - min - 1) %
|
2004-04-21 06:49:12 +00:00
|
|
|
|
steps + min;
|
|
|
|
|
if(*valptr == 0)
|
|
|
|
|
*valptr = min;
|
|
|
|
|
say_time(cursorpos, tm);
|
|
|
|
|
break;
|
2004-09-19 21:58:37 +00:00
|
|
|
|
|
2006-08-15 12:27:07 +00:00
|
|
|
|
case ACTION_STD_OK:
|
2004-04-21 06:49:12 +00:00
|
|
|
|
done = true;
|
|
|
|
|
break;
|
2004-09-19 21:58:37 +00:00
|
|
|
|
|
2006-08-15 12:27:07 +00:00
|
|
|
|
case ACTION_STD_CANCEL:
|
2004-04-21 06:49:12 +00:00
|
|
|
|
done = true;
|
|
|
|
|
tm->tm_year = -1;
|
|
|
|
|
break;
|
|
|
|
|
|
2004-07-26 16:06:59 +00:00
|
|
|
|
default:
|
|
|
|
|
if (default_event_handler(button) == SYS_USB_CONNECTED)
|
|
|
|
|
return true;
|
|
|
|
|
break;
|
2004-04-21 06:49:12 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2006-08-15 12:27:07 +00:00
|
|
|
|
action_signalscreenchange();
|
2004-04-21 06:49:12 +00:00
|
|
|
|
return false;
|
|
|
|
|
}
|
2007-03-16 23:47:03 +00:00
|
|
|
|
#endif /* defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0) */
|
2004-07-24 21:26:41 +00:00
|
|
|
|
|
2005-06-22 22:22:23 +00:00
|
|
|
|
#if (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF)
|
2004-07-24 21:26:41 +00:00
|
|
|
|
bool shutdown_screen(void)
|
|
|
|
|
{
|
|
|
|
|
int button;
|
|
|
|
|
bool done = false;
|
2006-10-09 12:14:25 +00:00
|
|
|
|
long time_entered = current_tick;
|
2004-07-24 21:26:41 +00:00
|
|
|
|
|
|
|
|
|
lcd_stop_scroll();
|
|
|
|
|
|
2007-03-16 21:56:08 +00:00
|
|
|
|
gui_syncsplash(0, str(LANG_CONFIRM_SHUTDOWN));
|
2004-07-24 21:35:38 +00:00
|
|
|
|
|
2006-10-09 12:14:25 +00:00
|
|
|
|
while(!done && TIME_BEFORE(current_tick,time_entered+HZ*2))
|
2004-07-24 21:26:41 +00:00
|
|
|
|
{
|
2006-10-09 12:14:25 +00:00
|
|
|
|
button = get_action(CONTEXT_STD,HZ);
|
2004-07-24 21:26:41 +00:00
|
|
|
|
switch(button)
|
|
|
|
|
{
|
2006-08-15 12:27:07 +00:00
|
|
|
|
case ACTION_STD_CANCEL:
|
2005-09-14 09:08:26 +00:00
|
|
|
|
sys_poweroff();
|
2004-07-24 21:26:41 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2006-10-09 12:14:25 +00:00
|
|
|
|
/* do nothing here, because ACTION_UNKNOWN might be caused
|
2006-10-30 11:33:38 +00:00
|
|
|
|
* by timeout or button release. In case of timeout the loop
|
2006-10-09 12:14:25 +00:00
|
|
|
|
* is terminated by TIME_BEFORE */
|
|
|
|
|
case ACTION_UNKNOWN:
|
|
|
|
|
break;
|
|
|
|
|
|
2004-07-24 21:26:41 +00:00
|
|
|
|
default:
|
2004-07-26 16:06:59 +00:00
|
|
|
|
if(default_event_handler(button) == SYS_USB_CONNECTED)
|
|
|
|
|
return true;
|
2006-10-09 12:14:25 +00:00
|
|
|
|
done = true;
|
2004-07-24 21:26:41 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2006-08-15 12:27:07 +00:00
|
|
|
|
action_signalscreenchange();
|
2004-07-24 21:26:41 +00:00
|
|
|
|
return false;
|
|
|
|
|
}
|
2004-07-24 21:35:38 +00:00
|
|
|
|
#endif
|
2004-09-19 21:58:37 +00:00
|
|
|
|
|
2007-02-11 08:06:24 +00:00
|
|
|
|
static const int id3_headers[]=
|
|
|
|
|
{
|
|
|
|
|
LANG_ID3_TITLE,
|
|
|
|
|
LANG_ID3_ARTIST,
|
|
|
|
|
LANG_ID3_ALBUM,
|
|
|
|
|
LANG_ID3_ALBUMARTIST,
|
|
|
|
|
LANG_ID3_TRACKNUM,
|
|
|
|
|
LANG_ID3_COMMENT,
|
|
|
|
|
LANG_ID3_GENRE,
|
|
|
|
|
LANG_ID3_YEAR,
|
|
|
|
|
LANG_ID3_LENGTH,
|
|
|
|
|
LANG_ID3_PLAYLIST,
|
|
|
|
|
LANG_ID3_BITRATE,
|
|
|
|
|
LANG_ID3_FRECUENCY,
|
2005-08-29 21:15:27 +00:00
|
|
|
|
#if CONFIG_CODEC == SWCODEC
|
2007-02-11 08:06:24 +00:00
|
|
|
|
LANG_ID3_TRACK_GAIN,
|
|
|
|
|
LANG_ID3_ALBUM_GAIN,
|
2005-07-24 15:32:28 +00:00
|
|
|
|
#endif
|
2007-02-11 08:06:24 +00:00
|
|
|
|
LANG_ID3_PATH,
|
|
|
|
|
};
|
2005-08-11 18:21:14 +00:00
|
|
|
|
|
2006-12-25 14:01:47 +00:00
|
|
|
|
static char * id3_get_info(int selected_item, void* data, char *buffer)
|
2005-08-11 18:21:14 +00:00
|
|
|
|
{
|
2006-07-02 12:28:27 +00:00
|
|
|
|
struct mp3entry* id3 =(struct mp3entry*)data;
|
|
|
|
|
int info_no=selected_item/2;
|
|
|
|
|
if(!(selected_item%2))
|
|
|
|
|
{/* header */
|
2007-02-11 08:06:24 +00:00
|
|
|
|
return( str(id3_headers[info_no]));
|
2006-07-02 12:28:27 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{/* data */
|
2005-08-11 18:21:14 +00:00
|
|
|
|
|
2006-07-02 12:28:27 +00:00
|
|
|
|
char * info=NULL;
|
|
|
|
|
switch(info_no)
|
2004-09-19 21:58:37 +00:00
|
|
|
|
{
|
2006-07-02 12:28:27 +00:00
|
|
|
|
case 0:/*LANG_ID3_TITLE*/
|
|
|
|
|
info=id3->title;
|
|
|
|
|
break;
|
|
|
|
|
case 1:/*LANG_ID3_ARTIST*/
|
|
|
|
|
info=id3->artist;
|
|
|
|
|
break;
|
|
|
|
|
case 2:/*LANG_ID3_ALBUM*/
|
|
|
|
|
info=id3->album;
|
|
|
|
|
break;
|
2007-02-10 12:09:28 +00:00
|
|
|
|
case 3:/*LANG_ID3_ALBUMARTIST*/
|
|
|
|
|
info=id3->albumartist;
|
|
|
|
|
break;
|
|
|
|
|
case 4:/*LANG_ID3_TRACKNUM*/
|
2006-07-02 12:28:27 +00:00
|
|
|
|
if (id3->track_string)
|
|
|
|
|
info = id3->track_string;
|
|
|
|
|
else if (id3->tracknum)
|
2005-08-11 18:21:14 +00:00
|
|
|
|
{
|
2006-07-02 12:28:27 +00:00
|
|
|
|
snprintf(buffer, MAX_PATH, "%d", id3->tracknum);
|
|
|
|
|
info = buffer;
|
2005-08-11 18:21:14 +00:00
|
|
|
|
}
|
2006-07-02 12:28:27 +00:00
|
|
|
|
break;
|
2007-02-10 12:09:28 +00:00
|
|
|
|
case 5:/*LANG_ID3_COMMENT*/
|
|
|
|
|
info=id3->comment;
|
|
|
|
|
break;
|
|
|
|
|
case 6:/*LANG_ID3_GENRE*/
|
2007-03-02 21:49:42 +00:00
|
|
|
|
info = id3->genre_string;
|
2006-07-02 12:28:27 +00:00
|
|
|
|
break;
|
2007-02-10 12:09:28 +00:00
|
|
|
|
case 7:/*LANG_ID3_YEAR*/
|
2006-07-02 12:28:27 +00:00
|
|
|
|
if (id3->year_string)
|
|
|
|
|
info = id3->year_string;
|
|
|
|
|
else if (id3->year)
|
2005-08-11 18:21:14 +00:00
|
|
|
|
{
|
2006-07-02 12:28:27 +00:00
|
|
|
|
snprintf(buffer, MAX_PATH, "%d", id3->year);
|
|
|
|
|
info = buffer;
|
2005-08-11 18:21:14 +00:00
|
|
|
|
}
|
2004-09-19 21:58:37 +00:00
|
|
|
|
break;
|
2007-02-10 12:09:28 +00:00
|
|
|
|
case 8:/*LANG_ID3_LENGTH*/
|
2007-02-17 13:36:44 +00:00
|
|
|
|
format_time(buffer, MAX_PATH, id3->length);
|
2006-07-02 12:28:27 +00:00
|
|
|
|
info=buffer;
|
|
|
|
|
break;
|
2007-02-10 12:09:28 +00:00
|
|
|
|
case 9:/*LANG_ID3_PLAYLIST*/
|
2006-07-02 12:28:27 +00:00
|
|
|
|
snprintf(buffer, MAX_PATH, "%d/%d", playlist_get_display_index(),
|
|
|
|
|
playlist_amount());
|
|
|
|
|
info=buffer;
|
|
|
|
|
break;
|
2007-02-10 12:09:28 +00:00
|
|
|
|
case 10:/*LANG_ID3_BITRATE*/
|
2006-07-02 12:28:27 +00:00
|
|
|
|
snprintf(buffer, MAX_PATH, "%d kbps%s", id3->bitrate,
|
|
|
|
|
id3->vbr ? str(LANG_ID3_VBR) : (const unsigned char*) "");
|
|
|
|
|
info=buffer;
|
|
|
|
|
break;
|
2007-02-10 12:09:28 +00:00
|
|
|
|
case 11:/*LANG_ID3_FRECUENCY*/
|
2006-07-02 12:28:27 +00:00
|
|
|
|
snprintf(buffer, MAX_PATH, "%ld Hz", id3->frequency);
|
|
|
|
|
info=buffer;
|
|
|
|
|
break;
|
|
|
|
|
#if CONFIG_CODEC == SWCODEC
|
2007-02-10 12:09:28 +00:00
|
|
|
|
case 12:/*LANG_ID3_TRACK_GAIN*/
|
2006-07-02 12:28:27 +00:00
|
|
|
|
info=id3->track_gain_string;
|
|
|
|
|
break;
|
2007-02-10 12:09:28 +00:00
|
|
|
|
case 13:/*LANG_ID3_ALBUM_GAIN*/
|
2006-07-02 12:28:27 +00:00
|
|
|
|
info=id3->album_gain_string;
|
|
|
|
|
break;
|
2007-02-10 12:09:28 +00:00
|
|
|
|
case 14:/*LANG_ID3_PATH*/
|
2005-08-11 18:21:14 +00:00
|
|
|
|
#else
|
2007-02-10 12:09:28 +00:00
|
|
|
|
case 12:/*LANG_ID3_PATH*/
|
2005-08-11 18:21:14 +00:00
|
|
|
|
#endif
|
2006-07-02 12:28:27 +00:00
|
|
|
|
info=id3->path;
|
2004-09-19 21:58:37 +00:00
|
|
|
|
break;
|
2006-07-02 12:28:27 +00:00
|
|
|
|
}
|
2007-05-02 17:01:02 +00:00
|
|
|
|
return info && *info ? info : (char*) str(LANG_ID3_NO_INFO);
|
2006-07-02 12:28:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2005-06-23 02:20:40 +00:00
|
|
|
|
|
2006-07-02 12:28:27 +00:00
|
|
|
|
bool browse_id3(void)
|
|
|
|
|
{
|
|
|
|
|
struct gui_synclist id3_lists;
|
|
|
|
|
struct mp3entry* id3 = audio_current_track();
|
|
|
|
|
int key;
|
|
|
|
|
|
|
|
|
|
gui_synclist_init(&id3_lists, &id3_get_info, id3, true, 2);
|
2007-02-11 08:06:24 +00:00
|
|
|
|
gui_synclist_set_nb_items(&id3_lists,
|
|
|
|
|
sizeof(id3_headers)/sizeof(id3_headers[0])*2);
|
2006-07-02 12:28:27 +00:00
|
|
|
|
gui_synclist_draw(&id3_lists);
|
2006-09-12 08:55:47 +00:00
|
|
|
|
gui_syncstatusbar_draw(&statusbars, true);
|
2006-08-17 05:40:14 +00:00
|
|
|
|
action_signalscreenchange();
|
2006-07-02 12:28:27 +00:00
|
|
|
|
while (true) {
|
2006-08-17 09:28:04 +00:00
|
|
|
|
gui_syncstatusbar_draw(&statusbars, false);
|
2006-08-17 05:40:14 +00:00
|
|
|
|
key = get_action(CONTEXT_LIST,HZ/2);
|
2006-10-30 11:33:38 +00:00
|
|
|
|
if(key!=ACTION_NONE && key!=ACTION_UNKNOWN
|
2006-11-06 10:11:51 +00:00
|
|
|
|
&& !gui_synclist_do_button(&id3_lists, key,LIST_WRAP_UNLESS_HELD))
|
2006-08-15 12:27:07 +00:00
|
|
|
|
{
|
|
|
|
|
action_signalscreenchange();
|
2006-07-02 16:18:59 +00:00
|
|
|
|
return(default_event_handler(key) == SYS_USB_CONNECTED);
|
2006-08-15 12:27:07 +00:00
|
|
|
|
}
|
2004-09-19 21:58:37 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-10 20:56:15 +00:00
|
|
|
|
static char* runtime_get_data(int selected_item, void* data, char* buffer)
|
|
|
|
|
{
|
|
|
|
|
(void) data;
|
|
|
|
|
unsigned char *headers[] = {str(LANG_RUNNING_TIME), str(LANG_TOP_TIME) };
|
|
|
|
|
int t;
|
|
|
|
|
if(!(selected_item%2))
|
|
|
|
|
return headers[selected_item/2];
|
|
|
|
|
|
|
|
|
|
if(selected_item/2) t = global_status.topruntime;
|
|
|
|
|
else t = global_status.runtime;
|
|
|
|
|
|
|
|
|
|
snprintf(buffer, 16, "%dh %dm %ds",
|
|
|
|
|
t / 3600, (t % 3600) / 60, t % 60);
|
|
|
|
|
return buffer;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-12-19 12:26:03 +00:00
|
|
|
|
bool view_runtime(void)
|
|
|
|
|
{
|
|
|
|
|
unsigned char *lines[]={str(LANG_CLEAR_TIME)};
|
|
|
|
|
struct text_message message={(char **)lines, 1};
|
|
|
|
|
|
2007-04-10 20:56:15 +00:00
|
|
|
|
struct gui_synclist lists;
|
|
|
|
|
int action;
|
|
|
|
|
gui_synclist_init(&lists, runtime_get_data, NULL, false, 2);
|
|
|
|
|
#if !defined(HAVE_LCD_CHARCELLS)
|
|
|
|
|
gui_synclist_set_title(&lists, str(LANG_RUNNING_TIME), NOICON);
|
|
|
|
|
#else
|
|
|
|
|
gui_synclist_set_title(&lists, NULL, NOICON);
|
2007-02-17 10:59:30 +00:00
|
|
|
|
#endif
|
2007-04-10 20:56:15 +00:00
|
|
|
|
gui_synclist_set_icon_callback(&lists, NULL);
|
|
|
|
|
gui_synclist_set_nb_items(&lists, 4);
|
|
|
|
|
action_signalscreenchange();
|
|
|
|
|
while(1)
|
2006-12-19 12:26:03 +00:00
|
|
|
|
{
|
2007-02-18 05:32:06 +00:00
|
|
|
|
#if CONFIG_CHARGING
|
2007-04-10 20:56:15 +00:00
|
|
|
|
if (charger_inserted()
|
2006-12-19 12:26:03 +00:00
|
|
|
|
#ifdef HAVE_USB_POWER
|
2007-04-10 20:56:15 +00:00
|
|
|
|
|| usb_powered()
|
2006-12-19 12:26:03 +00:00
|
|
|
|
#endif
|
2007-04-10 20:56:15 +00:00
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
global_status.runtime = 0;
|
2006-12-19 12:26:03 +00:00
|
|
|
|
}
|
2007-04-10 20:56:15 +00:00
|
|
|
|
else
|
|
|
|
|
#endif
|
2006-12-19 12:26:03 +00:00
|
|
|
|
{
|
2007-04-10 20:56:15 +00:00
|
|
|
|
global_status.runtime += ((current_tick - lasttime) / HZ);
|
2006-12-19 12:26:03 +00:00
|
|
|
|
}
|
2007-04-10 20:56:15 +00:00
|
|
|
|
lasttime = current_tick;
|
|
|
|
|
gui_synclist_draw(&lists);
|
|
|
|
|
gui_syncstatusbar_draw(&statusbars, true);
|
|
|
|
|
action = get_action(CONTEXT_STD, HZ);
|
|
|
|
|
gui_synclist_do_button(&lists, action, LIST_WRAP_UNLESS_HELD);
|
|
|
|
|
if(action == ACTION_STD_CANCEL)
|
|
|
|
|
break;
|
|
|
|
|
if(action == ACTION_STD_OK) {
|
|
|
|
|
if(gui_syncyesno_run(&message, NULL, NULL)==YESNO_YES)
|
|
|
|
|
{
|
|
|
|
|
if (!(gui_synclist_get_sel_pos(&lists)/2))
|
|
|
|
|
global_status.runtime = 0;
|
|
|
|
|
else
|
|
|
|
|
global_status.topruntime = 0;
|
|
|
|
|
}
|
2006-12-19 12:26:03 +00:00
|
|
|
|
}
|
2007-04-10 21:40:44 +00:00
|
|
|
|
if(default_event_handler(action) == SYS_USB_CONNECTED)
|
|
|
|
|
return true;
|
2006-12-19 12:26:03 +00:00
|
|
|
|
}
|
|
|
|
|
action_signalscreenchange();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2007-04-10 20:56:15 +00:00
|
|
|
|
|