diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-09-27 09:31:31 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-09-27 09:31:31 +0000 |
commit | bb572c44121e48d9d54411dff9e0f8dce015e550 (patch) | |
tree | a91d8c8e9e5675c9b5039ddc8108f81f55fc4f49 /apps/settings_menu.c | |
parent | acfacd938cfa878aeb69410532b2de58698f703a (diff) | |
download | rockbox-bb572c44121e48d9d54411dff9e0f8dce015e550.tar.gz rockbox-bb572c44121e48d9d54411dff9e0f8dce015e550.zip |
Philip Pertermanns peak meter
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2436 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings_menu.c')
-rw-r--r-- | apps/settings_menu.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 8aba4bc2f2..643f5be542 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include "powermgmt.h" | 36 | #include "powermgmt.h" |
37 | #include "rtc.h" | 37 | #include "rtc.h" |
38 | #include "ata.h" | 38 | #include "ata.h" |
39 | #include "peakmeter.h" | ||
39 | #include "lang.h" | 40 | #include "lang.h" |
40 | 41 | ||
41 | static bool contrast(void) | 42 | static bool contrast(void) |
@@ -44,6 +45,68 @@ static bool contrast(void) | |||
44 | lcd_set_contrast, 1, 0, MAX_CONTRAST_SETTING ); | 45 | lcd_set_contrast, 1, 0, MAX_CONTRAST_SETTING ); |
45 | } | 46 | } |
46 | 47 | ||
48 | #ifdef HAVE_LCD_BITMAP | ||
49 | /** | ||
50 | * Menu to set the hold time of normal peaks. | ||
51 | */ | ||
52 | static bool peak_meter_hold(void) { | ||
53 | char* names[] = { str(LANG_OFF), | ||
54 | "200 ms ", "300 ms ", "500 ms ", "1 s ", "2 s ", | ||
55 | "3 s ", "4 s ", "5 s ", "6 s ", "7 s", | ||
56 | "8 s", "9 s", "10 s", "15 s", "20 s", | ||
57 | "30 s", "1 min" | ||
58 | }; | ||
59 | return set_option( str(LANG_PM_PEAK_HOLD), | ||
60 | &global_settings.peak_meter_hold, names, | ||
61 | 18, NULL); | ||
62 | } | ||
63 | |||
64 | /** | ||
65 | * Menu to set the hold time of clips. | ||
66 | */ | ||
67 | static bool peak_meter_clip_hold(void) { | ||
68 | char* names[] = { str(LANG_PM_ETERNAL), | ||
69 | "1s ", "2s ", "3s ", "4s ", "5s ", | ||
70 | "6s ", "7s ", "8s ", "9s ", "10s", | ||
71 | "15s", "20s", "25s", "30s", "45s", | ||
72 | "60s", "90s", "2min", "3min", "5min", | ||
73 | "10min", "20min", "45min", "90min" | ||
74 | }; | ||
75 | return set_option( str(LANG_PM_CLIP_HOLD), | ||
76 | &global_settings.peak_meter_clip_hold, names, | ||
77 | 25, peak_meter_set_clip_hold); | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * Menu to set the release time of the peak meter. | ||
82 | */ | ||
83 | static bool peak_meter_release(void) { | ||
84 | return set_int( str(LANG_PM_RELEASE), str(LANG_PM_UNITS_PER_READ), | ||
85 | &global_settings.peak_meter_release, | ||
86 | NULL, 1, 1, LCD_WIDTH); | ||
87 | } | ||
88 | |||
89 | /** | ||
90 | * Menu to configure the peak meter | ||
91 | */ | ||
92 | static bool peak_meter_menu(void) | ||
93 | { | ||
94 | int m; | ||
95 | bool result; | ||
96 | |||
97 | struct menu_items items[] = { | ||
98 | { str(LANG_PM_RELEASE) , peak_meter_release }, | ||
99 | { str(LANG_PM_PEAK_HOLD), peak_meter_hold }, | ||
100 | { str(LANG_PM_CLIP_HOLD), peak_meter_clip_hold }, | ||
101 | }; | ||
102 | |||
103 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); | ||
104 | result = menu_run(m); | ||
105 | menu_exit(m); | ||
106 | return result; | ||
107 | } | ||
108 | #endif | ||
109 | |||
47 | #ifndef HAVE_RECORDER_KEYPAD | 110 | #ifndef HAVE_RECORDER_KEYPAD |
48 | static bool shuffle(void) | 111 | static bool shuffle(void) |
49 | { | 112 | { |
@@ -313,6 +376,9 @@ static bool display_settings_menu(void) | |||
313 | { str(LANG_SCROLL_MENU), scroll_speed }, | 376 | { str(LANG_SCROLL_MENU), scroll_speed }, |
314 | { str(LANG_BACKLIGHT), backlight_timer }, | 377 | { str(LANG_BACKLIGHT), backlight_timer }, |
315 | { str(LANG_CONTRAST), contrast }, | 378 | { str(LANG_CONTRAST), contrast }, |
379 | #ifdef HAVE_LCD_BITMAP | ||
380 | { str(LANG_PM_MENU), peak_meter_menu }, | ||
381 | #endif | ||
316 | }; | 382 | }; |
317 | 383 | ||
318 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); | 384 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); |