 
 (defn frames->chan
   "Returns a channel that emits frames from the given collection."
-  [frames speed]
+  [frames]
   (let [ch (chan)
         start (js/Date.)]
     (go

  (let [start (js/Date.)
        play-from (:play-from state)
        speed (:speed state)
        frames (-> (:frames state) (next-frames play-from))
        diff-chan (frames->chan frames speed)
        timer-chan (coll->chan (repeat [0.3 true]))
        stop-playback-chan (chan)
        elapsed-time #(* (elapsed-time-since start) speed)

  []
  (coll->chan (cycle [[0.5 false] [0.5 true]])))

(defn frames-at-speed [frames speed]
  (map (fn [[delay diff]] [(/ delay speed) diff]) frames))

(defn start-playback
  "The heart of the player. Coordinates dispatching of state update events like
  terminal line updating, time reporting and cursor blinking.
