Greg,
The best thing to do is create a database in memory, just like the player software. You could try to load the existing database-file in /empeg/var or create your own format. I tried the hard way by reading in all fid-files at startup in my perl-player, but that took a lot of time. I don't know if anyone has released some code on reading the existing database. I think I probably have some examples somewhere...
here's a snippet from displayserver's code, which just reads the fid-files :
if ( (chdir("/drive1/fids")) != -1 ) {
drive1=1;
if ( (fidfp=fopen(mp3fid, "r")) == NULL ) {
chdir("/drive0/fids");
fidfp=fopen(mp3fid, "r");
}
} else {
chdir("/drive0/fids");
fidfp=fopen(mp3fid, "r");
}
if ( fidfp != NULL ) {
while (fread(fid, sizeof(fid),1,fidfp) != 0 ) {
sprintf(lfilename, "%02x%02x%02x%02x",
fid[3],fid[2],fid[1],fid[0]);
sfilename = (char *) &lfilename;
i=0;
while ( lfilename == 48 ) {
sfilename++;
i++;
}
sfilename[strlen(sfilename)-1]='1';
// Process entries...
}
}