The TSongInfo object is used to store information about a song.
(more examples and methods can be found in the PAL Quick Start Guide)
Reading currently playing song information
This script will read the song information of the track loaded into DeckA, and then display the information.
var Song : TSongInfo; // Declare a container for the TSongInfo Object Song := DeckA.GetSongInfo; // Assign the song information from DeckA to the Song container if Song = nil then // Check for an empty Song Container WriteLn('No song loaded into DeckA!') // Write an error checking message else // If the Song Container is not empty then process the following begin WriteLn('Artist: '+Song['artist']); // Write 'Artist: ' followed by the track Artist WriteLn('Title: '+Song['title']); // Write 'Title: ' followed by the track Title WriteLn('Album: '+Song['album']); // Write 'Album: ' followed by the track Album WriteLn('Duration: '+Song['duration']); // Write 'Duration: ' followed by the track Duration end; Song.Free; // Release the Song Container
Notice how we test if Song = nil, because if that is the case, trying to read information on the song object will cause memory access violations since the object does not exist.