summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-08-08 06:42:02 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-08-08 06:42:02 +0000
commit1e02e98d4ad21726c34173fea7141bb67d5ef315 (patch)
tree7cef811ee0cbcc72adb1ccaf6b3b8595439499be
parente03366d54ea1389272ec1ddbf15dd3c63df24842 (diff)
downloadrockbox-1e02e98d4ad21726c34173fea7141bb67d5ef315.zip
rockbox-1e02e98d4ad21726c34173fea7141bb67d5ef315.tar.gz
rockbox-1e02e98d4ad21726c34173fea7141bb67d5ef315.tar.bz2
rockbox-1e02e98d4ad21726c34173fea7141bb67d5ef315.tar.xz
Compensates the starting position for non-mp3 files in the playlist build
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1606 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/tree.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/tree.c b/apps/tree.c
index c1859a6..e094929 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -109,7 +109,7 @@ extern unsigned char bitmap_icons_6x8[LastIcon][6];
#define TREE_ATTR_M3U 0x80 /* unused by FAT attributes */
#define TREE_ATTR_MP3 0x40 /* unused by FAT attributes */
-static void build_playlist(void)
+static int build_playlist(int start_index)
{
int i;
@@ -122,7 +122,15 @@ static void build_playlist(void)
DEBUGF("Adding %s\n", dircacheptr[i]->name);
playlist_add(dircacheptr[i]->name);
}
+ else
+ {
+ /* Adjust the start index when se skip non-MP3 entries */
+ if(i < start_index)
+ start_index--;
+ }
}
+
+ return start_index;
}
static int compare(const void* p1, const void* p2)
@@ -267,7 +275,7 @@ bool dirbrowse(char *root)
int lasti=-1;
int rc;
int button;
-
+ int start_index;
memcpy(currdir,root,sizeof(currdir));
numentries = showdir(root, start);
@@ -342,8 +350,8 @@ bool dirbrowse(char *root)
dircacheptr[dircursor+start]->name, 0);
}
else {
- build_playlist();
- play_list(currdir, NULL, dircursor+start);
+ start_index = build_playlist(dircursor+start);
+ play_list(currdir, NULL, start_index);
}
status_set_playmode(STATUS_PLAY);
status_draw();