summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-09-20 17:42:28 +0000
committerJens Arnold <amiconn@rockbox.org>2007-09-20 17:42:28 +0000
commita8af83e8f9b3c0698c0bc0a74fa7cd95d90e7c39 (patch)
treeee68c1199e20ec4544435f5836dfd9dc38036d78
parentf138fe28dcc650415d08aba3399c2a544ba22e0a (diff)
Code police raid: header files must not define actual code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14789 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/lib/pluginlib_actions.c267
-rw-r--r--apps/plugins/lib/pluginlib_actions.h268
2 files changed, 271 insertions, 264 deletions
diff --git a/apps/plugins/lib/pluginlib_actions.c b/apps/plugins/lib/pluginlib_actions.c
index 312eb61ea6..6957ae5e0f 100644
--- a/apps/plugins/lib/pluginlib_actions.c
+++ b/apps/plugins/lib/pluginlib_actions.c
@@ -22,6 +22,273 @@
#include "action.h"
#include "pluginlib_actions.h"
+#if defined(HAVE_REMOTE_LCD)
+const struct button_mapping remote_directions[] =
+{
+#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
+ (CONFIG_KEYPAD == IRIVER_H300_PAD)
+ { PLA_UP, BUTTON_RC_BITRATE, BUTTON_NONE},
+ { PLA_DOWN, BUTTON_RC_SOURCE, BUTTON_NONE},
+ { PLA_LEFT, BUTTON_RC_VOL_DOWN, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RC_VOL_UP, BUTTON_NONE},
+ { PLA_UP_REPEAT, BUTTON_RC_BITRATE|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_DOWN_REPEAT, BUTTON_RC_SOURCE|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE},
+#elif (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) || \
+ (CONFIG_KEYPAD == IRIVER_H10_PAD) || \
+ (CONFIG_KEYPAD == GIGABEAT_PAD)
+ { PLA_UP, BUTTON_RC_FF, BUTTON_NONE},
+ { PLA_DOWN, BUTTON_RC_REW, BUTTON_NONE},
+ { PLA_LEFT, BUTTON_RC_VOL_DOWN, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RC_VOL_UP, BUTTON_NONE},
+ { PLA_UP_REPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_DOWN_REPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE},
+#elif (CONFIG_KEYPAD == PLAYER_PAD) || \
+ (CONFIG_KEYPAD == RECORDER_PAD)
+ { PLA_UP, BUTTON_RC_VOL_UP, BUTTON_NONE},
+ { PLA_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE},
+ { PLA_LEFT, BUTTON_RC_LEFT, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RC_RIGHT, BUTTON_NONE},
+ { PLA_UP_REPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_DOWN_REPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_RC_LEFT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RC_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+#else
+ #error pluginlib_actions: Unsupported remote keypad
+#endif
+ {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
+};
+#endif /* HAVE_REMOTE_LCD */
+
+const struct button_mapping generic_directions[] =
+{
+#if (CONFIG_KEYPAD == IRIVER_H100_PAD) \
+ || (CONFIG_KEYPAD == IRIVER_H300_PAD) \
+ || (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \
+ || (CONFIG_KEYPAD == GIGABEAT_PAD) \
+ || (CONFIG_KEYPAD == RECORDER_PAD) \
+ || (CONFIG_KEYPAD == ARCHOS_AV300_PAD) \
+ || (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) \
+ || (CONFIG_KEYPAD == SANSA_C200_PAD)
+ { PLA_UP, BUTTON_UP, BUTTON_NONE},
+ { PLA_DOWN, BUTTON_DOWN, BUTTON_NONE},
+ { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
+ { PLA_UP_REPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_DOWN_REPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+#elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) \
+ || (CONFIG_KEYPAD == IPOD_3G_PAD) \
+ || (CONFIG_KEYPAD == IPOD_4G_PAD)
+ { PLA_UP, BUTTON_SCROLL_FWD, BUTTON_NONE},
+ { PLA_DOWN, BUTTON_SCROLL_BACK, BUTTON_NONE},
+ { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
+ { PLA_UP_REPEAT, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_DOWN_REPEAT, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == ONDIO_PAD
+ { PLA_UP, BUTTON_UP, BUTTON_NONE},
+ { PLA_DOWN, BUTTON_DOWN, BUTTON_NONE},
+ { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
+ { PLA_UP_REPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_DOWN_REPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == PLAYER_PAD
+ {PLA_UP, BUTTON_STOP, BUTTON_NONE},
+ {PLA_DOWN, BUTTON_PLAY, BUTTON_NONE},
+ {PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
+ {PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
+ {PLA_UP_REPEAT, BUTTON_STOP|BUTTON_REPEAT, BUTTON_NONE},
+ {PLA_DOWN_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE},
+ {PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
+ {PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD) \
+ || (CONFIG_KEYPAD == IRIVER_H10_PAD)
+ { PLA_UP, BUTTON_SCROLL_UP, BUTTON_NONE},
+ { PLA_DOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE},
+ { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
+ { PLA_UP_REPEAT, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_DOWN_REPEAT, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+
+#else
+ #error pluginlib_actions: Unsupported keypad
+#endif
+ {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
+};
+
+const struct button_mapping generic_left_right_fire[] =
+{
+#if (CONFIG_KEYPAD == IRIVER_H100_PAD) \
+ || (CONFIG_KEYPAD == IRIVER_H300_PAD) \
+ || (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \
+ || (CONFIG_KEYPAD == GIGABEAT_PAD) \
+ || (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD)
+ { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
+ { PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_NONE},
+#elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) \
+ || (CONFIG_KEYPAD == IPOD_3G_PAD) \
+ || (CONFIG_KEYPAD == IPOD_4G_PAD)
+ { PLA_LEFT, BUTTON_SCROLL_BACK, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_SCROLL_FWD, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
+ { PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_NONE},
+#elif CONFIG_KEYPAD == ONDIO_PAD
+ { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_FIRE, BUTTON_UP, BUTTON_NONE},
+ { PLA_FIRE_REPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == PLAYER_PAD
+ { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_FIRE, BUTTON_ON, BUTTON_NONE},
+ { PLA_FIRE_REPEAT, BUTTON_ON|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == RECORDER_PAD
+ { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_FIRE, BUTTON_PLAY, BUTTON_NONE},
+ { PLA_FIRE_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE},
+#elif (CONFIG_KEYPAD == SANSA_C200_PAD) \
+ || (CONFIG_KEYPAD == ARCHOS_AV300_PAD)
+ { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
+ { PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_NONE},
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+ { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
+ { PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_NONE},
+#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
+ { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_FIRE, BUTTON_REW, BUTTON_NONE},
+ { PLA_FIRE_REPEAT, BUTTON_REW|BUTTON_REPEAT, BUTTON_NONE},
+#else
+ #error pluginlib_actions: Unsupported keypad
+#endif
+ {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
+};
+
+/* these were taken from the bubbles plugin, so may need tweaking */
+const struct button_mapping generic_actions[] =
+{
+#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
+ {PLA_QUIT, BUTTON_OFF, BUTTON_NONE},
+ {PLA_QUIT, BUTTON_RC_STOP, BUTTON_NONE},
+ {PLA_START, BUTTON_ON, BUTTON_NONE},
+ {PLA_START, BUTTON_RC_ON, BUTTON_NONE},
+ {PLA_MENU, BUTTON_MODE, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_RC_MENU, BUTTON_NONE},
+ {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
+ {PLA_FIRE_REPEAT, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_NONE},
+#elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) \
+ || (CONFIG_KEYPAD == IPOD_3G_PAD) \
+ || (CONFIG_KEYPAD == IPOD_4G_PAD)
+ {PLA_QUIT, BUTTON_MENU|BUTTON_SELECT, BUTTON_NONE},
+ {PLA_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY},
+ {PLA_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT},
+ {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
+ {PLA_QUIT, BUTTON_POWER, BUTTON_NONE},
+ {PLA_START, BUTTON_PLAY, BUTTON_NONE},
+ {PLA_START, BUTTON_RC_PLAY, BUTTON_NONE},
+ {PLA_MENU, BUTTON_REC, BUTTON_NONE},
+ {PLA_MENU, BUTTON_RC_MENU, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_RC_MODE, BUTTON_NONE},
+ {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
+ {PLA_FIRE_REPEAT, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+ {PLA_QUIT, BUTTON_A, BUTTON_NONE},
+ {PLA_START, BUTTON_POWER, BUTTON_NONE},
+ {PLA_MENU, BUTTON_MENU, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
+ {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == RECORDER_PAD
+ {PLA_QUIT, BUTTON_OFF, BUTTON_NONE},
+ {PLA_START, BUTTON_ON, BUTTON_NONE},
+ {PLA_MENU, BUTTON_F1, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_PLAY, BUTTON_NONE},
+ {PLA_FIRE_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+ {PLA_QUIT, BUTTON_OFF, BUTTON_NONE},
+ {PLA_START, BUTTON_ON, BUTTON_NONE},
+ {PLA_MENU, BUTTON_F1, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
+ {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == ONDIO_PAD
+ {PLA_QUIT, BUTTON_OFF, BUTTON_NONE},
+ {PLA_START, BUTTON_MENU, BUTTON_NONE},
+ {PLA_MENU, BUTTON_DOWN, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_UP, BUTTON_NONE},
+ {PLA_FIRE_REPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == PLAYER_PAD
+ {PLA_QUIT, BUTTON_STOP|BUTTON_REPEAT, BUTTON_NONE},
+ {PLA_START, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE},
+ {PLA_MENU, BUTTON_MENU, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_ON, BUTTON_NONE},
+ {PLA_FIRE_REPEAT, BUTTON_ON|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+ {PLA_QUIT, BUTTON_POWER, BUTTON_NONE},
+ {PLA_START, BUTTON_UP, BUTTON_NONE},
+ {PLA_MENU, BUTTON_DOWN, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
+ {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == SANSA_C200_PAD
+ {PLA_QUIT, BUTTON_POWER, BUTTON_NONE},
+ {PLA_START, BUTTON_UP, BUTTON_NONE},
+ {PLA_MENU, BUTTON_DOWN, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
+ {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == IRIVER_H10_PAD
+ {PLA_QUIT, BUTTON_POWER, BUTTON_NONE},
+ {PLA_START, BUTTON_PLAY, BUTTON_NONE},
+ {PLA_MENU, BUTTON_FF, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_REW, BUTTON_NONE},
+ {PLA_FIRE_REPEAT, BUTTON_REW|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
+ {PLA_QUIT, BUTTON_EQ, BUTTON_NONE},
+ {PLA_START, BUTTON_PLAY, BUTTON_NONE},
+ {PLA_MENU, BUTTON_MODE, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
+ {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
+#else
+ #error pluginlib_actions: Unsupported keypad
+#endif
+ {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
+};
+
static struct button_mapping **plugin_context_order;
static int plugin_context_count = 0;
static int last_context = 0; /* index into plugin_context_order
diff --git a/apps/plugins/lib/pluginlib_actions.h b/apps/plugins/lib/pluginlib_actions.h
index 7b2b0a42e2..b0b9871de8 100644
--- a/apps/plugins/lib/pluginlib_actions.h
+++ b/apps/plugins/lib/pluginlib_actions.h
@@ -46,271 +46,11 @@ enum {
};
#if defined(HAVE_REMOTE_LCD)
-static const struct button_mapping remote_directions[] =
-{
-#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
- (CONFIG_KEYPAD == IRIVER_H300_PAD)
- { PLA_UP, BUTTON_RC_BITRATE, BUTTON_NONE},
- { PLA_DOWN, BUTTON_RC_SOURCE, BUTTON_NONE},
- { PLA_LEFT, BUTTON_RC_VOL_DOWN, BUTTON_NONE},
- { PLA_RIGHT, BUTTON_RC_VOL_UP, BUTTON_NONE},
- { PLA_UP_REPEAT, BUTTON_RC_BITRATE|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_DOWN_REPEAT, BUTTON_RC_SOURCE|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_LEFT_REPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_RIGHT_REPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE},
-#elif (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) || \
- (CONFIG_KEYPAD == IRIVER_H10_PAD) || \
- (CONFIG_KEYPAD == GIGABEAT_PAD)
- { PLA_UP, BUTTON_RC_FF, BUTTON_NONE},
- { PLA_DOWN, BUTTON_RC_REW, BUTTON_NONE},
- { PLA_LEFT, BUTTON_RC_VOL_DOWN, BUTTON_NONE},
- { PLA_RIGHT, BUTTON_RC_VOL_UP, BUTTON_NONE},
- { PLA_UP_REPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_DOWN_REPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_LEFT_REPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_RIGHT_REPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE},
-#elif (CONFIG_KEYPAD == PLAYER_PAD) || \
- (CONFIG_KEYPAD == RECORDER_PAD)
- { PLA_UP, BUTTON_RC_VOL_UP, BUTTON_NONE},
- { PLA_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE},
- { PLA_LEFT, BUTTON_RC_LEFT, BUTTON_NONE},
- { PLA_RIGHT, BUTTON_RC_RIGHT, BUTTON_NONE},
- { PLA_UP_REPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_DOWN_REPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_LEFT_REPEAT, BUTTON_RC_LEFT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_RIGHT_REPEAT, BUTTON_RC_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
-#else
- #error pluginlib_actions: Unsupported remote keypad
+extern const struct button_mapping remote_directions[];
#endif
- {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
-};
-#endif /* HAVE_REMOTE_LCD */
-
-static const struct button_mapping generic_directions[] =
-{
-#if (CONFIG_KEYPAD == IRIVER_H100_PAD) \
- || (CONFIG_KEYPAD == IRIVER_H300_PAD) \
- || (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \
- || (CONFIG_KEYPAD == GIGABEAT_PAD) \
- || (CONFIG_KEYPAD == RECORDER_PAD) \
- || (CONFIG_KEYPAD == ARCHOS_AV300_PAD) \
- || (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) \
- || (CONFIG_KEYPAD == SANSA_C200_PAD)
- { PLA_UP, BUTTON_UP, BUTTON_NONE},
- { PLA_DOWN, BUTTON_DOWN, BUTTON_NONE},
- { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
- { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
- { PLA_UP_REPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_DOWN_REPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
-#elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) \
- || (CONFIG_KEYPAD == IPOD_3G_PAD) \
- || (CONFIG_KEYPAD == IPOD_4G_PAD)
- { PLA_UP, BUTTON_SCROLL_FWD, BUTTON_NONE},
- { PLA_DOWN, BUTTON_SCROLL_BACK, BUTTON_NONE},
- { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
- { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
- { PLA_UP_REPEAT, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_DOWN_REPEAT, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
-#elif CONFIG_KEYPAD == ONDIO_PAD
- { PLA_UP, BUTTON_UP, BUTTON_NONE},
- { PLA_DOWN, BUTTON_DOWN, BUTTON_NONE},
- { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
- { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
- { PLA_UP_REPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_DOWN_REPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
-#elif CONFIG_KEYPAD == PLAYER_PAD
- {PLA_UP, BUTTON_STOP, BUTTON_NONE},
- {PLA_DOWN, BUTTON_PLAY, BUTTON_NONE},
- {PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
- {PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
- {PLA_UP_REPEAT, BUTTON_STOP|BUTTON_REPEAT, BUTTON_NONE},
- {PLA_DOWN_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE},
- {PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
- {PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
-#elif (CONFIG_KEYPAD == SANSA_E200_PAD) \
- || (CONFIG_KEYPAD == IRIVER_H10_PAD)
- { PLA_UP, BUTTON_SCROLL_UP, BUTTON_NONE},
- { PLA_DOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE},
- { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
- { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
- { PLA_UP_REPEAT, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_DOWN_REPEAT, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
-
-#else
- #error pluginlib_actions: Unsupported keypad
-#endif
- {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
-};
-
-static const struct button_mapping generic_left_right_fire[] =
-{
-#if (CONFIG_KEYPAD == IRIVER_H100_PAD) \
- || (CONFIG_KEYPAD == IRIVER_H300_PAD) \
- || (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \
- || (CONFIG_KEYPAD == GIGABEAT_PAD) \
- || (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD)
- { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
- { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
- { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
- { PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_NONE},
-#elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) \
- || (CONFIG_KEYPAD == IPOD_3G_PAD) \
- || (CONFIG_KEYPAD == IPOD_4G_PAD)
- { PLA_LEFT, BUTTON_SCROLL_BACK, BUTTON_NONE},
- { PLA_RIGHT, BUTTON_SCROLL_FWD, BUTTON_NONE},
- { PLA_LEFT_REPEAT, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_RIGHT_REPEAT, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
- { PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_NONE},
-#elif CONFIG_KEYPAD == ONDIO_PAD
- { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
- { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
- { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_FIRE, BUTTON_UP, BUTTON_NONE},
- { PLA_FIRE_REPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE},
-#elif CONFIG_KEYPAD == PLAYER_PAD
- { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
- { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
- { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_FIRE, BUTTON_ON, BUTTON_NONE},
- { PLA_FIRE_REPEAT, BUTTON_ON|BUTTON_REPEAT, BUTTON_NONE},
-#elif CONFIG_KEYPAD == RECORDER_PAD
- { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
- { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
- { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_FIRE, BUTTON_PLAY, BUTTON_NONE},
- { PLA_FIRE_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE},
-#elif (CONFIG_KEYPAD == SANSA_C200_PAD) \
- || (CONFIG_KEYPAD == ARCHOS_AV300_PAD)
- { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
- { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
- { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
- { PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_NONE},
-#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
- { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
- { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
- { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
- { PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_NONE},
-#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
- { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
- { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
- { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
- { PLA_FIRE, BUTTON_REW, BUTTON_NONE},
- { PLA_FIRE_REPEAT, BUTTON_REW|BUTTON_REPEAT, BUTTON_NONE},
-#else
- #error pluginlib_actions: Unsupported keypad
-#endif
- {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
-};
-
-/* these were taken from the bubbles plugin, so may need tweaking */
-static const struct button_mapping generic_actions[] =
-{
-#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
- {PLA_QUIT, BUTTON_OFF, BUTTON_NONE},
- {PLA_QUIT, BUTTON_RC_STOP, BUTTON_NONE},
- {PLA_START, BUTTON_ON, BUTTON_NONE},
- {PLA_START, BUTTON_RC_ON, BUTTON_NONE},
- {PLA_MENU, BUTTON_MODE, BUTTON_NONE},
- {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
- {PLA_FIRE, BUTTON_RC_MENU, BUTTON_NONE},
- {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
- {PLA_FIRE_REPEAT, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_NONE},
-#elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) \
- || (CONFIG_KEYPAD == IPOD_3G_PAD) \
- || (CONFIG_KEYPAD == IPOD_4G_PAD)
- {PLA_QUIT, BUTTON_MENU|BUTTON_SELECT, BUTTON_NONE},
- {PLA_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY},
- {PLA_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_NONE},
- {PLA_FIRE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT},
- {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
-#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
- {PLA_QUIT, BUTTON_POWER, BUTTON_NONE},
- {PLA_START, BUTTON_PLAY, BUTTON_NONE},
- {PLA_START, BUTTON_RC_PLAY, BUTTON_NONE},
- {PLA_MENU, BUTTON_REC, BUTTON_NONE},
- {PLA_MENU, BUTTON_RC_MENU, BUTTON_NONE},
- {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
- {PLA_FIRE, BUTTON_RC_MODE, BUTTON_NONE},
- {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
- {PLA_FIRE_REPEAT, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_NONE},
-#elif CONFIG_KEYPAD == GIGABEAT_PAD
- {PLA_QUIT, BUTTON_A, BUTTON_NONE},
- {PLA_START, BUTTON_POWER, BUTTON_NONE},
- {PLA_MENU, BUTTON_MENU, BUTTON_NONE},
- {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
- {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
-#elif CONFIG_KEYPAD == RECORDER_PAD
- {PLA_QUIT, BUTTON_OFF, BUTTON_NONE},
- {PLA_START, BUTTON_ON, BUTTON_NONE},
- {PLA_MENU, BUTTON_F1, BUTTON_NONE},
- {PLA_FIRE, BUTTON_PLAY, BUTTON_NONE},
- {PLA_FIRE_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE},
-#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
- {PLA_QUIT, BUTTON_OFF, BUTTON_NONE},
- {PLA_START, BUTTON_ON, BUTTON_NONE},
- {PLA_MENU, BUTTON_F1, BUTTON_NONE},
- {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
- {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
-#elif CONFIG_KEYPAD == ONDIO_PAD
- {PLA_QUIT, BUTTON_OFF, BUTTON_NONE},
- {PLA_START, BUTTON_MENU, BUTTON_NONE},
- {PLA_MENU, BUTTON_DOWN, BUTTON_NONE},
- {PLA_FIRE, BUTTON_UP, BUTTON_NONE},
- {PLA_FIRE_REPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE},
-#elif CONFIG_KEYPAD == PLAYER_PAD
- {PLA_QUIT, BUTTON_STOP|BUTTON_REPEAT, BUTTON_NONE},
- {PLA_START, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE},
- {PLA_MENU, BUTTON_MENU, BUTTON_NONE},
- {PLA_FIRE, BUTTON_ON, BUTTON_NONE},
- {PLA_FIRE_REPEAT, BUTTON_ON|BUTTON_REPEAT, BUTTON_NONE},
-#elif CONFIG_KEYPAD == SANSA_E200_PAD
- {PLA_QUIT, BUTTON_POWER, BUTTON_NONE},
- {PLA_START, BUTTON_UP, BUTTON_NONE},
- {PLA_MENU, BUTTON_DOWN, BUTTON_NONE},
- {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
- {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
-#elif CONFIG_KEYPAD == SANSA_C200_PAD
- {PLA_QUIT, BUTTON_POWER, BUTTON_NONE},
- {PLA_START, BUTTON_UP, BUTTON_NONE},
- {PLA_MENU, BUTTON_DOWN, BUTTON_NONE},
- {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
- {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
-#elif CONFIG_KEYPAD == IRIVER_H10_PAD
- {PLA_QUIT, BUTTON_POWER, BUTTON_NONE},
- {PLA_START, BUTTON_PLAY, BUTTON_NONE},
- {PLA_MENU, BUTTON_FF, BUTTON_NONE},
- {PLA_FIRE, BUTTON_REW, BUTTON_NONE},
- {PLA_FIRE_REPEAT, BUTTON_REW|BUTTON_REPEAT, BUTTON_NONE},
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
- {PLA_QUIT, BUTTON_EQ, BUTTON_NONE},
- {PLA_START, BUTTON_PLAY, BUTTON_NONE},
- {PLA_MENU, BUTTON_MODE, BUTTON_NONE},
- {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
- {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
-#else
- #error pluginlib_actions: Unsupported keypad
-#endif
- {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
-};
+extern const struct button_mapping generic_directions[];
+extern const struct button_mapping generic_left_right_fire[];
+extern const struct button_mapping generic_actions[];
int pluginlib_getaction(struct plugin_api *api,int timeout,
const struct button_mapping *plugin_contexts[],