Various mpd updates and improvements.
authorSteve Youngs <steve@sxemacs.org>
Sun, 18 Aug 2013 04:44:47 +0000 (14:44 +1000)
committerSteve Youngs <steve@sxemacs.org>
Sun, 18 Aug 2013 04:46:28 +0000 (14:46 +1000)
commit8ec355f9a7543fedcb55fcb7d37baa10bb40239d
tree9c7a35b768d13877409561657a2622196ca63443
parent45358a9c52f4f3ec5ea3d593f7d5bd9c2c397e1a
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>
mpd.el