(in-package #:mpd) (defparameter mpd::*debug-on* nil) (defun clos-client () (let ((client (make-instance 'mpd-client)) (status (make-instance 'mpd-status)) (song (make-instance 'mpd-song :position 1)) (maybe-song-in-playlist-index 0)) (format t "~&
Created with CL-MPD
") (with-mpd-client-slots (client) ;; L56 (with-mpd-status-slots (status) (mpd-update-status client status) (format t "~&Slot values for STATUS contains...
")
(format t "~&volume: ~S ~%repeat: ~S ~%random: ~S ~%playlist: ~S
"
volume repeat random playlist)
(format t "~%playlistlength: ~S ~%xfade: ~S ~%state: ~S ~%song: ~S ~%songid: ~S
"
playlist-length xfade state song songid)
(setf maybe-song-in-playlist-index song)
(format t "~%time: ~S ~%bitrate: ~S ~%audio: ~S ~%updating_db: ~S ~%error: ~S
"
time bitrate audio updating-db error))
;; L87
(let* ((cnt (mpd-status-playlist-length status))
(table (make-hash-table :size cnt))
(current-song-index 0))
(flet ((maybe-its-the-song ()
(if (= current-song-index maybe-song-in-playlist-index)
"> "
" ")
(incf current-song-index)))
(dotimes (i cnt)
(let ((obj (make-instance 'mpd-song :position i)))
(mpd-update-song client obj)
(setf (gethash i table) obj)))
(format t "~&
Artist:~A~A~%~&Title:~A~A~%Album:~A~A~%~%
"
#\Tab artist #\Tab title #\Tab album))
(mpd-client-disconnect client))))
(defun my-source ()
(let ((content (uiop:read-file-string #P"test-client.lisp")))
(format t "~a~%" content)))