summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-11-03 13:57:50 -0600
committerCraig Jennings <c@cjennings.net>2025-11-03 13:57:50 -0600
commit6624bc48bd9c2c784f41fdf406ec0a73a23adf75 (patch)
treecc91a268a339aaaad77e2c93f6ebdcd01415e8aa /modules
parentcf90eada0d16133f860b31f618ce0a5fb3468c75 (diff)
ux: Use friendlier labels for device states in recording module
Replace technical state names with user-friendly labels: - "SUSPENDED" → "Ready" (device available, will activate on use) - "RUNNING" → "Active" (device currently in use) - "IDLE" → "Ready" Add explanatory note in device list buffer explaining that "Ready" devices are normal and will activate automatically when recording starts. Prevents user confusion - "SUSPENDED" sounds like something is wrong when it's actually the normal idle state. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/video-audio-recording.el20
1 files changed, 16 insertions, 4 deletions
diff --git a/modules/video-audio-recording.el b/modules/video-audio-recording.el
index f9311957..bd0a0b22 100644
--- a/modules/video-audio-recording.el
+++ b/modules/video-audio-recording.el
@@ -82,6 +82,15 @@ Returns list of (device-name description state) tuples."
(push (list device driver state) sources))))
(nreverse sources)))
+(defun cj/recording-friendly-state (state)
+ "Convert technical state name to user-friendly label.
+STATE is the raw state from pactl (SUSPENDED, RUNNING, IDLE, etc.)."
+ (pcase state
+ ("SUSPENDED" "Ready")
+ ("RUNNING" "Active")
+ ("IDLE" "Ready")
+ (_ state))) ; fallback to original if unknown
+
(defun cj/recording-list-devices ()
"Show all available audio sources in a readable format.
Opens a buffer showing devices with their states."
@@ -91,6 +100,7 @@ Opens a buffer showing devices with their states."
(erase-buffer)
(insert "Available Audio Sources\n")
(insert "========================\n\n")
+ (insert "Note: 'Ready' devices are available and will activate when recording starts.\n\n")
(insert "Current Configuration:\n")
(insert (format " Microphone: %s\n" (or cj/recording-mic-device "Not set")))
(insert (format " System Audio: %s\n\n" (or cj/recording-system-device "Not set")))
@@ -99,8 +109,9 @@ Opens a buffer showing devices with their states."
(dolist (source sources)
(let ((device (nth 0 source))
(driver (nth 1 source))
- (state (nth 2 source)))
- (insert (format "%-10s [%s]\n" state driver))
+ (state (nth 2 source))
+ (friendly-state (cj/recording-friendly-state (nth 2 source))))
+ (insert (format "%-10s [%s]\n" friendly-state driver))
(insert (format " %s\n\n" device))))
(insert " No audio sources found. Is PulseAudio/PipeWire running?\n"))
(goto-char (point-min))
@@ -118,8 +129,9 @@ Returns selected device name or nil."
(choices (mapcar (lambda (s)
(let ((device (nth 0 s))
(driver (nth 1 s))
- (state (nth 2 s)))
- (cons (format "%-10s %s" state device) device)))
+ (state (nth 2 s))
+ (friendly-state (cj/recording-friendly-state (nth 2 s))))
+ (cons (format "%-10s %s" friendly-state device) device)))
filtered)))
(if choices
(cdr (assoc (completing-read prompt choices nil t) choices))