osc/devices/listening-device.lisp
j.forth 73b2376168 twiddle listener debug format
Ignore-this: 5175799645ca7ee38cd96445de532e2c

darcs-hash:20101206223058-16a00-df77e33c92f4343b147536ed8729209fa47844cb
2012-07-03 21:54:22 +01:00

27 lines
998 B
Common Lisp

(cl:in-package #:osc)
(defgeneric make-listening-thread (listening-device))
(defmethod connect progn ((listening-device listening-device)
host-port &key host-address host-name port)
(declare (ignore host-port host-address host-name port))
(set-listening-thread (make-listening-thread listening-device)
listening-device))
(defmethod quit ((device listening-device))
(sb-thread:terminate-thread (listening-thread device)))
(defmethod osc-device-cleanup ((device listening-device))
(set-listening-thread nil device)
(call-next-method))
(defmethod osc-device-cleanup ((device receiving-device))
(fill (socket-buffer device) 0)
(call-next-method))
(defun print-osc-debug-msg (receiver message length address port
timetag)
(format t "~%~A~%received:~A~A~%bytes:~A~A~A~%from:~A~A~A ~A ~%timetag:~A~A~%unix-time:~A~F~%"
(name receiver) #\Tab message #\Tab #\Tab length #\Tab #\Tab
address port #\Tab timetag #\Tab
(when timetag (timetag->unix-time timetag))))