diff options
Diffstat (limited to 'apps/main_menu.c')
-rw-r--r-- | apps/main_menu.c | 184 |
1 files changed, 0 insertions, 184 deletions
diff --git a/apps/main_menu.c b/apps/main_menu.c deleted file mode 100644 index 9d702cbb4a..0000000000 --- a/apps/main_menu.c +++ /dev/null | |||
@@ -1,184 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Björn Stenberg | ||
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 | #include <timefuncs.h> | ||
20 | #include "config.h" | ||
21 | #include "menu.h" | ||
22 | #include "tree.h" | ||
23 | #include "lcd.h" | ||
24 | #include "font.h" | ||
25 | #include "action.h" | ||
26 | #include "kernel.h" | ||
27 | #include "main_menu.h" | ||
28 | #include "debug_menu.h" | ||
29 | #include "sprintf.h" | ||
30 | #include <string.h> | ||
31 | #include "settings.h" | ||
32 | #include "settings_menu.h" | ||
33 | #include "power.h" | ||
34 | #include "powermgmt.h" | ||
35 | #include "sound_menu.h" | ||
36 | #include "status.h" | ||
37 | #include "fat.h" | ||
38 | #include "bookmark.h" | ||
39 | #include "buffer.h" | ||
40 | #include "screens.h" | ||
41 | #include "playlist_menu.h" | ||
42 | #include "talk.h" | ||
43 | #if CONFIG_TUNER | ||
44 | #include "radio.h" | ||
45 | #endif | ||
46 | #include "misc.h" | ||
47 | #include "lang.h" | ||
48 | #include "logfdisp.h" | ||
49 | #include "plugin.h" | ||
50 | #include "filetypes.h" | ||
51 | #include "splash.h" | ||
52 | |||
53 | #ifdef HAVE_RECORDING | ||
54 | #include "recording.h" | ||
55 | #endif | ||
56 | |||
57 | #ifdef HAVE_RECORDING | ||
58 | |||
59 | static bool rec_menu_recording_screen(void) | ||
60 | { | ||
61 | return recording_screen(false); | ||
62 | } | ||
63 | |||
64 | static bool recording_settings(void) | ||
65 | { | ||
66 | bool ret; | ||
67 | #ifdef HAVE_FMRADIO_IN | ||
68 | int rec_source = global_settings.rec_source; | ||
69 | #endif | ||
70 | |||
71 | ret = recording_menu(false); | ||
72 | |||
73 | #ifdef HAVE_FMRADIO_IN | ||
74 | if (rec_source != global_settings.rec_source) | ||
75 | { | ||
76 | if (rec_source == AUDIO_SRC_FMRADIO) | ||
77 | radio_stop(); | ||
78 | /* If AUDIO_SRC_FMRADIO was selected from something else, | ||
79 | the recording screen will start the radio */ | ||
80 | } | ||
81 | #endif | ||
82 | |||
83 | return ret; | ||
84 | } | ||
85 | |||
86 | bool rec_menu(void) | ||
87 | { | ||
88 | int m; | ||
89 | bool result; | ||
90 | |||
91 | /* recording menu */ | ||
92 | static const struct menu_item items[] = { | ||
93 | { ID2P(LANG_RECORDING_MENU), rec_menu_recording_screen }, | ||
94 | { ID2P(LANG_RECORDING_SETTINGS), recording_settings}, | ||
95 | }; | ||
96 | |||
97 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
98 | NULL, NULL, NULL); | ||
99 | result = menu_run(m); | ||
100 | menu_exit(m); | ||
101 | |||
102 | return result; | ||
103 | } | ||
104 | #endif | ||
105 | |||
106 | |||
107 | #if 0 | ||
108 | #ifdef HAVE_LCD_CHARCELLS | ||
109 | static bool do_shutdown(void) | ||
110 | { | ||
111 | sys_poweroff(); | ||
112 | return false; | ||
113 | } | ||
114 | #endif | ||
115 | bool main_menu(void) | ||
116 | { | ||
117 | int m; | ||
118 | bool result; | ||
119 | int i = 0; | ||
120 | static bool inside_menu = false; | ||
121 | |||
122 | |||
123 | /* main menu */ | ||
124 | struct menu_item items[11]; | ||
125 | |||
126 | if(inside_menu) return false; | ||
127 | inside_menu = true; | ||
128 | |||
129 | items[i].desc = ID2P(LANG_SOUND_SETTINGS); | ||
130 | items[i++].function = sound_menu; | ||
131 | |||
132 | items[i].desc = ID2P(LANG_GENERAL_SETTINGS); | ||
133 | items[i++].function = settings_menu; | ||
134 | |||
135 | items[i].desc = ID2P(LANG_MANAGE_MENU); | ||
136 | items[i++].function = manage_settings_menu; | ||
137 | |||
138 | items[i].desc = ID2P(LANG_CUSTOM_THEME); | ||
139 | items[i++].function = custom_theme_browse; | ||
140 | |||
141 | #if CONFIG_TUNER | ||
142 | if(radio_hardware_present()) { | ||
143 | items[i].desc = ID2P(LANG_FM_RADIO); | ||
144 | items[i++].function = radio_screen; | ||
145 | } | ||
146 | #endif | ||
147 | |||
148 | #ifdef HAVE_RECORDING | ||
149 | items[i].desc = ID2P(LANG_RECORDING); | ||
150 | items[i++].function = rec_menu; | ||
151 | #endif | ||
152 | |||
153 | items[i].desc = ID2P(LANG_PLAYLIST_MENU); | ||
154 | items[i++].function = playlist_menu; | ||
155 | |||
156 | items[i].desc = ID2P(LANG_PLUGINS); | ||
157 | items[i++].function = plugin_browse; | ||
158 | |||
159 | items[i].desc = ID2P(LANG_INFO); | ||
160 | items[i++].function = info_menu; | ||
161 | |||
162 | #ifdef HAVE_LCD_CHARCELLS | ||
163 | items[i].desc = ID2P(LANG_SHUTDOWN); | ||
164 | items[i++].function = do_shutdown; | ||
165 | #endif | ||
166 | |||
167 | m=menu_init( items, i, NULL, NULL, NULL, NULL ); | ||
168 | #ifdef HAVE_LCD_CHARCELLS | ||
169 | status_set_param(true); | ||
170 | #endif | ||
171 | result = menu_run(m); | ||
172 | #ifdef HAVE_LCD_CHARCELLS | ||
173 | status_set_param(false); | ||
174 | #endif | ||
175 | menu_exit(m); | ||
176 | |||
177 | inside_menu = false; | ||
178 | |||
179 | return result; | ||
180 | } | ||
181 | #endif | ||
182 | /* ----------------------------------------------------------------- | ||
183 | * vim: et sw=4 ts=8 sts=4 tw=78 | ||
184 | */ | ||