summaryrefslogtreecommitdiffstats
path: root/apps/plugins/mosaique.c
diff options
context:
space:
mode:
authorJean-Louis Biasini <jlbiasini@gmail.com>2012-02-25 23:43:18 +0100
committerThomas Martitz <kugel@rockbox.org>2012-03-03 16:37:47 +0100
commit693af46f6de65012828a621ab07573096857ab64 (patch)
tree3b3ffd25059e0772ee1e53ddc6205469d99b6d3f /apps/plugins/mosaique.c
parentd05db0a90c7bce7e6830e77a16c63a90e9e572c4 (diff)
downloadrockbox-693af46f6de65012828a621ab07573096857ab64.tar.gz
rockbox-693af46f6de65012828a621ab07573096857ab64.tar.bz2
rockbox-693af46f6de65012828a621ab07573096857ab64.zip
Plugin mosaique PLA integration (code + manual)
This commit change: 1) replace all keymaps with PLA ones. 2) add an alternative exit button (PLA_EXIT or PLA_CANCEL) 3) do the required change to the manual in order to match code's changes. 4) add a missing key in the manual and show them in a table Change-Id: Ie983c7673c9dec1a9daeb34f5edaaa3c8be7dd5e Reviewed-on: http://gerrit.rockbox.org/129 Reviewed-by: Thomas Martitz <kugel@rockbox.org> Tested-by: Thomas Martitz <kugel@rockbox.org>
Diffstat (limited to 'apps/plugins/mosaique.c')
-rw-r--r--apps/plugins/mosaique.c181
1 files changed, 12 insertions, 169 deletions
diff --git a/apps/plugins/mosaique.c b/apps/plugins/mosaique.c
index 87e664e102..68938a1f13 100644
--- a/apps/plugins/mosaique.c
+++ b/apps/plugins/mosaique.c
@@ -21,7 +21,7 @@
#include "plugin.h"
#include "lib/playergfx.h"
#include "lib/mylcd.h"
-
+#include "lib/pluginlib_actions.h"
#ifdef HAVE_LCD_BITMAP
@@ -41,174 +41,13 @@
#define GFX_HEIGHT 6
#endif
-/* variable button definitions */
-#if CONFIG_KEYPAD == RECORDER_PAD
-#define MOSAIQUE_QUIT BUTTON_OFF
-#define MOSAIQUE_SPEED BUTTON_F1
-#define MOSAIQUE_RESTART BUTTON_PLAY
-
-#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
-#define MOSAIQUE_QUIT BUTTON_OFF
-#define MOSAIQUE_SPEED BUTTON_F1
-#define MOSAIQUE_RESTART BUTTON_SELECT
-
-#elif CONFIG_KEYPAD == PLAYER_PAD
-#define MOSAIQUE_QUIT BUTTON_STOP
-#define MOSAIQUE_SPEED BUTTON_MENU
-#define MOSAIQUE_RESTART BUTTON_PLAY
-
-#elif CONFIG_KEYPAD == ONDIO_PAD
-#define MOSAIQUE_QUIT BUTTON_OFF
-#define MOSAIQUE_SPEED BUTTON_MENU
-#define MOSAIQUE_RESTART BUTTON_RIGHT
-
-#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
- (CONFIG_KEYPAD == IRIVER_H300_PAD)
-#define MOSAIQUE_QUIT BUTTON_OFF
-#define MOSAIQUE_SPEED BUTTON_MODE
-#define MOSAIQUE_RESTART BUTTON_ON
-
-#define MOSAIQUE_RC_QUIT BUTTON_RC_STOP
-
-#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
- (CONFIG_KEYPAD == IPOD_3G_PAD) || \
- (CONFIG_KEYPAD == IPOD_1G2G_PAD)
-#define MOSAIQUE_QUIT BUTTON_MENU
-#define MOSAIQUE_SPEED BUTTON_SELECT
-#define MOSAIQUE_RESTART BUTTON_PLAY
-
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-#define MOSAIQUE_QUIT BUTTON_PLAY
-#define MOSAIQUE_SPEED BUTTON_MODE
-#define MOSAIQUE_RESTART BUTTON_SELECT
-
-#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
-#define MOSAIQUE_QUIT BUTTON_POWER
-#define MOSAIQUE_SPEED BUTTON_SELECT
-#define MOSAIQUE_RESTART BUTTON_PLAY
-
-#elif CONFIG_KEYPAD == GIGABEAT_PAD
-#define MOSAIQUE_QUIT BUTTON_POWER
-#define MOSAIQUE_SPEED BUTTON_A
-#define MOSAIQUE_RESTART BUTTON_SELECT
-
-#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
- (CONFIG_KEYPAD == SANSA_C200_PAD) || \
- (CONFIG_KEYPAD == SANSA_CLIP_PAD) || \
- (CONFIG_KEYPAD == SANSA_M200_PAD)
-#define MOSAIQUE_QUIT BUTTON_POWER
-#define MOSAIQUE_SPEED BUTTON_DOWN
-#define MOSAIQUE_RESTART BUTTON_SELECT
-
-#elif (CONFIG_KEYPAD == SANSA_FUZE_PAD)
-#define MOSAIQUE_QUIT (BUTTON_HOME|BUTTON_REPEAT)
-#define MOSAIQUE_SPEED BUTTON_DOWN
-#define MOSAIQUE_RESTART BUTTON_SELECT
-
-#elif CONFIG_KEYPAD == IRIVER_H10_PAD
-#define MOSAIQUE_QUIT BUTTON_POWER
-#define MOSAIQUE_SPEED BUTTON_FF
-#define MOSAIQUE_RESTART BUTTON_PLAY
-
-#elif CONFIG_KEYPAD == MROBE500_PAD
-#define MOSAIQUE_QUIT BUTTON_POWER
-
-#elif CONFIG_KEYPAD == GIGABEAT_S_PAD || \
- CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
-#define MOSAIQUE_QUIT BUTTON_BACK
-#define MOSAIQUE_SPEED BUTTON_SELECT
-#define MOSAIQUE_RESTART BUTTON_MENU
-
-#elif CONFIG_KEYPAD == MROBE100_PAD
-#define MOSAIQUE_QUIT BUTTON_POWER
-#define MOSAIQUE_SPEED BUTTON_DISPLAY
-#define MOSAIQUE_RESTART BUTTON_SELECT
-
-#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
-#define MOSAIQUE_QUIT BUTTON_RC_REC
-#define MOSAIQUE_SPEED BUTTON_RC_MENU
-#define MOSAIQUE_RESTART BUTTON_RC_PLAY
-
-#elif CONFIG_KEYPAD == COWON_D2_PAD
-#define MOSAIQUE_QUIT BUTTON_POWER
-#define MOSAIQUE_SPEED BUTTON_MINUS
-#define MOSAIQUE_RESTART BUTTON_MENU
-
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define MOSAIQUE_QUIT BUTTON_POWER
-#define MOSAIQUE_SPEED BUTTON_PLAY
-#define MOSAIQUE_RESTART BUTTON_MENU
+/* this set the context to use with PLA */
+static const struct button_mapping *plugin_contexts[] = { pla_main_ctx };
-#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
-#define MOSAIQUE_QUIT BUTTON_BACK
-#define MOSAIQUE_SPEED BUTTON_SELECT
-#define MOSAIQUE_RESTART BUTTON_PLAY
-
-#elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD
-#define MOSAIQUE_QUIT BUTTON_POWER
-#define MOSAIQUE_SPEED BUTTON_VIEW
-#define MOSAIQUE_RESTART BUTTON_MENU
-
-#elif CONFIG_KEYPAD == PHILIPS_HDD6330_PAD
-#define MOSAIQUE_QUIT BUTTON_POWER
-#define MOSAIQUE_SPEED BUTTON_RIGHT
-#define MOSAIQUE_RESTART BUTTON_MENU
-
-#elif CONFIG_KEYPAD == PHILIPS_SA9200_PAD
-#define MOSAIQUE_QUIT BUTTON_POWER
-#define MOSAIQUE_SPEED BUTTON_RIGHT
-#define MOSAIQUE_RESTART BUTTON_MENU
-
-#elif CONFIG_KEYPAD == ONDAVX747_PAD
-#define MOSAIQUE_QUIT BUTTON_POWER
-#elif CONFIG_KEYPAD == ONDAVX777_PAD
-#define MOSAIQUE_QUIT BUTTON_POWER
-
-#elif CONFIG_KEYPAD == SAMSUNG_YH_PAD
-#define MOSAIQUE_QUIT BUTTON_PLAY
-#define MOSAIQUE_SPEED BUTTON_UP
-#define MOSAIQUE_RESTART BUTTON_DOWN
-
-#elif CONFIG_KEYPAD == PBELL_VIBE500_PAD
-#define MOSAIQUE_QUIT BUTTON_REC
-#define MOSAIQUE_SPEED BUTTON_PLAY
-#define MOSAIQUE_RESTART BUTTON_MENU
-
-#elif CONFIG_KEYPAD == MPIO_HD200_PAD
-#define MOSAIQUE_QUIT (BUTTON_REC | BUTTON_PLAY)
-#define MOSAIQUE_SPEED BUTTON_FUNC
-#define MOSAIQUE_RESTART BUTTON_PLAY
-
-#elif CONFIG_KEYPAD == MPIO_HD300_PAD
-#define MOSAIQUE_QUIT (BUTTON_REC | BUTTON_REPEAT)
-#define MOSAIQUE_SPEED BUTTON_ENTER
-#define MOSAIQUE_RESTART BUTTON_PLAY
-
-#elif CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD
-#define MOSAIQUE_QUIT BUTTON_POWER
-#define MOSAIQUE_SPEED BUTTON_PLAYPAUSE
-#define MOSAIQUE_RESTART BUTTON_BACK
-
-#elif CONFIG_KEYPAD == SANSA_CONNECT_PAD
-#define MOSAIQUE_QUIT BUTTON_POWER
-#define MOSAIQUE_SPEED BUTTON_SELECT
-#define MOSAIQUE_RESTART BUTTON_DOWN
-
-#else
-#error No keymap defined!
-#endif
-
-#ifdef HAVE_TOUCHSCREEN
-#ifndef MOSAIQUE_QUIT
-#define MOSAIQUE_QUIT BUTTON_TOPLEFT
-#endif
-#ifndef MOSAIQUE_SPEED
-#define MOSAIQUE_SPEED BUTTON_MIDRIGHT
-#endif
-#ifndef MOSAIQUE_RESTART
-#define MOSAIQUE_RESTART BUTTON_CENTER
-#endif
-#endif
+#define MOSAIQUE_QUIT PLA_EXIT
+#define MOSAIQUE_QUIT2 PLA_CANCEL
+#define MOSAIQUE_SPEED PLA_UP
+#define MOSAIQUE_RESTART PLA_SELECT
enum plugin_status plugin_start(const void* parameter)
{
@@ -266,13 +105,17 @@ enum plugin_status plugin_start(const void* parameter)
rb->sleep(HZ/timer);
- button = rb->button_get(false);
+ /*We get button from PLA this way */
+ button = pluginlib_getaction(TIMEOUT_NOBLOCK, plugin_contexts,
+ ARRAYLEN(plugin_contexts));
+
switch (button)
{
#ifdef MOSAIQUE_RC_QUIT
case MOSAIQUE_RC_QUIT:
#endif
case MOSAIQUE_QUIT:
+ case MOSAIQUE_QUIT2:
mylcd_set_drawmode(DRMODE_SOLID);
#ifdef HAVE_LCD_CHARCELLS
pgfx_release();