This class provides some methods for handling playlists when setting up online radio. It's a helper class for mp3_radio.

DOGMA (Constants and Variables)

(string) mp3_filelist::MP3_DIR

The name of the directory, where the music in mp3 format resides.

(string) mp3_filelist::LB

The format of the line-break. Could be ``\r\n'' for win32, ``\n'' for Unix/Linux or ``\r'' (Mac).

(string) mp3_filelist::MP3_LIST

The name of the playlist file.

(string) mp3_filelist::MP3_LAST

The name of the file storing last served filename.

(array) mp3_filelist::raw_filelist

List of all the files residing in the mp3_filelist::MP3_DIR directory when the request came.

(array) mp3_filelist::old_filelist

Old filelist

(array) mp3_filelist::filelist

New filelist. See the description of the mp3_filelist::create_new_filelist method

RITUAL (Methods)

(void) mp3_filelist::create_raw_filelist()

Creates a list of all music files currently in the mp3_filelist::MP3_DIR directory. Now working only with the mp3 files.

(void) mp3_filelist::create_new_filelist()

Opens old filelist from the mp3_filelist::MP3_LIST file, then compares it to the mp3_filelist::raw_filelist. Places the intersection at the beginning and appends to its end a list of files added since previous call. This creates FIFO-like queue of mp3's. Then saves it.