blob: cd2950665c29bbed9296acc5c85d0c1434223abb [file] [log] [blame]
Jonathan Gordon4718a1e2007-02-08 04:33:41 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
Jonathan Gordon4e73b532007-02-13 00:32:17 +00008 * $Id$
Jonathan Gordon4718a1e2007-02-08 04:33:41 +00009 *
10 * Copyright (C) 2007 Jonathan Gordon
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 <stdbool.h>
21#include <stddef.h>
22#include <limits.h>
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +000023#include <string.h>
Jonathan Gordon4718a1e2007-02-08 04:33:41 +000024#include "config.h"
25#include "lang.h"
26#include "action.h"
27#include "settings.h"
28#include "menu.h"
29#include "sound_menu.h"
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +000030#include "exported_menus.h"
31#include "tree.h"
32#include "tagtree.h"
33#include "usb.h"
34#include "splash.h"
35#include "talk.h"
36#include "sprintf.h"
37#include "powermgmt.h"
Thom Johansen8fd6d652007-02-28 21:55:11 +000038#ifdef HAVE_RTC_ALARM
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +000039#include "alarm_menu.h"
40#endif
Jonathan Gordon16d5d1d2007-03-07 08:56:20 +000041#if CONFIG_TUNER
42#include "radio.h"
43#endif
Jonathan Gordon4718a1e2007-02-08 04:33:41 +000044
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +000045/***********************************/
46/* TAGCACHE MENU */
47#ifdef HAVE_TAGCACHE
Steve Bavin81374892007-03-07 19:56:15 +000048
49static void tagcache_rebuild_with_splash(void)
50{
51 tagcache_rebuild();
Jens Arnold4d6374c2007-03-16 21:56:08 +000052 gui_syncsplash(HZ*2, str(LANG_TAGCACHE_FORCE_UPDATE_SPLASH));
Steve Bavin81374892007-03-07 19:56:15 +000053}
54
55static void tagcache_update_with_splash(void)
56{
57 tagcache_update();
Jens Arnold4d6374c2007-03-16 21:56:08 +000058 gui_syncsplash(HZ*2, str(LANG_TAGCACHE_FORCE_UPDATE_SPLASH));
Steve Bavin81374892007-03-07 19:56:15 +000059}
60
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +000061#ifdef HAVE_TC_RAMCACHE
62MENUITEM_SETTING(tagcache_ram, &global_settings.tagcache_ram, NULL);
63#endif
64MENUITEM_SETTING(tagcache_autoupdate, &global_settings.tagcache_autoupdate, NULL);
Jonathan Gordondaf66942007-03-17 12:33:34 +000065MENUITEM_FUNCTION(tc_init, 0, ID2P(LANG_TAGCACHE_FORCE_UPDATE),
66 (int(*)(void))tagcache_rebuild_with_splash,
Jonathan Gordone54d8e12007-03-18 07:03:43 +000067 NULL, NULL, Icon_NOICON);
Jonathan Gordondaf66942007-03-17 12:33:34 +000068MENUITEM_FUNCTION(tc_update, 0, ID2P(LANG_TAGCACHE_UPDATE),
69 (int(*)(void))tagcache_update_with_splash,
Jonathan Gordone54d8e12007-03-18 07:03:43 +000070 NULL, NULL, Icon_NOICON);
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +000071MENUITEM_SETTING(runtimedb, &global_settings.runtimedb, NULL);
Jonathan Gordondaf66942007-03-17 12:33:34 +000072MENUITEM_FUNCTION(tc_export, 0, ID2P(LANG_TAGCACHE_EXPORT),
Jonathan Gordone54d8e12007-03-18 07:03:43 +000073 (int(*)(void))tagtree_export, NULL,
Jonathan Gordondaf66942007-03-17 12:33:34 +000074 NULL, Icon_NOICON);
75MENUITEM_FUNCTION(tc_import, 0, ID2P(LANG_TAGCACHE_IMPORT),
Jonathan Gordone54d8e12007-03-18 07:03:43 +000076 (int(*)(void))tagtree_import, NULL,
Jonathan Gordondaf66942007-03-17 12:33:34 +000077 NULL, Icon_NOICON);
Jonathan Gordon02a87172007-03-03 13:52:14 +000078MAKE_MENU(tagcache_menu, ID2P(LANG_TAGCACHE), 0, Icon_NOICON,
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +000079#ifdef HAVE_TC_RAMCACHE
80 &tagcache_ram,
81#endif
82 &tagcache_autoupdate, &tc_init, &tc_update, &runtimedb,
83 &tc_export, &tc_import);
84#endif /* HAVE_TAGCACHE */
85/* TAGCACHE MENU */
86/***********************************/
87
88/***********************************/
89/* FILE VIEW MENU */
90static int fileview_callback(int action,const struct menu_item_ex *this_item);
91MENUITEM_SETTING(sort_case, &global_settings.sort_case, NULL);
92MENUITEM_SETTING(sort_dir, &global_settings.sort_dir, fileview_callback);
93MENUITEM_SETTING(sort_file, &global_settings.sort_file, fileview_callback);
94MENUITEM_SETTING(dirfilter, &global_settings.dirfilter, NULL);
95MENUITEM_SETTING(browse_current, &global_settings.browse_current, NULL);
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +000096MENUITEM_SETTING(show_path_in_browser, &global_settings.show_path_in_browser, NULL);
97static int fileview_callback(int action,const struct menu_item_ex *this_item)
98{
99 static int oldval;
100 int *variable = this_item->variable;
101 switch (action)
102 {
103 case ACTION_ENTER_MENUITEM: /* on entering an item */
104 oldval = *variable;
105 break;
106 case ACTION_EXIT_MENUITEM: /* on exit */
107 if (*variable != oldval)
108 reload_directory(); /* force reload if this has changed */
109 break;
110 }
111 return action;
112}
113
Jonathan Gordon02a87172007-03-03 13:52:14 +0000114MAKE_MENU(file_menu, ID2P(LANG_FILE), 0, Icon_file_view_menu,
Jonathan Gordon5599d682007-02-14 06:58:30 +0000115 &sort_case, &sort_dir, &sort_file,
Marcoen Hirschberg44c510e2007-03-01 17:39:15 +0000116 &dirfilter, &browse_current, &show_path_in_browser);
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000117/* FILE VIEW MENU */
118/***********************************/
119
120
121/***********************************/
122/* SYSTEM MENU */
123
124/* Battery */
125#ifndef SIMULATOR
Jonathan Gordonb43bf7e2007-07-15 03:56:04 +0000126#if BATTERY_CAPACITY_INC > 0
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000127MENUITEM_SETTING(battery_capacity, &global_settings.battery_capacity, NULL);
Jonathan Gordonb43bf7e2007-07-15 03:56:04 +0000128#endif
129#if BATTERY_TYPES_COUNT > 1
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000130MENUITEM_SETTING(battery_type, &global_settings.battery_type, NULL);
Jonathan Gordonb43bf7e2007-07-15 03:56:04 +0000131#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000132#ifdef HAVE_USB_POWER
Jonathan Gordon9a6f4192007-02-18 05:32:06 +0000133#if CONFIG_CHARGING
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000134static int usbcharging_callback(int action,const struct menu_item_ex *this_item)
135{
136 (void)this_item;
137 switch (action)
138 {
139 case ACTION_EXIT_MENUITEM: /* on exit */
140 usb_charging_enable(global_settings.usb_charging);
141 break;
142 }
143 return action;
144}
145MENUITEM_SETTING(usb_charging, &global_settings.usb_charging, usbcharging_callback);
146#endif
147#endif
Jonathan Gordon02a87172007-03-03 13:52:14 +0000148MAKE_MENU(battery_menu, ID2P(LANG_BATTERY_MENU), 0, Icon_NOICON,
Jonathan Gordonb43bf7e2007-07-15 03:56:04 +0000149#if BATTERY_CAPACITY_INC > 0
150 &battery_capacity,
151#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000152#if BATTERY_TYPES_COUNT > 1
153 &battery_type,
154#endif
155#ifdef HAVE_USB_POWER
Jonathan Gordon9a6f4192007-02-18 05:32:06 +0000156#if CONFIG_CHARGING
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000157 &usb_charging,
158#endif
159#endif
160 );
161#endif /* SIMULATOR */
162/* Disk */
Nils Wallménius0bfa3e72007-08-01 08:50:44 +0000163#ifndef HAVE_FLASH_STORAGE
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000164MENUITEM_SETTING(disk_spindown, &global_settings.disk_spindown, NULL);
Nils Wallménius0bfa3e72007-08-01 08:50:44 +0000165#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000166#ifdef HAVE_DIRCACHE
167static int dircache_callback(int action,const struct menu_item_ex *this_item)
168{
169 (void)this_item;
170 switch (action)
171 {
172 case ACTION_EXIT_MENUITEM: /* on exit */
173 switch (global_settings.dircache)
174 {
175 case true:
176 if (!dircache_is_enabled())
Jens Arnold4d6374c2007-03-16 21:56:08 +0000177 gui_syncsplash(HZ*2, str(LANG_PLEASE_REBOOT));
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000178 break;
179 case false:
180 if (dircache_is_enabled())
181 dircache_disable();
182 break;
183 }
184 break;
185 }
186 return action;
187}
188MENUITEM_SETTING(dircache, &global_settings.dircache, dircache_callback);
189#endif
Nils Wallménius0bfa3e72007-08-01 08:50:44 +0000190#if defined(HAVE_DIRCACHE) || !defined(HAVE_FLASH_STORAGE)
Jonathan Gordon02a87172007-03-03 13:52:14 +0000191MAKE_MENU(disk_menu, ID2P(LANG_DISK_MENU), 0, Icon_NOICON,
Nils Wallménius0bfa3e72007-08-01 08:50:44 +0000192#ifndef HAVE_FLASH_STORAGE
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000193 &disk_spindown,
Nils Wallménius0bfa3e72007-08-01 08:50:44 +0000194#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000195#ifdef HAVE_DIRCACHE
196 &dircache,
197#endif
198 );
199#endif
200
201/* Time & Date */
Jens Arnold2c7b1272007-03-16 23:47:03 +0000202#if CONFIG_RTC
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000203static int timedate_set(void)
204{
205 struct tm tm;
206 int result;
207
208 /* Make a local copy of the time struct */
209 memcpy(&tm, get_time(), sizeof(struct tm));
210
211 /* do some range checks */
212 /* This prevents problems with time/date setting after a power loss */
213 if (!valid_time(&tm))
214 {
Robert Kukla8f1bc1f2007-03-31 13:04:22 +0000215/* Macros to convert a 2-digit string to a decimal constant.
216 (YEAR), MONTH and DAY are set by the date command, which outputs
217 DAY as 00..31 and MONTH as 01..12. The leading zero would lead to
218 misinterpretation as an octal constant. */
219#define S100(x) 1 ## x
220#define C2DIG2DEC(x) (S100(x)-100)
221
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000222 tm.tm_hour = 0;
223 tm.tm_min = 0;
224 tm.tm_sec = 0;
Robert Kukla8f1bc1f2007-03-31 13:04:22 +0000225 tm.tm_mday = C2DIG2DEC(DAY);
226 tm.tm_mon = C2DIG2DEC(MONTH)-1;
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000227 tm.tm_wday = 1;
Robert Kukla8f1bc1f2007-03-31 13:04:22 +0000228 tm.tm_year = YEAR-1900;
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000229 }
230
231 result = (int)set_time_screen(str(LANG_TIME), &tm);
232
233 if(tm.tm_year != -1) {
234 set_time(&tm);
235 }
236 return result;
237}
238
Jonathan Gordondaf66942007-03-17 12:33:34 +0000239MENUITEM_FUNCTION(time_set, 0, ID2P(LANG_TIME),
Jonathan Gordone54d8e12007-03-18 07:03:43 +0000240 timedate_set, NULL, NULL, Icon_NOICON);
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000241MENUITEM_SETTING(timeformat, &global_settings.timeformat, NULL);
Jonathan Gordon02a87172007-03-03 13:52:14 +0000242MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), 0, Icon_NOICON, &time_set, &timeformat);
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000243#endif
244
245/* System menu */
246MENUITEM_SETTING(poweroff, &global_settings.poweroff, NULL);
247
Thom Johansen8fd6d652007-02-28 21:55:11 +0000248#ifdef HAVE_RTC_ALARM
Jonathan Gordondaf66942007-03-17 12:33:34 +0000249MENUITEM_FUNCTION(alarm_screen_call, 0, ID2P(LANG_ALARM_MOD_ALARM_MENU),
Jonathan Gordone54d8e12007-03-18 07:03:43 +0000250 (menu_function)alarm_screen, NULL, NULL, Icon_NOICON);
Jonathan Gordond0a7cf02007-03-07 07:36:04 +0000251#if CONFIG_TUNER || defined(HAVE_RECORDING)
252
253#if CONFIG_TUNER && !defined(HAVE_RECORDING)
254/* This need only be shown if we dont have recording, because if we do
255 then always show the setting item, because there will always be at least
256 2 items */
257static int alarm_callback(int action,const struct menu_item_ex *this_item)
258{
259 (void)this_item;
260 switch (action)
261 {
262 case ACTION_REQUEST_MENUITEM:
263 if (radio_hardware_present() == 0)
264 return ACTION_EXIT_MENUITEM;
265 break;
266 }
267 return action;
268}
269#else
270#define alarm_callback NULL
271#endif /* CONFIG_TUNER && !HAVE_RECORDING */
272/* have to do this manually because the setting screen
273 doesnt handle variable item count */
274static int alarm_setting(void)
275{
276 struct opt_items items[ALARM_START_COUNT];
277 int i = 0;
278 items[i].string = str(LANG_RESUME_PLAYBACK);
279 items[i].voice_id = LANG_RESUME_PLAYBACK;
280 i++;
281#if CONFIG_TUNER
282 if (radio_hardware_present())
283 {
284 items[i].string = str(LANG_FM_RADIO);
285 items[i].voice_id = LANG_FM_RADIO;
286 i++;
287 }
Jonathan Gordon9e554a82007-03-07 01:16:25 +0000288#endif
Jonathan Gordond0a7cf02007-03-07 07:36:04 +0000289#ifdef HAVE_RECORDING
290 items[i].string = str(LANG_RECORDING);
291 items[i].voice_id = LANG_RECORDING;
292 i++;
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000293#endif
Jonathan Gordond0a7cf02007-03-07 07:36:04 +0000294 return set_option(str(LANG_ALARM_WAKEUP_SCREEN),
295 &global_settings.alarm_wake_up_screen,
296 INT, items, i, NULL);
297}
298
Jonathan Gordondaf66942007-03-17 12:33:34 +0000299MENUITEM_FUNCTION(alarm_wake_up_screen, 0, ID2P(LANG_ALARM_WAKEUP_SCREEN),
Jonathan Gordone54d8e12007-03-18 07:03:43 +0000300 alarm_setting, NULL, alarm_callback, Icon_Menu_setting);
Jonathan Gordond0a7cf02007-03-07 07:36:04 +0000301#endif /* CONFIG_TUNER || defined(HAVE_RECORDING) */
302#endif /* HAVE_RTC_ALARM */
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000303
304/* Limits menu */
305MENUITEM_SETTING(max_files_in_dir, &global_settings.max_files_in_dir, NULL);
306MENUITEM_SETTING(max_files_in_playlist, &global_settings.max_files_in_playlist, NULL);
Jonathan Gordon02a87172007-03-03 13:52:14 +0000307MAKE_MENU(limits_menu, ID2P(LANG_LIMITS_MENU), 0, Icon_NOICON,
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000308 &max_files_in_dir, &max_files_in_playlist);
309
310#if CONFIG_CODEC == MAS3507D
311void dac_line_in(bool enable);
312static int linein_callback(int action,const struct menu_item_ex *this_item)
313{
314 (void)this_item;
315 switch (action)
316 {
317 case ACTION_EXIT_MENUITEM: /* on exit */
318#ifndef SIMULATOR
319 dac_line_in(global_settings.line_in);
320#endif
321 break;
322 }
323 return action;
324}
325MENUITEM_SETTING(line_in, &global_settings.line_in, linein_callback);
326#endif
Jonathan Gordon9a6f4192007-02-18 05:32:06 +0000327#if CONFIG_CHARGING
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000328MENUITEM_SETTING(car_adapter_mode, &global_settings.car_adapter_mode, NULL);
329#endif
Jonathan Gordon91cb68a2007-03-01 11:14:46 +0000330MENUITEM_SETTING(start_screen, &global_settings.start_in_screen, NULL);
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000331
Jonathan Gordon4b1d1b42007-04-22 13:02:24 +0000332#ifdef HAVE_BUTTON_LIGHT
333MENUITEM_SETTING(button_light_timeout, &global_settings.button_light_timeout, NULL);
334#endif
335
Karl Kurbjun6f95ab72007-05-08 06:45:38 +0000336#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
337MENUITEM_SETTING(buttonlight_brightness, &global_settings.buttonlight_brightness, NULL);
338#endif
339
Jonathan Gordon5599d682007-02-14 06:58:30 +0000340MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
Jonathan Gordon02a87172007-03-03 13:52:14 +0000341 0, Icon_System_menu,
Jonathan Gordon91cb68a2007-03-01 11:14:46 +0000342 &start_screen,
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000343#ifndef SIMULATOR
344 &battery_menu,
345#endif
Nils Wallméniusf7f8ee12007-08-01 09:05:42 +0000346#if defined(HAVE_DIRCACHE) || !defined(HAVE_FLASH_STORAGE)
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000347 &disk_menu,
348#endif
Jens Arnold2c7b1272007-03-16 23:47:03 +0000349#if CONFIG_RTC
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000350 &time_menu,
351#endif
352 &poweroff,
Thom Johansen8fd6d652007-02-28 21:55:11 +0000353#ifdef HAVE_RTC_ALARM
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000354 &alarm_screen_call,
Jonathan Gordon9e554a82007-03-07 01:16:25 +0000355#if defined(HAVE_RECORDING) || CONFIG_TUNER
356 &alarm_wake_up_screen,
357#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000358#endif
359 &limits_menu,
360#if CONFIG_CODEC == MAS3507D
361 &line_in,
362#endif
Jonathan Gordon9a6f4192007-02-18 05:32:06 +0000363#if CONFIG_CHARGING
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000364 &car_adapter_mode,
365#endif
Jonathan Gordon4b1d1b42007-04-22 13:02:24 +0000366#ifdef HAVE_BUTTON_LIGHT
367 &button_light_timeout,
368#endif
Karl Kurbjun6f95ab72007-05-08 06:45:38 +0000369#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
370 &buttonlight_brightness
371#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000372 );
373
374/* SYSTEM MENU */
375/***********************************/
376
377
378/***********************************/
379/* BOOKMARK MENU */
380static int bmark_callback(int action,const struct menu_item_ex *this_item)
381{
382 (void)this_item;
383 switch (action)
384 {
385 case ACTION_EXIT_MENUITEM: /* on exit */
386 if(global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_YES ||
387 global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_ASK)
388 {
389 if(global_settings.usemrb == BOOKMARK_NO)
390 global_settings.usemrb = BOOKMARK_YES;
391
392 }
393 break;
394 }
395 return action;
396}
397MENUITEM_SETTING(autocreatebookmark,
398 &global_settings.autocreatebookmark, bmark_callback);
399MENUITEM_SETTING(autoloadbookmark, &global_settings.autoloadbookmark, NULL);
400MENUITEM_SETTING(usemrb, &global_settings.usemrb, NULL);
401MAKE_MENU(bookmark_settings_menu, ID2P(LANG_BOOKMARK_SETTINGS), 0,
Jonathan Gordon02a87172007-03-03 13:52:14 +0000402 Icon_Bookmark,
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000403 &autocreatebookmark, &autoloadbookmark, &usemrb);
404/* BOOKMARK MENU */
405/***********************************/
406
407/***********************************/
408/* VOICE MENU */
409static int talk_callback(int action,const struct menu_item_ex *this_item);
Steve Bavin6fd10ba2007-06-07 09:24:53 +0000410MENUITEM_SETTING(talk_menu_item, &global_settings.talk_menu, NULL);
411MENUITEM_SETTING(talk_dir_item, &global_settings.talk_dir, NULL);
412MENUITEM_SETTING(talk_dir_clip_item, &global_settings.talk_dir_clip, talk_callback);
413MENUITEM_SETTING(talk_file_item, &global_settings.talk_file, NULL);
414MENUITEM_SETTING(talk_file_clip_item, &global_settings.talk_file_clip, talk_callback);
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000415static int talk_callback(int action,const struct menu_item_ex *this_item)
416{
417 static int oldval = 0;
418 switch (action)
419 {
420 case ACTION_ENTER_MENUITEM:
Steve Bavin6fd10ba2007-06-07 09:24:53 +0000421 oldval = global_settings.talk_file_clip;
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000422 break;
423 case ACTION_EXIT_MENUITEM:
424#if CONFIG_CODEC == SWCODEC
425 audio_set_crossfade(global_settings.crossfade);
426#endif
Steve Bavin6fd10ba2007-06-07 09:24:53 +0000427 if (this_item == &talk_dir_clip_item)
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000428 break;
Steve Bavin6fd10ba2007-06-07 09:24:53 +0000429 if (!oldval && global_settings.talk_file_clip)
430 {
431 /* force reload if newly talking thumbnails,
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000432 because the clip presence is cached only if enabled */
433 reload_directory();
434 }
435 break;
436 }
437 return action;
438}
Jonathan Gordon02a87172007-03-03 13:52:14 +0000439MAKE_MENU(voice_settings_menu, ID2P(LANG_VOICE), 0, Icon_Voice,
Steve Bavin6fd10ba2007-06-07 09:24:53 +0000440 &talk_menu_item, &talk_dir_item, &talk_dir_clip_item,
441 &talk_file_item, &talk_file_clip_item);
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000442/* VOICE MENU */
443/***********************************/
444
445/***********************************/
446/* SETTINGS MENU */
447static int language_browse(void)
448{
449 return (int)rockbox_browse(LANG_DIR, SHOW_LNG);
450}
Jonathan Gordondaf66942007-03-17 12:33:34 +0000451MENUITEM_FUNCTION(browse_langs, 0, ID2P(LANG_LANGUAGE), language_browse,
Jonathan Gordone54d8e12007-03-18 07:03:43 +0000452 NULL, NULL, Icon_Language);
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000453
454MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0,
Jonathan Gordon02a87172007-03-03 13:52:14 +0000455 Icon_General_settings_menu,
Jonathan Gordon91cb68a2007-03-01 11:14:46 +0000456 &playback_menu_item, &playlist_settings, &file_menu,
Marcoen Hirschberg44c510e2007-03-01 17:39:15 +0000457#ifdef HAVE_TAGCACHE
458 &tagcache_menu,
459#endif
Jonathan Gordon91cb68a2007-03-01 11:14:46 +0000460 &display_menu, &system_menu,
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000461 &bookmark_settings_menu, &browse_langs, &voice_settings_menu );
462/* SETTINGS MENU */
463/***********************************/