Advertisement
jappish84

default.py xbmc script

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