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