 ;; ORBIT_SOCKETDIR=/tmp/orbit-gregj
 
 
-(def fifo-path "/tmp/MYCMD")
-
-(def player-cmd (str "/usr/bin/mplayer -quiet -slave -input file=" fifo-path " -idle -nocache -nortc"))
-
-
 (defn mplayer-key->keyword [s]
   (->>
    (str/replace s #"(ANS_META_|ANS_)" "")

   (apply hash-map)
   )))

(defn mkfifo []
  (let [fifo-path "/tmp/MYCMD"]
    (do
      (sh "rm" "-f" fifo-path)
      (sh "mkfifo" fifo-path))))


;; (defn start-player [& playlist]
;;   (do
;;     (mkfifo)
;;     (Thread/sleep 200)
;;     (println (str player-cmd " " (clojure.string/join " " playlist) " 1>/tmp/mplayer-out.log 2>&1 & \n echo $!"))
;;     (sh "bash" "-c" (str player-cmd " " (first playlist) " 1>/tmp/mplayer-out.log 2>&1 & \n echo $!"))))

;; (defn pause-player []
;;   (sh "bash" "-c" (str "echo 'pause' > " fifo-path) ))
(defn play-player []
  (sh "mpc" "play"))

(defn pause-player []
  (sh "mpc" "toggle"))



;; (defn step-player
;;   ([] (step-player 1))
;;   ([step]
;;      (sh "bash" "-c" (str "echo 'pt_step " step "' > " fifo-path))))

(defn next-player []
  (sh "mpc" "next"))

(defn prev-player []
  (sh "mpc" "prev"))

(defn quit-player []
  (sh "bash" "-c" (str "echo 'quit' > " fifo-path) ))

(defn get-player-track-info []
  (let [x (sh "bash" "-c" "echo 'get_meta_artist\nget_meta_title\nget_meta_album\nget_meta_genre\nget_meta_year\nget_meta_track\nget_meta_comment' > /tmp/MYCMD")

        ]
    zz))

(defn get-player-volume []
  (first
   (map #(hash-map (keyword (nth % 1)) (nth % 2))
        (re-seq #"(volume):\s*([0-9]+)" (:out (sh "mpc" "volume"))))))

(defn get-player-upcoming
  "Get pre-formatted upcoming songs"
  ([]
