GameHeaders/GameSounds.h

#pragma once
#include <Sound.h>
 
#define kNumChan 4
enum {
    kWakeUpSnd  = 128,
    kFireSnd    = 129,
    kRiffSnd    = 130,
    kBadFireSnd = 131,
    kExplode    = 132,
    kYouLose   = 133,
    kYouWin     = 134,
    kIncidental1 = 135,
    kEngineStart = 136,
    kIncidental2 = 137,
    kEngineLoop  = 138,
    kIncidental3 = 139,
    kIncidental4 = 140,
    kIncidental5 = 141
};
 
enum {
    kStdPriority = 0x01,
    kMedPriority = 0x05,
    kHighPriority = 0x0A
};
 
enum {
    kMusicChan,
    kShotChan,
    kExplosionChan,
    kFlightChan
};
 
typedef struct {
    SndChannelPtr   channel;
    short           priority;
    Handle          sndHandle;
} SndChanInfo;
 
 
/* call this when your program starts */
void InitSounds(Str255  sndFileName);
 
/* call this from your main loop */
void SoundKeeper();
 
/* use this to play sounds */
OSErr PlaySndAsynchChannel(short sndID, short chanNum, short priority);
 
/* call this when your program quits */
void FreeSounds(void);
 
/* misc routines used internally */
pascal void SndDoneProc(SndChannelPtr channel, SndCommand *cmd);
Handle  GetSound(short  sndID);
 
/* private global variables */
extern SndChanInfo  gChan[kNumChan];