forked from len0rd/rockbox
Loading playlists using 512 byte buffer. Added feedback display during load.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@987 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
aa26b5cbe3
commit
4f00450f76
1 changed files with 19 additions and 4 deletions
|
|
@ -27,6 +27,8 @@
|
||||||
#include "sprintf.h"
|
#include "sprintf.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "mpeg.h"
|
#include "mpeg.h"
|
||||||
|
#include "lcd.h"
|
||||||
|
#include "kernel.h"
|
||||||
|
|
||||||
playlist_info_t playlist;
|
playlist_info_t playlist;
|
||||||
|
|
||||||
|
|
@ -70,6 +72,10 @@ char* playlist_next(int type)
|
||||||
void play_list(char *dir, char *file)
|
void play_list(char *dir, char *file)
|
||||||
{
|
{
|
||||||
char *sep="";
|
char *sep="";
|
||||||
|
|
||||||
|
lcd_clear_display();
|
||||||
|
lcd_puts(0,0,"Loading...");
|
||||||
|
lcd_update();
|
||||||
empty_playlist(&playlist);
|
empty_playlist(&playlist);
|
||||||
|
|
||||||
/* If the dir does not end in trailing new line, we use a separator.
|
/* If the dir does not end in trailing new line, we use a separator.
|
||||||
|
|
@ -86,9 +92,11 @@ void play_list(char *dir, char *file)
|
||||||
|
|
||||||
/* if shuffle is wanted, this is where to do that */
|
/* if shuffle is wanted, this is where to do that */
|
||||||
|
|
||||||
|
lcd_puts(0,0,"Playing...");
|
||||||
|
lcd_update();
|
||||||
/* also make the first song get playing */
|
/* also make the first song get playing */
|
||||||
mpeg_play(playlist_next(0));
|
mpeg_play(playlist_next(0));
|
||||||
|
sleep(HZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -113,8 +121,8 @@ void add_indices_to_playlist( playlist_info_t *playlist )
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
unsigned char buf[255];
|
unsigned char buf[512];
|
||||||
|
char line[16];
|
||||||
|
|
||||||
fd = open(playlist->filename, O_RDONLY);
|
fd = open(playlist->filename, O_RDONLY);
|
||||||
if(-1 == fd)
|
if(-1 == fd)
|
||||||
|
|
@ -144,12 +152,19 @@ void add_indices_to_playlist( playlist_info_t *playlist )
|
||||||
}
|
}
|
||||||
|
|
||||||
store_index = 0;
|
store_index = 0;
|
||||||
|
if ( playlist->amount % 200 == 0 ) {
|
||||||
|
snprintf(line, sizeof line, "%d", playlist->amount);
|
||||||
|
lcd_puts(0,1,line);
|
||||||
|
lcd_update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
i+= count;
|
i+= count;
|
||||||
}
|
}
|
||||||
|
snprintf(line, sizeof line, "%d", playlist->amount);
|
||||||
|
lcd_puts(0,1,line);
|
||||||
|
lcd_update();
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue