--- rockbox.orig/apps/lang/english.lang 2010-10-25 09:47:38.787087500 +0700
+++ rockbox/apps/lang/english.lang 2010-10-27 08:14:42.847703600 +0700
@@ -2428,6 +2428,34 @@
+ id: LANG_SET_AS_START_TAGCACHE
+ desc: used in the onplay menu to set tagcache start directory
+ user: core
+
+ *: "Start Database Update Here"
+
+
+ *: "Start Database Update Here"
+
+
+ *: none
+
+
+
+ id: LANG_RESET_START_TAGCACHE
+ desc: reset the tagcache start directory
+ user: core
+
+ *: "Reset Database Root Directory"
+
+
+ *: "Reset Database Root Directory"
+
+
+ *: none
+
+
+
id: LANG_TAGCACHE_FORCE_UPDATE_SPLASH
desc: in tag cache settings
user: core
--- rockbox.orig/apps/settings.h 2010-10-19 15:20:19.796839700 +0700
+++ rockbox/apps/settings.h 2010-10-26 23:46:49.972918300 +0700
@@ -576,6 +576,9 @@
#endif
bool tagcache_autoupdate; /* automatically keep tagcache in sync? */
bool runtimedb; /* runtime database active? */
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
+ char start_tagcache[2*MAX_FILENAME+1];
+#endif
#endif /* HAVE_TAGCACHE */
#if LCD_DEPTH > 1
--- rockbox.orig/apps/onplay.c 2010-10-19 15:20:19.737836400 +0700
+++ rockbox/apps/onplay.c 2010-10-26 23:16:13.104855500 +0700
@@ -1055,6 +1055,18 @@
}
MENUITEM_FUNCTION(set_startdir_item, 0, ID2P(LANG_SET_AS_START_DIR),
set_startdir, NULL, clipboard_callback, Icon_file_view_menu);
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
+static bool set_start_tagcache(void)
+{
+ snprintf(global_settings.start_tagcache,
+ sizeof(global_settings.start_tagcache),
+ "%s/", selected_file);
+ settings_save();
+ return false;
+}
+MENUITEM_FUNCTION(set_start_tagcache_item, 0, ID2P(LANG_SET_AS_START_TAGCACHE),
+ set_start_tagcache, NULL, clipboard_callback, Icon_NOICON);
+#endif
static int clipboard_callback(int action,const struct menu_item_ex *this_item)
{
@@ -1112,6 +1124,9 @@
#ifdef HAVE_RECORDING
|| this_item == &set_recdir_item
#endif
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
+ || this_item == &set_start_tagcache_item
+#endif
)
return action;
}
@@ -1174,6 +1189,9 @@
&set_recdir_item,
#endif
&set_startdir_item, &add_to_faves_item,
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
+ &set_start_tagcache_item,
+#endif
);
static int onplaymenu_callback(int action,const struct menu_item_ex *this_item)
{
--- rockbox.orig/apps/menus/settings_menu.c 2010-10-19 15:14:42.081523500 +0700
+++ rockbox/apps/menus/settings_menu.c 2010-10-27 08:17:29.321225300 +0700
@@ -80,12 +80,31 @@
MENUITEM_FUNCTION(tc_import, 0, ID2P(LANG_TAGCACHE_IMPORT),
(int(*)(void))tagtree_import, NULL,
NULL, Icon_NOICON);
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
+static int clear_start_tagcache(void)
+{
+#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
+ strcpy(global_settings.start_tagcache, "/sdcard");
+#else
+ strcpy(global_settings.start_tagcache, "/");
+#endif
+ settings_save();
+ splash(HZ, ID2P(LANG_RESET_DONE_CLEAR));
+ return false;
+}
+MENUITEM_FUNCTION(clear_start_tagcache_item, 0, ID2P(LANG_RESET_START_TAGCACHE),
+ clear_start_tagcache, NULL, NULL, Icon_NOICON);
+#endif
MAKE_MENU(tagcache_menu, ID2P(LANG_TAGCACHE), 0, Icon_NOICON,
#ifdef HAVE_TC_RAMCACHE
&tagcache_ram,
#endif
&tagcache_autoupdate, &tc_init, &tc_update, &runtimedb,
- &tc_export, &tc_import);
+ &tc_export, &tc_import
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
+ ,&clear_start_tagcache_item
+#endif
+ );
#endif /* HAVE_TAGCACHE */
/* TAGCACHE MENU */
/***********************************/
--- rockbox.orig/apps/tagcache.c 2010-10-19 15:20:20.230864600 +0700
+++ rockbox/apps/tagcache.c 2010-10-27 00:08:08.766061100 +0700
@@ -4462,11 +4462,19 @@
remove_files();
remove(get_user_file_path(TAGCACHE_FILE_TEMP,
IS_FILE|NEED_WRITE, path, sizeof(path)));
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
+ tagcache_build(global_settings.start_tagcache);
+#else
tagcache_build("/");
+#endif
break;
case Q_UPDATE:
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
+ tagcache_build(global_settings.start_tagcache);
+#else
tagcache_build("/");
+#endif
#ifdef HAVE_TC_RAMCACHE
load_ramcache();
#endif
@@ -4484,13 +4492,21 @@
{
load_ramcache();
if (tc_stat.ramcache && global_settings.tagcache_autoupdate)
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
+ tagcache_build(global_settings.start_tagcache);
+#else
tagcache_build("/");
+#endif
}
else
#endif
if (global_settings.tagcache_autoupdate)
{
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
+ tagcache_build(global_settings.start_tagcache);
+#else
tagcache_build("/");
+#endif
/* This will be very slow unless dircache is enabled
or target is flash based, but do it anyway for
--- rockbox.orig/apps/settings_list.c 2010-10-19 15:20:20.138859300 +0700
+++ rockbox/apps/settings_list.c 2010-10-26 23:59:21.876924800 +0700
@@ -1247,6 +1247,13 @@
#ifdef HAVE_TAGCACHE
OFFON_SETTING(0, runtimedb, LANG_RUNTIMEDB_ACTIVE, false,
"gather runtime data", NULL),
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
+#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
+ TEXT_SETTING(0, start_tagcache, "start tagcache", "/sdcard", NULL, NULL),
+#else
+ TEXT_SETTING(0, start_tagcache, "start tagcache", "/", NULL, NULL),
+#endif
+#endif
#endif
#if CONFIG_CODEC == SWCODEC