Moderator: Telldus
# ljus.py
import xbmc,xbmcgui
import subprocess,os
class MyPlayer(xbmc.Player) :
def __init__ (self):
xbmc.Player.__init__(self)
def onPlayBackStarted(self):
if xbmc.Player().isPlayingVideo():
os.system("sh /usr/share/xbmc/scripts/Ljus/biobelysning")
def onPlayBackEnded(self):
if (VIDEO == 1):
os.system("sh /usr/share/xbmc/scripts/Ljus/normalbelysning")
def onPlayBackStopped(self):
if (VIDEO == 1):
os.system("sh /usr/share/xbmc/scripts/Ljus/normalbelysning")
def onPlayBackPaused(self):
if xbmc.Player().isPlayingVideo():
os.system("sh /usr/share/xbmc/scripts/Ljus/normalbelysning")
def onPlayBackResumed(self):
if xbmc.Player().isPlayingVideo():
os.system("sh /usr/share/xbmc/scripts/Ljus/biobelysning")
player=MyPlayer()
while(1):
if xbmc.Player().isPlayingVideo():
VIDEO = 1
else:
VIDEO = 0
xbmc.sleep(3000)Se till att skapa dina egna script istället för "normalbelysning" och "biobelysning" eller byt helt enkelt ut dessa mot typ "tdtool -n 1" osv
# ljus.py
import xbmc,xbmcgui
import subprocess,os
class MyPlayer(xbmc.Player) :
def __init__ (self):
xbmc.Player.__init__(self)
def onPlayBackStarted(self):
if xbmc.Player().isPlayingVideo():
os.system("C:\biobelysning.bat")
def onPlayBackEnded(self):
if (VIDEO == 1):
os.system("C:\normalbelysning.bat")
def onPlayBackStopped(self):
if (VIDEO == 1):
os.system("C:\normalbelysning.bat")
def onPlayBackPaused(self):
if xbmc.Player().isPlayingVideo():
os.system("C:\normalbelysning.bat")
def onPlayBackResumed(self):
if xbmc.Player().isPlayingVideo():
os.system("C:\biobelysning.bat")
player=MyPlayer()
while(1):
if xbmc.Player().isPlayingVideo():
VIDEO = 1
else:
VIDEO = 0
xbmc.sleep(3000)
execfile("/home/xbmc/.xbmc/addons/script.ljus/default.py")Users browsing this forum: No registered users and 1 guest