1
0
Fork 0
forked from len0rd/rockbox

Adapted and commited Markus Kaufhold's remote hold icon on statusbar patch for iriver ; generic logo handler (now it's possible to have a different USB logo on main screen and on remote), made the quickscreen behave as it was before

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8044 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Kevin Ferrare 2005-11-22 21:55:05 +00:00
parent fd02642ee0
commit f57d0220dd
14 changed files with 244 additions and 112 deletions

View file

@ -36,6 +36,7 @@ gui/gwps.c
gui/gwps-common.c gui/gwps-common.c
gui/icon.c gui/icon.c
gui/list.c gui/list.c
gui/logo.c
gui/option_select.c gui/option_select.c
gui/quickscreen.c gui/quickscreen.c
gui/scrollbar.c gui/scrollbar.c

View file

@ -509,7 +509,7 @@ long gui_wps_show(void)
#ifdef WPS_RC_QUICK #ifdef WPS_RC_QUICK
case WPS_RC_QUICK: case WPS_RC_QUICK:
#endif #endif
if (quick_screen_quick()) if (quick_screen_quick(button))
return SYS_USB_CONNECTED; return SYS_USB_CONNECTED;
restore = true; restore = true;
lastbutton = 0; lastbutton = 0;
@ -518,7 +518,7 @@ long gui_wps_show(void)
/* screen settings */ /* screen settings */
#ifdef BUTTON_F3 #ifdef BUTTON_F3
case BUTTON_F3: case BUTTON_F3:
if (quick_screen_f3()) if (quick_screen_f3(button))
return SYS_USB_CONNECTED; return SYS_USB_CONNECTED;
restore = true; restore = true;
break; break;

94
apps/gui/logo.c Normal file
View file

@ -0,0 +1,94 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2002 Bjö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.
*
****************************************************************************/
#include "logo.h"
#ifdef HAVE_LCD_BITMAP
#define BMPHEIGHT_usb_logo_main 32
#define BMPWIDTH_usb_logo_main 100
static const unsigned char usb_logo_main[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x08,
0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x81, 0x81, 0x81,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0xf1, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0,
0x00, 0x00, 0xe0, 0x1c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x81, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0,
0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x1c,
0x0c, 0x0e, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f,
0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00,
0x00, 0x00, 0xe0, 0x1f, 0x00, 0xf8, 0x06, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x02, 0x02, 0x82, 0x7e, 0x00, 0xc0, 0x3e, 0x01,
0x70, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00, 0x07, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f,
0x0f, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x07, 0x0f,
0x1f, 0x3f, 0x7b, 0xf3, 0xe3, 0xc3, 0x83, 0x83, 0x83, 0x83, 0xe3, 0xe3, 0xe3,
0xe3, 0xe3, 0xe3, 0x03, 0x03, 0x03, 0x3f, 0x1f, 0x1f, 0x0f, 0x0f, 0x07, 0x02,
0xc0, 0x3e, 0x01, 0xe0, 0x9f, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0xf0, 0x0f, 0x80, 0x78, 0x07, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x10, 0x20, 0x40, 0x40, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x81, 0x81, 0x87, 0x87, 0x87,
0x87, 0x87, 0x87, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xf0,
0x0f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
0x04, 0x04, 0x04, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00,
};
struct logo usb_logos[]=
{
[SCREEN_MAIN]={usb_logo_main, BMPWIDTH_usb_logo_main, BMPHEIGHT_usb_logo_main},
#if NB_SCREENS==2
[SCREEN_REMOTE]={usb_logo_main, BMPWIDTH_usb_logo_main, BMPHEIGHT_usb_logo_main}
#endif
};
#else
struct logo usb_logos[]=
{
[SCREEN_MAIN]={"[USB Mode]"}
};
#endif
void gui_logo_draw(struct logo * logo, struct screen * display)
{
display->clear_display();
#ifdef HAVE_LCD_BITMAP
/* Center bitmap on screen */
display->mono_bitmap(logo->bitmap,
display->width/2-logo->width/2,
display->height/2-logo->height/2,
logo->width,
logo->height);
display->update();
#else
display->double_height(false);
display->puts_scroll(0, 0, logo->text);
#ifdef SIMULATOR
display->update();
#endif /* SIMULATOR */
#endif /* HAVE_LCD_BITMAP */
}

