Robert Hak | 84a6ba2 | 2002-06-24 21:39:48 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2002 Robert Hak |
| 11 | * |
| 12 | * All files in this archive are subject to the GNU General Public License. |
| 13 | * See the file COPYING in the source tree root for full license agreement. |
| 14 | * |
| 15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 16 | * KIND, either express or implied. |
| 17 | * |
| 18 | ****************************************************************************/ |
| 19 | |
| 20 | #include "config.h" |
| 21 | |
| 22 | #include <stdio.h> |
| 23 | #include <stdbool.h> |
Linus Nielsen Feltzing | 7ddf0d6 | 2004-04-20 10:23:57 +0000 | [diff] [blame] | 24 | #include <string.h> |
Justin Heiner | b5025a8 | 2002-08-31 04:58:35 +0000 | [diff] [blame] | 25 | |
Robert Hak | 84a6ba2 | 2002-06-24 21:39:48 +0000 | [diff] [blame] | 26 | #include "lcd.h" |
| 27 | #include "menu.h" |
| 28 | #include "mpeg.h" |
Linus Nielsen Feltzing | 8a237a8 | 2005-04-04 12:06:29 +0000 | [diff] [blame] | 29 | #include "audio.h" |
Robert Hak | 84a6ba2 | 2002-06-24 21:39:48 +0000 | [diff] [blame] | 30 | #include "button.h" |
| 31 | #include "kernel.h" |
Björn Stenberg | c4d8d97 | 2003-02-14 09:44:34 +0000 | [diff] [blame] | 32 | #include "thread.h" |
Robert Hak | 84a6ba2 | 2002-06-24 21:39:48 +0000 | [diff] [blame] | 33 | #include "sprintf.h" |
Robert Hak | 84a6ba2 | 2002-06-24 21:39:48 +0000 | [diff] [blame] | 34 | #include "settings.h" |
| 35 | #include "settings_menu.h" |
| 36 | #include "backlight.h" |
Robert Hak | ea8a4cf | 2002-10-14 09:12:52 +0000 | [diff] [blame] | 37 | #include "playlist.h" /* for playlist_shuffle */ |
Daniel Stenberg | 053d904 | 2002-08-22 15:47:30 +0000 | [diff] [blame] | 38 | #include "fat.h" /* For dotfile settings */ |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 39 | #include "sleeptimer.h" |
Heikki Hannikainen | 6eb4254 | 2002-08-06 10:52:51 +0000 | [diff] [blame] | 40 | #include "powermgmt.h" |
Markus Braun | 3181f68 | 2002-08-09 12:38:45 +0000 | [diff] [blame] | 41 | #include "rtc.h" |
Björn Stenberg | 457b8a0 | 2002-08-26 13:21:14 +0000 | [diff] [blame] | 42 | #include "ata.h" |
Björn Stenberg | de5477c | 2003-09-29 21:26:53 +0000 | [diff] [blame] | 43 | #include "tree.h" |
Robert Hak | 8f4c504 | 2002-10-14 11:55:20 +0000 | [diff] [blame] | 44 | #include "screens.h" |
Jörg Hohensohn | fa97f16 | 2004-03-19 22:15:53 +0000 | [diff] [blame] | 45 | #include "talk.h" |
Linus Nielsen Feltzing | 7ddf0d6 | 2004-04-20 10:23:57 +0000 | [diff] [blame] | 46 | #include "timefuncs.h" |
Linus Nielsen Feltzing | ade5d7b | 2004-07-26 16:06:59 +0000 | [diff] [blame] | 47 | #include "misc.h" |
Linus Nielsen Feltzing | 8782bc8 | 2005-07-01 09:42:39 +0000 | [diff] [blame] | 48 | #include "power.h" |
Jens Arnold | 8102f3d | 2005-07-02 10:50:42 +0000 | [diff] [blame] | 49 | #include "database.h" |
Linus Nielsen Feltzing | 8782bc8 | 2005-07-01 09:42:39 +0000 | [diff] [blame] | 50 | |
Daniel Stenberg | f7c3ffa | 2002-09-27 10:18:48 +0000 | [diff] [blame] | 51 | #ifdef HAVE_LCD_BITMAP |
Linus Nielsen Feltzing | bb572c4 | 2002-09-27 09:31:31 +0000 | [diff] [blame] | 52 | #include "peakmeter.h" |
Daniel Stenberg | f7c3ffa | 2002-09-27 10:18:48 +0000 | [diff] [blame] | 53 | #endif |
Björn Stenberg | 505eca7 | 2002-09-18 14:08:05 +0000 | [diff] [blame] | 54 | #include "lang.h" |
Jörg Hohensohn | 593cc00 | 2004-09-28 22:13:26 +0000 | [diff] [blame] | 55 | #if CONFIG_HWCODEC == MAS3507D |
Linus Nielsen Feltzing | 54a7e20 | 2003-11-04 00:18:19 +0000 | [diff] [blame] | 56 | void dac_line_in(bool enable); |
Linus Nielsen Feltzing | c22b411 | 2003-11-03 23:36:36 +0000 | [diff] [blame] | 57 | #endif |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 58 | #ifdef HAVE_ALARM_MOD |
| 59 | #include "alarm_menu.h" |
| 60 | #endif |
Robert Hak | 84a6ba2 | 2002-06-24 21:39:48 +0000 | [diff] [blame] | 61 | |
Christian Gmeiner | 7c1879b | 2005-04-15 12:08:49 +0000 | [diff] [blame] | 62 | #ifdef HAVE_REMOTE_LCD |
| 63 | #include "lcd-remote.h" |
| 64 | #endif |
| 65 | |
Linus Nielsen Feltzing | 6271b2b | 2005-06-09 09:47:00 +0000 | [diff] [blame] | 66 | #if CONFIG_HWCODEC == MASNONE |
Miika Pekkarinen | 20b3897 | 2005-07-13 12:48:22 +0000 | [diff] [blame^] | 67 | #include "pcmbuf.h" |
Linus Nielsen Feltzing | 6271b2b | 2005-06-09 09:47:00 +0000 | [diff] [blame] | 68 | #include "pcm_playback.h" |
| 69 | #endif |
| 70 | |
Jens Arnold | ccfa4cd | 2004-10-10 01:25:32 +0000 | [diff] [blame] | 71 | #ifdef HAVE_CHARGING |
Björn Stenberg | b1c429e | 2003-10-17 14:49:00 +0000 | [diff] [blame] | 72 | static bool car_adapter_mode(void) |
| 73 | { |
| 74 | return set_bool_options( str(LANG_CAR_ADAPTER_MODE), |
| 75 | &global_settings.car_adapter_mode, |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 76 | STR(LANG_SET_BOOL_YES), |
| 77 | STR(LANG_SET_BOOL_NO), |
Linus Nielsen Feltzing | 3d21781 | 2005-04-06 11:12:22 +0000 | [diff] [blame] | 78 | NULL); |
Björn Stenberg | b1c429e | 2003-10-17 14:49:00 +0000 | [diff] [blame] | 79 | } |
Jens Arnold | ccfa4cd | 2004-10-10 01:25:32 +0000 | [diff] [blame] | 80 | #endif |
Björn Stenberg | b1c429e | 2003-10-17 14:49:00 +0000 | [diff] [blame] | 81 | |
Jens Arnold | 61b9d34 | 2005-06-20 17:03:09 +0000 | [diff] [blame] | 82 | /** |
| 83 | * Menu to set icon visibility |
| 84 | */ |
| 85 | static bool show_icons(void) |
Linus Nielsen Feltzing | 638184f | 2002-08-13 11:10:11 +0000 | [diff] [blame] | 86 | { |
Jens Arnold | 61b9d34 | 2005-06-20 17:03:09 +0000 | [diff] [blame] | 87 | return set_bool( str(LANG_SHOW_ICONS), &global_settings.show_icons ); |
Linus Nielsen Feltzing | 638184f | 2002-08-13 11:10:11 +0000 | [diff] [blame] | 88 | } |
| 89 | |
Christian Gmeiner | 7c1879b | 2005-04-15 12:08:49 +0000 | [diff] [blame] | 90 | #ifdef HAVE_REMOTE_LCD |
| 91 | static bool remote_contrast(void) |
| 92 | { |
| 93 | return set_int( str(LANG_CONTRAST), "", UNIT_INT, |
| 94 | &global_settings.remote_contrast, |
| 95 | lcd_remote_set_contrast, 1, MIN_CONTRAST_SETTING, |
| 96 | MAX_CONTRAST_SETTING ); |
| 97 | } |
| 98 | |
| 99 | static bool remote_invert(void) |
| 100 | { |
| 101 | bool rc = set_bool_options(str(LANG_INVERT), |
| 102 | &global_settings.remote_invert, |
| 103 | STR(LANG_INVERT_LCD_INVERSE), |
| 104 | STR(LANG_INVERT_LCD_NORMAL), |
| 105 | lcd_remote_set_invert_display); |
| 106 | return rc; |
| 107 | } |
Jens Arnold | bd1bb5f | 2005-06-17 21:43:00 +0000 | [diff] [blame] | 108 | |
| 109 | static bool remote_flip_display(void) |
| 110 | { |
| 111 | bool rc = set_bool( str(LANG_FLIP_DISPLAY), |
| 112 | &global_settings.remote_flip_display); |
| 113 | |
| 114 | lcd_remote_set_flip(global_settings.remote_flip_display); |
| 115 | lcd_remote_update(); |
| 116 | |
| 117 | return rc; |
| 118 | } |
Christian Gmeiner | 7c1879b | 2005-04-15 12:08:49 +0000 | [diff] [blame] | 119 | #endif |
| 120 | |
Jörg Hohensohn | fee8617 | 2004-12-18 10:29:47 +0000 | [diff] [blame] | 121 | #ifdef CONFIG_BACKLIGHT |
Björn Stenberg | 8d4471d | 2003-04-24 08:27:11 +0000 | [diff] [blame] | 122 | static bool caption_backlight(void) |
| 123 | { |
| 124 | bool rc = set_bool( str(LANG_CAPTION_BACKLIGHT), |
| 125 | &global_settings.caption_backlight); |
| 126 | |
| 127 | return rc; |
| 128 | } |
Jens Arnold | 61b9d34 | 2005-06-20 17:03:09 +0000 | [diff] [blame] | 129 | |
| 130 | #ifdef HAVE_CHARGING |
| 131 | static bool backlight_on_when_charging(void) |
| 132 | { |
| 133 | bool result = set_bool(str(LANG_BACKLIGHT_ON_WHEN_CHARGING), |
| 134 | &global_settings.backlight_on_when_charging); |
| 135 | backlight_set_on_when_charging(global_settings.backlight_on_when_charging); |
| 136 | return result; |
| 137 | } |
Jens Arnold | a1a08d0 | 2004-10-09 19:56:27 +0000 | [diff] [blame] | 138 | #endif |
Björn Stenberg | 8d4471d | 2003-04-24 08:27:11 +0000 | [diff] [blame] | 139 | |
Jens Arnold | 61b9d34 | 2005-06-20 17:03:09 +0000 | [diff] [blame] | 140 | static bool backlight_timer(void) |
Björn Stenberg | d1a6fa1 | 2003-06-05 09:38:26 +0000 | [diff] [blame] | 141 | { |
Jens Arnold | 61b9d34 | 2005-06-20 17:03:09 +0000 | [diff] [blame] | 142 | static const struct opt_items names[] = { |
| 143 | { STR(LANG_OFF) }, |
| 144 | { STR(LANG_ON) }, |
| 145 | { "1s ", TALK_ID(1, UNIT_SEC) }, |
| 146 | { "2s ", TALK_ID(2, UNIT_SEC) }, |
| 147 | { "3s ", TALK_ID(3, UNIT_SEC) }, |
| 148 | { "4s ", TALK_ID(4, UNIT_SEC) }, |
| 149 | { "5s ", TALK_ID(5, UNIT_SEC) }, |
| 150 | { "6s ", TALK_ID(6, UNIT_SEC) }, |
| 151 | { "7s ", TALK_ID(7, UNIT_SEC) }, |
| 152 | { "8s ", TALK_ID(8, UNIT_SEC) }, |
| 153 | { "9s ", TALK_ID(9, UNIT_SEC) }, |
| 154 | { "10s", TALK_ID(10, UNIT_SEC) }, |
| 155 | { "15s", TALK_ID(15, UNIT_SEC) }, |
| 156 | { "20s", TALK_ID(20, UNIT_SEC) }, |
| 157 | { "25s", TALK_ID(25, UNIT_SEC) }, |
| 158 | { "30s", TALK_ID(30, UNIT_SEC) }, |
| 159 | { "45s", TALK_ID(45, UNIT_SEC) }, |
| 160 | { "60s", TALK_ID(60, UNIT_SEC) }, |
| 161 | { "90s", TALK_ID(90, UNIT_SEC) } |
| 162 | }; |
| 163 | return set_option(str(LANG_BACKLIGHT), &global_settings.backlight_timeout, |
| 164 | INT, names, 19, backlight_set_timeout ); |
| 165 | } |
| 166 | |
| 167 | #if CONFIG_BACKLIGHT == BL_IRIVER |
| 168 | static bool backlight_fade_in(void) |
| 169 | { |
| 170 | static const struct opt_items names[] = { |
| 171 | { STR(LANG_OFF) }, |
| 172 | { "500ms", TALK_ID(500, UNIT_MS) }, |
| 173 | { "1s", TALK_ID(1, UNIT_SEC) }, |
| 174 | { "2s", TALK_ID(2, UNIT_SEC) }, |
| 175 | }; |
| 176 | return set_option(str(LANG_BACKLIGHT_FADE_IN), |
| 177 | &global_settings.backlight_fade_in, |
| 178 | INT, names, 4, backlight_set_fade_in ); |
| 179 | } |
| 180 | |
| 181 | static bool backlight_fade_out(void) |
| 182 | { |
| 183 | static const struct opt_items names[] = { |
| 184 | { STR(LANG_OFF) }, |
| 185 | { "500ms", TALK_ID(500, UNIT_MS) }, |
| 186 | { "1s", TALK_ID(1, UNIT_SEC) }, |
| 187 | { "2s", TALK_ID(2, UNIT_SEC) }, |
| 188 | { "3s", TALK_ID(3, UNIT_SEC) }, |
| 189 | { "4s", TALK_ID(4, UNIT_SEC) }, |
| 190 | { "5s", TALK_ID(5, UNIT_SEC) }, |
| 191 | { "10s", TALK_ID(10, UNIT_SEC) }, |
| 192 | }; |
| 193 | return set_option(str(LANG_BACKLIGHT_FADE_OUT), |
| 194 | &global_settings.backlight_fade_out, |
| 195 | INT, names, 8, backlight_set_fade_out ); |
| 196 | } |
| 197 | #endif |
| 198 | #endif /* CONFIG_BACKLIGHT */ |
| 199 | |
| 200 | #ifdef HAVE_REMOTE_LCD |
| 201 | |
| 202 | static bool remote_backlight_timer(void) |
| 203 | { |
| 204 | static const struct opt_items names[] = { |
| 205 | { STR(LANG_OFF) }, |
| 206 | { STR(LANG_ON) }, |
| 207 | { "1s ", TALK_ID(1, UNIT_SEC) }, |
| 208 | { "2s ", TALK_ID(2, UNIT_SEC) }, |
| 209 | { "3s ", TALK_ID(3, UNIT_SEC) }, |
| 210 | { "4s ", TALK_ID(4, UNIT_SEC) }, |
| 211 | { "5s ", TALK_ID(5, UNIT_SEC) }, |
| 212 | { "6s ", TALK_ID(6, UNIT_SEC) }, |
| 213 | { "7s ", TALK_ID(7, UNIT_SEC) }, |
| 214 | { "8s ", TALK_ID(8, UNIT_SEC) }, |
| 215 | { "9s ", TALK_ID(9, UNIT_SEC) }, |
| 216 | { "10s", TALK_ID(10, UNIT_SEC) }, |
| 217 | { "15s", TALK_ID(15, UNIT_SEC) }, |
| 218 | { "20s", TALK_ID(20, UNIT_SEC) }, |
| 219 | { "25s", TALK_ID(25, UNIT_SEC) }, |
| 220 | { "30s", TALK_ID(30, UNIT_SEC) }, |
| 221 | { "45s", TALK_ID(45, UNIT_SEC) }, |
| 222 | { "60s", TALK_ID(60, UNIT_SEC) }, |
| 223 | { "90s", TALK_ID(90, UNIT_SEC) } |
| 224 | }; |
| 225 | return set_option(str(LANG_BACKLIGHT), &global_settings.remote_backlight_timeout, |
| 226 | INT, names, 19, remote_backlight_set_timeout ); |
| 227 | } |
| 228 | |
| 229 | #endif /* HAVE_REMOTE_LCD */ |
| 230 | |
| 231 | static bool contrast(void) |
| 232 | { |
| 233 | return set_int( str(LANG_CONTRAST), "", UNIT_INT, |
| 234 | &global_settings.contrast, |
| 235 | lcd_set_contrast, 1, MIN_CONTRAST_SETTING, |
| 236 | MAX_CONTRAST_SETTING ); |
Björn Stenberg | d1a6fa1 | 2003-06-05 09:38:26 +0000 | [diff] [blame] | 237 | } |
| 238 | |
Linus Nielsen Feltzing | bb572c4 | 2002-09-27 09:31:31 +0000 | [diff] [blame] | 239 | #ifdef HAVE_LCD_BITMAP |
Robert Hak | da40726 | 2002-10-26 05:46:53 +0000 | [diff] [blame] | 240 | |
Björn Stenberg | d1a6fa1 | 2003-06-05 09:38:26 +0000 | [diff] [blame] | 241 | /** |
| 242 | * Menu to set LCD Mode (normal/inverse) |
| 243 | */ |
Björn Stenberg | b107920 | 2003-02-27 14:22:30 +0000 | [diff] [blame] | 244 | static bool invert(void) |
| 245 | { |
Björn Stenberg | 233b7f3 | 2003-04-24 13:13:16 +0000 | [diff] [blame] | 246 | bool rc = set_bool_options(str(LANG_INVERT), |
| 247 | &global_settings.invert, |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 248 | STR(LANG_INVERT_LCD_INVERSE), |
| 249 | STR(LANG_INVERT_LCD_NORMAL), |
Björn Stenberg | 26712d5 | 2003-06-05 11:11:10 +0000 | [diff] [blame] | 250 | lcd_set_invert_display); |
Björn Stenberg | 233b7f3 | 2003-04-24 13:13:16 +0000 | [diff] [blame] | 251 | return rc; |
Björn Stenberg | b107920 | 2003-02-27 14:22:30 +0000 | [diff] [blame] | 252 | } |
| 253 | |
Björn Stenberg | d1a6fa1 | 2003-06-05 09:38:26 +0000 | [diff] [blame] | 254 | /** |
Jens Arnold | 61b9d34 | 2005-06-20 17:03:09 +0000 | [diff] [blame] | 255 | * Menu to turn the display+buttons by 180 degrees |
| 256 | */ |
| 257 | static bool flip_display(void) |
| 258 | { |
| 259 | bool rc = set_bool( str(LANG_FLIP_DISPLAY), |
| 260 | &global_settings.flip_display); |
| 261 | |
| 262 | button_set_flip(global_settings.flip_display); |
| 263 | lcd_set_flip(global_settings.flip_display); |
| 264 | |
| 265 | return rc; |
| 266 | } |
| 267 | |
| 268 | /** |
Björn Stenberg | d1a6fa1 | 2003-06-05 09:38:26 +0000 | [diff] [blame] | 269 | * Menu to set Line Selector Type (Pointer/Bar) |
| 270 | */ |
Linus Nielsen Feltzing | e43b78a | 2003-04-16 00:12:31 +0000 | [diff] [blame] | 271 | static bool invert_cursor(void) |
| 272 | { |
Björn Stenberg | 233b7f3 | 2003-04-24 13:13:16 +0000 | [diff] [blame] | 273 | return set_bool_options(str(LANG_INVERT_CURSOR), |
| 274 | &global_settings.invert_cursor, |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 275 | STR(LANG_INVERT_CURSOR_BAR), |
| 276 | STR(LANG_INVERT_CURSOR_POINTER), |
Björn Stenberg | 26712d5 | 2003-06-05 11:11:10 +0000 | [diff] [blame] | 277 | NULL); |
Linus Nielsen Feltzing | e43b78a | 2003-04-16 00:12:31 +0000 | [diff] [blame] | 278 | } |
| 279 | |
Robert Hak | da40726 | 2002-10-26 05:46:53 +0000 | [diff] [blame] | 280 | /** |
| 281 | * Menu to configure the battery display on status bar |
| 282 | */ |
Jens Arnold | 9d42e2b | 2005-01-30 13:48:44 +0000 | [diff] [blame] | 283 | static bool battery_display(void) |
Robert Hak | da40726 | 2002-10-26 05:46:53 +0000 | [diff] [blame] | 284 | { |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 285 | static const struct opt_items names[] = { |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 286 | { STR(LANG_DISPLAY_GRAPHIC) }, |
| 287 | { STR(LANG_DISPLAY_NUMERIC) } |
| 288 | }; |
Robert Hak | da40726 | 2002-10-26 05:46:53 +0000 | [diff] [blame] | 289 | return set_option( str(LANG_BATTERY_DISPLAY), |
Jens Arnold | 9d42e2b | 2005-01-30 13:48:44 +0000 | [diff] [blame] | 290 | &global_settings.battery_display, INT, names, 2, NULL); |
Robert Hak | da40726 | 2002-10-26 05:46:53 +0000 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | /** |
| 294 | * Menu to configure the volume display on status bar |
| 295 | */ |
| 296 | static bool volume_type(void) |
| 297 | { |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 298 | static const struct opt_items names[] = { |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 299 | { STR(LANG_DISPLAY_GRAPHIC) }, |
| 300 | { STR(LANG_DISPLAY_NUMERIC) } |
| 301 | }; |
Robert Hak | da40726 | 2002-10-26 05:46:53 +0000 | [diff] [blame] | 302 | return set_option( str(LANG_VOLUME_DISPLAY), &global_settings.volume_type, |
Björn Stenberg | 26712d5 | 2003-06-05 11:11:10 +0000 | [diff] [blame] | 303 | INT, names, 2, NULL); |
Robert Hak | da40726 | 2002-10-26 05:46:53 +0000 | [diff] [blame] | 304 | } |
| 305 | |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 306 | #ifdef PM_DEBUG |
| 307 | static bool peak_meter_fps_menu(void) { |
| 308 | bool retval = false; |
Jörg Hohensohn | beec2e9 | 2004-03-20 16:49:58 +0000 | [diff] [blame] | 309 | retval = set_int( "Refresh rate", "/s", UNIT_PER_SEC, |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 310 | &peak_meter_fps, |
| 311 | NULL, 1, 5, 40); |
| 312 | return retval; |
| 313 | } |
| 314 | #endif /* PM_DEBUG */ |
| 315 | |
Linus Nielsen Feltzing | bb572c4 | 2002-09-27 09:31:31 +0000 | [diff] [blame] | 316 | /** |
| 317 | * Menu to set the hold time of normal peaks. |
| 318 | */ |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 319 | static bool peak_meter_hold(void) { |
| 320 | bool retval = false; |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 321 | static const struct opt_items names[] = { |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 322 | { STR(LANG_OFF) }, |
Jörg Hohensohn | fa97f16 | 2004-03-19 22:15:53 +0000 | [diff] [blame] | 323 | { "200 ms " , TALK_ID(200, UNIT_MS) }, |
| 324 | { "300 ms " , TALK_ID(300, UNIT_MS) }, |
| 325 | { "500 ms " , TALK_ID(500, UNIT_MS) }, |
| 326 | { "1 s" , TALK_ID(1, UNIT_SEC) }, |
| 327 | { "2 s" , TALK_ID(2, UNIT_SEC) }, |
| 328 | { "3 s" , TALK_ID(3, UNIT_SEC) }, |
| 329 | { "4 s" , TALK_ID(4, UNIT_SEC) }, |
| 330 | { "5 s" , TALK_ID(5, UNIT_SEC) }, |
| 331 | { "6 s" , TALK_ID(6, UNIT_SEC) }, |
| 332 | { "7 s" , TALK_ID(7, UNIT_SEC) }, |
| 333 | { "8 s" , TALK_ID(8, UNIT_SEC) }, |
| 334 | { "9 s" , TALK_ID(9, UNIT_SEC) }, |
| 335 | { "10 s" , TALK_ID(10, UNIT_SEC) }, |
| 336 | { "15 s" , TALK_ID(15, UNIT_SEC) }, |
| 337 | { "20 s" , TALK_ID(20, UNIT_SEC) }, |
| 338 | { "30 s" , TALK_ID(30, UNIT_SEC) }, |
| 339 | { "1 min" , TALK_ID(1, UNIT_MIN) } |
Linus Nielsen Feltzing | bb572c4 | 2002-09-27 09:31:31 +0000 | [diff] [blame] | 340 | }; |
Björn Stenberg | 26712d5 | 2003-06-05 11:11:10 +0000 | [diff] [blame] | 341 | retval = set_option( str(LANG_PM_PEAK_HOLD), |
| 342 | &global_settings.peak_meter_hold, INT, names, |
| 343 | 18, NULL); |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 344 | |
| 345 | peak_meter_init_times(global_settings.peak_meter_release, |
| 346 | global_settings.peak_meter_hold, |
| 347 | global_settings.peak_meter_clip_hold); |
| 348 | |
| 349 | return retval; |
Linus Nielsen Feltzing | bb572c4 | 2002-09-27 09:31:31 +0000 | [diff] [blame] | 350 | } |
| 351 | |
| 352 | /** |
| 353 | * Menu to set the hold time of clips. |
| 354 | */ |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 355 | static bool peak_meter_clip_hold(void) { |
| 356 | bool retval = false; |
| 357 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 358 | static const struct opt_items names[] = { |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 359 | { STR(LANG_PM_ETERNAL) }, |
Jörg Hohensohn | fa97f16 | 2004-03-19 22:15:53 +0000 | [diff] [blame] | 360 | { "1s " , TALK_ID(1, UNIT_SEC) }, |
| 361 | { "2s " , TALK_ID(2, UNIT_SEC) }, |
| 362 | { "3s " , TALK_ID(3, UNIT_SEC) }, |
| 363 | { "4s " , TALK_ID(4, UNIT_SEC) }, |
| 364 | { "5s " , TALK_ID(5, UNIT_SEC) }, |
| 365 | { "6s " , TALK_ID(6, UNIT_SEC) }, |
| 366 | { "7s " , TALK_ID(7, UNIT_SEC) }, |
| 367 | { "8s " , TALK_ID(8, UNIT_SEC) }, |
| 368 | { "9s " , TALK_ID(9, UNIT_SEC) }, |
| 369 | { "10s" , TALK_ID(10, UNIT_SEC) }, |
| 370 | { "15s" , TALK_ID(15, UNIT_SEC) }, |
| 371 | { "20s" , TALK_ID(20, UNIT_SEC) }, |
| 372 | { "25s" , TALK_ID(25, UNIT_SEC) }, |
| 373 | { "30s" , TALK_ID(30, UNIT_SEC) }, |
| 374 | { "45s" , TALK_ID(45, UNIT_SEC) }, |
| 375 | { "60s" , TALK_ID(60, UNIT_SEC) }, |
| 376 | { "90s" , TALK_ID(90, UNIT_SEC) }, |
| 377 | { "2min" , TALK_ID(2, UNIT_MIN) }, |
| 378 | { "3min" , TALK_ID(3, UNIT_MIN) }, |
| 379 | { "5min" , TALK_ID(5, UNIT_MIN) }, |
| 380 | { "10min" , TALK_ID(10, UNIT_MIN) }, |
| 381 | { "20min" , TALK_ID(20, UNIT_MIN) }, |
| 382 | { "45min" , TALK_ID(45, UNIT_MIN) }, |
| 383 | { "90min" , TALK_ID(90, UNIT_MIN) } |
Linus Nielsen Feltzing | bb572c4 | 2002-09-27 09:31:31 +0000 | [diff] [blame] | 384 | }; |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 385 | retval = set_option( str(LANG_PM_CLIP_HOLD), |
Björn Stenberg | 26712d5 | 2003-06-05 11:11:10 +0000 | [diff] [blame] | 386 | &global_settings.peak_meter_clip_hold, INT, names, |
| 387 | 25, peak_meter_set_clip_hold); |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 388 | |
| 389 | peak_meter_init_times(global_settings.peak_meter_release, |
| 390 | global_settings.peak_meter_hold, |
| 391 | global_settings.peak_meter_clip_hold); |
| 392 | |
| 393 | return retval; |
Linus Nielsen Feltzing | bb572c4 | 2002-09-27 09:31:31 +0000 | [diff] [blame] | 394 | } |
| 395 | |
| 396 | /** |
| 397 | * Menu to set the release time of the peak meter. |
| 398 | */ |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 399 | static bool peak_meter_release(void) { |
| 400 | bool retval = false; |
| 401 | |
| 402 | /* The range of peak_meter_release is restricted so that it |
| 403 | fits into a 7 bit number. The 8th bit is used for storing |
| 404 | something else in the rtc ram. |
| 405 | Also, the max value is 0x7e, since the RTC value 0xff is reserved */ |
Jens Arnold | 359ef77 | 2004-11-19 01:13:33 +0000 | [diff] [blame] | 406 | retval = set_int( str(LANG_PM_RELEASE), str(LANG_PM_UNITS_PER_READ), |
| 407 | LANG_PM_UNITS_PER_READ, |
| 408 | &global_settings.peak_meter_release, |
| 409 | NULL, 1, 1, 0x7e); |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 410 | |
| 411 | peak_meter_init_times(global_settings.peak_meter_release, |
| 412 | global_settings.peak_meter_hold, |
| 413 | global_settings.peak_meter_clip_hold); |
| 414 | |
| 415 | return retval; |
| 416 | } |
| 417 | |
| 418 | /** |
| 419 | * Menu to select wether the scale of the meter |
| 420 | * displays dBfs of linear values. |
| 421 | */ |
| 422 | static bool peak_meter_scale(void) { |
| 423 | bool retval = false; |
| 424 | bool use_dbfs = global_settings.peak_meter_dbfs; |
| 425 | retval = set_bool_options(str(LANG_PM_SCALE), |
| 426 | &use_dbfs, |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 427 | STR(LANG_PM_DBFS), STR(LANG_PM_LINEAR), |
Björn Stenberg | 26712d5 | 2003-06-05 11:11:10 +0000 | [diff] [blame] | 428 | NULL); |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 429 | |
| 430 | /* has the user really changed the scale? */ |
| 431 | if (use_dbfs != global_settings.peak_meter_dbfs) { |
| 432 | |
| 433 | /* store the change */ |
| 434 | global_settings.peak_meter_dbfs = use_dbfs; |
| 435 | peak_meter_set_use_dbfs(use_dbfs); |
| 436 | |
| 437 | /* If the user changed the scale mode the meaning of |
| 438 | peak_meter_min (peak_meter_max) has changed. Thus we have |
| 439 | to convert the values stored in global_settings. */ |
| 440 | if (use_dbfs) { |
| 441 | |
| 442 | /* we only store -dBfs */ |
| 443 | global_settings.peak_meter_min = -peak_meter_get_min() / 100; |
| 444 | global_settings.peak_meter_max = -peak_meter_get_max() / 100; |
| 445 | } else { |
| 446 | int max; |
| 447 | |
| 448 | /* linear percent */ |
| 449 | global_settings.peak_meter_min = peak_meter_get_min(); |
| 450 | |
| 451 | /* converting dBfs -> percent results in a precision loss. |
| 452 | I assume that the user doesn't bother that conversion |
| 453 | dBfs <-> percent isn't symmetrical for odd values but that |
| 454 | he wants 0 dBfs == 100%. Thus I 'correct' the percent value |
| 455 | resulting from dBfs -> percent manually here */ |
| 456 | max = peak_meter_get_max(); |
| 457 | global_settings.peak_meter_max = max < 99 ? max : 100; |
| 458 | } |
| 459 | settings_apply_pm_range(); |
| 460 | } |
| 461 | return retval; |
| 462 | } |
| 463 | |
| 464 | /** |
| 465 | * Adjust the min value of the value range that |
| 466 | * the peak meter shall visualize. |
| 467 | */ |
| 468 | static bool peak_meter_min(void) { |
| 469 | bool retval = false; |
| 470 | if (global_settings.peak_meter_dbfs) { |
| 471 | |
| 472 | /* for dBfs scale */ |
| 473 | int range_max = -global_settings.peak_meter_max; |
| 474 | int min = -global_settings.peak_meter_min; |
| 475 | |
Jörg Hohensohn | beec2e9 | 2004-03-20 16:49:58 +0000 | [diff] [blame] | 476 | retval = set_int(str(LANG_PM_MIN), str(LANG_PM_DBFS), UNIT_DB, |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 477 | &min, NULL, 1, -89, range_max); |
| 478 | |
| 479 | global_settings.peak_meter_min = - min; |
| 480 | } |
| 481 | |
| 482 | /* for linear scale */ |
| 483 | else { |
| 484 | int min = global_settings.peak_meter_min; |
| 485 | |
Jörg Hohensohn | beec2e9 | 2004-03-20 16:49:58 +0000 | [diff] [blame] | 486 | retval = set_int(str(LANG_PM_MIN), "%", UNIT_PERCENT, |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 487 | &min, NULL, |
| 488 | 1, 0, global_settings.peak_meter_max - 1); |
| 489 | |
| 490 | global_settings.peak_meter_min = (unsigned char)min; |
| 491 | } |
| 492 | |
| 493 | settings_apply_pm_range(); |
| 494 | return retval; |
| 495 | } |
| 496 | |
| 497 | |
| 498 | /** |
| 499 | * Adjust the max value of the value range that |
| 500 | * the peak meter shall visualize. |
| 501 | */ |
| 502 | static bool peak_meter_max(void) { |
| 503 | bool retval = false; |
| 504 | if (global_settings.peak_meter_dbfs) { |
| 505 | |
| 506 | /* for dBfs scale */ |
| 507 | int range_min = -global_settings.peak_meter_min; |
| 508 | int max = -global_settings.peak_meter_max;; |
| 509 | |
Jörg Hohensohn | beec2e9 | 2004-03-20 16:49:58 +0000 | [diff] [blame] | 510 | retval = set_int(str(LANG_PM_MAX), str(LANG_PM_DBFS), UNIT_DB, |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 511 | &max, NULL, 1, range_min, 0); |
| 512 | |
| 513 | global_settings.peak_meter_max = - max; |
| 514 | |
| 515 | } |
| 516 | |
| 517 | /* for linear scale */ |
| 518 | else { |
| 519 | int max = global_settings.peak_meter_max; |
| 520 | |
Jörg Hohensohn | beec2e9 | 2004-03-20 16:49:58 +0000 | [diff] [blame] | 521 | retval = set_int(str(LANG_PM_MAX), "%", UNIT_PERCENT, |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 522 | &max, NULL, |
| 523 | 1, global_settings.peak_meter_min + 1, 100); |
| 524 | |
| 525 | global_settings.peak_meter_max = (unsigned char)max; |
| 526 | } |
| 527 | |
| 528 | settings_apply_pm_range(); |
| 529 | return retval; |
| 530 | } |
| 531 | |
| 532 | /** |
| 533 | * Menu to select wether the meter is in |
| 534 | * precision or in energy saver mode |
| 535 | */ |
| 536 | static bool peak_meter_performance(void) { |
| 537 | bool retval = false; |
| 538 | retval = set_bool_options(str(LANG_PM_PERFORMANCE), |
| 539 | &global_settings.peak_meter_performance, |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 540 | STR(LANG_PM_HIGH_PERFORMANCE), STR(LANG_PM_ENERGY_SAVER), |
Björn Stenberg | 26712d5 | 2003-06-05 11:11:10 +0000 | [diff] [blame] | 541 | NULL); |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 542 | |
| 543 | if (global_settings.peak_meter_performance) { |
| 544 | peak_meter_fps = 25; |
| 545 | } else { |
| 546 | peak_meter_fps = 20; |
| 547 | } |
| 548 | return retval; |
Linus Nielsen Feltzing | bb572c4 | 2002-09-27 09:31:31 +0000 | [diff] [blame] | 549 | } |
| 550 | |
| 551 | /** |
| 552 | * Menu to configure the peak meter |
| 553 | */ |
| 554 | static bool peak_meter_menu(void) |
| 555 | { |
| 556 | int m; |
| 557 | bool result; |
| 558 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 559 | static const struct menu_item items[] = { |
| 560 | { ID2P(LANG_PM_RELEASE) , peak_meter_release }, |
| 561 | { ID2P(LANG_PM_PEAK_HOLD), peak_meter_hold }, |
| 562 | { ID2P(LANG_PM_CLIP_HOLD), peak_meter_clip_hold }, |
| 563 | { ID2P(LANG_PM_PERFORMANCE), peak_meter_performance }, |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 564 | #ifdef PM_DEBUG |
Jörg Hohensohn | 4f36ea8 | 2004-03-14 21:33:53 +0000 | [diff] [blame] | 565 | { "Refresh rate" , -1 , peak_meter_fps_menu }, |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 566 | #endif |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 567 | { ID2P(LANG_PM_SCALE) , peak_meter_scale }, |
| 568 | { ID2P(LANG_PM_MIN) , peak_meter_min }, |
| 569 | { ID2P(LANG_PM_MAX) , peak_meter_max }, |
Linus Nielsen Feltzing | bb572c4 | 2002-09-27 09:31:31 +0000 | [diff] [blame] | 570 | }; |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 571 | |
| 572 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 573 | NULL, NULL, NULL ); |
Linus Nielsen Feltzing | bb572c4 | 2002-09-27 09:31:31 +0000 | [diff] [blame] | 574 | result = menu_run(m); |
| 575 | menu_exit(m); |
| 576 | return result; |
| 577 | } |
Linus Nielsen Feltzing | fd0cc3b | 2002-10-29 12:09:15 +0000 | [diff] [blame] | 578 | #endif /* HAVE_LCD_BITMAP */ |
Linus Nielsen Feltzing | bb572c4 | 2002-09-27 09:31:31 +0000 | [diff] [blame] | 579 | |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 580 | static bool shuffle(void) |
Robert Hak | 84a6ba2 | 2002-06-24 21:39:48 +0000 | [diff] [blame] | 581 | { |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 582 | return set_bool( str(LANG_SHUFFLE), &global_settings.playlist_shuffle ); |
Björn Stenberg | 60b356e | 2002-06-27 01:08:11 +0000 | [diff] [blame] | 583 | } |
Björn Stenberg | a6d0abb | 2002-10-04 08:48:20 +0000 | [diff] [blame] | 584 | |
| 585 | static bool repeat_mode(void) |
| 586 | { |
| 587 | bool result; |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 588 | static const struct opt_items names[] = { |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 589 | { STR(LANG_OFF) }, |
| 590 | { STR(LANG_REPEAT_ALL) }, |
Hardeep Sidhu | 74d082c | 2005-06-25 04:46:25 +0000 | [diff] [blame] | 591 | { STR(LANG_REPEAT_ONE) }, |
| 592 | { STR(LANG_SHUFFLE) }, |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 593 | }; |
Björn Stenberg | a6d0abb | 2002-10-04 08:48:20 +0000 | [diff] [blame] | 594 | int old_repeat = global_settings.repeat_mode; |
| 595 | |
| 596 | result = set_option( str(LANG_REPEAT), &global_settings.repeat_mode, |
Hardeep Sidhu | 74d082c | 2005-06-25 04:46:25 +0000 | [diff] [blame] | 597 | INT, names, 4, NULL ); |
Björn Stenberg | a6d0abb | 2002-10-04 08:48:20 +0000 | [diff] [blame] | 598 | |
Hardeep Sidhu | a6abe76 | 2005-07-07 23:50:16 +0000 | [diff] [blame] | 599 | if (old_repeat != global_settings.repeat_mode && |
| 600 | (audio_status() & AUDIO_STATUS_PLAY)) |
Linus Nielsen Feltzing | 8a237a8 | 2005-04-04 12:06:29 +0000 | [diff] [blame] | 601 | audio_flush_and_reload_tracks(); |
Björn Stenberg | a6d0abb | 2002-10-04 08:48:20 +0000 | [diff] [blame] | 602 | |
| 603 | return result; |
| 604 | } |
Robert Hak | 84a6ba2 | 2002-06-24 21:39:48 +0000 | [diff] [blame] | 605 | |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 606 | static bool play_selected(void) |
Linus Nielsen Feltzing | 25316c5 | 2002-09-18 10:13:09 +0000 | [diff] [blame] | 607 | { |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 608 | return set_bool( str(LANG_PLAY_SELECTED), &global_settings.play_selected ); |
Linus Nielsen Feltzing | 25316c5 | 2002-09-18 10:13:09 +0000 | [diff] [blame] | 609 | } |
| 610 | |
Björn Stenberg | a7dcf91 | 2002-09-24 19:12:09 +0000 | [diff] [blame] | 611 | static bool dir_filter(void) |
Björn Stenberg | 60b356e | 2002-06-27 01:08:11 +0000 | [diff] [blame] | 612 | { |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 613 | static const struct opt_items names[] = { |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 614 | { STR(LANG_FILTER_ALL) }, |
| 615 | { STR(LANG_FILTER_SUPPORTED) }, |
| 616 | { STR(LANG_FILTER_MUSIC) }, |
Björn Stenberg | fc53fd7 | 2005-01-17 11:37:36 +0000 | [diff] [blame] | 617 | { STR(LANG_FILTER_PLAYLIST) }, |
| 618 | { STR(LANG_FILTER_ID3DB) } |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 619 | }; |
Björn Stenberg | 26712d5 | 2003-06-05 11:11:10 +0000 | [diff] [blame] | 620 | return set_option( str(LANG_FILTER), &global_settings.dirfilter, INT, |
Björn Stenberg | fc53fd7 | 2005-01-17 11:37:36 +0000 | [diff] [blame] | 621 | names, 5, NULL ); |
Robert Hak | 84a6ba2 | 2002-06-24 21:39:48 +0000 | [diff] [blame] | 622 | } |
| 623 | |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 624 | static bool sort_case(void) |
Linus Nielsen Feltzing | c132c48 | 2002-07-22 16:39:17 +0000 | [diff] [blame] | 625 | { |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 626 | return set_bool( str(LANG_SORT_CASE), &global_settings.sort_case ); |
Linus Nielsen Feltzing | c132c48 | 2002-07-22 16:39:17 +0000 | [diff] [blame] | 627 | } |
| 628 | |
Jörg Hohensohn | 5c8a2f5 | 2004-06-22 09:16:44 +0000 | [diff] [blame] | 629 | static bool sort_file(void) |
| 630 | { |
Jörg Hohensohn | d79b1f5 | 2004-06-23 07:28:35 +0000 | [diff] [blame] | 631 | int oldval = global_settings.sort_file; |
| 632 | bool ret; |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 633 | static const struct opt_items names[] = { |
Jörg Hohensohn | 5c8a2f5 | 2004-06-22 09:16:44 +0000 | [diff] [blame] | 634 | { STR(LANG_SORT_ALPHA) }, |
| 635 | { STR(LANG_SORT_DATE) }, |
| 636 | { STR(LANG_SORT_DATE_REVERSE) }, |
| 637 | { STR(LANG_SORT_TYPE) } |
| 638 | }; |
Jörg Hohensohn | d79b1f5 | 2004-06-23 07:28:35 +0000 | [diff] [blame] | 639 | ret = set_option( str(LANG_SORT_FILE), &global_settings.sort_file, INT, |
Jörg Hohensohn | 5c8a2f5 | 2004-06-22 09:16:44 +0000 | [diff] [blame] | 640 | names, 4, NULL ); |
Jörg Hohensohn | d79b1f5 | 2004-06-23 07:28:35 +0000 | [diff] [blame] | 641 | if (global_settings.sort_file != oldval) |
| 642 | reload_directory(); /* force reload if this has changed */ |
| 643 | return ret; |
Jörg Hohensohn | 5c8a2f5 | 2004-06-22 09:16:44 +0000 | [diff] [blame] | 644 | } |
| 645 | |
| 646 | static bool sort_dir(void) |
| 647 | { |
Jörg Hohensohn | d79b1f5 | 2004-06-23 07:28:35 +0000 | [diff] [blame] | 648 | int oldval = global_settings.sort_dir; |
| 649 | bool ret; |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 650 | static const struct opt_items names[] = { |
Jörg Hohensohn | 5c8a2f5 | 2004-06-22 09:16:44 +0000 | [diff] [blame] | 651 | { STR(LANG_SORT_ALPHA) }, |
| 652 | { STR(LANG_SORT_DATE) }, |
| 653 | { STR(LANG_SORT_DATE_REVERSE) } |
| 654 | }; |
Jörg Hohensohn | d79b1f5 | 2004-06-23 07:28:35 +0000 | [diff] [blame] | 655 | ret = set_option( str(LANG_SORT_DIR), &global_settings.sort_dir, INT, |
Jörg Hohensohn | 5c8a2f5 | 2004-06-22 09:16:44 +0000 | [diff] [blame] | 656 | names, 3, NULL ); |
Jörg Hohensohn | d79b1f5 | 2004-06-23 07:28:35 +0000 | [diff] [blame] | 657 | if (global_settings.sort_dir != oldval) |
| 658 | reload_directory(); /* force reload if this has changed */ |
| 659 | return ret; |
Jörg Hohensohn | 5c8a2f5 | 2004-06-22 09:16:44 +0000 | [diff] [blame] | 660 | } |
| 661 | |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 662 | static bool resume(void) |
Björn Stenberg | 6224cdb | 2002-08-16 14:41:47 +0000 | [diff] [blame] | 663 | { |
Christi Scarborough | 9e8918b | 2005-06-29 12:23:09 +0000 | [diff] [blame] | 664 | return set_bool( str(LANG_RESUME), &global_settings.resume); |
Björn Stenberg | 6224cdb | 2002-08-16 14:41:47 +0000 | [diff] [blame] | 665 | } |
| 666 | |
Linus Nielsen Feltzing | 8782bc8 | 2005-07-01 09:42:39 +0000 | [diff] [blame] | 667 | #ifdef HAVE_SPDIF_POWER |
| 668 | static bool spdif(void) |
| 669 | { |
| 670 | bool rc = set_bool_options(str(LANG_SPDIF_ENABLE), |
| 671 | &global_settings.spdif_enable, |
| 672 | STR(LANG_ON), |
| 673 | STR(LANG_OFF), |
| 674 | spdif_power_enable); |
| 675 | return rc; |
| 676 | } |
| 677 | #endif |
| 678 | |
Björn Stenberg | a108ec2 | 2004-01-14 00:13:04 +0000 | [diff] [blame] | 679 | static bool autocreatebookmark(void) |
| 680 | { |
Henrik Backe | e735356 | 2004-04-19 17:51:47 +0000 | [diff] [blame] | 681 | bool retval = false; |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 682 | static const struct opt_items names[] = { |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 683 | { STR(LANG_SET_BOOL_NO) }, |
| 684 | { STR(LANG_SET_BOOL_YES) }, |
| 685 | { STR(LANG_RESUME_SETTING_ASK) }, |
| 686 | { STR(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_YES) }, |
| 687 | { STR(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_ASK) } |
| 688 | }; |
Henrik Backe | e735356 | 2004-04-19 17:51:47 +0000 | [diff] [blame] | 689 | |
| 690 | retval = set_option( str(LANG_BOOKMARK_SETTINGS_AUTOCREATE), |
Björn Stenberg | a108ec2 | 2004-01-14 00:13:04 +0000 | [diff] [blame] | 691 | &global_settings.autocreatebookmark, INT, |
| 692 | names, 5, NULL ); |
Henrik Backe | e735356 | 2004-04-19 17:51:47 +0000 | [diff] [blame] | 693 | if(global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_YES || |
| 694 | global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_ASK) |
| 695 | { |
| 696 | if(global_settings.usemrb == BOOKMARK_NO) |
| 697 | global_settings.usemrb = BOOKMARK_YES; |
| 698 | |
| 699 | } |
| 700 | return retval; |
Björn Stenberg | a108ec2 | 2004-01-14 00:13:04 +0000 | [diff] [blame] | 701 | } |
| 702 | |
| 703 | static bool autoloadbookmark(void) |
| 704 | { |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 705 | static const struct opt_items names[] = { |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 706 | { STR(LANG_SET_BOOL_NO) }, |
| 707 | { STR(LANG_SET_BOOL_YES) }, |
| 708 | { STR(LANG_RESUME_SETTING_ASK) } |
| 709 | }; |
Björn Stenberg | a108ec2 | 2004-01-14 00:13:04 +0000 | [diff] [blame] | 710 | return set_option( str(LANG_BOOKMARK_SETTINGS_AUTOLOAD), |
| 711 | &global_settings.autoloadbookmark, INT, |
| 712 | names, 3, NULL ); |
| 713 | } |
| 714 | |
| 715 | static bool useMRB(void) |
| 716 | { |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 717 | static const struct opt_items names[] = { |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 718 | { STR(LANG_SET_BOOL_NO) }, |
| 719 | { STR(LANG_SET_BOOL_YES) }, |
| 720 | { STR(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY) } |
| 721 | }; |
Björn Stenberg | a108ec2 | 2004-01-14 00:13:04 +0000 | [diff] [blame] | 722 | return set_option( str(LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS), |
| 723 | &global_settings.usemrb, INT, |
| 724 | names, 3, NULL ); |
| 725 | } |
Jens Arnold | a1a08d0 | 2004-10-09 19:56:27 +0000 | [diff] [blame] | 726 | |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 727 | static bool poweroff_idle_timer(void) |
Linus Nielsen Feltzing | 083a6db | 2002-09-23 11:42:48 +0000 | [diff] [blame] | 728 | { |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 729 | static const struct opt_items names[] = { |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 730 | { STR(LANG_OFF) }, |
Jörg Hohensohn | fa97f16 | 2004-03-19 22:15:53 +0000 | [diff] [blame] | 731 | { "1m ", TALK_ID(1, UNIT_MIN) }, |
| 732 | { "2m ", TALK_ID(2, UNIT_MIN) }, |
| 733 | { "3m ", TALK_ID(3, UNIT_MIN) }, |
| 734 | { "4m ", TALK_ID(4, UNIT_MIN) }, |
| 735 | { "5m ", TALK_ID(5, UNIT_MIN) }, |
| 736 | { "6m ", TALK_ID(6, UNIT_MIN) }, |
| 737 | { "7m ", TALK_ID(7, UNIT_MIN) }, |
| 738 | { "8m ", TALK_ID(8, UNIT_MIN) }, |
| 739 | { "9m ", TALK_ID(9, UNIT_MIN) }, |
| 740 | { "10m", TALK_ID(10, UNIT_MIN) }, |
| 741 | { "15m", TALK_ID(15, UNIT_MIN) }, |
| 742 | { "30m", TALK_ID(30, UNIT_MIN) }, |
| 743 | { "45m", TALK_ID(45, UNIT_MIN) }, |
| 744 | { "60m", TALK_ID(60, UNIT_MIN) } |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 745 | }; |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 746 | return set_option(str(LANG_POWEROFF_IDLE), &global_settings.poweroff, |
Björn Stenberg | 26712d5 | 2003-06-05 11:11:10 +0000 | [diff] [blame] | 747 | INT, names, 15, set_poweroff_timeout); |
Linus Nielsen Feltzing | 083a6db | 2002-09-23 11:42:48 +0000 | [diff] [blame] | 748 | } |
| 749 | |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 750 | static bool scroll_speed(void) |
Robert Hak | 84a6ba2 | 2002-06-24 21:39:48 +0000 | [diff] [blame] | 751 | { |
Jens Arnold | 566eae2 | 2004-10-15 20:30:29 +0000 | [diff] [blame] | 752 | return set_int(str(LANG_SCROLL), "", UNIT_INT, |
| 753 | &global_settings.scroll_speed, |
| 754 | &lcd_scroll_speed, 1, 0, 15 ); |
Robert Hak | 048fa13 | 2002-12-12 17:20:37 +0000 | [diff] [blame] | 755 | } |
| 756 | |
| 757 | |
| 758 | static bool scroll_delay(void) |
| 759 | { |
| 760 | int dummy = global_settings.scroll_delay * (HZ/10); |
Jörg Hohensohn | beec2e9 | 2004-03-20 16:49:58 +0000 | [diff] [blame] | 761 | int rc = set_int(str(LANG_SCROLL_DELAY), "ms", UNIT_MS, |
| 762 | &dummy, |
Robert Hak | 89d8f76 | 2002-12-12 20:34:30 +0000 | [diff] [blame] | 763 | &lcd_scroll_delay, 100, 0, 2500 ); |
Robert Hak | 048fa13 | 2002-12-12 17:20:37 +0000 | [diff] [blame] | 764 | global_settings.scroll_delay = dummy / (HZ/10); |
| 765 | return rc; |
Robert Hak | 84a6ba2 | 2002-06-24 21:39:48 +0000 | [diff] [blame] | 766 | } |
| 767 | |
Björn Stenberg | a2e98c1 | 2002-12-12 15:20:37 +0000 | [diff] [blame] | 768 | #ifdef HAVE_LCD_BITMAP |
| 769 | static bool scroll_step(void) |
| 770 | { |
Jörg Hohensohn | beec2e9 | 2004-03-20 16:49:58 +0000 | [diff] [blame] | 771 | return set_int(str(LANG_SCROLL_STEP_EXAMPLE), "pixels", UNIT_PIXEL, |
Björn Stenberg | a2e98c1 | 2002-12-12 15:20:37 +0000 | [diff] [blame] | 772 | &global_settings.scroll_step, |
| 773 | &lcd_scroll_step, 1, 1, LCD_WIDTH ); |
| 774 | } |
Mats Lidell | c65dadf | 2003-01-14 10:48:01 +0000 | [diff] [blame] | 775 | #endif |
Björn Stenberg | a2e98c1 | 2002-12-12 15:20:37 +0000 | [diff] [blame] | 776 | |
Björn Stenberg | a2e98c1 | 2002-12-12 15:20:37 +0000 | [diff] [blame] | 777 | static bool bidir_limit(void) |
| 778 | { |
Jörg Hohensohn | beec2e9 | 2004-03-20 16:49:58 +0000 | [diff] [blame] | 779 | return set_int(str(LANG_BIDIR_SCROLL), "%", UNIT_PERCENT, |
| 780 | &global_settings.bidir_limit, |
Björn Stenberg | a2e98c1 | 2002-12-12 15:20:37 +0000 | [diff] [blame] | 781 | &lcd_bidir_scroll, 25, 0, 200 ); |
| 782 | } |
Björn Stenberg | a2e98c1 | 2002-12-12 15:20:37 +0000 | [diff] [blame] | 783 | |
Kjell Ericson | 53f156a | 2003-05-22 06:42:14 +0000 | [diff] [blame] | 784 | #ifdef HAVE_LCD_CHARCELLS |
| 785 | static bool jump_scroll(void) |
| 786 | { |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 787 | static const struct opt_items names[] = { |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 788 | { STR(LANG_OFF) }, |
| 789 | { STR(LANG_ONE_TIME) }, |
Jörg Hohensohn | fa97f16 | 2004-03-19 22:15:53 +0000 | [diff] [blame] | 790 | { "2", TALK_ID(2, UNIT_INT) }, |
| 791 | { "3", TALK_ID(3, UNIT_INT) }, |
| 792 | { "4", TALK_ID(4, UNIT_INT) }, |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 793 | { STR(LANG_ALWAYS) } |
| 794 | }; |
Kjell Ericson | 6143eeb | 2003-05-27 12:54:11 +0000 | [diff] [blame] | 795 | bool ret; |
| 796 | ret=set_option(str(LANG_JUMP_SCROLL), &global_settings.jump_scroll, |
Björn Stenberg | 26712d5 | 2003-06-05 11:11:10 +0000 | [diff] [blame] | 797 | INT, names, 6, lcd_jump_scroll); |
Kjell Ericson | 6143eeb | 2003-05-27 12:54:11 +0000 | [diff] [blame] | 798 | return ret; |
| 799 | } |
| 800 | static bool jump_scroll_delay(void) |
| 801 | { |
| 802 | int dummy = global_settings.jump_scroll_delay * (HZ/10); |
Jörg Hohensohn | beec2e9 | 2004-03-20 16:49:58 +0000 | [diff] [blame] | 803 | int rc = set_int(str(LANG_JUMP_SCROLL_DELAY), "ms", UNIT_MS, |
| 804 | &dummy, |
Kjell Ericson | 6143eeb | 2003-05-27 12:54:11 +0000 | [diff] [blame] | 805 | &lcd_jump_scroll_delay, 100, 0, 2500 ); |
| 806 | global_settings.jump_scroll_delay = dummy / (HZ/10); |
| 807 | return rc; |
Kjell Ericson | 53f156a | 2003-05-22 06:42:14 +0000 | [diff] [blame] | 808 | } |
| 809 | #endif |
| 810 | |
Uwe Freese | 0bf70e6 | 2002-12-16 22:58:48 +0000 | [diff] [blame] | 811 | #ifndef SIMULATOR |
Uwe Freese | 4cff030 | 2002-12-15 18:12:00 +0000 | [diff] [blame] | 812 | /** |
| 813 | * Menu to set the battery capacity |
| 814 | */ |
Uwe Freese | 0bf70e6 | 2002-12-16 22:58:48 +0000 | [diff] [blame] | 815 | static bool battery_capacity(void) |
| 816 | { |
Jörg Hohensohn | beec2e9 | 2004-03-20 16:49:58 +0000 | [diff] [blame] | 817 | return set_int(str(LANG_BATTERY_CAPACITY), "mAh", UNIT_MAH, |
| 818 | &global_settings.battery_capacity, |
Jens Arnold | fe32456 | 2004-10-10 10:28:21 +0000 | [diff] [blame] | 819 | &set_battery_capacity, 50, BATTERY_CAPACITY_MIN, |
| 820 | BATTERY_CAPACITY_MAX ); |
Uwe Freese | 4cff030 | 2002-12-15 18:12:00 +0000 | [diff] [blame] | 821 | } |
Jens Arnold | 91846a1 | 2005-01-30 16:25:46 +0000 | [diff] [blame] | 822 | |
| 823 | #if BATTERY_TYPES_COUNT > 1 |
| 824 | static bool battery_type(void) |
| 825 | { |
| 826 | static const struct opt_items names[] = { |
| 827 | { STR(LANG_BATTERY_TYPE_ALKALINE) }, |
| 828 | { STR(LANG_BATTERY_TYPE_NIMH) } |
| 829 | }; |
| 830 | |
| 831 | return set_option(str(LANG_BATTERY_TYPE), &global_settings.battery_type, |
| 832 | INT, names, 2, set_battery_type); |
| 833 | } |
| 834 | #endif |
Uwe Freese | 0bf70e6 | 2002-12-16 22:58:48 +0000 | [diff] [blame] | 835 | #endif |
Uwe Freese | 4cff030 | 2002-12-15 18:12:00 +0000 | [diff] [blame] | 836 | |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 837 | #ifdef HAVE_RTC |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 838 | static bool timedate_set(void) |
Markus Braun | 3181f68 | 2002-08-09 12:38:45 +0000 | [diff] [blame] | 839 | { |
Linus Nielsen Feltzing | 7ddf0d6 | 2004-04-20 10:23:57 +0000 | [diff] [blame] | 840 | struct tm tm; |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 841 | bool result; |
Markus Braun | 3181f68 | 2002-08-09 12:38:45 +0000 | [diff] [blame] | 842 | |
Linus Nielsen Feltzing | 7ddf0d6 | 2004-04-20 10:23:57 +0000 | [diff] [blame] | 843 | /* Make a local copy of the time struct */ |
| 844 | memcpy(&tm, get_time(), sizeof(struct tm)); |
Markus Braun | 44ee2ab | 2003-05-27 14:28:08 +0000 | [diff] [blame] | 845 | |
| 846 | /* do some range checks */ |
| 847 | /* This prevents problems with time/date setting after a power loss */ |
Linus Nielsen Feltzing | 7ddf0d6 | 2004-04-20 10:23:57 +0000 | [diff] [blame] | 848 | if (!valid_time(&tm)) |
Markus Braun | 44ee2ab | 2003-05-27 14:28:08 +0000 | [diff] [blame] | 849 | { |
| 850 | /* hour */ |
Linus Nielsen Feltzing | 7ddf0d6 | 2004-04-20 10:23:57 +0000 | [diff] [blame] | 851 | tm.tm_hour = 0; |
| 852 | tm.tm_min = 0; |
| 853 | tm.tm_sec = 0; |
| 854 | tm.tm_mday = 1; |
| 855 | tm.tm_mon = 0; |
| 856 | tm.tm_wday = 1; |
| 857 | tm.tm_year = 100; |
Markus Braun | 44ee2ab | 2003-05-27 14:28:08 +0000 | [diff] [blame] | 858 | } |
Markus Braun | 3181f68 | 2002-08-09 12:38:45 +0000 | [diff] [blame] | 859 | |
Linus Nielsen Feltzing | 7ddf0d6 | 2004-04-20 10:23:57 +0000 | [diff] [blame] | 860 | result = set_time_screen(str(LANG_TIME), &tm); |
Markus Braun | 3181f68 | 2002-08-09 12:38:45 +0000 | [diff] [blame] | 861 | |
Linus Nielsen Feltzing | 7ddf0d6 | 2004-04-20 10:23:57 +0000 | [diff] [blame] | 862 | if(tm.tm_year != -1) { |
| 863 | set_time(&tm); |
Markus Braun | 3181f68 | 2002-08-09 12:38:45 +0000 | [diff] [blame] | 864 | } |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 865 | return result; |
Markus Braun | 3181f68 | 2002-08-09 12:38:45 +0000 | [diff] [blame] | 866 | } |
Markus Braun | 22a7a2d | 2002-10-14 12:50:20 +0000 | [diff] [blame] | 867 | |
| 868 | static bool timeformat_set(void) |
| 869 | { |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 870 | static const struct opt_items names[] = { |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 871 | { STR(LANG_24_HOUR_CLOCK) }, |
| 872 | { STR(LANG_12_HOUR_CLOCK) } |
| 873 | }; |
Björn Stenberg | 26712d5 | 2003-06-05 11:11:10 +0000 | [diff] [blame] | 874 | return set_option(str(LANG_TIMEFORMAT), &global_settings.timeformat, |
| 875 | INT, names, 2, NULL); |
Markus Braun | 22a7a2d | 2002-10-14 12:50:20 +0000 | [diff] [blame] | 876 | } |
Markus Braun | 3181f68 | 2002-08-09 12:38:45 +0000 | [diff] [blame] | 877 | #endif |
| 878 | |
Jens Arnold | dd937dc | 2004-10-09 22:04:47 +0000 | [diff] [blame] | 879 | #ifndef HAVE_MMC |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 880 | static bool spindown(void) |
Björn Stenberg | 457b8a0 | 2002-08-26 13:21:14 +0000 | [diff] [blame] | 881 | { |
Jörg Hohensohn | beec2e9 | 2004-03-20 16:49:58 +0000 | [diff] [blame] | 882 | return set_int(str(LANG_SPINDOWN), "s", UNIT_SEC, |
| 883 | &global_settings.disk_spindown, |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 884 | ata_spindown, 1, 3, 254 ); |
Björn Stenberg | 0570497 | 2002-08-14 19:23:34 +0000 | [diff] [blame] | 885 | } |
| 886 | |
Daniel Stenberg | 39c5474 | 2002-11-29 07:05:46 +0000 | [diff] [blame] | 887 | #ifdef HAVE_ATA_POWER_OFF |
Björn Stenberg | 2b77b4f | 2002-11-28 22:46:19 +0000 | [diff] [blame] | 888 | static bool poweroff(void) |
| 889 | { |
| 890 | bool rc = set_bool(str(LANG_POWEROFF), &global_settings.disk_poweroff); |
| 891 | ata_poweroff(global_settings.disk_poweroff); |
| 892 | return rc; |
| 893 | } |
Jens Arnold | dd937dc | 2004-10-09 22:04:47 +0000 | [diff] [blame] | 894 | #endif /* HAVE_ATA_POWEROFF */ |
| 895 | #endif /* !HAVE_MMC */ |
| 896 | |
| 897 | #if CONFIG_HWCODEC == MAS3507D |
| 898 | static bool line_in(void) |
| 899 | { |
| 900 | bool rc = set_bool(str(LANG_LINE_IN), &global_settings.line_in); |
| 901 | dac_line_in(global_settings.line_in); |
| 902 | return rc; |
| 903 | } |
Daniel Stenberg | 39c5474 | 2002-11-29 07:05:46 +0000 | [diff] [blame] | 904 | #endif |
Björn Stenberg | 2b77b4f | 2002-11-28 22:46:19 +0000 | [diff] [blame] | 905 | |
Linus Nielsen Feltzing | 20d031f | 2003-05-09 16:01:21 +0000 | [diff] [blame] | 906 | static bool max_files_in_dir(void) |
| 907 | { |
Jörg Hohensohn | beec2e9 | 2004-03-20 16:49:58 +0000 | [diff] [blame] | 908 | return set_int(str(LANG_MAX_FILES_IN_DIR), "", UNIT_INT, |
Linus Nielsen Feltzing | 20d031f | 2003-05-09 16:01:21 +0000 | [diff] [blame] | 909 | &global_settings.max_files_in_dir, |
| 910 | NULL, 50, 50, 10000 ); |
| 911 | } |
| 912 | |
| 913 | static bool max_files_in_playlist(void) |
| 914 | { |
Jörg Hohensohn | beec2e9 | 2004-03-20 16:49:58 +0000 | [diff] [blame] | 915 | return set_int(str(LANG_MAX_FILES_IN_PLAYLIST), "", UNIT_INT, |
Linus Nielsen Feltzing | 20d031f | 2003-05-09 16:01:21 +0000 | [diff] [blame] | 916 | &global_settings.max_files_in_playlist, |
Linus Nielsen Feltzing | 2ce9ba5 | 2003-05-09 21:59:04 +0000 | [diff] [blame] | 917 | NULL, 1000, 1000, 20000 ); |
Linus Nielsen Feltzing | 20d031f | 2003-05-09 16:01:21 +0000 | [diff] [blame] | 918 | } |
| 919 | |
Linus Nielsen Feltzing | b8ff5f8 | 2002-12-05 13:09:51 +0000 | [diff] [blame] | 920 | static bool buffer_margin(void) |
| 921 | { |
Jörg Hohensohn | beec2e9 | 2004-03-20 16:49:58 +0000 | [diff] [blame] | 922 | return set_int(str(LANG_MP3BUFFER_MARGIN), "s", UNIT_SEC, |
Linus Nielsen Feltzing | b8ff5f8 | 2002-12-05 13:09:51 +0000 | [diff] [blame] | 923 | &global_settings.buffer_margin, |
Linus Nielsen Feltzing | 8a237a8 | 2005-04-04 12:06:29 +0000 | [diff] [blame] | 924 | audio_set_buffer_margin, 1, 0, 7 ); |
Linus Nielsen Feltzing | b8ff5f8 | 2002-12-05 13:09:51 +0000 | [diff] [blame] | 925 | } |
| 926 | |
Linus Nielsen Feltzing | 20d031f | 2003-05-09 16:01:21 +0000 | [diff] [blame] | 927 | static bool ff_rewind_min_step(void) |
Eric Linenberg | 7eb2711 | 2002-09-04 03:38:37 +0000 | [diff] [blame] | 928 | { |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 929 | static const struct opt_items names[] = { |
Jörg Hohensohn | fa97f16 | 2004-03-19 22:15:53 +0000 | [diff] [blame] | 930 | { "1s", TALK_ID(1, UNIT_SEC) }, |
| 931 | { "2s", TALK_ID(2, UNIT_SEC) }, |
| 932 | { "3s", TALK_ID(3, UNIT_SEC) }, |
| 933 | { "4s", TALK_ID(4, UNIT_SEC) }, |
| 934 | { "5s", TALK_ID(5, UNIT_SEC) }, |
| 935 | { "6s", TALK_ID(6, UNIT_SEC) }, |
| 936 | { "8s", TALK_ID(8, UNIT_SEC) }, |
| 937 | { "10s", TALK_ID(10, UNIT_SEC) }, |
| 938 | { "15s", TALK_ID(15, UNIT_SEC) }, |
| 939 | { "20s", TALK_ID(20, UNIT_SEC) }, |
| 940 | { "25s", TALK_ID(25, UNIT_SEC) }, |
| 941 | { "30s", TALK_ID(30, UNIT_SEC) }, |
| 942 | { "45s", TALK_ID(45, UNIT_SEC) }, |
| 943 | { "60s", TALK_ID(60, UNIT_SEC) } |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 944 | }; |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 945 | return set_option(str(LANG_FFRW_STEP), &global_settings.ff_rewind_min_step, |
Björn Stenberg | 26712d5 | 2003-06-05 11:11:10 +0000 | [diff] [blame] | 946 | INT, names, 14, NULL ); |
Eric Linenberg | 7eb2711 | 2002-09-04 03:38:37 +0000 | [diff] [blame] | 947 | } |
| 948 | |
Björn Stenberg | e2628d9 | 2003-02-14 15:54:52 +0000 | [diff] [blame] | 949 | static bool set_fade_on_stop(void) |
| 950 | { |
| 951 | return set_bool( str(LANG_FADE_ON_STOP), &global_settings.fade_on_stop ); |
| 952 | } |
| 953 | |
| 954 | |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 955 | static bool ff_rewind_accel(void) |
Justin Heiner | 8097ee6 | 2002-08-29 05:41:35 +0000 | [diff] [blame] | 956 | { |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 957 | static const struct opt_items names[] = { |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 958 | { STR(LANG_OFF) }, |
Jörg Hohensohn | fa97f16 | 2004-03-19 22:15:53 +0000 | [diff] [blame] | 959 | { "2x/1s", TALK_ID(1, UNIT_SEC) }, |
| 960 | { "2x/2s", TALK_ID(2, UNIT_SEC) }, |
| 961 | { "2x/3s", TALK_ID(3, UNIT_SEC) }, |
| 962 | { "2x/4s", TALK_ID(4, UNIT_SEC) }, |
| 963 | { "2x/5s", TALK_ID(5, UNIT_SEC) }, |
| 964 | { "2x/6s", TALK_ID(6, UNIT_SEC) }, |
| 965 | { "2x/7s", TALK_ID(7, UNIT_SEC) }, |
| 966 | { "2x/8s", TALK_ID(8, UNIT_SEC) }, |
| 967 | { "2x/9s", TALK_ID(9, UNIT_SEC) }, |
| 968 | { "2x/10s", TALK_ID(10, UNIT_SEC) }, |
| 969 | { "2x/11s", TALK_ID(11, UNIT_SEC) }, |
| 970 | { "2x/12s", TALK_ID(12, UNIT_SEC) }, |
| 971 | { "2x/13s", TALK_ID(13, UNIT_SEC) }, |
| 972 | { "2x/14s", TALK_ID(14, UNIT_SEC) }, |
| 973 | { "2x/15s", TALK_ID(15, UNIT_SEC) } |
Jörg Hohensohn | 42ffbf9 | 2004-03-15 08:27:51 +0000 | [diff] [blame] | 974 | }; |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 975 | return set_option(str(LANG_FFRW_ACCEL), &global_settings.ff_rewind_accel, |
Björn Stenberg | 26712d5 | 2003-06-05 11:11:10 +0000 | [diff] [blame] | 976 | INT, names, 16, NULL ); |
Justin Heiner | 8097ee6 | 2002-08-29 05:41:35 +0000 | [diff] [blame] | 977 | } |
Eric Linenberg | 6524076 | 2002-08-28 19:34:07 +0000 | [diff] [blame] | 978 | |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 979 | static bool browse_current(void) |
Eric Linenberg | ecca123 | 2002-09-09 14:25:39 +0000 | [diff] [blame] | 980 | { |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 981 | return set_bool( str(LANG_FOLLOW), &global_settings.browse_current ); |
Eric Linenberg | ecca123 | 2002-09-09 14:25:39 +0000 | [diff] [blame] | 982 | } |
| 983 | |
Björn Stenberg | de5477c | 2003-09-29 21:26:53 +0000 | [diff] [blame] | 984 | static bool custom_wps_browse(void) |
| 985 | { |
| 986 | return rockbox_browse(ROCKBOX_DIR, SHOW_WPS); |
| 987 | } |
| 988 | |
| 989 | static bool custom_cfg_browse(void) |
| 990 | { |
| 991 | return rockbox_browse(ROCKBOX_DIR, SHOW_CFG); |
| 992 | } |
| 993 | |
| 994 | static bool language_browse(void) |
| 995 | { |
Jens Arnold | 3badc7d | 2005-01-17 23:55:55 +0000 | [diff] [blame] | 996 | return rockbox_browse(ROCKBOX_DIR LANG_DIR, SHOW_LNG); |
Björn Stenberg | de5477c | 2003-09-29 21:26:53 +0000 | [diff] [blame] | 997 | } |
| 998 | |
Jörg Hohensohn | 3aa99e1 | 2004-03-27 00:11:01 +0000 | [diff] [blame] | 999 | static bool voice_menus(void) |
| 1000 | { |
| 1001 | bool ret; |
| 1002 | bool temp = global_settings.talk_menu; |
| 1003 | /* work on a temp variable first, avoid "life" disabling */ |
| 1004 | ret = set_bool( str(LANG_VOICE_MENU), &temp ); |
| 1005 | global_settings.talk_menu = temp; |
| 1006 | return ret; |
| 1007 | } |
| 1008 | |
Jörg Hohensohn | d484420 | 2004-10-06 21:37:46 +0000 | [diff] [blame] | 1009 | /* this is used 2 times below, so it saves memory to put it in global scope */ |
| 1010 | static const struct opt_items voice_names[] = { |
| 1011 | { STR(LANG_OFF) }, |
| 1012 | { STR(LANG_VOICE_NUMBER) }, |
| 1013 | { STR(LANG_VOICE_SPELL) }, |
| 1014 | { STR(LANG_VOICE_DIR_HOVER) } |
| 1015 | }; |
| 1016 | |
Jörg Hohensohn | 3aa99e1 | 2004-03-27 00:11:01 +0000 | [diff] [blame] | 1017 | static bool voice_dirs(void) |
| 1018 | { |
Jörg Hohensohn | 3aa99e1 | 2004-03-27 00:11:01 +0000 | [diff] [blame] | 1019 | return set_option( str(LANG_VOICE_DIR), |
Jörg Hohensohn | d484420 | 2004-10-06 21:37:46 +0000 | [diff] [blame] | 1020 | &global_settings.talk_dir, INT, voice_names, 4, NULL); |
Jörg Hohensohn | 3aa99e1 | 2004-03-27 00:11:01 +0000 | [diff] [blame] | 1021 | } |
| 1022 | |
| 1023 | static bool voice_files(void) |
| 1024 | { |
Jörg Hohensohn | 40ae63b | 2004-10-21 18:34:48 +0000 | [diff] [blame] | 1025 | int oldval = global_settings.talk_file; |
| 1026 | bool ret; |
| 1027 | ret = set_option( str(LANG_VOICE_FILE), |
Jörg Hohensohn | d484420 | 2004-10-06 21:37:46 +0000 | [diff] [blame] | 1028 | &global_settings.talk_file, INT, voice_names, 4, NULL); |
Jörg Hohensohn | 40ae63b | 2004-10-21 18:34:48 +0000 | [diff] [blame] | 1029 | if (oldval != 3 && global_settings.talk_file == 3) |
| 1030 | { /* force reload if newly talking thumbnails, |
| 1031 | because the clip presence is cached only if enabled */ |
| 1032 | reload_directory(); |
| 1033 | } |
| 1034 | return ret; |
Jörg Hohensohn | 3aa99e1 | 2004-03-27 00:11:01 +0000 | [diff] [blame] | 1035 | } |
| 1036 | |
| 1037 | static bool voice_menu(void) |
| 1038 | { |
| 1039 | int m; |
| 1040 | bool result; |
| 1041 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1042 | static const struct menu_item items[] = { |
| 1043 | { ID2P(LANG_VOICE_MENU), voice_menus }, |
| 1044 | { ID2P(LANG_VOICE_DIR), voice_dirs }, |
| 1045 | { ID2P(LANG_VOICE_FILE), voice_files } |
Jörg Hohensohn | 3aa99e1 | 2004-03-27 00:11:01 +0000 | [diff] [blame] | 1046 | }; |
| 1047 | |
| 1048 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1049 | NULL, NULL, NULL); |
| 1050 | result = menu_run(m); |
| 1051 | menu_exit(m); |
| 1052 | return result; |
| 1053 | } |
| 1054 | |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1055 | #ifdef HAVE_LCD_BITMAP |
Björn Stenberg | de5477c | 2003-09-29 21:26:53 +0000 | [diff] [blame] | 1056 | static bool font_browse(void) |
| 1057 | { |
Daniel Stenberg | 0f68958 | 2004-01-08 12:40:25 +0000 | [diff] [blame] | 1058 | return rockbox_browse(ROCKBOX_DIR FONT_DIR, SHOW_FONT); |
Björn Stenberg | de5477c | 2003-09-29 21:26:53 +0000 | [diff] [blame] | 1059 | } |
Björn Stenberg | de5477c | 2003-09-29 21:26:53 +0000 | [diff] [blame] | 1060 | |
Jörg Hohensohn | 459abc2 | 2003-04-21 12:39:36 +0000 | [diff] [blame] | 1061 | static bool scroll_bar(void) |
| 1062 | { |
| 1063 | return set_bool( str(LANG_SCROLL_BAR), &global_settings.scrollbar ); |
| 1064 | } |
| 1065 | |
| 1066 | static bool status_bar(void) |
| 1067 | { |
| 1068 | return set_bool( str(LANG_STATUS_BAR), &global_settings.statusbar ); |
| 1069 | } |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1070 | |
Jens Arnold | 1f0908d | 2004-10-09 20:54:15 +0000 | [diff] [blame] | 1071 | #if CONFIG_KEYPAD == RECORDER_PAD |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1072 | static bool button_bar(void) |
| 1073 | { |
| 1074 | return set_bool( str(LANG_BUTTON_BAR), &global_settings.buttonbar ); |
| 1075 | } |
Jens Arnold | 1f0908d | 2004-10-09 20:54:15 +0000 | [diff] [blame] | 1076 | #endif /* CONFIG_KEYPAD == RECORDER_PAD */ |
| 1077 | #endif /* HAVE_LCD_BITMAP */ |
Jörg Hohensohn | 459abc2 | 2003-04-21 12:39:36 +0000 | [diff] [blame] | 1078 | |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1079 | static bool ff_rewind_settings_menu(void) |
| 1080 | { |
| 1081 | int m; |
| 1082 | bool result; |
| 1083 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1084 | static const struct menu_item items[] = { |
| 1085 | { ID2P(LANG_FFRW_STEP), ff_rewind_min_step }, |
| 1086 | { ID2P(LANG_FFRW_ACCEL), ff_rewind_accel }, |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1087 | }; |
| 1088 | |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1089 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1090 | NULL, NULL, NULL); |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1091 | result = menu_run(m); |
| 1092 | menu_exit(m); |
| 1093 | |
| 1094 | return result; |
| 1095 | } |
| 1096 | |
Linus Nielsen Feltzing | 4cdcbb9 | 2004-07-27 19:20:51 +0000 | [diff] [blame] | 1097 | static bool id3_order(void) |
| 1098 | { |
| 1099 | return set_bool_options( str(LANG_ID3_ORDER), |
| 1100 | &global_settings.id3_v1_first, |
| 1101 | STR(LANG_ID3_V1_FIRST), |
| 1102 | STR(LANG_ID3_V2_FIRST), |
| 1103 | mpeg_id3_options); |
| 1104 | } |
| 1105 | |
Linus Nielsen Feltzing | 6271b2b | 2005-06-09 09:47:00 +0000 | [diff] [blame] | 1106 | #if CONFIG_HWCODEC == MASNONE |
| 1107 | static bool crossfade(void) |
| 1108 | { |
| 1109 | bool rc = set_bool( str(LANG_CROSSFADE), &global_settings.crossfade ); |
| 1110 | #ifndef SIMULATOR |
Miika Pekkarinen | 20b3897 | 2005-07-13 12:48:22 +0000 | [diff] [blame^] | 1111 | pcmbuf_crossfade_enable(global_settings.crossfade); |
Linus Nielsen Feltzing | 6271b2b | 2005-06-09 09:47:00 +0000 | [diff] [blame] | 1112 | #endif |
| 1113 | return rc; |
| 1114 | } |
| 1115 | #endif |
| 1116 | |
Hardeep Sidhu | 71d2281 | 2005-07-01 11:25:16 +0000 | [diff] [blame] | 1117 | static bool next_folder(void) |
| 1118 | { |
| 1119 | return set_bool( str(LANG_NEXT_FOLDER), &global_settings.next_folder ); |
| 1120 | } |
| 1121 | |
Jens Arnold | 8102f3d | 2005-07-02 10:50:42 +0000 | [diff] [blame] | 1122 | static bool runtimedb(void) |
| 1123 | { |
| 1124 | bool rc; |
| 1125 | bool old = global_settings.runtimedb; |
| 1126 | |
| 1127 | rc = set_bool_options( str(LANG_RUNTIMEDB_ACTIVE), |
| 1128 | &global_settings.runtimedb, |
| 1129 | STR(LANG_SET_BOOL_YES), |
| 1130 | STR(LANG_SET_BOOL_NO), |
| 1131 | NULL); |
| 1132 | if (old && !global_settings.runtimedb) |
| 1133 | rundb_shutdown(); |
| 1134 | if (!old && global_settings.runtimedb) |
| 1135 | rundb_init(); |
| 1136 | |
| 1137 | return rc; |
| 1138 | } |
| 1139 | |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 1140 | static bool playback_settings_menu(void) |
Eric Linenberg | c5b645b | 2002-09-05 04:42:12 +0000 | [diff] [blame] | 1141 | { |
| 1142 | int m; |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 1143 | bool result; |
Eric Linenberg | c5b645b | 2002-09-05 04:42:12 +0000 | [diff] [blame] | 1144 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1145 | static const struct menu_item items[] = { |
| 1146 | { ID2P(LANG_SHUFFLE), shuffle }, |
| 1147 | { ID2P(LANG_REPEAT), repeat_mode }, |
| 1148 | { ID2P(LANG_PLAY_SELECTED), play_selected }, |
| 1149 | { ID2P(LANG_RESUME), resume }, |
| 1150 | { ID2P(LANG_WIND_MENU), ff_rewind_settings_menu }, |
| 1151 | { ID2P(LANG_MP3BUFFER_MARGIN), buffer_margin }, |
| 1152 | { ID2P(LANG_FADE_ON_STOP), set_fade_on_stop }, |
Linus Nielsen Feltzing | 6271b2b | 2005-06-09 09:47:00 +0000 | [diff] [blame] | 1153 | #if CONFIG_HWCODEC == MASNONE |
| 1154 | { ID2P(LANG_CROSSFADE), crossfade }, |
| 1155 | #endif |
Linus Nielsen Feltzing | 8782bc8 | 2005-07-01 09:42:39 +0000 | [diff] [blame] | 1156 | #ifdef HAVE_SPDIF_POWER |
| 1157 | { ID2P(LANG_SPDIF_ENABLE), spdif }, |
| 1158 | #endif |
Linus Nielsen Feltzing | 4cdcbb9 | 2004-07-27 19:20:51 +0000 | [diff] [blame] | 1159 | { ID2P(LANG_ID3_ORDER), id3_order }, |
Hardeep Sidhu | 71d2281 | 2005-07-01 11:25:16 +0000 | [diff] [blame] | 1160 | { ID2P(LANG_NEXT_FOLDER), next_folder }, |
Jens Arnold | 8102f3d | 2005-07-02 10:50:42 +0000 | [diff] [blame] | 1161 | { ID2P(LANG_RUNTIMEDB_ACTIVE), runtimedb }, |
Robert Hak | 84a6ba2 | 2002-06-24 21:39:48 +0000 | [diff] [blame] | 1162 | }; |
Björn Stenberg | 505eca7 | 2002-09-18 14:08:05 +0000 | [diff] [blame] | 1163 | |
Daniel Stenberg | 360ae3e | 2002-08-02 13:20:03 +0000 | [diff] [blame] | 1164 | bool old_shuffle = global_settings.playlist_shuffle; |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1165 | |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1166 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1167 | NULL, NULL, NULL); |
Daniel Stenberg | b285076 | 2002-08-23 12:32:52 +0000 | [diff] [blame] | 1168 | result = menu_run(m); |
Robert Hak | 84a6ba2 | 2002-06-24 21:39:48 +0000 | [diff] [blame] | 1169 | menu_exit(m); |
Daniel Stenberg | 360ae3e | 2002-08-02 13:20:03 +0000 | [diff] [blame] | 1170 | |
Jens Arnold | d6587f9 | 2005-05-01 19:13:47 +0000 | [diff] [blame] | 1171 | if ((old_shuffle != global_settings.playlist_shuffle) |
| 1172 | && (audio_status() & AUDIO_STATUS_PLAY)) |
Daniel Stenberg | 360ae3e | 2002-08-02 13:20:03 +0000 | [diff] [blame] | 1173 | { |
| 1174 | if (global_settings.playlist_shuffle) |
| 1175 | { |
Hardeep Sidhu | 107ebc5 | 2004-01-26 17:05:21 +0000 | [diff] [blame] | 1176 | playlist_randomise(NULL, current_tick, true); |
Daniel Stenberg | 360ae3e | 2002-08-02 13:20:03 +0000 | [diff] [blame] | 1177 | } |
| 1178 | else |
| 1179 | { |
Hardeep Sidhu | 107ebc5 | 2004-01-26 17:05:21 +0000 | [diff] [blame] | 1180 | playlist_sort(NULL, true); |
Daniel Stenberg | 360ae3e | 2002-08-02 13:20:03 +0000 | [diff] [blame] | 1181 | } |
| 1182 | } |
Daniel Stenberg | b285076 | 2002-08-23 12:32:52 +0000 | [diff] [blame] | 1183 | return result; |
Robert Hak | 84a6ba2 | 2002-06-24 21:39:48 +0000 | [diff] [blame] | 1184 | } |
Eric Linenberg | c5b645b | 2002-09-05 04:42:12 +0000 | [diff] [blame] | 1185 | |
Björn Stenberg | a108ec2 | 2004-01-14 00:13:04 +0000 | [diff] [blame] | 1186 | static bool bookmark_settings_menu(void) |
| 1187 | { |
| 1188 | int m; |
| 1189 | bool result; |
| 1190 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1191 | static const struct menu_item items[] = { |
| 1192 | { ID2P(LANG_BOOKMARK_SETTINGS_AUTOCREATE), autocreatebookmark}, |
| 1193 | { ID2P(LANG_BOOKMARK_SETTINGS_AUTOLOAD), autoloadbookmark}, |
| 1194 | { ID2P(LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS), useMRB}, |
Björn Stenberg | a108ec2 | 2004-01-14 00:13:04 +0000 | [diff] [blame] | 1195 | }; |
| 1196 | |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1197 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1198 | NULL, NULL, NULL); |
Björn Stenberg | a108ec2 | 2004-01-14 00:13:04 +0000 | [diff] [blame] | 1199 | result = menu_run(m); |
| 1200 | menu_exit(m); |
| 1201 | |
| 1202 | return result; |
| 1203 | } |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 1204 | static bool reset_settings(void) |
Justin Heiner | 2f9b54b | 2002-09-06 07:00:20 +0000 | [diff] [blame] | 1205 | { |
Robert Hak | ea8a4cf | 2002-10-14 09:12:52 +0000 | [diff] [blame] | 1206 | bool done=false; |
| 1207 | int line; |
Linus Nielsen Feltzing | ade5d7b | 2004-07-26 16:06:59 +0000 | [diff] [blame] | 1208 | int button; |
Robert Hak | ea8a4cf | 2002-10-14 09:12:52 +0000 | [diff] [blame] | 1209 | |
| 1210 | lcd_clear_display(); |
| 1211 | |
| 1212 | #ifdef HAVE_LCD_CHARCELLS |
| 1213 | line = 0; |
| 1214 | #else |
| 1215 | line = 1; |
| 1216 | lcd_puts(0,0,str(LANG_RESET_ASK_RECORDER)); |
| 1217 | #endif |
| 1218 | lcd_puts(0,line,str(LANG_RESET_CONFIRM)); |
| 1219 | lcd_puts(0,line+1,str(LANG_RESET_CANCEL)); |
| 1220 | |
| 1221 | lcd_update(); |
Robert Hak | ea8a4cf | 2002-10-14 09:12:52 +0000 | [diff] [blame] | 1222 | |
| 1223 | while(!done) { |
Linus Nielsen Feltzing | ade5d7b | 2004-07-26 16:06:59 +0000 | [diff] [blame] | 1224 | button = button_get(true); |
| 1225 | switch(button) { |
Björn Stenberg | 6c33c51 | 2004-09-19 21:58:37 +0000 | [diff] [blame] | 1226 | case SETTINGS_OK: |
| 1227 | settings_reset(); |
| 1228 | settings_apply(); |
| 1229 | lcd_clear_display(); |
| 1230 | lcd_puts(0,1,str(LANG_RESET_DONE_CLEAR)); |
| 1231 | done = true; |
| 1232 | break; |
Robert Hak | ea8a4cf | 2002-10-14 09:12:52 +0000 | [diff] [blame] | 1233 | |
Björn Stenberg | 6c33c51 | 2004-09-19 21:58:37 +0000 | [diff] [blame] | 1234 | case SETTINGS_CANCEL: |
| 1235 | lcd_clear_display(); |
| 1236 | lcd_puts(0,1,str(LANG_RESET_DONE_CANCEL)); |
| 1237 | done = true; |
| 1238 | break; |
Robert Hak | ea8a4cf | 2002-10-14 09:12:52 +0000 | [diff] [blame] | 1239 | |
Björn Stenberg | 6c33c51 | 2004-09-19 21:58:37 +0000 | [diff] [blame] | 1240 | default: |
| 1241 | if(default_event_handler(button) == SYS_USB_CONNECTED) |
| 1242 | return true; |
Robert Hak | ea8a4cf | 2002-10-14 09:12:52 +0000 | [diff] [blame] | 1243 | } |
Justin Heiner | 2f9b54b | 2002-09-06 07:00:20 +0000 | [diff] [blame] | 1244 | } |
Robert Hak | ea8a4cf | 2002-10-14 09:12:52 +0000 | [diff] [blame] | 1245 | |
| 1246 | lcd_puts(0,0,str(LANG_RESET_DONE_SETTING)); |
| 1247 | lcd_update(); |
| 1248 | sleep(HZ); |
| 1249 | return false; |
Justin Heiner | 2f9b54b | 2002-09-06 07:00:20 +0000 | [diff] [blame] | 1250 | } |
| 1251 | |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 1252 | static bool fileview_settings_menu(void) |
Eric Linenberg | c5b645b | 2002-09-05 04:42:12 +0000 | [diff] [blame] | 1253 | { |
| 1254 | int m; |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 1255 | bool result; |
Eric Linenberg | c5b645b | 2002-09-05 04:42:12 +0000 | [diff] [blame] | 1256 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1257 | static const struct menu_item items[] = { |
| 1258 | { ID2P(LANG_SORT_CASE), sort_case }, |
| 1259 | { ID2P(LANG_SORT_DIR), sort_dir }, |
| 1260 | { ID2P(LANG_SORT_FILE), sort_file }, |
| 1261 | { ID2P(LANG_FILTER), dir_filter }, |
| 1262 | { ID2P(LANG_FOLLOW), browse_current }, |
| 1263 | { ID2P(LANG_SHOW_ICONS), show_icons }, |
Eric Linenberg | c5b645b | 2002-09-05 04:42:12 +0000 | [diff] [blame] | 1264 | }; |
| 1265 | |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1266 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1267 | NULL, NULL, NULL); |
Eric Linenberg | c5b645b | 2002-09-05 04:42:12 +0000 | [diff] [blame] | 1268 | result = menu_run(m); |
| 1269 | menu_exit(m); |
| 1270 | return result; |
| 1271 | } |
| 1272 | |
Robert Hak | 65002e8 | 2002-12-12 16:56:19 +0000 | [diff] [blame] | 1273 | |
| 1274 | static bool scroll_settings_menu(void) |
| 1275 | { |
| 1276 | int m; |
| 1277 | bool result; |
| 1278 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1279 | static const struct menu_item items[] = { |
| 1280 | { ID2P(LANG_SCROLL_SPEED), scroll_speed }, |
| 1281 | { ID2P(LANG_SCROLL_DELAY), scroll_delay }, |
Robert Hak | 65002e8 | 2002-12-12 16:56:19 +0000 | [diff] [blame] | 1282 | #ifdef HAVE_LCD_BITMAP |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1283 | { ID2P(LANG_SCROLL_STEP), scroll_step }, |
Robert Hak | 65002e8 | 2002-12-12 16:56:19 +0000 | [diff] [blame] | 1284 | #endif |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1285 | { ID2P(LANG_BIDIR_SCROLL), bidir_limit }, |
Kjell Ericson | 53f156a | 2003-05-22 06:42:14 +0000 | [diff] [blame] | 1286 | #ifdef HAVE_LCD_CHARCELLS |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1287 | { ID2P(LANG_JUMP_SCROLL), jump_scroll }, |
| 1288 | { ID2P(LANG_JUMP_SCROLL_DELAY), jump_scroll_delay }, |
Kjell Ericson | 53f156a | 2003-05-22 06:42:14 +0000 | [diff] [blame] | 1289 | #endif |
Robert Hak | 65002e8 | 2002-12-12 16:56:19 +0000 | [diff] [blame] | 1290 | }; |
| 1291 | |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1292 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1293 | NULL, NULL, NULL); |
Robert Hak | 65002e8 | 2002-12-12 16:56:19 +0000 | [diff] [blame] | 1294 | result = menu_run(m); |
| 1295 | menu_exit(m); |
| 1296 | return result; |
| 1297 | } |
| 1298 | |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1299 | static bool lcd_settings_menu(void) |
| 1300 | { |
| 1301 | int m; |
| 1302 | bool result; |
| 1303 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1304 | static const struct menu_item items[] = { |
Jörg Hohensohn | fee8617 | 2004-12-18 10:29:47 +0000 | [diff] [blame] | 1305 | #ifdef CONFIG_BACKLIGHT |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1306 | { ID2P(LANG_BACKLIGHT), backlight_timer }, |
Jörg Hohensohn | fee8617 | 2004-12-18 10:29:47 +0000 | [diff] [blame] | 1307 | #ifdef HAVE_CHARGING |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1308 | { ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_on_when_charging }, |
Jens Arnold | a1a08d0 | 2004-10-09 19:56:27 +0000 | [diff] [blame] | 1309 | #endif |
Jörg Hohensohn | fee8617 | 2004-12-18 10:29:47 +0000 | [diff] [blame] | 1310 | { ID2P(LANG_CAPTION_BACKLIGHT), caption_backlight }, |
Jens Arnold | 61b9d34 | 2005-06-20 17:03:09 +0000 | [diff] [blame] | 1311 | #if CONFIG_BACKLIGHT == BL_IRIVER |
| 1312 | { ID2P(LANG_BACKLIGHT_FADE_IN), backlight_fade_in }, |
| 1313 | { ID2P(LANG_BACKLIGHT_FADE_OUT), backlight_fade_out }, |
| 1314 | #endif |
Jörg Hohensohn | fee8617 | 2004-12-18 10:29:47 +0000 | [diff] [blame] | 1315 | #endif /* CONFIG_BACKLIGHT */ |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1316 | { ID2P(LANG_CONTRAST), contrast }, |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1317 | #ifdef HAVE_LCD_BITMAP |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1318 | { ID2P(LANG_INVERT), invert }, |
| 1319 | { ID2P(LANG_FLIP_DISPLAY), flip_display }, |
| 1320 | { ID2P(LANG_INVERT_CURSOR), invert_cursor }, |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1321 | #endif |
| 1322 | }; |
| 1323 | |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1324 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1325 | NULL, NULL, NULL); |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1326 | result = menu_run(m); |
| 1327 | menu_exit(m); |
| 1328 | return result; |
| 1329 | } |
| 1330 | |
Christian Gmeiner | 7c1879b | 2005-04-15 12:08:49 +0000 | [diff] [blame] | 1331 | #ifdef HAVE_REMOTE_LCD |
| 1332 | static bool lcd_remote_settings_menu(void) |
| 1333 | { |
| 1334 | int m; |
| 1335 | bool result; |
| 1336 | |
| 1337 | static const struct menu_item items[] = { |
Christian Gmeiner | 7477c09 | 2005-05-30 00:00:22 +0000 | [diff] [blame] | 1338 | { ID2P(LANG_BACKLIGHT), remote_backlight_timer }, |
Christian Gmeiner | 7c1879b | 2005-04-15 12:08:49 +0000 | [diff] [blame] | 1339 | { ID2P(LANG_CONTRAST), remote_contrast }, |
| 1340 | { ID2P(LANG_INVERT), remote_invert }, |
Jens Arnold | bd1bb5f | 2005-06-17 21:43:00 +0000 | [diff] [blame] | 1341 | { ID2P(LANG_FLIP_DISPLAY), remote_flip_display }, |
| 1342 | /* { ID2P(LANG_INVERT_CURSOR), invert_cursor },*/ |
Christian Gmeiner | 7c1879b | 2005-04-15 12:08:49 +0000 | [diff] [blame] | 1343 | }; |
| 1344 | |
| 1345 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1346 | NULL, NULL, NULL); |
| 1347 | result = menu_run(m); |
| 1348 | menu_exit(m); |
| 1349 | return result; |
| 1350 | } |
| 1351 | #endif |
| 1352 | |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1353 | #ifdef HAVE_LCD_BITMAP |
| 1354 | static bool bars_settings_menu(void) |
| 1355 | { |
| 1356 | int m; |
| 1357 | bool result; |
| 1358 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1359 | static const struct menu_item items[] = { |
| 1360 | { ID2P(LANG_SCROLL_BAR), scroll_bar }, |
| 1361 | { ID2P(LANG_STATUS_BAR), status_bar }, |
Jens Arnold | 1f0908d | 2004-10-09 20:54:15 +0000 | [diff] [blame] | 1362 | #if CONFIG_KEYPAD == RECORDER_PAD |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1363 | { ID2P(LANG_BUTTON_BAR), button_bar }, |
Jens Arnold | 1f0908d | 2004-10-09 20:54:15 +0000 | [diff] [blame] | 1364 | #endif |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1365 | { ID2P(LANG_VOLUME_DISPLAY), volume_type }, |
Jens Arnold | 9d42e2b | 2005-01-30 13:48:44 +0000 | [diff] [blame] | 1366 | { ID2P(LANG_BATTERY_DISPLAY), battery_display }, |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1367 | }; |
| 1368 | |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1369 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1370 | NULL, NULL, NULL); |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1371 | result = menu_run(m); |
| 1372 | menu_exit(m); |
| 1373 | return result; |
| 1374 | } |
| 1375 | #endif |
Robert Hak | 65002e8 | 2002-12-12 16:56:19 +0000 | [diff] [blame] | 1376 | |
| 1377 | |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 1378 | static bool display_settings_menu(void) |
Eric Linenberg | c5b645b | 2002-09-05 04:42:12 +0000 | [diff] [blame] | 1379 | { |
| 1380 | int m; |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 1381 | bool result; |
Eric Linenberg | c5b645b | 2002-09-05 04:42:12 +0000 | [diff] [blame] | 1382 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1383 | static const struct menu_item items[] = { |
Linus Nielsen Feltzing | bb572c4 | 2002-09-27 09:31:31 +0000 | [diff] [blame] | 1384 | #ifdef HAVE_LCD_BITMAP |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1385 | { ID2P(LANG_CUSTOM_FONT), font_browse }, |
Linus Nielsen Feltzing | bb572c4 | 2002-09-27 09:31:31 +0000 | [diff] [blame] | 1386 | #endif |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1387 | { ID2P(LANG_WHILE_PLAYING), custom_wps_browse }, |
| 1388 | { ID2P(LANG_LCD_MENU), lcd_settings_menu }, |
Christian Gmeiner | 7c1879b | 2005-04-15 12:08:49 +0000 | [diff] [blame] | 1389 | #ifdef HAVE_REMOTE_LCD |
| 1390 | { ID2P(LANG_LCD_REMOTE_MENU), lcd_remote_settings_menu }, |
| 1391 | #endif |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1392 | { ID2P(LANG_SCROLL_MENU), scroll_settings_menu }, |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1393 | #ifdef HAVE_LCD_BITMAP |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1394 | { ID2P(LANG_BARS_MENU), bars_settings_menu }, |
| 1395 | { ID2P(LANG_PM_MENU), peak_meter_menu }, |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1396 | #endif |
Eric Linenberg | c5b645b | 2002-09-05 04:42:12 +0000 | [diff] [blame] | 1397 | }; |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1398 | |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1399 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1400 | NULL, NULL, NULL); |
Eric Linenberg | c5b645b | 2002-09-05 04:42:12 +0000 | [diff] [blame] | 1401 | result = menu_run(m); |
| 1402 | menu_exit(m); |
| 1403 | return result; |
| 1404 | } |
| 1405 | |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1406 | |
| 1407 | static bool firmware_browse(void) |
| 1408 | { |
| 1409 | return rockbox_browse(ROCKBOX_DIR, SHOW_MOD); |
| 1410 | } |
| 1411 | |
| 1412 | static bool battery_settings_menu(void) |
| 1413 | { |
| 1414 | int m; |
| 1415 | bool result; |
| 1416 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1417 | static const struct menu_item items[] = { |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1418 | #ifndef SIMULATOR |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1419 | { ID2P(LANG_BATTERY_CAPACITY), battery_capacity }, |
Jens Arnold | 91846a1 | 2005-01-30 16:25:46 +0000 | [diff] [blame] | 1420 | #if BATTERY_TYPES_COUNT > 1 |
| 1421 | { ID2P(LANG_BATTERY_TYPE), battery_type }, |
| 1422 | #endif |
Jörg Hohensohn | 00898c6 | 2004-06-14 07:23:48 +0000 | [diff] [blame] | 1423 | #else |
| 1424 | #ifndef HAVE_CHARGE_CTRL |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1425 | { "Dummy", NULL }, /* to have an entry at all, in the simulator */ |
Jörg Hohensohn | 00898c6 | 2004-06-14 07:23:48 +0000 | [diff] [blame] | 1426 | #endif |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1427 | #endif |
| 1428 | }; |
| 1429 | |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1430 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1431 | NULL, NULL, NULL); |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1432 | result = menu_run(m); |
| 1433 | menu_exit(m); |
| 1434 | return result; |
| 1435 | } |
| 1436 | |
Jens Arnold | dd937dc | 2004-10-09 22:04:47 +0000 | [diff] [blame] | 1437 | #ifndef HAVE_MMC |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1438 | static bool disk_settings_menu(void) |
| 1439 | { |
| 1440 | int m; |
| 1441 | bool result; |
| 1442 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1443 | static const struct menu_item items[] = { |
| 1444 | { ID2P(LANG_SPINDOWN), spindown }, |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1445 | #ifdef HAVE_ATA_POWER_OFF |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1446 | { ID2P(LANG_POWEROFF), poweroff }, |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1447 | #endif |
| 1448 | }; |
| 1449 | |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1450 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1451 | NULL, NULL, NULL); |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1452 | result = menu_run(m); |
| 1453 | menu_exit(m); |
| 1454 | return result; |
| 1455 | } |
Jens Arnold | dd937dc | 2004-10-09 22:04:47 +0000 | [diff] [blame] | 1456 | #endif /* !HAVE_MMC */ |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1457 | |
Jörg Hohensohn | 24c7c04 | 2004-09-10 10:51:54 +0000 | [diff] [blame] | 1458 | #ifdef HAVE_RTC |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1459 | static bool time_settings_menu(void) |
| 1460 | { |
| 1461 | int m; |
| 1462 | bool result; |
| 1463 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1464 | static const struct menu_item items[] = { |
| 1465 | { ID2P(LANG_TIME), timedate_set }, |
| 1466 | { ID2P(LANG_TIMEFORMAT), timeformat_set }, |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1467 | }; |
| 1468 | |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1469 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1470 | NULL, NULL, NULL); |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1471 | result = menu_run(m); |
| 1472 | menu_exit(m); |
| 1473 | return result; |
| 1474 | } |
| 1475 | #endif |
| 1476 | |
Christi Scarborough | d0ec0ce | 2005-07-04 09:24:31 +0000 | [diff] [blame] | 1477 | bool manage_settings_menu(void) |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1478 | { |
| 1479 | int m; |
| 1480 | bool result; |
| 1481 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1482 | static const struct menu_item items[] = { |
| 1483 | { ID2P(LANG_CUSTOM_CFG), custom_cfg_browse }, |
| 1484 | { ID2P(LANG_FIRMWARE), firmware_browse }, |
| 1485 | { ID2P(LANG_RESET), reset_settings }, |
| 1486 | { ID2P(LANG_SAVE_SETTINGS), settings_save_config }, |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1487 | }; |
| 1488 | |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1489 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1490 | NULL, NULL, NULL); |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1491 | result = menu_run(m); |
| 1492 | menu_exit(m); |
| 1493 | return result; |
| 1494 | } |
| 1495 | |
| 1496 | static bool limits_settings_menu(void) |
| 1497 | { |
| 1498 | int m; |
| 1499 | bool result; |
| 1500 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1501 | static const struct menu_item items[] = { |
| 1502 | { ID2P(LANG_MAX_FILES_IN_DIR), max_files_in_dir }, |
| 1503 | { ID2P(LANG_MAX_FILES_IN_PLAYLIST), max_files_in_playlist }, |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1504 | }; |
| 1505 | |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1506 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1507 | NULL, NULL, NULL); |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1508 | result = menu_run(m); |
| 1509 | menu_exit(m); |
| 1510 | return result; |
| 1511 | } |
| 1512 | |
| 1513 | |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 1514 | static bool system_settings_menu(void) |
Eric Linenberg | c5b645b | 2002-09-05 04:42:12 +0000 | [diff] [blame] | 1515 | { |
| 1516 | int m; |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 1517 | bool result; |
Eric Linenberg | c5b645b | 2002-09-05 04:42:12 +0000 | [diff] [blame] | 1518 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1519 | static const struct menu_item items[] = { |
| 1520 | { ID2P(LANG_BATTERY_MENU), battery_settings_menu }, |
Jens Arnold | dd937dc | 2004-10-09 22:04:47 +0000 | [diff] [blame] | 1521 | #ifndef HAVE_MMC |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1522 | { ID2P(LANG_DISK_MENU), disk_settings_menu }, |
Jens Arnold | dd937dc | 2004-10-09 22:04:47 +0000 | [diff] [blame] | 1523 | #endif |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1524 | #ifdef HAVE_RTC |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1525 | { ID2P(LANG_TIME_MENU), time_settings_menu }, |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1526 | #endif |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1527 | { ID2P(LANG_POWEROFF_IDLE), poweroff_idle_timer }, |
| 1528 | { ID2P(LANG_SLEEP_TIMER), sleeptimer_screen }, |
Björn Stenberg | a73cc6a | 2004-01-15 08:25:42 +0000 | [diff] [blame] | 1529 | #ifdef HAVE_ALARM_MOD |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1530 | { ID2P(LANG_ALARM_MOD_ALARM_MENU), alarm_screen }, |
Björn Stenberg | a73cc6a | 2004-01-15 08:25:42 +0000 | [diff] [blame] | 1531 | #endif |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1532 | { ID2P(LANG_LIMITS_MENU), limits_settings_menu }, |
Jörg Hohensohn | 593cc00 | 2004-09-28 22:13:26 +0000 | [diff] [blame] | 1533 | #if CONFIG_HWCODEC == MAS3507D |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1534 | { ID2P(LANG_LINE_IN), line_in }, |
Linus Nielsen Feltzing | c22b411 | 2003-11-03 23:36:36 +0000 | [diff] [blame] | 1535 | #endif |
Jens Arnold | ccfa4cd | 2004-10-10 01:25:32 +0000 | [diff] [blame] | 1536 | #ifdef HAVE_CHARGING |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1537 | { ID2P(LANG_CAR_ADAPTER_MODE), car_adapter_mode }, |
Jens Arnold | ccfa4cd | 2004-10-10 01:25:32 +0000 | [diff] [blame] | 1538 | #endif |
Eric Linenberg | c5b645b | 2002-09-05 04:42:12 +0000 | [diff] [blame] | 1539 | }; |
Björn Stenberg | fe375a0 | 2004-01-14 14:42:31 +0000 | [diff] [blame] | 1540 | |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1541 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1542 | NULL, NULL, NULL); |
Eric Linenberg | c5b645b | 2002-09-05 04:42:12 +0000 | [diff] [blame] | 1543 | result = menu_run(m); |
| 1544 | menu_exit(m); |
| 1545 | return result; |
| 1546 | } |
Björn Stenberg | 94afb54 | 2002-09-07 12:28:46 +0000 | [diff] [blame] | 1547 | |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 1548 | bool settings_menu(void) |
Björn Stenberg | 94afb54 | 2002-09-07 12:28:46 +0000 | [diff] [blame] | 1549 | { |
| 1550 | int m; |
Björn Stenberg | b1b8bd4 | 2002-09-24 17:22:12 +0000 | [diff] [blame] | 1551 | bool result; |
Björn Stenberg | 94afb54 | 2002-09-07 12:28:46 +0000 | [diff] [blame] | 1552 | |
Jörg Hohensohn | b1403ee | 2004-07-23 23:01:20 +0000 | [diff] [blame] | 1553 | static const struct menu_item items[] = { |
| 1554 | { ID2P(LANG_PLAYBACK), playback_settings_menu }, |
| 1555 | { ID2P(LANG_FILE), fileview_settings_menu }, |
| 1556 | { ID2P(LANG_DISPLAY), display_settings_menu }, |
| 1557 | { ID2P(LANG_SYSTEM), system_settings_menu }, |
| 1558 | { ID2P(LANG_BOOKMARK_SETTINGS),bookmark_settings_menu }, |
| 1559 | { ID2P(LANG_LANGUAGE), language_browse }, |
| 1560 | { ID2P(LANG_VOICE), voice_menu }, |
Björn Stenberg | 94afb54 | 2002-09-07 12:28:46 +0000 | [diff] [blame] | 1561 | }; |
| 1562 | |
Linus Nielsen Feltzing | 77936e6 | 2004-03-16 13:44:56 +0000 | [diff] [blame] | 1563 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
| 1564 | NULL, NULL, NULL); |
Björn Stenberg | 94afb54 | 2002-09-07 12:28:46 +0000 | [diff] [blame] | 1565 | result = menu_run(m); |
| 1566 | menu_exit(m); |
| 1567 | return result; |
| 1568 | } |