       (if-not (is-track-downloaded? track-id)
         (request-file-download track-id)
         (if-not (is-track-downloading? track-id)
-          (.emit socket "ready-to-start" sound-id)))))
+          (do
+            (println "Sending ready-to-start signal with sound-id:" sound-id)
+            (.emit socket "ready-to-start" sound-id))))))
 
 
 (.on socket "pause"
   (fn [position]
+    (println "Received pause signal with position:" position)
     (player/pause)
     (player/set-position position)))
 
-(.on socket "resume" #(player/resume))
+(.on socket "resume"
+  (fn []
+    (println "Received resume signal")
+    (player/resume)))
 
 (.on socket "position-change"
   (fn [position]
+    (println "Received position-change signal: " position)
     (player/set-position position)))
 
 (.on socket "hotjoin-music-info"
   (fn [room-music-info track-order current-track-id current-sound-id]
+    (println "Received room state:"
+             "room-music-info:" room-music-info
+             "track-order:" track-order
+             "current-track-id:" current-track-id
+             "current-sound-id:" current-sound-id)
     ; TODO: should probably convert room-music-info to clojure object before manipulating
     (let [track-order (js->clj track-order)
           sorted-music-info (.sort room-music-info (fn [a b]

                  (:music-info @app-state))))

(defn previous-track []
  (let [track-num (- (get-current-track-num) 1)]
    (if (>= track-num 0)
      (.emit socket "change-track" track-num (.v4 js/uuid)))))

(defn next-track []
  (let [track-num (+ (get-current-track-num) 1)]
    (if (< track-num (count (:music-info @app-state)))
      (.emit socket "change-track" track-num (.v4 js/uuid)))))

(defn restart-track []
  (.emit socket "position-change" 0))

(defn on-finish []
  (println "Song has finished!")
  (.emit socket "track-complete"))

(.on socket "sign-in-success"


(defn pause []
  (player/pause)
  (println "Sending pause signal")
  (.emit socket "pause" (player/get-position)))

(defn resume []
  (println "Sending resume signal")
  (.emit socket "resume"))

(defn get-current-track-num []
