home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14558 < prev    next >
Encoding:
Text File  |  1992-08-26  |  1.5 KB  |  55 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!gatech!utkcs2!utkux1.utk.edu!danny@utkux1.utk.edu
  3. From: danny@utkux1.utk.edu (Danny W. McCampbell)
  4. Subject: Still trying to get this stupid sound stuff to work...
  5. Message-ID: <1992Aug26.192610.14018@utkux1.utk.edu>
  6. Sender: usenet@utkux1.utk.edu (USENET News System)
  7. Organization: University of Tennessee
  8. Date: Wed, 26 Aug 1992 19:26:10 GMT
  9. Lines: 44
  10.  
  11. Will someone tell me what I can do to this code to cause the sound
  12. to play transparently.  What I mean is after the sound starts playing
  13. a modal dialog is brought up.  I want the user to be able to click
  14. in the dialog and when he/she does the sound stops and the dialog
  15. disappears.  What is happening now is the sound sound starts playing,
  16. the dialog comes up, but you cannot do anything until the sound 
  17. finishes.  Check it out:
  18.  
  19. unit Sounds;
  20.  
  21. interface
  22.  uses
  23.   Sound;
  24.  procedure PlaySound;
  25.  
  26. implementation
  27.  procedure PlaySound;
  28.   const
  29.    kAsync = true;
  30.    soundID = 128;
  31.   var
  32.    err: OSErr;
  33.    mySndHandle: Handle;
  34.    mySndChan: SndChannelPtr;
  35.  
  36.  begin
  37.   mySndChan := nil;
  38.   mySndHandle := GetResource('snd ', soundID);
  39.   if mySndHandle <> nil then
  40.    begin
  41.     err := SndPlay(mySndChan, mySndHandle, kAsync);
  42.     if err <> noErr then
  43.      ExitToShell;
  44.    end;
  45.  end;
  46. end.
  47.  
  48. I call sound play when the user chooses the about item from my program
  49. from the AppleMenu.  Then I bring up a modal dialog.  What can I
  50. do to get what I mentioned above to happen.  Thanks in advance.
  51.  
  52. Danny McCampbell
  53.  
  54.  
  55.