Music

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

_images/music.png

ERSMusicButton

ERSMusicButton = enum(AREA, MANUAL, RANDOM);

Enum representing the music configuration buttons.


TRSMusic

Main record that interacts with the Music gametab.


TRSMusicTrack

Helper record for TRSMusic.


TRSMusicTrackArray

Helper type for TRSMusic.


TRSMusic.SetupGameTab

procedure TRSMusic.SetupGameTab();

Interal method used to setup the TRSMusic coordinates.

This is automatically called for you on the Music variable.


Music.IsOpen

function TRSMusic.IsOpen(): Boolean;

Returns true if the music gametab is open.

Example:

WriteLn Music.IsOpen();

Music.Open

function TRSMusic.Open(): Boolean;

Attempts to open the Music gametab.

Example:

WriteLn Music.Open();

Music.ActiveTrack

property TRSMusic.ActiveTrack : String;

Returns the currently playing track.

Example:

WriteLn Music.ActiveTrack;

Music.GetTracks

function TRSMusic.GetTracks() : TRSMusicTrackArray;

Returns the currently visible TRSMusicTrackArray.

Example:

WriteLn Music.GetTracks();

Music.FindTrack

function TRSMusic.FindTrack(trackName: String) : TRSMusicTrack;

Returns a TRSMusicTrack if it was found in the playlist.

Example:

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

Music.PlayTrack

function TRSMusic.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 TRSMusic variable.