customized using the new user options 'mpc-notifications-title' and
'mpc-notifications-body'.
+*** New user option 'mpc-crossfade-time'.
+When non-nil, MPC will crossfade between songs for the specified number
+of seconds. Crossfading can be toggled using the command
+'mpc-toggle-crossfade' or from the MPC menu.
+
\f
* New Modes and Packages in Emacs 31.1
(defun mpc-cmd-tagtypes ()
(mapcar #'cdr (mpc-proc-cmd-to-alist "tagtypes")))
+(defun mpc-cmd-crossfade (&optional arg)
+ "Set duration of crossfade to `mpc-crossfade-time' or ARG seconds."
+ (mpc-proc-cmd (list "crossfade" (or arg mpc-crossfade-time))
+ #'mpc-status-refresh))
+
;; This was never integrated into MPD.
;; (defun mpc-cmd-download (file)
;; (with-current-buffer (generate-new-buffer " *mpc download*")
"Directory where MPC.el stores auxiliary data."
:type 'directory)
+(defcustom mpc-crossfade-time 3
+ "Number of seconds to crossfade between songs."
+ :version "31.1"
+ :type 'natnum)
+
(defun mpc-data-directory ()
(unless (file-directory-p mpc-data-directory)
(make-directory mpc-data-directory))
:selected (member '(single . "1") mpc-status)]
["Consume Mode" mpc-toggle-consume :style toggle
:selected (member '(consume . "1") mpc-status)]
+ ["Crossfade Songs" mpc-toggle-crossfade :style toggle
+ :selected (alist-get 'xfade mpc-status)]
"--"
["Add new browser" mpc-tagbrowser]
["Update DB" mpc-update]
(mpc-cmd-random
(if (string= "0" (cdr (assq 'random (mpc-cmd-status)))) "1" "0")))
+(defun mpc-toggle-crossfade ()
+ "Toggle crossfading between songs."
+ (interactive)
+ (mpc-cmd-crossfade
+ (if (alist-get 'xfade mpc-status) "0" mpc-crossfade-time)))
+
(defun mpc-stop ()
"Stop playing the current queue of songs."
(interactive)