Jump to content


Photo

Uix Cd-player


  • Please log in to reply
5 replies to this topic

#1 mrmodem

mrmodem

    X-S Member

  • Members
  • Pip
  • 83 posts
  • Xbox Version:v1.3

Posted 13 February 2005 - 04:16 PM

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..

#2 ImOkRuOk

ImOkRuOk

    X-S Senior Member

  • Members
  • PipPip
  • 264 posts
  • Location:USA
  • Interests:Xbox, games: fighting, action, Gore and blood and guts and death and violence and satan
  • Xbox Version:v1.1
  • 360 version:v4.0 (jasper)

Posted 14 February 2005 - 11:44 AM

ya, just wait for the update;)


...all your dreams will eventually come true!

#3 *LEGEND*

*LEGEND*

    X-S Enthusiast

  • Members
  • 29 posts

Posted 15 February 2005 - 07:00 PM

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

View Post


hopefully that dream will be to play mp3s on the dash

#4 mrmodem

mrmodem

    X-S Member

  • Members
  • Pip
  • 83 posts
  • Xbox Version:v1.3

Posted 16 February 2005 - 07:36 PM

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

#5 mateoleone

mateoleone

    X-S Enthusiast

  • Members
  • 21 posts

Posted 09 March 2005 - 01:59 PM

You rock! That did it and with no problems. Thanks!

#6 Laugh Out Loud

Laugh Out Loud

    X-S Senior Member

  • Members
  • PipPip
  • 153 posts
  • Location:Sydney, Australia
  • Xbox Version:v1.6

Posted 01 April 2005 - 03:32 AM

Ummm...great code, but why does it reboot the Xbox after it finishes the last song on the CD?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users