Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

if static is on, no need to even check CaptureState()

  • Loading branch information...
commit c973acafceaf5477bee52fc60e97acbce9c009ff 1 parent a6673d5
Zeljko Ametovic authored April 16, 2012
3  .gitignore
... ...
@@ -0,0 +1,3 @@
  1
+*.DS_Store
  2
+*.pyc
  3
+*.dylib
45  script.xbmc.boblight/default.py
@@ -114,28 +114,29 @@ def process_boblight():
114 114
       if not bob.bob_ping():
115 115
         connectBoblight()
116 116
         
117  
-      capture.waitForCaptureStateChangeEvent(1000)
118  
-      if capture.getCaptureState() == xbmc.CAPTURE_STATE_DONE and not settings.staticBobActive:
119  
-        if not bob.bob_set_priority(128):
120  
-          return
121  
-  
122  
-        width = capture.getWidth();
123  
-        height = capture.getHeight();
124  
-        pixels = capture.getImage();
125  
-        bob.bob_setscanrange(width, height)
126  
-        rgb = (c_int * 3)()
127  
-        for y in range(height):
128  
-          row = width * y * 4
129  
-          for x in range(width):
130  
-            rgb[0] = pixels[row + x * 4 + 2]
131  
-            rgb[1] = pixels[row + x * 4 + 1]
132  
-            rgb[2] = pixels[row + x * 4]
133  
-            bob.bob_addpixelxy(x, y, byref(rgb))
134  
-  
135  
-        if not bob.bob_sendrgb():
136  
-          log("error sending values: %s" % bob.bob_geterror())
137  
-          return
138  
-            
  117
+      if not settings.staticBobActive:        
  118
+        capture.waitForCaptureStateChangeEvent(1000)
  119
+        if capture.getCaptureState() == xbmc.CAPTURE_STATE_DONE:
  120
+          if not bob.bob_set_priority(128):
  121
+            return
  122
+    
  123
+          width = capture.getWidth();
  124
+          height = capture.getHeight();
  125
+          pixels = capture.getImage();
  126
+          bob.bob_setscanrange(width, height)
  127
+          rgb = (c_int * 3)()
  128
+          for y in range(height):
  129
+            row = width * y * 4
  130
+            for x in range(width):
  131
+              rgb[0] = pixels[row + x * 4 + 2]
  132
+              rgb[1] = pixels[row + x * 4 + 1]
  133
+              rgb[2] = pixels[row + x * 4]
  134
+              bob.bob_addpixelxy(x, y, byref(rgb))
  135
+    
  136
+          if not bob.bob_sendrgb():
  137
+            log("error sending values: %s" % bob.bob_geterror())
  138
+            return
  139
+                      
139 140
     elif bobdisable:
140 141
       log('boblight disabled in Addon Settings')
141 142
       bobdisable = False

0 notes on commit c973aca

Please sign in to comment.
Something went wrong with that request. Please try again.