summaryrefslogtreecommitdiffstats
path: root/apps/plugins/rockblox1d.c
diff options
context:
space:
mode:
authorJean-Louis Biasini <jlbiasini@gmail.com>2012-02-10 18:51:17 +0100
committerThomas Martitz <kugel@rockbox.org>2012-02-18 23:57:22 +0100
commite5b1b0f998f9ac16dc4a5f6be73be535f22533e4 (patch)
tree791dc2df7954abcda499ab716c55aeacd2cbe1bb /apps/plugins/rockblox1d.c
parent488f6229c0974fc9a7ff8762f1c35673b2747039 (diff)
downloadrockbox-e5b1b0f998f9ac16dc4a5f6be73be535f22533e4.tar.gz
rockbox-e5b1b0f998f9ac16dc4a5f6be73be535f22533e4.tar.bz2
rockbox-e5b1b0f998f9ac16dc4a5f6be73be535f22533e4.zip
rockblox1d's plugin PLA integration (main code + manual)
1) this patch replace all keymaps with PLA ones. It also clean some optionnal compiling that are not needed anymore througt PLA. 2) the patch also made required change to the manual in order to match code's change. 3) it also add an alternative exit button (PLA_EXIT or PLA_CANCEL). Change-Id: If6e78711eaab1dd2c907b418ba72c8789ceaa72b Reviewed-on: http://gerrit.rockbox.org/105 Reviewed-by: Thomas Martitz <kugel@rockbox.org> Tested-by: Thomas Martitz <kugel@rockbox.org>
Diffstat (limited to 'apps/plugins/rockblox1d.c')
-rw-r--r--apps/plugins/rockblox1d.c130
1 files changed, 12 insertions, 118 deletions
diff --git a/apps/plugins/rockblox1d.c b/apps/plugins/rockblox1d.c
index 7a50030596..6a2b013c44 100644
--- a/apps/plugins/rockblox1d.c
+++ b/apps/plugins/rockblox1d.c
@@ -21,123 +21,14 @@
****************************************************************************/
#include "plugin.h"
+#include "lib/pluginlib_actions.h"
-#if CONFIG_KEYPAD == RECORDER_PAD
-#define ONEDROCKBLOX_DOWN BUTTON_PLAY
-#define ONEDROCKBLOX_QUIT BUTTON_OFF
-
-#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
-#define ONEDROCKBLOX_DOWN BUTTON_SELECT
-#define ONEDROCKBLOX_QUIT BUTTON_OFF
-
-#elif CONFIG_KEYPAD == ONDIO_PAD
-#define ONEDROCKBLOX_DOWN BUTTON_RIGHT
-#define ONEDROCKBLOX_QUIT BUTTON_OFF
-
-#elif (CONFIG_KEYPAD == IAUDIO_X5M5_PAD)
-#define ONEDROCKBLOX_DOWN BUTTON_SELECT
-#define ONEDROCKBLOX_QUIT BUTTON_POWER
-
-#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
- (CONFIG_KEYPAD == IPOD_3G_PAD) || \
- (CONFIG_KEYPAD == IPOD_1G2G_PAD)
-#define ONEDROCKBLOX_DOWN BUTTON_SELECT
-#define ONEDROCKBLOX_QUIT (BUTTON_SELECT | BUTTON_MENU)
-
-#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
- (CONFIG_KEYPAD == IRIVER_H300_PAD)
-#define ONEDROCKBLOX_DOWN BUTTON_SELECT
-#define ONEDROCKBLOX_QUIT BUTTON_OFF
-
-#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
-#define ONEDROCKBLOX_DOWN BUTTON_SELECT
-#define ONEDROCKBLOX_QUIT BUTTON_POWER
-
-#elif CONFIG_KEYPAD == SANSA_E200_PAD || \
- CONFIG_KEYPAD == SANSA_C200_PAD || \
- CONFIG_KEYPAD == SANSA_CLIP_PAD || \
- CONFIG_KEYPAD == SANSA_M200_PAD || \
- CONFIG_KEYPAD == SANSA_CONNECT_PAD
-#define ONEDROCKBLOX_DOWN BUTTON_SELECT
-#define ONEDROCKBLOX_QUIT BUTTON_POWER
-
-#elif CONFIG_KEYPAD == SANSA_FUZE_PAD
-#define ONEDROCKBLOX_DOWN BUTTON_SELECT
-#define ONEDROCKBLOX_QUIT BUTTON_HOME
-
-#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
-#define ONEDROCKBLOX_DOWN BUTTON_PLAY
-#define ONEDROCKBLOX_QUIT BUTTON_POWER
-
-#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) || \
- (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
-#define ONEDROCKBLOX_DOWN BUTTON_SELECT
-#define ONEDROCKBLOX_QUIT BUTTON_BACK
-
-#elif (CONFIG_KEYPAD == MROBE100_PAD)
-#define ONEDROCKBLOX_DOWN BUTTON_SELECT
-#define ONEDROCKBLOX_QUIT BUTTON_POWER
-
-#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
-#define ONEDROCKBLOX_DOWN BUTTON_RC_PLAY
-#define ONEDROCKBLOX_QUIT BUTTON_RC_REC
-
-#elif (CONFIG_KEYPAD == COWON_D2_PAD)
-#define ONEDROCKBLOX_DOWN BUTTON_MENU
-#define ONEDROCKBLOX_QUIT BUTTON_POWER
-
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define ONEDROCKBLOX_DOWN BUTTON_MENU
-#define ONEDROCKBLOX_QUIT BUTTON_POWER
-
-#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
-#define ONEDROCKBLOX_DOWN BUTTON_SELECT
-#define ONEDROCKBLOX_QUIT BUTTON_BACK
-
-#elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD
-#define ONEDROCKBLOX_DOWN BUTTON_SELECT
-#define ONEDROCKBLOX_QUIT BUTTON_POWER
-
-#elif CONFIG_KEYPAD == PHILIPS_HDD6330_PAD
-#define ONEDROCKBLOX_DOWN BUTTON_PLAY
-#define ONEDROCKBLOX_QUIT BUTTON_POWER
-
-#elif CONFIG_KEYPAD == PHILIPS_SA9200_PAD
-#define ONEDROCKBLOX_DOWN BUTTON_PLAY
-#define ONEDROCKBLOX_QUIT BUTTON_POWER
-
-#elif (CONFIG_KEYPAD == ONDAVX747_PAD)
-#define ONEDROCKBLOX_DOWN BUTTON_MENU
-#define ONEDROCKBLOX_QUIT BUTTON_POWER
-
-#elif (CONFIG_KEYPAD == SAMSUNG_YH_PAD)
-#define ONEDROCKBLOX_DOWN BUTTON_DOWN
-#define ONEDROCKBLOX_QUIT BUTTON_PLAY
-
-#elif (CONFIG_KEYPAD == PBELL_VIBE500_PAD)
-#define ONEDROCKBLOX_DOWN BUTTON_DOWN
-#define ONEDROCKBLOX_QUIT BUTTON_REC
-
-#elif (CONFIG_KEYPAD == MPIO_HD200_PAD)
-#define ONEDROCKBLOX_DOWN BUTTON_FUNC
-#define ONEDROCKBLOX_QUIT (BUTTON_REC | BUTTON_PLAY)
-
-#elif (CONFIG_KEYPAD == MPIO_HD300_PAD)
-#define ONEDROCKBLOX_DOWN BUTTON_ENTER
-#define ONEDROCKBLOX_QUIT BUTTON_MENU
-
-#elif (CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD)
-#define ONEDROCKBLOX_DOWN BUTTON_DOWN
-#define ONEDROCKBLOX_QUIT BUTTON_POWER
-
-#elif defined(HAVE_TOUCHSCREEN)
-
-#define ONEDROCKBLOX_DOWN BUTTON_BOTTOMMIDDLE
-#define ONEDROCKBLOX_QUIT BUTTON_POWER
-
-#else
-#error No keymap defined!
-#endif
+/* this set the context to use with PLA */
+static const struct button_mapping *plugin_contexts[] = { pla_main_ctx };
+#define ONEDROCKBLOX_DOWN PLA_DOWN
+#define ONEDROCKBLOX_DOWN_REPEAT PLA_DOWN_REPEAT
+#define ONEDROCKBLOX_QUIT PLA_EXIT
+#define ONEDROCKBLOX_QUIT2 PLA_CANCEL
#define mrand(max) (short)(rb->rand()%max)
@@ -295,14 +186,17 @@ enum plugin_status plugin_start(const void* parameter)
rb->lcd_update();
- button = rb->button_status();
+ /*We get button from PLA this way */
+ button = pluginlib_getaction(TIMEOUT_NOBLOCK, plugin_contexts,
+ ARRAYLEN(plugin_contexts));
switch(button) {
case ONEDROCKBLOX_DOWN:
- case (ONEDROCKBLOX_DOWN|BUTTON_REPEAT):
+ case ONEDROCKBLOX_DOWN_REPEAT:
cycletime = 100;
break;
case ONEDROCKBLOX_QUIT:
+ case ONEDROCKBLOX_QUIT2:
quit = true;
break;
default: