From a60bc256ab78482812d6900d08c59d4948e019a2 Mon Sep 17 00:00:00 2001 From: Jean-Louis Biasini Date: Tue, 21 Feb 2012 15:04:21 +0100 Subject: fireworks's plugin PLA integration 1) this patch replace all keymaps with PLA ones. It also clean some optionnal compiling that are not needed anymore througt PLA 2) it also add an alternative exit button (PLA_EXIT or PLA_CANCEL) Note: no patch for manual here as there isn't a manual for fireworks yet Change-Id: I460096a018ce8d3890425f8b6b98194c4e3f9d76 Reviewed-on: http://gerrit.rockbox.org/114 Reviewed-by: Thomas Martitz Tested-by: Thomas Martitz --- apps/plugins/fireworks.c | 131 +++++------------------------------------------ 1 file changed, 13 insertions(+), 118 deletions(-) (limited to 'apps') diff --git a/apps/plugins/fireworks.c b/apps/plugins/fireworks.c index 52b11b7079..c49c4fd6bb 100644 --- a/apps/plugins/fireworks.c +++ b/apps/plugins/fireworks.c @@ -21,8 +21,10 @@ #include "plugin.h" #include "lib/helper.h" #include "lib/playback_control.h" +#include "lib/pluginlib_actions.h" - +/* this set the context to use with PLA */ +static const struct button_mapping *plugin_contexts[] = { pla_main_ctx }; /*** * FIREWORKS.C by ZAKK ROBERTS @@ -31,121 +33,11 @@ * Currently disabled for Archos Recorder - runs too slow. ***/ -/* All sorts of keymappings.. */ -#if (CONFIG_KEYPAD == IRIVER_H300_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) -#define BTN_MENU BUTTON_OFF -#define BTN_FIRE BUTTON_SELECT - -#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \ - (CONFIG_KEYPAD == IPOD_1G2G_PAD) -#define BTN_MENU BUTTON_MENU -#define BTN_FIRE BUTTON_SELECT - -#elif (CONFIG_KEYPAD == RECORDER_PAD) -#define BTN_MENU BUTTON_OFF -#define BTN_FIRE BUTTON_PLAY - -#elif (CONFIG_KEYPAD == ARCHOS_AV300_PAD) -#define BTN_MENU BUTTON_OFF -#define BTN_FIRE BUTTON_SELECT - -#elif (CONFIG_KEYPAD == ONDIO_PAD) -#define BTN_MENU BUTTON_MENU -#define BTN_FIRE BUTTON_UP - -#elif (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) -#define BTN_MENU BUTTON_POWER -#define BTN_FIRE BUTTON_SELECT - -#elif (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) -#define BTN_MENU BUTTON_MODE -#define BTN_FIRE BUTTON_SELECT - -#elif (CONFIG_KEYPAD == GIGABEAT_PAD) || \ - (CONFIG_KEYPAD == GIGABEAT_S_PAD) || \ - (CONFIG_KEYPAD == MROBE100_PAD) || \ - (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD) -#define BTN_MENU BUTTON_MENU -#define BTN_FIRE BUTTON_SELECT - -#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \ - (CONFIG_KEYPAD == SANSA_C200_PAD) || \ - (CONFIG_KEYPAD == SANSA_CONNECT_PAD) -#define BTN_MENU BUTTON_POWER -#define BTN_FIRE BUTTON_SELECT - -#elif (CONFIG_KEYPAD == SANSA_FUZE_PAD) -#define BTN_MENU (BUTTON_HOME|BUTTON_REPEAT) -#define BTN_FIRE BUTTON_SELECT - -#elif (CONFIG_KEYPAD == IRIVER_H10_PAD) -#define BTN_MENU BUTTON_POWER -#define BTN_FIRE BUTTON_PLAY - -#elif CONFIG_KEYPAD == IAUDIO_M3_PAD -#define BTN_MENU BUTTON_RC_REC -#define BTN_FIRE BUTTON_RC_PLAY - -#elif (CONFIG_KEYPAD == COWON_D2_PAD) -#define BTN_MENU (BUTTON_MENU|BUTTON_REL) - -#elif CONFIG_KEYPAD == IAUDIO67_PAD -#define BTN_MENU BUTTON_MENU -#define BTN_FIRE BUTTON_PLAY - -#elif CONFIG_KEYPAD == CREATIVEZVM_PAD -#define BTN_MENU BUTTON_MENU -#define BTN_FIRE BUTTON_SELECT - -#elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD -#define BTN_MENU BUTTON_MENU -#define BTN_FIRE BUTTON_SELECT - -#elif CONFIG_KEYPAD == PHILIPS_HDD6330_PAD -#define BTN_MENU BUTTON_MENU -#define BTN_FIRE BUTTON_PLAY - -#elif CONFIG_KEYPAD == PHILIPS_SA9200_PAD -#define BTN_MENU BUTTON_MENU -#define BTN_FIRE BUTTON_PLAY - -#elif (CONFIG_KEYPAD == ONDAVX747_PAD) -#define BTN_MENU (BUTTON_MENU|BUTTON_REL) - -#elif (CONFIG_KEYPAD == SAMSUNG_YH_PAD) -#define BTN_MENU BUTTON_LEFT -#define BTN_FIRE BUTTON_PLAY - -#elif (CONFIG_KEYPAD == PBELL_VIBE500_PAD) -#define BTN_MENU BUTTON_MENU -#define BTN_FIRE BUTTON_OK - -#elif (CONFIG_KEYPAD == MPIO_HD200_PAD) -#define BTN_MENU BUTTON_REC -#define BTN_FIRE BUTTON_PLAY - -#elif (CONFIG_KEYPAD == MPIO_HD300_PAD) -#define BTN_MENU BUTTON_MENU -#define BTN_FIRE BUTTON_PLAY - -#elif (CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD) -#define BTN_MENU BUTTON_SELECT -#define BTN_FIRE BUTTON_PLAYPAUSE - -#elif defined(HAVE_TOUCHSCREEN) - /* This is a touchscreen target */ -#else -#error No keymap defined! -#endif - -#ifdef HAVE_TOUCHSCREEN -#ifndef BTN_MENU -#define BTN_MENU (BUTTON_TOPLEFT|BUTTON_REL) -#endif -#ifndef BTN_FIRE -#define BTN_FIRE BUTTON_CENTER -#endif -#endif +/* We use PLA */ +#define BTN_MENU PLA_EXIT +#define BTN_MENU2 PLA_CANCEL +#define BTN_FIRE PLA_SELECT +#define BTN_FIRE_REPEAT PLA_SELECT_REPEAT /* The lowdown on source terminology: * a ROCKET is launched from the LCD bottom. @@ -609,15 +501,18 @@ enum plugin_status plugin_start(const void* parameter) rb->lcd_update(); - button = rb->button_get_w_tmo(HZ/fps_values[frames_per_second]); + button = pluginlib_getaction(HZ/fps_values[frames_per_second], plugin_contexts, + ARRAYLEN(plugin_contexts)); + switch(button) { case BTN_MENU: /* back to config menu */ + case BTN_MENU2: fireworks_menu(); break; case BTN_FIRE: /* fire off rockets manually */ - case BTN_FIRE|BUTTON_REPEAT: + case BTN_FIRE_REPEAT: init_rocket(thisrocket); if(++thisrocket == MAX_ROCKETS) thisrocket=0; -- cgit v1.2.3