 
 (defonce room-id (.getAttribute (. js/document (getElementById "roomid")) "data"))
 (defonce socket (js/io))
-(defonce current-sound-id "current-song")
 (defonce default-upload-slots 4)
 (defonce default-download-slots 4)
 (defonce app-state (atom {:signed-in? false


(.on socket "pause"
  (fn [position]
    (.pause js/soundManager current-sound-id)
    (.setPosition js/soundManager current-sound-id position)))

(.on socket "resume"
  (fn []
    (.resume js/soundManager current-sound-id)))

(.on socket "position-change"
  (fn [position]
    (letfn [(set-pos [position]
              (.setPosition js/soundManager current-sound-id position))]
      (println "Received pos: " position)
      (if (= 0 (.-playState (:current-sound @app-state)))
        (.play (:current-sound @app-state)

      (.emit socket "file-download-request" id))))

(defn pause []
  (.pause (:current-sound @app-state))
  (.emit socket "pause" (.-position (:current-sound @app-state))))

(defn resume []
