home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!gatech!destroyer!terminator!potts
- From: potts@itl.itd.umich.edu (Paul Potts)
- Subject: Re: Sound Loop in a with a Modal Dialog?
- Message-ID: <1992Sep11.123605.23454@terminator.cc.umich.edu>
- Sender: news@terminator.cc.umich.edu (Usenet Owner)
- Organization: Instructional Technology Laboratory, University of Michigan
- References: <1992Sep3.145524.8874@utkux1.utk.edu> <REEKES-080992142744@90.10.20.67> <1992Sep10.172752.19114@cs.uoregon.edu>
- Date: Fri, 11 Sep 1992 12:36:05 GMT
- Lines: 42
-
-
- I tried mailing this, but didn't get a response, so I'm not sure if it
- made it. Apologies to those who are tired of this thread...
-
- Danny -
- Haven't looked at it in great detail, but I noticed one thing in
- your code right off that looks wrong.
-
- You are using a call to the function SoundisStopped to determine
- if you should play the sound again - however, SoundisStopped
- appears to return the mySCStatus.scChannelBusy. This will be
- TRUE if sound is currently playing. It looks to me like your
- logic would thus be reversed - you attempt to play the sound
- again only if it is currently playing.
-
- I could be off base here - let me know if this appears to help.
- The other problem I still notice is that you call PlayTheSound,
- and then ModalDialog. ModalDialog *waits* until you do something
- that activates one of the buttons (click on it or press return).
- So ModalDialog will be called in this loop based on
- dialogtrue, until item 1 is hit, but the sound will be started
- once each time before calling ModalDialog. Since ModalDialog
- waits for a button to be activated, it will allow the sound to
- time out and finish playing. The sound will be played again
- if you hit a button that isn't number 1 (doesn't conclude the
- loop based on dialogtrue). Otherwise it will be played once,
- ModalDialog will wait for a button to be pressed, and then
- you're done. This problem combined with the reversed logic
- I mentioned above might give the symptoms you are seeing.
-
- Hope this helps some (also hope it is correct advice...
- I have learned the hard way to give no guarantees...)
- If these turn out to be the problems, you could post
- a followup to the newsgroup too.
- -Paul-
-
-
- --
- "...remove protective cap. Hold atomizer with thumb at base and nozzle
- between first and second fingers. Without tilting head, insert nozzle into
- nostril. Fully depress rim with a firm, even stroke and sniff deeply."
- -advice for presidential candidates from Paul Potts - potts@itl.itd.umich.edu
-