Skip to content

Commit

Permalink
* Seperated settinsg for LiveTV and TVShows
Browse files Browse the repository at this point in the history
* Added seperate settings for LiveTV
* Added seperate settings for Files
* Added option to disable settings for specific category (options are now: custom/fast/slow/disabled)
  • Loading branch information
georgehenze committed Jan 12, 2014
1 parent cd69fb9 commit 09263e5
Show file tree
Hide file tree
Showing 5 changed files with 183 additions and 18 deletions.
5 changes: 4 additions & 1 deletion script.xbmc.boblight/default.py
Expand Up @@ -155,12 +155,15 @@ def myPlayerChanged(state):
if state == 'stop':
ret = "static"
else:
# Possible Videoplayer options: files, movies, episodes, musicvideos, livetv
if xbmc.getCondVisibility("VideoPlayer.Content(musicvideos)"):
ret = "musicvideo"
elif xbmc.getCondVisibility("VideoPlayer.Content(episodes)"):
ret = "tvshow"
elif xbmc.getCondVisibility("VideoPlayer.Content(livetv)"):
ret = "tvshow"
ret = "livetv"
elif xbmc.getCondVisibility("VideoPlayer.Content(files)"):
ret = "files"
elif xbmc.getCondVisibility("Player.HasAudio()"):
ret = "static"
else:
Expand Down
22 changes: 21 additions & 1 deletion script.xbmc.boblight/resources/language/English/strings.xml
Expand Up @@ -26,13 +26,15 @@
<string id="32220">Custom</string>
<string id="32221">Slow</string>
<string id="32222">Fast</string>
<string id="32223">Disabled</string>

<!--MusicVideo-->
<string id="32300">Musicvideo</string>

<string id="32320">Custom</string>
<string id="32321">Slow</string>
<string id="32322">Fast</string>
<string id="32323">Disabled</string>

<!--Other-->
<string id="32400">Other</string>
Expand All @@ -57,12 +59,30 @@
<string id="32509">Should the addon try to download it for you?</string>
<string id="32510">Error downloading. Check filesystem permissions.</string>

<!--TVShows and LiveTV-->
<!--TVShows-->
<string id="32600">TV Shows</string>

<string id="32620">Custom</string>
<string id="32621">Slow</string>
<string id="32622">Fast</string>
<string id="32623">Disabled</string>

<!--LiveTV-->
<string id="32700">LiveTV</string>

<string id="32720">Custom</string>
<string id="32721">Slow</string>
<string id="32722">Fast</string>
<string id="32723">Disabled</string>

<!--Files-->
<string id="32800">Files</string>

<string id="32820">Custom</string>
<string id="32821">Slow</string>
<string id="32822">Fast</string>
<string id="32823">Disabled</string>

</strings>


36 changes: 28 additions & 8 deletions script.xbmc.boblight/resources/language/German/strings.xml
Expand Up @@ -17,22 +17,24 @@
<string id="32200">Film</string>
<string id="32201">Preset</string>
<string id="32202">Geschwindigkeit</string>
<string id="32203">autom. Geschwindigkeit</string>
<string id="32203">Autom. Geschwindigkeit</string>
<string id="32204">Interpolation</string>
<string id="32205">Farbe</string>
<string id="32206">Wert</string>
<string id="32207">Schwellwert</string>

<string id="32220">Eigene</string>
<string id="32221">langsam</string>
<string id="32222">schnell</string>
<string id="32221">Langsam</string>
<string id="32222">Schnell</string>
<string id="32223">Ausschalten</string>

<!--MusicVideo-->
<string id="32300">Musikvideo</string>

<string id="32320">Eigene</string>
<string id="32321">langsam</string>
<string id="32322">schnell</string>
<string id="32321">Langsam</string>
<string id="32322">Schnell</string>
<string id="32323">Ausschalten</string>

<!--Other-->
<string id="32400">Sonstige</string>
Expand All @@ -57,10 +59,28 @@
<string id="32509">Soll versucht werden diese automatisch herunterzuladen?</string>
<string id="32510">Fehler beim Herunterladen. Dateisystemberechtigungen pruefen.</string>

<!--TVShows and LiveTV-->
<!--TVShows-->
<string id="32600">TV-Serien</string>

<string id="32620">Eigene</string>
<string id="32621">langsam</string>
<string id="32622">schnell</string>
<string id="32621">Langsam</string>
<string id="32622">Schnell</string>
<string id="32623">Ausschalten</string>

