diff options
author | Miika Pekkarinen <miipekk@ihme.org> | 2006-08-12 09:06:50 +0000 |
---|---|---|
committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-08-12 09:06:50 +0000 |
commit | c0b99f2e8b149469a5d9e510ec38fa1e719ee8ce (patch) | |
tree | c4957b4ed0b8ba7c012ffe5771ae7ca3722f8943 /apps/tagtree.c | |
parent | 0a0682474e6326f63994a6cd62f23efd9818a7ec (diff) | |
download | rockbox-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
Diffstat (limited to 'apps/tagtree.c')
-rw-r--r-- | apps/tagtree.c | 21 |
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) | |||
798 | case allsubentries: | 798 | case allsubentries: |
799 | case navibrowse: | 799 | case navibrowse: |
800 | logf("navibrowse..."); | 800 | logf("navibrowse..."); |
801 | cpu_boost(true); | ||
801 | count = retrieve_entries(c, &tcs, 0, true); | 802 | count = retrieve_entries(c, &tcs, 0, true); |
803 | cpu_boost(false); | ||
802 | break; | 804 | break; |
803 | 805 | ||
804 | default: | 806 | default: |
@@ -956,6 +958,8 @@ bool insert_all_playlist(struct tree_context *c, int position, bool queue) | |||
956 | { | 958 | { |
957 | int i; | 959 | int i; |
958 | char buf[MAX_PATH]; | 960 | char buf[MAX_PATH]; |
961 | int from, to, direction; | ||
962 | bool first = true; | ||
959 | 963 | ||
960 | cpu_boost(true); | 964 | cpu_boost(true); |
961 | if (!tagcache_search(&tcs, tag_filename)) | 965 | if (!tagcache_search(&tcs, tag_filename)) |
@@ -964,7 +968,20 @@ bool insert_all_playlist(struct tree_context *c, int position, bool queue) | |||
964 | return false; | 968 | return false; |
965 | } | 969 | } |
966 | 970 | ||
967 | for (i=0; i < c->filesindir; i++) | 971 | if (position == PLAYLIST_INSERT_FIRST) |
972 | { | ||
973 | from = c->filesindir - 1; | ||
974 | to = -1; | ||
975 | direction = -1; | ||
976 | } | ||
977 | else | ||
978 | { | ||
979 | from = 0; | ||
980 | to = c->filesindir; | ||
981 | direction = 1; | ||
982 | } | ||
983 | |||
984 | for (i = from; i != to; i += direction) | ||
968 | { | 985 | { |
969 | if (!show_search_progress(false, i)) | 986 | if (!show_search_progress(false, i)) |
970 | break; | 987 | break; |
@@ -1082,6 +1099,7 @@ struct tagentry* tagtree_get_entry(struct tree_context *c, int id) | |||
1082 | /* Load the next chunk if necessary. */ | 1099 | /* Load the next chunk if necessary. */ |
1083 | if (realid >= current_entry_count || realid < 0) | 1100 | if (realid >= current_entry_count || realid < 0) |
1084 | { | 1101 | { |
1102 | cpu_boost(true); | ||
1085 | if (retrieve_entries(c, &tcs2, MAX(0, id - (current_entry_count / 2)), | 1103 | if (retrieve_entries(c, &tcs2, MAX(0, id - (current_entry_count / 2)), |
1086 | false) < 0) | 1104 | false) < 0) |
1087 | { | 1105 | { |
@@ -1089,6 +1107,7 @@ struct tagentry* tagtree_get_entry(struct tree_context *c, int id) | |||
1089 | return NULL; | 1107 | return NULL; |
1090 | } | 1108 | } |
1091 | realid = id - current_offset; | 1109 | realid = id - current_offset; |
1110 | cpu_boost(false); | ||
1092 | } | 1111 | } |
1093 | 1112 | ||
1094 | return &entry[realid]; | 1113 | return &entry[realid]; |