home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / SpriteFight 2002 v2.0a1 / SoundUtils.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-21  |  1023 b   |  68 lines  |  [TEXT/KAHL]

  1. /*
  2. //    SoundUtils.c
  3. //
  4. //    Created: 7/20/92 at 6:50:42 PM
  5. //    By:    Tony Myles
  6. //
  7. //    Copyright: © 1992-94 Tony Myles, All rights reserved worldwide.
  8. */
  9.  
  10.  
  11. #ifndef __SOUNDUTILS__
  12. #include "SoundUtils.h"
  13. #endif
  14.  
  15.  
  16. Boolean SndChannelBusy(
  17.     SndChannelPtr sndChannelP)
  18. {
  19.     OSErr err;
  20.     Boolean sndChannelBusy = true;
  21.     SCStatus sndChannelStatus;
  22.  
  23.     err = SndChannelStatus(sndChannelP, sizeof(SCStatus), &sndChannelStatus);
  24.  
  25.     if (err == noErr)
  26.     {
  27.         sndChannelBusy = sndChannelStatus.scChannelBusy;
  28.     }
  29.  
  30.     return sndChannelBusy;
  31. }
  32.  
  33.  
  34. OSErr InstallSoundCallBack(
  35.     SndChannelPtr sndChannelP)
  36. {
  37.     SndCommand sndCmd;
  38.  
  39.     sndCmd.cmd = callBackCmd;
  40.     sndCmd.param1 = kSoundComplete;
  41.     sndCmd.param2 = SetCurrentA5();
  42.  
  43.     return SndDoCommand(sndChannelP, &sndCmd, kWaitIfFull);
  44. }
  45.  
  46.  
  47. Handle GetSoundResource(
  48.     short soundResourceID,
  49.     OSErr* err)
  50. {
  51.     Handle soundResourceH = GetResource(soundListRsrc, soundResourceID);
  52.  
  53.     if (soundResourceH == NULL)
  54.     {
  55.         *err = ResError();
  56.         
  57.         if (*err == noErr)
  58.         {
  59.             *err = resNotFound;
  60.         }
  61.     }
  62.  
  63.     return soundResourceH;
  64. }
  65.  
  66.  
  67.  
  68.