<!--LiveTV-->
<string id="32700">LiveTV</string>

<string id="32720">Eigene</string>
<string id="32721">Langsam</string>
<string id="32722">Schnell</string>
<string id="32723">Ausschalten</string>

<!--Files-->
<string id="32800">Files</string>

<string id="32820">Eigene</string>
<string id="32821">Langsam</string>
<string id="32822">Schnell</string>
<string id="32823">Ausschalten</string>

</strings>
112 changes: 108 additions & 4 deletions script.xbmc.boblight/resources/lib/settings.py
Expand Up @@ -91,14 +91,32 @@ def start(self):
self.movie_threshold = float(__addon__.getSetting("movie_threshold"))
self.movie_preset = int(__addon__.getSetting("movie_preset"))

# TV Shows and LiveTV settings
# TV Shows settings
self.tvshow_saturation = float(__addon__.getSetting("tvshow_saturation"))
self.tvshow_value = float(__addon__.getSetting("tvshow_value"))
self.tvshow_speed = float(__addon__.getSetting("tvshow_speed"))
self.tvshow_autospeed = float(__addon__.getSetting("tvshow_autospeed"))
self.tvshow_interpolation = int(__addon__.getSetting("tvshow_interpolation") == "true")
self.tvshow_threshold = float(__addon__.getSetting("tvshow_threshold"))
self.tvshow_preset = int(__addon__.getSetting("tvshow_preset"))

# LiveTV settings
self.livetv_saturation = float(__addon__.getSetting("livetv_saturation"))
self.livetv_value = float(__addon__.getSetting("livetv_value"))
self.livetv_speed = float(__addon__.getSetting("livetv_speed"))
self.livetv_autospeed = float(__addon__.getSetting("livetv_autospeed"))
self.livetv_interpolation = int(__addon__.getSetting("livetv_interpolation") == "true")
self.livetv_threshold = float(__addon__.getSetting("livetv_threshold"))
self.livetv_preset = int(__addon__.getSetting("livetv_preset"))

# Files settings
self.files_saturation = float(__addon__.getSetting("files_saturation"))
self.files_value = float(__addon__.getSetting("files_value"))
self.files_speed = float(__addon__.getSetting("files_speed"))
self.files_autospeed = float(__addon__.getSetting("files_autospeed"))
self.files_interpolation = int(__addon__.getSetting("files_interpolation") == "true")
self.files_threshold = float(__addon__.getSetting("files_threshold"))
self.files_preset = int(__addon__.getSetting("files_preset"))

# Music Video settings
self.music_saturation = float(__addon__.getSetting("musicvideo_saturation"))
Expand Down Expand Up @@ -128,6 +146,13 @@ def setupForMovie(self):
autospeed = 0.0
interpolation = 0
threshold = 0.0
elif self.movie_preset == 3: #preset action
saturation = 0.0
value = 0.0
speed = 0.0
autospeed = 0.0
interpolation = 0
threshold = 0.0
elif self.movie_preset == 0: #custom
saturation = self.movie_saturation
value = self.movie_value
Expand All @@ -137,7 +162,7 @@ def setupForMovie(self):
threshold = self.movie_threshold
return (saturation,value,speed,autospeed,interpolation,threshold)

#handle boblight configuration from the "TVShows" and "LiveTV" category
#handle boblight configuration from the "TVShows" category
#returns the new settings
def setupForTVShow(self):
log('settings() - setupForTVShow')
Expand All @@ -156,6 +181,13 @@ def setupForTVShow(self):
autospeed = 0.0
interpolation = 0
threshold = 0.0
elif self.tvshow_preset == 3: #preset action
saturation = 0.0
value = 0.0
speed = 0.0
autospeed = 0.0
interpolation = 0
threshold = 0.0
elif self.tvshow_preset == 0: #custom
saturation = self.movie_saturation
value = self.movie_value
Expand All @@ -164,6 +196,76 @@ def setupForTVShow(self):
interpolation = self.movie_interpolation
threshold = self.movie_threshold
return (saturation,value,speed,autospeed,interpolation,threshold)

#handle boblight configuration from the "LiveTV" category
#returns the new settings
def setupForLiveTV(self):
log('settings() - setupForLiveTV')

