Toggle microphone: Better error message if there is no default input

Instead of an Elisp type error.
main
Milan Zamazal 7 months ago
parent a81c61ab0a
commit 8109f43855

@ -294,9 +294,10 @@ object. Otherwise apply it on the default audio sink."
(defun pipewire-toggle-microphone ()
"Switch mute status of the default audio input."
(interactive)
(let* ((object (car (pipewire-lib-default-capture-ports)))
(muted-p (pipewire-lib-toggle-mute object)))
(pipewire--update-muted object muted-p)))
(let ((object (car (pipewire-lib-default-capture-ports))))
(if object
(pipewire--update-muted object (pipewire-lib-toggle-mute object))
(error "No default audio input"))))
;;;###autoload
(defun pipewire-set-volume (volume &optional object single-p)

Loading…
Cancel
Save