diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-03-07 04:36:02 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-03-07 04:36:02 +0000 |
commit | 798ddf201c7110eb9961938d9056bdd27cc9d818 (patch) | |
tree | 06b5c7ff3b3a87136523c5dda3d636ab16f85507 | |
parent | e900a90e11f66f680a327b2f5c7600f4068d8e9e (diff) | |
download | rockbox-798ddf201c7110eb9961938d9056bdd27cc9d818.tar.gz rockbox-798ddf201c7110eb9961938d9056bdd27cc9d818.zip |
#ifdef HAVE_TAGCACHE
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12656 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/root_menu.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/apps/root_menu.c b/apps/root_menu.c index ea2912524b..a7713f748e 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c | |||
@@ -72,13 +72,17 @@ static int last_screen = GO_TO_ROOT; /* unfortunatly needed so we can resume | |||
72 | static int browser(void* param) | 72 | static int browser(void* param) |
73 | { | 73 | { |
74 | int ret_val; | 74 | int ret_val; |
75 | #ifdef HAVE_TAGCACHE | ||
75 | struct tree_context* tc = tree_get_context(); | 76 | struct tree_context* tc = tree_get_context(); |
77 | #endif | ||
76 | int filter = SHOW_SUPPORTED; | 78 | int filter = SHOW_SUPPORTED; |
77 | char folder[MAX_PATH] = "/"; | 79 | char folder[MAX_PATH] = "/"; |
78 | /* stuff needed to remember position in file browser */ | 80 | /* stuff needed to remember position in file browser */ |
79 | static char last_folder[MAX_PATH] = "/"; | 81 | static char last_folder[MAX_PATH] = "/"; |
80 | /* and stuff for the database browser */ | 82 | /* and stuff for the database browser */ |
83 | #ifdef HAVE_TAGCACHE | ||
81 | static int last_db_dirlevel = 0; | 84 | static int last_db_dirlevel = 0; |
85 | #endif | ||
82 | 86 | ||
83 | switch ((intptr_t)param) | 87 | switch ((intptr_t)param) |
84 | { | 88 | { |
@@ -93,6 +97,7 @@ static int browser(void* param) | |||
93 | else | 97 | else |
94 | strcpy(folder, last_folder); | 98 | strcpy(folder, last_folder); |
95 | break; | 99 | break; |
100 | #ifdef HAVE_TAGCACHE | ||
96 | case GO_TO_DBBROWSER: | 101 | case GO_TO_DBBROWSER: |
97 | if ((last_screen != GO_TO_ROOT) && !tagcache_is_usable()) | 102 | if ((last_screen != GO_TO_ROOT) && !tagcache_is_usable()) |
98 | { | 103 | { |
@@ -102,6 +107,7 @@ static int browser(void* param) | |||
102 | filter = SHOW_ID3DB; | 107 | filter = SHOW_ID3DB; |
103 | tc->dirlevel = last_db_dirlevel; | 108 | tc->dirlevel = last_db_dirlevel; |
104 | break; | 109 | break; |
110 | #endif | ||
105 | case GO_TO_BROWSEPLUGINS: | 111 | case GO_TO_BROWSEPLUGINS: |
106 | filter = SHOW_PLUGINS; | 112 | filter = SHOW_PLUGINS; |
107 | snprintf(folder, MAX_PATH, "%s/", PLUGIN_DIR); | 113 | snprintf(folder, MAX_PATH, "%s/", PLUGIN_DIR); |
@@ -113,9 +119,11 @@ static int browser(void* param) | |||
113 | case GO_TO_FILEBROWSER: | 119 | case GO_TO_FILEBROWSER: |
114 | get_current_file(last_folder, MAX_PATH); | 120 | get_current_file(last_folder, MAX_PATH); |
115 | break; | 121 | break; |
122 | #ifdef HAVE_TAGCACHE | ||
116 | case GO_TO_DBBROWSER: | 123 | case GO_TO_DBBROWSER: |
117 | last_db_dirlevel = tc->dirlevel; | 124 | last_db_dirlevel = tc->dirlevel; |
118 | break; | 125 | break; |
126 | #endif | ||
119 | } | 127 | } |
120 | /* hopefully only happens trying to go back into the WPS | 128 | /* hopefully only happens trying to go back into the WPS |
121 | from plugins, if music is stopped... */ | 129 | from plugins, if music is stopped... */ |
@@ -223,8 +231,10 @@ int item_callback(int action, const struct menu_item_ex *this_item) ; | |||
223 | 231 | ||
224 | MENUITEM_RETURNVALUE(file_browser, ID2P(LANG_DIR_BROWSER), GO_TO_FILEBROWSER, | 232 | MENUITEM_RETURNVALUE(file_browser, ID2P(LANG_DIR_BROWSER), GO_TO_FILEBROWSER, |
225 | NULL, Icon_file_view_menu); | 233 | NULL, Icon_file_view_menu); |
234 | #ifdef HAVE_TAGCACHE | ||
226 | MENUITEM_RETURNVALUE(db_browser, ID2P(LANG_TAGCACHE), GO_TO_DBBROWSER, | 235 | MENUITEM_RETURNVALUE(db_browser, ID2P(LANG_TAGCACHE), GO_TO_DBBROWSER, |
227 | NULL, Icon_Audio); | 236 | NULL, Icon_Audio); |
237 | #endif | ||
228 | MENUITEM_RETURNVALUE(rocks_browser, ID2P(LANG_PLUGINS), GO_TO_BROWSEPLUGINS, | 238 | MENUITEM_RETURNVALUE(rocks_browser, ID2P(LANG_PLUGINS), GO_TO_BROWSEPLUGINS, |
229 | NULL, Icon_Plugin); | 239 | NULL, Icon_Plugin); |
230 | char *get_wps_item_name(int selected_item, void * data, char *buffer) | 240 | char *get_wps_item_name(int selected_item, void * data, char *buffer) |
@@ -259,7 +269,10 @@ MENUITEM_FUNCTION(do_shutdown_item, ID2P(LANG_SHUTDOWN), do_shutdown, NULL, Icon | |||
259 | #endif | 269 | #endif |
260 | MAKE_MENU(root_menu_, ID2P(LANG_ROCKBOX_TITLE), | 270 | MAKE_MENU(root_menu_, ID2P(LANG_ROCKBOX_TITLE), |
261 | NULL, Icon_Rockbox, | 271 | NULL, Icon_Rockbox, |
262 | &bookmarks, &file_browser, &db_browser, | 272 | &bookmarks, &file_browser, |
273 | #ifdef HAVE_TAGCACHE | ||
274 | &db_browser, | ||
275 | #endif | ||
263 | &wps_item, &menu_, | 276 | &wps_item, &menu_, |
264 | #ifdef HAVE_RECORDING | 277 | #ifdef HAVE_RECORDING |
265 | &rec, | 278 | &rec, |
@@ -365,16 +378,20 @@ void root_menu(void) | |||
365 | break; | 378 | break; |
366 | 379 | ||
367 | case GO_TO_PREVIOUS_BROWSER: | 380 | case GO_TO_PREVIOUS_BROWSER: |
381 | #ifdef HAVE_TAGCACHE | ||
368 | if ((previous_browser == GO_TO_DBBROWSER) && | 382 | if ((previous_browser == GO_TO_DBBROWSER) && |
369 | !tagcache_is_usable()) | 383 | !tagcache_is_usable()) |
370 | ret_val = GO_TO_FILEBROWSER; | 384 | ret_val = GO_TO_FILEBROWSER; |
371 | else | 385 | else |
386 | #endif | ||
372 | ret_val = previous_browser; | 387 | ret_val = previous_browser; |
373 | /* fall through */ | 388 | /* fall through */ |
374 | case GO_TO_FILEBROWSER: | 389 | case GO_TO_FILEBROWSER: |
390 | #ifdef HAVE_TAGCACHE | ||
375 | case GO_TO_DBBROWSER: | 391 | case GO_TO_DBBROWSER: |
376 | previous_browser = ret_val; | 392 | previous_browser = ret_val; |
377 | break; | 393 | break; |
394 | #endif | ||
378 | 395 | ||
379 | case GO_TO_PREVIOUS_MUSIC: | 396 | case GO_TO_PREVIOUS_MUSIC: |
380 | ret_val = previous_music; | 397 | ret_val = previous_music; |