Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!Greg@AppleLink.Apple.Com From: Greg@AppleLink.Apple.Com (Greg Marriott) Newsgroups: comp.sys.mac.programmer Subject: Re: Gestalt Bug? Message-ID: <11839@goofy.Apple.COM> Date: 24 Jan 91 12:07:16 GMT References: <1991Jan21.221130.2061@athena.mit.edu> <1991Jan23.170829.2793@waikato.ac.nz> Sender: usenet@Apple.COM Distribution: usa Organization: Apple Computer, Inc. Lines: 60 In article <1991Jan23.170829.2793@waikato.ac.nz>, ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) wonders about the "sound input hardware present" bit: Okay, I talked to a sound engineer, and here's what he told me: NOBODY is suppose to change any of the SoundMgr Gestalt selectors! If a developer wants to determine if a Sound Input driver is available, then call the SPBGetIndexedDevice call (as shown below). The Gestalt selectors for sound will only report if the machine has "built-in sound input hardware". In System 7, we've added a new bit in the sound selector and changed a previous one to a name that is more descriptive. The new selector, gestaltHasSoundInputDevice, will call SPBGetIndexedDevice for you, but this only happens in System 7. If you are running under System 6.0.7, then you have to call SPBGetIndexedDevice directly. Also, if you are running under older Systems then you'll have to test if _SoundDispatch is implemented before calling SPBGetIndexedDevice. Here's some code that developers should be using. This issue is documented in the new Sound Manager chapter of Inside Mac 6. {is the new Sound Manager running?} IF NGetTrapAddress(_Unimplemented, ToolTrap) <> NGetTrapAddress(_SoundDispatch, ToolTrap) THEN gNewSndMgr:= SndSoundManagerVersion > 0 ELSE gNewSndMgr:= FALSE; {is the Sound Input Manager available?} gHasSndInput:= FALSE; IF gNewSndMgr THEN BEGIN IF SPBVersion > 0 THEN BEGIN IF SPBGetIndexedDevice(1, devName, devIconHandle) = noErr THEN BEGIN DisposHandle(devIconHandle); gHasSndInput:= TRUE; END; END; END; Here are the latest versions of the Gestalt bit for sound. "gestaltHasSoundInputDevice" only will be valid for System 7. gestaltSoundAttr = 'snd '; { sound attributes } gestaltStereoCapability = 0; { sound hardware has stereo capability } gestaltStereoMixing = 1; { stereo mixing on external speaker } gestaltSoundIOMgrPresent = 3; { The Sound I/O Manager is present } gestaltBuiltInSoundInput = 4; { built-in Sound Input hardware is present } gestaltHasSoundInputDevice = 5; { Sound Input device available } Jim Reekes E.O., Macintosh Toolbox Engineering --------------------- So, there you have it. Greg Marriott Blue Meanie Apple Computer, Inc.