Compare commits

..

No commits in common. "91888abb91e75898be496445877ee921f7c99136" and "e9273dcf09813f4f729ac7fbfa5af2dca00a495b" have entirely different histories.

4 changed files with 15 additions and 23 deletions

View File

@ -3,7 +3,7 @@
;; Copyright (C) 2022 Milan Zamazal <pdm@zamazal.org>
;; Author: Milan Zamazal <pdm@zamazal.org>
;; Version: 1
;; Package-Version: 1
;; Package-Requires: ((emacs "25.1"))
;; Keywords: multimedia
;; URL: https://git.zamazal.org/pdm/pipewire-0

View File

@ -3,7 +3,7 @@
;; Copyright (C) 2022 Milan Zamazal <pdm@zamazal.org>
;; Author: Milan Zamazal <pdm@zamazal.org>
;; Version: 1
;; Package-Version: 1
;; Package-Requires: ((emacs "25.1"))
;; Keywords: multimedia
;; URL: https://git.zamazal.org/pdm/pipewire-0
@ -39,8 +39,6 @@
(require 'eieio)
;;; Code:
(defclass pw-accessor ()
()
:documentation

View File

@ -3,7 +3,7 @@
;; Copyright (C) 2022 Milan Zamazal <pdm@zamazal.org>
;; Author: Milan Zamazal <pdm@zamazal.org>
;; Version: 1
;; Package-Version: 1
;; Package-Requires: ((emacs "28.1"))
;; Keywords: multimedia
;; URL: https://git.zamazal.org/pdm/pipewire-0
@ -35,8 +35,6 @@
(require 'cl-lib)
(require 'pw-access)
;;; Code:
(defvar pw-lib--accessor (pw-cli-accessor))
(defvar pw-lib--objects '())
@ -120,7 +118,7 @@ A list of strings (possibly empty) is returned."
"Set the profile of the given device.
DEVICE-ID is the numeric id of the device.
PROFILE is a string name of the profile, it must be one of the values
returned from `pw-lib-profiles'."
returned from `pw-lib-profiles'. "
(let* ((all-profiles (pw-access-profiles pw-lib--accessor device-id))
(properties (cl-find profile all-profiles :key #'pw-lib--profile-name :test #'equal)))
(unless properties
@ -131,9 +129,9 @@ returned from `pw-lib-profiles'."
(pw-access-set-profile pw-lib--accessor device-id index))))
(defun pw-lib-parent-node (object)
"Return parent node of OBJECT.
"Return parent node of `object'.
This is typically used for ports.
Behavior is undefined if OBJECT has no parent node."
Behavior is undefined if `object' has no parent node."
(pw-lib-get-object (pw-lib-object-value object "node.id")))
(defun pw-lib--node (object)
@ -251,7 +249,7 @@ version, call `pw-lib-refresh' first."
(list node-p parameters monitor-p node-id port-id)))
(defun pw-lib-muted-p (object &optional refresh)
"Return whether the given PipeWire OBJECT is muted.
"Return whether the given PipeWire object is muted.
Applicable only to Nodes and Ports.
If REFRESH is non-nil then retrive fresh information from PipeWire
rather than using cached data to obtain the result."
@ -274,7 +272,7 @@ rather than using cached data to obtain the result."
mute)))
(defun pw-lib-volume (object &optional refresh)
"Return volume of the given PipeWire OBJECT.
"Return volume of the given PipeWire object.
The returned value is an integer in the range 0-100.
Applicable only to Nodes and Ports.
If REFRESH is non-nil then retrive fresh information from PipeWire
@ -326,7 +324,7 @@ otherwise set the current default sink or source."
("Node"
(pw-lib--set-default-node object stored-p))
(_
(error "Cannot set this kind of object as default"))))
(error "Cannot set this kind of object as default."))))
(provide 'pw-lib)

View File

@ -3,7 +3,7 @@
;; Copyright (C) 2022 Milan Zamazal <pdm@zamazal.org>
;; Author: Milan Zamazal <pdm@zamazal.org>
;; Version: 1
;; Package-Version: 1
;; Package-Requires: ((emacs "25.1"))
;; Keywords: multimedia
;; URL: https://git.zamazal.org/pdm/pipewire-0
@ -33,8 +33,6 @@
(require 'pw-lib)
;;; Code:
(defgroup pipewire ()
"PipeWire user interface."
:group 'multimedia)
@ -297,9 +295,7 @@ object. Otherwise apply it on the default audio sink."
VOLUME must be a number in the range 0-100.
If OBJECT is given (only Nodes and Ports are allowed) or if on a Node
or Port in a PipeWire buffer, apply it on the given object.
Otherwise apply it on the default audio sink.
If SINGLE-P is nil, apply it on all related channels, otherwise on the
corresponding object only."
Otherwise apply it on the default audio sink."
(interactive "nVolume: ")
(setq volume (max 0 (min 100 volume)))
(unless object
@ -319,8 +315,8 @@ corresponding object only."
"Increase volume of an audio output or input.
The volume is increased by `pipewire-volume-step'.
If on a Node or Port in a PipeWire buffer, apply it on all the
channels of the given object, unless SINGLE-P is non-nil.
Otherwise apply it on the default audio sink."
channels of the given object. Otherwise apply it on the default audio
sink."
(interactive)
(pw-ui--change-volume pipewire-volume-step single-p))
@ -338,8 +334,8 @@ object. Otherwise apply it on the default audio sink."
"Decrease volume of an audio output or input.
The volume is decreased by `pipewire-volume-step'.
If on a Node or Port in a PipeWire buffer, apply it on all the
channels of the given object, unless SINGLE-P is non-nil.
Otherwise apply it on the default audio sink."
channels of the given object. Otherwise apply it on the default audio
sink."
(interactive)
(pw-ui--change-volume (- pipewire-volume-step) single-p))