43
apps/gui/logo.h Normal file
View file

@ -0,0 +1,43 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2005 by Kevin Ferrare
*
* 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.
*
****************************************************************************/
#ifndef _GUI_LOGO_H_
#define _GUI_LOGO_H_
#include "screen_access.h"
struct logo{
#ifdef HAVE_LCD_BITMAP
const unsigned char * bitmap;
int width;
int height;
#else
const char * text;
#endif
};
extern struct logo usb_logos[];
/*
* Draws the given logo at the center of the given screen
* - logo : the logo
* - display : the screen to draw on
*/
void gui_logo_draw(struct logo * logo, struct screen * display);
#endif /* _GUI_LOGO_H_ */

View file

@ -51,6 +51,7 @@ void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display)
display->has_buttonbar=false; display->has_buttonbar=false;
#endif #endif
gui_textarea_clear(display); gui_textarea_clear(display);
display->setfont(FONT_SYSFIXED);
display->getstringsize("M",&w,&h); display->getstringsize("M",&w,&h);
/* Displays the icons */ /* Displays the icons */
display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward],
@ -62,7 +63,6 @@ void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display)
display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward],
display->width/2 + 8, display->width/2 + 8,
display->height/2 - 4, 7, 8); display->height/2 - 4, 7, 8);
display->setfont(FONT_SYSFIXED);
/* Displays the left's text */ /* Displays the left's text */
title=option_select_get_title(qs->left_option); title=option_select_get_title(qs->left_option);
@ -90,7 +90,7 @@ void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display)
display->putsxy(display->width - w, display->height/2, option); display->putsxy(display->width - w, display->height/2, option);
gui_textarea_update(display); gui_textarea_update(display);
lcd_setfont(FONT_UI); display->setfont(FONT_UI);
} }
void gui_syncquickscreen_draw(struct gui_quickscreen * qs) void gui_syncquickscreen_draw(struct gui_quickscreen * qs)
@ -102,6 +102,7 @@ void gui_syncquickscreen_draw(struct gui_quickscreen * qs)
bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button) bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button)
{ {
switch(button) switch(button)
{ {
case QUICKSCREEN_LEFT : case QUICKSCREEN_LEFT :
@ -143,24 +144,32 @@ bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button)
return(false); return(false);
} }
bool gui_syncquickscreen_run(struct gui_quickscreen * qs) bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter)
{ {
int key; int key;
/* To quit we need either :
* - a second press on the button that made us enter
* - an action taken while pressing the enter button,
* then release the enter button*/
bool can_quit=false;
gui_syncquickscreen_draw(qs); gui_syncquickscreen_draw(qs);
while (true) { while (true) {
key = button_get(true); key = button_get(true);
if(default_event_handler(key) == SYS_USB_CONNECTED) if(default_event_handler(key & ~button_enter) == SYS_USB_CONNECTED)
return(true); return(true);
if(gui_quickscreen_do_button(qs, key)) if(gui_quickscreen_do_button(qs, key & ~button_enter))
{ {
can_quit=true;
if(qs->callback) if(qs->callback)
qs->callback(qs); qs->callback(qs);
gui_syncquickscreen_draw(qs); gui_syncquickscreen_draw(qs);
} }
else if(key==QUICKSCREEN_QUIT else if(key==button_enter)
can_quit=true;
if(key==(button_enter | BUTTON_REL) && can_quit)
return(false);
#ifdef QUICKSCREEN_QUIT #ifdef QUICKSCREEN_QUIT
|| key==QUICKSCREEN_QUIT if(key==QUICKSCREEN_QUIT
#endif
#ifdef QUICKSCREEN_QUIT2 #ifdef QUICKSCREEN_QUIT2
|| key==QUICKSCREEN_QUIT2 || key==QUICKSCREEN_QUIT2
#endif #endif
@ -168,9 +177,8 @@ bool gui_syncquickscreen_run(struct gui_quickscreen * qs)
|| key==QUICKSCREEN_RC_QUIT || key==QUICKSCREEN_RC_QUIT
#endif #endif
) )
{
return(false); return(false);
} #endif /* QUICKSCREEN_QUIT */
gui_syncstatusbar_draw(&statusbars, false); gui_syncstatusbar_draw(&statusbars, false);
} }
} }

