Music

Music is resposible for the track handling in the Music gametab.

../../images/music.png

EMusicButton

EMusicButton = enum(AREA, MANUAL, RANDOM);

Enum representing the music configuration buttons.


TMusic

Main record that interacts with the Music gametab.


TMusicTrack

Helper record for TMusic.


TMusicTrackArray

Helper type for TMusic.


TMusic.SetupGameTab

procedure TMusic.SetupGameTab();

Interal method used to setup the TMusic coordinates.

This is automatically called for you on the Music variable.


Music.IsOpen

function TMusic.IsOpen(): Boolean;

Returns true if the music gametab is open.

Example:

WriteLn Music.IsOpen();

Music.Open

function TMusic.Open(): Boolean;

Attempts to open the Music gametab.

Example:

WriteLn Music.Open();

Music.ActiveTrack

property TMusic.ActiveTrack : String;

Returns the currently playing track.

Example:

WriteLn Music.ActiveTrack;

Music.GetTracks

function TMusic.GetTracks() : TMusicTrackArray;

Returns the currently visible TMusicTrackArray.

Example:

WriteLn Music.GetTracks();

Music.FindTrack

function TMusic.FindTrack(trackName: String) : TMusicTrack;

Returns a TMusicTrack if it was found in the playlist.

Example:

var
  track: TMusicTrack;
begin
  track := Music.FindTrack('Sea Shanty 2');
  if track <> Default(TMusicTrack) then
    WriteLn track.Available;
end.

Music.PlayTrack

function TMusic.PlayTrack(trackName: String; force: Boolean = false) : Boolean;

Attempts to play the given track, if the track is already playing it can be clicked again by using the force parameter. Returns true if successful.

Example:

WriteLn Music.PlayTrack('Sea Shanty 2');

Music variable

Global TMusic variable.