summaryrefslogtreecommitdiff
path: root/apps/plugins/fft/fft.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/fft/fft.c')
-rw-r--r--apps/plugins/fft/fft.c36
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 */
42static const struct button_mapping *plugin_contexts[] = { pla_main_ctx }; 42static 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;