all functions are to the right thumbstick:
Right: plays if stoped or next track
Left: plays if stoped or previous track
up: plays if stoped or fast forwards if held
Down: stops and returns ambient audio
thumstick down( or click) goes to the next soundtrack, can also have it to dpad left or right so it works globaly threw the dash.
first off find in default/default:
CODE
function MusicPlayerFastForward()
{
var totaltracks = theMusicCollection.GetSoundtrackSongCount(currentAlbum) - 1;
if(currentTrack == totaltracks)
{
currentTrack = 0;
MusicPlayerPlay();
}
else
{
currentTrack = currentTrack + 1;
MusicPlayerPlay();
}
}
and right below it put this in
CODE
function MusicPlayerReWind()
{
var totaltracks = theMusicCollection.GetSoundtrackSongCount(currentAlbum) - 1;
if(currentTrack == totaltracks)
{
currentTrack = 0;
MusicPlayerPlay();
}
else
{
currentTrack = currentTrack - 1;
MusicPlayerPlay();
}
}
function MusicPlayerGo()
{
theMusicPlayer.url = "st:" + theMusicCollection.GetSoundtrackSongID( currentAlbum, currentTrack );
log("Playing " + theMusicPlayer.url);
DisableAmbientAudio();
theMusicPlayer.Play();
}
function MusicPlayerEnd()
{
var totalAlbums = "st:" + theMusicCollection.GetSoundtrackSongID( currentAlbum, currentTrack );
log("Stopping " + theMusicPlayer.url);
EnableAmbientAudio();
theMusicPlayer.Pause();
}
now find:
CODE
//Start and Back buttons are no longer bound to be the same as A and B buttons
//putting these functions here saves alot of pasting to make them all global
function OnBackDown() { MusicPlayerVolumeUp(); } //back and start buttons
function OnStartDown() { MusicPlayerVolumeDown(); } //repeat when held down
function OnBlackDown() { theDiscDrive.OpenTray(); }
function OnWhiteDown() { theDiscDrive.CloseTray();}
and put this under it:
CODE
function OnRightThumbMoveRight() { MusicPlayerFastForward();}
function OnRightThumbMoveLeft() {MusicPlayerReWind();}
function OnRightThumbMoveUp() {MusicPlayerGo();}
function OnRightThumbMoveDown() {MusicPlayerEnd();}
if you wnat to change the soundtrack globaly and not just in the main menu add this under the previous code:
CODE
function OnDPadPressRight() {MusicPlayerRandom();}
now if you want to do it on the thumbstick click or down find:
CODE
control DEF theMainMenuJoy Joystick
{
and put this under it
CODE
function OnRightThumbDown()
{
MusicPlayerRandom();
}
and thats it, now you have all your functions needed for your bg music, if you need any other ask and i can take a shot at it!