3 ;;; Julian Squires / 2004
8 (eval-when (:compile-toplevel
:load-toplevel
:execute
)
9 (defvar *replay-map
* nil
))
12 (name) (special-handler) (channel-creator) (output-fn))
14 (defun register-replay (name special-handler channel-creator output-fn
)
15 (let ((replay (make-replay :name name
:special-handler special-handler
16 :channel-creator channel-creator
17 :output-fn output-fn
)))
18 (aif (position name
*replay-map
* :test
#'equal
:key
#'replay-name
)
19 (setf (nth it
*replay-map
*) replay
)
20 (push replay
*replay-map
*))))
22 (defun set-tune-replay (name tune
)
23 (dolist (replay *replay-map
*)
24 (when (equal name
(replay-name replay
))
25 (setf (tune-replay tune
) replay
)
27 (equal (replay-name (tune-replay tune
)) name
))
31 (defun compile-mumble (in-file out-file
)
32 (with-open-file (stream in-file
)
33 (let ((tune (parse-mumble-file stream
)))
34 (funcall (replay-output-fn (tune-replay tune
)) tune out-file
))))