2010-09-25 13:48:08 +00:00
|
|
|
(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)
|
2010-12-06 22:30:58 +00:00
|
|
|
(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))))
|