Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to disable boblight on pause #20

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion script.xbmc.boblight/default.py
Expand Up @@ -48,7 +48,15 @@ def __init__( self, *args, **kwargs ):
xbmc.Player.__init__( self )
self.playing = False
log('MyPlayer - init')


def onPlayBackPaused( self ):
self.playing = False
myPlayerChanged( 'pause' )

def onPlayBackResumed( self ):
self.playing = True
myPlayerChanged( 'start' )

def onPlayBackStopped( self ):
self.playing = False
myPlayerChanged( 'stop' )
Expand Down Expand Up @@ -151,9 +159,13 @@ def check_state():

def myPlayerChanged(state):
log('PlayerChanged(%s)' % state)

xbmc.sleep(100)
if state == 'stop':
ret = "static"
elif state == 'pause':
if settings.disable_on_pause:
ret = "static"
else:
# Possible Videoplayer options: files, movies, episodes, musicvideos, livetv
if xbmc.getCondVisibility("VideoPlayer.Content(musicvideos)"):
Expand Down
5 changes: 3 additions & 2 deletions script.xbmc.boblight/resources/language/Dutch/strings.xml
Expand Up @@ -12,7 +12,7 @@
<string id="32104">Schakel Boblightd uit</string>
<string id="32105">Overschrijf gebruikte categorie</string>
<string id="32106">Categorie</string>

<!--Movie/MusicVideo/Other-->
<string id="32200">Film</string>
<string id="32201">Preset</string>
Expand Down Expand Up @@ -45,7 +45,8 @@
<string id="32405">Schakel uit als de schermbeveiliging actief is</string>
<string id="32406">Oplichten bij opstarten</string>
<string id="32407">Toon status meldingen</string>

<string id="32408">Schakel uit bij pauzeren</string>

<!--Notifications-->
<string id="32500">Kon geen verbinding maken met Boblightd!</string>
<string id="32501">Verbonden met Boblightd!</string>
Expand Down
Expand Up @@ -45,6 +45,7 @@
<string id="32405">Disable when Screen Saver is on</string>
<string id="32406">Enable initial light flash</string>
<string id="32407">Enable status notifications</string>
<string id="32408">Disable on pause</string>

<!--Notifications-->
<string id="32500">Failed to connect to boblightd!</string>
Expand Down
8 changes: 4 additions & 4 deletions script.xbmc.boblight/resources/language/German/strings.xml
Expand Up @@ -10,9 +10,8 @@
<string id="32102">Boblightd IP</string>
<string id="32103">Boblightd Port</string>
<string id="32104">Boblight ausschalten</string>
<string id="32105">Erzwinge Kategorie</string>
<string id="32106">Kategorie</string>

<string id="32105">Erzwinge Kategorie</string> <string id="32106">Kategorie</string>

<!--Movie/MusicVideo/Other-->
<string id="32200">Film</string>
<string id="32201">Preset</string>
Expand Down Expand Up @@ -45,8 +44,9 @@
<string id="32405">Waehrend Bildschirmschoner Licht ausschalten</string>
<string id="32406">Initialen Lichttest aktivieren</string>
<string id="32407">Statusnachrichten aktivieren</string>
<string id="32408">Waehrend pausieren ausschalten</string>

<!--Notifications-->
<!--Notifications-->
<string id="32500">Fehler beim Verbinden zu boblightd!</string>
<string id="32501">Verbunden mit boblightd!</string>
<string id="32502">Einstellungen geaendert!</string>
Expand Down
Empty file modified script.xbmc.boblight/resources/lib/boblight.py 100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions script.xbmc.boblight/resources/lib/settings.py
Expand Up @@ -41,7 +41,9 @@ def __init__( self, *args, **kwargs ):
self.staticBobActive = False
self.run_init = True
self.category = "static"
self.disable_on_pause = False
self.networkaccess = __addon__.getSetting("networkaccess") == "true"

if not self.networkaccess:
self.hostip = None
self.hostport = -1
Expand All @@ -59,6 +61,7 @@ def start(self):
self.overwrite_cat_val = int(__addon__.getSetting("overwrite_cat_val"))
self.screensaver = xbmc.getCondVisibility("System.ScreenSaverActive")
self.bobdisable = __addon__.getSetting("bobdisable") == "true"
self.disable_on_pause = __addon__.getSetting("other_disable_on_pause") == "true"
self.current_option = ""

if not self.networkaccess:
Expand Down
1 change: 1 addition & 0 deletions script.xbmc.boblight/resources/settings.xml
Expand Up @@ -68,6 +68,7 @@
<setting id="other_static_green" type="slider" subsetting="true" enable="eq(-2,true)" label="32403" option="int" default="128" range="0,255" />
<setting id="other_static_blue" type="slider" subsetting="true" enable="eq(-3,true)" label="32404" option="int" default="128" range="0,255" />
<setting id="other_static_onscreensaver" type="bool" label="32405" default="false" />
<setting id="other_disable_on_pause" type="bool" label="32408" default="false" />
<setting id="sep3" type="sep" />
<setting id="other_misc_initialflash" type="bool" label="32406" default="true" />
<setting id="other_misc_notifications" type="bool" label="32407" default="true" />
Expand Down