View file

@ -34,10 +34,8 @@
#define QUICKSCREEN_BOTTOM_INV BUTTON_UP #define QUICKSCREEN_BOTTOM_INV BUTTON_UP
#define QUICKSCREEN_RIGHT BUTTON_RIGHT #define QUICKSCREEN_RIGHT BUTTON_RIGHT
#if CONFIG_KEYPAD == RECORDER_PAD
#define QUICKSCREEN_QUIT BUTTON_F2 #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
#define QUICKSCREEN_QUIT2 BUTTON_F3
#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
#define QUICKSCREEN_QUIT BUTTON_MODE #define QUICKSCREEN_QUIT BUTTON_MODE
#define QUICKSCREEN_QUIT2 BUTTON_OFF #define QUICKSCREEN_QUIT2 BUTTON_OFF
#define QUICKSCREEN_RC_QUIT BUTTON_RC_MODE #define QUICKSCREEN_RC_QUIT BUTTON_RC_MODE
@ -104,11 +102,12 @@ bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button);
void gui_syncquickscreen_draw(struct gui_quickscreen * qs); void gui_syncquickscreen_draw(struct gui_quickscreen * qs);
/* /*
* Runs the quickscreen on all available screens * Runs the quickscreen on all available screens, if button_enter is released, quits
* - qs : the quickscreen * - qs : the quickscreen
* - button_enter : button pressed at the same time the quickscreen is displayed
* returns : true if usb was connected, false otherwise * returns : true if usb was connected, false otherwise
*/ */
bool gui_syncquickscreen_run(struct gui_quickscreen * qs); bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter);
#endif /*_GUI_QUICK_SCREEN_H_*/ #endif /*_GUI_QUICK_SCREEN_H_*/
#endif /* CONFIG_KEYPAD */ #endif /* CONFIG_KEYPAD */

View file

