Toggle microphone: Better error message if there is no default input
Instead of an Elisp type error.
This commit is contained in:
parent
a81c61ab0a
commit
8109f43855
@ -294,9 +294,10 @@ object. Otherwise apply it on the default audio sink."
|
|||||||
(defun pipewire-toggle-microphone ()
|
(defun pipewire-toggle-microphone ()
|
||||||
"Switch mute status of the default audio input."
|
"Switch mute status of the default audio input."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let* ((object (car (pipewire-lib-default-capture-ports)))
|
(let ((object (car (pipewire-lib-default-capture-ports))))
|
||||||
(muted-p (pipewire-lib-toggle-mute object)))
|
(if object
|
||||||
(pipewire--update-muted object muted-p)))
|
(pipewire--update-muted object (pipewire-lib-toggle-mute object))
|
||||||
|
(error "No default audio input"))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun pipewire-set-volume (volume &optional object single-p)
|
(defun pipewire-set-volume (volume &optional object single-p)
|
||||||
|
Loading…
Reference in New Issue
Block a user