Help - Search - Members - Calendar
Full Version: Uix Cd-player
Scenyx Entertainment Community > Xbox1 Forums > Dashboard Forums > Official Team UIX Forums > User.Interface.X (UIX) Code
mrmodem
hey.. does anyone have the code to make the UIX cd-player work like a REGULAR cdplayer.... by this i mean i want when you play an audio cd it plays each track till the cd is done. at present it just plays one track then stops..
ImOkRuOk
ya, just wait for the update;)


...all your dreams will eventually come true!
*LEGEND*
QUOTE(ImOkRuOk @ Feb 14 2005, 01:50 AM)
ya, just wait for the update;)
...all your dreams will eventually come true!
*


hopefully that dream will be to play mp3s on the dash
mrmodem
ok ... well i guess the next UIX release would solve this problem... but i was curious to see why the tracks wouldnt flow with the cd player but would flow with the soundtracks.

on examination of the music.xap file inside default.xip i noticed that there was a function called

CODE

DoEndOfAudio()


this is the function that is called when a song from the soundtracks finished playing...

but... as i realized ... it was not called when a cd-track finished playing..

as i also realized.. this function was called from inside the dash XBE and not from anywhere inside the music.xap

so i decided to make the player "REALIZE" when a cd-track had come to an end... and let it run the DoEndOfAudio() function.

this is how i did it..

open up default.xip/music.xap


scroll down till u see this function

.....

CODE

function SetMusicPlayPos(nPos)
{
   if(bTrackListVisible == true)
   {
       var nNewPos = nPos;
       if(nNewPos < 0) { nNewPos = 0; }
       else if (nNewPos > 1) { nNewPos = 1; }
       var x = -1.579 + ( 0.730 * nNewPos );
       var y = -0.6701;
       var z =  0.1081;
       theMusicPlayMenu.children[0].children[0].MU_L3_timeslider.SetTranslation(x, y, z);
       var m = theMusicPlayer.getMinutes();
       var s = theMusicPlayer.getSeconds();
       if(m < 10) { m = "0" + m; }
       if(s < 10) { s = "0" + s; }
       theMusicPlayMenu.children[0].children[0].MusicTimeText.text = m + ":" + s;
   }
}



now replace this function so it now looks like this..

CODE

function SetMusicPlayPos(nPos)
{
   if(bTrackListVisible == true)
   {
       var track_length;
       var current_track_pos;
       var nNewPos = nPos;
       if(nNewPos < 0) { nNewPos = 0; }
       else if (nNewPos > 1) { nNewPos = 1; }
       var x = -1.579 + ( 0.730 * nNewPos );
       var y = -0.6701;
       var z =  0.1081;
       theMusicPlayMenu.children[0].children[0].MU_L3_timeslider.SetTranslation(x, y, z);
       var m = theMusicPlayer.getMinutes();
       var s = theMusicPlayer.getSeconds();
       if(m < 10) { m = "0" + m; }
       if(s < 10) { s = "0" + s; }
       theMusicPlayMenu.children[0].children[0].MusicTimeText.text = m + ":" + s;
      current_track_pos = m + ":" + s;
      track_length = theDiscDrive.FormatTrackTime(playlist[nPlayCursor]);
      if (current_track_pos == track_length )
      { DoEndOfAudio(); }
   
  }
}





save the file.. re insert into default.xip

upload to your xbox and reboot...


P.S. this works for me.. if anyone else has a better / cleaner way of doing this let me know .. thanks alot..


MrModem ph34r.gif ph34r.gif
mateoleone
You rock! That did it and with no problems. Thanks!
Laugh Out Loud
Ummm...great code, but why does it reboot the Xbox after it finishes the last song on the CD?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.