Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#113824 - 29/08/2002 08:22 Example of programatic access to playlists + music
grgcombs
addict

Registered: 03/07/2001
Posts: 663
Loc: Dallas, TX
Is there a more clear example of programatically getting the playlists and music from the local drive(s) than the hijack code?

I thought someone else had done something similar elsewhere (vague enough?). The hijack code just has a lot of other stuff going on in there, that's distracting.

Greg
_________________________

Top
#113825 - 29/08/2002 08:24 Re: Example of programatic access to playlists + m [Re: grgcombs]
mschrag
pooh-bah

Registered: 09/09/2000
Posts: 2303
Loc: Richmond, VA
you're talking getting it directly from the filesystem vs. the empeg protocol, right? if you want protocol examples, in the latest source release of jEmplode there are some examples of just getting access to the player database

Top
#113826 - 29/08/2002 08:51 Re: Example of programatic access to playlists + m [Re: mschrag]
grgcombs
addict

Registered: 03/07/2001
Posts: 663
Loc: Dallas, TX
Right this will be in lieu of any currently deployed empeg software. We want to get at the playlists and the music file (plus tag info) without the help of any other software.

For more background, this is so we can add an additional source to rioplay, that being the local music database on the empeg.

I'd prefer to not have to use hijack as an intermediary. It'd be best if this software could work on stock empegs, as well as those with hijack.

Greg
_________________________

Top
#113827 - 29/08/2002 09:37 Re: Example of programatic access to playlists + m [Re: grgcombs]
tms13
old hand

Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
It's not hard to read the playlist structure and tags.

A fairly trivial effort can be seen by going back to my first efforts on the player.
_________________________
Toby Speight
030103016 (80GB Mk2a, blue)
030102806 (0GB Mk2a, blue)

Top
#113828 - 29/08/2002 10:08 Re: Example of programatic access to playlists + m [Re: grgcombs]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
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...
}
}

_________________________
Frank van Gestel

Top
#113829 - 29/08/2002 11:25 Re: Example of programatic access to playlists + m [Re: fvgestel]
TommyE
enthusiast

Registered: 08/06/1999
Posts: 356
Loc: NORWAY
Hello there Frank.

Long time no see, all well?

TommyE

Top
#113830 - 29/08/2002 14:06 Re: Example of programatic access to playlists + m [Re: TommyE]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
Yes, Tom, all is well. Just been busy with a lot of other stuff.
I don't read the BBS very often lately, although I try to read the programming-thread regularly. I haven't been sleeping though, I have done some programming stuff in the meantime, even some empeg-stuff. In the past half year I bought a couple of tuxscreens and an extra empeg for home-use. The tuxscreens are meant to serve as terminals to control the empeg and rio-receiver through displayserver hacks. I've just got a stable displayserver running for the receiver, based on Mark's excellent hijack-code. An empeg-version shouldn't be that hard...
I've also been doing some other stuff for the empeg. I was planning on publishing a games-distro for the empeg, which consists of :
- vnc X-server
- xdoom
- xgalaga
- mahjong
the ones above are tested. Other X-games should work as well.
It is now contained in a full debian-distro, but I think I can cut it down to about 100/150Mb. The only thing that has to run is inetd in chrooted mode.
I'm ashame I'm telling it now, as it has been in the state it is in now for about 6 months. Anyway, if anyone is interested I'll try to put together a nice filesystem for the empeg...
_________________________
Frank van Gestel

Top
#113831 - 29/08/2002 14:27 Re: Example of programatic access to playlists + m [Re: fvgestel]
grgcombs
addict

Registered: 03/07/2001
Posts: 663
Loc: Dallas, TX
After some further reading, looks like the existing database format is located in the emptool source tree. Thanks for the Fid code, but hopefully given an existing DB and this emptool code, I won't need it.

Thanks!!!

Greg
_________________________

Top
#113832 - 29/08/2002 14:30 Re: Example of programatic access to playlists + m [Re: grgcombs]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31578
Loc: Seattle, WA
Ooo, reading the database directly? Cool. Looking forward to seeing it in action.
_________________________
Tony Fabris

Top
#113833 - 29/08/2002 14:35 Re: Example of programatic access to playlists + m [Re: grgcombs]
tms13
old hand

Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
In reply to:

looks like the existing database format is located in the emptool source tree


Oops, I meant to tell you to read the whole of the thread I pointed you at...
_________________________
Toby Speight
030103016 (80GB Mk2a, blue)
030102806 (0GB Mk2a, blue)

Top