home *** CD-ROM | disk | FTP | other *** search
- (in-package :oou)
- (oou-provide :video-svm)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; :video-svm.lisp
- ;;
- ;; Copyright ⌐ 1991 Northwestern University Institute for the Learning Sciences
- ;; All Rights Reserved
- ;;
- ;; author: Michael S. Engber
- ;;
- ;; mixin for adding video to views
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (oou-dependencies :video-player
- :video-digitizer-svm
- )
-
- (export '(video-svm video-view player-object))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (defclass video-svm (video-digitizer-svm)
- ((player-class :initarg :player-class)
- (player-object :initarg :player-object
- :accessor player-object)
- (dispose-vp-on-remove-p :initarg :dispose-vp-on-remove-p)
- )
- (:default-initargs
- :dispose-vp-on-remove-p t))
-
- (defclass video-view (video-svm simple-view) ())
-
- (defmethod initialize-instance :after ((sv video-svm) &rest initargs
- &key
- &allow-other-keys)
- (declare (dynamic-extent initargs))
- (unless (slot-boundp sv 'player-object)
- (setf (player-object sv)
- (apply 'make-instance (slot-value sv 'player-class)
- :allow-other-keys t
- initargs))))
-
- (defmethod install-view-in-window :after ((sv video-svm) window)
- (declare (ignore window))
- (vp-init (player-object sv)))
-
- (defmethod remove-view-from-window :before ((sv video-svm))
- (with-slots ((vp player-object)) sv
- (vp-stop vp)
- (when (slot-value sv 'dispose-vp-on-remove-p) (vp-dispose vp))))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (defmethod vp-load ((sv video-svm) &rest rest &key &allow-other-keys)
- (apply 'vp-load (player-object sv) rest))
-
- (defmethod vp-loaded-p ((sv video-svm))
- (funcall 'vp-loaded-p (player-object sv)))
-
- (defmethod vp-features ((sv video-svm))
- (funcall 'vp-features (player-object sv)))
-
- (defmethod vp-seek ((sv video-svm) frame &rest rest &key &allow-other-keys)
- (apply 'vp-seek (player-object sv) frame rest))
-
- (defmethod vp-play ((sv video-svm))
- (funcall 'vp-play (player-object sv))
- (unless (digitizing-p sv) (start-digitizing sv)))
-
- (defmethod vp-limit ((sv video-svm) min-frame max-frame)
- (funcall 'vp-limit (player-object sv) min-frame max-frame))
-
- (defmethod vp-play-clip ((sv video-svm) start-frame end-frame &rest rest &key &allow-other-keys)
- (apply 'vp-play-clip (player-object sv) start-frame end-frame rest)
- (unless (digitizing-p sv) (start-digitizing sv)))
-
- (defmethod vp-scan ((sv video-svm) direction speed-x)
- (funcall 'vp-scan (player-object sv) direction speed-x)
- (unless (digitizing-p sv) (start-digitizing sv)))
-
- (defmethod vp-jump ((sv video-svm) direction frame-count)
- (funcall 'vp-jump (player-object sv) direction frame-count)
- (unless (digitizing-p sv) (grab-one-frame sv)))
-
- (defmethod vp-step ((sv video-svm) direction)
- (funcall 'vp-step (player-object sv) direction)
- (unless (digitizing-p sv) (grab-one-frame sv)))
-
- (defmethod vp-stop ((sv video-svm))
- (when (digitizing-p sv) (stop-digitizing sv))
- (funcall 'vp-stop (player-object sv)))
-
- (defmethod vp-freeze ((sv video-svm))
- (when (digitizing-p sv) (stop-digitizing sv))
- (funcall 'vp-freeze (player-object sv)))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- #|
- an example can be found in video-example.lisp
- |#