@ -40,27 +40,30 @@
/* FIXME: should be removed from icon.h to avoid redefinition, /* FIXME: should be removed from icon.h to avoid redefinition,
but still needed for compatibility with old system */ but still needed for compatibility with old system */
#define ICONS_SPACING 2
#define STATUSBAR_BATTERY_X_POS 0 #define STATUSBAR_BATTERY_X_POS 0*ICONS_SPACING
#define STATUSBAR_BATTERY_WIDTH 18 #define STATUSBAR_BATTERY_WIDTH 18
#define STATUSBAR_PLUG_X_POS STATUSBAR_X_POS + \ #define STATUSBAR_PLUG_X_POS STATUSBAR_X_POS + \
STATUSBAR_BATTERY_WIDTH +2 STATUSBAR_BATTERY_WIDTH + \
ICONS_SPACING
#define STATUSBAR_PLUG_WIDTH 7 #define STATUSBAR_PLUG_WIDTH 7
#define STATUSBAR_VOLUME_X_POS STATUSBAR_X_POS + \ #define STATUSBAR_VOLUME_X_POS STATUSBAR_X_POS + \
STATUSBAR_BATTERY_WIDTH + \ STATUSBAR_BATTERY_WIDTH + \
STATUSBAR_PLUG_WIDTH +2+2 STATUSBAR_PLUG_WIDTH + \
2*ICONS_SPACING
#define STATUSBAR_VOLUME_WIDTH 16 #define STATUSBAR_VOLUME_WIDTH 16
#define STATUSBAR_PLAY_STATE_X_POS STATUSBAR_X_POS + \ #define STATUSBAR_PLAY_STATE_X_POS STATUSBAR_X_POS + \
STATUSBAR_BATTERY_WIDTH + \ STATUSBAR_BATTERY_WIDTH + \
STATUSBAR_PLUG_WIDTH + \ STATUSBAR_PLUG_WIDTH + \
STATUSBAR_VOLUME_WIDTH+2+2+2 STATUSBAR_VOLUME_WIDTH + \
3*ICONS_SPACING
#define STATUSBAR_PLAY_STATE_WIDTH 7 #define STATUSBAR_PLAY_STATE_WIDTH 7
#define STATUSBAR_PLAY_MODE_X_POS STATUSBAR_X_POS + \ #define STATUSBAR_PLAY_MODE_X_POS STATUSBAR_X_POS + \
STATUSBAR_BATTERY_WIDTH + \ STATUSBAR_BATTERY_WIDTH + \
STATUSBAR_PLUG_WIDTH + \ STATUSBAR_PLUG_WIDTH + \
STATUSBAR_VOLUME_WIDTH + \ STATUSBAR_VOLUME_WIDTH + \
STATUSBAR_PLAY_STATE_WIDTH + \ STATUSBAR_PLAY_STATE_WIDTH + \
2+2+2+2 4*ICONS_SPACING
#define STATUSBAR_PLAY_MODE_WIDTH 7 #define STATUSBAR_PLAY_MODE_WIDTH 7
#define STATUSBAR_SHUFFLE_X_POS STATUSBAR_X_POS + \ #define STATUSBAR_SHUFFLE_X_POS STATUSBAR_X_POS + \
STATUSBAR_BATTERY_WIDTH + \ STATUSBAR_BATTERY_WIDTH + \
@ -68,17 +71,28 @@
STATUSBAR_VOLUME_WIDTH + \ STATUSBAR_VOLUME_WIDTH + \
STATUSBAR_PLAY_STATE_WIDTH + \ STATUSBAR_PLAY_STATE_WIDTH + \
STATUSBAR_PLAY_MODE_WIDTH + \ STATUSBAR_PLAY_MODE_WIDTH + \
2+2+2+2+2 5*ICONS_SPACING
#define STATUSBAR_SHUFFLE_WIDTH 7 #define STATUSBAR_SHUFFLE_WIDTH 7
#define STATUSBAR_LOCK_X_POS STATUSBAR_X_POS + \ #define STATUSBAR_LOCKM_X_POS STATUSBAR_X_POS + \
STATUSBAR_BATTERY_WIDTH + \ STATUSBAR_BATTERY_WIDTH + \
STATUSBAR_PLUG_WIDTH + \ STATUSBAR_PLUG_WIDTH + \
STATUSBAR_VOLUME_WIDTH + \ STATUSBAR_VOLUME_WIDTH + \
STATUSBAR_PLAY_STATE_WIDTH + \ STATUSBAR_PLAY_STATE_WIDTH + \
STATUSBAR_PLAY_MODE_WIDTH + \ STATUSBAR_PLAY_MODE_WIDTH + \
STATUSBAR_SHUFFLE_WIDTH + \ STATUSBAR_SHUFFLE_WIDTH + \
2+2+2+2+2+2 6*ICONS_SPACING
#define STATUSBAR_LOCK_WIDTH 5 #define STATUSBAR_LOCKM_WIDTH 5
#define STATUSBAR_LOCKR_X_POS STATUSBAR_X_POS + \
STATUSBAR_BATTERY_WIDTH + \
STATUSBAR_PLUG_WIDTH + \
STATUSBAR_VOLUME_WIDTH + \
STATUSBAR_PLAY_STATE_WIDTH + \
STATUSBAR_PLAY_MODE_WIDTH + \
STATUSBAR_SHUFFLE_WIDTH + \
STATUSBAR_LOCKM_WIDTH + \
7*ICONS_SPACING
#define STATUSBAR_LOCKR_WIDTH 5
#define STATUSBAR_DISK_WIDTH 12 #define STATUSBAR_DISK_WIDTH 12
#define STATUSBAR_DISK_X_POS(statusbar_width) statusbar_width - \ #define STATUSBAR_DISK_X_POS(statusbar_width) statusbar_width - \
STATUSBAR_DISK_WIDTH STATUSBAR_DISK_WIDTH
@ -98,7 +112,6 @@ void gui_statusbar_init(struct gui_statusbar * bar)
void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
{ {
struct screen * display = bar->display; struct screen * display = bar->display;
#ifdef HAVE_RTC #ifdef HAVE_RTC
struct tm* tm; /* For Time */ struct tm* tm; /* For Time */
#endif /* HAVE_RTC */ #endif /* HAVE_RTC */
@ -120,11 +133,14 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
#endif /* HAVE_RTC */ #endif /* HAVE_RTC */
bar->info.shuffle = global_settings.playlist_shuffle; bar->info.shuffle = global_settings.playlist_shuffle;
#if CONFIG_KEYPAD == IRIVER_H100_PAD #ifdef HAS_BUTTON_HOLD
bar->info.keylock = button_hold(); bar->info.keylock = button_hold();
#else #else
bar->info.keylock = keys_locked; bar->info.keylock = keys_locked;
#endif /* CONFIG_KEYPAD == IRIVER_H100_PAD */ #endif /* HAS_BUTTON_HOLD */
#ifdef HAS_REMOTE_BUTTON_HOLD
bar->info.keylockremote = remote_button_hold();
#endif
bar->info.repeat = global_settings.repeat_mode; bar->info.repeat = global_settings.repeat_mode;
bar->info.playmode = current_playmode(); bar->info.playmode = current_playmode();
if(!display->has_disk_led) if(!display->has_disk_led)
@ -235,6 +251,10 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
gui_statusbar_icon_shuffle(display); gui_statusbar_icon_shuffle(display);
if (bar->info.keylock) if (bar->info.keylock)
gui_statusbar_icon_lock(display); gui_statusbar_icon_lock(display);
#ifdef HAS_REMOTE_BUTTON_HOLD
if (bar->info.keylockremote)
gui_statusbar_icon_lock_remote(display);
#endif
#ifdef HAVE_RTC #ifdef HAVE_RTC
gui_statusbar_time(display, bar->info.hour, bar->info.minute); gui_statusbar_time(display, bar->info.hour, bar->info.minute);
#endif /* HAVE_RTC */ #endif /* HAVE_RTC */
@ -430,8 +450,19 @@ void gui_statusbar_icon_shuffle(struct screen * display)
*/ */
void gui_statusbar_icon_lock(struct screen * display) void gui_statusbar_icon_lock(struct screen * display)
{ {
display->mono_bitmap(bitmap_icons_5x8[Icon_Lock], STATUSBAR_LOCK_X_POS, display->mono_bitmap(bitmap_icons_5x8[Icon_Lock_Main],
STATUSBAR_Y_POS, 5, 8); STATUSBAR_LOCKM_X_POS, STATUSBAR_Y_POS,
STATUSBAR_LOCKM_WIDTH, STATUSBAR_HEIGHT);
}
/*
* Print remote lock when remote hold is enabled
*/
void gui_statusbar_icon_lock_remote(struct screen * display)
{
display->mono_bitmap(bitmap_icons_5x8[Icon_Lock_Remote],
STATUSBAR_LOCKR_X_POS, STATUSBAR_Y_POS,
STATUSBAR_LOCKR_WIDTH, STATUSBAR_HEIGHT);
} }
/* /*

View file

@ -23,6 +23,7 @@
#include "config.h" #include "config.h"
#include "status.h" #include "status.h"
#include "screen_access.h" #include "screen_access.h"
#include "button.h"
#define STATUSBAR_X_POS 0 #define STATUSBAR_X_POS 0
#define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */ #define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */
@ -40,6 +41,9 @@ struct status_info {
bool inserted; bool inserted;
bool shuffle; bool shuffle;
bool keylock; bool keylock;
#ifdef HAS_REMOTE_BUTTON_HOLD
bool keylockremote;
#endif
bool battery_safe; bool battery_safe;
bool redraw_volume; /* true if the volume gauge needs updating */ bool redraw_volume; /* true if the volume gauge needs updating */
bool led; /* disk LED simulation in the status bar */ bool led; /* disk LED simulation in the status bar */
@ -101,6 +105,7 @@ void gui_statusbar_icon_play_state(struct screen * display, int state);
void gui_statusbar_icon_play_mode(struct screen * display, int mode); void gui_statusbar_icon_play_mode(struct screen * display, int mode);
void gui_statusbar_icon_shuffle(struct screen * display); void gui_statusbar_icon_shuffle(struct screen * display);
void gui_statusbar_icon_lock(struct screen * display); void gui_statusbar_icon_lock(struct screen * display);
void gui_statusbar_icon_lock_remote(struct screen * display);
void gui_statusbar_led(struct screen * display); void gui_statusbar_led(struct screen * display);

View file

@ -30,11 +30,11 @@
const unsigned char bitmap_icons_5x8[][5] = const unsigned char bitmap_icons_5x8[][5] =
{ {
/* Lock */ [Icon_Lock_Main] ={0x78,0x7f,0x49,0x7f,0x78}, /* Lock Main */
{0x78,0x7f,0x49,0x7f,0x78} [Icon_Lock_Remote]={0x78,0x7f,0x49,0x7f,0x78} /* Lock Remote */
}; };
const unsigned char bitmap_icons_6x8[LastIcon][6] = const unsigned char bitmap_icons_6x8[][6] =
{ {
{ 0x60, 0x7f, 0x03, 0x33, 0x3f, 0x00 }, /* Musical note */ { 0x60, 0x7f, 0x03, 0x33, 0x3f, 0x00 }, /* Musical note */
{ 0x7e, 0x41, 0x41, 0x42, 0x7e, 0x00 }, /* Folder */ { 0x7e, 0x41, 0x41, 0x42, 0x7e, 0x00 }, /* Folder */

View file

@ -29,7 +29,9 @@
/* Symbolic names for icons */ /* Symbolic names for icons */
enum icons_5x8 { enum icons_5x8 {
Icon_Lock Icon_Lock_Main,
Icon_Lock_Remote,
Icon5x8Last
}; };
enum icons_6x8 { enum icons_6x8 {
@ -46,7 +48,7 @@ enum icons_6x8 {
Icon_Bookmark, Icon_Bookmark,
Icon_Queued, Icon_Queued,
Icon_Moving, Icon_Moving,
LastIcon Icon6x8Last
}; };
enum icons_7x8 { enum icons_7x8 {
@ -68,12 +70,12 @@ enum icons_7x8 {
Icon_DownArrow, Icon_DownArrow,
Icon_UpArrow, Icon_UpArrow,
Icon_RepeatAB, Icon_RepeatAB,
Icon_Last Icon7x8Last
}; };
extern const unsigned char bitmap_icons_5x8[1][5]; extern const unsigned char bitmap_icons_5x8[Icon5x8Last][5];
extern const unsigned char bitmap_icons_6x8[LastIcon][6]; extern const unsigned char bitmap_icons_6x8[Icon6x8Last][6];
extern const unsigned char bitmap_icons_7x8[Icon_Last][7]; extern const unsigned char bitmap_icons_7x8[Icon7x8Last][7];
extern const unsigned char bitmap_icon_disk[]; extern const unsigned char bitmap_icon_disk[];
#if LCD_WIDTH == 112 || LCD_WIDTH == 128 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_WIDTH == 128) #if LCD_WIDTH == 112 || LCD_WIDTH == 128 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_WIDTH == 128)

View file

@ -16,6 +16,7 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
****************************************************************************/ ****************************************************************************/
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
@ -51,6 +52,7 @@
#include "statusbar.h" #include "statusbar.h"
#include "screen_access.h" #include "screen_access.h"
#include "quickscreen.h" #include "quickscreen.h"
#include "logo.h"
#if defined(HAVE_LCD_BITMAP) #if defined(HAVE_LCD_BITMAP)
#include "widgets.h" #include "widgets.h"
@ -64,66 +66,8 @@
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
#define SCROLLBAR_WIDTH 6 #define SCROLLBAR_WIDTH 6
#define BMPHEIGHT_usb_logo 32
#define BMPWIDTH_usb_logo 100
static const unsigned char usb_logo[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x08,
0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x81, 0x81, 0x81,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0xf1, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0,
0x00, 0x00, 0xe0, 0x1c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x81, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0,
0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x1c,
0x0c, 0x0e, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f,
0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00,
0x00, 0x00, 0xe0, 0x1f, 0x00, 0xf8, 0x06, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x02, 0x02, 0x82, 0x7e, 0x00, 0xc0, 0x3e, 0x01,
0x70, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00, 0x07, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f,
0x0f, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x07, 0x0f,
0x1f, 0x3f, 0x7b, 0xf3, 0xe3, 0xc3, 0x83, 0x83, 0x83, 0x83, 0xe3, 0xe3, 0xe3,
0xe3, 0xe3, 0xe3, 0x03, 0x03, 0x03, 0x3f, 0x1f, 0x1f, 0x0f, 0x0f, 0x07, 0x02,
0xc0, 0x3e, 0x01, 0xe0, 0x9f, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0xf0, 0x0f, 0x80, 0x78, 0x07, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x10, 0x20, 0x40, 0x40, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x81, 0x81, 0x87, 0x87, 0x87,
0x87, 0x87, 0x87, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xf0,
0x0f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
0x04, 0x04, 0x04, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00,
};
#endif #endif
void usb_display_info(struct screen * display)
{
display->clear_display();
#ifdef HAVE_LCD_BITMAP
/* Center bitmap on screen */
display->mono_bitmap(usb_logo,
display->width/2-BMPWIDTH_usb_logo/2,
display->height/2-BMPHEIGHT_usb_logo/2,
BMPWIDTH_usb_logo,
BMPHEIGHT_usb_logo);
display->update();
#else
display->double_height(false);
display->puts(0, 0, "[USB Mode]");
#ifdef SIMULATOR
display->update();
#endif /* SIMULATOR */
#endif /* HAVE_LCD_BITMAP */
}
void usb_screen(void) void usb_screen(void)
{ {
#ifdef USB_NONE #ifdef USB_NONE
@ -132,7 +76,7 @@ void usb_screen(void)
int i; int i;
FOR_NB_SCREENS(i) { FOR_NB_SCREENS(i) {
screens[i].backlight_on(); screens[i].backlight_on();
usb_display_info(&screens[i]); gui_logo_draw(&usb_logos[i], &screens[i]);
} }
#ifdef HAVE_LCD_CHARCELLS #ifdef HAVE_LCD_CHARCELLS
status_set_param(false); status_set_param(false);
@ -542,7 +486,7 @@ void quick_screen_quick_apply(struct gui_quickscreen *qs)
global_settings.repeat_mode=option_select_get_selected(qs->right_option); global_settings.repeat_mode=option_select_get_selected(qs->right_option);
} }
bool quick_screen_quick(void) bool quick_screen_quick(int button_enter)
{ {
bool res, oldrepeat; bool res, oldrepeat;
struct option_select left_option; struct option_select left_option;
@ -589,7 +533,7 @@ bool quick_screen_quick(void)
gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option, gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option,
str(LANG_F2_MODE), &quick_screen_quick_apply); str(LANG_F2_MODE), &quick_screen_quick_apply);
oldrepeat=global_settings.repeat_mode; oldrepeat=global_settings.repeat_mode;
res=gui_syncquickscreen_run(&qs); res=gui_syncquickscreen_run(&qs, button_enter);
if(!res) if(!res)
{ {
if ( oldrepeat != global_settings.repeat_mode && if ( oldrepeat != global_settings.repeat_mode &&
@ -624,7 +568,7 @@ void quick_screen_f3_apply(struct gui_quickscreen *qs)
gui_syncstatusbar_draw(&statusbars, true); gui_syncstatusbar_draw(&statusbars, true);
} }
bool quick_screen_f3(void) bool quick_screen_f3(int button_enter)
{ {
bool res; bool res;
struct option_select left_option; struct option_select left_option;
@ -658,7 +602,7 @@ bool quick_screen_f3(void)
2); 2);
gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option, gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option,
str(LANG_F3_BAR), &quick_screen_f3_apply); str(LANG_F3_BAR), &quick_screen_f3_apply);
res=gui_syncquickscreen_run(&qs); res=gui_syncquickscreen_run(&qs, button_enter);
if(!res) if(!res)
settings_save(); settings_save();
return(res); return(res);

View file

@ -35,9 +35,9 @@ int mmc_remove_request(void);
#if CONFIG_KEYPAD == RECORDER_PAD #if CONFIG_KEYPAD == RECORDER_PAD
int pitch_screen(void); int pitch_screen(void);
extern bool quick_screen_f3(void); extern bool quick_screen_f3(int button_enter);
#endif #endif
extern bool quick_screen_quick(void); extern bool quick_screen_quick(int button_enter);
#ifdef HAVE_RTC #ifdef HAVE_RTC
bool set_time_screen(const char* string, struct tm *tm); bool set_time_screen(const char* string, struct tm *tm);

View file

@ -718,7 +718,7 @@ static bool dirbrowse(void)
/* don't enter f2 from plugin browser */ /* don't enter f2 from plugin browser */
if (*tc.dirfilter < NUM_FILTER_MODES) if (*tc.dirfilter < NUM_FILTER_MODES)
{ {
if (quick_screen_quick()) if (quick_screen_quick(button))
reload_dir = true; reload_dir = true;
restore = true; restore = true;
@ -733,7 +733,7 @@ static bool dirbrowse(void)
/* don't enter f3 from plugin browser */ /* don't enter f3 from plugin browser */
if (*tc.dirfilter < NUM_FILTER_MODES) if (*tc.dirfilter < NUM_FILTER_MODES)
{ {
if (quick_screen_f3()) if (quick_screen_f3(button))
reload_dir = true; reload_dir = true;
restore = true; restore = true;
} }

View file

@ -22,7 +22,11 @@
#include <stdbool.h> #include <stdbool.h>
#include "config.h" #include "config.h"
#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
(CONFIG_KEYPAD == IRIVER_H300_PAD)
#define HAS_BUTTON_HOLD
#define HAS_REMOTE_BUTTON_HOLD
#endif
extern struct event_queue button_queue; extern struct event_queue button_queue;
void button_init (void); void button_init (void);
@ -34,9 +38,10 @@ void button_clear_queue(void);
void button_set_flip(bool flip); /* turn 180 degrees */ void button_set_flip(bool flip); /* turn 180 degrees */
#endif #endif
#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ #ifdef HAS_BUTTON_HOLD
(CONFIG_KEYPAD == IRIVER_H300_PAD)
bool button_hold(void); bool button_hold(void);
#endif
#ifdef HAS_REMOTE_BUTTON_HOLD
bool remote_button_hold(void); bool remote_button_hold(void);
#endif #endif