home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / source / oodleutl.cpt / oodles-of-utils / NotInROM / +Sound.lisp < prev    next >
Encoding:
Text File  |  1992-02-07  |  1.6 KB  |  47 lines

  1. ;; -*- package: NotInROM -*-
  2. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3. ;; +Sound.Lisp
  4. ;;
  5. ;; Copyright ⌐ 1991 Northwestern University Institute for the Learning Sciences
  6. ;; All Rights Reserved
  7. ;;
  8. ;; author: Michael S. Engber
  9. ;;
  10. ;; Provides missing Sound Manager Routines
  11. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  12.  
  13. (eval-when (:compile-toplevel :load-toplevel :execute)
  14.   (require    :NotInROM-u)
  15.   (in-package :NotInROM))
  16.  
  17. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  18.  
  19. (deftrap-NotInROM _GetSoundVol :none ((level (:pointer :signed-integer)))
  20.   (%put-word level (%get-unsigned-byte (%int-to-ptr #$SdVolume))))
  21.  
  22.  
  23. (deftrap-NotInROM _SetSoundVol :none ((level :signed-integer))
  24.   (rlet ((pb :ParamBlockRec
  25.              :ioCompletion (%null-ptr)
  26.              :ioRefNum -4
  27.              :csCode    2))
  28.     (%put-word (pref pb :ParamBlockRec.csParam) level)
  29.     (#_PBControl pb)))
  30.  
  31. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  32.  
  33. ;;This one is taken pretty much straight from interfaces.lisp.
  34. ;;I don't claim to understand how it works.
  35. ;;
  36. ;;IM II p.232 outlines an approach, but doesn't say exactly how
  37. ;;to get the most recent pb. Presumably, #x0AE8 is the address of
  38. ;;a ptr to ptr to the param block of the most recent sound driver call.
  39. ;;
  40. ;;The SoundDriver is considered obsolete now (and at some point will be
  41. ;;removed), so you probably shouldn't be using this call anyway.
  42.  
  43. (deftrap-NotInROM _SoundDone :Boolean ()
  44.   (let ((pb (%get-long (%int-to-ptr #x0AE8))))
  45.     (or (= pb -1)
  46.         (<= (pref (%get-ptr (%int-to-ptr pb)) :ParamBlockRec.ioResult) 0))))
  47.