home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / source / usynchsn.bin < prev    next >
MacBinary  |  1989-09-14  |  4.3 KB  |  [TEXT/TEXT]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: usynchsn.bin

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert AMOS Picture Packer (image/amosPicturePacker) ext Supported
1% dexvert Debian floppy split (archive/debianFloppySplit) ext Unsupported
1% dexvert Sound Images sound sample (audio/soundImagesSoundSample) ext Unsupported
1% dexvert DESI-III drawing (image/desiIIIDrawing) ext Unsupported
1% dexvert MS-DOS PMODE extender executable (executable/msdosPMODEExtenderExecutable) ext Unsupported
1% dexvert Alien Trilogytextures (other/alienTrilogyTextures) ext Unsupported
1% dexvert APT cache data (other/aptCacheData) ext Unsupported
1% dexvert CorelTRACE configuration (other/corelTRACEConfiguration) ext Unsupported
1% dexvert Dreamcast Disc (other/dreamcastDisc) ext Unsupported
1% dexvert EST flat binary (other/estFlatBinary) ext Unsupported
1% dexvert Finale Enigma Binary Format (other/finaleEnigmaBinaryFormat) ext Unsupported
1% dexvert Sega Genesis/Megadrive/32x ROM (other/genesisROM) ext Unsupported
1% dexvert Myth: The Fallen Lords game archive (other/mythTheFallenLordsGameArchive) ext Unsupported
1% dexvert Sound Images Sound Driver (other/soundImagesSoundDriver) ext Unsupported
1% dexvert Symantec/Norton Config (other/symantecNortonConfig) ext Unsupported
1% dexvert Vectrex ROM (other/vectrexROM) ext Unsupported
1% dexvert BIS raP encoded format (other/bisraPEncoded) ext Unsupported
1% dexvert Pascal Script binary (other/pascalScriptBinary) ext Unsupported
1% dexvert 7th Level game data archive (other/seventhLevelGameDataArchive) ext Unsupported
1% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Binary Text (image/binaryText) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file data default
100% TrID Macintosh plain text (MacBinary) default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[TEXT]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 10 75 61 73 79 6e 63 | 68 73 6e 64 2e 70 2e 62 |..uasync|hsnd.p.b|
|00000010| 69 6e 0a 90 20 88 2b 72 | d2 d0 a1 53 c6 0d 08 31 |in.. .+r|...S...1|
|00000020| 79 40 0c 91 13 26 cd 19 | 10 52 ea 98 31 43 91 e2 |y@...&..|.R..1C..|
|00000030| 45 85 64 de dc 01 d1 26 | 8c 9b 34 70 ea b0 09 43 |E.d....&|..4p...C|
|00000040| 27 54 45 58 54 54 45 58 | 54 01 00 00 40 00 00 00 |'TEXTTEX|T...@...|
|00000050| 00 00 00 00 00 10 2c 00 | 00 00 00 a0 90 6e 28 a0 |......,.|.....n(.|
|00000060| 90 6e 28 00 00 00 00 d8 | 69 6f 6e c9 00 00 00 00 |.n(.....|ion.....|
|00000070| 10 43 6c 6f 73 65 20 43 | 6f 6e 6e 65 63 74 69 6f |.Close C|onnectio|
|00000080| 0d 45 6e 63 6c 6f 73 65 | 64 20 69 73 20 74 68 65 |.Enclose|d is the|
|00000090| 20 73 6f 75 72 63 65 20 | 66 6f 72 20 61 6e 20 4d | source |for an M|
|000000a0| 50 57 20 50 61 73 63 61 | 6c 20 75 6e 69 74 20 74 |PW Pasca|l unit t|
|000000b0| 68 61 74 20 73 68 6f 77 | 73 20 68 6f 77 20 74 6f |hat show|s how to|
|000000c0| 20 70 6c 61 79 0d 61 73 | 79 6e 63 68 72 6f 6e 6f | play.as|ynchrono|
|000000d0| 75 73 20 73 6f 75 6e 64 | 73 20 77 69 74 68 20 74 |us sound|s with t|
|000000e0| 68 65 20 53 6f 75 6e 64 | 20 4d 61 6e 61 67 65 72 |he Sound| Manager|
|000000f0| 2e 20 20 49 20 68 61 76 | 65 20 74 72 69 65 64 20 |. I hav|e tried |
|00000100| 74 68 69 73 20 75 6e 69 | 74 20 6f 6e 6c 79 0d 6f |this uni|t only.o|
|00000110| 6e 20 53 79 73 74 65 6d | 20 36 2e 30 2e 32 3b 20 |n System| 6.0.2; |
|00000120| 73 75 70 70 6f 73 64 6c | 79 20 74 68 65 72 65 20 |supposdl|y there |
|00000130| 61 72 65 20 62 75 67 73 | 20 69 6e 20 65 61 72 6c |are bugs| in earl|
|00000140| 69 65 72 20 76 65 72 73 | 69 6f 6e 73 20 6f 66 20 |ier vers|ions of |
|00000150| 74 68 65 0d 53 6f 75 6e | 64 20 4d 61 6e 61 67 65 |the.Soun|d Manage|
|00000160| 72 2e 20 20 54 68 69 73 | 20 75 6e 69 74 20 61 6c |r. This| unit al|
|00000170| 73 6f 20 64 6f 65 73 6e | 27 74 20 63 68 65 63 6b |so doesn|'t check|
|00000180| 20 66 6f 72 20 74 68 65 | 20 65 78 69 73 74 65 6e | for the| existen|
|00000190| 63 65 20 6f 66 20 74 68 | 65 0d 53 6f 75 6e 64 20 |ce of th|e.Sound |
|000001a0| 4d 61 6e 61 67 65 72 2c | 20 49 20 61 73 73 75 6d |Manager,| I assum|
|000001b0| 65 20 74 68 61 74 20 79 | 6f 75 20 64 6f 20 74 68 |e that y|ou do th|
|000001c0| 69 73 20 61 74 20 61 20 | 68 69 67 68 65 72 20 6c |is at a |higher l|
|000001d0| 65 76 65 6c 2e 0d 49 20 | 75 73 65 64 20 74 68 69 |evel..I |used thi|
|000001e0| 73 20 69 6e 20 61 20 73 | 69 6d 70 6c 65 20 4d 61 |s in a s|imple Ma|
|000001f0| 63 41 70 70 20 70 72 6f | 67 72 61 6d 20 74 68 61 |cApp pro|gram tha|
|00000200| 74 20 77 69 6c 6c 20 6f | 70 65 6e 20 61 6e 79 20 |t will o|pen any |
|00000210| 66 69 6c 65 20 61 6e 64 | 0d 61 6c 6c 6f 77 20 79 |file and|.allow y|
|00000220| 6f 75 20 74 6f 20 70 6c | 61 79 20 61 6e 79 20 73 |ou to pl|ay any s|
|00000230| 6e 64 20 72 65 73 6f 75 | 72 63 65 20 69 6e 20 74 |nd resou|rce in t|
|00000240| 68 65 20 66 69 6c 65 20 | 61 6e 73 79 6e 63 68 72 |he file |ansynchr|
|00000250| 6f 6e 6f 75 73 6c 79 2e | 20 20 28 49 0d 73 74 61 |onously.| (I.sta|
|00000260| 72 74 65 64 20 74 68 69 | 73 20 77 69 74 68 20 74 |rted thi|s with t|
|00000270| 68 65 20 69 64 65 61 20 | 6f 66 20 61 6c 6c 6f 77 |he idea |of allow|
|00000280| 69 6e 67 20 63 6f 70 79 | 20 26 20 70 61 73 74 65 |ing copy| & paste|
|00000290| 2c 20 62 75 74 20 68 61 | 76 65 6e 27 74 20 67 6f |, but ha|ven't go|
|000002a0| 74 74 65 6e 0d 74 68 61 | 74 20 66 61 72 20 79 65 |tten.tha|t far ye|
|000002b0| 74 2e 20 20 49 66 20 74 | 68 65 72 65 20 69 73 20 |t. If t|here is |
|000002c0| 69 6e 74 65 72 65 73 74 | 2c 20 49 20 63 61 6e 20 |interest|, I can |
|000002d0| 70 6f 73 74 20 74 68 61 | 74 20 70 72 6f 67 72 61 |post tha|t progra|
|000002e0| 6d 2e 29 0d 20 4c 61 72 | 72 79 20 52 6f 73 65 6e |m.). Lar|ry Rosen|
|000002f0| 73 74 65 69 6e 2c 20 20 | 4f 62 6a 65 63 74 20 53 |stein, |Object S|
|00000300| 70 65 63 69 61 6c 69 73 | 74 0d 20 41 70 70 6c 65 |pecialis|t. Apple|
|00000310| 20 43 6f 6d 70 75 74 65 | 72 2c 20 49 6e 63 2e 20 | Compute|r, Inc. |
|00000320| 20 32 30 35 32 35 20 4d | 61 72 69 61 6e 69 20 41 | 20525 M|ariani A|
|00000330| 76 65 2c 20 4d 53 20 34 | 36 2d 42 20 20 43 75 70 |ve, MS 4|6-B Cup|
|00000340| 65 72 74 69 6e 6f 2c 20 | 43 41 20 39 35 30 31 34 |ertino, |CA 95014|
|00000350| 0d 20 20 20 20 41 70 70 | 6c 65 4c 69 6e 6b 3a 52 |. App|leLink:R|
|00000360| 6f 73 65 6e 73 74 65 69 | 6e 31 20 20 20 20 64 6f |osenstei|n1 do|
|00000370| 6d 61 69 6e 3a 6c 73 72 | 40 41 70 70 6c 65 2e 43 |main:lsr|@Apple.C|
|00000380| 4f 4d 0d 55 55 43 50 3a | 7b 73 75 6e 2c 76 6f 64 |OM.UUCP:|{sun,vod|
|00000390| 65 72 2c 6e 73 63 2c 64 | 65 63 77 72 6c 7d 21 61 |er,nsc,d|ecwrl}!a|
|000003a0| 70 70 6c 65 21 6c 73 72 | 0d 2d 2d 2d 0d 28 2a 0d |pple!lsr|.---.(*.|
|000003b0| 41 20 73 69 6d 70 6c 65 | 20 75 6e 69 74 20 74 68 |A simple| unit th|
|000003c0| 61 74 20 64 65 6d 6f 6e | 73 74 72 61 74 65 73 20 |at demon|strates |
|000003d0| 68 6f 77 20 74 6f 20 70 | 72 6f 64 75 63 65 20 61 |how to p|roduce a|
|000003e0| 73 79 6e 63 68 72 6f 6e | 6f 75 73 20 73 6f 75 6e |synchron|ous soun|
|000003f0| 64 20 77 69 74 68 0d 74 | 68 65 20 4d 61 63 69 6e |d with.t|he Macin|
|00000400| 74 6f 73 68 20 53 6f 75 | 6e 64 20 4d 61 6e 61 67 |tosh Sou|nd Manag|
|00000410| 65 72 2e 20 20 41 6c 74 | 68 6f 75 67 68 20 49 20 |er. Alt|hough I |
|00000420| 61 6d 20 70 72 65 74 74 | 79 20 63 6f 6e 66 69 64 |am prett|y confid|
|00000430| 65 6e 74 20 61 62 6f 75 | 74 20 74 68 69 73 20 63 |ent abou|t this c|
|00000440| 6f 64 65 2c 0d 49 20 64 | 6f 6e 27 74 20 67 75 61 |ode,.I d|on't gua|
|00000450| 72 61 6e 74 65 65 20 74 | 68 61 74 20 74 68 69 73 |rantee t|hat this|
|00000460| 20 63 6f 64 65 20 64 65 | 6d 6f 6e 73 74 72 61 74 | code de|monstrat|
|00000470| 65 73 20 74 68 65 20 63 | 6f 72 72 65 63 74 20 77 |es the c|orrect w|
|00000480| 61 79 20 74 6f 20 64 6f | 20 74 68 69 6e 67 73 2e |ay to do| things.|
|00000490| 20 20 49 74 0d 64 6f 65 | 73 20 73 65 65 6d 20 74 | It.doe|s seem t|
|000004a0| 6f 20 77 6f 72 6b 20 72 | 65 6c 69 61 62 6c 79 2e |o work r|eliably.|
|000004b0| 0d 54 68 69 73 20 75 6e | 69 74 20 64 6f 65 73 6e |.This un|it doesn|
|000004c0| 27 74 20 73 6f 6c 76 65 | 20 61 6e 79 20 6f 66 20 |'t solve| any of |
|000004d0| 74 68 65 20 74 72 69 63 | 6b 79 20 69 73 73 75 65 |the tric|ky issue|
|000004e0| 73 20 61 62 6f 75 74 20 | 75 73 69 6e 67 20 74 68 |s about |using th|
|000004f0| 65 20 53 6f 75 6e 64 20 | 4d 61 6e 61 67 65 72 2e |e Sound |Manager.|
|00000500| 0d 50 72 69 6d 61 72 69 | 6c 79 2c 20 73 6f 75 6e |.Primari|ly, soun|
|00000510| 64 20 63 68 61 6e 6e 65 | 6c 73 20 73 68 6f 75 6c |d channe|ls shoul|
|00000520| 64 20 62 65 20 64 69 73 | 70 6f 73 65 64 20 6f 66 |d be dis|posed of|
|00000530| 20 61 73 20 73 6f 6f 6e | 20 61 73 20 74 68 65 79 | as soon| as they|
|00000540| 20 61 72 65 20 6e 6f 20 | 6c 6f 6e 67 65 72 0d 6e | are no |longer.n|
|00000550| 65 65 64 65 64 2e 20 20 | 54 68 69 73 20 63 6f 64 |eeded. |This cod|
|00000560| 65 20 64 6f 65 73 20 6a | 75 73 74 20 74 68 61 74 |e does j|ust that|
|00000570| 2c 20 62 75 74 20 69 74 | 20 64 6f 65 73 6e 27 74 |, but it| doesn't|
|00000580| 20 70 72 65 76 65 6e 74 | 20 79 6f 75 72 20 70 72 | prevent| your pr|
|00000590| 6f 67 72 61 6d 20 6f 72 | 20 61 0d 62 61 63 6b 67 |ogram or| a.backg|
|000005a0| 72 6f 75 6e 64 20 70 72 | 6f 67 72 61 6d 20 66 72 |round pr|ogram fr|
|000005b0| 6f 6d 20 74 72 79 69 6e | 67 20 74 6f 20 6d 61 6b |om tryin|g to mak|
|000005c0| 65 20 73 6f 75 6e 64 2e | 0d 43 68 61 6e 67 65 73 |e sound.|.Changes|
|000005d0| 3a 0d 32 2f 31 36 2f 38 | 39 20 20 4c 6f 63 6b 20 |:.2/16/8|9 Lock |
|000005e0| 74 68 65 20 73 6f 75 6e | 64 20 72 65 73 6f 75 72 |the soun|d resour|
|000005f0| 63 65 3b 20 73 74 61 74 | 65 20 72 65 73 74 6f 72 |ce; stat|e restor|
|00000600| 65 64 20 69 6e 20 63 61 | 6c 6c 20 62 61 63 6b 0d |ed in ca|ll back.|
|00000610| 67 53 6f 75 6e 64 50 6c | 61 79 69 6e 67 20 69 73 |gSoundPl|aying is|
|00000620| 20 74 68 65 20 61 63 74 | 75 61 6c 20 68 61 6e 64 | the act|ual hand|
|00000630| 6c 65 2e 0d 4c 61 72 72 | 79 20 52 6f 73 65 6e 73 |le..Larr|y Rosens|
|00000640| 74 65 69 6e 0d 41 70 70 | 6c 65 20 43 6f 6d 70 75 |tein.App|le Compu|
|00000650| 74 65 72 2c 20 49 6e 63 | 2e 0d 6c 73 72 40 41 70 |ter, Inc|..lsr@Ap|
|00000660| 70 6c 65 2e 43 4f 4d 0d | 43 6f 70 79 72 69 67 68 |ple.COM.|Copyrigh|
|00000670| 74 20 31 39 38 38 2d 31 | 39 38 39 20 41 70 70 6c |t 1988-1|989 Appl|
|00000680| 65 20 43 6f 6d 70 75 74 | 65 72 20 49 6e 63 2e 20 |e Comput|er Inc. |
|00000690| 20 41 6c 6c 20 52 69 67 | 68 74 73 20 52 65 73 65 | All Rig|hts Rese|
|000006a0| 72 76 65 64 2e 0d 2a 29 | 0d 55 4e 49 54 20 55 41 |rved..*)|.UNIT UA|
|000006b0| 73 79 6e 63 68 53 6e 64 | 3b 0d 49 4e 54 45 52 46 |synchSnd|;.INTERF|
|000006c0| 41 43 45 0d 55 53 45 53 | 0d 4d 65 6d 54 79 70 65 |ACE.USES|.MemType|
|000006d0| 73 2c 20 51 75 69 63 6b | 64 72 61 77 2c 20 4f 53 |s, Quick|draw, OS|
|000006e0| 49 6e 74 66 2c 20 54 6f | 6f 6c 49 6e 74 66 3b 0d |Intf, To|olIntf;.|
|000006f0| 7b 20 63 61 6c 6c 20 74 | 68 69 73 20 62 65 66 6f |{ call t|his befo|
|00000700| 72 65 20 61 6e 79 20 6f | 74 68 65 72 20 72 6f 75 |re any o|ther rou|
|00000710| 74 69 6e 65 20 7d 0d 50 | 52 4f 43 45 44 55 52 45 |tine }.P|ROCEDURE|
|00000720| 20 49 6e 69 74 55 41 73 | 79 6e 63 68 53 6e 64 3b | InitUAs|ynchSnd;|
|00000730| 0d 7b 20 72 65 74 75 72 | 6e 73 20 54 52 55 45 20 |.{ retur|ns TRUE |
|00000740| 69 66 20 61 6e 20 61 73 | 79 6e 63 68 72 6f 6e 6f |if an as|ynchrono|
|00000750| 75 73 20 73 6f 75 6e 64 | 20 69 73 20 70 6c 61 79 |us sound| is play|
|00000760| 69 6e 67 20 7d 0d 46 55 | 4e 43 54 49 4f 4e 20 20 |ing }.FU|NCTION |
|00000770| 49 73 53 6f 75 6e 64 50 | 6c 61 79 69 6e 67 3a 20 |IsSoundP|laying: |
|00000780| 42 4f 4f 4c 45 41 4e 3b | 0d 7b 20 65 71 75 69 76 |BOOLEAN;|.{ equiv|
|00000790| 61 6c 65 6e 74 20 74 6f | 20 53 6e 64 50 6c 61 79 |alent to| SndPlay|
|000007a0| 2c 20 62 75 74 20 64 6f | 65 73 20 69 74 20 61 73 |, but do|es it as|
|000007b0| 79 6e 63 68 72 6f 6e 6f | 75 73 6c 79 3b 20 69 66 |ynchrono|usly; if|
|000007c0| 20 79 6f 75 20 63 61 6c | 6c 20 74 68 69 73 0d 77 | you cal|l this.w|
|000007d0| 68 69 6c 65 20 61 6e 6f | 74 68 65 72 20 73 6f 75 |hile ano|ther sou|
|000007e0| 6e 64 20 69 73 20 70 6c | 61 79 69 6e 67 2c 20 74 |nd is pl|aying, t|
|000007f0| 68 65 20 66 69 72 73 74 | 20 6f 6e 65 20 77 69 6c |he first| one wil|
|00000800| 6c 20 62 65 20 73 74 6f | 70 70 65 64 20 7d 0d 46 |l be sto|pped }.F|
|00000810| 55 4e 43 54 49 4f 4e 20 | 20 41 53 79 6e 63 68 53 |UNCTION | ASynchS|
|00000820| 6e 64 50 6c 61 79 28 73 | 6e 64 48 61 6e 64 6c 65 |ndPlay(s|ndHandle|
|00000830| 3a 20 48 61 6e 64 6c 65 | 29 3a 20 4f 53 45 72 72 |: Handle|): OSErr|
|00000840| 3b 0d 7b 20 73 74 6f 70 | 20 74 68 65 20 73 6f 75 |;.{ stop| the sou|
|00000850| 6e 64 20 66 72 6f 6d 20 | 70 6c 61 79 69 6e 67 3b |nd from |playing;|
|00000860| 20 6d 61 79 20 62 65 20 | 63 61 6c 6c 65 64 20 65 | may be |called e|
|00000870| 76 65 6e 20 69 66 20 6e | 6f 20 73 6f 75 6e 64 20 |ven if n|o sound |
|00000880| 69 73 0d 63 75 72 72 65 | 6e 74 6c 79 20 70 6c 61 |is.curre|ntly pla|
|00000890| 79 69 6e 67 20 7d 0d 50 | 52 4f 43 45 44 55 52 45 |ying }.P|ROCEDURE|
|000008a0| 20 53 74 6f 70 41 73 79 | 6e 63 68 53 6f 75 6e 64 | StopAsy|nchSound|
|000008b0| 3b 0d 7b 20 73 68 6f 75 | 6c 64 20 62 65 20 63 61 |;.{ shou|ld be ca|
|000008c0| 6c 6c 65 64 20 77 68 65 | 6e 20 79 6f 75 72 20 70 |lled whe|n your p|
|000008d0| 72 6f 67 72 61 6d 20 65 | 78 69 74 73 20 7d 0d 50 |rogram e|xits }.P|
|000008e0| 52 4f 43 45 44 55 52 45 | 20 54 65 72 6d 69 6e 61 |ROCEDURE| Termina|
|000008f0| 74 65 55 41 73 79 6e 63 | 68 53 6e 64 3b 0d 49 4d |teUAsync|hSnd;.IM|
|00000900| 50 4c 45 4d 45 4e 54 41 | 54 49 4f 4e 0d 56 41 52 |PLEMENTA|TION.VAR|
|00000910| 0d 67 53 6f 75 6e 64 50 | 6c 61 79 69 6e 67 3a 09 |.gSoundP|laying:.|
|00000920| 09 48 61 6e 64 6c 65 3b | 0d 67 53 6f 75 6e 64 53 |.Handle;|.gSoundS|
|00000930| 74 61 74 65 3a 09 09 53 | 69 67 6e 65 64 42 79 74 |tate:..S|ignedByt|
|00000940| 65 3b 0d 67 53 6e 64 43 | 68 61 6e 6e 65 6c 3a 09 |e;.gSndC|hannel:.|
|00000950| 09 53 6e 64 43 68 61 6e | 6e 65 6c 50 74 72 3b 0d |.SndChan|nelPtr;.|
|00000960| 50 52 4f 43 45 44 55 52 | 45 20 43 68 61 6e 43 61 |PROCEDUR|E ChanCa|
|00000970| 6c 6c 42 61 63 6b 28 63 | 68 61 6e 3a 20 53 6e 64 |llBack(c|han: Snd|
|00000980| 43 68 61 6e 6e 65 6c 50 | 74 72 3b 20 63 6d 64 3a |ChannelP|tr; cmd:|
|00000990| 20 53 6e 64 43 6f 6d 6d | 61 6e 64 29 3b 20 46 4f | SndComm|and); FO|
|000009a0| 52 57 41 52 44 3b 0d 46 | 55 4e 43 54 49 4f 4e 20 |RWARD;.F|UNCTION |
|000009b0| 20 47 65 74 41 35 3a 20 | 4c 4f 4e 47 49 4e 54 3b | GetA5: |LONGINT;|
|000009c0| 20 49 4e 4c 49 4e 45 20 | 24 32 45 38 44 3b 20 7b | INLINE |$2E8D; {|
|000009d0| 4d 4f 56 45 2e 4c 20 41 | 35 2c 28 41 37 29 7d 0d |MOVE.L A|5,(A7)}.|
|000009e0| 46 55 4e 43 54 49 4f 4e | 20 20 4c 6f 61 64 41 35 |FUNCTION| LoadA5|
|000009f0| 28 6e 65 77 41 35 3a 20 | 4c 4f 4e 47 49 4e 54 29 |(newA5: |LONGINT)|
|00000a00| 3a 20 4c 4f 4e 47 49 4e | 54 3b 0d 20 20 20 20 09 |: LONGIN|T;. .|
|00000a10| 09 09 09 09 49 4e 4c 49 | 4e 45 20 24 32 46 34 44 |....INLI|NE $2F4D|
|00000a20| 2c 24 30 30 30 34 2c 24 | 32 41 35 46 3b 0d 28 2a |,$0004,$|2A5F;.(*|
|00000a30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000a40| 2a 2a 2a 29 0d 50 52 4f | 43 45 44 55 52 45 20 49 |***).PRO|CEDURE I|
|00000a50| 6e 69 74 55 41 73 79 6e | 63 68 53 6e 64 3b 0d 42 |nitUAsyn|chSnd;.B|
|00000a60| 45 47 49 4e 0d 67 53 6e | 64 43 68 61 6e 6e 65 6c |EGIN.gSn|dChannel|
|00000a70| 20 3a 3d 20 4e 49 4c 3b | 0d 67 53 6f 75 6e 64 50 | := NIL;|.gSoundP|
|00000a80| 6c 61 79 69 6e 67 20 3a | 3d 20 4e 49 4c 3b 0d 45 |laying :|= NIL;.E|
|00000a90| 4e 44 3b 0d 46 55 4e 43 | 54 49 4f 4e 20 20 41 53 |ND;.FUNC|TION AS|
|00000aa0| 79 6e 63 68 53 6e 64 50 | 6c 61 79 28 73 6e 64 48 |ynchSndP|lay(sndH|
|00000ab0| 61 6e 64 6c 65 3a 20 48 | 61 6e 64 6c 65 29 3a 20 |andle: H|andle): |
|00000ac0| 4f 53 45 72 72 3b 0d 56 | 41 52 09 65 72 72 3a 09 |OSErr;.V|AR.err:.|
|00000ad0| 09 09 4f 53 45 72 72 3b | 0d 61 43 6f 6d 6d 61 6e |..OSErr;|.aComman|
|00000ae0| 64 3a 09 09 53 6e 64 43 | 6f 6d 6d 61 6e 64 3b 0d |d:..SndC|ommand;.|
|00000af0| 42 45 47 49 4e 0d 53 74 | 6f 70 41 73 79 6e 63 68 |BEGIN.St|opAsynch|
|00000b00| 53 6f 75 6e 64 3b 09 7b | 20 6b 69 6c 6c 20 74 68 |Sound;.{| kill th|
|00000b10| 65 20 63 75 72 72 65 6e | 74 20 73 6f 75 6e 64 20 |e curren|t sound |
|00000b20| 26 20 63 68 61 6e 6e 65 | 6c 20 7d 0d 65 72 72 20 |& channe|l }.err |
|00000b30| 3a 3d 20 6e 6f 45 72 72 | 3b 20 7b 20 64 65 66 61 |:= noErr|; { defa|
|00000b40| 75 6c 74 20 76 61 6c 75 | 65 20 7d 0d 7b 20 67 53 |ult valu|e }.{ gS|
|00000b50| 6e 64 43 68 61 6e 6e 65 | 6c 20 73 68 6f 75 6c 64 |ndChanne|l should|
|00000b60| 20 62 65 20 4e 49 4c 20 | 6e 6f 77 20 7d 0d 65 72 | be NIL |now }.er|
|00000b70| 72 20 3a 3d 20 53 6e 64 | 4e 65 77 43 68 61 6e 6e |r := Snd|NewChann|
|00000b80| 65 6c 28 67 53 6e 64 43 | 68 61 6e 6e 65 6c 2c 20 |el(gSndC|hannel, |
|00000b90| 30 2c 20 30 2c 20 40 43 | 68 61 6e 43 61 6c 6c 42 |0, 0, @C|hanCallB|
|00000ba0| 61 63 6b 29 3b 0d 7b 20 | 57 65 20 64 6f 6e 27 74 |ack);.{ |We don't|
|00000bb0| 20 73 70 65 63 69 66 79 | 20 61 20 73 79 6e 74 68 | specify| a synth|
|00000bc0| 65 73 69 7a 65 72 2c 20 | 73 69 6e 63 65 20 77 65 |esizer, |since we|
|00000bd0| 20 61 72 65 20 61 73 73 | 75 6d 69 6e 67 20 74 68 | are ass|uming th|
|00000be0| 61 74 0d 74 68 65 20 73 | 6e 64 20 72 65 73 6f 75 |at.the s|nd resou|
|00000bf0| 72 63 65 20 73 70 65 63 | 69 66 69 65 73 20 6f 6e |rce spec|ifies on|
|00000c00| 65 2e 20 20 46 6f 72 20 | 65 78 61 6d 70 6c 65 2c |e. For |example,|
|00000c10| 20 74 68 65 0d 73 74 61 | 6e 64 61 72 64 20 43 6c | the.sta|ndard Cl|
|00000c20| 69 6e 6b 2d 4b 6c 61 6e | 6b 20 73 6e 64 20 72 65 |ink-Klan|k snd re|
|00000c30| 73 6f 75 72 63 65 20 64 | 6f 65 73 6e 27 74 20 75 |source d|oesn't u|
|00000c40| 73 65 20 74 68 65 20 0d | 73 61 6d 70 6c 65 64 20 |se the .|sampled |
|00000c50| 73 79 6e 74 68 65 73 69 | 7a 65 72 2e 20 7d 0d 67 |synthesi|zer. }.g|
|00000c60| 53 6f 75 6e 64 53 74 61 | 74 65 20 3a 3d 20 48 47 |SoundSta|te := HG|
|00000c70| 65 74 53 74 61 74 65 28 | 73 6e 64 48 61 6e 64 6c |etState(|sndHandl|
|00000c80| 65 29 3b 0d 4d 6f 76 65 | 48 48 69 28 73 6e 64 48 |e);.Move|HHi(sndH|
|00000c90| 61 6e 64 6c 65 29 3b 0d | 48 4c 6f 63 6b 28 73 6e |andle);.|HLock(sn|
|00000ca0| 64 48 61 6e 64 6c 65 29 | 3b 0d 67 53 6f 75 6e 64 |dHandle)|;.gSound|
|00000cb0| 50 6c 61 79 69 6e 67 20 | 3a 3d 20 73 6e 64 48 61 |Playing |:= sndHa|
|00000cc0| 6e 64 6c 65 3b 0d 49 46 | 20 65 72 72 20 3d 20 6e |ndle;.IF| err = n|
|00000cd0| 6f 45 72 72 20 54 48 45 | 4e 0d 65 72 72 20 3a 3d |oErr THE|N.err :=|
|00000ce0| 20 53 6e 64 50 6c 61 79 | 28 67 53 6e 64 43 68 61 | SndPlay|(gSndCha|
|00000cf0| 6e 6e 65 6c 2c 20 73 6e | 64 48 61 6e 64 6c 65 2c |nnel, sn|dHandle,|
|00000d00| 20 54 52 55 45 29 3b 0d | 57 49 54 48 20 61 43 6f | TRUE);.|WITH aCo|
|00000d10| 6d 6d 61 6e 64 20 44 4f | 20 42 45 47 49 4e 0d 63 |mmand DO| BEGIN.c|
|00000d20| 6d 64 20 3a 3d 20 63 61 | 6c 6c 42 61 63 6b 43 6d |md := ca|llBackCm|
|00000d30| 64 3b 0d 70 61 72 61 6d | 31 20 3a 3d 20 30 3b 0d |d;.param|1 := 0;.|
|00000d40| 70 61 72 61 6d 32 20 3a | 3d 20 47 65 74 41 35 3b |param2 :|= GetA5;|
|00000d50| 0d 45 4e 44 3b 0d 49 46 | 20 65 72 72 20 3d 20 6e |.END;.IF| err = n|
|00000d60| 6f 45 72 72 20 54 48 45 | 4e 0d 65 72 72 20 3a 3d |oErr THE|N.err :=|
|00000d70| 20 53 6e 64 44 6f 43 6f | 6d 6d 61 6e 64 28 67 53 | SndDoCo|mmand(gS|
|00000d80| 6e 64 43 68 61 6e 6e 65 | 6c 2c 20 61 43 6f 6d 6d |ndChanne|l, aComm|
|00000d90| 61 6e 64 2c 20 46 41 4c | 53 45 29 3b 0d 49 46 20 |and, FAL|SE);.IF |
|00000da0| 65 72 72 20 3c 3e 20 6e | 6f 45 72 72 20 54 48 45 |err <> n|oErr THE|
|00000db0| 4e 0d 53 74 6f 70 41 73 | 79 6e 63 68 53 6f 75 6e |N.StopAs|ynchSoun|
|00000dc0| 64 3b 09 09 7b 20 66 6c | 75 73 68 20 63 68 61 6e |d;..{ fl|ush chan|
|00000dd0| 6e 65 6c 3b 20 75 6e 6c | 6f 63 6b 20 73 6f 75 6e |nel; unl|ock soun|
|00000de0| 64 20 7d 0d 41 73 79 6e | 63 68 53 6e 64 50 6c 61 |d }.Asyn|chSndPla|
|00000df0| 79 20 3a 3d 20 65 72 72 | 3b 0d 45 4e 44 3b 0d 50 |y := err|;.END;.P|
|00000e00| 52 4f 43 45 44 55 52 45 | 20 43 68 61 6e 43 61 6c |ROCEDURE| ChanCal|
|00000e10| 6c 42 61 63 6b 28 63 68 | 61 6e 3a 20 53 6e 64 43 |lBack(ch|an: SndC|
|00000e20| 68 61 6e 6e 65 6c 50 74 | 72 3b 20 63 6d 64 3a 20 |hannelPt|r; cmd: |
|00000e30| 53 6e 64 43 6f 6d 6d 61 | 6e 64 29 3b 0d 56 41 52 |SndComma|nd);.VAR|
|00000e40| 09 6f 6c 64 41 35 3a 09 | 4c 4f 4e 47 49 4e 54 3b |.oldA5:.|LONGINT;|
|00000e50| 0d 42 45 47 49 4e 0d 6f | 6c 64 41 35 20 3a 3d 20 |.BEGIN.o|ldA5 := |
|00000e60| 4c 6f 61 64 41 35 28 63 | 6d 64 2e 70 61 72 61 6d |LoadA5(c|md.param|
|00000e70| 32 29 3b 09 7b 20 67 65 | 74 20 74 68 65 20 61 70 |2);.{ ge|t the ap|
|00000e80| 70 6c 69 63 61 74 69 6f | 6e 27 73 20 41 35 20 61 |plicatio|n's A5 a|
|00000e90| 6e 64 20 73 65 74 20 69 | 74 20 7d 0d 48 53 65 74 |nd set i|t }.HSet|
|00000ea0| 53 74 61 74 65 28 67 53 | 6f 75 6e 64 50 6c 61 79 |State(gS|oundPlay|
|00000eb0| 69 6e 67 2c 20 67 53 6f | 75 6e 64 53 74 61 74 65 |ing, gSo|undState|
|00000ec0| 29 3b 0d 67 53 6f 75 6e | 64 50 6c 61 79 69 6e 67 |);.gSoun|dPlaying|
|00000ed0| 20 3a 3d 20 4e 49 4c 3b | 0d 6f 6c 64 41 35 20 3a | := NIL;|.oldA5 :|
|00000ee0| 3d 20 4c 6f 61 64 41 35 | 28 6f 6c 64 41 35 29 3b |= LoadA5|(oldA5);|
|00000ef0| 09 09 09 7b 20 72 65 73 | 74 6f 72 65 20 6f 6c 64 |...{ res|tore old|
|00000f00| 20 41 35 20 7d 0d 45 4e | 44 3b 0d 46 55 4e 43 54 | A5 }.EN|D;.FUNCT|
|00000f10| 49 4f 4e 20 20 49 73 53 | 6f 75 6e 64 50 6c 61 79 |ION IsS|oundPlay|
|00000f20| 69 6e 67 3a 20 42 4f 4f | 4c 45 41 4e 3b 0d 42 45 |ing: BOO|LEAN;.BE|
|00000f30| 47 49 4e 0d 49 73 53 6f | 75 6e 64 50 6c 61 79 69 |GIN.IsSo|undPlayi|
|00000f40| 6e 67 20 3a 3d 20 67 53 | 6f 75 6e 64 50 6c 61 79 |ng := gS|oundPlay|
|00000f50| 69 6e 67 20 3c 3e 20 4e | 49 4c 3b 0d 45 4e 44 3b |ing <> N|IL;.END;|
|00000f60| 0d 50 52 4f 43 45 44 55 | 52 45 20 53 74 6f 70 41 |.PROCEDU|RE StopA|
|00000f70| 73 79 6e 63 68 53 6f 75 | 6e 64 3b 0d 42 45 47 49 |synchSou|nd;.BEGI|
|00000f80| 4e 0d 49 46 20 67 53 6e | 64 43 68 61 6e 6e 65 6c |N.IF gSn|dChannel|
|00000f90| 20 3c 3e 20 4e 49 4c 20 | 54 48 45 4e 20 42 45 47 | <> NIL |THEN BEG|
|00000fa0| 49 4e 0d 49 46 20 53 6e | 64 44 69 73 70 6f 73 65 |IN.IF Sn|dDispose|
|00000fb0| 43 68 61 6e 6e 65 6c 28 | 67 53 6e 64 43 68 61 6e |Channel(|gSndChan|
|00000fc0| 6e 65 6c 2c 20 54 52 55 | 45 29 20 3d 20 6e 6f 45 |nel, TRU|E) = noE|
|00000fd0| 72 72 20 54 48 45 4e 20 | 7b 20 6e 6f 74 68 69 6e |rr THEN |{ nothin|
|00000fe0| 67 20 7d 3b 0d 67 53 6e | 64 43 68 61 6e 6e 65 6c |g };.gSn|dChannel|
|00000ff0| 20 3a 3d 20 4e 49 4c 3b | 0d 45 4e 44 3b 0d 49 46 | := NIL;|.END;.IF|
|00001000| 20 67 53 6f 75 6e 64 50 | 6c 61 79 69 6e 67 20 3c | gSoundP|laying <|
|00001010| 3e 20 4e 49 4c 20 54 48 | 45 4e 0d 42 45 47 49 4e |> NIL TH|EN.BEGIN|
|00001020| 0d 48 53 65 74 53 74 61 | 74 65 28 67 53 6f 75 6e |.HSetSta|te(gSoun|
|00001030| 64 50 6c 61 79 69 6e 67 | 2c 20 67 53 6f 75 6e 64 |dPlaying|, gSound|
|00001040| 53 74 61 74 65 29 3b 0d | 67 53 6f 75 6e 64 50 6c |State);.|gSoundPl|
|00001050| 61 79 69 6e 67 20 3a 3d | 20 4e 49 4c 3b 0d 45 4e |aying :=| NIL;.EN|
|00001060| 44 3b 0d 45 4e 44 3b 0d | 50 52 4f 43 45 44 55 52 |D;.END;.|PROCEDUR|
|00001070| 45 20 54 65 72 6d 69 6e | 61 74 65 55 41 73 79 6e |E Termin|ateUAsyn|
|00001080| 63 68 53 6e 64 3b 0d 42 | 45 47 49 4e 0d 53 74 6f |chSnd;.B|EGIN.Sto|
|00001090| 70 41 73 79 6e 63 68 53 | 6f 75 6e 64 3b 0d 45 4e |pAsynchS|ound;.EN|
|000010a0| 44 3b 0d 45 4e 44 2e 0d | 2d 2d 2d 0d 2e 95 54 6a |D;.END..|---...Tj|
|000010b0| 80 2c 74 05 f4 38 d2 e2 | e0 b4 c0 bd 1e 75 9f d9 |.,t..8..|.....u..|
|000010c0| da 05 c7 96 ac cb 25 2f | 11 e4 00 58 8e 08 d8 73 |......%/|...X...s|
|000010d0| b2 ac ee 2d dd 59 5d 67 | ce 53 51 f5 fc 2a 88 1d |...-.Y]g|.SQ..*..|
|000010e0| 5c db 09 a3 ae 99 52 85 | a2 6a a9 2a df 1b e0 57 |\.....R.|.j.*...W|
|000010f0| bf fc 7d d5 7f 3b 14 60 | 65 76 d4 8c 01 a4 64 4d |..}..;.`|ev....dM|
+--------+-------------------------+-------------------------+--------+--------+