summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-08-12 09:06:50 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-08-12 09:06:50 +0000
commitc0b99f2e8b149469a5d9e510ec38fa1e719ee8ce (patch)
treec4957b4ed0b8ba7c012ffe5771ae7ca3722f8943
parent0a0682474e6326f63994a6cd62f23efd9818a7ec (diff)
downloadrockbox-c0b99f2e8b149469a5d9e510ec38fa1e719ee8ce.tar.gz
rockbox-c0b99f2e8b149469a5d9e510ec38fa1e719ee8ce.zip
Fixed track order when inserting an album from tagcache to the
playlist with "insert next" or "queue next". git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10537 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/tagtree.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c
index b7e75a15c3..e3022193c7 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -798,7 +798,9 @@ int tagtree_load(struct tree_context* c)
case allsubentries:
case navibrowse:
logf("navibrowse...");
+ cpu_boost(true);
count = retrieve_entries(c, &tcs, 0, true);
+ cpu_boost(false);
break;
default:
@@ -956,6 +958,8 @@ bool insert_all_playlist(struct tree_context *c, int position, bool queue)
{
int i;
char buf[MAX_PATH];
+ int from, to, direction;
+ bool first = true;
cpu_boost(true);
if (!tagcache_search(&tcs, tag_filename))
@@ -964,7 +968,20 @@ bool insert_all_playlist(struct tree_context *c, int position, bool queue)
return false;
}
- for (i=0; i < c->filesindir; i++)
+ if (position == PLAYLIST_INSERT_FIRST)
+ {
+ from = c->filesindir - 1;
+ to = -1;
+ direction = -1;
+ }
+ else
+ {
+ from = 0;
+ to = c->filesindir;
+ direction = 1;
+ }
+
+ for (i = from; i != to; i += direction)
{
if (!show_search_progress(false, i))
break;
@@ -1082,6 +1099,7 @@ struct tagentry* tagtree_get_entry(struct tree_context *c, int id)
/* Load the next chunk if necessary. */
if (realid >= current_entry_count || realid < 0)
{
+ cpu_boost(true);
if (retrieve_entries(c, &tcs2, MAX(0, id - (current_entry_count / 2)),
false) < 0)
{
@@ -1089,6 +1107,7 @@ struct tagentry* tagtree_get_entry(struct tree_context *c, int id)
return NULL;
}
realid = id - current_offset;
+ cpu_boost(false);
}
return &entry[realid];