diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2022-12-18 21:13:15 +0100 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2022-12-29 04:39:22 +0100 |
commit | faa2cb99429214de745bbc3e64e48a7432db51ae (patch) | |
tree | de2967e0e8237cb86422cd82488e110b97ff831e /apps/plugins/fft/fft.c | |
parent | 52f59f637dfcb24900b30ed52c1d7725eab93364 (diff) | |
download | rockbox-faa2cb99429214de745bbc3e64e48a7432db51ae.tar.gz rockbox-faa2cb99429214de745bbc3e64e48a7432db51ae.zip |
plugins: Improve usability of iPod keymaps
- Reduce need to press multiple buttons at
the same time to quit a plugin
- Have "Menu" be default way to quit plugins or
to access plugin menu
- Fall back to (Long) "Select" or Long "Menu"
in cases where Menu button isn't available
(e.g. in ImageViewer and many games)
out of scope:
boomshine, lua_scripts, Rockpaint,
Doom, Duke3D, Pacbox, Quake,
Sgt-Puzzles, Wolf3D, XWorld,
Minesweeper, Pixel Painter, Spacerocks
Change-Id: I6d4dc7174695fe4b8ee9cbaccb21bdbfe6af5c48
Diffstat (limited to 'apps/plugins/fft/fft.c')
-rw-r--r-- | apps/plugins/fft/fft.c | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/apps/plugins/fft/fft.c b/apps/plugins/fft/fft.c index f612a0ea35..4d36302ddf 100644 --- a/apps/plugins/fft/fft.c +++ b/apps/plugins/fft/fft.c | |||
@@ -40,13 +40,22 @@ GREY_INFO_STRUCT | |||
40 | 40 | ||
41 | /* this set the context to use with PLA */ | 41 | /* this set the context to use with PLA */ |
42 | static const struct button_mapping *plugin_contexts[] = { pla_main_ctx }; | 42 | static const struct button_mapping *plugin_contexts[] = { pla_main_ctx }; |
43 | #define FFT_PREV_GRAPH PLA_LEFT | 43 | #define FFT_PREV_GRAPH PLA_LEFT |
44 | #define FFT_NEXT_GRAPH PLA_RIGHT | 44 | #define FFT_NEXT_GRAPH PLA_RIGHT |
45 | #define FFT_ORIENTATION PLA_CANCEL | 45 | #define FFT_ORIENTATION PLA_CANCEL |
46 | #define FFT_WINDOW PLA_SELECT | 46 | #define FFT_WINDOW PLA_SELECT_REL |
47 | #define FFT_AMP_SCALE PLA_UP | 47 | #define FFT_AMP_SCALE PLA_SELECT_REPEAT |
48 | #define FFT_FREQ_SCALE PLA_DOWN | 48 | #define FFT_AMP_SCALE_PRE PLA_SELECT |
49 | #define FFT_QUIT PLA_EXIT | 49 | #define FFT_FREQ_SCALE PLA_DOWN |
50 | |||
51 | |||
52 | #if (CONFIG_KEYPAD == IPOD_1G2G_PAD) \ | ||
53 | || (CONFIG_KEYPAD == IPOD_3G_PAD) \ | ||
54 | || (CONFIG_KEYPAD == IPOD_4G_PAD) | ||
55 | #define FFT_QUIT PLA_UP | ||
56 | #else | ||
57 | #define FFT_QUIT PLA_EXIT | ||
58 | #endif | ||
50 | 59 | ||
51 | #ifdef HAVE_LCD_COLOR | 60 | #ifdef HAVE_LCD_COLOR |
52 | #include "pluginbitmaps/fft_colors.h" | 61 | #include "pluginbitmaps/fft_colors.h" |
@@ -1257,6 +1266,10 @@ enum plugin_status plugin_start(const void* parameter) | |||
1257 | if(!fft_setup()) | 1266 | if(!fft_setup()) |
1258 | return PLUGIN_ERROR; | 1267 | return PLUGIN_ERROR; |
1259 | 1268 | ||
1269 | #if defined(FFT_AMP_SCALE_PRE) | ||
1270 | int lastbutton = BUTTON_NONE; | ||
1271 | #endif | ||
1272 | |||
1260 | while(run) | 1273 | while(run) |
1261 | { | 1274 | { |
1262 | long delay = fft_draw(); | 1275 | long delay = fft_draw(); |
@@ -1300,6 +1313,10 @@ enum plugin_status plugin_start(const void* parameter) | |||
1300 | break; | 1313 | break; |
1301 | 1314 | ||
1302 | case FFT_AMP_SCALE: | 1315 | case FFT_AMP_SCALE: |
1316 | #ifdef FFT_AMP_SCALE_PRE | ||
1317 | if (lastbutton != FFT_AMP_SCALE_PRE) | ||
1318 | break; | ||
1319 | #endif | ||
1303 | if (++fft.amp_scale >= FFT_MAX_AS) | 1320 | if (++fft.amp_scale >= FFT_MAX_AS) |
1304 | fft.amp_scale = FFT_MIN_AS; | 1321 | fft.amp_scale = FFT_MIN_AS; |
1305 | 1322 | ||
@@ -1328,6 +1345,11 @@ enum plugin_status plugin_start(const void* parameter) | |||
1328 | exit_on_usb(button); | 1345 | exit_on_usb(button); |
1329 | break; | 1346 | break; |
1330 | } | 1347 | } |
1348 | |||
1349 | #if defined(FFT_AMP_SCALE_PRE) | ||
1350 | if (button != BUTTON_NONE) | ||
1351 | lastbutton = button; | ||
1352 | #endif | ||
1331 | } | 1353 | } |
1332 | 1354 | ||
1333 | return PLUGIN_OK; | 1355 | return PLUGIN_OK; |