An MPD client implementation in clojure
[mpd-clj "0.2.0"]
Note: A breaking change in the API has occurred since 0.1.8. Please read the updated documentation below.
You can pull in the entire library by requireing mpd-clj.core
(ns example.core
(:require [mpd-clj.core :as mpd]))
;; create a client and pass it your host and port info.
(def mpd-server (mpd/client {:host "10.0.0.1" :port 6600}))
;; execute the stats command using the specified client
(mpd/stats mpd-server)
Or you can pull in individual pieces
(ns example.core
(:require [mpd-clj.utils :as mpd]
[mpd-clj.status :refer :all])
;; define the host and port of your mpd server
(def mpd-server (mpd/client {:host "10.0.0.1" :port 6600}))
;; execute the stats command on the specified server
(stats mpd-server)
The namespaces you can pull in are
- mpd-clj.status
- mpd-clj.options
- mpd-clj.playback
- mpd-clj.controlls
- mpd-clj.stored
- mpd-clj.db
- mpd-clj.utils
All functions require a client object. In my usage I call it
mpd-server
but you can call it anything. The client function returns an object representing an asyncronous tcp connection. The client function requires a server configuration object. The server configuration is a map with two key value pairs, host
and port
. host
expects a string of either an IP address or FQDN. port
expects an integer.
- make library feature complete with mpd documentation
- write more tests
Copyright © 2015 Tim Gallant
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.