aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-10-31 07:20:42 -0500
committerColin Okay <colin@cicadas.surf>2022-10-31 07:20:42 -0500
commit25d906dd84479522cd53bbb96597b7375de7a61e (patch)
tree6955eac9b12b30fed8e505ce247772f19a9faf7f
parent49a1cf6766f2cf5cc28c7cdf5b234a80f4d02364 (diff)
Modify: clicking on tracks to make them play.
-rw-r--r--playlist.lisp17
1 files changed, 10 insertions, 7 deletions
diff --git a/playlist.lisp b/playlist.lisp
index abb8e3d..236da00 100644
--- a/playlist.lisp
+++ b/playlist.lisp
@@ -165,13 +165,16 @@
(defun play-this-audio (audio)
(when-let (ctl (cur-playlist-ctl audio))
(let ((np (now-playing-track ctl)))
- (unless (and np (eq audio (audio np)))
- (let ((tr
- (track-ctl-with-audio ctl audio)))
- (stop-playback ctl)
- (setf (now-playing-track ctl) tr)
- (start-playback ctl)
- (load-now-playing-display ctl tr))))))
+ (cond
+ ((not (eq audio (audio np))) ; different track
+ (let ((tr
+ (track-ctl-with-audio ctl audio)))
+ (stop-playback ctl)
+ (setf (now-playing-track ctl) tr)
+ (start-playback ctl)
+ (load-now-playing-display ctl tr)))
+ ((pausedp audio)
+ (start-playback ctl))))))
;;; SYNCHRONZIED CLIENT CONTROL