diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-08-08 06:42:02 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-08-08 06:42:02 +0000 |
commit | 1e02e98d4ad21726c34173fea7141bb67d5ef315 (patch) | |
tree | 7cef811ee0cbcc72adb1ccaf6b3b8595439499be /apps/tree.c | |
parent | e03366d54ea1389272ec1ddbf15dd3c63df24842 (diff) | |
download | rockbox-1e02e98d4ad21726c34173fea7141bb67d5ef315.tar.gz rockbox-1e02e98d4ad21726c34173fea7141bb67d5ef315.zip |
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
Diffstat (limited to 'apps/tree.c')
-rw-r--r-- | apps/tree.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/tree.c b/apps/tree.c index c1859a66ae..e09492946b 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -109,7 +109,7 @@ extern unsigned char bitmap_icons_6x8[LastIcon][6]; | |||
109 | #define TREE_ATTR_M3U 0x80 /* unused by FAT attributes */ | 109 | #define TREE_ATTR_M3U 0x80 /* unused by FAT attributes */ |
110 | #define TREE_ATTR_MP3 0x40 /* unused by FAT attributes */ | 110 | #define TREE_ATTR_MP3 0x40 /* unused by FAT attributes */ |
111 | 111 | ||
112 | static void build_playlist(void) | 112 | static int build_playlist(int start_index) |
113 | { | 113 | { |
114 | int i; | 114 | int i; |
115 | 115 | ||
@@ -122,7 +122,15 @@ static void build_playlist(void) | |||
122 | DEBUGF("Adding %s\n", dircacheptr[i]->name); | 122 | DEBUGF("Adding %s\n", dircacheptr[i]->name); |
123 | playlist_add(dircacheptr[i]->name); | 123 | playlist_add(dircacheptr[i]->name); |
124 | } | 124 | } |
125 | else | ||
126 | { | ||
127 | /* Adjust the start index when se skip non-MP3 entries */ | ||
128 | if(i < start_index) | ||
129 | start_index--; | ||
130 | } | ||
125 | } | 131 | } |
132 | |||
133 | return start_index; | ||
126 | } | 134 | } |
127 | 135 | ||
128 | static int compare(const void* p1, const void* p2) | 136 | static int compare(const void* p1, const void* p2) |
@@ -267,7 +275,7 @@ bool dirbrowse(char *root) | |||
267 | int lasti=-1; | 275 | int lasti=-1; |
268 | int rc; | 276 | int rc; |
269 | int button; | 277 | int button; |
270 | 278 | int start_index; | |
271 | 279 | ||
272 | memcpy(currdir,root,sizeof(currdir)); | 280 | memcpy(currdir,root,sizeof(currdir)); |
273 | numentries = showdir(root, start); | 281 | numentries = showdir(root, start); |
@@ -342,8 +350,8 @@ bool dirbrowse(char *root) | |||
342 | dircacheptr[dircursor+start]->name, 0); | 350 | dircacheptr[dircursor+start]->name, 0); |
343 | } | 351 | } |
344 | else { | 352 | else { |
345 | build_playlist(); | 353 | start_index = build_playlist(dircursor+start); |
346 | play_list(currdir, NULL, dircursor+start); | 354 | play_list(currdir, NULL, start_index); |
347 | } | 355 | } |
348 | status_set_playmode(STATUS_PLAY); | 356 | status_set_playmode(STATUS_PLAY); |
349 | status_draw(); | 357 | status_draw(); |