if self.livetv_preset == 1: #preset smooth
saturation = 3.0
value = 10.0
speed = 20.0
autospeed = 0.0
interpolation = 0
threshold = 0.0
elif self.livetv_preset == 2: #preset action
saturation = 3.0
value = 10.0
speed = 80.0
autospeed = 0.0
interpolation = 0
threshold = 0.0
elif self.livetv_preset == 3: #preset action
saturation = 0.0
value = 0.0
speed = 0.0
autospeed = 0.0
interpolation = 0
threshold = 0.0
elif self.livetv_preset == 0: #custom
saturation = self.livetv_saturation
value = self.livetv_value
speed = self.livetv_speed
autospeed = self.livetv_autospeed
interpolation = self.livetv_interpolation
threshold = self.livetv_threshold
return (saturation,value,speed,autospeed,interpolation,threshold)

#handle boblight configuration from the "files" category
#returns the new settings
def setupForFiles(self):
log('settings() - setupForFiles')

if self.files_preset == 1: #preset smooth
saturation = 3.0
value = 10.0
speed = 20.0
autospeed = 0.0
interpolation = 0
threshold = 0.0
elif self.files_preset == 2: #preset action
saturation = 3.0
value = 10.0
speed = 80.0
autospeed = 0.0
interpolation = 0
threshold = 0.0
elif self.files_preset == 3: #preset action
saturation = 0.0
value = 0.0
speed = 0.0
autospeed = 0.0
interpolation = 0
threshold = 0.0
elif self.files_preset == 0: #custom
saturation = self.files_saturation
value = self.files_value
speed = self.files_speed
autospeed = self.files_autospeed
interpolation = self.files_interpolation
threshold = self.files_threshold
return (saturation,value,speed,autospeed,interpolation,threshold)

#handle boblight configuration from the "MusicVideo" category
#returns the new settings
Expand Down Expand Up @@ -241,14 +343,16 @@ def handleStaticBgSettings(self):

