home *** CD-ROM | disk | FTP | other *** search
- /********************************************************************************
- * noise.c
- *
- * Noise Playing Package
- *
- * Written by Paco Xander Nathan
- * ⌐1990, Motorola Inc. Public domain source code.
- ********************************************************************************/
-
- #include "applic.h"
- #include "noise.h"
- #include <SoundMgr.h>
- #include <OSUtil.h>
-
-
- /* External Data Structures
- */
- Boolean
- noiseDone = FALSE;
-
-
- /* Local Data Structures
- */
- static Boolean
- noiseStarted = FALSE;
-
- static SndChannelPtr
- noiseChan;
-
-
- /* Play the specified piece of noise
- */
- void
- NoisePlay (theNoise)
- register short theNoise;
- {
- register Handle noiseHdl;
-
- if (laMachine.hasSound) {
- if (noiseHdl = GetResource('snd ', theNoise)) {
- if (!noiseStarted)
- SndPlay(NULL, noiseHdl, TRUE);
-
- ReleaseResource((Handle) noiseHdl);
- }
- }
- else
- SysBeep(5);
- }
-