Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- media="c:\\1.mp3"
- # This can be a playlist, music, or video file or an Url.
- playercontrol1="RandomOn"
- playercontrol2=""
- # "RandomOn", "RandomOff", "RepeatOne", "RepeatAll", "Partymode(music)", "Partymode(path to .xsp file)"
- sfx=False
- # True or False | Note that there are no quotes around True or False
- # media needs to be a path to a .wav file if this is true
- randomplaylist=True
- # Set randomplaylist to True and playercontrol1 to RandomOn to start the playlist
- # on the second (random) song. Otherwise set this to False.
- volume=""
- # If you want to reset the volume each time before the playlist starts, put a number in the "" quotes.
- # The number is a percent between 0 and 100. 0 is mute and 100 is max volume.
- ####################################
- #Don't mess with anything down here#
- #unless you know what you're doing #
- ####################################
- import nt,xbmc,xbmcgui
- from os import path
- # if (media!="" and not path.isfile(media)):
- # xbmcgui.Dialog().ok('Invalid Path','Path to media not found')
- while (not xbmc.abortRequested):
- if not xbmc.Player().isPlaying():
- if(volume!="") : xbmc.executebuiltin('SetVolume('+volume+')')
- if(media==""):
- if (playercontrol1=="Partymode(music)" or playercontrol2=="Partymode(music)"):
- xbmc.executebuiltin('XBMC.PlayerControl(Partymode(music))')
- xbmc.sleep(5000)
- elif(sfx==True):
- try:
- xbmc.playSFX(media)
- except:
- xbmc.log('playSFX failed')
- else:
- xbmc.executebuiltin('XBMC.PlayMedia('+media+')')
- if playercontrol1!="":
- xbmc.executebuiltin('XBMC.PlayerControl('+playercontrol1+')')
- if playercontrol2!="":
- xbmc.executebuiltin('XBMC.PlayerControl('+playercontrol2+')')
- if randomplaylist==True:
- xbmc.executebuiltin('XBMC.PlayerControl(Next)')
- xbmc.sleep(5000)
- else:
- xbmc.sleep(1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement