   "Creates a new display streaming color commands to connected pixel-pusher
   hardware."
   []
-  (PixelPusherDisplay. (DeviceRegistry.) (atom []) false))
+  (let [registry (DeviceRegistry.)
+        strips (atom [])]
+    (doto registry
+      (.addObserver (registry-observer registry strips))
+      (.setExtraDelay 0)
+      (.setAutoThrottle true))
+    (PixelPusherDisplay. registry strips false)))

  (start
    [this]
    (log/info "Starting PixelPusher display...")
    (when-not running
      (doto registry
        (.addObserver (registry-observer registry strips))
        (.startPushing)
        (.setExtraDelay 0)
        (.setAutoThrottle true)))
    (assoc this :running true))


  (stop
    [this]
    (log/info "Stopping PixelPusher display...")
    (doto registry
      (.deleteObservers)
      (.stopPushing))
    (reset! strips [])
    (assoc this :running false))



(defn- set-pixels!
  "Renders a sequence of pixel colors to an LED strip."
  [^Strip strip colors]
  (dorun (map #(when %2 (.setPixel strip (unchecked-int %2) (int %1)))
              (range (.getLength strip))
              colors)))

