blob: 135e632479ad4b51a9ec9fad6904a4edbe91a1af [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 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
Jonathan Gordon4718a1e2007-02-08 04:33:41 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include <stdbool.h>
23#include <stddef.h>
24#include <limits.h>
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +000025#include <string.h>
Jonathan Gordon4718a1e2007-02-08 04:33:41 +000026#include "config.h"
27#include "lang.h"
28#include "action.h"
29#include "settings.h"
30#include "menu.h"
31#include "sound_menu.h"
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +000032#include "exported_menus.h"
33#include "tree.h"
34#include "tagtree.h"
35#include "usb.h"
36#include "splash.h"
37#include "talk.h"
38#include "sprintf.h"
Andree Buschmann850a1122008-04-20 18:28:25 +000039#include "powermgmt.h"
40#if CONFIG_CODEC == SWCODEC
41#include "playback.h"
42#endif
Andree Buschmann850a1122008-04-20 18:28:25 +000043#if CONFIG_RTC
44#include "screens.h"
45#endif
Jonathan Gordonedcacaa2008-11-03 11:11:07 +000046#include "quickscreen.h"
Bertrik Sikkenb24fafb2009-03-08 20:28:15 +000047#ifdef HAVE_DIRCACHE
48#include "dircache.h"
49#endif
Jonathan Gordon4718a1e2007-02-08 04:33:41 +000050
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +000051/***********************************/
52/* TAGCACHE MENU */
53#ifdef HAVE_TAGCACHE
Steve Bavin81374892007-03-07 19:56:15 +000054
55static void tagcache_rebuild_with_splash(void)
56{
57 tagcache_rebuild();
Michael Giacomellie25f1f92008-12-25 03:23:22 +000058 splash(HZ*2, ID2P(LANG_TAGCACHE_FORCE_UPDATE_SPLASH));
Steve Bavin81374892007-03-07 19:56:15 +000059}
60
61static void tagcache_update_with_splash(void)
62{
63 tagcache_update();
Nils Wallménius01729e72008-08-15 08:27:39 +000064 splash(HZ*2, ID2P(LANG_TAGCACHE_FORCE_UPDATE_SPLASH));
Steve Bavin81374892007-03-07 19:56:15 +000065}
66
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +000067#ifdef HAVE_TC_RAMCACHE
68MENUITEM_SETTING(tagcache_ram, &global_settings.tagcache_ram, NULL);
69#endif
70MENUITEM_SETTING(tagcache_autoupdate, &global_settings.tagcache_autoupdate, NULL);
Jonathan Gordondaf66942007-03-17 12:33:34 +000071MENUITEM_FUNCTION(tc_init, 0, ID2P(LANG_TAGCACHE_FORCE_UPDATE),
Michael Giacomellie25f1f92008-12-25 03:23:22 +000072 (int(*)(void))tagcache_rebuild_with_splash,
Jonathan Gordone54d8e12007-03-18 07:03:43 +000073 NULL, NULL, Icon_NOICON);
Jonathan Gordondaf66942007-03-17 12:33:34 +000074MENUITEM_FUNCTION(tc_update, 0, ID2P(LANG_TAGCACHE_UPDATE),
Michael Giacomellie25f1f92008-12-25 03:23:22 +000075 (int(*)(void))tagcache_update_with_splash,
Jonathan Gordone54d8e12007-03-18 07:03:43 +000076 NULL, NULL, Icon_NOICON);
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +000077MENUITEM_SETTING(runtimedb, &global_settings.runtimedb, NULL);
Jonathan Gordondaf66942007-03-17 12:33:34 +000078MENUITEM_FUNCTION(tc_export, 0, ID2P(LANG_TAGCACHE_EXPORT),
Michael Giacomellie25f1f92008-12-25 03:23:22 +000079 (int(*)(void))tagtree_export, NULL,
Jonathan Gordondaf66942007-03-17 12:33:34 +000080 NULL, Icon_NOICON);
81MENUITEM_FUNCTION(tc_import, 0, ID2P(LANG_TAGCACHE_IMPORT),
Michael Giacomellie25f1f92008-12-25 03:23:22 +000082 (int(*)(void))tagtree_import, NULL,
Jonathan Gordondaf66942007-03-17 12:33:34 +000083 NULL, Icon_NOICON);
Jonathan Gordon02a87172007-03-03 13:52:14 +000084MAKE_MENU(tagcache_menu, ID2P(LANG_TAGCACHE), 0, Icon_NOICON,
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +000085#ifdef HAVE_TC_RAMCACHE
86 &tagcache_ram,
87#endif
88 &tagcache_autoupdate, &tc_init, &tc_update, &runtimedb,
89 &tc_export, &tc_import);
90#endif /* HAVE_TAGCACHE */
91/* TAGCACHE MENU */
92/***********************************/
93
94/***********************************/
95/* FILE VIEW MENU */
96static int fileview_callback(int action,const struct menu_item_ex *this_item);
97MENUITEM_SETTING(sort_case, &global_settings.sort_case, NULL);
98MENUITEM_SETTING(sort_dir, &global_settings.sort_dir, fileview_callback);
99MENUITEM_SETTING(sort_file, &global_settings.sort_file, fileview_callback);
Thomas Martitzd13f1a42009-03-01 17:55:59 +0000100MENUITEM_SETTING(interpret_numbers, &global_settings.interpret_numbers, fileview_callback);
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000101MENUITEM_SETTING(dirfilter, &global_settings.dirfilter, NULL);
Peter D'Hoye37fd4392007-08-13 19:29:49 +0000102MENUITEM_SETTING(show_filename_ext, &global_settings.show_filename_ext, NULL);
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000103MENUITEM_SETTING(browse_current, &global_settings.browse_current, NULL);
Jonathan Gordon189f9e22008-01-13 09:29:45 +0000104#ifdef HAVE_LCD_BITMAP
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000105MENUITEM_SETTING(show_path_in_browser, &global_settings.show_path_in_browser, NULL);
Jonathan Gordon189f9e22008-01-13 09:29:45 +0000106#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000107static int fileview_callback(int action,const struct menu_item_ex *this_item)
108{
109 static int oldval;
110 int *variable = this_item->variable;
111 switch (action)
112 {
113 case ACTION_ENTER_MENUITEM: /* on entering an item */
114 oldval = *variable;
115 break;
116 case ACTION_EXIT_MENUITEM: /* on exit */
117 if (*variable != oldval)
118 reload_directory(); /* force reload if this has changed */
119 break;
120 }
121 return action;
122}
123
Jonathan Gordon02a87172007-03-03 13:52:14 +0000124MAKE_MENU(file_menu, ID2P(LANG_FILE), 0, Icon_file_view_menu,
Thomas Martitzd13f1a42009-03-01 17:55:59 +0000125 &sort_case, &sort_dir, &sort_file, &interpret_numbers,
Peter D'Hoye37fd4392007-08-13 19:29:49 +0000126 &dirfilter, &show_filename_ext, &browse_current,
Jonathan Gordon189f9e22008-01-13 09:29:45 +0000127#ifdef HAVE_LCD_BITMAP
128 &show_path_in_browser
129#endif
130 );
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000131/* FILE VIEW MENU */
132/***********************************/
133
134
135/***********************************/
136/* SYSTEM MENU */
137
138/* Battery */
Jonathan Gordonb43bf7e2007-07-15 03:56:04 +0000139#if BATTERY_CAPACITY_INC > 0
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000140MENUITEM_SETTING(battery_capacity, &global_settings.battery_capacity, NULL);
Jonathan Gordonb43bf7e2007-07-15 03:56:04 +0000141#endif
142#if BATTERY_TYPES_COUNT > 1
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000143MENUITEM_SETTING(battery_type, &global_settings.battery_type, NULL);
Jonathan Gordonb43bf7e2007-07-15 03:56:04 +0000144#endif
Michael Sevakis58eb7842008-12-03 19:54:25 +0000145#ifdef HAVE_USB_CHARGING_ENABLE
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000146static int usbcharging_callback(int action,const struct menu_item_ex *this_item)
147{
148 (void)this_item;
149 switch (action)
150 {
151 case ACTION_EXIT_MENUITEM: /* on exit */
152 usb_charging_enable(global_settings.usb_charging);
153 break;
154 }
155 return action;
156}
157MENUITEM_SETTING(usb_charging, &global_settings.usb_charging, usbcharging_callback);
Michael Sevakis58eb7842008-12-03 19:54:25 +0000158#endif /* HAVE_USB_CHARGING_ENABLE */
Jonathan Gordon02a87172007-03-03 13:52:14 +0000159MAKE_MENU(battery_menu, ID2P(LANG_BATTERY_MENU), 0, Icon_NOICON,
Jonathan Gordonb43bf7e2007-07-15 03:56:04 +0000160#if BATTERY_CAPACITY_INC > 0
161 &battery_capacity,
162#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000163#if BATTERY_TYPES_COUNT > 1
164 &battery_type,
165#endif
Michael Sevakis58eb7842008-12-03 19:54:25 +0000166#ifdef HAVE_USB_CHARGING_ENABLE
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000167 &usb_charging,
168#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000169 );
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000170/* Disk */
Frank Gevaerts46573012008-10-07 19:37:33 +0000171#ifdef HAVE_DISK_STORAGE
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000172MENUITEM_SETTING(disk_spindown, &global_settings.disk_spindown, NULL);
Nils Wallménius0bfa3e72007-08-01 08:50:44 +0000173#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000174#ifdef HAVE_DIRCACHE
175static int dircache_callback(int action,const struct menu_item_ex *this_item)
176{
177 (void)this_item;
178 switch (action)
179 {
180 case ACTION_EXIT_MENUITEM: /* on exit */
181 switch (global_settings.dircache)
182 {
183 case true:
184 if (!dircache_is_enabled())
Nils Wallménius01729e72008-08-15 08:27:39 +0000185 splash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000186 break;
187 case false:
188 if (dircache_is_enabled())
189 dircache_disable();
190 break;
191 }
192 break;
193 }
194 return action;
195}
196MENUITEM_SETTING(dircache, &global_settings.dircache, dircache_callback);
197#endif
Frank Gevaerts46573012008-10-07 19:37:33 +0000198#if defined(HAVE_DIRCACHE) || defined(HAVE_DISK_STORAGE)
Jonathan Gordon02a87172007-03-03 13:52:14 +0000199MAKE_MENU(disk_menu, ID2P(LANG_DISK_MENU), 0, Icon_NOICON,
Frank Gevaerts46573012008-10-07 19:37:33 +0000200#ifdef HAVE_DISK_STORAGE
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000201 &disk_spindown,
Nils Wallménius0bfa3e72007-08-01 08:50:44 +0000202#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000203#ifdef HAVE_DIRCACHE
204 &dircache,
205#endif
206 );
207#endif
208
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000209/* System menu */
210MENUITEM_SETTING(poweroff, &global_settings.poweroff, NULL);
211
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000212/* Limits menu */
213MENUITEM_SETTING(max_files_in_dir, &global_settings.max_files_in_dir, NULL);
214MENUITEM_SETTING(max_files_in_playlist, &global_settings.max_files_in_playlist, NULL);
Jonathan Gordon02a87172007-03-03 13:52:14 +0000215MAKE_MENU(limits_menu, ID2P(LANG_LIMITS_MENU), 0, Icon_NOICON,
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000216 &max_files_in_dir, &max_files_in_playlist);
217
Steve Bavinea358a12008-01-21 09:48:44 +0000218
219/* Keyclick menu */
220#if CONFIG_CODEC == SWCODEC
221MENUITEM_SETTING(keyclick, &global_settings.keyclick, NULL);
222MENUITEM_SETTING(keyclick_repeats, &global_settings.keyclick_repeats, NULL);
223MAKE_MENU(keyclick_menu, ID2P(LANG_KEYCLICK), 0, Icon_NOICON,
224 &keyclick, &keyclick_repeats);
225#endif
226
227
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000228#if CONFIG_CODEC == MAS3507D
229void dac_line_in(bool enable);
230static int linein_callback(int action,const struct menu_item_ex *this_item)
231{
232 (void)this_item;
233 switch (action)
234 {
235 case ACTION_EXIT_MENUITEM: /* on exit */
236#ifndef SIMULATOR
237 dac_line_in(global_settings.line_in);
238#endif
239 break;
240 }
241 return action;
242}
243MENUITEM_SETTING(line_in, &global_settings.line_in, linein_callback);
244#endif
Jonathan Gordon9a6f4192007-02-18 05:32:06 +0000245#if CONFIG_CHARGING
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000246MENUITEM_SETTING(car_adapter_mode, &global_settings.car_adapter_mode, NULL);
247#endif
Michael Giacomelli70e9c7a2008-12-25 01:46:16 +0000248#ifdef IPOD_ACCESSORY_PROTOCOL
249MENUITEM_SETTING(serial_bitrate, &global_settings.serial_bitrate, NULL);
250#endif
Andree Buschmann850a1122008-04-20 18:28:25 +0000251#ifdef HAVE_ACCESSORY_SUPPLY
252MENUITEM_SETTING(accessory_supply, &global_settings.accessory_supply, NULL);
253#endif
Jonathan Gordon91cb68a2007-03-01 11:14:46 +0000254MENUITEM_SETTING(start_screen, &global_settings.start_in_screen, NULL);
Tomer Shalev8c5141b2009-09-30 10:06:04 +0000255#ifdef USB_ENABLE_HID
Tomer Shalev83d24f82009-10-23 13:29:19 +0000256MENUITEM_SETTING(usb_hid, &global_settings.usb_hid, NULL);
Tomer Shalev8c5141b2009-09-30 10:06:04 +0000257MENUITEM_SETTING(usb_keypad_mode, &global_settings.usb_keypad_mode, NULL);
258#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000259
Teruaki Kawashima92fb1df2009-11-08 13:14:50 +0000260#ifdef HAVE_MORSE_INPUT
261MENUITEM_SETTING(morse_input, &global_settings.morse_input, NULL);
262#endif
263
Jonathan Gordon4b1d1b42007-04-22 13:02:24 +0000264#ifdef HAVE_BUTTON_LIGHT
Jens Arnold5f1ec302007-10-07 15:02:02 +0000265MENUITEM_SETTING(buttonlight_timeout, &global_settings.buttonlight_timeout, NULL);
Jonathan Gordon4b1d1b42007-04-22 13:02:24 +0000266#endif
267
Karl Kurbjun6f95ab72007-05-08 06:45:38 +0000268#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
269MENUITEM_SETTING(buttonlight_brightness, &global_settings.buttonlight_brightness, NULL);
270#endif
271
Michael Sevakisc541e042008-05-29 21:27:44 +0000272#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
273MENUITEM_SETTING(touchpad_sensitivity, &global_settings.touchpad_sensitivity, NULL);
274#endif
275
Michael Giacomellie25f1f92008-12-25 03:23:22 +0000276MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
Jonathan Gordon02a87172007-03-03 13:52:14 +0000277 0, Icon_System_menu,
Jonathan Gordon91cb68a2007-03-01 11:14:46 +0000278 &start_screen,
Nils Wallméniusf28da1a2007-08-12 19:49:03 +0000279#if (BATTERY_CAPACITY_INC > 0) || (BATTERY_TYPES_COUNT > 1)
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000280 &battery_menu,
281#endif
Frank Gevaerts46573012008-10-07 19:37:33 +0000282#if defined(HAVE_DIRCACHE) || defined(HAVE_DISK_STORAGE)
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000283 &disk_menu,
284#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000285 &poweroff,
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000286 &limits_menu,
Teruaki Kawashima92fb1df2009-11-08 13:14:50 +0000287#ifdef HAVE_MORSE_INPUT
288 &morse_input,
289#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000290#if CONFIG_CODEC == MAS3507D
291 &line_in,
292#endif
Jonathan Gordon9a6f4192007-02-18 05:32:06 +0000293#if CONFIG_CHARGING
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000294 &car_adapter_mode,
295#endif
Michael Giacomellie25f1f92008-12-25 03:23:22 +0000296#ifdef IPOD_ACCESSORY_PROTOCOL
Teruaki Kawashima92fb1df2009-11-08 13:14:50 +0000297 &serial_bitrate,
Michael Giacomelli70e9c7a2008-12-25 01:46:16 +0000298#endif
Andree Buschmann850a1122008-04-20 18:28:25 +0000299#ifdef HAVE_ACCESSORY_SUPPLY
300 &accessory_supply,
301#endif
Jonathan Gordon4b1d1b42007-04-22 13:02:24 +0000302#ifdef HAVE_BUTTON_LIGHT
Jens Arnold5f1ec302007-10-07 15:02:02 +0000303 &buttonlight_timeout,
Jonathan Gordon4b1d1b42007-04-22 13:02:24 +0000304#endif
Karl Kurbjun6f95ab72007-05-08 06:45:38 +0000305#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
Steve Bavinea358a12008-01-21 09:48:44 +0000306 &buttonlight_brightness,
307#endif
308#if CONFIG_CODEC == SWCODEC
309 &keyclick_menu,
Karl Kurbjun6f95ab72007-05-08 06:45:38 +0000310#endif
Michael Sevakisc541e042008-05-29 21:27:44 +0000311#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
312 &touchpad_sensitivity,
313#endif
Tomer Shalev8c5141b2009-09-30 10:06:04 +0000314#ifdef USB_ENABLE_HID
Tomer Shalev83d24f82009-10-23 13:29:19 +0000315 &usb_hid,
Tomer Shalev8c5141b2009-09-30 10:06:04 +0000316 &usb_keypad_mode,
317#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000318 );
319
320/* SYSTEM MENU */
321/***********************************/
322
323
324/***********************************/
325/* BOOKMARK MENU */
326static int bmark_callback(int action,const struct menu_item_ex *this_item)
327{
328 (void)this_item;
329 switch (action)
330 {
331 case ACTION_EXIT_MENUITEM: /* on exit */
332 if(global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_YES ||
333 global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_ASK)
334 {
335 if(global_settings.usemrb == BOOKMARK_NO)
336 global_settings.usemrb = BOOKMARK_YES;
Michael Giacomellie25f1f92008-12-25 03:23:22 +0000337
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000338 }
339 break;
340 }
341 return action;
342}
343MENUITEM_SETTING(autocreatebookmark,
344 &global_settings.autocreatebookmark, bmark_callback);
345MENUITEM_SETTING(autoloadbookmark, &global_settings.autoloadbookmark, NULL);
346MENUITEM_SETTING(usemrb, &global_settings.usemrb, NULL);
347MAKE_MENU(bookmark_settings_menu, ID2P(LANG_BOOKMARK_SETTINGS), 0,
Jonathan Gordon02a87172007-03-03 13:52:14 +0000348 Icon_Bookmark,
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000349 &autocreatebookmark, &autoloadbookmark, &usemrb);
350/* BOOKMARK MENU */
351/***********************************/
352
353/***********************************/
354/* VOICE MENU */
355static int talk_callback(int action,const struct menu_item_ex *this_item);
Steve Bavin6fd10ba2007-06-07 09:24:53 +0000356MENUITEM_SETTING(talk_menu_item, &global_settings.talk_menu, NULL);
357MENUITEM_SETTING(talk_dir_item, &global_settings.talk_dir, NULL);
358MENUITEM_SETTING(talk_dir_clip_item, &global_settings.talk_dir_clip, talk_callback);
359MENUITEM_SETTING(talk_file_item, &global_settings.talk_file, NULL);
360MENUITEM_SETTING(talk_file_clip_item, &global_settings.talk_file_clip, talk_callback);
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000361static int talk_callback(int action,const struct menu_item_ex *this_item)
362{
363 static int oldval = 0;
364 switch (action)
365 {
366 case ACTION_ENTER_MENUITEM:
Steve Bavin6fd10ba2007-06-07 09:24:53 +0000367 oldval = global_settings.talk_file_clip;
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000368 break;
369 case ACTION_EXIT_MENUITEM:
370#if CONFIG_CODEC == SWCODEC
371 audio_set_crossfade(global_settings.crossfade);
372#endif
Steve Bavin6fd10ba2007-06-07 09:24:53 +0000373 if (this_item == &talk_dir_clip_item)
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000374 break;
Steve Bavin6fd10ba2007-06-07 09:24:53 +0000375 if (!oldval && global_settings.talk_file_clip)
Michael Giacomellie25f1f92008-12-25 03:23:22 +0000376 {
Steve Bavin6fd10ba2007-06-07 09:24:53 +0000377 /* force reload if newly talking thumbnails,
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000378 because the clip presence is cached only if enabled */
379 reload_directory();
380 }
381 break;
382 }
383 return action;
384}
Stéphane Doyona4f491c2007-11-07 03:25:33 +0000385MENUITEM_SETTING(talk_filetype_item, &global_settings.talk_filetype, NULL);
Stéphane Doyonda932992007-11-03 05:00:49 +0000386MENUITEM_SETTING(talk_battery_level_item,
387 &global_settings.talk_battery_level, NULL);
Jonathan Gordon02a87172007-03-03 13:52:14 +0000388MAKE_MENU(voice_settings_menu, ID2P(LANG_VOICE), 0, Icon_Voice,
Michael Giacomellie25f1f92008-12-25 03:23:22 +0000389 &talk_menu_item, &talk_dir_item, &talk_dir_clip_item,
Stéphane Doyona4f491c2007-11-07 03:25:33 +0000390 &talk_file_item, &talk_file_clip_item, &talk_filetype_item,
Stéphane Doyonda932992007-11-03 05:00:49 +0000391 &talk_battery_level_item);
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000392/* VOICE MENU */
393/***********************************/
394
Christian Gmeiner8181a0c2007-08-27 16:04:32 +0000395
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000396/***********************************/
397/* SETTINGS MENU */
398static int language_browse(void)
399{
400 return (int)rockbox_browse(LANG_DIR, SHOW_LNG);
401}
Jonathan Gordondaf66942007-03-17 12:33:34 +0000402MENUITEM_FUNCTION(browse_langs, 0, ID2P(LANG_LANGUAGE), language_browse,
Jonathan Gordone54d8e12007-03-18 07:03:43 +0000403 NULL, NULL, Icon_Language);
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000404
405MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0,
Jonathan Gordon02a87172007-03-03 13:52:14 +0000406 Icon_General_settings_menu,
Nils Wallménius5aa06652008-10-13 15:11:11 +0000407 &playlist_settings, &file_menu,
Marcoen Hirschberg44c510e2007-03-01 17:39:15 +0000408#ifdef HAVE_TAGCACHE
409 &tagcache_menu,
410#endif
Jonathan Gordon91cb68a2007-03-01 11:14:46 +0000411 &display_menu, &system_menu,
Christian Gmeiner8181a0c2007-08-27 16:04:32 +0000412 &bookmark_settings_menu, &browse_langs, &voice_settings_menu
Christian Gmeiner8181a0c2007-08-27 16:04:32 +0000413 );
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000414/* SETTINGS MENU */
415/***********************************/