Various mpd updates and improvements.
This changeset primarily adds inserting coverart into the balloon-help
buffer, but it also cleans up the code and fixes a couple of tiny bugs
and prevents bytecompiler warnings.
* mpd.el (mpd-start-connection): Add #'mpd-clear-variables to
mpd-before-variables-update-hook.
(mpd-disconnect): Remove it here.
(define-mpd-command): Improve docstring.
(mpd-state): New. Returns the value of `**mpd-var-state*'.
(mpd-stopped-p, mpd-paused-p): Use it.
(mpd-volume): New. Returns the current volume as int.
(mpd-muted-p): New. Return t when volume is zero.
(mpd-volume-up): Use #'mpd-volume, don't run any hooks.
(mpd-volume-down): Ditto.
(mpd-volume-mute): Define with `mpd-define-command' to have hooks
run. Use #'mpd-volume.
(mpd-volume-min): Use #'mpd-volume, improve docstring.
(mpd-songpos): Prevent bytecompiler warnings.
(mpd-seek): Ditto.
(mpd-seek-forward, mpd-seek-backward): Add docstring.
(mpd-file): New. Return a mpd track filename.
(mpd-cover-file): New. Returns a possible coverart filename.
(mpd-has-cover-p): New. Returns t when coverart exists
for the current track.
(mpd-scale-cover): New. Scales coverart image.
(mpd-update-cover): Rewrite with #'mpd-file, #'mpd-cover-file,
#'mpd-has-cover-p, #'mpd-scale-cover
(mpd-clear-variables): New. Sets Title, Artist, Album, Genre, and
Date variables to nil when they don't exist in the metainfo.
(mpd-info): Prevent bytecompiler warnings. Allow space for
coverart in balloon when necessary.
(mpd-balloon-cover): New. Inserts coverart into mpd balloon.
(balloon-help-display-help): Advised to insert coverart.
Signed-off-by: Steve Youngs <steve@sxemacs.org>