Skip to main content
Topic: Parse playlist file (.fpl) (Read 8063 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Parse playlist file (.fpl)

How does the foobar playlist work? It doesn't show the information on one line. (sometimes up to 3 lines ) Why is that? I would like to parse the playlist file using PHP so I can show my playlist and some stats about my playlist online...

grtz, Spyru

 

Parse playlist file (.fpl)

Reply #1
File format is as follows, everything is little-endian, and strings are all paired with length fields, so they are not null terminated.

offset    data

0    Signature (GUID, should be E3D06882-874B-43E3-9825-4E42020AF543)
16    Unknown, possibly format version (dword, should be 0)
20    Number of items (dword)

Now, what follows the header is each playlist item:

Quote
0    Flags (dword)
4    Length of the file path field (dword)
8    File path (string)
*    Subsong index (dword)

Quote
Known bits for Flags are:

bit    meaning
0    Play length and meta/info are present
2    File length is present
3    File modification time is present

If you encounter files with only bit 2 or 3 set, and things blow up, you'll know I guessed backwards.



Extra data layout follows:

*    File length in bytes (__int64)
*    File modification time (__int64, see reader.h)
*    Play length (double)

Immediately following the play length is the file metadata structure:

0    Number of strings (dword)

For every string:

0    Length of name (dword)
4    Name (string)
*    Length of value (dword)
*    Value (string)

After all of the metadata strings come the info strings, following the same format as the metadata.


This format information is subject to change as my guesses are corrected. The actual format structure, being an internal, is subject to change without notice.

 
SimplePortal 1.0.0 RC1 © 2008-2019