       :seek-forward (aset audio-node "currentTime" (+ (.-currentTime audio-node) 1))
       (.pause audio-node))))
 
+(defn set-track [track offset owner]
+  (om/set-state! owner :current-offset offset)
+  (aset audio-node "src" (tracks/mk-track-url track))
+  (ctrl-audio-node :play)
+  (put! channels/now-playing track))
+
 (defn audio-elem [data owner]
   (reify
     om/IInitState

                  (do
                    (om/set-state! owner :current-position c)
                    (om/set-state! owner :end-position e))))
              (recur)))
        ))
    om/IRender
    (render [this]
      (let [ctrl-current (om/get-state owner :ctrl)

                    track-src (om/get-state owner :current-src)
                    next-track (last (take next-offset track-src))
                    previous-track (last (take previous-offset track-src))
                    current-track (last (take current-offset track-src))
                    ]
                (om/set-state! owner :ctrl ctrl)
                (cond
                  (and (= ctrl :next) (> next-offset (count track-src)))
                  (ctrl-audio-node :stop)
                  (and (= ctrl :next) (not (nil? next-track)))
                  (set-track next-track next-offset owner)
                  (and (= ctrl :previous) (not (nil? previous-track)))
                  (set-track previous-track previous-offset owner)
                  :else (do (ctrl-audio-node ctrl)
                            (when (= ctrl :stop)
                              (put! channels/now-playing {"track" {}}))
                            (when (= ctrl :play)
                              (put! channels/now-playing current-track)))))
              (recur)))
        (go (loop []
              (<! channels/stream-position)
