~breatheoutbreathein/emacs-simple-mpc-breatheoutbreathein

bed901a49527e8ad8837f3c4fc41e7d7f0ba4700 — Joseph Turner 1 year, 9 months ago 4cc5ae2
Use simple-mpc-extract-status to get current volume

Replaces simple-mpc-message-current-volume.
2 files changed, 1 insertions(+), 12 deletions(-)

M simple-mpc-utils.el
M simple-mpc.el
M simple-mpc-utils.el => simple-mpc-utils.el +0 -11
@@ 112,17 112,6 @@ output as a string."
    (simple-mpc-call-mpc t "playlist")
    (count-lines (point-min) (point-max))))

(defun simple-mpc-message-current-volume ()
  "Return the current volume."
  ;; Use "%s" as format-string. Otherwise message will
  ;; interpret the percent symbol in mpc's output as an
  ;; incomplete format specifier.
  (message "%s"
           (with-temp-buffer
             (simple-mpc-call-mpc t "volume")
             (delete-char -1)  ;; delete trailing \n
             (buffer-string))))

(defun simple-mpc-extract-status (type)
  "Return the mpc data corresponding to TYPE of current song. TYPE may be one of the keys of `simple-mpc-status-re-groups'."
  (with-temp-buffer

M simple-mpc.el => simple-mpc.el +1 -1
@@ 101,7 101,7 @@
  "Helper function to adjust volume by VOLUME-CHANGE."
  (let ((volume-change-string (simple-mpc-convert-number-to-relative-string volume-change)))
    (simple-mpc-call-mpc nil (list "volume" volume-change-string)))
  (simple-mpc-message-current-volume))
  (message "%s" (simple-mpc-extract-status 'volume)))

(defun simple-mpc-clear-current-playlist ()
  "Clear the current playlist."