summaryrefslogtreecommitdiff
path: root/apps/plugins/lib
diff options
context:
space:
mode:
authorKevin Ferrare <kevin@rockbox.org>2008-01-23 08:25:04 +0000
committerKevin Ferrare <kevin@rockbox.org>2008-01-23 08:25:04 +0000
commitebe5acfb9dd80bfce2c915a568e2c86244b67510 (patch)
treec7c6894575e6c5b3d318556cc439d5aa8783061a /apps/plugins/lib
parent8a91c19f7003a34a650b6baf52b23cbdaf767919 (diff)
downloadrockbox-ebe5acfb9dd80bfce2c915a568e2c86244b67510.zip
rockbox-ebe5acfb9dd80bfce2c915a568e2c86244b67510.tar.gz
rockbox-ebe5acfb9dd80bfce2c915a568e2c86244b67510.tar.bz2
rockbox-ebe5acfb9dd80bfce2c915a568e2c86244b67510.tar.xz
Fixed the problems on the new version of the fire plugin (so repush it), added new actions to the pluginlib_actions to fix the keymaps on the Sansa e200 for the clock and fire plugins. Also slightly simplified the metronome plugin's key mapping with those new actions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16148 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib')
-rw-r--r--apps/plugins/lib/fixedpoint.h8
-rw-r--r--apps/plugins/lib/pluginlib_actions.c48
-rw-r--r--apps/plugins/lib/pluginlib_actions.h8
3 files changed, 63 insertions, 1 deletions
diff --git a/apps/plugins/lib/fixedpoint.h b/apps/plugins/lib/fixedpoint.h
index 7199157..a9650e7 100644
--- a/apps/plugins/lib/fixedpoint.h
+++ b/apps/plugins/lib/fixedpoint.h
@@ -24,3 +24,11 @@ long fsqrt(long a, unsigned int fracbits);
long cos_int(int val);
long sin_int(int val);
long flog(int x);
+
+/* fast unsigned multiplication (16x16bit->32bit or 32x32bit->32bit,
+ * whichever is faster for the architecture) */
+#ifdef CPU_ARM
+#define FMULU(a, b) ((uint32_t) (((uint32_t) (a)) * ((uint32_t) (b))))
+#else /* SH1, coldfire */
+#define FMULU(a, b) ((uint32_t) (((uint16_t) (a)) * ((uint16_t) (b))))
+#endif
diff --git a/apps/plugins/lib/pluginlib_actions.c b/apps/plugins/lib/pluginlib_actions.c
index e74ffc0..f358bb5 100644
--- a/apps/plugins/lib/pluginlib_actions.c
+++ b/apps/plugins/lib/pluginlib_actions.c
@@ -335,6 +335,54 @@ const struct button_mapping generic_actions[] =
{CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
};
+const struct button_mapping generic_increase_decrease[] =
+{
+#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 == ONDIO_PAD) \
+ || (CONFIG_KEYPAD == COWOND2_PAD)
+ {PLA_INC, BUTTON_UP, BUTTON_NONE},
+ {PLA_DEC, BUTTON_DOWN, BUTTON_NONE},
+ {PLA_INC_REPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE},
+ {PLA_DEC_REPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE},
+#elif (CONFIG_KEYPAD == SANSA_C200_PAD)
+ {PLA_INC, BUTTON_VOL_UP, BUTTON_NONE},
+ {PLA_DEC, BUTTON_VOL_DOWN, BUTTON_NONE},
+ {PLA_INC_REPEAT, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE},
+ {PLA_DEC_REPEAT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
+#elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) \
+ || (CONFIG_KEYPAD == IPOD_3G_PAD) \
+ || (CONFIG_KEYPAD == SANSA_E200_PAD) \
+ || (CONFIG_KEYPAD == IPOD_4G_PAD)
+ {PLA_INC, BUTTON_SCROLL_FWD, BUTTON_NONE},
+ {PLA_DEC, BUTTON_SCROLL_BACK, BUTTON_NONE},
+ {PLA_INC_REPEAT, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE},
+ {PLA_DEC_REPEAT, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == PLAYER_PAD
+ {PLA_INC, BUTTON_STOP, BUTTON_NONE},
+ {PLA_DEC, BUTTON_PLAY, BUTTON_NONE},
+#elif (CONFIG_KEYPAD == IRIVER_H10_PAD) \
+ || (CONFIG_KEYPAD == MROBE100_PAD)
+ {PLA_INC, BUTTON_SCROLL_UP, BUTTON_NONE},
+ {PLA_DEC, BUTTON_SCROLL_DOWN, BUTTON_NONE},
+ {PLA_INC_REPEAT, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE},
+ {PLA_DEC_REPEAT, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
+#elif (CONFIG_KEYPAD == MROBE500_PAD)
+ {PLA_INC, BUTTON_RC_PLAY, BUTTON_NONE},
+ {PLA_DEC, BUTTON_RC_DOWN, BUTTON_NONE},
+ {PLA_INC_REPEAT, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE},
+ {PLA_DEC_REPEAT, BUTTON_RC_DOWN|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 b0b9871..c11a087 100644
--- a/apps/plugins/lib/pluginlib_actions.h
+++ b/apps/plugins/lib/pluginlib_actions.h
@@ -35,7 +35,12 @@ enum {
PLA_DOWN_REPEAT,
PLA_LEFT_REPEAT,
PLA_RIGHT_REPEAT,
-
+
+ PLA_INC,
+ PLA_DEC,
+ PLA_INC_REPEAT,
+ PLA_DEC_REPEAT,
+
PLA_QUIT,
PLA_START,
PLA_MENU,
@@ -51,6 +56,7 @@ extern const struct button_mapping remote_directions[];
extern const struct button_mapping generic_directions[];
extern const struct button_mapping generic_left_right_fire[];
extern const struct button_mapping generic_actions[];
+extern const struct button_mapping generic_increase_decrease[];
int pluginlib_getaction(struct plugin_api *api,int timeout,
const struct button_mapping *plugin_contexts[],