home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15342 < prev    next >
Encoding:
Text File  |  1992-09-11  |  2.5 KB  |  54 lines

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