From 8de47fd766fe57c7f89960ee110b209a946024cb Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 26 Feb 2026 18:37:07 -0600 Subject: feat(recording): intuitive labels, show muted devices, add app names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rework quick-setup device picker: - Labels: [in use], [ready], [available], [muted] instead of PulseAudio jargon (RUNNING/IDLE/SUSPENDED) - Muted devices now shown (previously hidden) so users can see all connected hardware and understand why a device is unsuitable - Sink step shows which apps are playing through each output: "JDS Labs Element IV [in use] (Firefox, Spotify)" - Prompt changed from "audio output to monitor" to "audio output to capture" to avoid PulseAudio monitor terminology confusion - Sort order: in use → ready → available → muted --- ...t-video-audio-recording--get-available-sinks.el | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'tests/test-video-audio-recording--get-available-sinks.el') diff --git a/tests/test-video-audio-recording--get-available-sinks.el b/tests/test-video-audio-recording--get-available-sinks.el index a8e7ad6a..2f0d965c 100644 --- a/tests/test-video-audio-recording--get-available-sinks.el +++ b/tests/test-video-audio-recording--get-available-sinks.el @@ -3,9 +3,9 @@ ;;; Commentary: ;; Unit tests for cj/recording--get-available-sinks. ;; Verifies that available sinks are discovered correctly: -;; - Muted sinks are excluded +;; - Muted sinks are included (shown with [muted] label in UI) ;; - Friendly descriptions from PulseAudio are used -;; - PulseAudio state is included +;; - PulseAudio state and mute status are included ;;; Code: @@ -29,16 +29,16 @@ Each sink is (name description mute state)." ;;; Normal Cases -(ert-deftest test-get-available-sinks-normal-filters-muted () - "Test that muted sinks are excluded from sink list." +(ert-deftest test-get-available-sinks-normal-includes-muted () + "Test that muted sinks are included in sink list." (cl-letf (((symbol-function 'shell-command-to-string) (lambda (_cmd) (test-sinks--make-pactl-output '(("active-sink" "Active Sink" "no" "RUNNING") ("muted-sink" "Muted Sink" "yes" "SUSPENDED")))))) (let ((sinks (cj/recording--get-available-sinks))) - (should (= 1 (length sinks))) - (should (equal "active-sink" (nth 0 (car sinks))))))) + (should (= 2 (length sinks))) + (should (equal "yes" (nth 3 (nth 1 sinks))))))) (ert-deftest test-get-available-sinks-normal-uses-descriptions () "Test that friendly descriptions are returned as second element." @@ -58,8 +58,17 @@ Each sink is (name description mute state)." (let ((sinks (cj/recording--get-available-sinks))) (should (equal "RUNNING" (nth 2 (car sinks))))))) +(ert-deftest test-get-available-sinks-normal-includes-mute-status () + "Test that mute status is returned as fourth element." + (cl-letf (((symbol-function 'shell-command-to-string) + (lambda (_cmd) + (test-sinks--make-pactl-output + '(("sink-a" "Sink A" "yes" "SUSPENDED")))))) + (let ((sinks (cj/recording--get-available-sinks))) + (should (equal "yes" (nth 3 (car sinks))))))) + (ert-deftest test-get-available-sinks-normal-multiple-sinks () - "Test that multiple non-muted sinks are returned." + "Test that multiple sinks are returned including muted." (cl-letf (((symbol-function 'shell-command-to-string) (lambda (_cmd) (test-sinks--make-pactl-output @@ -67,7 +76,7 @@ Each sink is (name description mute state)." ("sink-b" "Shure MV7+" "no" "SUSPENDED") ("muted-sink" "Muted" "yes" "SUSPENDED")))))) (let ((sinks (cj/recording--get-available-sinks))) - (should (= 2 (length sinks)))))) + (should (= 3 (length sinks)))))) ;;; Boundary Cases @@ -77,14 +86,5 @@ Each sink is (name description mute state)." (lambda (_cmd) ""))) (should (null (cj/recording--get-available-sinks))))) -(ert-deftest test-get-available-sinks-boundary-all-muted () - "Test that if all sinks are muted, returns empty list." - (cl-letf (((symbol-function 'shell-command-to-string) - (lambda (_cmd) - (test-sinks--make-pactl-output - '(("muted-a" "Sink A" "yes" "SUSPENDED") - ("muted-b" "Sink B" "yes" "SUSPENDED")))))) - (should (null (cj/recording--get-available-sinks))))) - (provide 'test-video-audio-recording--get-available-sinks) ;;; test-video-audio-recording--get-available-sinks.el ends here -- cgit v1.2.3