#handles the boblight configuration of all categorys
#and applies changed settings to boblight
#"movie","musicvideo", "other and "static"
#"movie","musicvideo","files","livetv","tvshows","other and "static"
def handleGlobalSettings(self):
log('settings() - handleGlobalSettings')
if (self.current_option != self.category) or self.force_update:
#call the right setup function according to categroy
#call the right setup function according to category
#switch case in python - dictionary with function pointers
option = { "movie" : self.setupForMovie,
"tvshow" : self.setupForTVShow,
"livetv" : self.setupForLiveTV,
"files" : self.setupForFiles,
"musicvideo" : self.setupForMusicVideo,
"other" : self.setupForOther,
"static" : self.setupForStatic,
Expand Down
26 changes: 22 additions & 4 deletions script.xbmc.boblight/resources/settings.xml
Expand Up @@ -2,7 +2,7 @@
<settings>
<category label="32100">
<setting id="overwrite_cat" type="bool" label="32105" default="false" />
<setting id="overwrite_cat_val" type="enum" subsetting="true" enable="eq(-1,true)" label="32106" default="0" lvalues="32200|32300|32600" />
<setting id="overwrite_cat_val" type="enum" subsetting="true" enable="eq(-1,true)" label="32106" default="0" lvalues="32200|32300|32600|32700|32800" />
<setting id="sep1" type="sep" />
<setting id="networkaccess" type="bool" label="32101" default="false" />
<setting id="hostip" type="ipaddress" subsetting="true" enable="eq(-1,true)" label="32102" default="127.0.0.1" />
Expand All @@ -11,7 +11,7 @@
<setting id="bobdisable" type="bool" label="32104" default="false" />
</category>
<category label="32200">
<setting id="movie_preset" type="enum" label="32201" default="1" lvalues="32220|32221|32222" />
<setting id="movie_preset" type="enum" label="32201" default="1" lvalues="32220|32221|32222|32223" />
<setting id="movie_speed" type="slider" subsetting="true" visible="eq(-1,0)" label="32202" default="100" range="0,100" />
<setting id="movie_autospeed" type="slider" subsetting="true" visible="eq(-2,0)" label="32203" default="0" range="0,100" />
<setting id="movie_interpolation" type="bool" subsetting="true" visible="eq(-3,0)" label="32204" default="false" />
Expand All @@ -20,23 +20,41 @@
<setting id="movie_threshold" type="slider" subsetting="true" visible="eq(-6,0)" label="32207" default="0" range="0,255" />
</category>
<category label="32600">
<setting id="tvshow_preset" type="enum" label="32201" default="1" lvalues="32620|32621|32622" />
<setting id="tvshow_preset" type="enum" label="32201" default="1" lvalues="32620|32621|32622|32623" />
<setting id="tvshow_speed" type="slider" subsetting="true" visible="eq(-1,0)" label="32202" default="100" range="0,100" />
<setting id="tvshow_autospeed" type="slider" subsetting="true" visible="eq(-2,0)" label="32203" default="0" range="0,100" />
<setting id="tvshow_interpolation" type="bool" subsetting="true" visible="eq(-3,0)" label="32204" default="false" />
<setting id="tvshow_saturation" type="slider" subsetting="true" visible="eq(-4,0)" label="32205" option="float" default="0" range="0,0.1,20" />
<setting id="tvshow_value" type="slider" subsetting="true" visible="eq(-5,0)" label="32206" option="float" default="0" range="0,0.1,20" />
<setting id="tvshow_threshold" type="slider" subsetting="true" visible="eq(-6,0)" label="32207" default="0" range="0,255" />
</category>
<category label="32700">
<setting id="livetv_preset" type="enum" label="32201" default="1" lvalues="32720|32721|32722|32723" />
<setting id="livetv_speed" type="slider" subsetting="true" visible="eq(-1,0)" label="32202" default="100" range="0,100" />
<setting id="livetv_autospeed" type="slider" subsetting="true" visible="eq(-2,0)" label="32203" default="0" range="0,100" />
<setting id="livetv_interpolation" type="bool" subsetting="true" visible="eq(-3,0)" label="32204" default="false" />
<setting id="livetv_saturation" type="slider" subsetting="true" visible="eq(-4,0)" label="32205" option="float" default="0" range="0,0.1,20" />
<setting id="livetv_value" type="slider" subsetting="true" visible="eq(-5,0)" label="32206" option="float" default="0" range="0,0.1,20" />
<setting id="livetv_threshold" type="slider" subsetting="true" visible="eq(-6,0)" label="32207" default="0" range="0,255" />
</category>
<category label="32300">
<setting id="musicvideo_preset" type="enum" label="32201" default="1" lvalues="32320|32321|32322" />
<setting id="musicvideo_preset" type="enum" label="32201" default="1" lvalues="32320|32321|32322|32323" />
<setting id="musicvideo_speed" type="slider" subsetting="true" visible="eq(-1,0)" label="32202" default="100" range="0,100" />
<setting id="musicvideo_autospeed" type="slider" subsetting="true" visible="eq(-2,0)" label="32203" default="0" range="0,100" />
<setting id="musicvideo_interpolation" type="bool" subsetting="true" visible="eq(-3,0)" label="32204" default="false" />
<setting id="musicvideo_saturation" type="slider" subsetting="true" visible="eq(-4,0)" label="32205" option="float" default="1" range="0,0.1,20" />
<setting id="musicvideo_value" type="slider" subsetting="true" visible="eq(-5,0)" label="32206" option="float" default="1" range="0,0.1,20" />
<setting id="musicvideo_threshold" type="slider" subsetting="true" visible="eq(-6,0)" label="32207" default="0" range="0,255" />
</category>
<category label="32800">
<setting id="files_preset" type="enum" label="32201" default="1" lvalues="32820|32821|32822|32823" />
<setting id="files_speed" type="slider" subsetting="true" visible="eq(-1,0)" label="32202" default="100" range="0,100" />
<setting id="files_autospeed" type="slider" subsetting="true" visible="eq(-2,0)" label="32203" default="0" range="0,100" />
<setting id="files_interpolation" type="bool" subsetting="true" visible="eq(-3,0)" label="32204" default="false" />
<setting id="files_saturation" type="slider" subsetting="true" visible="eq(-4,0)" label="32205" option="float" default="0" range="0,0.1,20" />
<setting id="files_value" type="slider" subsetting="true" visible="eq(-5,0)" label="32206" option="float" default="0" range="0,0.1,20" />
<setting id="files_threshold" type="slider" subsetting="true" visible="eq(-6,0)" label="32207" default="0" range="0,255" />
</category>
<category label="32400">
<!-- uncomment these settings when boblight works on menu and non rendered stuff too
<setting id="other_speed" type="slider" label="32202" default="100" range="0,100" />
Expand Down

0 comments on commit 09263e5

Please sign in to comment.