home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!biosci!parc!news!jellinek
- From: jellinek@rutabaga.adoc.xerox.com (Herb Jellinek)
- Newsgroups: comp.sys.mac.programmer
- Subject: Async sound input: interruptRoutine
- Message-ID: <JELLINEK.92Dec29111534@rutabaga.adoc.xerox.com>
- Date: 29 Dec 92 19:15:34 GMT
- Sender: news@parc.xerox.com
- Distribution: comp
- Organization: Xerox PARC, Palo Alto, CA
- Lines: 41
-
- I'm writing an application that does asynchronous sound input, and I
- want to use the optional interruptRoutine feature of input sound
- parameter blocks. I'm using Think C 5.0.4.
-
- I've looked at the description of the interruptRoutine feature in
- Inside Mac VI, and I think I'm doing things right, but my machine
- hangs in the interrupt routine whenever it does anything other than
- save and restore A5. From looking at things with MacsBug, I see that
- the value in A0 is wrong, accounting for the bad things that follow.
- I've been looking for code examples, to no avail: the otherwise
- excellent Async Sound Helper doesn't use this feature.
-
- Here's the current version of the interrupt routine:
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- Boolean interrupted = false;
-
- #pragma parameter recordingInterrupt(__a0,__a1,__d0,__d1)
- void recordingInterrupt(SPBPtr spb, Ptr samples, long peak,
- Size byteCount) {
- long oldA5 = SetA5(spb->userLong);
-
- // interrupted = true;
-
- SetA5(oldA5);
- }
-
- ...
-
- // (Fragmentary) code in init routine:
- mySPB.userLong = SetCurrentA5();
- mySPB.interruptRoutine = recordingInterrupt;
-
- // Execute:
- myErr = SPBRecord(&mySPB, true);
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- Thanks for any and all help you can provide.
-
- Herb
-