Change volume of playback ports by default
This seems to be more correct than changing volume of the whole sink. The default volume of the sink is 1 (100) and alsamixer also changes volume of the ports.
This commit is contained in:
@@ -150,6 +150,13 @@ version, call `pw-lib-refresh' first."
|
||||
"Return a PipeWire object that is the current default audio sink."
|
||||
(pw-lib-get-object (cdr (assoc "default.audio.sink" (pw-lib-default-nodes)))))
|
||||
|
||||
(defun pw-lib-default-playback-ports ()
|
||||
"Return list of PipeWire objects that are default playback ports."
|
||||
(cl-remove-if-not #'(lambda (o)
|
||||
(if-let ((name (pw-lib-object-value o "port.name")))
|
||||
(string-match "^playback" name)))
|
||||
(pw-lib-children (pw-lib-object-id (pw-lib-default-audio-sink)) "Port")))
|
||||
|
||||
(defun pw-lib--volume-% (volume)
|
||||
(when volume
|
||||
(round (* 100 volume))))
|
||||
|
||||
Reference in New Issue
Block a user