            [org.json JSONObject JSONArray]
            [java.util Date UUID]
            [java.text SimpleDateFormat]
+           [javax.swing SwingUtilities]
            [ij ImagePlus])
    (:gen-class
      :name org.micromanager.AcqEngine

      {
       "AxisPositions" (when-let [axes (get-in event [:position :axes])] (JSONObject. axes))
       "Binning" (core getProperty (core getCameraDevice) "Binning")
       "Channel" (get-in event [:channel :name])
       "ChannelIndex" (:channel-index event)
       "ElapsedTime-ms" (if (state :start-time) (- (clock-ms) (state :start-time)) 0)

          (dosync (ref-set live-mode-running true))
          (core startContinuousSequenceAcquisition 0)
          (.start (Thread.
                    #(do (while @live-mode-running
                           (let [img (annotate-image (core getLastImage) event state)]
                              (reset-snap-window img)
                              (show-image @snap-window img)))
                         (core stopSequenceAcquisition)))))
        (dosync (ref-set live-mode-running false))))

;; java interop
