1
0
Fork 0
forked from len0rd/rockbox

Initial suppport for building Rockbox for Neo. The Neo has a different

key layout so we need to check for this.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4138 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2003-12-12 13:34:27 +00:00
parent ca71062221
commit 8e43ccbec6
10 changed files with 130 additions and 70 deletions

View file

@ -85,7 +85,9 @@ bool dbg_os(void)
switch(button)
{
#ifdef BUTTON_OFF
case BUTTON_OFF:
#endif
case BUTTON_LEFT:
return false;
}
@ -1194,9 +1196,9 @@ static bool view_runtime(void)
/* Wait for a key to be pushed */
key = button_get_w_tmo(HZ);
switch(key) {
#ifdef HAVE_PLAYER_KEYPAD
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
case BUTTON_STOP | BUTTON_REL:
#else
#elif HAVE_RECORDER_KEYPAD
case BUTTON_OFF | BUTTON_REL:
#endif
done = true;
@ -1301,7 +1303,7 @@ static bool dbg_disk_info(void)
/* Wait for a key to be pushed */
key = button_get_w_tmo(HZ*5);
switch(key) {
#ifdef HAVE_PLAYER_KEYPAD
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
case BUTTON_STOP | BUTTON_REL:
#else
case BUTTON_OFF | BUTTON_REL:

View file

@ -138,6 +138,7 @@ void init(void)
powermgmt_init();
#ifdef HAVE_BATTERIES
if (coldstart && charger_inserted())
{
rc = charging_screen(); /* display a "charging" screen */
@ -145,6 +146,7 @@ void init(void)
power_off();
/* "On" pressed or USB connected: proceed */
}
#endif
rc = ata_init();
if(rc)

View file

@ -218,7 +218,7 @@ bool show_info(void)
/* Wait for a key to be pushed */
key = button_get_w_tmo(HZ*5);
switch(key) {
#ifdef HAVE_PLAYER_KEYPAD
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
case BUTTON_STOP | BUTTON_REL:
#else
case BUTTON_LEFT | BUTTON_REL:

View file

@ -29,7 +29,7 @@
#define KEYBOARD_PAGES 3
unsigned short *lcd_ascii;
extern unsigned short *lcd_ascii;
static unsigned short* kbd_setupkeys(int page, int* len)
{

View file

@ -453,7 +453,7 @@ static int add_directory_to_playlist(char *dirname, int *position, bool queue,
for (i=0; i<num_files; i++)
{
/* user abort */
#ifdef HAVE_PLAYER_KEYPAD
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
if (button_get(false) == BUTTON_STOP)
#else
if (button_get(false) == BUTTON_OFF)
@ -1553,7 +1553,7 @@ int playlist_insert_playlist(char *filename, int position, bool queue)
while ((max = read_line(fd, temp_buf, sizeof(temp_buf))) > 0)
{
/* user abort */
#ifdef HAVE_PLAYER_KEYPAD
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
if (button_get(false) == BUTTON_STOP)
#else
if (button_get(false) == BUTTON_OFF)
@ -2019,7 +2019,7 @@ int playlist_save(char *filename)
int seek;
/* user abort */
#ifdef HAVE_PLAYER_KEYPAD
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
if (button_get(false) == BUTTON_STOP)
#else
if (button_get(false) == BUTTON_OFF)

View file

@ -103,6 +103,9 @@ void usb_display_info(void)
void usb_screen(void)
{
#ifdef USB_NONE
/* nothing here! */
#else
#ifndef SIMULATOR
backlight_on();
usb_acknowledge(SYS_USB_CONNECTED_ACK);
@ -118,6 +121,7 @@ void usb_screen(void)
backlight_on();
#endif
#endif /* USB_NONE */
}
@ -230,7 +234,7 @@ void charging_display_info(bool animate)
}
#endif
#ifdef HAVE_BATTERIES
/* blocks while charging, returns on event:
1 if charger cable was removed
2 if Off/Stop key was pressed
@ -279,7 +283,7 @@ int charging_screen(void)
return rc;
}
#endif /* HAVE_BATTERIES */
#ifdef HAVE_RECORDER_KEYPAD

View file

@ -92,7 +92,7 @@ bool sleeptimer_screen(void)
done = true;
break;
#ifdef HAVE_PLAYER_KEYPAD
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
case BUTTON_RIGHT:
#else
case BUTTON_UP:

View file

@ -562,15 +562,19 @@ static bool ask_resume(bool ask_once)
while (!stop) {
switch (button_get(true)) {
case BUTTON_PLAY:
#ifdef BUTTON_RC_PLAY
case BUTTON_RC_PLAY:
#endif
return true;
#ifdef BUTTON_ON
/* ignore the ON button, since it might
still be pressed since booting */
case BUTTON_ON:
case BUTTON_ON | BUTTON_REL:
case BUTTON_ON | BUTTON_REPEAT:
break;
#endif
case SYS_USB_CONNECTED:
usb_screen();
@ -711,9 +715,13 @@ static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen,
while (!exit) {
switch (button_get(true)) {
case TREE_PREV:
#ifdef BUTTON_RC_LEFT
case BUTTON_RC_LEFT:
#endif
#ifdef BUTTON_ON
case BUTTON_ON | TREE_PREV:
case BUTTON_ON | TREE_PREV | BUTTON_REPEAT:
#endif
used = true;
if ( dirstart ) {
dirstart -= tree_max_on_screen;
@ -725,9 +733,13 @@ static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen,
break;
case TREE_NEXT:
#ifdef BUTTON_RC_RIGHT
case BUTTON_RC_RIGHT:
#endif
#ifdef BUTTON_ON
case BUTTON_ON | TREE_NEXT:
case BUTTON_ON | TREE_NEXT | BUTTON_REPEAT:
#endif
used = true;
if ( dirstart < numentries - tree_max_on_screen ) {
dirstart += tree_max_on_screen;
@ -741,8 +753,13 @@ static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen,
case BUTTON_PLAY:
#ifdef BUTTON_RC_PLAY
case BUTTON_RC_PLAY:
case BUTTON_ON | BUTTON_PLAY: {
#endif
#ifdef BUTTON_ON
case BUTTON_ON | BUTTON_PLAY:
#endif
{
int onplay_result;
if (currdir[1])
@ -769,11 +786,13 @@ static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen,
exit = true;
break;
}
#ifdef BUTTON_ON
case BUTTON_ON | BUTTON_REL:
case BUTTON_ON | TREE_PREV | BUTTON_REL:
case BUTTON_ON | TREE_NEXT | BUTTON_REL:
exit = true;
break;
#endif
}
if ( used && !exit ) {
#ifdef HAVE_LCD_BITMAP
@ -873,7 +892,9 @@ static bool dirbrowse(char *root, int *dirfilter)
switch ( button ) {
case TREE_EXIT:
#ifdef BUTTON_RC_STOP
case BUTTON_RC_STOP:
#endif
#ifdef HAVE_RECORDER_KEYPAD
case BUTTON_LEFT | BUTTON_REPEAT:
#endif
@ -932,7 +953,9 @@ static bool dirbrowse(char *root, int *dirfilter)
case TREE_ENTER:
case TREE_ENTER | BUTTON_REPEAT:
#ifdef BUTTON_RC_PLAY
case BUTTON_RC_PLAY:
#endif
#ifdef HAVE_RECORDER_KEYPAD
case BUTTON_PLAY:
case BUTTON_PLAY | BUTTON_REPEAT:
@ -1109,7 +1132,9 @@ static bool dirbrowse(char *root, int *dirfilter)
case TREE_PREV:
case TREE_PREV | BUTTON_REPEAT:
#ifdef BUTTON_RC_LEFT
case BUTTON_RC_LEFT:
#endif
if(filesindir) {
if(dircursor) {
put_cursorxy(CURSOR_X, CURSOR_Y + dircursor, false);
@ -1147,7 +1172,9 @@ static bool dirbrowse(char *root, int *dirfilter)
case TREE_NEXT:
case TREE_NEXT | BUTTON_REPEAT:
#ifdef BUTTON_RC_RIGHT
case BUTTON_RC_RIGHT:
#endif
if(filesindir)
{
if (dircursor + dirstart + 1 < numentries ) {
@ -1190,6 +1217,8 @@ static bool dirbrowse(char *root, int *dirfilter)
}
break;
#ifdef BUTTON_ON /* I bet the folks without ON-button want this to
work on a different button */
case BUTTON_ON:
if (handle_on(&dirstart, &dircursor, numentries,
tree_max_on_screen, dirfilter))
@ -1216,6 +1245,7 @@ static bool dirbrowse(char *root, int *dirfilter)
}
}
break;
#endif
#ifdef HAVE_RECORDER_KEYPAD
case BUTTON_F2:
@ -1342,7 +1372,7 @@ static bool add_dir(char* dirname, int fd)
DIR* dir;
/* check for user abort */
#ifdef HAVE_PLAYER_KEYPAD
#ifdef BUTTON_STOP
if (button_get(false) == BUTTON_STOP)
#else
if (button_get(false) == BUTTON_OFF)

View file

@ -414,6 +414,7 @@ static char* get_tag(struct mp3entry* id3,
#endif
case 'f': /* full-line progress bar */
#ifdef HAVE_LCD_CHARCELLS
#ifndef HAVE_NEO_LCD
if(has_new_lcd()) {
*flags |= WPS_REFRESH_PLAYER_PROGRESS;
*flags |= WPS_REFRESH_DYNAMIC;
@ -421,7 +422,10 @@ static char* get_tag(struct mp3entry* id3,
/* we need 11 characters (full line) for
progress-bar */
snprintf(buf, buf_size, " ");
} else {
}
else
#endif /* HAVE_NEO_LCD */
{
/* Tell the user if we have an OldPlayer */
snprintf(buf, buf_size, " <Old LCD> ");
}

View file

@ -53,7 +53,7 @@ static bool paused = false;
static struct mp3entry* id3 = NULL;
static char current_track_path[MAX_PATH+1];
#ifdef HAVE_PLAYER_KEYPAD
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
void player_change_volume(int button)
{
bool exit = false;
@ -278,7 +278,7 @@ bool browse_id3(void)
case BUTTON_REPEAT:
break;
#ifdef HAVE_PLAYER_KEYPAD
#ifdef BUTTON_STOP
case BUTTON_STOP:
#else
case BUTTON_OFF:
@ -506,7 +506,7 @@ static bool menu(void)
break;
/* mute */
#ifdef HAVE_PLAYER_KEYPAD
#ifdef BUTTON_MENU
case BUTTON_MENU | BUTTON_PLAY:
#else
case BUTTON_F1 | BUTTON_PLAY:
@ -534,7 +534,7 @@ static bool menu(void)
while (button_get(false)); /* clear button queue */
break;
#ifdef HAVE_PLAYER_KEYPAD
#ifdef BUTTON_MENU
/* change volume */
case BUTTON_MENU | BUTTON_LEFT:
case BUTTON_MENU | BUTTON_LEFT | BUTTON_REPEAT:
@ -545,9 +545,11 @@ static bool menu(void)
break;
/* show id3 tags */
#ifdef BUTTON_ON
case BUTTON_MENU | BUTTON_ON:
status_set_param(true);
status_set_audio(true);
#endif
#else
case BUTTON_F1 | BUTTON_ON:
#endif
@ -742,8 +744,11 @@ int wps_show(void)
! ((button & BUTTON_MENU) ||
#endif
(button == BUTTON_NONE) ||
(button == SYS_USB_CONNECTED) ||
(button & BUTTON_REMOTE)))
(button == SYS_USB_CONNECTED)
#ifdef BUTTON_REMOTE
|| (button & BUTTON_REMOTE)
#endif
))
{
while (button_get(false)); /* clear button queue */
display_keylock_text(true);
@ -759,6 +764,7 @@ int wps_show(void)
switch(button)
{
#ifdef BUTTON_ON
case BUTTON_ON:
#ifdef HAVE_RECORDER_KEYPAD
switch (on_screen()) {
@ -795,10 +801,12 @@ int wps_show(void)
}
break;
#endif
#endif /* BUTTON_ON */
/* play/pause */
case BUTTON_PLAY:
#ifdef BUTTON_RC_PLAY
case BUTTON_RC_PLAY:
#endif
if ( paused )
{
paused = false;
@ -830,7 +838,9 @@ int wps_show(void)
case BUTTON_UP:
case BUTTON_UP | BUTTON_REPEAT:
#endif
#ifdef BUTTON_RC_VOL_UP
case BUTTON_RC_VOL_UP:
#endif
global_settings.volume++;
if(global_settings.volume > mpeg_sound_max(SOUND_VOLUME))
global_settings.volume = mpeg_sound_max(SOUND_VOLUME);
@ -844,7 +854,9 @@ int wps_show(void)
case BUTTON_DOWN:
case BUTTON_DOWN | BUTTON_REPEAT:
#endif
#ifdef BUTTON_RC_VOL_DOWN
case BUTTON_RC_VOL_DOWN:
#endif
global_settings.volume--;
if(global_settings.volume < mpeg_sound_min(SOUND_VOLUME))
global_settings.volume = mpeg_sound_min(SOUND_VOLUME);
@ -860,7 +872,9 @@ int wps_show(void)
break;
/* prev / restart */
#ifdef BUTTON_RC_LEFT
case BUTTON_RC_LEFT:
#endif
case BUTTON_LEFT | BUTTON_REL:
#ifdef HAVE_RECORDER_KEYPAD
if ((button == (BUTTON_LEFT | BUTTON_REL)) &&
@ -882,7 +896,9 @@ int wps_show(void)
break;
/* next */
#ifdef BUTTON_RC_RIGHT
case BUTTON_RC_RIGHT:
#endif
case BUTTON_RIGHT | BUTTON_REL:
#ifdef HAVE_RECORDER_KEYPAD
if ((button == (BUTTON_RIGHT | BUTTON_REL)) &&
@ -893,7 +909,7 @@ int wps_show(void)
break;
/* menu key functions */
#ifdef HAVE_PLAYER_KEYPAD
#ifdef BUTTON_MENU
case BUTTON_MENU:
#else
case BUTTON_F1:
@ -922,8 +938,10 @@ int wps_show(void)
#endif
/* stop and exit wps */
#ifdef BUTTON_RC_STOP
case BUTTON_RC_STOP:
#ifdef HAVE_RECORDER_KEYPAD
#endif
#ifdef BUTTON_OFF
case BUTTON_OFF:
#else
case BUTTON_STOP | BUTTON_REL: