Jump to content


Photo

Startup Music On For Xbox


  • This topic is locked This topic is locked
2 replies to this topic

#1 JayDee

JayDee

    X-S Legend

  • Head Moderators
  • PipPipPipPipPipPipPipPipPip
  • 5,750 posts
  • Gender:Male
  • Location:Sweden
  • Xbox Version:v1.1
  • 360 version:v2 (zephyr)

Posted 20 August 2004 - 08:22 PM

Shameless copy and paste from a post by nimbles here on this forum!

For loading playlist:

first copy this to notepad and save as autoexec.py
CODE

# auto execute scripts when xbmc starts, place this file in xbmchome\scripts\
#
# note: - do not execute more than one script at a time which asks for user input!

import xbmc

xbmc.executescript('q:\\scripts\\RandomPlay.py')



and then copy this in notepad and save as Play Random Playlist.py

Get this script RANDOM PLAY and place it in the scripts dir with the autoexec.py

You could just use the second script as autoexec.py i guess unless you want to launch another script at startup too.

Edited by JayDee, 21 August 2004 - 09:09 PM.


#2 nimbles

nimbles

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,184 posts
  • Location:London, UK
  • Interests:Student, Mathematical Finance.<br>Most sports, footbal (Arsenal fan), cricket &amp; rugby<br>Movie Junkie.
  • Xbox Version:v1.1

Posted 22 August 2004 - 09:32 AM

Ok had to help a couple of people in the irc channel with the startup music script for xbmc- seems like when i pasted the code in the thread- alot of the indents were lost in formatting causing the script not to work.

There seem to be two slightly different scripts that'll do the job- both of which i've included with a read me and autoexec.py file in a zip file which you can get from here

QUOTE (Readme)
I
I've included two scripts made by guyane[at]ifrance.com (RandomPlay1.py) & C. Newman (RandomPlay2.py) respectively

Both scripts will do the job- guyane[at]ifrance.com's script will launch a random playlist with no indication at start up, while C. Newman's will start with a dialog box telling you which playlist has been loaded

For this to work you have to create one or more playlists first (both will select a playlist at random on start up and shuffle the playlist before playing)

To create a playlist- go to my music- select a track and hit "y" on the gamepad or "0" on the remote (assuming you have not changed the keymap.xml). If you hit "y"/"0" over a folder or bookmark it will will add all valid music files in that bookmark/folder and all subdirectories to the playlist. Then save the playlist by accessing playlist view by hitting either black button on the gamepad or the "title" button the remote. Save the file (this will be saved to Q:\albums\playlists by default- where Q:\ is the XBMC "home" folder) using the onscreen keyboard to name the playlist.

Make sure that you have all the Python library installed for this to work. If you don't have it get it from the sticky at the top of this forum: Unrar the and copy the scripts and python folders to the XBMC "home drive".

If you want to use the script that starts without any dialog screens you don't need to edit anything just copy autoexec.py and RandomPlay1.py to the scripts folder. if you want dialog, open the autoexec.py and rename RandomPlay1.py to Randomplay2.py (in notepad), and copy the edited autoexec.py and RandomPlay2.py to the scripts folder.

Changes I've made to the scripts:

RandomPlay1.py
Changed playlist path from E:\\Apps\\XBMC\\Albums\\playlists\\ to Q:\\albums\\playlists

RanddomPlay2.py
Changed playlist path from C:\\playlists\\ to Q:\\albums\\playlists added shuffle (xbmc.PlayList(0).shuffle() - remove if you don't want playlist to be shuffled- similalrly remove pls.shuffle() from RandomPlay1.py if you do not want to shuffle the playlist in RandomPlay1)



JayDee- please merge or add this info to the post you made yesterday

Edited by nimbles, 22 August 2004 - 09:39 AM.


#3 JayDee

JayDee

    X-S Legend

  • Head Moderators
  • PipPipPipPipPipPipPipPipPip
  • 5,750 posts
  • Gender:Male
  • Location:Sweden
  • Xbox Version:v1.1
  • 360 version:v2 (zephyr)

Posted 22 August 2004 - 11:01 AM

Done smile.gif




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users