# Music Music is resposible for the track handling in the Music gametab. ```{figure} ../../images/music.png ``` - - - ## ERSMusicButton ```pascal ERSMusicButton = enum(AREA, MANUAL, RANDOM); ``` Enum representing the music configuration buttons. - - - ## TRSMusic Main record that interacts with the {ref}`Music` gametab. - - - ## TRSMusicTrack Helper record for {ref}`TRSMusic`. - - - ## TRSMusicTrackArray Helper type for {ref}`TRSMusic`. - - - ## TRSMusic.SetupGameTab ```pascal procedure TRSMusic.SetupGameTab(); ``` Interal method used to setup the {ref}`TRSMusic` coordinates. This is automatically called for you on the {ref}`Music variable`. - - - ## Music.IsOpen ```pascal function TRSMusic.IsOpen(): Boolean; ``` Returns true if the music gametab is open. Example: ```pascal WriteLn Music.IsOpen(); ``` - - - ## Music.Open ```pascal function TRSMusic.Open(): Boolean; ``` Attempts to open the Music gametab. Example: ```pascal WriteLn Music.Open(); ``` - - - ## Music.ActiveTrack ```pascal property TRSMusic.ActiveTrack : String; ``` Returns the currently playing track. Example: ```pascal WriteLn Music.ActiveTrack; ``` - - - ## Music.GetTracks ```pascal function TRSMusic.GetTracks() : TRSMusicTrackArray; ``` Returns the currently visible {ref}`TRSMusicTrackArray`. Example: ```pascal WriteLn Music.GetTracks(); ``` - - - ## Music.FindTrack ```pascal function TRSMusic.FindTrack(trackName: String) : TRSMusicTrack; ``` Returns a {ref}`TRSMusicTrack` if it was found in the playlist. Example: ```pascal var track: TRSMusicTrack; begin track := Music.FindTrack('Sea Shanty 2'); if track <> Default(TRSMusicTrack) then WriteLn track.Available; end. ``` - - - ## Music.PlayTrack ```pascal 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: ```pascal WriteLn Music.PlayTrack('Sea Shanty 2'); ``` - - - ## Music variable Global {ref}`TRSMusic` variable.