Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
Peter D'Hoye | 4d28b2f | 2007-03-29 22:51:03 +0000 | [diff] [blame] | 8 | * $Id$ |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 9 | * |
| 10 | * Copyright (C) 2007 Jonathan Gordon |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 12 | * 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 Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | #include <stdio.h> |
| 22 | #include <string.h> |
| 23 | #include <stdlib.h> |
| 24 | #include <stdbool.h> |
| 25 | #include "config.h" |
| 26 | #include "menu.h" |
| 27 | #include "root_menu.h" |
| 28 | #include "lang.h" |
| 29 | #include "settings.h" |
Jens Arnold | 178c565 | 2007-04-09 13:39:37 +0000 | [diff] [blame] | 30 | #include "screens.h" |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 31 | #include "kernel.h" |
| 32 | #include "debug.h" |
| 33 | #include "misc.h" |
| 34 | #include "rolo.h" |
Jonathan Gordon | 5462a91 | 2007-03-01 12:35:24 +0000 | [diff] [blame] | 35 | #include "powermgmt.h" |
Jens Arnold | 178c565 | 2007-04-09 13:39:37 +0000 | [diff] [blame] | 36 | #include "power.h" |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 37 | #include "talk.h" |
| 38 | #include "audio.h" |
Jonathan Gordon | 2ca895b | 2007-07-03 08:43:38 +0000 | [diff] [blame] | 39 | #include "hotswap.h" |
Nicolas Pennequin | 1cf2ec3 | 2007-04-25 22:08:00 +0000 | [diff] [blame] | 40 | #include "backdrop.h" |
Nicolas Pennequin | 1cf2ec3 | 2007-04-25 22:08:00 +0000 | [diff] [blame] | 41 | |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 42 | /* gui api */ |
| 43 | #include "list.h" |
| 44 | #include "statusbar.h" |
| 45 | #include "splash.h" |
| 46 | #include "buttonbar.h" |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 47 | #include "action.h" |
| 48 | #include "yesno.h" |
| 49 | |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 50 | #include "tree.h" |
Jonathan Gordon | 08575f0 | 2007-03-01 12:18:30 +0000 | [diff] [blame] | 51 | #if CONFIG_TUNER |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 52 | #include "radio.h" |
Jonathan Gordon | 08575f0 | 2007-03-01 12:18:30 +0000 | [diff] [blame] | 53 | #endif |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 54 | #ifdef HAVE_RECORDING |
| 55 | #include "recording.h" |
| 56 | #endif |
| 57 | #include "gwps-common.h" |
| 58 | #include "bookmark.h" |
Dave Chapman | 78d29f5 | 2008-03-26 23:35:34 +0000 | [diff] [blame] | 59 | #include "playlist.h" |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 60 | #include "tagtree.h" |
| 61 | #include "menus/exported_menus.h" |
Dan Everton | c423e87 | 2007-03-01 11:46:26 +0000 | [diff] [blame] | 62 | #ifdef HAVE_RTC_ALARM |
| 63 | #include "rtc.h" |
| 64 | #endif |
Steve Bavin | 8137489 | 2007-03-07 19:56:15 +0000 | [diff] [blame] | 65 | #ifdef HAVE_TAGCACHE |
| 66 | #include "tagcache.h" |
| 67 | #endif |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 68 | |
| 69 | struct root_items { |
| 70 | int (*function)(void* param); |
| 71 | void* param; |
Jonathan Gordon | f9fb492 | 2007-04-12 15:28:51 +0000 | [diff] [blame] | 72 | const struct menu_item_ex *context_menu; |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 73 | }; |
| 74 | static int last_screen = GO_TO_ROOT; /* unfortunatly needed so we can resume |
| 75 | or goto current track based on previous |
| 76 | screen */ |
| 77 | static int browser(void* param) |
| 78 | { |
| 79 | int ret_val; |
Jonathan Gordon | 798ddf2 | 2007-03-07 04:36:02 +0000 | [diff] [blame] | 80 | #ifdef HAVE_TAGCACHE |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 81 | struct tree_context* tc = tree_get_context(); |
Jonathan Gordon | 798ddf2 | 2007-03-07 04:36:02 +0000 | [diff] [blame] | 82 | #endif |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 83 | int filter = SHOW_SUPPORTED; |
| 84 | char folder[MAX_PATH] = "/"; |
| 85 | /* stuff needed to remember position in file browser */ |
| 86 | static char last_folder[MAX_PATH] = "/"; |
| 87 | /* and stuff for the database browser */ |
Jonathan Gordon | 798ddf2 | 2007-03-07 04:36:02 +0000 | [diff] [blame] | 88 | #ifdef HAVE_TAGCACHE |
Jonathan Gordon | fd30be5 | 2007-03-10 12:51:08 +0000 | [diff] [blame] | 89 | static int last_db_dirlevel = 0, last_db_selection = 0; |
Jonathan Gordon | 798ddf2 | 2007-03-07 04:36:02 +0000 | [diff] [blame] | 90 | #endif |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 91 | |
Jonathan Gordon | 08575f0 | 2007-03-01 12:18:30 +0000 | [diff] [blame] | 92 | switch ((intptr_t)param) |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 93 | { |
| 94 | case GO_TO_FILEBROWSER: |
| 95 | filter = global_settings.dirfilter; |
| 96 | if (global_settings.browse_current && |
Steve Bavin | 6cc3895 | 2008-02-09 15:20:15 +0000 | [diff] [blame] | 97 | last_screen == GO_TO_WPS && |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 98 | wps_state.current_track_path[0] != '\0') |
| 99 | { |
Jonathan Gordon | 1b07ed0 | 2007-03-06 08:21:18 +0000 | [diff] [blame] | 100 | strcpy(folder, wps_state.current_track_path); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 101 | } |
Jonathan Gordon | 2ca895b | 2007-07-03 08:43:38 +0000 | [diff] [blame] | 102 | #ifdef HAVE_HOTSWAP /* quick hack to stop crashing if you try entering |
| 103 | the browser from the menu when you were in the card |
| 104 | and it was removed */ |
| 105 | else if (strchr(last_folder, '<') && (card_detect() == false)) |
| 106 | strcpy(folder, "/"); |
| 107 | #endif |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 108 | else |
Jonathan Gordon | 1b07ed0 | 2007-03-06 08:21:18 +0000 | [diff] [blame] | 109 | strcpy(folder, last_folder); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 110 | break; |
Jonathan Gordon | 798ddf2 | 2007-03-07 04:36:02 +0000 | [diff] [blame] | 111 | #ifdef HAVE_TAGCACHE |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 112 | case GO_TO_DBBROWSER: |
Steve Bavin | 8137489 | 2007-03-07 19:56:15 +0000 | [diff] [blame] | 113 | if (!tagcache_is_usable()) |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 114 | { |
Steve Bavin | 149bc03 | 2007-03-08 08:20:30 +0000 | [diff] [blame] | 115 | bool reinit_attempted = false; |
Steve Bavin | 8137489 | 2007-03-07 19:56:15 +0000 | [diff] [blame] | 116 | |
| 117 | /* Now display progress until it's ready or the user exits */ |
| 118 | while(!tagcache_is_usable()) |
| 119 | { |
| 120 | gui_syncstatusbar_draw(&statusbars, false); |
Steve Bavin | 149bc03 | 2007-03-08 08:20:30 +0000 | [diff] [blame] | 121 | struct tagcache_stat *stat = tagcache_get_stat(); |
| 122 | |
| 123 | /* Allow user to exit */ |
| 124 | if (action_userabort(HZ/2)) |
| 125 | break; |
Steve Bavin | 8137489 | 2007-03-07 19:56:15 +0000 | [diff] [blame] | 126 | |
| 127 | /* Maybe just needs to reboot due to delayed commit */ |
| 128 | if (stat->commit_delayed) |
| 129 | { |
Nils Wallménius | 5b76936 | 2007-08-06 13:08:36 +0000 | [diff] [blame] | 130 | gui_syncsplash(HZ*2, ID2P(LANG_PLEASE_REBOOT)); |
Steve Bavin | 8137489 | 2007-03-07 19:56:15 +0000 | [diff] [blame] | 131 | break; |
| 132 | } |
| 133 | |
Steve Bavin | 149bc03 | 2007-03-08 08:20:30 +0000 | [diff] [blame] | 134 | /* Check if ready status is known */ |
| 135 | if (!stat->readyvalid) |
| 136 | { |
Jens Arnold | 4d6374c | 2007-03-16 21:56:08 +0000 | [diff] [blame] | 137 | gui_syncsplash(0, str(LANG_TAGCACHE_BUSY)); |
Steve Bavin | 149bc03 | 2007-03-08 08:20:30 +0000 | [diff] [blame] | 138 | continue; |
| 139 | } |
| 140 | |
| 141 | /* Re-init if required */ |
| 142 | if (!reinit_attempted && !stat->ready && |
| 143 | stat->processed_entries == 0 && stat->commit_step == 0) |
| 144 | { |
| 145 | /* Prompt the user */ |
| 146 | reinit_attempted = true; |
Nils Wallménius | 33c4446 | 2008-04-26 09:30:24 +0000 | [diff] [blame] | 147 | static const char *lines[]={ |
| 148 | ID2P(LANG_TAGCACHE_BUSY), ID2P(LANG_TAGCACHE_FORCE_UPDATE)}; |
| 149 | static const struct text_message message={lines, 2}; |
Steve Bavin | 149bc03 | 2007-03-08 08:20:30 +0000 | [diff] [blame] | 150 | if(gui_syncyesno_run(&message, NULL, NULL) == YESNO_NO) |
| 151 | break; |
| 152 | int i; |
| 153 | FOR_NB_SCREENS(i) |
| 154 | screens[i].clear_display(); |
| 155 | |
| 156 | /* Start initialisation */ |
| 157 | tagcache_rebuild(); |
| 158 | } |
| 159 | |
Steve Bavin | 8137489 | 2007-03-07 19:56:15 +0000 | [diff] [blame] | 160 | /* Display building progress */ |
Nils Wallménius | 5b76936 | 2007-08-06 13:08:36 +0000 | [diff] [blame] | 161 | static long talked_tick = 0; |
Steve Bavin | 32a9575 | 2007-10-19 15:31:42 +0000 | [diff] [blame] | 162 | if(global_settings.talk_menu && |
Nils Wallménius | 5b76936 | 2007-08-06 13:08:36 +0000 | [diff] [blame] | 163 | (talked_tick == 0 |
| 164 | || TIME_AFTER(current_tick, talked_tick+7*HZ))) |
| 165 | { |
| 166 | talked_tick = current_tick; |
| 167 | if (stat->commit_step > 0) |
| 168 | { |
| 169 | talk_id(LANG_TAGCACHE_INIT, false); |
| 170 | talk_number(stat->commit_step, true); |
| 171 | talk_id(VOICE_OF, true); |
| 172 | talk_number(tagcache_get_max_commit_step(), true); |
| 173 | } else if(stat->processed_entries) |
| 174 | { |
| 175 | talk_number(stat->processed_entries, false); |
| 176 | talk_id(LANG_BUILDING_DATABASE, true); |
| 177 | } |
| 178 | } |
Steve Bavin | 8137489 | 2007-03-07 19:56:15 +0000 | [diff] [blame] | 179 | if (stat->commit_step > 0) |
| 180 | { |
Jens Arnold | 4d6374c | 2007-03-16 21:56:08 +0000 | [diff] [blame] | 181 | gui_syncsplash(0, "%s [%d/%d]", |
Steve Bavin | 8137489 | 2007-03-07 19:56:15 +0000 | [diff] [blame] | 182 | str(LANG_TAGCACHE_INIT), stat->commit_step, |
| 183 | tagcache_get_max_commit_step()); |
| 184 | } |
| 185 | else |
| 186 | { |
Jens Arnold | 4d6374c | 2007-03-16 21:56:08 +0000 | [diff] [blame] | 187 | gui_syncsplash(0, str(LANG_BUILDING_DATABASE), |
Steve Bavin | 8137489 | 2007-03-07 19:56:15 +0000 | [diff] [blame] | 188 | stat->processed_entries); |
| 189 | } |
Steve Bavin | 8137489 | 2007-03-07 19:56:15 +0000 | [diff] [blame] | 190 | } |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 191 | } |
Steve Bavin | 8137489 | 2007-03-07 19:56:15 +0000 | [diff] [blame] | 192 | if (!tagcache_is_usable()) |
| 193 | return GO_TO_PREVIOUS; |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 194 | filter = SHOW_ID3DB; |
| 195 | tc->dirlevel = last_db_dirlevel; |
Jonathan Gordon | fd30be5 | 2007-03-10 12:51:08 +0000 | [diff] [blame] | 196 | tc->selected_item = last_db_selection; |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 197 | break; |
Jonathan Gordon | 798ddf2 | 2007-03-07 04:36:02 +0000 | [diff] [blame] | 198 | #endif |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 199 | case GO_TO_BROWSEPLUGINS: |
| 200 | filter = SHOW_PLUGINS; |
Peter D'Hoye | 5737254 | 2007-07-11 22:05:38 +0000 | [diff] [blame] | 201 | snprintf(folder, MAX_PATH, "%s", PLUGIN_DIR); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 202 | break; |
| 203 | } |
| 204 | ret_val = rockbox_browse(folder, filter); |
Jonathan Gordon | 08575f0 | 2007-03-01 12:18:30 +0000 | [diff] [blame] | 205 | switch ((intptr_t)param) |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 206 | { |
| 207 | case GO_TO_FILEBROWSER: |
Jonathan Gordon | 1b07ed0 | 2007-03-06 08:21:18 +0000 | [diff] [blame] | 208 | get_current_file(last_folder, MAX_PATH); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 209 | break; |
Jonathan Gordon | 798ddf2 | 2007-03-07 04:36:02 +0000 | [diff] [blame] | 210 | #ifdef HAVE_TAGCACHE |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 211 | case GO_TO_DBBROWSER: |
| 212 | last_db_dirlevel = tc->dirlevel; |
Jonathan Gordon | fd30be5 | 2007-03-10 12:51:08 +0000 | [diff] [blame] | 213 | last_db_selection = tc->selected_item; |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 214 | break; |
Jonathan Gordon | 798ddf2 | 2007-03-07 04:36:02 +0000 | [diff] [blame] | 215 | #endif |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 216 | } |
| 217 | return ret_val; |
| 218 | } |
| 219 | |
| 220 | static int menu(void* param) |
| 221 | { |
| 222 | (void)param; |
Jonathan Gordon | 5ca1539 | 2008-03-26 03:35:24 +0000 | [diff] [blame] | 223 | return do_menu(NULL, 0, NULL, false); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 224 | |
| 225 | } |
| 226 | #ifdef HAVE_RECORDING |
| 227 | static int recscrn(void* param) |
| 228 | { |
| 229 | (void)param; |
| 230 | recording_screen(false); |
| 231 | return GO_TO_ROOT; |
| 232 | } |
| 233 | #endif |
| 234 | static int wpsscrn(void* param) |
| 235 | { |
| 236 | int ret_val = GO_TO_PREVIOUS; |
| 237 | (void)param; |
| 238 | if (audio_status()) |
| 239 | { |
Steve Bavin | 32a9575 | 2007-10-19 15:31:42 +0000 | [diff] [blame] | 240 | talk_shutup(); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 241 | ret_val = gui_wps_show(); |
| 242 | } |
| 243 | else if ( global_status.resume_index != -1 ) |
| 244 | { |
Jens Arnold | f68362a | 2007-03-17 09:54:28 +0000 | [diff] [blame] | 245 | DEBUGF("Resume index %X offset %lX\n", |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 246 | global_status.resume_index, |
Jens Arnold | bd5c0ad | 2007-03-17 10:50:58 +0000 | [diff] [blame] | 247 | (unsigned long)global_status.resume_offset); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 248 | if (playlist_resume() != -1) |
| 249 | { |
| 250 | playlist_start(global_status.resume_index, |
| 251 | global_status.resume_offset); |
| 252 | ret_val = gui_wps_show(); |
| 253 | } |
| 254 | } |
Jens Arnold | f68362a | 2007-03-17 09:54:28 +0000 | [diff] [blame] | 255 | else |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 256 | { |
Nils Wallménius | 5b76936 | 2007-08-06 13:08:36 +0000 | [diff] [blame] | 257 | gui_syncsplash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME)); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 258 | } |
| 259 | #if LCD_DEPTH > 1 |
| 260 | show_main_backdrop(); |
| 261 | #endif |
Nicolas Pennequin | 7fdfa56 | 2007-04-25 21:44:56 +0000 | [diff] [blame] | 262 | #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 |
| 263 | show_remote_main_backdrop(); |
| 264 | #endif |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 265 | return ret_val; |
| 266 | } |
| 267 | #if CONFIG_TUNER |
| 268 | static int radio(void* param) |
| 269 | { |
| 270 | (void)param; |
| 271 | radio_screen(); |
| 272 | return GO_TO_ROOT; |
| 273 | } |
| 274 | #endif |
| 275 | |
| 276 | static int load_bmarks(void* param) |
| 277 | { |
| 278 | (void)param; |
Stéphane Doyon | 84ed3fd | 2007-10-12 04:10:08 +0000 | [diff] [blame] | 279 | if(bookmark_mrb_load()) |
| 280 | return GO_TO_WPS; |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 281 | return GO_TO_PREVIOUS; |
| 282 | } |
Jonathan Gordon | fda7d72 | 2007-08-06 13:42:52 +0000 | [diff] [blame] | 283 | static int plugins_menu(void* param) |
| 284 | { |
| 285 | (void)param; |
| 286 | MENUITEM_STRINGLIST(plugins_menu_items, ID2P(LANG_PLUGINS), NULL, |
| 287 | ID2P(LANG_PLUGIN_GAMES), |
| 288 | ID2P(LANG_PLUGIN_APPS), ID2P(LANG_PLUGIN_DEMOS)); |
| 289 | char *folder; |
| 290 | int retval = GO_TO_PREVIOUS; |
| 291 | int selection = 0, current = 0; |
| 292 | while (retval == GO_TO_PREVIOUS) |
| 293 | { |
Jonathan Gordon | 5ca1539 | 2008-03-26 03:35:24 +0000 | [diff] [blame] | 294 | selection = do_menu(&plugins_menu_items, ¤t, NULL, false); |
Jonathan Gordon | fda7d72 | 2007-08-06 13:42:52 +0000 | [diff] [blame] | 295 | switch (selection) |
| 296 | { |
| 297 | case 0: |
| 298 | folder = PLUGIN_GAMES_DIR; |
| 299 | break; |
| 300 | case 1: |
| 301 | folder = PLUGIN_APPS_DIR; |
| 302 | break; |
| 303 | case 2: |
| 304 | folder = PLUGIN_DEMOS_DIR; |
| 305 | break; |
| 306 | default: |
| 307 | return selection; |
| 308 | } |
| 309 | retval = rockbox_browse(folder, SHOW_PLUGINS); |
| 310 | } |
| 311 | return retval; |
| 312 | } |
| 313 | |
Jonathan Gordon | f9fb492 | 2007-04-12 15:28:51 +0000 | [diff] [blame] | 314 | /* These are all static const'd from apps/menus/ *.c |
| 315 | so little hack so we can use them */ |
| 316 | extern struct menu_item_ex |
| 317 | file_menu, |
Brandon Low | b44b660 | 2007-04-18 19:46:34 +0000 | [diff] [blame] | 318 | #ifdef HAVE_TAGCACHE |
Jonathan Gordon | f9fb492 | 2007-04-12 15:28:51 +0000 | [diff] [blame] | 319 | tagcache_menu, |
Brandon Low | b44b660 | 2007-04-18 19:46:34 +0000 | [diff] [blame] | 320 | #endif |
Jonathan Gordon | f9fb492 | 2007-04-12 15:28:51 +0000 | [diff] [blame] | 321 | manage_settings, |
Peter D'Hoye | 9337efd | 2007-07-03 18:31:13 +0000 | [diff] [blame] | 322 | recording_settings_menu, |
| 323 | radio_settings_menu, |
Jonathan Gordon | f9fb492 | 2007-04-12 15:28:51 +0000 | [diff] [blame] | 324 | bookmark_settings_menu, |
| 325 | system_menu; |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 326 | static const struct root_items items[] = { |
Jonathan Gordon | f9fb492 | 2007-04-12 15:28:51 +0000 | [diff] [blame] | 327 | [GO_TO_FILEBROWSER] = { browser, (void*)GO_TO_FILEBROWSER, &file_menu}, |
Brandon Low | b44b660 | 2007-04-18 19:46:34 +0000 | [diff] [blame] | 328 | #ifdef HAVE_TAGCACHE |
Jonathan Gordon | f9fb492 | 2007-04-12 15:28:51 +0000 | [diff] [blame] | 329 | [GO_TO_DBBROWSER] = { browser, (void*)GO_TO_DBBROWSER, &tagcache_menu }, |
Brandon Low | b44b660 | 2007-04-18 19:46:34 +0000 | [diff] [blame] | 330 | #endif |
Steve Bavin | 5f8bd63 | 2008-05-22 08:02:48 +0000 | [diff] [blame] | 331 | [GO_TO_WPS] = { wpsscrn, NULL, &playback_settings }, |
Jonathan Gordon | f9fb492 | 2007-04-12 15:28:51 +0000 | [diff] [blame] | 332 | [GO_TO_MAINMENU] = { menu, NULL, &manage_settings }, |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 333 | |
| 334 | #ifdef HAVE_RECORDING |
Peter D'Hoye | 9337efd | 2007-07-03 18:31:13 +0000 | [diff] [blame] | 335 | [GO_TO_RECSCREEN] = { recscrn, NULL, &recording_settings_menu }, |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 336 | #endif |
| 337 | |
| 338 | #if CONFIG_TUNER |
Peter D'Hoye | 9337efd | 2007-07-03 18:31:13 +0000 | [diff] [blame] | 339 | [GO_TO_FM] = { radio, NULL, &radio_settings_menu }, |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 340 | #endif |
| 341 | |
Jonathan Gordon | f9fb492 | 2007-04-12 15:28:51 +0000 | [diff] [blame] | 342 | [GO_TO_RECENTBMARKS] = { load_bmarks, NULL, &bookmark_settings_menu }, |
Jonathan Gordon | fda7d72 | 2007-08-06 13:42:52 +0000 | [diff] [blame] | 343 | [GO_TO_BROWSEPLUGINS] = { plugins_menu, NULL, NULL }, |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 344 | |
| 345 | }; |
| 346 | static const int nb_items = sizeof(items)/sizeof(*items); |
| 347 | |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 348 | int item_callback(int action, const struct menu_item_ex *this_item) ; |
| 349 | |
| 350 | MENUITEM_RETURNVALUE(file_browser, ID2P(LANG_DIR_BROWSER), GO_TO_FILEBROWSER, |
Jonathan Gordon | 02a8717 | 2007-03-03 13:52:14 +0000 | [diff] [blame] | 351 | NULL, Icon_file_view_menu); |
Jonathan Gordon | 798ddf2 | 2007-03-07 04:36:02 +0000 | [diff] [blame] | 352 | #ifdef HAVE_TAGCACHE |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 353 | MENUITEM_RETURNVALUE(db_browser, ID2P(LANG_TAGCACHE), GO_TO_DBBROWSER, |
Jonathan Gordon | 02a8717 | 2007-03-03 13:52:14 +0000 | [diff] [blame] | 354 | NULL, Icon_Audio); |
Jonathan Gordon | 798ddf2 | 2007-03-07 04:36:02 +0000 | [diff] [blame] | 355 | #endif |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 356 | MENUITEM_RETURNVALUE(rocks_browser, ID2P(LANG_PLUGINS), GO_TO_BROWSEPLUGINS, |
Jonathan Gordon | 02a8717 | 2007-03-03 13:52:14 +0000 | [diff] [blame] | 357 | NULL, Icon_Plugin); |
Bertrik Sikken | e15f8a2 | 2008-05-03 08:35:14 +0000 | [diff] [blame] | 358 | static char *get_wps_item_name(int selected_item, void * data, char *buffer) |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 359 | { |
| 360 | (void)selected_item; (void)data; (void)buffer; |
| 361 | if (audio_status()) |
Linus Nielsen Feltzing | 298c2bb | 2007-03-05 00:32:33 +0000 | [diff] [blame] | 362 | return ID2P(LANG_NOW_PLAYING); |
| 363 | return ID2P(LANG_RESUME_PLAYBACK); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 364 | } |
| 365 | MENUITEM_RETURNVALUE_DYNTEXT(wps_item, GO_TO_WPS, NULL, get_wps_item_name, |
Stéphane Doyon | 5acf091 | 2007-10-09 03:48:56 +0000 | [diff] [blame] | 366 | NULL, NULL, Icon_Playback_menu); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 367 | #ifdef HAVE_RECORDING |
Nils Wallménius | b311367 | 2007-08-05 19:19:39 +0000 | [diff] [blame] | 368 | MENUITEM_RETURNVALUE(rec, ID2P(LANG_RECORDING), GO_TO_RECSCREEN, |
Jonathan Gordon | 02a8717 | 2007-03-03 13:52:14 +0000 | [diff] [blame] | 369 | NULL, Icon_Recording); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 370 | #endif |
| 371 | #if CONFIG_TUNER |
| 372 | MENUITEM_RETURNVALUE(fm, ID2P(LANG_FM_RADIO), GO_TO_FM, |
Jonathan Gordon | 02a8717 | 2007-03-03 13:52:14 +0000 | [diff] [blame] | 373 | item_callback, Icon_Radio_screen); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 374 | #endif |
Nils Wallménius | b311367 | 2007-08-05 19:19:39 +0000 | [diff] [blame] | 375 | MENUITEM_RETURNVALUE(menu_, ID2P(LANG_SETTINGS), GO_TO_MAINMENU, |
Jonathan Gordon | 02a8717 | 2007-03-03 13:52:14 +0000 | [diff] [blame] | 376 | NULL, Icon_Submenu_Entered); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 377 | MENUITEM_RETURNVALUE(bookmarks, ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS), |
| 378 | GO_TO_RECENTBMARKS, item_callback, |
Jonathan Gordon | 02a8717 | 2007-03-03 13:52:14 +0000 | [diff] [blame] | 379 | Icon_Bookmark); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 380 | #ifdef HAVE_LCD_CHARCELLS |
| 381 | static int do_shutdown(void) |
| 382 | { |
Jens Arnold | 5764ff5 | 2007-04-09 13:54:38 +0000 | [diff] [blame] | 383 | #if CONFIG_CHARGING |
Jens Arnold | 178c565 | 2007-04-09 13:39:37 +0000 | [diff] [blame] | 384 | if (charger_inserted()) |
| 385 | charging_splash(); |
| 386 | else |
Jens Arnold | 5764ff5 | 2007-04-09 13:54:38 +0000 | [diff] [blame] | 387 | #endif |
Jens Arnold | 178c565 | 2007-04-09 13:39:37 +0000 | [diff] [blame] | 388 | sys_poweroff(); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 389 | return 0; |
| 390 | } |
Jonathan Gordon | daf6694 | 2007-03-17 12:33:34 +0000 | [diff] [blame] | 391 | MENUITEM_FUNCTION(do_shutdown_item, 0, ID2P(LANG_SHUTDOWN), |
Jonathan Gordon | 458648b | 2007-03-18 07:25:01 +0000 | [diff] [blame] | 392 | do_shutdown, NULL, NULL, Icon_NOICON); |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 393 | #endif |
| 394 | MAKE_MENU(root_menu_, ID2P(LANG_ROCKBOX_TITLE), |
Jonathan Gordon | 411f3e2 | 2007-07-11 02:22:03 +0000 | [diff] [blame] | 395 | item_callback, Icon_Rockbox, |
Jonathan Gordon | 798ddf2 | 2007-03-07 04:36:02 +0000 | [diff] [blame] | 396 | &bookmarks, &file_browser, |
| 397 | #ifdef HAVE_TAGCACHE |
| 398 | &db_browser, |
| 399 | #endif |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 400 | &wps_item, &menu_, |
| 401 | #ifdef HAVE_RECORDING |
| 402 | &rec, |
| 403 | #endif |
| 404 | #if CONFIG_TUNER |
| 405 | &fm, |
| 406 | #endif |
| 407 | &playlist_options, &rocks_browser, &info_menu |
| 408 | |
| 409 | #ifdef HAVE_LCD_CHARCELLS |
| 410 | ,&do_shutdown_item |
| 411 | #endif |
| 412 | ); |
| 413 | |
| 414 | int item_callback(int action, const struct menu_item_ex *this_item) |
| 415 | { |
| 416 | switch (action) |
| 417 | { |
Jonathan Gordon | 411f3e2 | 2007-07-11 02:22:03 +0000 | [diff] [blame] | 418 | case ACTION_TREE_STOP: |
| 419 | return ACTION_REDRAW; |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 420 | case ACTION_REQUEST_MENUITEM: |
| 421 | #if CONFIG_TUNER |
| 422 | if (this_item == &fm) |
| 423 | { |
| 424 | if (radio_hardware_present() == 0) |
| 425 | return ACTION_EXIT_MENUITEM; |
| 426 | } |
| 427 | else |
| 428 | #endif |
| 429 | if (this_item == &bookmarks) |
| 430 | { |
| 431 | if (global_settings.usemrb == 0) |
| 432 | return ACTION_EXIT_MENUITEM; |
| 433 | } |
| 434 | break; |
| 435 | } |
| 436 | return action; |
| 437 | } |
Jonathan Gordon | 6bb473d | 2007-03-05 13:36:00 +0000 | [diff] [blame] | 438 | static int get_selection(int last_screen) |
| 439 | { |
| 440 | unsigned int i; |
| 441 | for(i=0; i< sizeof(root_menu__)/sizeof(*root_menu__); i++) |
| 442 | { |
Jonathan Gordon | 680acbf | 2007-04-25 10:41:17 +0000 | [diff] [blame] | 443 | if (((root_menu__[i]->flags&MENU_TYPE_MASK) == MT_RETURN_VALUE) && |
Jonathan Gordon | 6bb473d | 2007-03-05 13:36:00 +0000 | [diff] [blame] | 444 | (root_menu__[i]->value == last_screen)) |
| 445 | { |
| 446 | return i; |
| 447 | } |
| 448 | } |
| 449 | return 0; |
| 450 | } |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 451 | |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 452 | static inline int load_screen(int screen) |
| 453 | { |
| 454 | /* set the global_status.last_screen before entering, |
| 455 | if we dont we will always return to the wrong screen on boot */ |
| 456 | int old_previous = last_screen; |
| 457 | int ret_val; |
| 458 | if (screen <= GO_TO_ROOT) |
| 459 | return screen; |
| 460 | if (screen == old_previous) |
| 461 | old_previous = GO_TO_ROOT; |
| 462 | global_status.last_screen = (char)screen; |
| 463 | status_save(); |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 464 | ret_val = items[screen].function(items[screen].param); |
Robert Kukla | 1f33735 | 2007-03-31 21:59:57 +0000 | [diff] [blame] | 465 | last_screen = screen; |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 466 | if (ret_val == GO_TO_PREVIOUS) |
| 467 | last_screen = old_previous; |
| 468 | return ret_val; |
| 469 | } |
Jonathan Gordon | f9fb492 | 2007-04-12 15:28:51 +0000 | [diff] [blame] | 470 | static int load_context_screen(int selection) |
| 471 | { |
| 472 | const struct menu_item_ex *context_menu = NULL; |
Jonathan Gordon | 680acbf | 2007-04-25 10:41:17 +0000 | [diff] [blame] | 473 | if ((root_menu__[selection]->flags&MENU_TYPE_MASK) == MT_RETURN_VALUE) |
Jonathan Gordon | f9fb492 | 2007-04-12 15:28:51 +0000 | [diff] [blame] | 474 | { |
| 475 | int item = root_menu__[selection]->value; |
| 476 | context_menu = items[item].context_menu; |
| 477 | } |
| 478 | /* special cases */ |
| 479 | else if (root_menu__[selection] == &info_menu) |
| 480 | { |
| 481 | context_menu = &system_menu; |
| 482 | } |
| 483 | |
| 484 | if (context_menu) |
Jonathan Gordon | 5ca1539 | 2008-03-26 03:35:24 +0000 | [diff] [blame] | 485 | return do_menu(context_menu, NULL, NULL, false); |
Jonathan Gordon | f9fb492 | 2007-04-12 15:28:51 +0000 | [diff] [blame] | 486 | else |
| 487 | return GO_TO_PREVIOUS; |
| 488 | } |
Stéphane Doyon | 6d08116 | 2007-10-12 04:20:20 +0000 | [diff] [blame] | 489 | |
| 490 | static int previous_music = GO_TO_WPS; |
| 491 | |
| 492 | void previous_music_is_wps(void) |
| 493 | { |
| 494 | previous_music = GO_TO_WPS; |
| 495 | } |
| 496 | |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 497 | void root_menu(void) |
| 498 | { |
| 499 | int previous_browser = GO_TO_FILEBROWSER; |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 500 | int next_screen = GO_TO_ROOT; |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 501 | int selected = 0; |
| 502 | |
| 503 | if (global_settings.start_in_screen == 0) |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 504 | next_screen = (int)global_status.last_screen; |
| 505 | else next_screen = global_settings.start_in_screen - 2; |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 506 | |
Jonathan Gordon | 9e554a8 | 2007-03-07 01:16:25 +0000 | [diff] [blame] | 507 | #ifdef HAVE_RTC_ALARM |
| 508 | if ( rtc_check_alarm_started(true) ) |
| 509 | { |
| 510 | rtc_enable_alarm(false); |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 511 | next_screen = GO_TO_WPS; |
Jonathan Gordon | 9e554a8 | 2007-03-07 01:16:25 +0000 | [diff] [blame] | 512 | #if CONFIG_TUNER |
| 513 | if (global_settings.alarm_wake_up_screen == ALARM_START_FM) |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 514 | next_screen = GO_TO_FM; |
Jonathan Gordon | 9e554a8 | 2007-03-07 01:16:25 +0000 | [diff] [blame] | 515 | #endif |
| 516 | #ifdef HAVE_RECORDING |
| 517 | if (global_settings.alarm_wake_up_screen == ALARM_START_REC) |
Jonathan Gordon | e900a90 | 2007-03-07 01:59:29 +0000 | [diff] [blame] | 518 | { |
| 519 | recording_start_automatic = true; |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 520 | next_screen = GO_TO_RECSCREEN; |
Jonathan Gordon | e900a90 | 2007-03-07 01:59:29 +0000 | [diff] [blame] | 521 | } |
Jonathan Gordon | 9e554a8 | 2007-03-07 01:16:25 +0000 | [diff] [blame] | 522 | #endif |
| 523 | } |
| 524 | #endif /* HAVE_RTC_ALARM */ |
| 525 | |
Jonathan Gordon | 7ce492e | 2007-03-08 00:37:58 +0000 | [diff] [blame] | 526 | #ifdef HAVE_HEADPHONE_DETECTION |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 527 | if (next_screen == GO_TO_WPS && |
Jonathan Gordon | 7ce492e | 2007-03-08 00:37:58 +0000 | [diff] [blame] | 528 | (global_settings.unplug_autoresume && !headphones_inserted() )) |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 529 | next_screen = GO_TO_ROOT; |
Jonathan Gordon | 7ce492e | 2007-03-08 00:37:58 +0000 | [diff] [blame] | 530 | #endif |
| 531 | |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 532 | while (true) |
| 533 | { |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 534 | switch (next_screen) |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 535 | { |
Jonathan Gordon | 91e726a | 2007-03-27 06:38:11 +0000 | [diff] [blame] | 536 | case MENU_ATTACHED_USB: |
| 537 | case MENU_SELECTED_EXIT: |
Jonathan Gordon | 91e726a | 2007-03-27 06:38:11 +0000 | [diff] [blame] | 538 | /* fall through */ |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 539 | case GO_TO_ROOT: |
Jonathan Gordon | 43b2d09 | 2007-03-07 10:13:07 +0000 | [diff] [blame] | 540 | if (last_screen != GO_TO_ROOT) |
| 541 | selected = get_selection(last_screen); |
Jonathan Gordon | 5ca1539 | 2008-03-26 03:35:24 +0000 | [diff] [blame] | 542 | next_screen = do_menu(&root_menu_, &selected, NULL, false); |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 543 | if (next_screen != GO_TO_PREVIOUS) |
| 544 | last_screen = GO_TO_ROOT; |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 545 | break; |
Jonathan Gordon | a74eefe | 2007-03-06 13:35:15 +0000 | [diff] [blame] | 546 | |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 547 | case GO_TO_PREVIOUS: |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 548 | next_screen = last_screen; |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 549 | break; |
Jonathan Gordon | a74eefe | 2007-03-06 13:35:15 +0000 | [diff] [blame] | 550 | |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 551 | case GO_TO_PREVIOUS_BROWSER: |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 552 | next_screen = previous_browser; |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 553 | break; |
Jonathan Gordon | a74eefe | 2007-03-06 13:35:15 +0000 | [diff] [blame] | 554 | |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 555 | case GO_TO_PREVIOUS_MUSIC: |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 556 | next_screen = previous_music; |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 557 | break; |
Jonathan Gordon | f9fb492 | 2007-04-12 15:28:51 +0000 | [diff] [blame] | 558 | case GO_TO_ROOTITEM_CONTEXT: |
| 559 | next_screen = load_context_screen(selected); |
| 560 | break; |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 561 | default: |
| 562 | if (next_screen == GO_TO_FILEBROWSER |
Steve Bavin | 888890a | 2007-03-09 16:54:35 +0000 | [diff] [blame] | 563 | #ifdef HAVE_TAGCACHE |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 564 | || next_screen == GO_TO_DBBROWSER |
Steve Bavin | 888890a | 2007-03-09 16:54:35 +0000 | [diff] [blame] | 565 | #endif |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 566 | ) |
| 567 | previous_browser = next_screen; |
| 568 | if (next_screen == GO_TO_WPS |
Jonathan Gordon | ec7ca33 | 2007-04-05 02:50:43 +0000 | [diff] [blame] | 569 | #if CONFIG_TUNER |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 570 | || next_screen == GO_TO_FM |
Steve Bavin | 888890a | 2007-03-09 16:54:35 +0000 | [diff] [blame] | 571 | #endif |
Jonathan Gordon | 678705c | 2007-03-29 14:19:28 +0000 | [diff] [blame] | 572 | ) |
| 573 | previous_music = next_screen; |
| 574 | next_screen = load_screen(next_screen); |
| 575 | break; |
| 576 | } /* switch() */ |
Jonathan Gordon | 91cb68a | 2007-03-01 11:14:46 +0000 | [diff] [blame] | 577 | } |
| 578 | return; |
| 579 | } |