 (def start-time 0)
 (declare interrupt-requests)
 (declare z-corrections)
+(declare init-auto-shutter)
 
 ;; metadata
 

  (.. gui getAutofocusManager getDevice fullFocus))

(defn snap-image [open-before close-after]
  (if open-before
    (. mmc setShutterOpen true)
    (. mmc waitForDevice (. mmc getShutterDevice)))
  (. mmc snapImage)
  (if close-after
    (. mmc setShutterOpen false))
    (. mmc waitForDevice (. mmc getShutterDevice)))

(defn init-burst [length]
  (. mmc startSequenceAcquisition length 0 false))

(defn expose [event]
  (do (condp = (:task event)

  (binding [interrupt-requests (ref {:pause false :stop false})
            z-corrections (ref nil)
            last-wake-time (atom (clock-ms))
            start-time (clock-ms)
            init-auto-shutter (. mmc getAutoShutter)]
    (let [acq-seq (generate-acq-sequence settings)]
       (def acq-sequence acq-seq)
       (execute (mapcat #(make-event-fns % out-queue) acq-seq))
       (. mmc setAutoShutter init-auto-shutter))))
  
(defn convert-settings [^SequenceSettings settings]
  (-> settings
