Advertisement
jappish84

default.py

Apr 12th, 2013
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.01 KB | None | 0 0
  1. media="c:\\1.mp3"
  2.  # This can be a playlist, music, or video file or an Url.
  3. playercontrol1="RepeatAll"
  4. playercontrol2=""
  5.  # "RandomOn", "RandomOff", "RepeatOne", "RepeatAll", "Partymode(music)", "Partymode(path to .xsp file)"
  6. sfx=False
  7.  # True or False | Note that there are no quotes around True or False
  8.  # media needs to be a path to a .wav file if this is true
  9. randomplaylist=False
  10.  # Set randomplaylist to True and playercontrol1 to RandomOn to start the playlist
  11.  # on the second (random) song. Otherwise set this to False.
  12. volume="100"
  13.  # If you want to reset the volume each time before the playlist starts, put a number in the "" quotes.
  14.  # The number is a percent between 0 and 100. 0 is mute and 100 is max volume.
  15.  
  16.  
  17.  ####################################
  18.  #Don't mess with anything down here#
  19.  #unless you know what you're doing #
  20.  ####################################
  21.  
  22. import nt,xbmc,xbmcgui
  23. from os import path
  24.  
  25.  # if (media!="" and not path.isfile(media)):
  26.  #    xbmcgui.Dialog().ok('Invalid Path','Path to media not found')
  27.  
  28. while (not xbmc.abortRequested):
  29.     if not xbmc.Player().isPlaying():
  30.         if(volume!="") : xbmc.executebuiltin('SetVolume('+volume+')')
  31.         if(media==""):
  32.             if (playercontrol1=="Partymode(music)" or playercontrol2=="Partymode(music)"):
  33.                 xbmc.executebuiltin('XBMC.PlayerControl(Partymode(music))')
  34.                 xbmc.sleep(5000)
  35.         elif(sfx==True):
  36.             try:
  37.                 xbmc.playSFX(media)
  38.             except:
  39.                 xbmc.log('playSFX failed')
  40.         else:
  41.             xbmc.executebuiltin('XBMC.PlayMedia('+media+')')
  42.             if playercontrol1!="":
  43.                 xbmc.executebuiltin('XBMC.PlayerControl('+playercontrol1+')')
  44.             if playercontrol2!="":
  45.                 xbmc.executebuiltin('XBMC.PlayerControl('+playercontrol2+')')
  46.             if randomplaylist==True:
  47.                 xbmc.executebuiltin('XBMC.PlayerControl(Next)')
  48.             xbmc.sleep(5000)
  49.     else:
  50.         xbmc.sleep(1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement