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.tar.gz
rockbox-ebe5acfb9dd80bfce2c915a568e2c86244b67510.zip
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 719915709a..a9650e7977 100644
--- a/apps/plugins/lib/fixedpoint.h
+++ b/apps/plugins/lib/fixedpoint.h
@@ -24,3 +24,11 @@ long fsqrt(long a, unsigned int fracbits);
24long cos_int(int val); 24long cos_int(int val);
25long sin_int(int val); 25long sin_int(int val);
26long flog(int x); 26long flog(int x);
27
28/* fast unsigned multiplication (16x16bit->32bit or 32x32bit->32bit,
29 * whichever is faster for the architecture) */
30#ifdef CPU_ARM
31#define FMULU(a, b) ((uint32_t) (((uint32_t) (a)) * ((uint32_t) (b))))
32#else /* SH1, coldfire */
33#define FMULU(a, b) ((uint32_t) (((uint16_t) (a)) * ((uint16_t) (b))))
34#endif
diff --git a/apps/plugins/lib/pluginlib_actions.c b/apps/plugins/lib/pluginlib_actions.c
index e74ffc0315..f358bb59f6 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[] =
335 {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE} 335 {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
336}; 336};
337 337
338const struct button_mapping generic_increase_decrease[] =
339{
340#if (CONFIG_KEYPAD == IRIVER_H100_PAD) \
341 || (CONFIG_KEYPAD == IRIVER_H300_PAD) \
342 || (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \
343 || (CONFIG_KEYPAD == GIGABEAT_PAD) \
344 || (CONFIG_KEYPAD == RECORDER_PAD) \
345 || (CONFIG_KEYPAD == ARCHOS_AV300_PAD) \
346 || (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) \
347 || (CONFIG_KEYPAD == ONDIO_PAD) \
348 || (CONFIG_KEYPAD == COWOND2_PAD)
349 {PLA_INC, BUTTON_UP, BUTTON_NONE},
350 {PLA_DEC, BUTTON_DOWN, BUTTON_NONE},
351 {PLA_INC_REPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE},
352 {PLA_DEC_REPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE},
353#elif (CONFIG_KEYPAD == SANSA_C200_PAD)
354 {PLA_INC, BUTTON_VOL_UP, BUTTON_NONE},
355 {PLA_DEC, BUTTON_VOL_DOWN, BUTTON_NONE},
356 {PLA_INC_REPEAT, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE},
357 {PLA_DEC_REPEAT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
358#elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) \
359 || (CONFIG_KEYPAD == IPOD_3G_PAD) \
360 || (CONFIG_KEYPAD == SANSA_E200_PAD) \
361 || (CONFIG_KEYPAD == IPOD_4G_PAD)
362 {PLA_INC, BUTTON_SCROLL_FWD, BUTTON_NONE},
363 {PLA_DEC, BUTTON_SCROLL_BACK, BUTTON_NONE},
364 {PLA_INC_REPEAT, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE},
365 {PLA_DEC_REPEAT, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE},
366#elif CONFIG_KEYPAD == PLAYER_PAD
367 {PLA_INC, BUTTON_STOP, BUTTON_NONE},
368 {PLA_DEC, BUTTON_PLAY, BUTTON_NONE},
369#elif (CONFIG_KEYPAD == IRIVER_H10_PAD) \
370 || (CONFIG_KEYPAD == MROBE100_PAD)
371 {PLA_INC, BUTTON_SCROLL_UP, BUTTON_NONE},
372 {PLA_DEC, BUTTON_SCROLL_DOWN, BUTTON_NONE},
373 {PLA_INC_REPEAT, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE},
374 {PLA_DEC_REPEAT, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
375#elif (CONFIG_KEYPAD == MROBE500_PAD)
376 {PLA_INC, BUTTON_RC_PLAY, BUTTON_NONE},
377 {PLA_DEC, BUTTON_RC_DOWN, BUTTON_NONE},
378 {PLA_INC_REPEAT, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE},
379 {PLA_DEC_REPEAT, BUTTON_RC_DOWN|BUTTON_REPEAT, BUTTON_NONE},
380#else
381#error pluginlib_actions: Unsupported keypad
382#endif
383 {CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
384};
385
338static struct button_mapping **plugin_context_order; 386static struct button_mapping **plugin_context_order;
339static int plugin_context_count = 0; 387static int plugin_context_count = 0;
340static int last_context = 0; /* index into plugin_context_order 388static 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 b0b9871de8..c11a087904 100644
--- a/apps/plugins/lib/pluginlib_actions.h
+++ b/apps/plugins/lib/pluginlib_actions.h
@@ -35,7 +35,12 @@ enum {
35 PLA_DOWN_REPEAT, 35 PLA_DOWN_REPEAT,
36 PLA_LEFT_REPEAT, 36 PLA_LEFT_REPEAT,
37 PLA_RIGHT_REPEAT, 37 PLA_RIGHT_REPEAT,
38 38
39 PLA_INC,
40 PLA_DEC,
41 PLA_INC_REPEAT,
42 PLA_DEC_REPEAT,
43
39 PLA_QUIT, 44 PLA_QUIT,
40 PLA_START, 45 PLA_START,
41 PLA_MENU, 46 PLA_MENU,
@@ -51,6 +56,7 @@ extern const struct button_mapping remote_directions[];
51extern const struct button_mapping generic_directions[]; 56extern const struct button_mapping generic_directions[];
52extern const struct button_mapping generic_left_right_fire[]; 57extern const struct button_mapping generic_left_right_fire[];
53extern const struct button_mapping generic_actions[]; 58extern const struct button_mapping generic_actions[];
59extern const struct button_mapping generic_increase_decrease[];
54 60
55int pluginlib_getaction(struct plugin_api *api,int timeout, 61int pluginlib_getaction(struct plugin_api *api,int timeout,
56 const struct button_mapping *plugin_contexts[], 62 const struct button_mapping *plugin_contexts[],