2013-05-20, 12:29
Hello,
I wrote a patch which adds 3D functionality to the boblight-add on. If you patch the source code using the diff from my posting, you will find a new option in the settings of the boblight-addon.
You can choose between:
Off -> No 3D
SideBySide -> for half-SBS movies
Top/Bottom -> for half-top-bottom movies
Feel free to add the code to the original project source code.
Kind regards,
Uwe Heinritz.
I wrote a patch which adds 3D functionality to the boblight-add on. If you patch the source code using the diff from my posting, you will find a new option in the settings of the boblight-addon.
You can choose between:
Off -> No 3D
SideBySide -> for half-SBS movies
Top/Bottom -> for half-top-bottom movies
Feel free to add the code to the original project source code.
Kind regards,
Uwe Heinritz.
Code:
diff -u -r script.xbmc.boblight.ori/default.py script.xbmc.boblight/default.py
--- script.xbmc.boblight.ori/default.py 2013-05-17 11:33:54.000000000 +0200
+++ script.xbmc.boblight/default.py 2013-05-20 11:50:07.954423244 +0200
@@ -189,14 +189,22 @@
if not settings.staticBobActive:
capture.waitForCaptureStateChangeEvent(1000)
if capture.getCaptureState() == xbmc.CAPTURE_STATE_DONE and player_monitor.isPlaying():
- width = capture.getWidth();
- height = capture.getHeight();
+ widthori = capture.getWidth();
+ heightori = capture.getHeight();
+ if settings.bob3D == 1:
+ widthused = widthori / 2
+ else:
+ widthused = widthori
+ if settings.bob3D == 3:
+ heightused = heightori / 2
+ else:
+ heightused = heightori
pixels = capture.getImage();
- bob.bob_setscanrange(width, height)
+ bob.bob_setscanrange(widthused, heightused)
rgb = (c_int * 3)()
- for y in range(height):
- row = width * y * 4
- for x in range(width):
+ for y in range(heightused):
+ row = widthori * y * 4
+ for x in range(widthused):
rgb[0] = pixels[row + x * 4 + 2]
rgb[1] = pixels[row + x * 4 + 1]
rgb[2] = pixels[row + x * 4]
diff -u -r script.xbmc.boblight.ori/resources/language/English/strings.xml script.xbmc.boblight/resources/language/English/strings.xml
--- script.xbmc.boblight.ori/resources/language/English/strings.xml 2013-05-17 11:33:54.000000000 +0200
+++ script.xbmc.boblight/resources/language/English/strings.xml 2013-05-20 11:38:52.522308693 +0200
@@ -12,6 +12,7 @@
<string id="104">Disable boblight</string>
<string id="105">Override used category</string>
<string id="106">Category</string>
+ <string id="107">3D Mode</string>
<!--Movie/MusicVideo/Other-->
<string id="200">Movie</string>
@@ -26,6 +27,11 @@
<string id="220">Custom</string>
<string id="221">Slow</string>
<string id="222">Fast</string>
+
+ <!--Movie/MusicVideo/Other-->
+ <string id="230">Off</string>
+ <string id="231">SideBySide</string>
+ <string id="232">Top/Bottom</string>
<!--MusicVideo-->
<string id="300">Musicvideo</string>
diff -u -r script.xbmc.boblight.ori/resources/language/German/strings.xml script.xbmc.boblight/resources/language/German/strings.xml
--- script.xbmc.boblight.ori/resources/language/German/strings.xml 2013-05-17 11:33:54.000000000 +0200
+++ script.xbmc.boblight/resources/language/German/strings.xml 2013-05-20 11:28:33.086225650 +0200
@@ -12,6 +12,7 @@
<string id="104">Boblight ausschalten</string>
<string id="105">Erzwinge Kategorie</string>
<string id="106">Kategorie</string>
+ <string id="107">3D Modus</string>
<!--Movie/MusicVideo/Other-->
<string id="200">Film</string>
@@ -26,6 +27,11 @@
<string id="220">Eigene</string>
<string id="221">langsam</string>
<string id="222">schnell</string>
+
+ <!--3D-->
+ <string id="230">Aus</string>
+ <string id="231">SideBySide</string>
+ <string id="232">Top/Bottom</string>
<!--MusicVideo-->
<string id="300">Musikvideo</string>
diff -u -r script.xbmc.boblight.ori/resources/lib/settings.py script.xbmc.boblight/resources/lib/settings.py
--- script.xbmc.boblight.ori/resources/lib/settings.py 2013-05-17 11:33:54.000000000 +0200
+++ script.xbmc.boblight/resources/lib/settings.py 2013-05-20 11:29:50.258235714 +0200
@@ -57,6 +57,7 @@
self.networkaccess = __addon__.getSetting("networkaccess") == "true"
self.overwrite_cat = __addon__.getSetting("overwrite_cat") == "true"
self.overwrite_cat_val = int(__addon__.getSetting("overwrite_cat_val"))
+ self.bob3D = int(__addon__.getSetting("bob3D"))
self.screensaver = xbmc.getCondVisibility("System.ScreenSaverActive")
self.bobdisable = __addon__.getSetting("bobdisable") == "true"
self.current_option = ""
Binärdateien script.xbmc.boblight.ori/resources/lib/settings.pyc and script.xbmc.boblight/resources/lib/settings.pyc sind verschieden.
diff -u -r script.xbmc.boblight.ori/resources/settings.xml script.xbmc.boblight/resources/settings.xml
--- script.xbmc.boblight.ori/resources/settings.xml 2013-05-17 11:33:54.000000000 +0200
+++ script.xbmc.boblight/resources/settings.xml 2013-05-20 11:27:38.354218395 +0200
@@ -9,6 +9,8 @@
<setting id="hostport" type="number" subsetting="true" enable="eq(-2,true)" label="103" default="19333" />
<setting id="sep2" type="sep" />
<setting id="bobdisable" type="bool" label="104" default="false" />
+ <setting id="sep4" type="sep" />
+ <setting id="bob3D" type="enum" subsettings="true" label="107" default="0" lvalues="230|231|232" />
</category>
<category label="200">
<setting id="movie_preset" type="enum" label="201" default="1" lvalues="220|221|222" />