2005-02-15 08:03:56 +00:00
|
|
|
|
/***************************************************************************
|
|
|
|
|
* __________ __ ___.
|
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
2006-03-27 17:34:23 +00:00
|
|
|
|
* Copyright (C) 2005 Jonas H<EFBFBD>gqvist
|
2005-02-15 08:03:56 +00:00
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
2005-02-15 08:03:56 +00:00
|
|
|
|
*
|
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
|
* KIND, either express or implied.
|
|
|
|
|
*
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
#include "plugin.h"
|
2008-11-20 11:27:31 +00:00
|
|
|
|
#include "lib/playergfx.h"
|
2005-02-15 08:03:56 +00:00
|
|
|
|
|
2006-01-15 18:20:18 +00:00
|
|
|
|
PLUGIN_HEADER
|
|
|
|
|
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
|
#define DISPLAY_WIDTH LCD_WIDTH
|
|
|
|
|
#define DISPLAY_HEIGHT LCD_HEIGHT
|
|
|
|
|
#define RAND_SCALE 5
|
2005-02-15 08:03:56 +00:00
|
|
|
|
|
2005-05-23 16:23:25 +00:00
|
|
|
|
#ifdef HAVE_REMOTE_LCD
|
|
|
|
|
#define REMOTE_WIDTH LCD_REMOTE_WIDTH
|
|
|
|
|
#define REMOTE_HEIGHT LCD_REMOTE_HEIGHT
|
2008-11-03 14:37:50 +00:00
|
|
|
|
#include "pluginbitmaps/remote_rockboxlogo.h"
|
2008-01-31 21:05:32 +00:00
|
|
|
|
#define REMOTE_LOGO_WIDTH BMPWIDTH_remote_rockboxlogo
|
|
|
|
|
#define REMOTE_LOGO_HEIGHT BMPHEIGHT_remote_rockboxlogo
|
2008-01-31 19:28:51 +00:00
|
|
|
|
#define REMOTE_LOGO remote_rockboxlogo
|
2008-01-31 20:42:28 +00:00
|
|
|
|
extern const fb_remote_data remote_rockboxlogo[];
|
2005-06-30 21:07:00 +00:00
|
|
|
|
#endif /* HAVE_REMOTE_LCD */
|
2005-05-16 12:07:30 +00:00
|
|
|
|
|
2008-01-31 19:28:51 +00:00
|
|
|
|
#define LOGO rockboxlogo
|
2008-11-03 14:37:50 +00:00
|
|
|
|
#include "pluginbitmaps/rockboxlogo.h"
|
2008-01-31 21:05:32 +00:00
|
|
|
|
#define LOGO_WIDTH BMPWIDTH_rockboxlogo
|
|
|
|
|
#define LOGO_HEIGHT BMPHEIGHT_rockboxlogo
|
2008-01-31 19:28:51 +00:00
|
|
|
|
extern const fb_data rockboxlogo[];
|
2005-03-05 22:45:04 +00:00
|
|
|
|
|
|
|
|
|
#else /* !LCD_BITMAP */
|
|
|
|
|
#define DISPLAY_WIDTH 55
|
|
|
|
|
#define DISPLAY_HEIGHT 14
|
|
|
|
|
#define RAND_SCALE 2
|
|
|
|
|
#define LOGO_WIDTH 16
|
|
|
|
|
#define LOGO_HEIGHT 7
|
|
|
|
|
#define LOGO rockbox16x7
|
|
|
|
|
const unsigned char rockbox16x7[] = {
|
2005-06-30 21:07:00 +00:00
|
|
|
|
0x47, 0x18, 0xa6, 0xd8, 0x66, 0xde, 0xb7, 0x9b,
|
|
|
|
|
0x76, 0xdb, 0x26, 0xdb, 0x66, 0xde,
|
2005-03-05 22:45:04 +00:00
|
|
|
|
};
|
|
|
|
|
#endif /* !LCD_BITMAP */
|
|
|
|
|
|
|
|
|
|
/* variable button definitions */
|
|
|
|
|
#if CONFIG_KEYPAD == PLAYER_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_STOP
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y (BUTTON_ON | BUTTON_LEFT)
|
|
|
|
|
#define LP_INC_Y (BUTTON_ON | BUTTON_RIGHT)
|
2008-03-22 10:24:28 +00:00
|
|
|
|
|
2006-02-24 20:54:09 +00:00
|
|
|
|
#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
|
2007-07-27 09:57:27 +00:00
|
|
|
|
(CONFIG_KEYPAD == IPOD_3G_PAD) || \
|
|
|
|
|
(CONFIG_KEYPAD == IPOD_1G2G_PAD)
|
2005-12-14 01:31:37 +00:00
|
|
|
|
#define LP_QUIT BUTTON_MENU
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_SCROLL_BACK
|
|
|
|
|
#define LP_INC_Y BUTTON_SCROLL_FWD
|
2008-03-22 10:24:28 +00:00
|
|
|
|
|
2006-01-12 00:35:50 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_PLAY
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
2008-03-22 10:24:28 +00:00
|
|
|
|
|
2007-03-16 23:02:39 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
|
2006-03-27 17:34:23 +00:00
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
2006-01-19 12:44:46 +00:00
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
2008-03-22 10:24:28 +00:00
|
|
|
|
|
2006-02-24 15:42:52 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == GIGABEAT_PAD
|
2007-05-19 23:38:09 +00:00
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
2006-02-24 15:42:52 +00:00
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
2006-10-26 13:38:09 +00:00
|
|
|
|
|
2007-09-20 10:49:48 +00:00
|
|
|
|
#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
|
2009-01-04 23:33:15 +00:00
|
|
|
|
(CONFIG_KEYPAD == SANSA_C200_PAD) || \
|
|
|
|
|
(CONFIG_KEYPAD == SANSA_CLIP_PAD) || \
|
2009-05-28 15:57:29 +00:00
|
|
|
|
(CONFIG_KEYPAD == SANSA_M200_PAD)
|
2006-10-26 13:38:09 +00:00
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2009-04-10 17:28:26 +00:00
|
|
|
|
#elif (CONFIG_KEYPAD == SANSA_FUZE_PAD)
|
|
|
|
|
#define LP_QUIT (BUTTON_HOME|BUTTON_REPEAT)
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2006-08-03 20:17:25 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_SCROLL_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_SCROLL_UP
|
2007-10-23 15:40:51 +00:00
|
|
|
|
|
|
|
|
|
#elif CONFIG_KEYPAD == MROBE500_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
|
2008-02-17 12:23:02 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_BACK
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2008-03-01 22:55:09 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == MROBE100_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2008-03-22 10:24:28 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_RC_REC
|
|
|
|
|
#define LP_DEC_X BUTTON_RC_REW
|
|
|
|
|
#define LP_INC_X BUTTON_RC_FF
|
|
|
|
|
#define LP_DEC_Y BUTTON_RC_VOL_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_RC_VOL_UP
|
|
|
|
|
|
2008-03-22 22:03:34 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == COWOND2_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
|
2008-10-07 16:38:28 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == IAUDIO67_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_PLAY
|
|
|
|
|
#define LP_INC_Y BUTTON_STOP
|
|
|
|
|
|
2008-12-04 21:28:56 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_BACK
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
2009-01-24 22:41:55 +00:00
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
|
|
|
|
#elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
2008-12-04 21:28:56 +00:00
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2009-04-07 23:41:44 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == ONDAVX747_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
|
2009-08-04 03:08:32 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == SAMSUNG_YH_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_PLAY
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#else
|
|
|
|
|
#define LP_QUIT BUTTON_OFF
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
2005-02-15 08:03:56 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#ifdef CONFIG_REMOTE_KEYPAD
|
2005-06-29 12:47:24 +00:00
|
|
|
|
#if (CONFIG_REMOTE_KEYPAD == H100_REMOTE) || \
|
|
|
|
|
(CONFIG_REMOTE_KEYPAD == H300_REMOTE)
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#define LP_R_QUIT BUTTON_RC_STOP
|
|
|
|
|
#define LP_R_DEC_X BUTTON_RC_REW
|
|
|
|
|
#define LP_R_INC_X BUTTON_RC_FF
|
|
|
|
|
#define LP_R_DEC_Y BUTTON_RC_SOURCE
|
|
|
|
|
#define LP_R_INC_Y BUTTON_RC_BITRATE
|
2009-04-11 07:23:56 +00:00
|
|
|
|
|
|
|
|
|
#elif (CONFIG_REMOTE_KEYPAD==MROBE_REMOTE)
|
|
|
|
|
#define LP_R_QUIT BUTTON_RC_HEART
|
|
|
|
|
#define LP_R_DEC_X BUTTON_RC_REW
|
|
|
|
|
#define LP_R_INC_X BUTTON_RC_FF
|
|
|
|
|
#define LP_R_DEC_Y BUTTON_RC_DOWN
|
|
|
|
|
#define LP_R_INC_Y BUTTON_RC_PLAY
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#endif
|
2009-04-11 07:23:56 +00:00
|
|
|
|
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#endif /* CONFIG_REMOTE_KEYPAD */
|
|
|
|
|
|
2008-08-23 09:46:38 +00:00
|
|
|
|
#ifdef HAVE_TOUCHSCREEN
|
2008-04-27 15:30:19 +00:00
|
|
|
|
#ifndef LP_QUIT
|
|
|
|
|
#define LP_QUIT BUTTON_TOPLEFT
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef LP_DEC_X
|
|
|
|
|
#define LP_DEC_X BUTTON_MIDLEFT
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef LP_INC_X
|
|
|
|
|
#define LP_INC_X BUTTON_MIDRIGHT
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef LP_DEC_Y
|
|
|
|
|
#define LP_DEC_Y BUTTON_TOPMIDDLE
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef LP_INC_Y
|
|
|
|
|
#define LP_INC_Y BUTTON_BOTTOMMIDDLE
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
2005-02-15 08:03:56 +00:00
|
|
|
|
|
2009-01-16 10:34:40 +00:00
|
|
|
|
enum plugin_status plugin_start(const void* parameter) {
|
2005-02-15 08:03:56 +00:00
|
|
|
|
int button;
|
|
|
|
|
int timer = 10;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
int x = (DISPLAY_WIDTH / 2) - (LOGO_WIDTH / 2);
|
|
|
|
|
int y = (DISPLAY_HEIGHT / 2) - (LOGO_HEIGHT / 2);
|
2005-02-15 09:27:23 +00:00
|
|
|
|
int dx;
|
|
|
|
|
int dy;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
|
int cpos = -1;
|
|
|
|
|
int old_cpos = -1;
|
|
|
|
|
#endif
|
2005-02-15 09:27:23 +00:00
|
|
|
|
|
2005-02-15 08:03:56 +00:00
|
|
|
|
(void)parameter;
|
2005-02-15 09:27:23 +00:00
|
|
|
|
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
2009-01-16 10:34:40 +00:00
|
|
|
|
if (!pgfx_init(4, 2)) {
|
2007-03-16 21:56:08 +00:00
|
|
|
|
rb->splash(HZ*2, "Old LCD :(");
|
2005-03-05 22:45:04 +00:00
|
|
|
|
return PLUGIN_OK;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
rb->srand(*rb->current_tick);
|
|
|
|
|
dx = rb->rand()%(2*RAND_SCALE+1) - RAND_SCALE;
|
|
|
|
|
dy = rb->rand()%(2*RAND_SCALE+1) - RAND_SCALE;
|
2005-02-15 08:03:56 +00:00
|
|
|
|
|
|
|
|
|
while (1) {
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2005-02-15 08:03:56 +00:00
|
|
|
|
rb->lcd_clear_display();
|
2008-01-31 19:28:51 +00:00
|
|
|
|
rb->lcd_bitmap(LOGO, x, y, LOGO_WIDTH, LOGO_HEIGHT);
|
2005-05-16 12:07:30 +00:00
|
|
|
|
#ifdef REMOTE_LOGO
|
2005-06-29 01:39:50 +00:00
|
|
|
|
rb->lcd_remote_clear_display();
|
2008-01-31 19:28:51 +00:00
|
|
|
|
rb->lcd_remote_bitmap(REMOTE_LOGO,
|
2005-05-16 12:07:30 +00:00
|
|
|
|
(x * (REMOTE_WIDTH - REMOTE_LOGO_WIDTH)) / (DISPLAY_WIDTH - LOGO_WIDTH),
|
|
|
|
|
(y * (REMOTE_HEIGHT - REMOTE_LOGO_HEIGHT)) / (DISPLAY_HEIGHT - LOGO_HEIGHT),
|
2005-06-29 01:39:50 +00:00
|
|
|
|
REMOTE_LOGO_WIDTH, REMOTE_LOGO_HEIGHT);
|
2005-05-16 12:07:30 +00:00
|
|
|
|
#endif
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#else
|
|
|
|
|
pgfx_clear_display();
|
2005-07-07 00:05:29 +00:00
|
|
|
|
pgfx_mono_bitmap(LOGO, x % 5, y, LOGO_WIDTH, LOGO_HEIGHT);
|
2005-03-05 22:45:04 +00:00
|
|
|
|
cpos = x / 5;
|
|
|
|
|
#endif
|
2005-02-15 08:03:56 +00:00
|
|
|
|
|
|
|
|
|
x += dx;
|
|
|
|
|
if (x < 0) {
|
|
|
|
|
dx = -dx;
|
|
|
|
|
x = 0;
|
|
|
|
|
}
|
2005-03-05 22:45:04 +00:00
|
|
|
|
if (x > DISPLAY_WIDTH - LOGO_WIDTH) {
|
2005-02-15 08:03:56 +00:00
|
|
|
|
dx = -dx;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
x = DISPLAY_WIDTH - LOGO_WIDTH;
|
2005-02-15 08:03:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
y += dy;
|
|
|
|
|
if (y < 0) {
|
|
|
|
|
dy = -dy;
|
|
|
|
|
y = 0;
|
|
|
|
|
}
|
2005-03-05 22:45:04 +00:00
|
|
|
|
if (y > DISPLAY_HEIGHT - LOGO_HEIGHT) {
|
2005-02-15 08:03:56 +00:00
|
|
|
|
dy = -dy;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
y = DISPLAY_HEIGHT - LOGO_HEIGHT;
|
2005-02-15 08:03:56 +00:00
|
|
|
|
}
|
2005-03-05 22:45:04 +00:00
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2005-02-15 08:03:56 +00:00
|
|
|
|
rb->lcd_update();
|
2005-05-16 12:07:30 +00:00
|
|
|
|
#ifdef REMOTE_LOGO
|
2005-06-29 01:39:50 +00:00
|
|
|
|
rb->lcd_remote_update();
|
2005-05-16 12:07:30 +00:00
|
|
|
|
#endif
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#else
|
|
|
|
|
if (cpos != old_cpos) {
|
|
|
|
|
rb->lcd_clear_display();
|
|
|
|
|
pgfx_display(cpos, 0);
|
|
|
|
|
old_cpos = cpos;
|
|
|
|
|
}
|
2007-04-06 22:55:00 +00:00
|
|
|
|
pgfx_update();
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#endif
|
2005-02-15 08:03:56 +00:00
|
|
|
|
rb->sleep(HZ/timer);
|
|
|
|
|
|
|
|
|
|
button = rb->button_get(false);
|
|
|
|
|
switch (button) {
|
2005-03-05 22:45:04 +00:00
|
|
|
|
case LP_QUIT:
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#ifdef CONFIG_REMOTE_KEYPAD
|
|
|
|
|
case LP_R_QUIT:
|
|
|
|
|
#endif
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
|
pgfx_release();
|
|
|
|
|
#endif
|
2005-02-15 08:03:56 +00:00
|
|
|
|
return PLUGIN_OK;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
case LP_DEC_X:
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#ifdef CONFIG_REMOTE_KEYPAD
|
|
|
|
|
case LP_R_DEC_X:
|
|
|
|
|
#endif
|
2005-03-05 22:45:04 +00:00
|
|
|
|
if (dx)
|
|
|
|
|
dx += (dx < 0) ? 1 : -1;
|
2005-02-15 08:03:56 +00:00
|
|
|
|
break;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
case LP_INC_X:
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#ifdef CONFIG_REMOTE_KEYPAD
|
|
|
|
|
case LP_R_INC_X:
|
|
|
|
|
#endif
|
2005-03-05 22:45:04 +00:00
|
|
|
|
dx += (dx < 0) ? -1 : 1;
|
2005-02-15 08:03:56 +00:00
|
|
|
|
break;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
case LP_DEC_Y:
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#ifdef CONFIG_REMOTE_KEYPAD
|
|
|
|
|
case LP_R_DEC_Y:
|
|
|
|
|
#endif
|
2005-03-05 22:45:04 +00:00
|
|
|
|
if (dy)
|
|
|
|
|
dy += (dy < 0) ? 1 : -1;
|
2005-02-15 08:03:56 +00:00
|
|
|
|
break;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
case LP_INC_Y:
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#ifdef CONFIG_REMOTE_KEYPAD
|
|
|
|
|
case LP_R_INC_Y:
|
|
|
|
|
#endif
|
2005-03-05 22:45:04 +00:00
|
|
|
|
dy += (dy < 0) ? -1 : 1;
|
2005-02-15 08:03:56 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
2005-03-05 22:45:04 +00:00
|
|
|
|
if (rb->default_event_handler(button) == SYS_USB_CONNECTED) {
|
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
|
pgfx_release();
|
|
|
|
|
#endif
|
|
|
|
|
return PLUGIN_USB_CONNECTED;
|
|
|
|
|
}
|
2005-02-15 08:03:56 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-27 15:30:19 +00:00
|
|
|
|
|