Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3240 lines
119 KiB

  1. /*
  2. File: Sound.h
  3. Contains: Sound Manager Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1986-2001 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __SOUND__
  11. #define __SOUND__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __COMPONENTS__
  16. #include <Components.h>
  17. #endif
  18. #ifndef __MIXEDMODE__
  19. #include <MixedMode.h>
  20. #endif
  21. #ifndef __DIALOGS__
  22. #include <Dialogs.h>
  23. #endif
  24. #if PRAGMA_ONCE
  25. #pragma once
  26. #endif
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. #if PRAGMA_IMPORT
  31. #pragma import on
  32. #endif
  33. #if PRAGMA_STRUCT_ALIGN
  34. #pragma options align=mac68k
  35. #elif PRAGMA_STRUCT_PACKPUSH
  36. #pragma pack(push, 2)
  37. #elif PRAGMA_STRUCT_PACK
  38. #pragma pack(2)
  39. #endif
  40. /*
  41. * * * N O T E * * *
  42. This file has been updated to include Sound Manager 3.3 interfaces.
  43. Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  44. that originally shipped with the PowerMacs. These missing functions and the
  45. new 3.3 interfaces have been released in the SoundLib library for PowerPC
  46. developers to link with. The runtime library for these functions are
  47. installed by the Sound Manager. The following functions are found in SoundLib.
  48. GetCompressionInfo(), GetSoundPreference(), SetSoundPreference(),
  49. UnsignedFixedMulDiv(), SndGetInfo(), SndSetInfo(), GetSoundOutputInfo(),
  50. SetSoundOutputInfo(), GetCompressionName(), SoundConverterOpen(),
  51. SoundConverterClose(), SoundConverterGetBufferSizes(), SoundConverterBeginConversion(),
  52. SoundConverterConvertBuffer(), SoundConverterEndConversion(),
  53. AudioGetBass(), AudioGetInfo(), AudioGetMute(), AudioGetOutputDevice(),
  54. AudioGetTreble(), AudioGetVolume(), AudioMuteOnEvent(), AudioSetBass(),
  55. AudioSetMute(), AudioSetToDefaults(), AudioSetTreble(), AudioSetVolume(),
  56. OpenMixerSoundComponent(), CloseMixerSoundComponent(), SoundComponentAddSource(),
  57. SoundComponentGetInfo(), SoundComponentGetSource(), SoundComponentGetSourceData(),
  58. SoundComponentInitOutputDevice(), SoundComponentPauseSource(),
  59. SoundComponentPlaySourceBuffer(), SoundComponentRemoveSource(),
  60. SoundComponentSetInfo(), SoundComponentSetOutput(), SoundComponentSetSource(),
  61. SoundComponentStartSource(), SoundComponentStopSource(),
  62. ParseAIFFHeader(), ParseSndHeader(), SoundConverterGetInfo(), SoundConverterSetInfo()
  63. */
  64. /*
  65. Interfaces for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!
  66. These items are no longer defined, but appear here so that someone
  67. searching the interfaces might find them. If you are using one of these
  68. items, you must change your code to support the Sound Manager.
  69. swMode, ftMode, ffMode
  70. FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
  71. SndCompletionProcPtr
  72. StartSound, StopSound, SoundDone
  73. SetSoundVol, GetSoundVol
  74. */
  75. /*
  76. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  77. constants
  78. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  79. */
  80. #define twelfthRootTwo 1.05946309435
  81. enum {
  82. soundListRsrc = FOUR_CHAR_CODE('snd '), /*Resource type used by Sound Manager*/
  83. kSoundCodecInfoResourceType = FOUR_CHAR_CODE('snfo') /*Resource type holding codec information (optional public component resource)*/
  84. };
  85. enum {
  86. kSimpleBeepID = 1 /*reserved resource ID for Simple Beep*/
  87. };
  88. enum {
  89. rate48khz = (long)0xBB800000, /*48000.00000 in fixed-point*/
  90. rate44khz = (long)0xAC440000, /*44100.00000 in fixed-point*/
  91. rate32khz = 0x7D000000, /*32000.00000 in fixed-point*/
  92. rate22050hz = 0x56220000, /*22050.00000 in fixed-point*/
  93. rate22khz = 0x56EE8BA3, /*22254.54545 in fixed-point*/
  94. rate16khz = 0x3E800000, /*16000.00000 in fixed-point*/
  95. rate11khz = 0x2B7745D1, /*11127.27273 in fixed-point*/
  96. rate11025hz = 0x2B110000, /*11025.00000 in fixed-point*/
  97. rate8khz = 0x1F400000 /* 8000.00000 in fixed-point*/
  98. };
  99. /*synthesizer numbers for SndNewChannel*/
  100. enum {
  101. sampledSynth = 5 /*sampled sound synthesizer*/
  102. };
  103. #if CALL_NOT_IN_CARBON
  104. enum {
  105. squareWaveSynth = 1, /*square wave synthesizer*/
  106. waveTableSynth = 3, /*wave table synthesizer*/
  107. /*old Sound Manager MACE synthesizer numbers*/
  108. MACE3snthID = 11,
  109. MACE6snthID = 13
  110. };
  111. #endif /* CALL_NOT_IN_CARBON */
  112. enum {
  113. kMiddleC = 60 /*MIDI note value for middle C*/
  114. };
  115. enum {
  116. kNoVolume = 0, /*setting for no sound volume*/
  117. kFullVolume = 0x0100 /*1.0, setting for full hardware output volume*/
  118. };
  119. enum {
  120. stdQLength = 128
  121. };
  122. enum {
  123. dataOffsetFlag = 0x8000
  124. };
  125. enum {
  126. kUseOptionalOutputDevice = -1 /*only for Sound Manager 3.0 or later*/
  127. };
  128. enum {
  129. notCompressed = 0, /*compression ID's*/
  130. fixedCompression = -1, /*compression ID for fixed-sized compression*/
  131. variableCompression = -2 /*compression ID for variable-sized compression*/
  132. };
  133. enum {
  134. twoToOne = 1,
  135. eightToThree = 2,
  136. threeToOne = 3,
  137. sixToOne = 4,
  138. sixToOnePacketSize = 8,
  139. threeToOnePacketSize = 16
  140. };
  141. enum {
  142. stateBlockSize = 64,
  143. leftOverBlockSize = 32
  144. };
  145. enum {
  146. firstSoundFormat = 0x0001, /*general sound format*/
  147. secondSoundFormat = 0x0002 /*special sampled sound format (HyperCard)*/
  148. };
  149. #if CALL_NOT_IN_CARBON
  150. enum {
  151. dbBufferReady = 0x00000001, /*double buffer is filled*/
  152. dbLastBuffer = 0x00000004 /*last double buffer to play*/
  153. };
  154. #endif /* CALL_NOT_IN_CARBON */
  155. enum {
  156. sysBeepDisable = 0x0000, /*SysBeep() enable flags*/
  157. sysBeepEnable = (1 << 0),
  158. sysBeepSynchronous = (1 << 1) /*if bit set, make alert sounds synchronous*/
  159. };
  160. enum {
  161. unitTypeNoSelection = 0xFFFF, /*unitTypes for AudioSelection.unitType*/
  162. unitTypeSeconds = 0x0000
  163. };
  164. enum {
  165. stdSH = 0x00, /*Standard sound header encode value*/
  166. extSH = 0xFF, /*Extended sound header encode value*/
  167. cmpSH = 0xFE /*Compressed sound header encode value*/
  168. };
  169. /*command numbers for SndDoCommand and SndDoImmediate*/
  170. enum {
  171. nullCmd = 0,
  172. quietCmd = 3,
  173. flushCmd = 4,
  174. reInitCmd = 5,
  175. waitCmd = 10,
  176. pauseCmd = 11,
  177. resumeCmd = 12,
  178. callBackCmd = 13,
  179. syncCmd = 14,
  180. availableCmd = 24,
  181. versionCmd = 25,
  182. volumeCmd = 46, /*sound manager 3.0 or later only*/
  183. getVolumeCmd = 47, /*sound manager 3.0 or later only*/
  184. clockComponentCmd = 50, /*sound manager 3.2.1 or later only*/
  185. getClockComponentCmd = 51, /*sound manager 3.2.1 or later only*/
  186. scheduledSoundCmd = 52, /*sound manager 3.3 or later only*/
  187. linkSoundComponentsCmd = 53, /*sound manager 3.3 or later only*/
  188. soundCmd = 80,
  189. bufferCmd = 81,
  190. rateMultiplierCmd = 86,
  191. getRateMultiplierCmd = 87
  192. };
  193. #if CALL_NOT_IN_CARBON
  194. /*command numbers for SndDoCommand and SndDoImmediate that are not available for use in Carbon */
  195. enum {
  196. initCmd = 1,
  197. freeCmd = 2,
  198. totalLoadCmd = 26,
  199. loadCmd = 27,
  200. freqDurationCmd = 40,
  201. restCmd = 41,
  202. freqCmd = 42,
  203. ampCmd = 43,
  204. timbreCmd = 44,
  205. getAmpCmd = 45,
  206. waveTableCmd = 60,
  207. phaseCmd = 61,
  208. rateCmd = 82,
  209. continueCmd = 83,
  210. doubleBufferCmd = 84,
  211. getRateCmd = 85,
  212. sizeCmd = 90, /*obsolete command*/
  213. convertCmd = 91 /*obsolete MACE command*/
  214. };
  215. #endif /* CALL_NOT_IN_CARBON */
  216. #if OLDROUTINENAMES
  217. /*channel initialization parameters*/
  218. enum {
  219. waveInitChannelMask = 0x07,
  220. waveInitChannel0 = 0x04, /*wave table only, Sound Manager 2.0 and earlier*/
  221. waveInitChannel1 = 0x05, /*wave table only, Sound Manager 2.0 and earlier*/
  222. waveInitChannel2 = 0x06, /*wave table only, Sound Manager 2.0 and earlier*/
  223. waveInitChannel3 = 0x07, /*wave table only, Sound Manager 2.0 and earlier*/
  224. initChan0 = waveInitChannel0, /*obsolete spelling*/
  225. initChan1 = waveInitChannel1, /*obsolete spelling*/
  226. initChan2 = waveInitChannel2, /*obsolete spelling*/
  227. initChan3 = waveInitChannel3 /*obsolete spelling*/
  228. };
  229. enum {
  230. outsideCmpSH = 0, /*obsolete MACE constant*/
  231. insideCmpSH = 1, /*obsolete MACE constant*/
  232. aceSuccess = 0, /*obsolete MACE constant*/
  233. aceMemFull = 1, /*obsolete MACE constant*/
  234. aceNilBlock = 2, /*obsolete MACE constant*/
  235. aceBadComp = 3, /*obsolete MACE constant*/
  236. aceBadEncode = 4, /*obsolete MACE constant*/
  237. aceBadDest = 5, /*obsolete MACE constant*/
  238. aceBadCmd = 6 /*obsolete MACE constant*/
  239. };
  240. #endif /* OLDROUTINENAMES */
  241. enum {
  242. initChanLeft = 0x0002, /*left stereo channel*/
  243. initChanRight = 0x0003, /*right stereo channel*/
  244. initNoInterp = 0x0004, /*no linear interpolation*/
  245. initNoDrop = 0x0008, /*no drop-sample conversion*/
  246. initMono = 0x0080, /*monophonic channel*/
  247. initStereo = 0x00C0, /*stereo channel*/
  248. initMACE3 = 0x0300, /*MACE 3:1*/
  249. initMACE6 = 0x0400, /*MACE 6:1*/
  250. initPanMask = 0x0003, /*mask for right/left pan values*/
  251. initSRateMask = 0x0030, /*mask for sample rate values*/
  252. initStereoMask = 0x00C0, /*mask for mono/stereo values*/
  253. initCompMask = 0xFF00 /*mask for compression IDs*/
  254. };
  255. /*Get&Set Sound Information Selectors*/
  256. enum {
  257. siActiveChannels = FOUR_CHAR_CODE('chac'), /*active channels*/
  258. siActiveLevels = FOUR_CHAR_CODE('lmac'), /*active meter levels*/
  259. siAGCOnOff = FOUR_CHAR_CODE('agc '), /*automatic gain control state*/
  260. siAsync = FOUR_CHAR_CODE('asyn'), /*asynchronous capability*/
  261. siAVDisplayBehavior = FOUR_CHAR_CODE('avdb'),
  262. siChannelAvailable = FOUR_CHAR_CODE('chav'), /*number of channels available*/
  263. siCompressionAvailable = FOUR_CHAR_CODE('cmav'), /*compression types available*/
  264. siCompressionFactor = FOUR_CHAR_CODE('cmfa'), /*current compression factor*/
  265. siCompressionHeader = FOUR_CHAR_CODE('cmhd'), /*return compression header*/
  266. siCompressionNames = FOUR_CHAR_CODE('cnam'), /*compression type names available*/
  267. siCompressionParams = FOUR_CHAR_CODE('evaw'), /*compression parameters*/
  268. siCompressionSampleRate = FOUR_CHAR_CODE('cprt'), /* SetInfo only: compressor's sample rate*/
  269. siCompressionChannels = FOUR_CHAR_CODE('cpct'), /* SetInfo only: compressor's number of channels*/
  270. siCompressionOutputSampleRate = FOUR_CHAR_CODE('cort'), /* GetInfo only: only implemented by compressors that have differing in and out rates */
  271. siCompressionInputRateList = FOUR_CHAR_CODE('crtl'), /* GetInfo only: only implemented by compressors that only take certain input rates */
  272. siCompressionType = FOUR_CHAR_CODE('comp'), /*current compression type*/
  273. siCompressionConfiguration = FOUR_CHAR_CODE('ccfg'), /*compression extensions*/
  274. siContinuous = FOUR_CHAR_CODE('cont'), /*continous recording*/
  275. siDecompressionParams = FOUR_CHAR_CODE('wave'), /*decompression parameters*/
  276. siDecompressionConfiguration = FOUR_CHAR_CODE('dcfg'), /*decompression extensions*/
  277. siDeviceBufferInfo = FOUR_CHAR_CODE('dbin'), /*size of interrupt buffer*/
  278. siDeviceConnected = FOUR_CHAR_CODE('dcon'), /*input device connection status*/
  279. siDeviceIcon = FOUR_CHAR_CODE('icon'), /*input device icon*/
  280. siDeviceName = FOUR_CHAR_CODE('name'), /*input device name*/
  281. siEQSpectrumBands = FOUR_CHAR_CODE('eqsb'), /* number of spectrum bands*/
  282. siEQSpectrumLevels = FOUR_CHAR_CODE('eqlv'), /* gets spectum meter levels*/
  283. siEQSpectrumOnOff = FOUR_CHAR_CODE('eqlo'), /* turn on/off spectum meter levels*/
  284. siEQSpectrumResolution = FOUR_CHAR_CODE('eqrs'), /* set the resolution of the FFT, 0 = low res (<=16 bands), 1 = high res (16-64 bands)*/
  285. siEQToneControlGain = FOUR_CHAR_CODE('eqtg'), /* set the bass and treble gain*/
  286. siEQToneControlOnOff = FOUR_CHAR_CODE('eqtc'), /* turn on equalizer attenuation*/
  287. siHardwareBalance = FOUR_CHAR_CODE('hbal'),
  288. siHardwareBalanceSteps = FOUR_CHAR_CODE('hbls'),
  289. siHardwareBass = FOUR_CHAR_CODE('hbas'),
  290. siHardwareBassSteps = FOUR_CHAR_CODE('hbst'),
  291. siHardwareBusy = FOUR_CHAR_CODE('hwbs'), /*sound hardware is in use*/
  292. siHardwareFormat = FOUR_CHAR_CODE('hwfm'), /*get hardware format*/
  293. siHardwareMute = FOUR_CHAR_CODE('hmut'), /*mute state of all hardware*/
  294. siHardwareMuteNoPrefs = FOUR_CHAR_CODE('hmnp'), /*mute state of all hardware, but don't store in prefs */
  295. siHardwareTreble = FOUR_CHAR_CODE('htrb'),
  296. siHardwareTrebleSteps = FOUR_CHAR_CODE('hwts'),
  297. siHardwareVolume = FOUR_CHAR_CODE('hvol'), /*volume level of all hardware*/
  298. siHardwareVolumeSteps = FOUR_CHAR_CODE('hstp'), /*number of volume steps for hardware*/
  299. siHeadphoneMute = FOUR_CHAR_CODE('pmut'), /*mute state of headphones*/
  300. siHeadphoneVolume = FOUR_CHAR_CODE('pvol'), /*volume level of headphones*/
  301. siHeadphoneVolumeSteps = FOUR_CHAR_CODE('hdst'), /*number of volume steps for headphones*/
  302. siInputAvailable = FOUR_CHAR_CODE('inav'), /*input sources available*/
  303. siInputGain = FOUR_CHAR_CODE('gain'), /*input gain*/
  304. siInputSource = FOUR_CHAR_CODE('sour'), /*input source selector*/
  305. siInputSourceNames = FOUR_CHAR_CODE('snam'), /*input source names*/
  306. siLevelMeterOnOff = FOUR_CHAR_CODE('lmet'), /*level meter state*/
  307. siModemGain = FOUR_CHAR_CODE('mgai'), /*modem input gain*/
  308. siMonitorAvailable = FOUR_CHAR_CODE('mnav'),
  309. siMonitorSource = FOUR_CHAR_CODE('mons'),
  310. siNumberChannels = FOUR_CHAR_CODE('chan'), /*current number of channels*/
  311. siOptionsDialog = FOUR_CHAR_CODE('optd'), /*display options dialog*/
  312. siOSTypeInputSource = FOUR_CHAR_CODE('inpt'), /*input source by OSType*/
  313. siOSTypeInputAvailable = FOUR_CHAR_CODE('inav'), /*list of available input source OSTypes*/
  314. siOutputDeviceName = FOUR_CHAR_CODE('onam'), /*output device name*/
  315. siPlayThruOnOff = FOUR_CHAR_CODE('plth'), /*playthrough state*/
  316. siPostMixerSoundComponent = FOUR_CHAR_CODE('psmx'), /*install post-mixer effect*/
  317. siPreMixerSoundComponent = FOUR_CHAR_CODE('prmx'), /*install pre-mixer effect*/
  318. siQuality = FOUR_CHAR_CODE('qual'), /*quality setting*/
  319. siRateMultiplier = FOUR_CHAR_CODE('rmul'), /*throttle rate setting*/
  320. siRecordingQuality = FOUR_CHAR_CODE('qual'), /*recording quality*/
  321. siSampleRate = FOUR_CHAR_CODE('srat'), /*current sample rate*/
  322. siSampleRateAvailable = FOUR_CHAR_CODE('srav'), /*sample rates available*/
  323. siSampleSize = FOUR_CHAR_CODE('ssiz'), /*current sample size*/
  324. siSampleSizeAvailable = FOUR_CHAR_CODE('ssav'), /*sample sizes available*/
  325. siSetupCDAudio = FOUR_CHAR_CODE('sucd'), /*setup sound hardware for CD audio*/
  326. siSetupModemAudio = FOUR_CHAR_CODE('sumd'), /*setup sound hardware for modem audio*/
  327. siSlopeAndIntercept = FOUR_CHAR_CODE('flap'), /*floating point variables for conversion*/
  328. siSoundClock = FOUR_CHAR_CODE('sclk'),
  329. siUseThisSoundClock = FOUR_CHAR_CODE('sclc'), /*sdev uses this to tell the mixer to use his sound clock*/
  330. siSpeakerMute = FOUR_CHAR_CODE('smut'), /*mute state of all built-in speaker*/
  331. siSpeakerVolume = FOUR_CHAR_CODE('svol'), /*volume level of built-in speaker*/
  332. siSSpCPULoadLimit = FOUR_CHAR_CODE('3dll'),
  333. siSSpLocalization = FOUR_CHAR_CODE('3dif'),
  334. siSSpSpeakerSetup = FOUR_CHAR_CODE('3dst'),
  335. siStereoInputGain = FOUR_CHAR_CODE('sgai'), /*stereo input gain*/
  336. siSubwooferMute = FOUR_CHAR_CODE('bmut'), /*mute state of sub-woofer*/
  337. siTerminalType = FOUR_CHAR_CODE('ttyp'), /* usb terminal type */
  338. siTwosComplementOnOff = FOUR_CHAR_CODE('twos'), /*two's complement state*/
  339. siVendorProduct = FOUR_CHAR_CODE('vpro'), /* vendor and product ID */
  340. siVolume = FOUR_CHAR_CODE('volu'), /*volume level of source*/
  341. siVoxRecordInfo = FOUR_CHAR_CODE('voxr'), /*VOX record parameters*/
  342. siVoxStopInfo = FOUR_CHAR_CODE('voxs'), /*VOX stop parameters*/
  343. siWideStereo = FOUR_CHAR_CODE('wide'), /*wide stereo setting*/
  344. siSupportedExtendedFlags = FOUR_CHAR_CODE('exfl'), /*which flags are supported in Extended sound data structures*/
  345. siRateConverterRollOffSlope = FOUR_CHAR_CODE('rcdb'), /*the roll-off slope for the rate converter's filter, in whole dB as a long this value is a long whose range is from 20 (worst quality/fastest performance) to 90 (best quality/slowest performance)*/
  346. siOutputLatency = FOUR_CHAR_CODE('olte'), /*latency of sound output component*/
  347. siHALAudioDeviceID = FOUR_CHAR_CODE('hlid'), /*audio device id*/
  348. siHALAudioDeviceUniqueID = FOUR_CHAR_CODE('huid'), /*audio device unique id*/
  349. siClientAcceptsVBR = FOUR_CHAR_CODE('cvbr'), /*client handles VBR*/
  350. siSourceIsExhausted = FOUR_CHAR_CODE('srcx'), /*the ultimate source of data has run out (keep asking, but when you get nothing, that's it)*/
  351. siMediaContextID = FOUR_CHAR_CODE('uuid'), /*media context id -- UUID */
  352. siCompressionMaxPacketSize = FOUR_CHAR_CODE('cmxp'), /*maximum compressed packet size for current configuration -- unsigned long */
  353. siAudioCodecPropertyValue = FOUR_CHAR_CODE('spva'), /*audio codec property value -- SoundAudioCodecPropertyRequestParams* */
  354. siAudioCodecPropertyInfo = FOUR_CHAR_CODE('spin') /*audio codec property info -- SoundAudioCodecPropertyRequestParams* */
  355. };
  356. enum {
  357. siCloseDriver = FOUR_CHAR_CODE('clos'), /*reserved for internal use only*/
  358. siInitializeDriver = FOUR_CHAR_CODE('init'), /*reserved for internal use only*/
  359. siPauseRecording = FOUR_CHAR_CODE('paus'), /*reserved for internal use only*/
  360. siUserInterruptProc = FOUR_CHAR_CODE('user') /*reserved for internal use only*/
  361. };
  362. /* input source Types*/
  363. enum {
  364. kInvalidSource = (long)0xFFFFFFFF, /*this source may be returned from GetInfo if no other source is the monitored source*/
  365. kNoSource = FOUR_CHAR_CODE('none'), /*no source selection*/
  366. kCDSource = FOUR_CHAR_CODE('cd '), /*internal CD player input*/
  367. kExtMicSource = FOUR_CHAR_CODE('emic'), /*external mic input*/
  368. kSoundInSource = FOUR_CHAR_CODE('sinj'), /*sound input jack*/
  369. kRCAInSource = FOUR_CHAR_CODE('irca'), /*RCA jack input*/
  370. kTVFMTunerSource = FOUR_CHAR_CODE('tvfm'),
  371. kDAVInSource = FOUR_CHAR_CODE('idav'), /*DAV analog input*/
  372. kIntMicSource = FOUR_CHAR_CODE('imic'), /*internal mic input*/
  373. kMediaBaySource = FOUR_CHAR_CODE('mbay'), /*media bay input*/
  374. kModemSource = FOUR_CHAR_CODE('modm'), /*modem input (internal modem on desktops, PCI input on PowerBooks)*/
  375. kPCCardSource = FOUR_CHAR_CODE('pcm '), /*PC Card pwm input*/
  376. kZoomVideoSource = FOUR_CHAR_CODE('zvpc'), /*zoom video input*/
  377. kDVDSource = FOUR_CHAR_CODE('dvda'), /* DVD audio input*/
  378. kMicrophoneArray = FOUR_CHAR_CODE('mica') /* microphone array*/
  379. };
  380. /*Sound Component Types and Subtypes*/
  381. enum {
  382. kNoSoundComponentType = FOUR_CHAR_CODE('****'),
  383. kSoundComponentType = FOUR_CHAR_CODE('sift'), /*component type*/
  384. kSoundComponentPPCType = FOUR_CHAR_CODE('nift'), /*component type for PowerPC code*/
  385. kRate8SubType = FOUR_CHAR_CODE('ratb'), /*8-bit rate converter*/
  386. kRate16SubType = FOUR_CHAR_CODE('ratw'), /*16-bit rate converter*/
  387. kConverterSubType = FOUR_CHAR_CODE('conv'), /*sample format converter*/
  388. kSndSourceSubType = FOUR_CHAR_CODE('sour'), /*generic source component*/
  389. kMixerType = FOUR_CHAR_CODE('mixr'),
  390. kMixer8SubType = FOUR_CHAR_CODE('mixb'), /*8-bit mixer*/
  391. kMixer16SubType = FOUR_CHAR_CODE('mixw'), /*16-bit mixer*/
  392. kSoundInputDeviceType = FOUR_CHAR_CODE('sinp'), /*sound input component*/
  393. kWaveInSubType = FOUR_CHAR_CODE('wavi'), /*Windows waveIn*/
  394. kWaveInSnifferSubType = FOUR_CHAR_CODE('wisn'), /*Windows waveIn sniffer*/
  395. kSoundOutputDeviceType = FOUR_CHAR_CODE('sdev'), /*sound output component*/
  396. kClassicSubType = FOUR_CHAR_CODE('clas'), /*classic hardware, i.e. Mac Plus*/
  397. kASCSubType = FOUR_CHAR_CODE('asc '), /*Apple Sound Chip device*/
  398. kDSPSubType = FOUR_CHAR_CODE('dsp '), /*DSP device*/
  399. kAwacsSubType = FOUR_CHAR_CODE('awac'), /*Another of Will's Audio Chips device*/
  400. kGCAwacsSubType = FOUR_CHAR_CODE('awgc'), /*Awacs audio with Grand Central DMA*/
  401. kSingerSubType = FOUR_CHAR_CODE('sing'), /*Singer (via Whitney) based sound*/
  402. kSinger2SubType = FOUR_CHAR_CODE('sng2'), /*Singer 2 (via Whitney) for Acme*/
  403. kWhitSubType = FOUR_CHAR_CODE('whit'), /*Whit sound component for PrimeTime 3*/
  404. kSoundBlasterSubType = FOUR_CHAR_CODE('sbls'), /*Sound Blaster for CHRP*/
  405. kWaveOutSubType = FOUR_CHAR_CODE('wavo'), /*Windows waveOut*/
  406. kWaveOutSnifferSubType = FOUR_CHAR_CODE('wosn'), /*Windows waveOut sniffer*/
  407. kDirectSoundSubType = FOUR_CHAR_CODE('dsnd'), /*Windows DirectSound*/
  408. kDirectSoundSnifferSubType = FOUR_CHAR_CODE('dssn'), /*Windows DirectSound sniffer*/
  409. kUNIXsdevSubType = FOUR_CHAR_CODE('un1x'), /*UNIX base sdev*/
  410. kUSBSubType = FOUR_CHAR_CODE('usb '), /*USB device*/
  411. kBlueBoxSubType = FOUR_CHAR_CODE('bsnd'), /*Blue Box sound component*/
  412. kHALCustomComponentSubType = FOUR_CHAR_CODE('halx'), /*Registered by the HAL output component ('hal!') for each HAL output device*/
  413. kSoundCompressor = FOUR_CHAR_CODE('scom'),
  414. kSoundDecompressor = FOUR_CHAR_CODE('sdec'),
  415. kAudioComponentType = FOUR_CHAR_CODE('adio'), /*Audio components and sub-types*/
  416. kAwacsPhoneSubType = FOUR_CHAR_CODE('hphn'),
  417. kAudioVisionSpeakerSubType = FOUR_CHAR_CODE('telc'),
  418. kAudioVisionHeadphoneSubType = FOUR_CHAR_CODE('telh'),
  419. kPhilipsFaderSubType = FOUR_CHAR_CODE('tvav'),
  420. kSGSToneSubType = FOUR_CHAR_CODE('sgs0'),
  421. kSoundEffectsType = FOUR_CHAR_CODE('snfx'), /*sound effects type*/
  422. kEqualizerSubType = FOUR_CHAR_CODE('eqal'), /*frequency equalizer*/
  423. kSSpLocalizationSubType = FOUR_CHAR_CODE('snd3')
  424. };
  425. /*Format Types*/
  426. enum {
  427. kSoundNotCompressed = FOUR_CHAR_CODE('NONE'), /*sound is not compressed*/
  428. k8BitOffsetBinaryFormat = FOUR_CHAR_CODE('raw '), /*8-bit offset binary*/
  429. k16BitBigEndianFormat = FOUR_CHAR_CODE('twos'), /*16-bit big endian*/
  430. k16BitLittleEndianFormat = FOUR_CHAR_CODE('sowt'), /*16-bit little endian*/
  431. kFloat32Format = FOUR_CHAR_CODE('fl32'), /*32-bit floating point*/
  432. kFloat64Format = FOUR_CHAR_CODE('fl64'), /*64-bit floating point*/
  433. k24BitFormat = FOUR_CHAR_CODE('in24'), /*24-bit integer*/
  434. k32BitFormat = FOUR_CHAR_CODE('in32'), /*32-bit integer*/
  435. k32BitLittleEndianFormat = FOUR_CHAR_CODE('23ni'), /*32-bit little endian integer */
  436. kMACE3Compression = FOUR_CHAR_CODE('MAC3'), /*MACE 3:1*/
  437. kMACE6Compression = FOUR_CHAR_CODE('MAC6'), /*MACE 6:1*/
  438. kCDXA4Compression = FOUR_CHAR_CODE('cdx4'), /*CD/XA 4:1*/
  439. kCDXA2Compression = FOUR_CHAR_CODE('cdx2'), /*CD/XA 2:1*/
  440. kIMACompression = FOUR_CHAR_CODE('ima4'), /*IMA 4:1*/
  441. kULawCompression = FOUR_CHAR_CODE('ulaw'), /*.Law 2:1*/
  442. kALawCompression = FOUR_CHAR_CODE('alaw'), /*aLaw 2:1*/
  443. kMicrosoftADPCMFormat = 0x6D730002, /*Microsoft ADPCM - ACM code 2*/
  444. kDVIIntelIMAFormat = 0x6D730011, /*DVI/Intel IMA ADPCM - ACM code 17*/
  445. kMicrosoftGSMCompression = 0x6D730031, /*Microsoft GSM 6.10 - ACM code 49*/
  446. kDVAudioFormat = FOUR_CHAR_CODE('dvca'), /*DV Audio*/
  447. kQDesignCompression = FOUR_CHAR_CODE('QDMC'), /*QDesign music*/
  448. kQDesign2Compression = FOUR_CHAR_CODE('QDM2'), /*QDesign2 music*/
  449. kQUALCOMMCompression = FOUR_CHAR_CODE('Qclp'), /*QUALCOMM PureVoice*/
  450. kOffsetBinary = k8BitOffsetBinaryFormat, /*for compatibility*/
  451. kTwosComplement = k16BitBigEndianFormat, /*for compatibility*/
  452. kLittleEndianFormat = k16BitLittleEndianFormat, /*for compatibility*/
  453. kMPEGLayer3Format = 0x6D730055, /*MPEG Layer 3, CBR only (pre QT4.1)*/
  454. kFullMPEGLay3Format = FOUR_CHAR_CODE('.mp3'), /*MPEG Layer 3, CBR & VBR (QT4.1 and later)*/
  455. kVariableDurationDVAudioFormat = FOUR_CHAR_CODE('vdva') /*Variable Duration DV Audio*/
  456. };
  457. #if TARGET_RT_LITTLE_ENDIAN
  458. enum {
  459. k16BitNativeEndianFormat = k16BitLittleEndianFormat,
  460. k16BitNonNativeEndianFormat = k16BitBigEndianFormat
  461. };
  462. #else
  463. enum {
  464. k16BitNativeEndianFormat = k16BitBigEndianFormat,
  465. k16BitNonNativeEndianFormat = k16BitLittleEndianFormat
  466. };
  467. #endif /* TARGET_RT_LITTLE_ENDIAN */
  468. /*Features Flags*/
  469. enum {
  470. k8BitRawIn = (1 << 0), /*data description*/
  471. k8BitTwosIn = (1 << 1),
  472. k16BitIn = (1 << 2),
  473. kStereoIn = (1 << 3),
  474. k8BitRawOut = (1 << 8),
  475. k8BitTwosOut = (1 << 9),
  476. k16BitOut = (1 << 10),
  477. kStereoOut = (1 << 11),
  478. kReverse = (1L << 16), /* function description*/
  479. kRateConvert = (1L << 17),
  480. kCreateSoundSource = (1L << 18),
  481. kVMAwareness = (1L << 21), /* component will hold its memory*/
  482. kHighQuality = (1L << 22), /* performance description*/
  483. kNonRealTime = (1L << 23)
  484. };
  485. /*'snfo' Resource Feature Flags*/
  486. enum {
  487. kSoundCodecInfoFixedCompression = (1L << 0), /* has fixed compression format*/
  488. kSoundCodecInfoVariableCompression = (1L << 1), /* has variable compression format*/
  489. kSoundCodecInfoHasRestrictedInputRates = (1L << 2), /* compressor has restricted set of input sample rates*/
  490. kSoundCodecInfoCanChangeOutputRate = (1L << 3), /* compressor may output a different sample rate than it receives*/
  491. kSoundCodecInfoRequiresExternalFraming = (1L << 4), /* format requires external framing information during decode/encode*/
  492. kSoundCodecInfoVariableDuration = (1L << 5) /* audio packets can vary in duration*/
  493. };
  494. /*SoundComponentPlaySourceBuffer action flags*/
  495. enum {
  496. kSourcePaused = (1 << 0),
  497. kPassThrough = (1L << 16),
  498. kNoSoundComponentChain = (1L << 17)
  499. };
  500. /*SoundParamBlock flags, usefull for OpenMixerSoundComponent*/
  501. enum {
  502. kNoMixing = (1 << 0), /*don't mix source*/
  503. kNoSampleRateConversion = (1 << 1), /*don't convert sample rate (i.e. 11 kHz -> 22 kHz)*/
  504. kNoSampleSizeConversion = (1 << 2), /*don't convert sample size (i.e. 16 -> 8)*/
  505. kNoSampleFormatConversion = (1 << 3), /*don't convert sample format (i.e. 'twos' -> 'raw ')*/
  506. kNoChannelConversion = (1 << 4), /*don't convert stereo/mono*/
  507. kNoDecompression = (1 << 5), /*don't decompress (i.e. 'MAC3' -> 'raw ')*/
  508. kNoVolumeConversion = (1 << 6), /*don't apply volume*/
  509. kNoRealtimeProcessing = (1 << 7), /*won't run at interrupt time*/
  510. kScheduledSource = (1 << 8), /*source is scheduled*/
  511. kNonInterleavedBuffer = (1 << 9), /*buffer is not interleaved samples*/
  512. kNonPagingMixer = (1 << 10), /*if VM is on, use the non-paging mixer*/
  513. kSoundConverterMixer = (1 << 11), /*the mixer is to be used by the SoundConverter*/
  514. kPagingMixer = (1 << 12), /*the mixer is to be used as a paging mixer when VM is on*/
  515. kVMAwareMixer = (1 << 13), /*passed to the output device when the SM is going to deal with VM safety*/
  516. kExtendedSoundData = (1 << 14) /*SoundComponentData record is actually an ExtendedSoundComponentData*/
  517. };
  518. /*SoundParamBlock quality settings*/
  519. enum {
  520. kBestQuality = (1 << 0) /*use interpolation in rate conversion*/
  521. };
  522. /*useful bit masks*/
  523. enum {
  524. kInputMask = 0x000000FF, /*masks off input bits*/
  525. kOutputMask = 0x0000FF00, /*masks off output bits*/
  526. kOutputShift = 8, /*amount output bits are shifted*/
  527. kActionMask = 0x00FF0000, /*masks off action bits*/
  528. kSoundComponentBits = 0x00FFFFFF
  529. };
  530. /*audio atom types*/
  531. enum {
  532. kAudioFormatAtomType = FOUR_CHAR_CODE('frma'),
  533. kAudioEndianAtomType = FOUR_CHAR_CODE('enda'),
  534. kAudioVBRAtomType = FOUR_CHAR_CODE('vbra'),
  535. kAudioTerminatorAtomType = 0
  536. };
  537. /*siAVDisplayBehavior types*/
  538. enum {
  539. kAVDisplayHeadphoneRemove = 0, /* monitor does not have a headphone attached*/
  540. kAVDisplayHeadphoneInsert = 1, /* monitor has a headphone attached*/
  541. kAVDisplayPlainTalkRemove = 2, /* monitor either sending no input through CPU input port or unable to tell if input is coming in*/
  542. kAVDisplayPlainTalkInsert = 3 /* monitor sending PlainTalk level microphone source input through sound input port*/
  543. };
  544. /*Audio Component constants*/
  545. enum {
  546. /*Values for whichChannel parameter*/
  547. audioAllChannels = 0, /*All channels (usually interpreted as both left and right)*/
  548. audioLeftChannel = 1, /*Left channel*/
  549. audioRightChannel = 2, /*Right channel*/
  550. /*Values for mute parameter*/
  551. audioUnmuted = 0, /*Device is unmuted*/
  552. audioMuted = 1, /*Device is muted*/
  553. /*Capabilities flags definitions*/
  554. audioDoesMono = (1L << 0), /*Device supports mono output*/
  555. audioDoesStereo = (1L << 1), /*Device supports stereo output*/
  556. audioDoesIndependentChannels = (1L << 2) /*Device supports independent software control of each channel*/
  557. };
  558. /*Sound Input Qualities*/
  559. enum {
  560. siCDQuality = FOUR_CHAR_CODE('cd '), /*44.1kHz, stereo, 16 bit*/
  561. siBestQuality = FOUR_CHAR_CODE('best'), /*22kHz, mono, 8 bit*/
  562. siBetterQuality = FOUR_CHAR_CODE('betr'), /*22kHz, mono, MACE 3:1*/
  563. siGoodQuality = FOUR_CHAR_CODE('good'), /*22kHz, mono, MACE 6:1*/
  564. siNoneQuality = FOUR_CHAR_CODE('none') /*settings don't match any quality for a get call*/
  565. };
  566. enum {
  567. siDeviceIsConnected = 1, /*input device is connected and ready for input*/
  568. siDeviceNotConnected = 0, /*input device is not connected*/
  569. siDontKnowIfConnected = -1, /*can't tell if input device is connected*/
  570. siReadPermission = 0, /*permission passed to SPBOpenDevice*/
  571. siWritePermission = 1 /*permission passed to SPBOpenDevice*/
  572. };
  573. /*flags that SoundConverterFillBuffer will return*/
  574. enum {
  575. kSoundConverterDidntFillBuffer = (1 << 0), /*set if the converter couldn't completely satisfy a SoundConverterFillBuffer request*/
  576. kSoundConverterHasLeftOverData = (1 << 1) /*set if the converter had left over data after completely satisfying a SoundConverterFillBuffer call*/
  577. };
  578. /* flags for extendedFlags fields of ExtendedSoundComponentData, ExtendedSoundParamBlock, and ExtendedScheduledSoundHeader*/
  579. enum {
  580. kExtendedSoundSampleCountNotValid = 1L << 0, /* set if sampleCount of SoundComponentData isn't meaningful; use buffer size instead*/
  581. kExtendedSoundBufferSizeValid = 1L << 1, /* set if bufferSize field is valid*/
  582. kExtendedSoundFrameSizesValid = 1L << 2, /* set if frameSizesArray is valid (will be nil if all sizes are common and kExtendedSoundCommonFrameSizeValid is set*/
  583. kExtendedSoundCommonFrameSizeValid = 1L << 3, /* set if all audio frames have the same size and the commonFrameSize field is valid*/
  584. kExtendedSoundExtensionsValid = 1L << 4, /* set if pointer to extensions array is valid*/
  585. kExtendedSoundBufferFlagsValid = 1L << 5 /* set if buffer flags field is valid*/
  586. };
  587. /* flags passed in bufferFlags/bufferFlagsMask extended fields if kExtendedSoundBufferFlagsValid extended flag is set*/
  588. enum {
  589. kExtendedSoundBufferIsDiscontinuous = 1L << 0, /* buffer is discontinuous with previous buffer*/
  590. kExtendedSoundBufferIsFirstBuffer = 1L << 1 /* buffer is first buffer*/
  591. };
  592. /*
  593. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  594. typedefs
  595. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  596. */
  597. struct SndCommand {
  598. unsigned short cmd;
  599. short param1;
  600. long param2;
  601. };
  602. typedef struct SndCommand SndCommand;
  603. typedef struct SndChannel SndChannel;
  604. typedef SndChannel * SndChannelPtr;
  605. typedef CALLBACK_API( void , SndCallBackProcPtr )(SndChannelPtr chan, SndCommand *cmd);
  606. typedef STACK_UPP_TYPE(SndCallBackProcPtr) SndCallBackUPP;
  607. struct SndChannel {
  608. SndChannelPtr nextChan;
  609. Ptr firstMod; /* reserved for the Sound Manager */
  610. SndCallBackUPP callBack;
  611. long userInfo;
  612. long wait; /* The following is for internal Sound Manager use only.*/
  613. SndCommand cmdInProgress;
  614. short flags;
  615. short qLength;
  616. short qHead;
  617. short qTail;
  618. SndCommand queue[128];
  619. };
  620. /*
  621. * NewSndCallBackUPP()
  622. *
  623. * Availability:
  624. * Non-Carbon CFM: available as macro/inline
  625. * CarbonLib: in CarbonLib 1.0 and later
  626. * Mac OS X: in version 10.0 and later
  627. */
  628. EXTERN_API_C( SndCallBackUPP )
  629. NewSndCallBackUPP(SndCallBackProcPtr userRoutine);
  630. #if !OPAQUE_UPP_TYPES
  631. enum { uppSndCallBackProcInfo = 0x000003C0 }; /* pascal no_return_value Func(4_bytes, 4_bytes) */
  632. #ifdef __cplusplus
  633. inline DEFINE_API_C(SndCallBackUPP) NewSndCallBackUPP(SndCallBackProcPtr userRoutine) { return (SndCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSndCallBackProcInfo, GetCurrentArchitecture()); }
  634. #else
  635. #define NewSndCallBackUPP(userRoutine) (SndCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSndCallBackProcInfo, GetCurrentArchitecture())
  636. #endif
  637. #endif
  638. /*
  639. * DisposeSndCallBackUPP()
  640. *
  641. * Availability:
  642. * Non-Carbon CFM: available as macro/inline
  643. * CarbonLib: in CarbonLib 1.0 and later
  644. * Mac OS X: in version 10.0 and later
  645. */
  646. EXTERN_API_C( void )
  647. DisposeSndCallBackUPP(SndCallBackUPP userUPP);
  648. #if !OPAQUE_UPP_TYPES
  649. #ifdef __cplusplus
  650. inline DEFINE_API_C(void) DisposeSndCallBackUPP(SndCallBackUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  651. #else
  652. #define DisposeSndCallBackUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  653. #endif
  654. #endif
  655. /*
  656. * InvokeSndCallBackUPP()
  657. *
  658. * Availability:
  659. * Non-Carbon CFM: available as macro/inline
  660. * CarbonLib: in CarbonLib 1.0 and later
  661. * Mac OS X: in version 10.0 and later
  662. */
  663. EXTERN_API_C( void )
  664. InvokeSndCallBackUPP(
  665. SndChannelPtr chan,
  666. SndCommand * cmd,
  667. SndCallBackUPP userUPP);
  668. #if !OPAQUE_UPP_TYPES
  669. #ifdef __cplusplus
  670. inline DEFINE_API_C(void) InvokeSndCallBackUPP(SndChannelPtr chan, SndCommand * cmd, SndCallBackUPP userUPP) { CALL_TWO_PARAMETER_UPP(userUPP, uppSndCallBackProcInfo, chan, cmd); }
  671. #else
  672. #define InvokeSndCallBackUPP(chan, cmd, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppSndCallBackProcInfo, (chan), (cmd))
  673. #endif
  674. #endif
  675. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  676. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  677. #define NewSndCallBackProc(userRoutine) NewSndCallBackUPP(userRoutine)
  678. #define CallSndCallBackProc(userRoutine, chan, cmd) InvokeSndCallBackUPP(chan, cmd, userRoutine)
  679. #endif /* CALL_NOT_IN_CARBON */
  680. /*MACE structures*/
  681. struct StateBlock {
  682. short stateVar[64];
  683. };
  684. typedef struct StateBlock StateBlock;
  685. typedef StateBlock * StateBlockPtr;
  686. struct LeftOverBlock {
  687. unsigned long count;
  688. SInt8 sampleArea[32];
  689. };
  690. typedef struct LeftOverBlock LeftOverBlock;
  691. typedef LeftOverBlock * LeftOverBlockPtr;
  692. struct ModRef {
  693. unsigned short modNumber;
  694. long modInit;
  695. };
  696. typedef struct ModRef ModRef;
  697. struct SndListResource {
  698. short format;
  699. short numModifiers;
  700. ModRef modifierPart[1];
  701. short numCommands;
  702. SndCommand commandPart[1];
  703. UInt8 dataPart[1];
  704. };
  705. typedef struct SndListResource SndListResource;
  706. typedef SndListResource * SndListPtr;
  707. typedef SndListPtr * SndListHandle;
  708. typedef SndListHandle SndListHndl;
  709. /*HyperCard sound resource format*/
  710. struct Snd2ListResource {
  711. short format;
  712. short refCount;
  713. short numCommands;
  714. SndCommand commandPart[1];
  715. UInt8 dataPart[1];
  716. };
  717. typedef struct Snd2ListResource Snd2ListResource;
  718. typedef Snd2ListResource * Snd2ListPtr;
  719. typedef Snd2ListPtr * Snd2ListHandle;
  720. typedef Snd2ListHandle Snd2ListHndl;
  721. struct SoundHeader {
  722. Ptr samplePtr; /*if NIL then samples are in sampleArea*/
  723. unsigned long length; /*length of sound in bytes*/
  724. UnsignedFixed sampleRate; /*sample rate for this sound*/
  725. unsigned long loopStart; /*start of looping portion*/
  726. unsigned long loopEnd; /*end of looping portion*/
  727. UInt8 encode; /*header encoding*/
  728. UInt8 baseFrequency; /*baseFrequency value*/
  729. UInt8 sampleArea[1]; /*space for when samples follow directly*/
  730. };
  731. typedef struct SoundHeader SoundHeader;
  732. typedef SoundHeader * SoundHeaderPtr;
  733. struct CmpSoundHeader {
  734. Ptr samplePtr; /*if nil then samples are in sample area*/
  735. unsigned long numChannels; /*number of channels i.e. mono = 1*/
  736. UnsignedFixed sampleRate; /*sample rate in Apples Fixed point representation*/
  737. unsigned long loopStart; /*loopStart of sound before compression*/
  738. unsigned long loopEnd; /*loopEnd of sound before compression*/
  739. UInt8 encode; /*data structure used , stdSH, extSH, or cmpSH*/
  740. UInt8 baseFrequency; /*same meaning as regular SoundHeader*/
  741. unsigned long numFrames; /*length in frames ( packetFrames or sampleFrames )*/
  742. extended80 AIFFSampleRate; /*IEEE sample rate*/
  743. Ptr markerChunk; /*sync track*/
  744. OSType format; /*data format type, was futureUse1*/
  745. unsigned long futureUse2; /*reserved by Apple*/
  746. StateBlockPtr stateVars; /*pointer to State Block*/
  747. LeftOverBlockPtr leftOverSamples; /*used to save truncated samples between compression calls*/
  748. short compressionID; /*0 means no compression, non zero means compressionID*/
  749. unsigned short packetSize; /*number of bits in compressed sample packet*/
  750. unsigned short snthID; /*resource ID of Sound Manager snth that contains NRT C/E*/
  751. unsigned short sampleSize; /*number of bits in non-compressed sample*/
  752. UInt8 sampleArea[1]; /*space for when samples follow directly*/
  753. };
  754. typedef struct CmpSoundHeader CmpSoundHeader;
  755. typedef CmpSoundHeader * CmpSoundHeaderPtr;
  756. struct ExtSoundHeader {
  757. Ptr samplePtr; /*if nil then samples are in sample area*/
  758. unsigned long numChannels; /*number of channels, ie mono = 1*/
  759. UnsignedFixed sampleRate; /*sample rate in Apples Fixed point representation*/
  760. unsigned long loopStart; /*same meaning as regular SoundHeader*/
  761. unsigned long loopEnd; /*same meaning as regular SoundHeader*/
  762. UInt8 encode; /*data structure used , stdSH, extSH, or cmpSH*/
  763. UInt8 baseFrequency; /*same meaning as regular SoundHeader*/
  764. unsigned long numFrames; /*length in total number of frames*/
  765. extended80 AIFFSampleRate; /*IEEE sample rate*/
  766. Ptr markerChunk; /*sync track*/
  767. Ptr instrumentChunks; /*AIFF instrument chunks*/
  768. Ptr AESRecording;
  769. unsigned short sampleSize; /*number of bits in sample*/
  770. unsigned short futureUse1; /*reserved by Apple*/
  771. unsigned long futureUse2; /*reserved by Apple*/
  772. unsigned long futureUse3; /*reserved by Apple*/
  773. unsigned long futureUse4; /*reserved by Apple*/
  774. UInt8 sampleArea[1]; /*space for when samples follow directly*/
  775. };
  776. typedef struct ExtSoundHeader ExtSoundHeader;
  777. typedef ExtSoundHeader * ExtSoundHeaderPtr;
  778. union SoundHeaderUnion {
  779. SoundHeader stdHeader;
  780. CmpSoundHeader cmpHeader;
  781. ExtSoundHeader extHeader;
  782. };
  783. typedef union SoundHeaderUnion SoundHeaderUnion;
  784. struct ConversionBlock {
  785. short destination;
  786. short unused;
  787. CmpSoundHeaderPtr inputPtr;
  788. CmpSoundHeaderPtr outputPtr;
  789. };
  790. typedef struct ConversionBlock ConversionBlock;
  791. typedef ConversionBlock * ConversionBlockPtr;
  792. /* ScheduledSoundHeader flags*/
  793. enum {
  794. kScheduledSoundDoScheduled = 1 << 0,
  795. kScheduledSoundDoCallBack = 1 << 1,
  796. kScheduledSoundExtendedHdr = 1 << 2
  797. };
  798. struct ScheduledSoundHeader {
  799. SoundHeaderUnion u;
  800. long flags;
  801. short reserved;
  802. short callBackParam1;
  803. long callBackParam2;
  804. TimeRecord startTime;
  805. };
  806. typedef struct ScheduledSoundHeader ScheduledSoundHeader;
  807. typedef ScheduledSoundHeader * ScheduledSoundHeaderPtr;
  808. struct ExtendedScheduledSoundHeader {
  809. SoundHeaderUnion u;
  810. long flags;
  811. short reserved;
  812. short callBackParam1;
  813. long callBackParam2;
  814. TimeRecord startTime;
  815. long recordSize;
  816. long extendedFlags;
  817. long bufferSize;
  818. long frameCount; /* number of audio frames*/
  819. long * frameSizesArray; /* pointer to array of longs with frame sizes in bytes*/
  820. long commonFrameSize; /* size of each frame if common*/
  821. void * extensionsPtr; /*pointer to set of classic atoms (size,type,data,...)*/
  822. long extensionsSize; /*size of extensions data (extensionsPtr)*/
  823. unsigned long bufferFlags; /*set or cleared flags*/
  824. unsigned long bufferFlagsMask; /*which flags are valid*/
  825. };
  826. typedef struct ExtendedScheduledSoundHeader ExtendedScheduledSoundHeader;
  827. typedef ExtendedScheduledSoundHeader * ExtendedScheduledSoundHeaderPtr;
  828. struct SMStatus {
  829. short smMaxCPULoad;
  830. short smNumChannels;
  831. short smCurCPULoad;
  832. };
  833. typedef struct SMStatus SMStatus;
  834. typedef SMStatus * SMStatusPtr;
  835. struct SCStatus {
  836. UnsignedFixed scStartTime;
  837. UnsignedFixed scEndTime;
  838. UnsignedFixed scCurrentTime;
  839. Boolean scChannelBusy;
  840. Boolean scChannelDisposed;
  841. Boolean scChannelPaused;
  842. Boolean scUnused;
  843. unsigned long scChannelAttributes;
  844. long scCPULoad;
  845. };
  846. typedef struct SCStatus SCStatus;
  847. typedef SCStatus * SCStatusPtr;
  848. struct AudioSelection {
  849. long unitType;
  850. UnsignedFixed selStart;
  851. UnsignedFixed selEnd;
  852. };
  853. typedef struct AudioSelection AudioSelection;
  854. typedef AudioSelection * AudioSelectionPtr;
  855. #if CALL_NOT_IN_CARBON
  856. struct SndDoubleBuffer {
  857. long dbNumFrames;
  858. long dbFlags;
  859. long dbUserInfo[2];
  860. SInt8 dbSoundData[1];
  861. };
  862. typedef struct SndDoubleBuffer SndDoubleBuffer;
  863. typedef SndDoubleBuffer * SndDoubleBufferPtr;
  864. typedef CALLBACK_API( void , SndDoubleBackProcPtr )(SndChannelPtr channel, SndDoubleBufferPtr doubleBufferPtr);
  865. typedef STACK_UPP_TYPE(SndDoubleBackProcPtr) SndDoubleBackUPP;
  866. #if CALL_NOT_IN_CARBON
  867. /*
  868. * NewSndDoubleBackUPP()
  869. *
  870. * Availability:
  871. * Non-Carbon CFM: available as macro/inline
  872. * CarbonLib: not available
  873. * Mac OS X: not available
  874. */
  875. EXTERN_API_C( SndDoubleBackUPP )
  876. NewSndDoubleBackUPP(SndDoubleBackProcPtr userRoutine);
  877. #if !OPAQUE_UPP_TYPES
  878. enum { uppSndDoubleBackProcInfo = 0x000003C0 }; /* pascal no_return_value Func(4_bytes, 4_bytes) */
  879. #ifdef __cplusplus
  880. inline DEFINE_API_C(SndDoubleBackUPP) NewSndDoubleBackUPP(SndDoubleBackProcPtr userRoutine) { return (SndDoubleBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSndDoubleBackProcInfo, GetCurrentArchitecture()); }
  881. #else
  882. #define NewSndDoubleBackUPP(userRoutine) (SndDoubleBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSndDoubleBackProcInfo, GetCurrentArchitecture())
  883. #endif
  884. #endif
  885. /*
  886. * DisposeSndDoubleBackUPP()
  887. *
  888. * Availability:
  889. * Non-Carbon CFM: available as macro/inline
  890. * CarbonLib: not available
  891. * Mac OS X: not available
  892. */
  893. EXTERN_API_C( void )
  894. DisposeSndDoubleBackUPP(SndDoubleBackUPP userUPP);
  895. #if !OPAQUE_UPP_TYPES
  896. #ifdef __cplusplus
  897. inline DEFINE_API_C(void) DisposeSndDoubleBackUPP(SndDoubleBackUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  898. #else
  899. #define DisposeSndDoubleBackUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  900. #endif
  901. #endif
  902. /*
  903. * InvokeSndDoubleBackUPP()
  904. *
  905. * Availability:
  906. * Non-Carbon CFM: available as macro/inline
  907. * CarbonLib: not available
  908. * Mac OS X: not available
  909. */
  910. EXTERN_API_C( void )
  911. InvokeSndDoubleBackUPP(
  912. SndChannelPtr channel,
  913. SndDoubleBufferPtr doubleBufferPtr,
  914. SndDoubleBackUPP userUPP);
  915. #if !OPAQUE_UPP_TYPES
  916. #ifdef __cplusplus
  917. inline DEFINE_API_C(void) InvokeSndDoubleBackUPP(SndChannelPtr channel, SndDoubleBufferPtr doubleBufferPtr, SndDoubleBackUPP userUPP) { CALL_TWO_PARAMETER_UPP(userUPP, uppSndDoubleBackProcInfo, channel, doubleBufferPtr); }
  918. #else
  919. #define InvokeSndDoubleBackUPP(channel, doubleBufferPtr, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppSndDoubleBackProcInfo, (channel), (doubleBufferPtr))
  920. #endif
  921. #endif
  922. #endif /* CALL_NOT_IN_CARBON */
  923. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  924. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  925. #define NewSndDoubleBackProc(userRoutine) NewSndDoubleBackUPP(userRoutine)
  926. #define CallSndDoubleBackProc(userRoutine, channel, doubleBufferPtr) InvokeSndDoubleBackUPP(channel, doubleBufferPtr, userRoutine)
  927. #endif /* CALL_NOT_IN_CARBON */
  928. struct SndDoubleBufferHeader {
  929. short dbhNumChannels;
  930. short dbhSampleSize;
  931. short dbhCompressionID;
  932. short dbhPacketSize;
  933. UnsignedFixed dbhSampleRate;
  934. SndDoubleBufferPtr dbhBufferPtr[2];
  935. SndDoubleBackUPP dbhDoubleBack;
  936. };
  937. typedef struct SndDoubleBufferHeader SndDoubleBufferHeader;
  938. typedef SndDoubleBufferHeader * SndDoubleBufferHeaderPtr;
  939. struct SndDoubleBufferHeader2 {
  940. short dbhNumChannels;
  941. short dbhSampleSize;
  942. short dbhCompressionID;
  943. short dbhPacketSize;
  944. UnsignedFixed dbhSampleRate;
  945. SndDoubleBufferPtr dbhBufferPtr[2];
  946. SndDoubleBackUPP dbhDoubleBack;
  947. OSType dbhFormat;
  948. };
  949. typedef struct SndDoubleBufferHeader2 SndDoubleBufferHeader2;
  950. typedef SndDoubleBufferHeader2 * SndDoubleBufferHeader2Ptr;
  951. #endif /* CALL_NOT_IN_CARBON */
  952. struct SoundInfoList {
  953. short count;
  954. Handle infoHandle;
  955. };
  956. typedef struct SoundInfoList SoundInfoList;
  957. typedef SoundInfoList * SoundInfoListPtr;
  958. struct SoundComponentData {
  959. long flags;
  960. OSType format;
  961. short numChannels;
  962. short sampleSize;
  963. UnsignedFixed sampleRate;
  964. long sampleCount;
  965. Byte * buffer;
  966. long reserved;
  967. };
  968. typedef struct SoundComponentData SoundComponentData;
  969. typedef SoundComponentData * SoundComponentDataPtr;
  970. struct ExtendedSoundComponentData {
  971. SoundComponentData desc; /*description of sound buffer*/
  972. long recordSize; /*size of this record in bytes*/
  973. long extendedFlags; /*flags for extended record*/
  974. long bufferSize; /*size of buffer in bytes*/
  975. long frameCount; /*number of audio frames*/
  976. long * frameSizesArray; /*pointer to array of longs with frame sizes in bytes*/
  977. long commonFrameSize; /*size of each frame if common*/
  978. void * extensionsPtr; /*pointer to set of classic atoms (size,type,data,...)*/
  979. long extensionsSize; /*size of extensions data (extensionsPtr)*/
  980. unsigned long bufferFlags; /*set or cleared flags*/
  981. unsigned long bufferFlagsMask; /*which flags are valid*/
  982. };
  983. typedef struct ExtendedSoundComponentData ExtendedSoundComponentData;
  984. typedef ExtendedSoundComponentData * ExtendedSoundComponentDataPtr;
  985. typedef struct SoundParamBlock SoundParamBlock;
  986. typedef SoundParamBlock * SoundParamBlockPtr;
  987. typedef CALLBACK_API( Boolean , SoundParamProcPtr )(SoundParamBlockPtr * pb);
  988. typedef STACK_UPP_TYPE(SoundParamProcPtr) SoundParamUPP;
  989. struct SoundParamBlock {
  990. long recordSize; /*size of this record in bytes*/
  991. SoundComponentData desc; /*description of sound buffer*/
  992. UnsignedFixed rateMultiplier; /*rate multiplier to apply to sound*/
  993. short leftVolume; /*volumes to apply to sound*/
  994. short rightVolume;
  995. long quality; /*quality to apply to sound*/
  996. ComponentInstance filter; /*filter to apply to sound*/
  997. SoundParamUPP moreRtn; /*routine to call to get more data*/
  998. SoundParamUPP completionRtn; /*routine to call when buffer is complete*/
  999. long refCon; /*user refcon*/
  1000. short result; /*result*/
  1001. };
  1002. struct ExtendedSoundParamBlock {
  1003. SoundParamBlock pb; /*classic SoundParamBlock except recordSize == sizeof(ExtendedSoundParamBlock)*/
  1004. short reserved;
  1005. long extendedFlags; /*flags*/
  1006. long bufferSize; /*size of buffer in bytes*/
  1007. long frameCount; /*number of audio frames*/
  1008. long * frameSizesArray; /*pointer to array of longs with frame sizes in bytes*/
  1009. long commonFrameSize; /*size of each frame if common*/
  1010. void * extensionsPtr; /*pointer to set of classic atoms (size,type,data,...)*/
  1011. long extensionsSize; /*size of extensions data (extensionsPtr)*/
  1012. unsigned long bufferFlags; /*set or cleared flags*/
  1013. unsigned long bufferFlagsMask; /*which flags are valid*/
  1014. };
  1015. typedef struct ExtendedSoundParamBlock ExtendedSoundParamBlock;
  1016. typedef ExtendedSoundParamBlock * ExtendedSoundParamBlockPtr;
  1017. struct CompressionInfo {
  1018. long recordSize;
  1019. OSType format;
  1020. short compressionID;
  1021. unsigned short samplesPerPacket;
  1022. unsigned short bytesPerPacket;
  1023. unsigned short bytesPerFrame;
  1024. unsigned short bytesPerSample;
  1025. unsigned short futureUse1;
  1026. };
  1027. typedef struct CompressionInfo CompressionInfo;
  1028. typedef CompressionInfo * CompressionInfoPtr;
  1029. typedef CompressionInfoPtr * CompressionInfoHandle;
  1030. /*variables for floating point conversion*/
  1031. struct SoundSlopeAndInterceptRecord {
  1032. Float64 slope;
  1033. Float64 intercept;
  1034. Float64 minClip;
  1035. Float64 maxClip;
  1036. };
  1037. typedef struct SoundSlopeAndInterceptRecord SoundSlopeAndInterceptRecord;
  1038. typedef SoundSlopeAndInterceptRecord * SoundSlopeAndInterceptPtr;
  1039. /*private thing to use as a reference to a Sound Converter*/
  1040. typedef struct OpaqueSoundConverter* SoundConverter;
  1041. /*callback routine to provide data to the Sound Converter*/
  1042. typedef CALLBACK_API( Boolean , SoundConverterFillBufferDataProcPtr )(SoundComponentDataPtr *data, void *refCon);
  1043. typedef STACK_UPP_TYPE(SoundConverterFillBufferDataProcPtr) SoundConverterFillBufferDataUPP;
  1044. /*private thing to use as a reference to a Sound Source*/
  1045. typedef struct OpaqueSoundSource* SoundSource;
  1046. typedef SoundSource * SoundSourcePtr;
  1047. struct SoundComponentLink {
  1048. ComponentDescription description; /*Describes the sound component*/
  1049. SoundSource mixerID; /*Reserved by Apple*/
  1050. SoundSource * linkID; /*Reserved by Apple*/
  1051. };
  1052. typedef struct SoundComponentLink SoundComponentLink;
  1053. typedef SoundComponentLink * SoundComponentLinkPtr;
  1054. struct AudioInfo {
  1055. long capabilitiesFlags; /*Describes device capabilities*/
  1056. long reserved; /*Reserved by Apple*/
  1057. unsigned short numVolumeSteps; /*Number of significant increments between min and max volume*/
  1058. };
  1059. typedef struct AudioInfo AudioInfo;
  1060. typedef AudioInfo * AudioInfoPtr;
  1061. struct AudioFormatAtom {
  1062. long size; /* = sizeof(AudioFormatAtom)*/
  1063. OSType atomType; /* = kAudioFormatAtomType*/
  1064. OSType format;
  1065. };
  1066. typedef struct AudioFormatAtom AudioFormatAtom;
  1067. typedef AudioFormatAtom * AudioFormatAtomPtr;
  1068. struct AudioEndianAtom {
  1069. long size; /* = sizeof(AudioEndianAtom)*/
  1070. OSType atomType; /* = kAudioEndianAtomType*/
  1071. short littleEndian;
  1072. };
  1073. typedef struct AudioEndianAtom AudioEndianAtom;
  1074. typedef AudioEndianAtom * AudioEndianAtomPtr;
  1075. struct AudioTerminatorAtom {
  1076. long size; /* = sizeof(AudioTerminatorAtom)*/
  1077. OSType atomType; /* = kAudioTerminatorAtomType*/
  1078. };
  1079. typedef struct AudioTerminatorAtom AudioTerminatorAtom;
  1080. typedef AudioTerminatorAtom * AudioTerminatorAtomPtr;
  1081. struct LevelMeterInfo {
  1082. short numChannels; /* mono or stereo source*/
  1083. UInt8 leftMeter; /* 0-255 range*/
  1084. UInt8 rightMeter; /* 0-255 range*/
  1085. };
  1086. typedef struct LevelMeterInfo LevelMeterInfo;
  1087. typedef LevelMeterInfo * LevelMeterInfoPtr;
  1088. struct EQSpectrumBandsRecord {
  1089. short count;
  1090. UnsignedFixedPtr frequency; /* pointer to array of frequencies*/
  1091. };
  1092. typedef struct EQSpectrumBandsRecord EQSpectrumBandsRecord;
  1093. typedef EQSpectrumBandsRecord * EQSpectrumBandsRecordPtr;
  1094. enum {
  1095. kSoundAudioCodecPropertyWritableFlag = 1L << 0
  1096. };
  1097. struct SoundAudioCodecPropertyRequestParams {
  1098. UInt32 propertyClass;
  1099. UInt32 propertyID;
  1100. UInt32 propertyDataSize; /* out -- GetPropertyInfo, in/out -- GetProperty, in -- SetProperty*/
  1101. void * propertyData; /* in -- GetPropertyInfo, GetProperty, SetProperty*/
  1102. UInt32 propertyRequestFlags; /* out -- GetPropertyInfo*/
  1103. UInt32 propertyDataType; /* out -- GetPropertyInfo, often 0*/
  1104. ComponentResult propertyRequestResult; /* out -- GetPropertyInfo, GetProperty, SetProperty*/
  1105. };
  1106. typedef struct SoundAudioCodecPropertyRequestParams SoundAudioCodecPropertyRequestParams;
  1107. /* Sound Input Structures*/
  1108. typedef struct SPB SPB;
  1109. typedef SPB * SPBPtr;
  1110. /*user procedures called by sound input routines*/
  1111. typedef CALLBACK_API_REGISTER68K( void , SIInterruptProcPtr, (SPBPtr inParamPtr, Ptr dataBuffer, short peakAmplitude, long sampleSize) );
  1112. typedef CALLBACK_API( void , SICompletionProcPtr )(SPBPtr inParamPtr);
  1113. typedef REGISTER_UPP_TYPE(SIInterruptProcPtr) SIInterruptUPP;
  1114. typedef STACK_UPP_TYPE(SICompletionProcPtr) SICompletionUPP;
  1115. /*Sound Input Parameter Block*/
  1116. struct SPB {
  1117. long inRefNum; /*reference number of sound input device*/
  1118. unsigned long count; /*number of bytes to record*/
  1119. unsigned long milliseconds; /*number of milliseconds to record*/
  1120. unsigned long bufferLength; /*length of buffer in bytes*/
  1121. Ptr bufferPtr; /*buffer to store sound data in*/
  1122. SICompletionUPP completionRoutine; /*completion routine*/
  1123. SIInterruptUPP interruptRoutine; /*interrupt routine*/
  1124. long userLong; /*user-defined field*/
  1125. OSErr error; /*error*/
  1126. long unused1; /*reserved - must be zero*/
  1127. };
  1128. /*
  1129. * NewSoundParamUPP()
  1130. *
  1131. * Availability:
  1132. * Non-Carbon CFM: available as macro/inline
  1133. * CarbonLib: in CarbonLib 1.0 and later
  1134. * Mac OS X: in version 10.0 and later
  1135. */
  1136. EXTERN_API_C( SoundParamUPP )
  1137. NewSoundParamUPP(SoundParamProcPtr userRoutine);
  1138. #if !OPAQUE_UPP_TYPES
  1139. enum { uppSoundParamProcInfo = 0x000000D0 }; /* pascal 1_byte Func(4_bytes) */
  1140. #ifdef __cplusplus
  1141. inline DEFINE_API_C(SoundParamUPP) NewSoundParamUPP(SoundParamProcPtr userRoutine) { return (SoundParamUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSoundParamProcInfo, GetCurrentArchitecture()); }
  1142. #else
  1143. #define NewSoundParamUPP(userRoutine) (SoundParamUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSoundParamProcInfo, GetCurrentArchitecture())
  1144. #endif
  1145. #endif
  1146. /*
  1147. * NewSoundConverterFillBufferDataUPP()
  1148. *
  1149. * Availability:
  1150. * Non-Carbon CFM: available as macro/inline
  1151. * CarbonLib: in CarbonLib 1.1 and later
  1152. * Mac OS X: in version 10.0 and later
  1153. */
  1154. EXTERN_API_C( SoundConverterFillBufferDataUPP )
  1155. NewSoundConverterFillBufferDataUPP(SoundConverterFillBufferDataProcPtr userRoutine);
  1156. #if !OPAQUE_UPP_TYPES
  1157. enum { uppSoundConverterFillBufferDataProcInfo = 0x000003D0 }; /* pascal 1_byte Func(4_bytes, 4_bytes) */
  1158. #ifdef __cplusplus
  1159. inline DEFINE_API_C(SoundConverterFillBufferDataUPP) NewSoundConverterFillBufferDataUPP(SoundConverterFillBufferDataProcPtr userRoutine) { return (SoundConverterFillBufferDataUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSoundConverterFillBufferDataProcInfo, GetCurrentArchitecture()); }
  1160. #else
  1161. #define NewSoundConverterFillBufferDataUPP(userRoutine) (SoundConverterFillBufferDataUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSoundConverterFillBufferDataProcInfo, GetCurrentArchitecture())
  1162. #endif
  1163. #endif
  1164. /*
  1165. * NewSIInterruptUPP()
  1166. *
  1167. * Availability:
  1168. * Non-Carbon CFM: available as macro/inline
  1169. * CarbonLib: in CarbonLib 1.0 and later
  1170. * Mac OS X: in version 10.0 and later
  1171. */
  1172. EXTERN_API_C( SIInterruptUPP )
  1173. NewSIInterruptUPP(SIInterruptProcPtr userRoutine);
  1174. #if !OPAQUE_UPP_TYPES
  1175. enum { uppSIInterruptProcInfo = 0x1C579802 }; /* register no_return_value Func(4_bytes:A0, 4_bytes:A1, 2_bytes:D0, 4_bytes:D1) */
  1176. #ifdef __cplusplus
  1177. inline DEFINE_API_C(SIInterruptUPP) NewSIInterruptUPP(SIInterruptProcPtr userRoutine) { return (SIInterruptUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSIInterruptProcInfo, GetCurrentArchitecture()); }
  1178. #else
  1179. #define NewSIInterruptUPP(userRoutine) (SIInterruptUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSIInterruptProcInfo, GetCurrentArchitecture())
  1180. #endif
  1181. #endif
  1182. /*
  1183. * NewSICompletionUPP()
  1184. *
  1185. * Availability:
  1186. * Non-Carbon CFM: available as macro/inline
  1187. * CarbonLib: in CarbonLib 1.0 and later
  1188. * Mac OS X: in version 10.0 and later
  1189. */
  1190. EXTERN_API_C( SICompletionUPP )
  1191. NewSICompletionUPP(SICompletionProcPtr userRoutine);
  1192. #if !OPAQUE_UPP_TYPES
  1193. enum { uppSICompletionProcInfo = 0x000000C0 }; /* pascal no_return_value Func(4_bytes) */
  1194. #ifdef __cplusplus
  1195. inline DEFINE_API_C(SICompletionUPP) NewSICompletionUPP(SICompletionProcPtr userRoutine) { return (SICompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSICompletionProcInfo, GetCurrentArchitecture()); }
  1196. #else
  1197. #define NewSICompletionUPP(userRoutine) (SICompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSICompletionProcInfo, GetCurrentArchitecture())
  1198. #endif
  1199. #endif
  1200. /*
  1201. * DisposeSoundParamUPP()
  1202. *
  1203. * Availability:
  1204. * Non-Carbon CFM: available as macro/inline
  1205. * CarbonLib: in CarbonLib 1.0 and later
  1206. * Mac OS X: in version 10.0 and later
  1207. */
  1208. EXTERN_API_C( void )
  1209. DisposeSoundParamUPP(SoundParamUPP userUPP);
  1210. #if !OPAQUE_UPP_TYPES
  1211. #ifdef __cplusplus
  1212. inline DEFINE_API_C(void) DisposeSoundParamUPP(SoundParamUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1213. #else
  1214. #define DisposeSoundParamUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1215. #endif
  1216. #endif
  1217. /*
  1218. * DisposeSoundConverterFillBufferDataUPP()
  1219. *
  1220. * Availability:
  1221. * Non-Carbon CFM: available as macro/inline
  1222. * CarbonLib: in CarbonLib 1.1 and later
  1223. * Mac OS X: in version 10.0 and later
  1224. */
  1225. EXTERN_API_C( void )
  1226. DisposeSoundConverterFillBufferDataUPP(SoundConverterFillBufferDataUPP userUPP);
  1227. #if !OPAQUE_UPP_TYPES
  1228. #ifdef __cplusplus
  1229. inline DEFINE_API_C(void) DisposeSoundConverterFillBufferDataUPP(SoundConverterFillBufferDataUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1230. #else
  1231. #define DisposeSoundConverterFillBufferDataUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1232. #endif
  1233. #endif
  1234. /*
  1235. * DisposeSIInterruptUPP()
  1236. *
  1237. * Availability:
  1238. * Non-Carbon CFM: available as macro/inline
  1239. * CarbonLib: in CarbonLib 1.0 and later
  1240. * Mac OS X: in version 10.0 and later
  1241. */
  1242. EXTERN_API_C( void )
  1243. DisposeSIInterruptUPP(SIInterruptUPP userUPP);
  1244. #if !OPAQUE_UPP_TYPES
  1245. #ifdef __cplusplus
  1246. inline DEFINE_API_C(void) DisposeSIInterruptUPP(SIInterruptUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1247. #else
  1248. #define DisposeSIInterruptUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1249. #endif
  1250. #endif
  1251. /*
  1252. * DisposeSICompletionUPP()
  1253. *
  1254. * Availability:
  1255. * Non-Carbon CFM: available as macro/inline
  1256. * CarbonLib: in CarbonLib 1.0 and later
  1257. * Mac OS X: in version 10.0 and later
  1258. */
  1259. EXTERN_API_C( void )
  1260. DisposeSICompletionUPP(SICompletionUPP userUPP);
  1261. #if !OPAQUE_UPP_TYPES
  1262. #ifdef __cplusplus
  1263. inline DEFINE_API_C(void) DisposeSICompletionUPP(SICompletionUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1264. #else
  1265. #define DisposeSICompletionUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1266. #endif
  1267. #endif
  1268. /*
  1269. * InvokeSoundParamUPP()
  1270. *
  1271. * Availability:
  1272. * Non-Carbon CFM: available as macro/inline
  1273. * CarbonLib: in CarbonLib 1.0 and later
  1274. * Mac OS X: in version 10.0 and later
  1275. */
  1276. EXTERN_API_C( Boolean )
  1277. InvokeSoundParamUPP(
  1278. SoundParamBlockPtr * pb,
  1279. SoundParamUPP userUPP);
  1280. #if !OPAQUE_UPP_TYPES
  1281. #ifdef __cplusplus
  1282. inline DEFINE_API_C(Boolean) InvokeSoundParamUPP(SoundParamBlockPtr * pb, SoundParamUPP userUPP) { return (Boolean)CALL_ONE_PARAMETER_UPP(userUPP, uppSoundParamProcInfo, pb); }
  1283. #else
  1284. #define InvokeSoundParamUPP(pb, userUPP) (Boolean)CALL_ONE_PARAMETER_UPP((userUPP), uppSoundParamProcInfo, (pb))
  1285. #endif
  1286. #endif
  1287. /*
  1288. * InvokeSoundConverterFillBufferDataUPP()
  1289. *
  1290. * Availability:
  1291. * Non-Carbon CFM: available as macro/inline
  1292. * CarbonLib: in CarbonLib 1.1 and later
  1293. * Mac OS X: in version 10.0 and later
  1294. */
  1295. EXTERN_API_C( Boolean )
  1296. InvokeSoundConverterFillBufferDataUPP(
  1297. SoundComponentDataPtr * data,
  1298. void * refCon,
  1299. SoundConverterFillBufferDataUPP userUPP);
  1300. #if !OPAQUE_UPP_TYPES
  1301. #ifdef __cplusplus
  1302. inline DEFINE_API_C(Boolean) InvokeSoundConverterFillBufferDataUPP(SoundComponentDataPtr * data, void * refCon, SoundConverterFillBufferDataUPP userUPP) { return (Boolean)CALL_TWO_PARAMETER_UPP(userUPP, uppSoundConverterFillBufferDataProcInfo, data, refCon); }
  1303. #else
  1304. #define InvokeSoundConverterFillBufferDataUPP(data, refCon, userUPP) (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppSoundConverterFillBufferDataProcInfo, (data), (refCon))
  1305. #endif
  1306. #endif
  1307. /*
  1308. * InvokeSIInterruptUPP()
  1309. *
  1310. * Availability:
  1311. * Non-Carbon CFM: available as macro/inline
  1312. * CarbonLib: in CarbonLib 1.0 and later
  1313. * Mac OS X: in version 10.0 and later
  1314. */
  1315. EXTERN_API_C( void )
  1316. InvokeSIInterruptUPP(
  1317. SPBPtr inParamPtr,
  1318. Ptr dataBuffer,
  1319. short peakAmplitude,
  1320. long sampleSize,
  1321. SIInterruptUPP userUPP);
  1322. #if !OPAQUE_UPP_TYPES && (!TARGET_OS_MAC || !TARGET_CPU_68K || TARGET_RT_MAC_CFM)
  1323. #ifdef __cplusplus
  1324. inline DEFINE_API_C(void) InvokeSIInterruptUPP(SPBPtr inParamPtr, Ptr dataBuffer, short peakAmplitude, long sampleSize, SIInterruptUPP userUPP) { CALL_FOUR_PARAMETER_UPP(userUPP, uppSIInterruptProcInfo, inParamPtr, dataBuffer, peakAmplitude, sampleSize); }
  1325. #else
  1326. #define InvokeSIInterruptUPP(inParamPtr, dataBuffer, peakAmplitude, sampleSize, userUPP) CALL_FOUR_PARAMETER_UPP((userUPP), uppSIInterruptProcInfo, (inParamPtr), (dataBuffer), (peakAmplitude), (sampleSize))
  1327. #endif
  1328. #endif
  1329. /*
  1330. * InvokeSICompletionUPP()
  1331. *
  1332. * Availability:
  1333. * Non-Carbon CFM: available as macro/inline
  1334. * CarbonLib: in CarbonLib 1.0 and later
  1335. * Mac OS X: in version 10.0 and later
  1336. */
  1337. EXTERN_API_C( void )
  1338. InvokeSICompletionUPP(
  1339. SPBPtr inParamPtr,
  1340. SICompletionUPP userUPP);
  1341. #if !OPAQUE_UPP_TYPES
  1342. #ifdef __cplusplus
  1343. inline DEFINE_API_C(void) InvokeSICompletionUPP(SPBPtr inParamPtr, SICompletionUPP userUPP) { CALL_ONE_PARAMETER_UPP(userUPP, uppSICompletionProcInfo, inParamPtr); }
  1344. #else
  1345. #define InvokeSICompletionUPP(inParamPtr, userUPP) CALL_ONE_PARAMETER_UPP((userUPP), uppSICompletionProcInfo, (inParamPtr))
  1346. #endif
  1347. #endif
  1348. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  1349. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  1350. #define NewSoundParamProc(userRoutine) NewSoundParamUPP(userRoutine)
  1351. #define NewSoundConverterFillBufferDataProc(userRoutine) NewSoundConverterFillBufferDataUPP(userRoutine)
  1352. #define NewSIInterruptProc(userRoutine) NewSIInterruptUPP(userRoutine)
  1353. #define NewSICompletionProc(userRoutine) NewSICompletionUPP(userRoutine)
  1354. #define CallSoundParamProc(userRoutine, pb) InvokeSoundParamUPP(pb, userRoutine)
  1355. #define CallSoundConverterFillBufferDataProc(userRoutine, data, refCon) InvokeSoundConverterFillBufferDataUPP(data, refCon, userRoutine)
  1356. #define CallSIInterruptProc(userRoutine, inParamPtr, dataBuffer, peakAmplitude, sampleSize) InvokeSIInterruptUPP(inParamPtr, dataBuffer, peakAmplitude, sampleSize, userRoutine)
  1357. #define CallSICompletionProc(userRoutine, inParamPtr) InvokeSICompletionUPP(inParamPtr, userRoutine)
  1358. #endif /* CALL_NOT_IN_CARBON */
  1359. typedef CALLBACK_API( void , FilePlayCompletionProcPtr )(SndChannelPtr chan);
  1360. typedef STACK_UPP_TYPE(FilePlayCompletionProcPtr) FilePlayCompletionUPP;
  1361. #if CALL_NOT_IN_CARBON
  1362. /*
  1363. * NewFilePlayCompletionUPP()
  1364. *
  1365. * Availability:
  1366. * Non-Carbon CFM: available as macro/inline
  1367. * CarbonLib: not available
  1368. * Mac OS X: not available
  1369. */
  1370. EXTERN_API_C( FilePlayCompletionUPP )
  1371. NewFilePlayCompletionUPP(FilePlayCompletionProcPtr userRoutine);
  1372. #if !OPAQUE_UPP_TYPES
  1373. enum { uppFilePlayCompletionProcInfo = 0x000000C0 }; /* pascal no_return_value Func(4_bytes) */
  1374. #ifdef __cplusplus
  1375. inline DEFINE_API_C(FilePlayCompletionUPP) NewFilePlayCompletionUPP(FilePlayCompletionProcPtr userRoutine) { return (FilePlayCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFilePlayCompletionProcInfo, GetCurrentArchitecture()); }
  1376. #else
  1377. #define NewFilePlayCompletionUPP(userRoutine) (FilePlayCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFilePlayCompletionProcInfo, GetCurrentArchitecture())
  1378. #endif
  1379. #endif
  1380. /*
  1381. * DisposeFilePlayCompletionUPP()
  1382. *
  1383. * Availability:
  1384. * Non-Carbon CFM: available as macro/inline
  1385. * CarbonLib: not available
  1386. * Mac OS X: not available
  1387. */
  1388. EXTERN_API_C( void )
  1389. DisposeFilePlayCompletionUPP(FilePlayCompletionUPP userUPP);
  1390. #if !OPAQUE_UPP_TYPES
  1391. #ifdef __cplusplus
  1392. inline DEFINE_API_C(void) DisposeFilePlayCompletionUPP(FilePlayCompletionUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1393. #else
  1394. #define DisposeFilePlayCompletionUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1395. #endif
  1396. #endif
  1397. /*
  1398. * InvokeFilePlayCompletionUPP()
  1399. *
  1400. * Availability:
  1401. * Non-Carbon CFM: available as macro/inline
  1402. * CarbonLib: not available
  1403. * Mac OS X: not available
  1404. */
  1405. EXTERN_API_C( void )
  1406. InvokeFilePlayCompletionUPP(
  1407. SndChannelPtr chan,
  1408. FilePlayCompletionUPP userUPP);
  1409. #if !OPAQUE_UPP_TYPES
  1410. #ifdef __cplusplus
  1411. inline DEFINE_API_C(void) InvokeFilePlayCompletionUPP(SndChannelPtr chan, FilePlayCompletionUPP userUPP) { CALL_ONE_PARAMETER_UPP(userUPP, uppFilePlayCompletionProcInfo, chan); }
  1412. #else
  1413. #define InvokeFilePlayCompletionUPP(chan, userUPP) CALL_ONE_PARAMETER_UPP((userUPP), uppFilePlayCompletionProcInfo, (chan))
  1414. #endif
  1415. #endif
  1416. #endif /* CALL_NOT_IN_CARBON */
  1417. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  1418. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  1419. #define NewFilePlayCompletionProc(userRoutine) NewFilePlayCompletionUPP(userRoutine)
  1420. #define CallFilePlayCompletionProc(userRoutine, chan) InvokeFilePlayCompletionUPP(chan, userRoutine)
  1421. #endif /* CALL_NOT_IN_CARBON */
  1422. /*
  1423. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1424. prototypes
  1425. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1426. */
  1427. /* Sound Manager routines */
  1428. /*
  1429. * SysBeep()
  1430. *
  1431. * Availability:
  1432. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1433. * CarbonLib: in CarbonLib 1.0 and later
  1434. * Mac OS X: in version 10.0 and later
  1435. */
  1436. EXTERN_API( void )
  1437. SysBeep(short duration) ONEWORDINLINE(0xA9C8);
  1438. /*
  1439. * SndDoCommand()
  1440. *
  1441. * Availability:
  1442. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1443. * CarbonLib: in CarbonLib 1.0 and later
  1444. * Mac OS X: in version 10.0 and later
  1445. */
  1446. EXTERN_API( OSErr )
  1447. SndDoCommand(
  1448. SndChannelPtr chan,
  1449. const SndCommand * cmd,
  1450. Boolean noWait) ONEWORDINLINE(0xA803);
  1451. /*
  1452. * SndDoImmediate()
  1453. *
  1454. * Availability:
  1455. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1456. * CarbonLib: in CarbonLib 1.0 and later
  1457. * Mac OS X: in version 10.0 and later
  1458. */
  1459. EXTERN_API( OSErr )
  1460. SndDoImmediate(
  1461. SndChannelPtr chan,
  1462. const SndCommand * cmd) ONEWORDINLINE(0xA804);
  1463. /*
  1464. * SndNewChannel()
  1465. *
  1466. * Availability:
  1467. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1468. * CarbonLib: in CarbonLib 1.0 and later
  1469. * Mac OS X: in version 10.0 and later
  1470. */
  1471. EXTERN_API( OSErr )
  1472. SndNewChannel(
  1473. SndChannelPtr * chan,
  1474. short synth,
  1475. long init,
  1476. SndCallBackUPP userRoutine) ONEWORDINLINE(0xA807);
  1477. /*
  1478. * SndDisposeChannel()
  1479. *
  1480. * Availability:
  1481. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1482. * CarbonLib: in CarbonLib 1.0 and later
  1483. * Mac OS X: in version 10.0 and later
  1484. */
  1485. EXTERN_API( OSErr )
  1486. SndDisposeChannel(
  1487. SndChannelPtr chan,
  1488. Boolean quietNow) ONEWORDINLINE(0xA801);
  1489. /*
  1490. * SndPlay()
  1491. *
  1492. * Availability:
  1493. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1494. * CarbonLib: in CarbonLib 1.0 and later
  1495. * Mac OS X: in version 10.0 and later
  1496. */
  1497. EXTERN_API( OSErr )
  1498. SndPlay(
  1499. SndChannelPtr chan,
  1500. SndListHandle sndHandle,
  1501. Boolean async) ONEWORDINLINE(0xA805);
  1502. #if OLDROUTINENAMES
  1503. #if CALL_NOT_IN_CARBON
  1504. /*
  1505. * SndAddModifier()
  1506. *
  1507. * Availability:
  1508. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1509. * CarbonLib: not available
  1510. * Mac OS X: not available
  1511. */
  1512. EXTERN_API( OSErr )
  1513. SndAddModifier(
  1514. SndChannelPtr chan,
  1515. Ptr modifier,
  1516. short id,
  1517. long init) ONEWORDINLINE(0xA802);
  1518. #endif /* CALL_NOT_IN_CARBON */
  1519. #endif /* OLDROUTINENAMES */
  1520. #if CALL_NOT_IN_CARBON
  1521. /*
  1522. * SndControl()
  1523. *
  1524. * Availability:
  1525. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1526. * CarbonLib: not available
  1527. * Mac OS X: not available
  1528. */
  1529. EXTERN_API( OSErr )
  1530. SndControl(
  1531. short id,
  1532. SndCommand * cmd) ONEWORDINLINE(0xA806);
  1533. /* Sound Manager 2.0 and later, uses _SoundDispatch */
  1534. #endif /* CALL_NOT_IN_CARBON */
  1535. /*
  1536. * SndSoundManagerVersion()
  1537. *
  1538. * Availability:
  1539. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1540. * CarbonLib: in CarbonLib 1.0 and later
  1541. * Mac OS X: in version 10.0 and later
  1542. */
  1543. EXTERN_API( NumVersion )
  1544. SndSoundManagerVersion(void) FOURWORDINLINE(0x203C, 0x000C, 0x0008, 0xA800);
  1545. #if CALL_NOT_IN_CARBON
  1546. /*
  1547. * SndStartFilePlay()
  1548. *
  1549. * Availability:
  1550. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1551. * CarbonLib: not available
  1552. * Mac OS X: not available
  1553. */
  1554. EXTERN_API( OSErr )
  1555. SndStartFilePlay(
  1556. SndChannelPtr chan,
  1557. short fRefNum,
  1558. short resNum,
  1559. long bufferSize,
  1560. void * theBuffer,
  1561. AudioSelectionPtr theSelection,
  1562. FilePlayCompletionUPP theCompletion,
  1563. Boolean async) FOURWORDINLINE(0x203C, 0x0D00, 0x0008, 0xA800);
  1564. /*
  1565. * SndPauseFilePlay()
  1566. *
  1567. * Availability:
  1568. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1569. * CarbonLib: not available
  1570. * Mac OS X: not available
  1571. */
  1572. EXTERN_API( OSErr )
  1573. SndPauseFilePlay(SndChannelPtr chan) FOURWORDINLINE(0x203C, 0x0204, 0x0008, 0xA800);
  1574. /*
  1575. * SndStopFilePlay()
  1576. *
  1577. * Availability:
  1578. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1579. * CarbonLib: not available
  1580. * Mac OS X: not available
  1581. */
  1582. EXTERN_API( OSErr )
  1583. SndStopFilePlay(
  1584. SndChannelPtr chan,
  1585. Boolean quietNow) FOURWORDINLINE(0x203C, 0x0308, 0x0008, 0xA800);
  1586. #endif /* CALL_NOT_IN_CARBON */
  1587. /*
  1588. * SndChannelStatus()
  1589. *
  1590. * Availability:
  1591. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1592. * CarbonLib: in CarbonLib 1.0 and later
  1593. * Mac OS X: in version 10.0 and later
  1594. */
  1595. EXTERN_API( OSErr )
  1596. SndChannelStatus(
  1597. SndChannelPtr chan,
  1598. short theLength,
  1599. SCStatusPtr theStatus) FOURWORDINLINE(0x203C, 0x0510, 0x0008, 0xA800);
  1600. /*
  1601. * SndManagerStatus()
  1602. *
  1603. * Availability:
  1604. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1605. * CarbonLib: in CarbonLib 1.0 and later
  1606. * Mac OS X: in version 10.0 and later
  1607. */
  1608. EXTERN_API( OSErr )
  1609. SndManagerStatus(
  1610. short theLength,
  1611. SMStatusPtr theStatus) FOURWORDINLINE(0x203C, 0x0314, 0x0008, 0xA800);
  1612. /*
  1613. * SndGetSysBeepState()
  1614. *
  1615. * Availability:
  1616. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1617. * CarbonLib: in CarbonLib 1.0 and later
  1618. * Mac OS X: in version 10.0 and later
  1619. */
  1620. EXTERN_API( void )
  1621. SndGetSysBeepState(short * sysBeepState) FOURWORDINLINE(0x203C, 0x0218, 0x0008, 0xA800);
  1622. /*
  1623. * SndSetSysBeepState()
  1624. *
  1625. * Availability:
  1626. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1627. * CarbonLib: in CarbonLib 1.0 and later
  1628. * Mac OS X: in version 10.0 and later
  1629. */
  1630. EXTERN_API( OSErr )
  1631. SndSetSysBeepState(short sysBeepState) FOURWORDINLINE(0x203C, 0x011C, 0x0008, 0xA800);
  1632. #if CALL_NOT_IN_CARBON
  1633. /*
  1634. * SndPlayDoubleBuffer()
  1635. *
  1636. * Availability:
  1637. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1638. * CarbonLib: not available
  1639. * Mac OS X: not available
  1640. */
  1641. EXTERN_API( OSErr )
  1642. SndPlayDoubleBuffer(
  1643. SndChannelPtr chan,
  1644. SndDoubleBufferHeaderPtr theParams) FOURWORDINLINE(0x203C, 0x0420, 0x0008, 0xA800);
  1645. /* MACE compression routines, uses _SoundDispatch */
  1646. /*
  1647. * MACEVersion()
  1648. *
  1649. * Availability:
  1650. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1651. * CarbonLib: not available
  1652. * Mac OS X: not available
  1653. */
  1654. EXTERN_API( NumVersion )
  1655. MACEVersion(void) FOURWORDINLINE(0x203C, 0x0000, 0x0010, 0xA800);
  1656. /*
  1657. * Comp3to1()
  1658. *
  1659. * Availability:
  1660. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1661. * CarbonLib: not available
  1662. * Mac OS X: not available
  1663. */
  1664. EXTERN_API( void )
  1665. Comp3to1(
  1666. const void * inBuffer,
  1667. void * outBuffer,
  1668. unsigned long cnt,
  1669. StateBlockPtr inState,
  1670. StateBlockPtr outState,
  1671. unsigned long numChannels,
  1672. unsigned long whichChannel) FOURWORDINLINE(0x203C, 0x0004, 0x0010, 0xA800);
  1673. /*
  1674. * Exp1to3()
  1675. *
  1676. * Availability:
  1677. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1678. * CarbonLib: not available
  1679. * Mac OS X: not available
  1680. */
  1681. EXTERN_API( void )
  1682. Exp1to3(
  1683. const void * inBuffer,
  1684. void * outBuffer,
  1685. unsigned long cnt,
  1686. StateBlockPtr inState,
  1687. StateBlockPtr outState,
  1688. unsigned long numChannels,
  1689. unsigned long whichChannel) FOURWORDINLINE(0x203C, 0x0008, 0x0010, 0xA800);
  1690. /*
  1691. * Comp6to1()
  1692. *
  1693. * Availability:
  1694. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1695. * CarbonLib: not available
  1696. * Mac OS X: not available
  1697. */
  1698. EXTERN_API( void )
  1699. Comp6to1(
  1700. const void * inBuffer,
  1701. void * outBuffer,
  1702. unsigned long cnt,
  1703. StateBlockPtr inState,
  1704. StateBlockPtr outState,
  1705. unsigned long numChannels,
  1706. unsigned long whichChannel) FOURWORDINLINE(0x203C, 0x000C, 0x0010, 0xA800);
  1707. /*
  1708. * Exp1to6()
  1709. *
  1710. * Availability:
  1711. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1712. * CarbonLib: not available
  1713. * Mac OS X: not available
  1714. */
  1715. EXTERN_API( void )
  1716. Exp1to6(
  1717. const void * inBuffer,
  1718. void * outBuffer,
  1719. unsigned long cnt,
  1720. StateBlockPtr inState,
  1721. StateBlockPtr outState,
  1722. unsigned long numChannels,
  1723. unsigned long whichChannel) FOURWORDINLINE(0x203C, 0x0010, 0x0010, 0xA800);
  1724. /* Sound Manager 3.0 and later calls, uses _SoundDispatch */
  1725. #endif /* CALL_NOT_IN_CARBON */
  1726. /*
  1727. * GetSysBeepVolume()
  1728. *
  1729. * Availability:
  1730. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1731. * CarbonLib: in CarbonLib 1.0 and later
  1732. * Mac OS X: in version 10.0 and later
  1733. */
  1734. EXTERN_API( OSErr )
  1735. GetSysBeepVolume(long * level) FOURWORDINLINE(0x203C, 0x0224, 0x0018, 0xA800);
  1736. /*
  1737. * SetSysBeepVolume()
  1738. *
  1739. * Availability:
  1740. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1741. * CarbonLib: in CarbonLib 1.0 and later
  1742. * Mac OS X: in version 10.0 and later
  1743. */
  1744. EXTERN_API( OSErr )
  1745. SetSysBeepVolume(long level) FOURWORDINLINE(0x203C, 0x0228, 0x0018, 0xA800);
  1746. /*
  1747. * GetDefaultOutputVolume()
  1748. *
  1749. * Availability:
  1750. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1751. * CarbonLib: in CarbonLib 1.0 and later
  1752. * Mac OS X: in version 10.0 and later
  1753. */
  1754. EXTERN_API( OSErr )
  1755. GetDefaultOutputVolume(long * level) FOURWORDINLINE(0x203C, 0x022C, 0x0018, 0xA800);
  1756. /*
  1757. * SetDefaultOutputVolume()
  1758. *
  1759. * Availability:
  1760. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1761. * CarbonLib: in CarbonLib 1.0 and later
  1762. * Mac OS X: in version 10.0 and later
  1763. */
  1764. EXTERN_API( OSErr )
  1765. SetDefaultOutputVolume(long level) FOURWORDINLINE(0x203C, 0x0230, 0x0018, 0xA800);
  1766. /*
  1767. * GetSoundHeaderOffset()
  1768. *
  1769. * Availability:
  1770. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1771. * CarbonLib: in CarbonLib 1.0 and later
  1772. * Mac OS X: in version 10.0 and later
  1773. */
  1774. EXTERN_API( OSErr )
  1775. GetSoundHeaderOffset(
  1776. SndListHandle sndHandle,
  1777. long * offset) FOURWORDINLINE(0x203C, 0x0404, 0x0018, 0xA800);
  1778. /*
  1779. * UnsignedFixedMulDiv()
  1780. *
  1781. * Availability:
  1782. * Non-Carbon CFM: in SoundLib 3.0 and later
  1783. * CarbonLib: in CarbonLib 1.0 and later
  1784. * Mac OS X: not available
  1785. */
  1786. EXTERN_API( UnsignedFixed )
  1787. UnsignedFixedMulDiv(
  1788. UnsignedFixed value,
  1789. UnsignedFixed multiplier,
  1790. UnsignedFixed divisor) FOURWORDINLINE(0x203C, 0x060C, 0x0018, 0xA800);
  1791. /*
  1792. * GetCompressionInfo()
  1793. *
  1794. * Availability:
  1795. * Non-Carbon CFM: in SoundLib 3.0 and later
  1796. * CarbonLib: in CarbonLib 1.0 and later
  1797. * Mac OS X: in version 10.0 and later
  1798. */
  1799. EXTERN_API( OSErr )
  1800. GetCompressionInfo(
  1801. short compressionID,
  1802. OSType format,
  1803. short numChannels,
  1804. short sampleSize,
  1805. CompressionInfoPtr cp) FOURWORDINLINE(0x203C, 0x0710, 0x0018, 0xA800);
  1806. /*
  1807. * SetSoundPreference()
  1808. *
  1809. * Availability:
  1810. * Non-Carbon CFM: in SoundLib 3.0 and later
  1811. * CarbonLib: in CarbonLib 1.0 and later
  1812. * Mac OS X: in version 10.0 and later
  1813. */
  1814. EXTERN_API( OSErr )
  1815. SetSoundPreference(
  1816. OSType theType,
  1817. Str255 name,
  1818. Handle settings) FOURWORDINLINE(0x203C, 0x0634, 0x0018, 0xA800);
  1819. /*
  1820. * GetSoundPreference()
  1821. *
  1822. * Availability:
  1823. * Non-Carbon CFM: in SoundLib 3.0 and later
  1824. * CarbonLib: in CarbonLib 1.0 and later
  1825. * Mac OS X: in version 10.0 and later
  1826. */
  1827. EXTERN_API( OSErr )
  1828. GetSoundPreference(
  1829. OSType theType,
  1830. Str255 name,
  1831. Handle settings) FOURWORDINLINE(0x203C, 0x0638, 0x0018, 0xA800);
  1832. /*
  1833. * OpenMixerSoundComponent()
  1834. *
  1835. * Availability:
  1836. * Non-Carbon CFM: in SoundLib 3.0 and later
  1837. * CarbonLib: in CarbonLib 1.0 and later
  1838. * Mac OS X: in version 10.0 and later
  1839. */
  1840. EXTERN_API( OSErr )
  1841. OpenMixerSoundComponent(
  1842. SoundComponentDataPtr outputDescription,
  1843. long outputFlags,
  1844. ComponentInstance * mixerComponent) FOURWORDINLINE(0x203C, 0x0614, 0x0018, 0xA800);
  1845. /*
  1846. * CloseMixerSoundComponent()
  1847. *
  1848. * Availability:
  1849. * Non-Carbon CFM: in SoundLib 3.0 and later
  1850. * CarbonLib: in CarbonLib 1.0 and later
  1851. * Mac OS X: in version 10.0 and later
  1852. */
  1853. EXTERN_API( OSErr )
  1854. CloseMixerSoundComponent(ComponentInstance ci) FOURWORDINLINE(0x203C, 0x0218, 0x0018, 0xA800);
  1855. /* Sound Manager 3.1 and later calls, uses _SoundDispatch */
  1856. /*
  1857. * SndGetInfo()
  1858. *
  1859. * Availability:
  1860. * Non-Carbon CFM: in SoundLib 3.1 and later
  1861. * CarbonLib: in CarbonLib 1.0 and later
  1862. * Mac OS X: in version 10.0 and later
  1863. */
  1864. EXTERN_API( OSErr )
  1865. SndGetInfo(
  1866. SndChannelPtr chan,
  1867. OSType selector,
  1868. void * infoPtr) FOURWORDINLINE(0x203C, 0x063C, 0x0018, 0xA800);
  1869. /*
  1870. * SndSetInfo()
  1871. *
  1872. * Availability:
  1873. * Non-Carbon CFM: in SoundLib 3.1 and later
  1874. * CarbonLib: in CarbonLib 1.0 and later
  1875. * Mac OS X: in version 10.0 and later
  1876. */
  1877. EXTERN_API( OSErr )
  1878. SndSetInfo(
  1879. SndChannelPtr chan,
  1880. OSType selector,
  1881. const void * infoPtr) FOURWORDINLINE(0x203C, 0x0640, 0x0018, 0xA800);
  1882. /*
  1883. * GetSoundOutputInfo()
  1884. *
  1885. * Availability:
  1886. * Non-Carbon CFM: in SoundLib 3.1 and later
  1887. * CarbonLib: in CarbonLib 1.0 and later
  1888. * Mac OS X: in version 10.0 and later
  1889. */
  1890. EXTERN_API( OSErr )
  1891. GetSoundOutputInfo(
  1892. Component outputDevice,
  1893. OSType selector,
  1894. void * infoPtr) FOURWORDINLINE(0x203C, 0x0644, 0x0018, 0xA800);
  1895. /*
  1896. * SetSoundOutputInfo()
  1897. *
  1898. * Availability:
  1899. * Non-Carbon CFM: in SoundLib 3.1 and later
  1900. * CarbonLib: in CarbonLib 1.0 and later
  1901. * Mac OS X: in version 10.0 and later
  1902. */
  1903. EXTERN_API( OSErr )
  1904. SetSoundOutputInfo(
  1905. Component outputDevice,
  1906. OSType selector,
  1907. const void * infoPtr) FOURWORDINLINE(0x203C, 0x0648, 0x0018, 0xA800);
  1908. /* Sound Manager 3.2 and later calls, uses _SoundDispatch */
  1909. /*
  1910. * GetCompressionName()
  1911. *
  1912. * Availability:
  1913. * Non-Carbon CFM: in SoundLib 3.2 and later
  1914. * CarbonLib: in CarbonLib 1.0 and later
  1915. * Mac OS X: in version 10.0 and later
  1916. */
  1917. EXTERN_API( OSErr )
  1918. GetCompressionName(
  1919. OSType compressionType,
  1920. Str255 compressionName) FOURWORDINLINE(0x203C, 0x044C, 0x0018, 0xA800);
  1921. /*
  1922. * SoundConverterOpen()
  1923. *
  1924. * Availability:
  1925. * Non-Carbon CFM: in SoundLib 3.2 and later
  1926. * CarbonLib: in CarbonLib 1.0 and later
  1927. * Mac OS X: in version 10.0 and later
  1928. */
  1929. EXTERN_API( OSErr )
  1930. SoundConverterOpen(
  1931. const SoundComponentData * inputFormat,
  1932. const SoundComponentData * outputFormat,
  1933. SoundConverter * sc) FOURWORDINLINE(0x203C, 0x0650, 0x0018, 0xA800);
  1934. /*
  1935. * SoundConverterClose()
  1936. *
  1937. * Availability:
  1938. * Non-Carbon CFM: in SoundLib 3.2 and later
  1939. * CarbonLib: in CarbonLib 1.0 and later
  1940. * Mac OS X: in version 10.0 and later
  1941. */
  1942. EXTERN_API( OSErr )
  1943. SoundConverterClose(SoundConverter sc) FOURWORDINLINE(0x203C, 0x0254, 0x0018, 0xA800);
  1944. /*
  1945. * SoundConverterGetBufferSizes()
  1946. *
  1947. * Availability:
  1948. * Non-Carbon CFM: in SoundLib 3.2 and later
  1949. * CarbonLib: in CarbonLib 1.0 and later
  1950. * Mac OS X: in version 10.0 and later
  1951. */
  1952. EXTERN_API( OSErr )
  1953. SoundConverterGetBufferSizes(
  1954. SoundConverter sc,
  1955. unsigned long inputBytesTarget,
  1956. unsigned long * inputFrames,
  1957. unsigned long * inputBytes,
  1958. unsigned long * outputBytes) FOURWORDINLINE(0x203C, 0x0A58, 0x0018, 0xA800);
  1959. /*
  1960. * SoundConverterBeginConversion()
  1961. *
  1962. * Availability:
  1963. * Non-Carbon CFM: in SoundLib 3.2 and later
  1964. * CarbonLib: in CarbonLib 1.0 and later
  1965. * Mac OS X: in version 10.0 and later
  1966. */
  1967. EXTERN_API( OSErr )
  1968. SoundConverterBeginConversion(SoundConverter sc) FOURWORDINLINE(0x203C, 0x025C, 0x0018, 0xA800);
  1969. /*
  1970. * SoundConverterConvertBuffer()
  1971. *
  1972. * Availability:
  1973. * Non-Carbon CFM: in SoundLib 3.2 and later
  1974. * CarbonLib: in CarbonLib 1.0 and later
  1975. * Mac OS X: in version 10.0 and later
  1976. */
  1977. EXTERN_API( OSErr )
  1978. SoundConverterConvertBuffer(
  1979. SoundConverter sc,
  1980. const void * inputPtr,
  1981. unsigned long inputFrames,
  1982. void * outputPtr,
  1983. unsigned long * outputFrames,
  1984. unsigned long * outputBytes) FOURWORDINLINE(0x203C, 0x0C60, 0x0018, 0xA800);
  1985. /*
  1986. * SoundConverterEndConversion()
  1987. *
  1988. * Availability:
  1989. * Non-Carbon CFM: in SoundLib 3.2 and later
  1990. * CarbonLib: in CarbonLib 1.0 and later
  1991. * Mac OS X: in version 10.0 and later
  1992. */
  1993. EXTERN_API( OSErr )
  1994. SoundConverterEndConversion(
  1995. SoundConverter sc,
  1996. void * outputPtr,
  1997. unsigned long * outputFrames,
  1998. unsigned long * outputBytes) FOURWORDINLINE(0x203C, 0x0864, 0x0018, 0xA800);
  1999. /* Sound Manager 3.3 and later calls, uses _SoundDispatch */
  2000. /*
  2001. * SoundConverterGetInfo()
  2002. *
  2003. * Availability:
  2004. * Non-Carbon CFM: in SoundLib 3.3 and later
  2005. * CarbonLib: in CarbonLib 1.0 and later
  2006. * Mac OS X: in version 10.0 and later
  2007. */
  2008. EXTERN_API( OSErr )
  2009. SoundConverterGetInfo(
  2010. SoundConverter sc,
  2011. OSType selector,
  2012. void * infoPtr) FOURWORDINLINE(0x203C, 0x0668, 0x0018, 0xA800);
  2013. /*
  2014. * SoundConverterSetInfo()
  2015. *
  2016. * Availability:
  2017. * Non-Carbon CFM: in SoundLib 3.3 and later
  2018. * CarbonLib: in CarbonLib 1.0 and later
  2019. * Mac OS X: in version 10.0 and later
  2020. */
  2021. EXTERN_API( OSErr )
  2022. SoundConverterSetInfo(
  2023. SoundConverter sc,
  2024. OSType selector,
  2025. void * infoPtr) FOURWORDINLINE(0x203C, 0x066C, 0x0018, 0xA800);
  2026. /* Sound Manager 3.6 and later calls, uses _SoundDispatch */
  2027. /*
  2028. * SoundConverterFillBuffer()
  2029. *
  2030. * Availability:
  2031. * Non-Carbon CFM: in SoundLib 3.6 and later
  2032. * CarbonLib: in CarbonLib 1.1 and later
  2033. * Mac OS X: in version 10.0 and later
  2034. */
  2035. EXTERN_API( OSErr )
  2036. SoundConverterFillBuffer(
  2037. SoundConverter sc,
  2038. SoundConverterFillBufferDataUPP fillBufferDataUPP,
  2039. void * fillBufferDataRefCon,
  2040. void * outputBuffer,
  2041. unsigned long outputBufferByteSize,
  2042. unsigned long * bytesWritten,
  2043. unsigned long * framesWritten,
  2044. unsigned long * outputFlags) FOURWORDINLINE(0x203C, 0x1078, 0x0018, 0xA800);
  2045. /*
  2046. * SoundManagerGetInfo()
  2047. *
  2048. * Availability:
  2049. * Non-Carbon CFM: in SoundLib 3.6 and later
  2050. * CarbonLib: in CarbonLib 1.1 and later
  2051. * Mac OS X: in version 10.0 and later
  2052. */
  2053. EXTERN_API( OSErr )
  2054. SoundManagerGetInfo(
  2055. OSType selector,
  2056. void * infoPtr) FOURWORDINLINE(0x203C, 0x047C, 0x0018, 0xA800);
  2057. /*
  2058. * SoundManagerSetInfo()
  2059. *
  2060. * Availability:
  2061. * Non-Carbon CFM: in SoundLib 3.6 and later
  2062. * CarbonLib: in CarbonLib 1.1 and later
  2063. * Mac OS X: in version 10.0 and later
  2064. */
  2065. EXTERN_API( OSErr )
  2066. SoundManagerSetInfo(
  2067. OSType selector,
  2068. const void * infoPtr) FOURWORDINLINE(0x203C, 0x0480, 0x0018, 0xA800);
  2069. /*
  2070. Sound Component Functions
  2071. basic sound component functions
  2072. */
  2073. /*
  2074. * SoundComponentInitOutputDevice()
  2075. *
  2076. * Availability:
  2077. * Non-Carbon CFM: in SoundLib 3.0 and later
  2078. * CarbonLib: in CarbonLib 1.0 and later
  2079. * Mac OS X: in version 10.0 and later
  2080. */
  2081. EXTERN_API( ComponentResult )
  2082. SoundComponentInitOutputDevice(
  2083. ComponentInstance ti,
  2084. long actions) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  2085. /*
  2086. * SoundComponentSetSource()
  2087. *
  2088. * Availability:
  2089. * Non-Carbon CFM: in SoundLib 3.0 and later
  2090. * CarbonLib: in CarbonLib 1.0 and later
  2091. * Mac OS X: in version 10.0 and later
  2092. */
  2093. EXTERN_API( ComponentResult )
  2094. SoundComponentSetSource(
  2095. ComponentInstance ti,
  2096. SoundSource sourceID,
  2097. ComponentInstance source) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0002, 0x7000, 0xA82A);
  2098. /*
  2099. * SoundComponentGetSource()
  2100. *
  2101. * Availability:
  2102. * Non-Carbon CFM: in SoundLib 3.0 and later
  2103. * CarbonLib: in CarbonLib 1.0 and later
  2104. * Mac OS X: in version 10.0 and later
  2105. */
  2106. EXTERN_API( ComponentResult )
  2107. SoundComponentGetSource(
  2108. ComponentInstance ti,
  2109. SoundSource sourceID,
  2110. ComponentInstance * source) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);
  2111. /*
  2112. * SoundComponentGetSourceData()
  2113. *
  2114. * Availability:
  2115. * Non-Carbon CFM: in SoundLib 3.0 and later
  2116. * CarbonLib: in CarbonLib 1.0 and later
  2117. * Mac OS X: in version 10.0 and later
  2118. */
  2119. EXTERN_API( ComponentResult )
  2120. SoundComponentGetSourceData(
  2121. ComponentInstance ti,
  2122. SoundComponentDataPtr * sourceData) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  2123. /*
  2124. * SoundComponentSetOutput()
  2125. *
  2126. * Availability:
  2127. * Non-Carbon CFM: in SoundLib 3.0 and later
  2128. * CarbonLib: in CarbonLib 1.0 and later
  2129. * Mac OS X: in version 10.0 and later
  2130. */
  2131. EXTERN_API( ComponentResult )
  2132. SoundComponentSetOutput(
  2133. ComponentInstance ti,
  2134. SoundComponentDataPtr requested,
  2135. SoundComponentDataPtr * actual) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0005, 0x7000, 0xA82A);
  2136. /* junction methods for the mixer, must be called at non-interrupt level*/
  2137. /*
  2138. * SoundComponentAddSource()
  2139. *
  2140. * Availability:
  2141. * Non-Carbon CFM: in SoundLib 3.0 and later
  2142. * CarbonLib: in CarbonLib 1.0 and later
  2143. * Mac OS X: in version 10.0 and later
  2144. */
  2145. EXTERN_API( ComponentResult )
  2146. SoundComponentAddSource(
  2147. ComponentInstance ti,
  2148. SoundSource * sourceID) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0101, 0x7000, 0xA82A);
  2149. /*
  2150. * SoundComponentRemoveSource()
  2151. *
  2152. * Availability:
  2153. * Non-Carbon CFM: in SoundLib 3.0 and later
  2154. * CarbonLib: in CarbonLib 1.0 and later
  2155. * Mac OS X: in version 10.0 and later
  2156. */
  2157. EXTERN_API( ComponentResult )
  2158. SoundComponentRemoveSource(
  2159. ComponentInstance ti,
  2160. SoundSource sourceID) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0102, 0x7000, 0xA82A);
  2161. /* info methods*/
  2162. /*
  2163. * SoundComponentGetInfo()
  2164. *
  2165. * Availability:
  2166. * Non-Carbon CFM: in SoundLib 3.0 and later
  2167. * CarbonLib: in CarbonLib 1.0 and later
  2168. * Mac OS X: in version 10.0 and later
  2169. */
  2170. EXTERN_API( ComponentResult )
  2171. SoundComponentGetInfo(
  2172. ComponentInstance ti,
  2173. SoundSource sourceID,
  2174. OSType selector,
  2175. void * infoPtr) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0103, 0x7000, 0xA82A);
  2176. /*
  2177. * SoundComponentSetInfo()
  2178. *
  2179. * Availability:
  2180. * Non-Carbon CFM: in SoundLib 3.0 and later
  2181. * CarbonLib: in CarbonLib 1.0 and later
  2182. * Mac OS X: in version 10.0 and later
  2183. */
  2184. EXTERN_API( ComponentResult )
  2185. SoundComponentSetInfo(
  2186. ComponentInstance ti,
  2187. SoundSource sourceID,
  2188. OSType selector,
  2189. void * infoPtr) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0104, 0x7000, 0xA82A);
  2190. /* control methods*/
  2191. /*
  2192. * SoundComponentStartSource()
  2193. *
  2194. * Availability:
  2195. * Non-Carbon CFM: in SoundLib 3.0 and later
  2196. * CarbonLib: in CarbonLib 1.0 and later
  2197. * Mac OS X: in version 10.0 and later
  2198. */
  2199. EXTERN_API( ComponentResult )
  2200. SoundComponentStartSource(
  2201. ComponentInstance ti,
  2202. short count,
  2203. SoundSource * sources) FIVEWORDINLINE(0x2F3C, 0x0006, 0x0105, 0x7000, 0xA82A);
  2204. /*
  2205. * SoundComponentStopSource()
  2206. *
  2207. * Availability:
  2208. * Non-Carbon CFM: in SoundLib 3.0 and later
  2209. * CarbonLib: in CarbonLib 1.0 and later
  2210. * Mac OS X: in version 10.0 and later
  2211. */
  2212. EXTERN_API( ComponentResult )
  2213. SoundComponentStopSource(
  2214. ComponentInstance ti,
  2215. short count,
  2216. SoundSource * sources) FIVEWORDINLINE(0x2F3C, 0x0006, 0x0106, 0x7000, 0xA82A);
  2217. /*
  2218. * SoundComponentPauseSource()
  2219. *
  2220. * Availability:
  2221. * Non-Carbon CFM: in SoundLib 3.0 and later
  2222. * CarbonLib: in CarbonLib 1.0 and later
  2223. * Mac OS X: in version 10.0 and later
  2224. */
  2225. EXTERN_API( ComponentResult )
  2226. SoundComponentPauseSource(
  2227. ComponentInstance ti,
  2228. short count,
  2229. SoundSource * sources) FIVEWORDINLINE(0x2F3C, 0x0006, 0x0107, 0x7000, 0xA82A);
  2230. /*
  2231. * SoundComponentPlaySourceBuffer()
  2232. *
  2233. * Availability:
  2234. * Non-Carbon CFM: in SoundLib 3.0 and later
  2235. * CarbonLib: in CarbonLib 1.0 and later
  2236. * Mac OS X: in version 10.0 and later
  2237. */
  2238. EXTERN_API( ComponentResult )
  2239. SoundComponentPlaySourceBuffer(
  2240. ComponentInstance ti,
  2241. SoundSource sourceID,
  2242. SoundParamBlockPtr pb,
  2243. long actions) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0108, 0x7000, 0xA82A);
  2244. /* selectors for component calls */
  2245. enum {
  2246. kSoundComponentInitOutputDeviceSelect = 0x0001,
  2247. kSoundComponentSetSourceSelect = 0x0002,
  2248. kSoundComponentGetSourceSelect = 0x0003,
  2249. kSoundComponentGetSourceDataSelect = 0x0004,
  2250. kSoundComponentSetOutputSelect = 0x0005,
  2251. kSoundComponentAddSourceSelect = 0x0101,
  2252. kSoundComponentRemoveSourceSelect = 0x0102,
  2253. kSoundComponentGetInfoSelect = 0x0103,
  2254. kSoundComponentSetInfoSelect = 0x0104,
  2255. kSoundComponentStartSourceSelect = 0x0105,
  2256. kSoundComponentStopSourceSelect = 0x0106,
  2257. kSoundComponentPauseSourceSelect = 0x0107,
  2258. kSoundComponentPlaySourceBufferSelect = 0x0108
  2259. };
  2260. /*Audio Components*/
  2261. /*Volume is described as a value between 0 and 1, with 0 indicating minimum
  2262. volume and 1 indicating maximum volume; if the device doesn't support
  2263. software control of volume, then a value of unimpErr is returned, indicating
  2264. that these functions are not supported by the device
  2265. */
  2266. #if CALL_NOT_IN_CARBON
  2267. /*
  2268. * AudioGetVolume()
  2269. *
  2270. * Availability:
  2271. * Non-Carbon CFM: in SoundLib 3.0 and later
  2272. * CarbonLib: not available
  2273. * Mac OS X: not available
  2274. */
  2275. EXTERN_API( ComponentResult )
  2276. AudioGetVolume(
  2277. ComponentInstance ac,
  2278. short whichChannel,
  2279. ShortFixed * volume) FIVEWORDINLINE(0x2F3C, 0x0006, 0x0000, 0x7000, 0xA82A);
  2280. /*
  2281. * AudioSetVolume()
  2282. *
  2283. * Availability:
  2284. * Non-Carbon CFM: in SoundLib 3.0 and later
  2285. * CarbonLib: not available
  2286. * Mac OS X: not available
  2287. */
  2288. EXTERN_API( ComponentResult )
  2289. AudioSetVolume(
  2290. ComponentInstance ac,
  2291. short whichChannel,
  2292. ShortFixed volume) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  2293. /*If the device doesn't support software control of mute, then a value of unimpErr is
  2294. returned, indicating that these functions are not supported by the device.*/
  2295. /*
  2296. * AudioGetMute()
  2297. *
  2298. * Availability:
  2299. * Non-Carbon CFM: in SoundLib 3.0 and later
  2300. * CarbonLib: not available
  2301. * Mac OS X: not available
  2302. */
  2303. EXTERN_API( ComponentResult )
  2304. AudioGetMute(
  2305. ComponentInstance ac,
  2306. short whichChannel,
  2307. short * mute) FIVEWORDINLINE(0x2F3C, 0x0006, 0x0002, 0x7000, 0xA82A);
  2308. /*
  2309. * AudioSetMute()
  2310. *
  2311. * Availability:
  2312. * Non-Carbon CFM: in SoundLib 3.0 and later
  2313. * CarbonLib: not available
  2314. * Mac OS X: not available
  2315. */
  2316. EXTERN_API( ComponentResult )
  2317. AudioSetMute(
  2318. ComponentInstance ac,
  2319. short whichChannel,
  2320. short mute) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0003, 0x7000, 0xA82A);
  2321. /*AudioSetToDefaults causes the associated device to reset its volume and mute values
  2322. (and perhaps other characteristics, e.g. attenuation) to "factory default" settings*/
  2323. /*
  2324. * AudioSetToDefaults()
  2325. *
  2326. * Availability:
  2327. * Non-Carbon CFM: in SoundLib 3.0 and later
  2328. * CarbonLib: not available
  2329. * Mac OS X: not available
  2330. */
  2331. EXTERN_API( ComponentResult )
  2332. AudioSetToDefaults(ComponentInstance ac) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0004, 0x7000, 0xA82A);
  2333. /*This routine is required; it must be implemented by all audio components*/
  2334. /*
  2335. * AudioGetInfo()
  2336. *
  2337. * Availability:
  2338. * Non-Carbon CFM: in SoundLib 3.0 and later
  2339. * CarbonLib: not available
  2340. * Mac OS X: not available
  2341. */
  2342. EXTERN_API( ComponentResult )
  2343. AudioGetInfo(
  2344. ComponentInstance ac,
  2345. AudioInfoPtr info) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  2346. /*
  2347. * AudioGetBass()
  2348. *
  2349. * Availability:
  2350. * Non-Carbon CFM: in SoundLib 3.0 and later
  2351. * CarbonLib: not available
  2352. * Mac OS X: not available
  2353. */
  2354. EXTERN_API( ComponentResult )
  2355. AudioGetBass(
  2356. ComponentInstance ac,
  2357. short whichChannel,
  2358. short * bass) FIVEWORDINLINE(0x2F3C, 0x0006, 0x0006, 0x7000, 0xA82A);
  2359. /*
  2360. * AudioSetBass()
  2361. *
  2362. * Availability:
  2363. * Non-Carbon CFM: in SoundLib 3.0 and later
  2364. * CarbonLib: not available
  2365. * Mac OS X: not available
  2366. */
  2367. EXTERN_API( ComponentResult )
  2368. AudioSetBass(
  2369. ComponentInstance ac,
  2370. short whichChannel,
  2371. short bass) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  2372. /*
  2373. * AudioGetTreble()
  2374. *
  2375. * Availability:
  2376. * Non-Carbon CFM: in SoundLib 3.0 and later
  2377. * CarbonLib: not available
  2378. * Mac OS X: not available
  2379. */
  2380. EXTERN_API( ComponentResult )
  2381. AudioGetTreble(
  2382. ComponentInstance ac,
  2383. short whichChannel,
  2384. short * Treble) FIVEWORDINLINE(0x2F3C, 0x0006, 0x0008, 0x7000, 0xA82A);
  2385. /*
  2386. * AudioSetTreble()
  2387. *
  2388. * Availability:
  2389. * Non-Carbon CFM: in SoundLib 3.0 and later
  2390. * CarbonLib: not available
  2391. * Mac OS X: not available
  2392. */
  2393. EXTERN_API( ComponentResult )
  2394. AudioSetTreble(
  2395. ComponentInstance ac,
  2396. short whichChannel,
  2397. short Treble) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0009, 0x7000, 0xA82A);
  2398. /*
  2399. * AudioGetOutputDevice()
  2400. *
  2401. * Availability:
  2402. * Non-Carbon CFM: in SoundLib 3.0 and later
  2403. * CarbonLib: not available
  2404. * Mac OS X: not available
  2405. */
  2406. EXTERN_API( ComponentResult )
  2407. AudioGetOutputDevice(
  2408. ComponentInstance ac,
  2409. Component * outputDevice) FIVEWORDINLINE(0x2F3C, 0x0004, 0x000A, 0x7000, 0xA82A);
  2410. /*This is routine is private to the AudioVision component. It enables the watching of the mute key.*/
  2411. /*
  2412. * AudioMuteOnEvent()
  2413. *
  2414. * Availability:
  2415. * Non-Carbon CFM: in SoundLib 3.0 and later
  2416. * CarbonLib: not available
  2417. * Mac OS X: not available
  2418. */
  2419. EXTERN_API( ComponentResult )
  2420. AudioMuteOnEvent(
  2421. ComponentInstance ac,
  2422. short muteOnEvent) FIVEWORDINLINE(0x2F3C, 0x0002, 0x0081, 0x7000, 0xA82A);
  2423. /* selectors for component calls */
  2424. enum {
  2425. kAudioGetVolumeSelect = 0x0000,
  2426. kAudioSetVolumeSelect = 0x0001,
  2427. kAudioGetMuteSelect = 0x0002,
  2428. kAudioSetMuteSelect = 0x0003,
  2429. kAudioSetToDefaultsSelect = 0x0004,
  2430. kAudioGetInfoSelect = 0x0005,
  2431. kAudioGetBassSelect = 0x0006,
  2432. kAudioSetBassSelect = 0x0007,
  2433. kAudioGetTrebleSelect = 0x0008,
  2434. kAudioSetTrebleSelect = 0x0009,
  2435. kAudioGetOutputDeviceSelect = 0x000A,
  2436. kAudioMuteOnEventSelect = 0x0081
  2437. };
  2438. #endif /* CALL_NOT_IN_CARBON */
  2439. enum {
  2440. kDelegatedSoundComponentSelectors = 0x0100
  2441. };
  2442. /* Sound Input Manager routines, uses _SoundDispatch */
  2443. /*
  2444. * SPBVersion()
  2445. *
  2446. * Availability:
  2447. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2448. * CarbonLib: in CarbonLib 1.0 and later
  2449. * Mac OS X: in version 10.0 and later
  2450. */
  2451. EXTERN_API( NumVersion )
  2452. SPBVersion(void) FOURWORDINLINE(0x203C, 0x0000, 0x0014, 0xA800);
  2453. /*
  2454. * SndRecord()
  2455. *
  2456. * Availability:
  2457. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2458. * CarbonLib: in CarbonLib 1.0 and later
  2459. * Mac OS X: in version 10.0 and later
  2460. */
  2461. EXTERN_API( OSErr )
  2462. SndRecord(
  2463. ModalFilterUPP filterProc,
  2464. Point corner,
  2465. OSType quality,
  2466. SndListHandle * sndHandle) FOURWORDINLINE(0x203C, 0x0804, 0x0014, 0xA800);
  2467. #if CALL_NOT_IN_CARBON
  2468. /*
  2469. * SndRecordToFile()
  2470. *
  2471. * Availability:
  2472. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2473. * CarbonLib: not available
  2474. * Mac OS X: not available
  2475. */
  2476. EXTERN_API( OSErr )
  2477. SndRecordToFile(
  2478. ModalFilterUPP filterProc,
  2479. Point corner,
  2480. OSType quality,
  2481. short fRefNum) FOURWORDINLINE(0x203C, 0x0708, 0x0014, 0xA800);
  2482. #endif /* CALL_NOT_IN_CARBON */
  2483. /*
  2484. * SPBSignInDevice()
  2485. *
  2486. * Availability:
  2487. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2488. * CarbonLib: in CarbonLib 1.0 and later
  2489. * Mac OS X: in version 10.0 and later
  2490. */
  2491. EXTERN_API( OSErr )
  2492. SPBSignInDevice(
  2493. short deviceRefNum,
  2494. ConstStr255Param deviceName) FOURWORDINLINE(0x203C, 0x030C, 0x0014, 0xA800);
  2495. /*
  2496. * SPBSignOutDevice()
  2497. *
  2498. * Availability:
  2499. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2500. * CarbonLib: in CarbonLib 1.0 and later
  2501. * Mac OS X: in version 10.0 and later
  2502. */
  2503. EXTERN_API( OSErr )
  2504. SPBSignOutDevice(short deviceRefNum) FOURWORDINLINE(0x203C, 0x0110, 0x0014, 0xA800);
  2505. /*
  2506. * SPBGetIndexedDevice()
  2507. *
  2508. * Availability:
  2509. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2510. * CarbonLib: in CarbonLib 1.0 and later
  2511. * Mac OS X: in version 10.0 and later
  2512. */
  2513. EXTERN_API( OSErr )
  2514. SPBGetIndexedDevice(
  2515. short count,
  2516. Str255 deviceName,
  2517. Handle * deviceIconHandle) FOURWORDINLINE(0x203C, 0x0514, 0x0014, 0xA800);
  2518. /*
  2519. * SPBOpenDevice()
  2520. *
  2521. * Availability:
  2522. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2523. * CarbonLib: in CarbonLib 1.0 and later
  2524. * Mac OS X: in version 10.0 and later
  2525. */
  2526. EXTERN_API( OSErr )
  2527. SPBOpenDevice(
  2528. ConstStr255Param deviceName,
  2529. short permission,
  2530. long * inRefNum) FOURWORDINLINE(0x203C, 0x0518, 0x0014, 0xA800);
  2531. /*
  2532. * SPBCloseDevice()
  2533. *
  2534. * Availability:
  2535. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2536. * CarbonLib: in CarbonLib 1.0 and later
  2537. * Mac OS X: in version 10.0 and later
  2538. */
  2539. EXTERN_API( OSErr )
  2540. SPBCloseDevice(long inRefNum) FOURWORDINLINE(0x203C, 0x021C, 0x0014, 0xA800);
  2541. /*
  2542. * SPBRecord()
  2543. *
  2544. * Availability:
  2545. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2546. * CarbonLib: in CarbonLib 1.0 and later
  2547. * Mac OS X: in version 10.0 and later
  2548. */
  2549. EXTERN_API( OSErr )
  2550. SPBRecord(
  2551. SPBPtr inParamPtr,
  2552. Boolean asynchFlag) FOURWORDINLINE(0x203C, 0x0320, 0x0014, 0xA800);
  2553. #if CALL_NOT_IN_CARBON
  2554. /*
  2555. * SPBRecordToFile()
  2556. *
  2557. * Availability:
  2558. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2559. * CarbonLib: not available
  2560. * Mac OS X: not available
  2561. */
  2562. EXTERN_API( OSErr )
  2563. SPBRecordToFile(
  2564. short fRefNum,
  2565. SPBPtr inParamPtr,
  2566. Boolean asynchFlag) FOURWORDINLINE(0x203C, 0x0424, 0x0014, 0xA800);
  2567. #endif /* CALL_NOT_IN_CARBON */
  2568. /*
  2569. * SPBPauseRecording()
  2570. *
  2571. * Availability:
  2572. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2573. * CarbonLib: in CarbonLib 1.0 and later
  2574. * Mac OS X: in version 10.0 and later
  2575. */
  2576. EXTERN_API( OSErr )
  2577. SPBPauseRecording(long inRefNum) FOURWORDINLINE(0x203C, 0x0228, 0x0014, 0xA800);
  2578. /*
  2579. * SPBResumeRecording()
  2580. *
  2581. * Availability:
  2582. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2583. * CarbonLib: in CarbonLib 1.0 and later
  2584. * Mac OS X: in version 10.0 and later
  2585. */
  2586. EXTERN_API( OSErr )
  2587. SPBResumeRecording(long inRefNum) FOURWORDINLINE(0x203C, 0x022C, 0x0014, 0xA800);
  2588. /*
  2589. * SPBStopRecording()
  2590. *
  2591. * Availability:
  2592. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2593. * CarbonLib: in CarbonLib 1.0 and later
  2594. * Mac OS X: in version 10.0 and later
  2595. */
  2596. EXTERN_API( OSErr )
  2597. SPBStopRecording(long inRefNum) FOURWORDINLINE(0x203C, 0x0230, 0x0014, 0xA800);
  2598. /*
  2599. * SPBGetRecordingStatus()
  2600. *
  2601. * Availability:
  2602. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2603. * CarbonLib: in CarbonLib 1.0 and later
  2604. * Mac OS X: in version 10.0 and later
  2605. */
  2606. EXTERN_API( OSErr )
  2607. SPBGetRecordingStatus(
  2608. long inRefNum,
  2609. short * recordingStatus,
  2610. short * meterLevel,
  2611. unsigned long * totalSamplesToRecord,
  2612. unsigned long * numberOfSamplesRecorded,
  2613. unsigned long * totalMsecsToRecord,
  2614. unsigned long * numberOfMsecsRecorded) FOURWORDINLINE(0x203C, 0x0E34, 0x0014, 0xA800);
  2615. /*
  2616. * SPBGetDeviceInfo()
  2617. *
  2618. * Availability:
  2619. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2620. * CarbonLib: in CarbonLib 1.0 and later
  2621. * Mac OS X: in version 10.0 and later
  2622. */
  2623. EXTERN_API( OSErr )
  2624. SPBGetDeviceInfo(
  2625. long inRefNum,
  2626. OSType infoType,
  2627. void * infoData) FOURWORDINLINE(0x203C, 0x0638, 0x0014, 0xA800);
  2628. /*
  2629. * SPBSetDeviceInfo()
  2630. *
  2631. * Availability:
  2632. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2633. * CarbonLib: in CarbonLib 1.0 and later
  2634. * Mac OS X: in version 10.0 and later
  2635. */
  2636. EXTERN_API( OSErr )
  2637. SPBSetDeviceInfo(
  2638. long inRefNum,
  2639. OSType infoType,
  2640. void * infoData) FOURWORDINLINE(0x203C, 0x063C, 0x0014, 0xA800);
  2641. /*
  2642. * SPBMillisecondsToBytes()
  2643. *
  2644. * Availability:
  2645. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2646. * CarbonLib: in CarbonLib 1.0 and later
  2647. * Mac OS X: in version 10.0 and later
  2648. */
  2649. EXTERN_API( OSErr )
  2650. SPBMillisecondsToBytes(
  2651. long inRefNum,
  2652. long * milliseconds) FOURWORDINLINE(0x203C, 0x0440, 0x0014, 0xA800);
  2653. /*
  2654. * SPBBytesToMilliseconds()
  2655. *
  2656. * Availability:
  2657. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2658. * CarbonLib: in CarbonLib 1.0 and later
  2659. * Mac OS X: in version 10.0 and later
  2660. */
  2661. EXTERN_API( OSErr )
  2662. SPBBytesToMilliseconds(
  2663. long inRefNum,
  2664. long * byteCount) FOURWORDINLINE(0x203C, 0x0444, 0x0014, 0xA800);
  2665. /*
  2666. * SetupSndHeader()
  2667. *
  2668. * Availability:
  2669. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2670. * CarbonLib: in CarbonLib 1.0 and later
  2671. * Mac OS X: in version 10.0 and later
  2672. */
  2673. EXTERN_API( OSErr )
  2674. SetupSndHeader(
  2675. SndListHandle sndHandle,
  2676. short numChannels,
  2677. UnsignedFixed sampleRate,
  2678. short sampleSize,
  2679. OSType compressionType,
  2680. short baseNote,
  2681. unsigned long numBytes,
  2682. short * headerLen) FOURWORDINLINE(0x203C, 0x0D48, 0x0014, 0xA800);
  2683. /*
  2684. * SetupAIFFHeader()
  2685. *
  2686. * Availability:
  2687. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2688. * CarbonLib: in CarbonLib 1.0 and later
  2689. * Mac OS X: in version 10.0 and later
  2690. */
  2691. EXTERN_API( OSErr )
  2692. SetupAIFFHeader(
  2693. short fRefNum,
  2694. short numChannels,
  2695. UnsignedFixed sampleRate,
  2696. short sampleSize,
  2697. OSType compressionType,
  2698. unsigned long numBytes,
  2699. unsigned long numFrames) FOURWORDINLINE(0x203C, 0x0B4C, 0x0014, 0xA800);
  2700. /* Sound Input Manager 1.1 and later calls, uses _SoundDispatch */
  2701. /*
  2702. * ParseAIFFHeader()
  2703. *
  2704. * Availability:
  2705. * Non-Carbon CFM: in SoundLib 3.0 and later
  2706. * CarbonLib: in CarbonLib 1.0 and later
  2707. * Mac OS X: in version 10.0 and later
  2708. */
  2709. EXTERN_API( OSErr )
  2710. ParseAIFFHeader(
  2711. short fRefNum,
  2712. SoundComponentData * sndInfo,
  2713. unsigned long * numFrames,
  2714. unsigned long * dataOffset) FOURWORDINLINE(0x203C, 0x0758, 0x0014, 0xA800);
  2715. /*
  2716. * ParseSndHeader()
  2717. *
  2718. * Availability:
  2719. * Non-Carbon CFM: in SoundLib 3.0 and later
  2720. * CarbonLib: in CarbonLib 1.0 and later
  2721. * Mac OS X: in version 10.0 and later
  2722. */
  2723. EXTERN_API( OSErr )
  2724. ParseSndHeader(
  2725. SndListHandle sndHandle,
  2726. SoundComponentData * sndInfo,
  2727. unsigned long * numFrames,
  2728. unsigned long * dataOffset) FOURWORDINLINE(0x203C, 0x085C, 0x0014, 0xA800);
  2729. #if !TARGET_OS_MAC || TARGET_API_MAC_CARBON
  2730. /* Only to be used if you are writing a sound input component; this */
  2731. /* is the param block for a read request from the SoundMgr to the */
  2732. /* sound input component. Not to be confused with the SPB struct */
  2733. /* above, which is the param block for a read request from an app */
  2734. /* to the SoundMgr. */
  2735. typedef struct SndInputCmpParam SndInputCmpParam;
  2736. typedef SndInputCmpParam * SndInputCmpParamPtr;
  2737. typedef CALLBACK_API( void , SICCompletionProcPtr )(SndInputCmpParamPtr SICParmPtr);
  2738. struct SndInputCmpParam {
  2739. SICCompletionProcPtr ioCompletion; /* completion routine [pointer]*/
  2740. SIInterruptProcPtr ioInterrupt; /* interrupt routine [pointer]*/
  2741. OSErr ioResult; /* I/O result code [word]*/
  2742. short pad;
  2743. unsigned long ioReqCount;
  2744. unsigned long ioActCount;
  2745. Ptr ioBuffer;
  2746. Ptr ioMisc;
  2747. };
  2748. /*
  2749. * SndInputReadAsync()
  2750. *
  2751. * Availability:
  2752. * Non-Carbon CFM: not available
  2753. * CarbonLib: not available
  2754. * Mac OS X: in version 10.0 and later
  2755. */
  2756. EXTERN_API( ComponentResult )
  2757. SndInputReadAsync(
  2758. ComponentInstance self,
  2759. SndInputCmpParamPtr SICParmPtr) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  2760. /*
  2761. * SndInputReadSync()
  2762. *
  2763. * Availability:
  2764. * Non-Carbon CFM: not available
  2765. * CarbonLib: not available
  2766. * Mac OS X: in version 10.0 and later
  2767. */
  2768. EXTERN_API( ComponentResult )
  2769. SndInputReadSync(
  2770. ComponentInstance self,
  2771. SndInputCmpParamPtr SICParmPtr) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0002, 0x7000, 0xA82A);
  2772. /*
  2773. * SndInputPauseRecording()
  2774. *
  2775. * Availability:
  2776. * Non-Carbon CFM: not available
  2777. * CarbonLib: not available
  2778. * Mac OS X: in version 10.0 and later
  2779. */
  2780. EXTERN_API( ComponentResult )
  2781. SndInputPauseRecording(ComponentInstance self) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0003, 0x7000, 0xA82A);
  2782. /*
  2783. * SndInputResumeRecording()
  2784. *
  2785. * Availability:
  2786. * Non-Carbon CFM: not available
  2787. * CarbonLib: not available
  2788. * Mac OS X: in version 10.0 and later
  2789. */
  2790. EXTERN_API( ComponentResult )
  2791. SndInputResumeRecording(ComponentInstance self) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0004, 0x7000, 0xA82A);
  2792. /*
  2793. * SndInputStopRecording()
  2794. *
  2795. * Availability:
  2796. * Non-Carbon CFM: not available
  2797. * CarbonLib: not available
  2798. * Mac OS X: in version 10.0 and later
  2799. */
  2800. EXTERN_API( ComponentResult )
  2801. SndInputStopRecording(ComponentInstance self) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0005, 0x7000, 0xA82A);
  2802. /*
  2803. * SndInputGetStatus()
  2804. *
  2805. * Availability:
  2806. * Non-Carbon CFM: not available
  2807. * CarbonLib: not available
  2808. * Mac OS X: in version 10.0 and later
  2809. */
  2810. EXTERN_API( ComponentResult )
  2811. SndInputGetStatus(
  2812. ComponentInstance self,
  2813. short * recordingStatus,
  2814. unsigned long * totalSamplesToRecord,
  2815. unsigned long * numberOfSamplesRecorded) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0006, 0x7000, 0xA82A);
  2816. /*
  2817. * SndInputGetDeviceInfo()
  2818. *
  2819. * Availability:
  2820. * Non-Carbon CFM: not available
  2821. * CarbonLib: not available
  2822. * Mac OS X: in version 10.0 and later
  2823. */
  2824. EXTERN_API( ComponentResult )
  2825. SndInputGetDeviceInfo(
  2826. ComponentInstance self,
  2827. OSType infoType,
  2828. void * infoData) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0007, 0x7000, 0xA82A);
  2829. /*
  2830. * SndInputSetDeviceInfo()
  2831. *
  2832. * Availability:
  2833. * Non-Carbon CFM: not available
  2834. * CarbonLib: not available
  2835. * Mac OS X: in version 10.0 and later
  2836. */
  2837. EXTERN_API( ComponentResult )
  2838. SndInputSetDeviceInfo(
  2839. ComponentInstance self,
  2840. OSType infoType,
  2841. void * infoData) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0008, 0x7000, 0xA82A);
  2842. /*
  2843. * SndInputInitHardware()
  2844. *
  2845. * Availability:
  2846. * Non-Carbon CFM: not available
  2847. * CarbonLib: not available
  2848. * Mac OS X: in version 10.0 and later
  2849. */
  2850. EXTERN_API( ComponentResult )
  2851. SndInputInitHardware(ComponentInstance self) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0009, 0x7000, 0xA82A);
  2852. /* selectors for component calls */
  2853. enum {
  2854. kSndInputReadAsyncSelect = 0x0001,
  2855. kSndInputReadSyncSelect = 0x0002,
  2856. kSndInputPauseRecordingSelect = 0x0003,
  2857. kSndInputResumeRecordingSelect = 0x0004,
  2858. kSndInputStopRecordingSelect = 0x0005,
  2859. kSndInputGetStatusSelect = 0x0006,
  2860. kSndInputGetDeviceInfoSelect = 0x0007,
  2861. kSndInputSetDeviceInfoSelect = 0x0008,
  2862. kSndInputInitHardwareSelect = 0x0009
  2863. };
  2864. #endif /* !TARGET_OS_MAC || TARGET_API_MAC_CARBON */
  2865. #if PRAGMA_STRUCT_ALIGN
  2866. #pragma options align=reset
  2867. #elif PRAGMA_STRUCT_PACKPUSH
  2868. #pragma pack(pop)
  2869. #elif PRAGMA_STRUCT_PACK
  2870. #pragma pack()
  2871. #endif
  2872. #ifdef PRAGMA_IMPORT_OFF
  2873. #pragma import off
  2874. #elif PRAGMA_IMPORT
  2875. #pragma import reset
  2876. #endif
  2877. #ifdef __cplusplus
  2878. }
  2879. #endif
  2880. #endif /* __SOUND__ */