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.

3378 lines
128 KiB

  1. /*
  2. File: QuickTimeMusic.h
  3. Contains: QuickTime Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1990-2007 by Apple 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 __QUICKTIMEMUSIC__
  11. #define __QUICKTIMEMUSIC__
  12. #ifndef __COMPONENTS__
  13. #include <Components.h>
  14. #endif
  15. #ifndef __QUICKDRAW__
  16. #include <Quickdraw.h>
  17. #endif
  18. #ifndef __VIDEO__
  19. #include <Video.h>
  20. #endif
  21. #ifndef __MACMEMORY__
  22. #include <MacMemory.h>
  23. #endif
  24. #ifndef __SOUND__
  25. #include <Sound.h>
  26. #endif
  27. #ifndef __ENDIAN__
  28. #include <Endian.h>
  29. #endif
  30. #ifndef __IMAGECOMPRESSION__
  31. #include <ImageCompression.h>
  32. #endif
  33. #ifndef __MOVIES__
  34. #include <Movies.h>
  35. #endif
  36. #if PRAGMA_ONCE
  37. #pragma once
  38. #endif
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. #if PRAGMA_IMPORT
  43. #pragma import on
  44. #endif
  45. #if PRAGMA_STRUCT_ALIGN
  46. #pragma options align=mac68k
  47. #elif PRAGMA_STRUCT_PACKPUSH
  48. #pragma pack(push, 2)
  49. #elif PRAGMA_STRUCT_PACK
  50. #pragma pack(2)
  51. #endif
  52. /* QuickTime is not available to 64-bit clients */
  53. #if !__LP64__
  54. enum {
  55. kaiToneDescType = FOUR_CHAR_CODE('tone'),
  56. kaiNoteRequestInfoType = FOUR_CHAR_CODE('ntrq'),
  57. kaiKnobListType = FOUR_CHAR_CODE('knbl'),
  58. kaiKeyRangeInfoType = FOUR_CHAR_CODE('sinf'),
  59. kaiSampleDescType = FOUR_CHAR_CODE('sdsc'),
  60. kaiSampleInfoType = FOUR_CHAR_CODE('smin'),
  61. kaiSampleDataType = FOUR_CHAR_CODE('sdat'),
  62. kaiSampleDataQUIDType = FOUR_CHAR_CODE('quid'),
  63. kaiInstInfoType = FOUR_CHAR_CODE('iinf'),
  64. kaiPictType = FOUR_CHAR_CODE('pict'),
  65. kaiWriterType = 0xA9777274,
  66. kaiCopyrightType = 0xA9637079,
  67. kaiOtherStrType = FOUR_CHAR_CODE('str '),
  68. kaiInstrumentRefType = FOUR_CHAR_CODE('iref'),
  69. kaiInstGMQualityType = FOUR_CHAR_CODE('qual'),
  70. kaiLibraryInfoType = FOUR_CHAR_CODE('linf'),
  71. kaiLibraryDescType = FOUR_CHAR_CODE('ldsc')
  72. };
  73. struct InstLibDescRec {
  74. Str31 libIDName;
  75. };
  76. typedef struct InstLibDescRec InstLibDescRec;
  77. struct InstKnobRec {
  78. BigEndianLong number;
  79. BigEndianLong value;
  80. };
  81. typedef struct InstKnobRec InstKnobRec;
  82. enum {
  83. kInstKnobMissingUnknown = 0,
  84. kInstKnobMissingDefault = (1 << 0)
  85. };
  86. struct InstKnobList {
  87. BigEndianLong knobCount;
  88. BigEndianLong knobFlags;
  89. InstKnobRec knob[1];
  90. };
  91. typedef struct InstKnobList InstKnobList;
  92. enum {
  93. kMusicLoopTypeNormal = 0,
  94. kMusicLoopTypePalindrome = 1 /* back & forth*/
  95. };
  96. enum {
  97. instSamplePreProcessFlag = 1 << 0
  98. };
  99. struct InstSampleDescRec {
  100. BigEndianOSType dataFormat;
  101. BigEndianShort numChannels;
  102. BigEndianShort sampleSize;
  103. BigEndianUnsignedFixed sampleRate;
  104. BigEndianShort sampleDataID;
  105. BigEndianLong offset; /* offset within SampleData - this could be just for internal use*/
  106. BigEndianLong numSamples; /* this could also just be for internal use, we'll see*/
  107. BigEndianLong loopType;
  108. BigEndianLong loopStart;
  109. BigEndianLong loopEnd;
  110. BigEndianLong pitchNormal;
  111. BigEndianLong pitchLow;
  112. BigEndianLong pitchHigh;
  113. };
  114. typedef struct InstSampleDescRec InstSampleDescRec;
  115. typedef Handle AtomicInstrument;
  116. typedef Ptr AtomicInstrumentPtr;
  117. enum {
  118. kQTMIDIComponentType = FOUR_CHAR_CODE('midi')
  119. };
  120. enum {
  121. kOMSComponentSubType = FOUR_CHAR_CODE('OMS '),
  122. kFMSComponentSubType = FOUR_CHAR_CODE('FMS '),
  123. kMIDIManagerComponentSubType = FOUR_CHAR_CODE('mmgr'),
  124. kOSXMIDIComponentSubType = FOUR_CHAR_CODE('osxm')
  125. };
  126. typedef ComponentInstance QTMIDIComponent;
  127. enum {
  128. kMusicPacketPortLost = 1, /* received when application loses the default input port */
  129. kMusicPacketPortFound = 2, /* received when application gets it back out from under someone else's claim */
  130. kMusicPacketTimeGap = 3 /* data[0] = number of milliseconds to keep the MIDI line silent */
  131. };
  132. enum {
  133. kAppleSysexID = 0x11, /* apple sysex is followed by 2-byte command. 0001 is the command for samplesize */
  134. kAppleSysexCmdSampleSize = 0x0001, /* 21 bit number in 3 midi bytes follows sysex ID and 2 cmd bytes */
  135. kAppleSysexCmdSampleBreak = 0x0002, /* specifies that the sample should break right here */
  136. kAppleSysexCmdAtomicInstrument = 0x0010, /* contents of atomic instrument handle */
  137. kAppleSysexCmdDeveloper = 0x7F00 /* F0 11 7F 00 ww xx yy zz ... F7 is available for non-Apple developers, where wxyz is unique app signature with 8th bit cleared, unique to developer, and 00 and 7f are reserved */
  138. };
  139. struct MusicMIDIPacket {
  140. unsigned short length;
  141. unsigned long reserved; /* if length zero, then reserved = above enum */
  142. UInt8 data[249];
  143. };
  144. typedef struct MusicMIDIPacket MusicMIDIPacket;
  145. typedef CALLBACK_API( ComponentResult , MusicMIDISendProcPtr )(ComponentInstance self, long refCon, MusicMIDIPacket *mmp);
  146. typedef STACK_UPP_TYPE(MusicMIDISendProcPtr) MusicMIDISendUPP;
  147. enum {
  148. kSynthesizerConnectionFMS = 1, /* this connection imported from FMS */
  149. kSynthesizerConnectionMMgr = 2, /* this connection imported from the MIDI Mgr */
  150. kSynthesizerConnectionOMS = 4, /* this connection imported from OMS */
  151. kSynthesizerConnectionQT = 8, /* this connection is a QuickTime-only port */
  152. kSynthesizerConnectionOSXMIDI = 16, /* this connection is an OS X CoreMIDI port */
  153. /* lowest five bits are mutually exclusive; combinations reserved for future use.*/
  154. kSynthesizerConnectionUnavailable = 256 /* port exists, but cannot be used just now */
  155. };
  156. /*
  157. The sampleBankFile field of this structure can be used to pass in a pointer to an FSSpec
  158. that represents a SoundFont 2 or DLS file (otherwise set it to NULL ).
  159. You then pass in a structure with this field set (all other fields should be zero) to
  160. NARegisterMusicDevice:
  161. - with synthType as kSoftSynthComponentSubType
  162. - with name being used to return to the application the "name" of the synth
  163. that should be used in the synthesiserName field of the ToneDescription structure
  164. and is also used to retrieve a particular MusicComponent with the
  165. NAGetRegisteredMusicDevice call
  166. This call will create a MusicComponent of kSoftSynthComponentSubType, with the specified
  167. sound bank as the sample data source.
  168. This field requires QuickTime 5.0 or later and should be set to NULL for prior versions.
  169. */
  170. struct SynthesizerConnections {
  171. OSType clientID;
  172. OSType inputPortID; /* terminology death: this port is used to SEND to the midi synth */
  173. OSType outputPortID; /* terminology death: this port receives from a keyboard or other control device */
  174. long midiChannel; /* The system channel; others are configurable (or the nubus slot number) */
  175. long flags;
  176. long unique; /* unique id may be used instead of index, to getinfo and unregister calls */
  177. FSSpecPtr sampleBankFile; /* see notes above */
  178. long reserved2; /* should be zero */
  179. };
  180. typedef struct SynthesizerConnections SynthesizerConnections;
  181. struct QTMIDIPort {
  182. SynthesizerConnections portConnections;
  183. Str63 portName;
  184. };
  185. typedef struct QTMIDIPort QTMIDIPort;
  186. struct QTMIDIPortList {
  187. short portCount;
  188. QTMIDIPort port[1];
  189. };
  190. typedef struct QTMIDIPortList QTMIDIPortList;
  191. typedef QTMIDIPortList * QTMIDIPortListPtr;
  192. typedef QTMIDIPortListPtr * QTMIDIPortListHandle;
  193. /*
  194. * QTMIDIGetMIDIPorts()
  195. *
  196. * Availability:
  197. * Non-Carbon CFM: in QuickTimeLib 3.0 and later
  198. * CarbonLib: in CarbonLib 1.0 and later
  199. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  200. * Windows: in qtmlClient.lib 3.0 and later
  201. */
  202. EXTERN_API( ComponentResult )
  203. QTMIDIGetMIDIPorts(
  204. QTMIDIComponent ci,
  205. QTMIDIPortListHandle * inputPorts,
  206. QTMIDIPortListHandle * outputPorts) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0001, 0x7000, 0xA82A);
  207. /*
  208. * QTMIDIUseSendPort()
  209. *
  210. * Availability:
  211. * Non-Carbon CFM: in QuickTimeLib 3.0 and later
  212. * CarbonLib: in CarbonLib 1.0 and later
  213. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  214. * Windows: in qtmlClient.lib 3.0 and later
  215. */
  216. EXTERN_API( ComponentResult )
  217. QTMIDIUseSendPort(
  218. QTMIDIComponent ci,
  219. long portIndex,
  220. long inUse) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0002, 0x7000, 0xA82A);
  221. /*
  222. * QTMIDISendMIDI()
  223. *
  224. * Availability:
  225. * Non-Carbon CFM: in QuickTimeLib 3.0 and later
  226. * CarbonLib: in CarbonLib 1.0 and later
  227. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  228. * Windows: in qtmlClient.lib 3.0 and later
  229. */
  230. EXTERN_API( ComponentResult )
  231. QTMIDISendMIDI(
  232. QTMIDIComponent ci,
  233. long portIndex,
  234. MusicMIDIPacket * mp) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);
  235. enum {
  236. kMusicComponentType = FOUR_CHAR_CODE('musi'),
  237. kInstrumentComponentType = FOUR_CHAR_CODE('inst')
  238. };
  239. enum {
  240. kSoftSynthComponentSubType = FOUR_CHAR_CODE('ss '),
  241. kGMSynthComponentSubType = FOUR_CHAR_CODE('gm ')
  242. };
  243. typedef ComponentInstance MusicComponent;
  244. /* MusicSynthesizerFlags*/
  245. enum {
  246. kSynthesizerDynamicVoice = 1 << 0, /* can assign voices on the fly (else, polyphony is very important */
  247. kSynthesizerUsesMIDIPort = 1 << 1, /* must be patched through MIDI Manager */
  248. kSynthesizerMicrotone = 1 << 2, /* can play microtonal scales */
  249. kSynthesizerHasSamples = 1 << 3, /* synthesizer has some use for sampled data */
  250. kSynthesizerMixedDrums = 1 << 4, /* any part can play drum parts, total = instrument parts */
  251. kSynthesizerSoftware = 1 << 5, /* implemented in main CPU software == uses cpu cycles */
  252. kSynthesizerHardware = 1 << 6, /* is a hardware device (such as nubus, or maybe DSP?) */
  253. kSynthesizerDynamicChannel = 1 << 7, /* can move any part to any channel or disable each part. (else we assume it lives on all channels in masks) */
  254. kSynthesizerHogsSystemChannel = 1 << 8, /* can be channelwise dynamic, but always responds on its system channel */
  255. kSynthesizerHasSystemChannel = 1 << 9, /* has some "system channel" notion to distinguish it from multiple instances of the same device (GM devices dont) */
  256. kSynthesizerSlowSetPart = 1 << 10, /* SetPart() and SetPartInstrumentNumber() calls do not have rapid response, may glitch notes */
  257. kSynthesizerOffline = 1 << 12, /* can enter an offline synthesis mode */
  258. kSynthesizerGM = 1 << 14, /* synth is a GM device */
  259. kSynthesizerDLS = 1 << 15, /* synth supports DLS level 1 */
  260. kSynthesizerSoundLocalization = 1 << 16 /* synth supports extremely baroque, nonstandard, and proprietary "apple game sprockets" localization parameter set */
  261. };
  262. /*
  263. * Note that these controller numbers
  264. * are _not_ identical to the MIDI controller numbers.
  265. * These are _signed_ 8.8 values, and the LSB's are
  266. * always sent to a MIDI device. Controllers 32-63 are
  267. * reserved (for MIDI, they are LSB's for 0-31, but we
  268. * always send both).
  269. *
  270. * The full range, therefore, is -128.00 to 127.7f.
  271. *
  272. * _Excepting_ _volume_, all controls default to zero.
  273. *
  274. * Pitch bend is specified in fractional semitones! No
  275. * more "pitch bend range" nonsense. You can bend as far
  276. * as you want, any time you want.
  277. */
  278. typedef SInt32 MusicController;
  279. enum {
  280. kControllerModulationWheel = 1,
  281. kControllerBreath = 2,
  282. kControllerFoot = 4,
  283. kControllerPortamentoTime = 5, /* time in 8.8 seconds, portamento on/off is omitted, 0 time = 'off' */
  284. kControllerVolume = 7, /* main volume control */
  285. kControllerBalance = 8,
  286. kControllerPan = 10, /* 0 - "default", 1 - n: positioned in output 1-n (incl fractions) */
  287. kControllerExpression = 11, /* secondary volume control */
  288. kControllerLever1 = 16, /* general purpose controllers */
  289. kControllerLever2 = 17, /* general purpose controllers */
  290. kControllerLever3 = 18, /* general purpose controllers */
  291. kControllerLever4 = 19, /* general purpose controllers */
  292. kControllerLever5 = 80, /* general purpose controllers */
  293. kControllerLever6 = 81, /* general purpose controllers */
  294. kControllerLever7 = 82, /* general purpose controllers */
  295. kControllerLever8 = 83, /* general purpose controllers */
  296. kControllerPitchBend = 32, /* positive & negative semitones, with 8 bits fraction, same units as transpose controllers*/
  297. kControllerAfterTouch = 33, /* aka channel pressure */
  298. kControllerPartTranspose = 40, /* identical to pitchbend, for overall part xpose */
  299. kControllerTuneTranspose = 41, /* another pitchbend, for "song global" pitch offset */
  300. kControllerPartVolume = 42, /* another volume control, passed right down from note allocator part volume */
  301. kControllerTuneVolume = 43, /* another volume control, used for "song global" volume - since we share one synthesizer across multiple tuneplayers*/
  302. kControllerSustain = 64, /* boolean - positive for on, 0 or negative off */
  303. kControllerPortamento = 65, /* boolean*/
  304. kControllerSostenuto = 66, /* boolean */
  305. kControllerSoftPedal = 67, /* boolean */
  306. kControllerReverb = 91,
  307. kControllerTremolo = 92,
  308. kControllerChorus = 93,
  309. kControllerCeleste = 94,
  310. kControllerPhaser = 95,
  311. kControllerEditPart = 113, /* last 16 controllers 113-128 and above are global controllers which respond on part zero */
  312. kControllerMasterTune = 114,
  313. kControllerMasterTranspose = 114, /* preferred*/
  314. kControllerMasterVolume = 115,
  315. kControllerMasterCPULoad = 116,
  316. kControllerMasterPolyphony = 117,
  317. kControllerMasterFeatures = 118
  318. };
  319. /* ID's of knobs supported by the QuickTime Music Synthesizer built into QuickTime*/
  320. enum {
  321. kQTMSKnobStartID = 0x02000000,
  322. kQTMSKnobVolumeAttackTimeID = 0x02000001,
  323. kQTMSKnobVolumeDecayTimeID = 0x02000002,
  324. kQTMSKnobVolumeSustainLevelID = 0x02000003,
  325. kQTMSKnobVolumeRelease1RateID = 0x02000004,
  326. kQTMSKnobVolumeDecayKeyScalingID = 0x02000005,
  327. kQTMSKnobVolumeReleaseTimeID = 0x02000006,
  328. kQTMSKnobVolumeLFODelayID = 0x02000007,
  329. kQTMSKnobVolumeLFORampTimeID = 0x02000008,
  330. kQTMSKnobVolumeLFOPeriodID = 0x02000009,
  331. kQTMSKnobVolumeLFOShapeID = 0x0200000A,
  332. kQTMSKnobVolumeLFODepthID = 0x0200000B,
  333. kQTMSKnobVolumeOverallID = 0x0200000C,
  334. kQTMSKnobVolumeVelocity127ID = 0x0200000D,
  335. kQTMSKnobVolumeVelocity96ID = 0x0200000E,
  336. kQTMSKnobVolumeVelocity64ID = 0x0200000F,
  337. kQTMSKnobVolumeVelocity32ID = 0x02000010,
  338. kQTMSKnobVolumeVelocity16ID = 0x02000011, /* Pitch related knobs*/
  339. kQTMSKnobPitchTransposeID = 0x02000012,
  340. kQTMSKnobPitchLFODelayID = 0x02000013,
  341. kQTMSKnobPitchLFORampTimeID = 0x02000014,
  342. kQTMSKnobPitchLFOPeriodID = 0x02000015,
  343. kQTMSKnobPitchLFOShapeID = 0x02000016,
  344. kQTMSKnobPitchLFODepthID = 0x02000017,
  345. kQTMSKnobPitchLFOQuantizeID = 0x02000018, /* Stereo related knobs*/
  346. kQTMSKnobStereoDefaultPanID = 0x02000019,
  347. kQTMSKnobStereoPositionKeyScalingID = 0x0200001A,
  348. kQTMSKnobPitchLFOOffsetID = 0x0200001B,
  349. kQTMSKnobExclusionGroupID = 0x0200001C, /* Misc knobs, late additions*/
  350. kQTMSKnobSustainTimeID = 0x0200001D,
  351. kQTMSKnobSustainInfiniteID = 0x0200001E,
  352. kQTMSKnobVolumeLFOStereoID = 0x0200001F,
  353. kQTMSKnobVelocityLowID = 0x02000020,
  354. kQTMSKnobVelocityHighID = 0x02000021,
  355. kQTMSKnobVelocitySensitivityID = 0x02000022,
  356. kQTMSKnobPitchSensitivityID = 0x02000023,
  357. kQTMSKnobVolumeLFODepthFromWheelID = 0x02000024,
  358. kQTMSKnobPitchLFODepthFromWheelID = 0x02000025, /* Volume Env again*/
  359. kQTMSKnobVolumeExpOptionsID = 0x02000026, /* Env1*/
  360. kQTMSKnobEnv1AttackTimeID = 0x02000027,
  361. kQTMSKnobEnv1DecayTimeID = 0x02000028,
  362. kQTMSKnobEnv1SustainLevelID = 0x02000029,
  363. kQTMSKnobEnv1SustainTimeID = 0x0200002A,
  364. kQTMSKnobEnv1SustainInfiniteID = 0x0200002B,
  365. kQTMSKnobEnv1ReleaseTimeID = 0x0200002C,
  366. kQTMSKnobEnv1ExpOptionsID = 0x0200002D, /* Env2*/
  367. kQTMSKnobEnv2AttackTimeID = 0x0200002E,
  368. kQTMSKnobEnv2DecayTimeID = 0x0200002F,
  369. kQTMSKnobEnv2SustainLevelID = 0x02000030,
  370. kQTMSKnobEnv2SustainTimeID = 0x02000031,
  371. kQTMSKnobEnv2SustainInfiniteID = 0x02000032,
  372. kQTMSKnobEnv2ReleaseTimeID = 0x02000033,
  373. kQTMSKnobEnv2ExpOptionsID = 0x02000034, /* Pitch Env*/
  374. kQTMSKnobPitchEnvelopeID = 0x02000035,
  375. kQTMSKnobPitchEnvelopeDepthID = 0x02000036, /* Filter*/
  376. kQTMSKnobFilterKeyFollowID = 0x02000037,
  377. kQTMSKnobFilterTransposeID = 0x02000038,
  378. kQTMSKnobFilterQID = 0x02000039,
  379. kQTMSKnobFilterFrequencyEnvelopeID = 0x0200003A,
  380. kQTMSKnobFilterFrequencyEnvelopeDepthID = 0x0200003B,
  381. kQTMSKnobFilterQEnvelopeID = 0x0200003C,
  382. kQTMSKnobFilterQEnvelopeDepthID = 0x0200003D, /* Reverb Threshhold*/
  383. kQTMSKnobReverbThresholdID = 0x0200003E,
  384. kQTMSKnobVolumeAttackVelScalingID = 0x0200003F,
  385. kQTMSKnobLastIDPlus1 = 0x02000040
  386. };
  387. enum {
  388. kControllerMaximum = 0x00007FFF, /* +01111111.11111111 */
  389. kControllerMinimum = (long)0xFFFF8000 /* -10000000.00000000 */
  390. };
  391. struct SynthesizerDescription {
  392. OSType synthesizerType; /* synthesizer type (must be same as component subtype) */
  393. Str31 name; /* text name of synthesizer type */
  394. unsigned long flags; /* from the above enum */
  395. unsigned long voiceCount; /* maximum polyphony */
  396. unsigned long partCount; /* maximum multi-timbrality (and midi channels) */
  397. unsigned long instrumentCount; /* non gm, built in (rom) instruments only */
  398. unsigned long modifiableInstrumentCount; /* plus n-more are user modifiable */
  399. unsigned long channelMask; /* (midi device only) which channels device always uses */
  400. unsigned long drumPartCount; /* maximum multi-timbrality of drum parts */
  401. unsigned long drumCount; /* non gm, built in (rom) drumkits only */
  402. unsigned long modifiableDrumCount; /* plus n-more are user modifiable */
  403. unsigned long drumChannelMask; /* (midi device only) which channels device always uses */
  404. unsigned long outputCount; /* number of audio outputs (usually two) */
  405. unsigned long latency; /* response time in .Sec */
  406. unsigned long controllers[4]; /* array of 128 bits */
  407. unsigned long gmInstruments[4]; /* array of 128 bits */
  408. unsigned long gmDrums[4]; /* array of 128 bits */
  409. };
  410. typedef struct SynthesizerDescription SynthesizerDescription;
  411. enum {
  412. kVoiceCountDynamic = -1 /* constant to use to specify dynamic voicing */
  413. };
  414. struct ToneDescription {
  415. BigEndianOSType synthesizerType; /* synthesizer type */
  416. Str31 synthesizerName; /* name of instantiation of synth */
  417. Str31 instrumentName; /* preferred name for human use */
  418. BigEndianLong instrumentNumber; /* inst-number used if synth-name matches */
  419. BigEndianLong gmNumber; /* Best matching general MIDI number */
  420. };
  421. typedef struct ToneDescription ToneDescription;
  422. enum {
  423. kFirstGMInstrument = 0x00000001,
  424. kLastGMInstrument = 0x00000080,
  425. kFirstGSInstrument = 0x00000081,
  426. kLastGSInstrument = 0x00003FFF,
  427. kFirstDrumkit = 0x00004000, /* (first value is "no drum". instrument numbers from 16384->16384+128 are drumkits, and for GM they are _defined_ drumkits! */
  428. kLastDrumkit = 0x00004080,
  429. kFirstROMInstrument = 0x00008000,
  430. kLastROMInstrument = 0x0000FFFF,
  431. kFirstUserInstrument = 0x00010000,
  432. kLastUserInstrument = 0x0001FFFF
  433. };
  434. /* InstrumentMatch*/
  435. enum {
  436. kInstrumentMatchSynthesizerType = 1,
  437. kInstrumentMatchSynthesizerName = 2,
  438. kInstrumentMatchName = 4,
  439. kInstrumentMatchNumber = 8,
  440. kInstrumentMatchGMNumber = 16,
  441. kInstrumentMatchGSNumber = 32
  442. };
  443. /* KnobFlags*/
  444. enum {
  445. kKnobBasic = 8, /* knob shows up in certain simplified lists of knobs */
  446. kKnobReadOnly = 16, /* knob value cannot be changed by user or with a SetKnob call */
  447. kKnobInterruptUnsafe = 32, /* only alter this knob from foreground task time (may access toolbox) */
  448. kKnobKeyrangeOverride = 64, /* knob can be overridden within a single keyrange (software synth only) */
  449. kKnobGroupStart = 128, /* knob is first in some logical group of knobs */
  450. kKnobFixedPoint8 = 1024,
  451. kKnobFixedPoint16 = 2048, /* One of these may be used at a time. */
  452. kKnobTypeNumber = 0 << 12,
  453. kKnobTypeGroupName = 1 << 12, /* "knob" is really a group name for display purposes */
  454. kKnobTypeBoolean = 2 << 12, /* if range is greater than 1, its a multi-checkbox field */
  455. kKnobTypeNote = 3 << 12, /* knob range is equivalent to MIDI keys */
  456. kKnobTypePan = 4 << 12, /* range goes left/right (lose this? ) */
  457. kKnobTypeInstrument = 5 << 12, /* knob value = reference to another instrument number */
  458. kKnobTypeSetting = 6 << 12, /* knob value is 1 of n different things (eg, fm algorithms) popup menu */
  459. kKnobTypeMilliseconds = 7 << 12, /* knob is a millisecond time range */
  460. kKnobTypePercentage = 8 << 12, /* knob range is displayed as a Percentage */
  461. kKnobTypeHertz = 9 << 12, /* knob represents frequency */
  462. kKnobTypeButton = 10 << 12 /* momentary trigger push button */
  463. };
  464. enum {
  465. kUnknownKnobValue = 0x7FFFFFFF, /* a knob with this value means, we don't know it. */
  466. kDefaultKnobValue = 0x7FFFFFFE /* used to SET a knob to its default value. */
  467. };
  468. struct KnobDescription {
  469. Str63 name;
  470. long lowValue;
  471. long highValue;
  472. long defaultValue; /* a default instrument is made of all default values */
  473. long flags;
  474. long knobID;
  475. };
  476. typedef struct KnobDescription KnobDescription;
  477. struct GCInstrumentData {
  478. ToneDescription tone;
  479. long knobCount;
  480. long knob[1];
  481. };
  482. typedef struct GCInstrumentData GCInstrumentData;
  483. typedef GCInstrumentData * GCInstrumentDataPtr;
  484. typedef GCInstrumentDataPtr * GCInstrumentDataHandle;
  485. struct InstrumentAboutInfo {
  486. PicHandle p;
  487. Str255 author;
  488. Str255 copyright;
  489. Str255 other;
  490. };
  491. typedef struct InstrumentAboutInfo InstrumentAboutInfo;
  492. enum {
  493. notImplementedMusicErr = (0x80000000 | (0xFFFF & (notImplementedMusicOSErr))),
  494. cantSendToSynthesizerErr = (0x80000000 | (0xFFFF & (cantSendToSynthesizerOSErr))),
  495. cantReceiveFromSynthesizerErr = (0x80000000 | (0xFFFF & (cantReceiveFromSynthesizerOSErr))),
  496. illegalVoiceAllocationErr = (0x80000000 | (0xFFFF & (illegalVoiceAllocationOSErr))),
  497. illegalPartErr = (0x80000000 | (0xFFFF & (illegalPartOSErr))),
  498. illegalChannelErr = (0x80000000 | (0xFFFF & (illegalChannelOSErr))),
  499. illegalKnobErr = (0x80000000 | (0xFFFF & (illegalKnobOSErr))),
  500. illegalKnobValueErr = (0x80000000 | (0xFFFF & (illegalKnobValueOSErr))),
  501. illegalInstrumentErr = (0x80000000 | (0xFFFF & (illegalInstrumentOSErr))),
  502. illegalControllerErr = (0x80000000 | (0xFFFF & (illegalControllerOSErr))),
  503. midiManagerAbsentErr = (0x80000000 | (0xFFFF & (midiManagerAbsentOSErr))),
  504. synthesizerNotRespondingErr = (0x80000000 | (0xFFFF & (synthesizerNotRespondingOSErr))),
  505. synthesizerErr = (0x80000000 | (0xFFFF & (synthesizerOSErr))),
  506. illegalNoteChannelErr = (0x80000000 | (0xFFFF & (illegalNoteChannelOSErr))),
  507. noteChannelNotAllocatedErr = (0x80000000 | (0xFFFF & (noteChannelNotAllocatedOSErr))),
  508. tunePlayerFullErr = (0x80000000 | (0xFFFF & (tunePlayerFullOSErr))),
  509. tuneParseErr = (0x80000000 | (0xFFFF & (tuneParseOSErr)))
  510. };
  511. enum {
  512. kGetAtomicInstNoExpandedSamples = 1 << 0,
  513. kGetAtomicInstNoOriginalSamples = 1 << 1,
  514. kGetAtomicInstNoSamples = kGetAtomicInstNoExpandedSamples | kGetAtomicInstNoOriginalSamples,
  515. kGetAtomicInstNoKnobList = 1 << 2,
  516. kGetAtomicInstNoInstrumentInfo = 1 << 3,
  517. kGetAtomicInstOriginalKnobList = 1 << 4,
  518. kGetAtomicInstAllKnobs = 1 << 5 /* return even those that are set to default*/
  519. };
  520. /*
  521. For non-gm instruments, instrument number of tone description == 0
  522. If you want to speed up while running, slam the inst num with what Get instrument number returns
  523. All missing knobs are slammed to the default value
  524. */
  525. enum {
  526. kSetAtomicInstKeepOriginalInstrument = 1 << 0,
  527. kSetAtomicInstShareAcrossParts = 1 << 1, /* inst disappears when app goes away*/
  528. kSetAtomicInstCallerTosses = 1 << 2, /* the caller isn't keeping a copy around (for NASetAtomicInstrument)*/
  529. kSetAtomicInstCallerGuarantees = 1 << 3, /* the caller guarantees a copy is around*/
  530. kSetAtomicInstInterruptSafe = 1 << 4, /* dont move memory at this time (but process at next task time)*/
  531. kSetAtomicInstDontPreprocess = 1 << 7 /* perform no further preprocessing because either 1)you know the instrument is digitally clean, or 2) you got it from a GetPartAtomic*/
  532. };
  533. enum {
  534. kInstrumentNamesModifiable = 1,
  535. kInstrumentNamesBoth = 2
  536. };
  537. /*
  538. * Structures specific to the GenericMusicComponent
  539. */
  540. enum {
  541. kGenericMusicComponentSubtype = FOUR_CHAR_CODE('gene')
  542. };
  543. struct GenericKnobDescription {
  544. KnobDescription kd;
  545. long hw1; /* driver defined */
  546. long hw2; /* driver defined */
  547. long hw3; /* driver defined */
  548. long settingsID; /* resource ID list for boolean and popup names */
  549. };
  550. typedef struct GenericKnobDescription GenericKnobDescription;
  551. struct GenericKnobDescriptionList {
  552. long knobCount;
  553. GenericKnobDescription knob[1];
  554. };
  555. typedef struct GenericKnobDescriptionList GenericKnobDescriptionList;
  556. typedef GenericKnobDescriptionList * GenericKnobDescriptionListPtr;
  557. typedef GenericKnobDescriptionListPtr * GenericKnobDescriptionListHandle;
  558. /* knobTypes for MusicDerivedSetKnob */
  559. enum {
  560. kGenericMusicKnob = 1,
  561. kGenericMusicInstrumentKnob = 2,
  562. kGenericMusicDrumKnob = 3,
  563. kGenericMusicGlobalController = 4
  564. };
  565. enum {
  566. kGenericMusicResFirst = 0,
  567. kGenericMusicResMiscStringList = 1, /* STR# 1: synth name, 2:about author,3:aboutcopyright,4:aboutother */
  568. kGenericMusicResMiscLongList = 2, /* Long various params, see list below */
  569. kGenericMusicResInstrumentList = 3, /* NmLs of names and shorts, categories prefixed by 'oo' */
  570. kGenericMusicResDrumList = 4, /* NmLs of names and shorts */
  571. kGenericMusicResInstrumentKnobDescriptionList = 5, /* Knob */
  572. kGenericMusicResDrumKnobDescriptionList = 6, /* Knob */
  573. kGenericMusicResKnobDescriptionList = 7, /* Knob */
  574. kGenericMusicResBitsLongList = 8, /* Long back to back bitmaps of controllers, gminstruments, and drums */
  575. kGenericMusicResModifiableInstrumentHW = 9, /* Shrt same as the hw shorts trailing the instrument names, a shortlist */
  576. kGenericMusicResGMTranslation = 10, /* Long 128 long entries, 1 for each gm inst, of local instrument numbers 1-n (not hw numbers) */
  577. kGenericMusicResROMInstrumentData = 11, /* knob lists for ROM instruments, so the knob values may be known */
  578. kGenericMusicResAboutPICT = 12, /* picture for aboutlist. must be present for GetAbout call to work */
  579. kGenericMusicResLast = 13
  580. };
  581. /* elements of the misc long list */
  582. enum {
  583. kGenericMusicMiscLongFirst = 0,
  584. kGenericMusicMiscLongVoiceCount = 1,
  585. kGenericMusicMiscLongPartCount = 2,
  586. kGenericMusicMiscLongModifiableInstrumentCount = 3,
  587. kGenericMusicMiscLongChannelMask = 4,
  588. kGenericMusicMiscLongDrumPartCount = 5,
  589. kGenericMusicMiscLongModifiableDrumCount = 6,
  590. kGenericMusicMiscLongDrumChannelMask = 7,
  591. kGenericMusicMiscLongOutputCount = 8,
  592. kGenericMusicMiscLongLatency = 9,
  593. kGenericMusicMiscLongFlags = 10,
  594. kGenericMusicMiscLongFirstGMHW = 11, /* number to add to locate GM main instruments */
  595. kGenericMusicMiscLongFirstGMDrumHW = 12, /* number to add to locate GM drumkits */
  596. kGenericMusicMiscLongFirstUserHW = 13, /* First hw number of user instruments (presumed sequential) */
  597. kGenericMusicMiscLongLast = 14
  598. };
  599. struct GCPart {
  600. long hwInstrumentNumber; /* internal number of recalled instrument */
  601. short controller[128]; /* current values for all controllers */
  602. long volume; /* ctrl 7 is special case */
  603. long polyphony;
  604. long midiChannel; /* 1-16 if in use */
  605. GCInstrumentData id; /* ToneDescription & knoblist, uncertain length */
  606. };
  607. typedef struct GCPart GCPart;
  608. /*
  609. * Calls specific to the GenericMusicComponent
  610. */
  611. enum {
  612. kMusicGenericRange = 0x0100,
  613. kMusicDerivedRange = 0x0200
  614. };
  615. /*
  616. * Flags in GenericMusicConfigure call
  617. */
  618. enum {
  619. kGenericMusicDoMIDI = 1 << 0, /* implement normal MIDI messages for note, controllers, and program changes 0-127 */
  620. kGenericMusicBank0 = 1 << 1, /* implement instrument bank changes on controller 0 */
  621. kGenericMusicBank32 = 1 << 2, /* implement instrument bank changes on controller 32 */
  622. kGenericMusicErsatzMIDI = 1 << 3, /* construct MIDI packets, but send them to the derived component */
  623. kGenericMusicCallKnobs = 1 << 4, /* call the derived component with special knob format call */
  624. kGenericMusicCallParts = 1 << 5, /* call the derived component with special part format call */
  625. kGenericMusicCallInstrument = 1 << 6, /* call MusicDerivedSetInstrument for MusicSetInstrument calls */
  626. kGenericMusicCallNumber = 1 << 7, /* call MusicDerivedSetPartInstrumentNumber for MusicSetPartInstrumentNumber calls, & don't send any C0 or bank stuff */
  627. kGenericMusicCallROMInstrument = 1 << 8, /* call MusicSetInstrument for MusicSetPartInstrumentNumber for "ROM" instruments, passing params from the ROMi resource */
  628. kGenericMusicAllDefaults = 1 << 9 /* indicates that when a new instrument is recalled, all knobs are reset to DEFAULT settings. True for GS modules */
  629. };
  630. typedef CALLBACK_API( ComponentResult , MusicOfflineDataProcPtr )(Ptr SoundData, long numBytes, long myRefCon);
  631. typedef STACK_UPP_TYPE(MusicOfflineDataProcPtr) MusicOfflineDataUPP;
  632. struct OfflineSampleType {
  633. unsigned long numChannels; /*number of channels, ie mono = 1*/
  634. UnsignedFixed sampleRate; /*sample rate in Apples Fixed point representation*/
  635. unsigned short sampleSize; /*number of bits in sample*/
  636. };
  637. typedef struct OfflineSampleType OfflineSampleType;
  638. struct InstrumentInfoRecord {
  639. long instrumentNumber; /* instrument number (if 0, name is a catagory)*/
  640. long flags; /* show in picker, etc.*/
  641. long toneNameIndex; /* index in toneNames (1 based)*/
  642. long itxtNameAtomID; /* index in itxtNames (itxt/name by index)*/
  643. };
  644. typedef struct InstrumentInfoRecord InstrumentInfoRecord;
  645. struct InstrumentInfoList {
  646. long recordCount;
  647. Handle toneNames; /* name from tone description*/
  648. QTAtomContainer itxtNames; /* itxt/name atoms for instruments*/
  649. InstrumentInfoRecord info[1];
  650. };
  651. typedef struct InstrumentInfoList InstrumentInfoList;
  652. typedef InstrumentInfoList * InstrumentInfoListPtr;
  653. typedef InstrumentInfoListPtr * InstrumentInfoListHandle;
  654. /*
  655. * MusicGetDescription()
  656. *
  657. * Availability:
  658. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  659. * CarbonLib: in CarbonLib 1.0 and later
  660. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  661. * Windows: in qtmlClient.lib 3.0 and later
  662. */
  663. EXTERN_API( ComponentResult )
  664. MusicGetDescription(
  665. MusicComponent mc,
  666. SynthesizerDescription * sd) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  667. /*
  668. * MusicGetPart()
  669. *
  670. * Availability:
  671. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  672. * CarbonLib: in CarbonLib 1.0 and later
  673. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  674. * Windows: in qtmlClient.lib 3.0 and later
  675. */
  676. EXTERN_API( ComponentResult )
  677. MusicGetPart(
  678. MusicComponent mc,
  679. long part,
  680. long * midiChannel,
  681. long * polyphony) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0002, 0x7000, 0xA82A);
  682. /*
  683. * MusicSetPart()
  684. *
  685. * Availability:
  686. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  687. * CarbonLib: in CarbonLib 1.0 and later
  688. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  689. * Windows: in qtmlClient.lib 3.0 and later
  690. */
  691. EXTERN_API( ComponentResult )
  692. MusicSetPart(
  693. MusicComponent mc,
  694. long part,
  695. long midiChannel,
  696. long polyphony) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0003, 0x7000, 0xA82A);
  697. /*
  698. * MusicSetPartInstrumentNumber()
  699. *
  700. * Availability:
  701. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  702. * CarbonLib: in CarbonLib 1.0 and later
  703. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  704. * Windows: in qtmlClient.lib 3.0 and later
  705. */
  706. EXTERN_API( ComponentResult )
  707. MusicSetPartInstrumentNumber(
  708. MusicComponent mc,
  709. long part,
  710. long instrumentNumber) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  711. #if OLDROUTINENAMES
  712. #define MusicSetInstrumentNumber(ci,part,instrumentNumber) MusicSetPartInstrumentNumber(ci, part,instrumentNumber)
  713. #endif
  714. /*
  715. * MusicGetPartInstrumentNumber()
  716. *
  717. * Availability:
  718. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  719. * CarbonLib: in CarbonLib 1.0 and later
  720. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  721. * Windows: in qtmlClient.lib 3.0 and later
  722. */
  723. EXTERN_API( ComponentResult )
  724. MusicGetPartInstrumentNumber(
  725. MusicComponent mc,
  726. long part) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  727. /*
  728. * MusicStorePartInstrument()
  729. *
  730. * Availability:
  731. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  732. * CarbonLib: in CarbonLib 1.0 and later
  733. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  734. * Windows: in qtmlClient.lib 3.0 and later
  735. */
  736. EXTERN_API( ComponentResult )
  737. MusicStorePartInstrument(
  738. MusicComponent mc,
  739. long part,
  740. long instrumentNumber) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0006, 0x7000, 0xA82A);
  741. /*
  742. * MusicGetPartAtomicInstrument()
  743. *
  744. * Availability:
  745. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  746. * CarbonLib: in CarbonLib 1.0 and later
  747. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  748. * Windows: in qtmlClient.lib 3.0 and later
  749. */
  750. EXTERN_API( ComponentResult )
  751. MusicGetPartAtomicInstrument(
  752. MusicComponent mc,
  753. long part,
  754. AtomicInstrument * ai,
  755. long flags) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0009, 0x7000, 0xA82A);
  756. /*
  757. * MusicSetPartAtomicInstrument()
  758. *
  759. * Availability:
  760. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  761. * CarbonLib: in CarbonLib 1.0 and later
  762. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  763. * Windows: in qtmlClient.lib 3.0 and later
  764. */
  765. EXTERN_API( ComponentResult )
  766. MusicSetPartAtomicInstrument(
  767. MusicComponent mc,
  768. long part,
  769. AtomicInstrumentPtr aiP,
  770. long flags) FIVEWORDINLINE(0x2F3C, 0x000C, 0x000A, 0x7000, 0xA82A);
  771. /*
  772. * MusicGetPartKnob()
  773. *
  774. * Availability:
  775. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  776. * CarbonLib: in CarbonLib 1.0 and later
  777. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  778. * Windows: in qtmlClient.lib 3.0 and later
  779. */
  780. EXTERN_API( ComponentResult )
  781. MusicGetPartKnob(
  782. MusicComponent mc,
  783. long part,
  784. long knobID) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0010, 0x7000, 0xA82A);
  785. /*
  786. * MusicSetPartKnob()
  787. *
  788. * Availability:
  789. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  790. * CarbonLib: in CarbonLib 1.0 and later
  791. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  792. * Windows: in qtmlClient.lib 3.0 and later
  793. */
  794. EXTERN_API( ComponentResult )
  795. MusicSetPartKnob(
  796. MusicComponent mc,
  797. long part,
  798. long knobID,
  799. long knobValue) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0011, 0x7000, 0xA82A);
  800. /*
  801. * MusicGetKnob()
  802. *
  803. * Availability:
  804. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  805. * CarbonLib: in CarbonLib 1.0 and later
  806. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  807. * Windows: in qtmlClient.lib 3.0 and later
  808. */
  809. EXTERN_API( ComponentResult )
  810. MusicGetKnob(
  811. MusicComponent mc,
  812. long knobID) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0012, 0x7000, 0xA82A);
  813. /*
  814. * MusicSetKnob()
  815. *
  816. * Availability:
  817. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  818. * CarbonLib: in CarbonLib 1.0 and later
  819. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  820. * Windows: in qtmlClient.lib 3.0 and later
  821. */
  822. EXTERN_API( ComponentResult )
  823. MusicSetKnob(
  824. MusicComponent mc,
  825. long knobID,
  826. long knobValue) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0013, 0x7000, 0xA82A);
  827. /*
  828. * MusicGetPartName()
  829. *
  830. * Availability:
  831. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  832. * CarbonLib: in CarbonLib 1.0 and later
  833. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  834. * Windows: in qtmlClient.lib 3.0 and later
  835. */
  836. EXTERN_API( ComponentResult )
  837. MusicGetPartName(
  838. MusicComponent mc,
  839. long part,
  840. StringPtr name) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0014, 0x7000, 0xA82A);
  841. /*
  842. * MusicSetPartName()
  843. *
  844. * Availability:
  845. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  846. * CarbonLib: in CarbonLib 1.0 and later
  847. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  848. * Windows: in qtmlClient.lib 3.0 and later
  849. */
  850. EXTERN_API( ComponentResult )
  851. MusicSetPartName(
  852. MusicComponent mc,
  853. long part,
  854. StringPtr name) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0015, 0x7000, 0xA82A);
  855. /*
  856. * MusicFindTone()
  857. *
  858. * Availability:
  859. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  860. * CarbonLib: in CarbonLib 1.0 and later
  861. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  862. * Windows: in qtmlClient.lib 3.0 and later
  863. */
  864. EXTERN_API( ComponentResult )
  865. MusicFindTone(
  866. MusicComponent mc,
  867. ToneDescription * td,
  868. long * libraryIndexOut,
  869. unsigned long * fit) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0016, 0x7000, 0xA82A);
  870. /*
  871. * MusicPlayNote()
  872. *
  873. * Availability:
  874. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  875. * CarbonLib: in CarbonLib 1.0 and later
  876. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  877. * Windows: in qtmlClient.lib 3.0 and later
  878. */
  879. EXTERN_API( ComponentResult )
  880. MusicPlayNote(
  881. MusicComponent mc,
  882. long part,
  883. long pitch,
  884. long velocity) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0017, 0x7000, 0xA82A);
  885. /*
  886. * MusicResetPart()
  887. *
  888. * Availability:
  889. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  890. * CarbonLib: in CarbonLib 1.0 and later
  891. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  892. * Windows: in qtmlClient.lib 3.0 and later
  893. */
  894. EXTERN_API( ComponentResult )
  895. MusicResetPart(
  896. MusicComponent mc,
  897. long part) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  898. /*
  899. * MusicSetPartController()
  900. *
  901. * Availability:
  902. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  903. * CarbonLib: in CarbonLib 1.0 and later
  904. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  905. * Windows: in qtmlClient.lib 3.0 and later
  906. */
  907. EXTERN_API( ComponentResult )
  908. MusicSetPartController(
  909. MusicComponent mc,
  910. long part,
  911. MusicController controllerNumber,
  912. long controllerValue) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0019, 0x7000, 0xA82A);
  913. #if OLDROUTINENAMES
  914. #define MusicSetController(ci,part,controllerNumber,controllerValue) MusicSetPartController(ci, part,controllerNumber,controllerValue)
  915. #endif
  916. /*
  917. * MusicGetPartController()
  918. *
  919. * Availability:
  920. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  921. * CarbonLib: in CarbonLib 1.0 and later
  922. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  923. * Windows: in qtmlClient.lib 3.0 and later
  924. */
  925. EXTERN_API( ComponentResult )
  926. MusicGetPartController(
  927. MusicComponent mc,
  928. long part,
  929. MusicController controllerNumber) FIVEWORDINLINE(0x2F3C, 0x0008, 0x001A, 0x7000, 0xA82A);
  930. /*
  931. * MusicGetMIDIProc()
  932. *
  933. * Availability:
  934. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  935. * CarbonLib: in CarbonLib 1.0 and later
  936. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  937. * Windows: in qtmlClient.lib 3.0 and later
  938. */
  939. EXTERN_API( ComponentResult )
  940. MusicGetMIDIProc(
  941. MusicComponent mc,
  942. MusicMIDISendUPP * midiSendProc,
  943. long * refCon) FIVEWORDINLINE(0x2F3C, 0x0008, 0x001B, 0x7000, 0xA82A);
  944. /*
  945. * MusicSetMIDIProc()
  946. *
  947. * Availability:
  948. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  949. * CarbonLib: in CarbonLib 1.0 and later
  950. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  951. * Windows: in qtmlClient.lib 3.0 and later
  952. */
  953. EXTERN_API( ComponentResult )
  954. MusicSetMIDIProc(
  955. MusicComponent mc,
  956. MusicMIDISendUPP midiSendProc,
  957. long refCon) FIVEWORDINLINE(0x2F3C, 0x0008, 0x001C, 0x7000, 0xA82A);
  958. /*
  959. * MusicGetInstrumentNames()
  960. *
  961. * Availability:
  962. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  963. * CarbonLib: in CarbonLib 1.0 and later
  964. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  965. * Windows: in qtmlClient.lib 3.0 and later
  966. */
  967. EXTERN_API( ComponentResult )
  968. MusicGetInstrumentNames(
  969. MusicComponent mc,
  970. long modifiableInstruments,
  971. Handle * instrumentNames,
  972. Handle * instrumentCategoryLasts,
  973. Handle * instrumentCategoryNames) FIVEWORDINLINE(0x2F3C, 0x0010, 0x001D, 0x7000, 0xA82A);
  974. /*
  975. * MusicGetDrumNames()
  976. *
  977. * Availability:
  978. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  979. * CarbonLib: in CarbonLib 1.0 and later
  980. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  981. * Windows: in qtmlClient.lib 3.0 and later
  982. */
  983. EXTERN_API( ComponentResult )
  984. MusicGetDrumNames(
  985. MusicComponent mc,
  986. long modifiableInstruments,
  987. Handle * instrumentNumbers,
  988. Handle * instrumentNames) FIVEWORDINLINE(0x2F3C, 0x000C, 0x001E, 0x7000, 0xA82A);
  989. /*
  990. * MusicGetMasterTune()
  991. *
  992. * Availability:
  993. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  994. * CarbonLib: in CarbonLib 1.0 and later
  995. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  996. * Windows: in qtmlClient.lib 3.0 and later
  997. */
  998. EXTERN_API( ComponentResult )
  999. MusicGetMasterTune(MusicComponent mc) FIVEWORDINLINE(0x2F3C, 0x0000, 0x001F, 0x7000, 0xA82A);
  1000. /*
  1001. * MusicSetMasterTune()
  1002. *
  1003. * Availability:
  1004. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1005. * CarbonLib: in CarbonLib 1.0 and later
  1006. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1007. * Windows: in qtmlClient.lib 3.0 and later
  1008. */
  1009. EXTERN_API( ComponentResult )
  1010. MusicSetMasterTune(
  1011. MusicComponent mc,
  1012. long masterTune) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0020, 0x7000, 0xA82A);
  1013. /*
  1014. * MusicGetInstrumentAboutInfo()
  1015. *
  1016. * Availability:
  1017. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1018. * CarbonLib: in CarbonLib 1.0 and later
  1019. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1020. * Windows: in qtmlClient.lib 3.0 and later
  1021. */
  1022. EXTERN_API( ComponentResult )
  1023. MusicGetInstrumentAboutInfo(
  1024. MusicComponent mc,
  1025. long part,
  1026. InstrumentAboutInfo * iai) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0022, 0x7000, 0xA82A);
  1027. /*
  1028. * MusicGetDeviceConnection()
  1029. *
  1030. * Availability:
  1031. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1032. * CarbonLib: in CarbonLib 1.0 and later
  1033. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1034. * Windows: in qtmlClient.lib 3.0 and later
  1035. */
  1036. EXTERN_API( ComponentResult )
  1037. MusicGetDeviceConnection(
  1038. MusicComponent mc,
  1039. long index,
  1040. long * id1,
  1041. long * id2) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0023, 0x7000, 0xA82A);
  1042. /*
  1043. * MusicUseDeviceConnection()
  1044. *
  1045. * Availability:
  1046. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1047. * CarbonLib: in CarbonLib 1.0 and later
  1048. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1049. * Windows: in qtmlClient.lib 3.0 and later
  1050. */
  1051. EXTERN_API( ComponentResult )
  1052. MusicUseDeviceConnection(
  1053. MusicComponent mc,
  1054. long id1,
  1055. long id2) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0024, 0x7000, 0xA82A);
  1056. /*
  1057. * MusicGetKnobSettingStrings()
  1058. *
  1059. * Availability:
  1060. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1061. * CarbonLib: in CarbonLib 1.0 and later
  1062. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1063. * Windows: in qtmlClient.lib 3.0 and later
  1064. */
  1065. EXTERN_API( ComponentResult )
  1066. MusicGetKnobSettingStrings(
  1067. MusicComponent mc,
  1068. long knobIndex,
  1069. long isGlobal,
  1070. Handle * settingsNames,
  1071. Handle * settingsCategoryLasts,
  1072. Handle * settingsCategoryNames) FIVEWORDINLINE(0x2F3C, 0x0014, 0x0025, 0x7000, 0xA82A);
  1073. /*
  1074. * MusicGetMIDIPorts()
  1075. *
  1076. * Availability:
  1077. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1078. * CarbonLib: in CarbonLib 1.0 and later
  1079. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1080. * Windows: in qtmlClient.lib 3.0 and later
  1081. */
  1082. EXTERN_API( ComponentResult )
  1083. MusicGetMIDIPorts(
  1084. MusicComponent mc,
  1085. long * inputPortCount,
  1086. long * outputPortCount) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0026, 0x7000, 0xA82A);
  1087. /*
  1088. * MusicSendMIDI()
  1089. *
  1090. * Availability:
  1091. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1092. * CarbonLib: in CarbonLib 1.0 and later
  1093. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1094. * Windows: in qtmlClient.lib 3.0 and later
  1095. */
  1096. EXTERN_API( ComponentResult )
  1097. MusicSendMIDI(
  1098. MusicComponent mc,
  1099. long portIndex,
  1100. MusicMIDIPacket * mp) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0027, 0x7000, 0xA82A);
  1101. /*
  1102. * MusicStartOffline()
  1103. *
  1104. * Availability:
  1105. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1106. * CarbonLib: in CarbonLib 1.0 and later
  1107. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1108. * Windows: in qtmlClient.lib 3.0 and later
  1109. */
  1110. EXTERN_API( ComponentResult )
  1111. MusicStartOffline(
  1112. MusicComponent mc,
  1113. unsigned long * numChannels,
  1114. UnsignedFixed * sampleRate,
  1115. unsigned short * sampleSize,
  1116. MusicOfflineDataUPP dataProc,
  1117. long dataProcRefCon) FIVEWORDINLINE(0x2F3C, 0x0014, 0x0029, 0x7000, 0xA82A);
  1118. /*
  1119. * MusicSetOfflineTimeTo()
  1120. *
  1121. * Availability:
  1122. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1123. * CarbonLib: in CarbonLib 1.0 and later
  1124. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1125. * Windows: in qtmlClient.lib 3.0 and later
  1126. */
  1127. EXTERN_API( ComponentResult )
  1128. MusicSetOfflineTimeTo(
  1129. MusicComponent mc,
  1130. long newTimeStamp) FIVEWORDINLINE(0x2F3C, 0x0004, 0x002A, 0x7000, 0xA82A);
  1131. /*
  1132. * MusicGetInstrumentKnobDescription()
  1133. *
  1134. * Availability:
  1135. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1136. * CarbonLib: in CarbonLib 1.0 and later
  1137. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1138. * Windows: in qtmlClient.lib 3.0 and later
  1139. */
  1140. EXTERN_API( ComponentResult )
  1141. MusicGetInstrumentKnobDescription(
  1142. MusicComponent mc,
  1143. long knobIndex,
  1144. KnobDescription * mkd) FIVEWORDINLINE(0x2F3C, 0x0008, 0x002B, 0x7000, 0xA82A);
  1145. /*
  1146. * MusicGetDrumKnobDescription()
  1147. *
  1148. * Availability:
  1149. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1150. * CarbonLib: in CarbonLib 1.0 and later
  1151. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1152. * Windows: in qtmlClient.lib 3.0 and later
  1153. */
  1154. EXTERN_API( ComponentResult )
  1155. MusicGetDrumKnobDescription(
  1156. MusicComponent mc,
  1157. long knobIndex,
  1158. KnobDescription * mkd) FIVEWORDINLINE(0x2F3C, 0x0008, 0x002C, 0x7000, 0xA82A);
  1159. /*
  1160. * MusicGetKnobDescription()
  1161. *
  1162. * Availability:
  1163. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1164. * CarbonLib: in CarbonLib 1.0 and later
  1165. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1166. * Windows: in qtmlClient.lib 3.0 and later
  1167. */
  1168. EXTERN_API( ComponentResult )
  1169. MusicGetKnobDescription(
  1170. MusicComponent mc,
  1171. long knobIndex,
  1172. KnobDescription * mkd) FIVEWORDINLINE(0x2F3C, 0x0008, 0x002D, 0x7000, 0xA82A);
  1173. /*
  1174. * MusicGetInfoText()
  1175. *
  1176. * Availability:
  1177. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1178. * CarbonLib: in CarbonLib 1.0 and later
  1179. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1180. * Windows: in qtmlClient.lib 3.0 and later
  1181. */
  1182. EXTERN_API( ComponentResult )
  1183. MusicGetInfoText(
  1184. MusicComponent mc,
  1185. long selector,
  1186. Handle * textH,
  1187. Handle * styleH) FIVEWORDINLINE(0x2F3C, 0x000C, 0x002E, 0x7000, 0xA82A);
  1188. enum {
  1189. kGetInstrumentInfoNoBuiltIn = 1 << 0,
  1190. kGetInstrumentInfoMidiUserInst = 1 << 1,
  1191. kGetInstrumentInfoNoIText = 1 << 2
  1192. };
  1193. /*
  1194. * MusicGetInstrumentInfo()
  1195. *
  1196. * Availability:
  1197. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1198. * CarbonLib: in CarbonLib 1.0 and later
  1199. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1200. * Windows: in qtmlClient.lib 3.0 and later
  1201. */
  1202. EXTERN_API( ComponentResult )
  1203. MusicGetInstrumentInfo(
  1204. MusicComponent mc,
  1205. long getInstrumentInfoFlags,
  1206. InstrumentInfoListHandle * infoListH) FIVEWORDINLINE(0x2F3C, 0x0008, 0x002F, 0x7000, 0xA82A);
  1207. /*
  1208. * MusicTask()
  1209. *
  1210. * Availability:
  1211. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1212. * CarbonLib: in CarbonLib 1.0 and later
  1213. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1214. * Windows: in qtmlClient.lib 3.0 and later
  1215. */
  1216. EXTERN_API( ComponentResult )
  1217. MusicTask(MusicComponent mc) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0031, 0x7000, 0xA82A);
  1218. /*
  1219. * MusicSetPartInstrumentNumberInterruptSafe()
  1220. *
  1221. * Availability:
  1222. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1223. * CarbonLib: in CarbonLib 1.0 and later
  1224. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1225. * Windows: in qtmlClient.lib 3.0 and later
  1226. */
  1227. EXTERN_API( ComponentResult )
  1228. MusicSetPartInstrumentNumberInterruptSafe(
  1229. MusicComponent mc,
  1230. long part,
  1231. long instrumentNumber) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0032, 0x7000, 0xA82A);
  1232. /*
  1233. * MusicSetPartSoundLocalization()
  1234. *
  1235. * Availability:
  1236. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1237. * CarbonLib: in CarbonLib 1.0 and later
  1238. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1239. * Windows: in qtmlClient.lib 3.0 and later
  1240. */
  1241. EXTERN_API( ComponentResult )
  1242. MusicSetPartSoundLocalization(
  1243. MusicComponent mc,
  1244. long part,
  1245. Handle data) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0033, 0x7000, 0xA82A);
  1246. /*
  1247. * MusicGenericConfigure()
  1248. *
  1249. * Availability:
  1250. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1251. * CarbonLib: in CarbonLib 1.0 and later
  1252. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1253. * Windows: in qtmlClient.lib 3.0 and later
  1254. */
  1255. EXTERN_API( ComponentResult )
  1256. MusicGenericConfigure(
  1257. MusicComponent mc,
  1258. long mode,
  1259. long flags,
  1260. long baseResID) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0100, 0x7000, 0xA82A);
  1261. /*
  1262. * MusicGenericGetPart()
  1263. *
  1264. * Availability:
  1265. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1266. * CarbonLib: in CarbonLib 1.0 and later
  1267. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1268. * Windows: in qtmlClient.lib 3.0 and later
  1269. */
  1270. EXTERN_API( ComponentResult )
  1271. MusicGenericGetPart(
  1272. MusicComponent mc,
  1273. long partNumber,
  1274. GCPart ** part) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0101, 0x7000, 0xA82A);
  1275. /*
  1276. * MusicGenericGetKnobList()
  1277. *
  1278. * Availability:
  1279. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1280. * CarbonLib: in CarbonLib 1.0 and later
  1281. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1282. * Windows: in qtmlClient.lib 3.0 and later
  1283. */
  1284. EXTERN_API( ComponentResult )
  1285. MusicGenericGetKnobList(
  1286. MusicComponent mc,
  1287. long knobType,
  1288. GenericKnobDescriptionListHandle * gkdlH) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0102, 0x7000, 0xA82A);
  1289. /*
  1290. * MusicGenericSetResourceNumbers()
  1291. *
  1292. * Availability:
  1293. * Non-Carbon CFM: in QuickTimeLib 3.0 and later
  1294. * CarbonLib: in CarbonLib 1.0 and later
  1295. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1296. * Windows: in qtmlClient.lib 3.0 and later
  1297. */
  1298. EXTERN_API( ComponentResult )
  1299. MusicGenericSetResourceNumbers(
  1300. MusicComponent mc,
  1301. Handle resourceIDH) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0103, 0x7000, 0xA82A);
  1302. /*
  1303. * MusicDerivedMIDISend()
  1304. *
  1305. * Availability:
  1306. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1307. * CarbonLib: in CarbonLib 1.0 and later
  1308. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1309. * Windows: in qtmlClient.lib 3.0 and later
  1310. */
  1311. EXTERN_API( ComponentResult )
  1312. MusicDerivedMIDISend(
  1313. MusicComponent mc,
  1314. MusicMIDIPacket * packet) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0200, 0x7000, 0xA82A);
  1315. /*
  1316. * MusicDerivedSetKnob()
  1317. *
  1318. * Availability:
  1319. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1320. * CarbonLib: in CarbonLib 1.0 and later
  1321. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1322. * Windows: in qtmlClient.lib 3.0 and later
  1323. */
  1324. EXTERN_API( ComponentResult )
  1325. MusicDerivedSetKnob(
  1326. MusicComponent mc,
  1327. long knobType,
  1328. long knobNumber,
  1329. long knobValue,
  1330. long partNumber,
  1331. GCPart * p,
  1332. GenericKnobDescription * gkd) FIVEWORDINLINE(0x2F3C, 0x0018, 0x0201, 0x7000, 0xA82A);
  1333. /*
  1334. * MusicDerivedSetPart()
  1335. *
  1336. * Availability:
  1337. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1338. * CarbonLib: in CarbonLib 1.0 and later
  1339. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1340. * Windows: in qtmlClient.lib 3.0 and later
  1341. */
  1342. EXTERN_API( ComponentResult )
  1343. MusicDerivedSetPart(
  1344. MusicComponent mc,
  1345. long partNumber,
  1346. GCPart * p) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0202, 0x7000, 0xA82A);
  1347. /*
  1348. * MusicDerivedSetInstrument()
  1349. *
  1350. * Availability:
  1351. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1352. * CarbonLib: in CarbonLib 1.0 and later
  1353. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1354. * Windows: in qtmlClient.lib 3.0 and later
  1355. */
  1356. EXTERN_API( ComponentResult )
  1357. MusicDerivedSetInstrument(
  1358. MusicComponent mc,
  1359. long partNumber,
  1360. GCPart * p) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0203, 0x7000, 0xA82A);
  1361. /*
  1362. * MusicDerivedSetPartInstrumentNumber()
  1363. *
  1364. * Availability:
  1365. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1366. * CarbonLib: in CarbonLib 1.0 and later
  1367. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1368. * Windows: in qtmlClient.lib 3.0 and later
  1369. */
  1370. EXTERN_API( ComponentResult )
  1371. MusicDerivedSetPartInstrumentNumber(
  1372. MusicComponent mc,
  1373. long partNumber,
  1374. GCPart * p) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0204, 0x7000, 0xA82A);
  1375. /*
  1376. * MusicDerivedSetMIDI()
  1377. *
  1378. * Availability:
  1379. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1380. * CarbonLib: in CarbonLib 1.0 and later
  1381. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1382. * Windows: in qtmlClient.lib 3.0 and later
  1383. */
  1384. EXTERN_API( ComponentResult )
  1385. MusicDerivedSetMIDI(
  1386. MusicComponent mc,
  1387. MusicMIDISendUPP midiProc,
  1388. long refcon,
  1389. long midiChannel) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0205, 0x7000, 0xA82A);
  1390. /*
  1391. * MusicDerivedStorePartInstrument()
  1392. *
  1393. * Availability:
  1394. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1395. * CarbonLib: in CarbonLib 1.0 and later
  1396. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1397. * Windows: in qtmlClient.lib 3.0 and later
  1398. */
  1399. EXTERN_API( ComponentResult )
  1400. MusicDerivedStorePartInstrument(
  1401. MusicComponent mc,
  1402. long partNumber,
  1403. GCPart * p,
  1404. long instrumentNumber) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0206, 0x7000, 0xA82A);
  1405. /*
  1406. * MusicDerivedOpenResFile()
  1407. *
  1408. * Availability:
  1409. * Non-Carbon CFM: in QuickTimeLib 3.0 and later
  1410. * CarbonLib: in CarbonLib 1.0 and later
  1411. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1412. * Windows: in qtmlClient.lib 3.0 and later
  1413. */
  1414. EXTERN_API( ComponentResult )
  1415. MusicDerivedOpenResFile(MusicComponent mc) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0207, 0x7000, 0xA82A);
  1416. /*
  1417. * MusicDerivedCloseResFile()
  1418. *
  1419. * Availability:
  1420. * Non-Carbon CFM: in QuickTimeLib 3.0 and later
  1421. * CarbonLib: in CarbonLib 1.0 and later
  1422. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1423. * Windows: in qtmlClient.lib 3.0 and later
  1424. */
  1425. EXTERN_API( ComponentResult )
  1426. MusicDerivedCloseResFile(
  1427. MusicComponent mc,
  1428. short resRefNum) FIVEWORDINLINE(0x2F3C, 0x0002, 0x0208, 0x7000, 0xA82A);
  1429. /*--------------------------
  1430. Types
  1431. --------------------------*/
  1432. enum {
  1433. kNoteRequestNoGM = 1, /* don't degrade to a GM synth */
  1434. kNoteRequestNoSynthType = 2, /* don't degrade to another synth of same type but different name */
  1435. kNoteRequestSynthMustMatch = 4 /* synthType must be a match, including kGMSynthComponentSubType */
  1436. };
  1437. enum {
  1438. kNoteRequestSpecifyMIDIChannel = 0x80
  1439. };
  1440. typedef ComponentInstance NoteAllocator;
  1441. /*
  1442. The midiChannelAssignment field of this structure is used to assign a MIDI channel
  1443. when a NoteChannel is created from a NoteRequest.
  1444. A value of 0 indicates a MIDI channel has *not* been assigned
  1445. A value of (kNoteRequestSpecifyMIDIChannel | 1->16) is a MIDI channel assignment
  1446. This field requires QuickTime 5.0 or later and should be set to 0 for prior versions.
  1447. */
  1448. typedef UInt8 NoteRequestMIDIChannel;
  1449. struct NoteRequestInfo {
  1450. UInt8 flags; /* 1: dont accept GM match, 2: dont accept same-synth-type match */
  1451. NoteRequestMIDIChannel midiChannelAssignment; /* (kNoteRequestSpecifyMIDIChannel | 1->16) as MIDI Channel assignement or zero - see notes above */
  1452. BigEndianShort polyphony; /* Maximum number of voices */
  1453. BigEndianFixed typicalPolyphony; /* Hint for level mixing */
  1454. };
  1455. typedef struct NoteRequestInfo NoteRequestInfo;
  1456. struct NoteRequest {
  1457. NoteRequestInfo info;
  1458. ToneDescription tone;
  1459. };
  1460. typedef struct NoteRequest NoteRequest;
  1461. typedef long NoteChannel;
  1462. enum {
  1463. kPickDontMix = 1, /* dont mix instruments with drum sounds */
  1464. kPickSameSynth = 2, /* only allow the same device that went in, to come out */
  1465. kPickUserInsts = 4, /* show user insts in addition to ROM voices */
  1466. kPickEditAllowEdit = 8, /* lets user switch over to edit mode */
  1467. kPickEditAllowPick = 16, /* lets the user switch over to pick mode */
  1468. kPickEditSynthGlobal = 32, /* edit the global knobs of the synth */
  1469. kPickEditControllers = 64 /* edit the controllers of the notechannel */
  1470. };
  1471. enum {
  1472. kNoteAllocatorComponentType = FOUR_CHAR_CODE('nota')
  1473. };
  1474. /*--------------------------------
  1475. Note Allocator Prototypes
  1476. --------------------------------*/
  1477. /*
  1478. * NARegisterMusicDevice()
  1479. *
  1480. * Availability:
  1481. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1482. * CarbonLib: in CarbonLib 1.0 and later
  1483. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1484. * Windows: in qtmlClient.lib 3.0 and later
  1485. */
  1486. EXTERN_API( ComponentResult )
  1487. NARegisterMusicDevice(
  1488. NoteAllocator na,
  1489. OSType synthType,
  1490. Str31 name,
  1491. SynthesizerConnections * connections) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0000, 0x7000, 0xA82A);
  1492. /*
  1493. * NAUnregisterMusicDevice()
  1494. *
  1495. * Availability:
  1496. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1497. * CarbonLib: in CarbonLib 1.0 and later
  1498. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1499. * Windows: in qtmlClient.lib 3.0 and later
  1500. */
  1501. EXTERN_API( ComponentResult )
  1502. NAUnregisterMusicDevice(
  1503. NoteAllocator na,
  1504. long index) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  1505. /*
  1506. * NAGetRegisteredMusicDevice()
  1507. *
  1508. * Availability:
  1509. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1510. * CarbonLib: in CarbonLib 1.0 and later
  1511. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1512. * Windows: in qtmlClient.lib 3.0 and later
  1513. */
  1514. EXTERN_API( ComponentResult )
  1515. NAGetRegisteredMusicDevice(
  1516. NoteAllocator na,
  1517. long index,
  1518. OSType * synthType,
  1519. Str31 name,
  1520. SynthesizerConnections * connections,
  1521. MusicComponent * mc) FIVEWORDINLINE(0x2F3C, 0x0014, 0x0002, 0x7000, 0xA82A);
  1522. /*
  1523. * NASaveMusicConfiguration()
  1524. *
  1525. * Availability:
  1526. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1527. * CarbonLib: in CarbonLib 1.0 and later
  1528. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1529. * Windows: in qtmlClient.lib 3.0 and later
  1530. */
  1531. EXTERN_API( ComponentResult )
  1532. NASaveMusicConfiguration(NoteAllocator na) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0003, 0x7000, 0xA82A);
  1533. /*
  1534. * NANewNoteChannel()
  1535. *
  1536. * Availability:
  1537. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1538. * CarbonLib: in CarbonLib 1.0 and later
  1539. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1540. * Windows: in qtmlClient.lib 3.0 and later
  1541. */
  1542. EXTERN_API( ComponentResult )
  1543. NANewNoteChannel(
  1544. NoteAllocator na,
  1545. NoteRequest * noteRequest,
  1546. NoteChannel * outChannel) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  1547. /*
  1548. * NADisposeNoteChannel()
  1549. *
  1550. * Availability:
  1551. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1552. * CarbonLib: in CarbonLib 1.0 and later
  1553. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1554. * Windows: in qtmlClient.lib 3.0 and later
  1555. */
  1556. EXTERN_API( ComponentResult )
  1557. NADisposeNoteChannel(
  1558. NoteAllocator na,
  1559. NoteChannel noteChannel) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  1560. /*
  1561. * NAGetNoteChannelInfo()
  1562. *
  1563. * Availability:
  1564. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1565. * CarbonLib: in CarbonLib 1.0 and later
  1566. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1567. * Windows: in qtmlClient.lib 3.0 and later
  1568. */
  1569. EXTERN_API( ComponentResult )
  1570. NAGetNoteChannelInfo(
  1571. NoteAllocator na,
  1572. NoteChannel noteChannel,
  1573. long * index,
  1574. long * part) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0006, 0x7000, 0xA82A);
  1575. /*
  1576. * NAPrerollNoteChannel()
  1577. *
  1578. * Availability:
  1579. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1580. * CarbonLib: in CarbonLib 1.0 and later
  1581. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1582. * Windows: in qtmlClient.lib 3.0 and later
  1583. */
  1584. EXTERN_API( ComponentResult )
  1585. NAPrerollNoteChannel(
  1586. NoteAllocator na,
  1587. NoteChannel noteChannel) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  1588. /*
  1589. * NAUnrollNoteChannel()
  1590. *
  1591. * Availability:
  1592. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1593. * CarbonLib: in CarbonLib 1.0 and later
  1594. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1595. * Windows: in qtmlClient.lib 3.0 and later
  1596. */
  1597. EXTERN_API( ComponentResult )
  1598. NAUnrollNoteChannel(
  1599. NoteAllocator na,
  1600. NoteChannel noteChannel) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0008, 0x7000, 0xA82A);
  1601. /*
  1602. * NASetNoteChannelVolume()
  1603. *
  1604. * Availability:
  1605. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1606. * CarbonLib: in CarbonLib 1.0 and later
  1607. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1608. * Windows: in qtmlClient.lib 3.0 and later
  1609. */
  1610. EXTERN_API( ComponentResult )
  1611. NASetNoteChannelVolume(
  1612. NoteAllocator na,
  1613. NoteChannel noteChannel,
  1614. Fixed volume) FIVEWORDINLINE(0x2F3C, 0x0008, 0x000B, 0x7000, 0xA82A);
  1615. /*
  1616. * NAResetNoteChannel()
  1617. *
  1618. * Availability:
  1619. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1620. * CarbonLib: in CarbonLib 1.0 and later
  1621. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1622. * Windows: in qtmlClient.lib 3.0 and later
  1623. */
  1624. EXTERN_API( ComponentResult )
  1625. NAResetNoteChannel(
  1626. NoteAllocator na,
  1627. NoteChannel noteChannel) FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  1628. /*
  1629. * NAPlayNote()
  1630. *
  1631. * Availability:
  1632. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1633. * CarbonLib: in CarbonLib 1.0 and later
  1634. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1635. * Windows: in qtmlClient.lib 3.0 and later
  1636. */
  1637. EXTERN_API( ComponentResult )
  1638. NAPlayNote(
  1639. NoteAllocator na,
  1640. NoteChannel noteChannel,
  1641. long pitch,
  1642. long velocity) FIVEWORDINLINE(0x2F3C, 0x000C, 0x000D, 0x7000, 0xA82A);
  1643. /*
  1644. * NASetController()
  1645. *
  1646. * Availability:
  1647. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1648. * CarbonLib: in CarbonLib 1.0 and later
  1649. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1650. * Windows: in qtmlClient.lib 3.0 and later
  1651. */
  1652. EXTERN_API( ComponentResult )
  1653. NASetController(
  1654. NoteAllocator na,
  1655. NoteChannel noteChannel,
  1656. long controllerNumber,
  1657. long controllerValue) FIVEWORDINLINE(0x2F3C, 0x000C, 0x000E, 0x7000, 0xA82A);
  1658. /*
  1659. * NASetKnob()
  1660. *
  1661. * Availability:
  1662. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1663. * CarbonLib: in CarbonLib 1.0 and later
  1664. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1665. * Windows: in qtmlClient.lib 3.0 and later
  1666. */
  1667. EXTERN_API( ComponentResult )
  1668. NASetKnob(
  1669. NoteAllocator na,
  1670. NoteChannel noteChannel,
  1671. long knobNumber,
  1672. long knobValue) FIVEWORDINLINE(0x2F3C, 0x000C, 0x000F, 0x7000, 0xA82A);
  1673. /*
  1674. * NAFindNoteChannelTone()
  1675. *
  1676. * Availability:
  1677. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1678. * CarbonLib: in CarbonLib 1.0 and later
  1679. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1680. * Windows: in qtmlClient.lib 3.0 and later
  1681. */
  1682. EXTERN_API( ComponentResult )
  1683. NAFindNoteChannelTone(
  1684. NoteAllocator na,
  1685. NoteChannel noteChannel,
  1686. ToneDescription * td,
  1687. long * instrumentNumber) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0010, 0x7000, 0xA82A);
  1688. /*
  1689. * NASetInstrumentNumber()
  1690. *
  1691. * Availability:
  1692. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1693. * CarbonLib: in CarbonLib 1.0 and later
  1694. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1695. * Windows: in qtmlClient.lib 3.0 and later
  1696. */
  1697. EXTERN_API( ComponentResult )
  1698. NASetInstrumentNumber(
  1699. NoteAllocator na,
  1700. NoteChannel noteChannel,
  1701. long instrumentNumber) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0011, 0x7000, 0xA82A);
  1702. #if OLDROUTINENAMES
  1703. #define NASetNoteChannelInstrument(ci, noteChannel,instrumentNumber ) NASetInstrumentNumber(ci, noteChannel,instrumentNumber)
  1704. #define NASetInstrument(ci, noteChannel,instrumentNumber ) NASetInstrumentNumber(ci, noteChannel,instrumentNumber)
  1705. #endif
  1706. /*
  1707. * NAPickInstrument()
  1708. *
  1709. * Availability:
  1710. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1711. * CarbonLib: in CarbonLib 1.0 and later
  1712. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1713. * Windows: in qtmlClient.lib 3.0 and later
  1714. */
  1715. EXTERN_API( ComponentResult )
  1716. NAPickInstrument(
  1717. NoteAllocator na,
  1718. ModalFilterUPP filterProc,
  1719. StringPtr prompt,
  1720. ToneDescription * sd,
  1721. unsigned long flags,
  1722. long refCon,
  1723. long reserved1,
  1724. long reserved2) FIVEWORDINLINE(0x2F3C, 0x001C, 0x0012, 0x7000, 0xA82A);
  1725. /*
  1726. * NAPickArrangement()
  1727. *
  1728. * Availability:
  1729. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1730. * CarbonLib: in CarbonLib 1.0 and later
  1731. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1732. * Windows: in qtmlClient.lib 3.0 and later
  1733. */
  1734. EXTERN_API( ComponentResult )
  1735. NAPickArrangement(
  1736. NoteAllocator na,
  1737. ModalFilterUPP filterProc,
  1738. StringPtr prompt,
  1739. long zero1,
  1740. long zero2,
  1741. Track t,
  1742. StringPtr songName) FIVEWORDINLINE(0x2F3C, 0x0018, 0x0013, 0x7000, 0xA82A);
  1743. /*
  1744. * NAStuffToneDescription()
  1745. *
  1746. * Availability:
  1747. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1748. * CarbonLib: in CarbonLib 1.0 and later
  1749. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1750. * Windows: in qtmlClient.lib 3.0 and later
  1751. */
  1752. EXTERN_API( ComponentResult )
  1753. NAStuffToneDescription(
  1754. NoteAllocator na,
  1755. long gmNumber,
  1756. ToneDescription * td) FIVEWORDINLINE(0x2F3C, 0x0008, 0x001B, 0x7000, 0xA82A);
  1757. /*
  1758. * NACopyrightDialog()
  1759. *
  1760. * Availability:
  1761. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1762. * CarbonLib: in CarbonLib 1.0 and later
  1763. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1764. * Windows: in qtmlClient.lib 3.0 and later
  1765. */
  1766. EXTERN_API( ComponentResult )
  1767. NACopyrightDialog(
  1768. NoteAllocator na,
  1769. PicHandle p,
  1770. StringPtr author,
  1771. StringPtr copyright,
  1772. StringPtr other,
  1773. StringPtr title,
  1774. ModalFilterUPP filterProc,
  1775. long refCon) FIVEWORDINLINE(0x2F3C, 0x001C, 0x001C, 0x7000, 0xA82A);
  1776. /*
  1777. kNADummyOneSelect = 29
  1778. kNADummyTwoSelect = 30
  1779. */
  1780. /*
  1781. * NAGetIndNoteChannel()
  1782. *
  1783. * Availability:
  1784. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1785. * CarbonLib: in CarbonLib 1.0 and later
  1786. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1787. * Windows: in qtmlClient.lib 3.0 and later
  1788. */
  1789. EXTERN_API( ComponentResult )
  1790. NAGetIndNoteChannel(
  1791. NoteAllocator na,
  1792. long index,
  1793. NoteChannel * nc,
  1794. long * seed) FIVEWORDINLINE(0x2F3C, 0x000C, 0x001F, 0x7000, 0xA82A);
  1795. /*
  1796. * NAGetMIDIPorts()
  1797. *
  1798. * Availability:
  1799. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1800. * CarbonLib: in CarbonLib 1.0 and later
  1801. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1802. * Windows: in qtmlClient.lib 3.0 and later
  1803. */
  1804. EXTERN_API( ComponentResult )
  1805. NAGetMIDIPorts(
  1806. NoteAllocator na,
  1807. QTMIDIPortListHandle * inputPorts,
  1808. QTMIDIPortListHandle * outputPorts) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0021, 0x7000, 0xA82A);
  1809. /*
  1810. * NAGetNoteRequest()
  1811. *
  1812. * Availability:
  1813. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1814. * CarbonLib: in CarbonLib 1.0 and later
  1815. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1816. * Windows: in qtmlClient.lib 3.0 and later
  1817. */
  1818. EXTERN_API( ComponentResult )
  1819. NAGetNoteRequest(
  1820. NoteAllocator na,
  1821. NoteChannel noteChannel,
  1822. NoteRequest * nrOut) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0022, 0x7000, 0xA82A);
  1823. /*
  1824. * NASendMIDI()
  1825. *
  1826. * Availability:
  1827. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1828. * CarbonLib: in CarbonLib 1.0 and later
  1829. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1830. * Windows: in qtmlClient.lib 3.0 and later
  1831. */
  1832. EXTERN_API( ComponentResult )
  1833. NASendMIDI(
  1834. NoteAllocator na,
  1835. NoteChannel noteChannel,
  1836. MusicMIDIPacket * mp) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0023, 0x7000, 0xA82A);
  1837. /*
  1838. * NAPickEditInstrument()
  1839. *
  1840. * Availability:
  1841. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1842. * CarbonLib: in CarbonLib 1.0 and later
  1843. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1844. * Windows: in qtmlClient.lib 3.0 and later
  1845. */
  1846. EXTERN_API( ComponentResult )
  1847. NAPickEditInstrument(
  1848. NoteAllocator na,
  1849. ModalFilterUPP filterProc,
  1850. StringPtr prompt,
  1851. long refCon,
  1852. NoteChannel nc,
  1853. AtomicInstrument ai,
  1854. long flags) FIVEWORDINLINE(0x2F3C, 0x0018, 0x0024, 0x7000, 0xA82A);
  1855. /*
  1856. * NANewNoteChannelFromAtomicInstrument()
  1857. *
  1858. * Availability:
  1859. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1860. * CarbonLib: in CarbonLib 1.0 and later
  1861. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1862. * Windows: in qtmlClient.lib 3.0 and later
  1863. */
  1864. EXTERN_API( ComponentResult )
  1865. NANewNoteChannelFromAtomicInstrument(
  1866. NoteAllocator na,
  1867. AtomicInstrumentPtr instrument,
  1868. long flags,
  1869. NoteChannel * outChannel) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0025, 0x7000, 0xA82A);
  1870. /*
  1871. * NASetAtomicInstrument()
  1872. *
  1873. * Availability:
  1874. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1875. * CarbonLib: in CarbonLib 1.0 and later
  1876. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1877. * Windows: in qtmlClient.lib 3.0 and later
  1878. */
  1879. EXTERN_API( ComponentResult )
  1880. NASetAtomicInstrument(
  1881. NoteAllocator na,
  1882. NoteChannel noteChannel,
  1883. AtomicInstrumentPtr instrument,
  1884. long flags) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0026, 0x7000, 0xA82A);
  1885. /*
  1886. * NAGetKnob()
  1887. *
  1888. * Availability:
  1889. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1890. * CarbonLib: in CarbonLib 1.0 and later
  1891. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1892. * Windows: in qtmlClient.lib 3.0 and later
  1893. */
  1894. EXTERN_API( ComponentResult )
  1895. NAGetKnob(
  1896. NoteAllocator na,
  1897. NoteChannel noteChannel,
  1898. long knobNumber,
  1899. long * knobValue) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0028, 0x7000, 0xA82A);
  1900. /*
  1901. * NATask()
  1902. *
  1903. * Availability:
  1904. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1905. * CarbonLib: in CarbonLib 1.0 and later
  1906. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1907. * Windows: in qtmlClient.lib 3.0 and later
  1908. */
  1909. EXTERN_API( ComponentResult )
  1910. NATask(NoteAllocator na) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0029, 0x7000, 0xA82A);
  1911. /*
  1912. * NASetNoteChannelBalance()
  1913. *
  1914. * Availability:
  1915. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1916. * CarbonLib: in CarbonLib 1.0 and later
  1917. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1918. * Windows: in qtmlClient.lib 3.0 and later
  1919. */
  1920. EXTERN_API( ComponentResult )
  1921. NASetNoteChannelBalance(
  1922. NoteAllocator na,
  1923. NoteChannel noteChannel,
  1924. long balance) FIVEWORDINLINE(0x2F3C, 0x0008, 0x002A, 0x7000, 0xA82A);
  1925. /*
  1926. * NASetInstrumentNumberInterruptSafe()
  1927. *
  1928. * Availability:
  1929. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1930. * CarbonLib: in CarbonLib 1.0 and later
  1931. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1932. * Windows: in qtmlClient.lib 3.0 and later
  1933. */
  1934. EXTERN_API( ComponentResult )
  1935. NASetInstrumentNumberInterruptSafe(
  1936. NoteAllocator na,
  1937. NoteChannel noteChannel,
  1938. long instrumentNumber) FIVEWORDINLINE(0x2F3C, 0x0008, 0x002B, 0x7000, 0xA82A);
  1939. /*
  1940. * NASetNoteChannelSoundLocalization()
  1941. *
  1942. * Availability:
  1943. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1944. * CarbonLib: in CarbonLib 1.0 and later
  1945. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1946. * Windows: in qtmlClient.lib 3.0 and later
  1947. */
  1948. EXTERN_API( ComponentResult )
  1949. NASetNoteChannelSoundLocalization(
  1950. NoteAllocator na,
  1951. NoteChannel noteChannel,
  1952. Handle data) FIVEWORDINLINE(0x2F3C, 0x0008, 0x002C, 0x7000, 0xA82A);
  1953. /*
  1954. * NAGetController()
  1955. *
  1956. * Availability:
  1957. * Non-Carbon CFM: in QuickTimeLib 3.0 and later
  1958. * CarbonLib: in CarbonLib 1.0 and later
  1959. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1960. * Windows: in qtmlClient.lib 3.0 and later
  1961. */
  1962. EXTERN_API( ComponentResult )
  1963. NAGetController(
  1964. NoteAllocator na,
  1965. NoteChannel noteChannel,
  1966. long controllerNumber,
  1967. long * controllerValue) FIVEWORDINLINE(0x2F3C, 0x000C, 0x002D, 0x7000, 0xA82A);
  1968. enum {
  1969. kTuneQueueDepth = 8 /* Deepest you can queue tune segments */
  1970. };
  1971. struct TuneStatus {
  1972. unsigned long * tune; /* currently playing tune */
  1973. unsigned long * tunePtr; /* position within currently playing piece */
  1974. TimeValue time; /* current tune time */
  1975. short queueCount; /* how many pieces queued up? */
  1976. short queueSpots; /* How many more tunepieces can be queued */
  1977. TimeValue queueTime; /* How much time is queued up? (can be very inaccurate) */
  1978. long reserved[3];
  1979. };
  1980. typedef struct TuneStatus TuneStatus;
  1981. typedef CALLBACK_API( void , TuneCallBackProcPtr )(const TuneStatus *status, long refCon);
  1982. typedef CALLBACK_API( void , TunePlayCallBackProcPtr )(unsigned long *event, long seed, long refCon);
  1983. typedef STACK_UPP_TYPE(TuneCallBackProcPtr) TuneCallBackUPP;
  1984. typedef STACK_UPP_TYPE(TunePlayCallBackProcPtr) TunePlayCallBackUPP;
  1985. typedef ComponentInstance TunePlayer;
  1986. enum {
  1987. kTunePlayerComponentType = FOUR_CHAR_CODE('tune')
  1988. };
  1989. /*
  1990. * TuneSetHeader()
  1991. *
  1992. * Availability:
  1993. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  1994. * CarbonLib: in CarbonLib 1.0 and later
  1995. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  1996. * Windows: in qtmlClient.lib 3.0 and later
  1997. */
  1998. EXTERN_API( ComponentResult )
  1999. TuneSetHeader(
  2000. TunePlayer tp,
  2001. unsigned long * header) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  2002. /*
  2003. * TuneGetTimeBase()
  2004. *
  2005. * Availability:
  2006. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2007. * CarbonLib: in CarbonLib 1.0 and later
  2008. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2009. * Windows: in qtmlClient.lib 3.0 and later
  2010. */
  2011. EXTERN_API( ComponentResult )
  2012. TuneGetTimeBase(
  2013. TunePlayer tp,
  2014. TimeBase * tb) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  2015. /*
  2016. * TuneSetTimeScale()
  2017. *
  2018. * Availability:
  2019. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2020. * CarbonLib: in CarbonLib 1.0 and later
  2021. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2022. * Windows: in qtmlClient.lib 3.0 and later
  2023. */
  2024. EXTERN_API( ComponentResult )
  2025. TuneSetTimeScale(
  2026. TunePlayer tp,
  2027. TimeScale scale) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  2028. /*
  2029. * TuneGetTimeScale()
  2030. *
  2031. * Availability:
  2032. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2033. * CarbonLib: in CarbonLib 1.0 and later
  2034. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2035. * Windows: in qtmlClient.lib 3.0 and later
  2036. */
  2037. EXTERN_API( ComponentResult )
  2038. TuneGetTimeScale(
  2039. TunePlayer tp,
  2040. TimeScale * scale) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  2041. /*
  2042. * TuneGetIndexedNoteChannel()
  2043. *
  2044. * Availability:
  2045. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2046. * CarbonLib: in CarbonLib 1.0 and later
  2047. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2048. * Windows: in qtmlClient.lib 3.0 and later
  2049. */
  2050. EXTERN_API( ComponentResult )
  2051. TuneGetIndexedNoteChannel(
  2052. TunePlayer tp,
  2053. long i,
  2054. NoteChannel * nc) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0008, 0x7000, 0xA82A);
  2055. /* Values for when to start. */
  2056. enum {
  2057. kTuneStartNow = 1, /* start after buffer is implied */
  2058. kTuneDontClipNotes = 2, /* allow notes to finish their durations outside sample */
  2059. kTuneExcludeEdgeNotes = 4, /* dont play notes that start at end of tune */
  2060. kTuneQuickStart = 8, /* Leave all the controllers where they are, ignore start time */
  2061. kTuneLoopUntil = 16, /* loop a queued tune if there's nothing else in the queue*/
  2062. kTunePlayDifference = 32, /* by default, the tune difference is skipped*/
  2063. kTunePlayConcurrent = 64, /* dont block the next tune sequence with this one*/
  2064. kTuneStartNewMaster = 16384
  2065. };
  2066. /*
  2067. * TuneQueue()
  2068. *
  2069. * Availability:
  2070. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2071. * CarbonLib: in CarbonLib 1.0 and later
  2072. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2073. * Windows: in qtmlClient.lib 3.0 and later
  2074. */
  2075. EXTERN_API( ComponentResult )
  2076. TuneQueue(
  2077. TunePlayer tp,
  2078. unsigned long * tune,
  2079. Fixed tuneRate,
  2080. unsigned long tuneStartPosition,
  2081. unsigned long tuneStopPosition,
  2082. unsigned long queueFlags,
  2083. TuneCallBackUPP callBackProc,
  2084. long refCon) FIVEWORDINLINE(0x2F3C, 0x001C, 0x000A, 0x7000, 0xA82A);
  2085. /*
  2086. * TuneInstant()
  2087. *
  2088. * Availability:
  2089. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2090. * CarbonLib: in CarbonLib 1.0 and later
  2091. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2092. * Windows: in qtmlClient.lib 3.0 and later
  2093. */
  2094. EXTERN_API( ComponentResult )
  2095. TuneInstant(
  2096. TunePlayer tp,
  2097. unsigned long * tune,
  2098. unsigned long tunePosition) FIVEWORDINLINE(0x2F3C, 0x0008, 0x000B, 0x7000, 0xA82A);
  2099. /*
  2100. * TuneGetStatus()
  2101. *
  2102. * Availability:
  2103. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2104. * CarbonLib: in CarbonLib 1.0 and later
  2105. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2106. * Windows: in qtmlClient.lib 3.0 and later
  2107. */
  2108. EXTERN_API( ComponentResult )
  2109. TuneGetStatus(
  2110. TunePlayer tp,
  2111. TuneStatus * status) FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  2112. /* Values for stopping. */
  2113. enum {
  2114. kTuneStopFade = 1, /* do a quick, synchronous fadeout */
  2115. kTuneStopSustain = 2, /* don't silece notes */
  2116. kTuneStopInstant = 4, /* silence notes fast (else, decay them) */
  2117. kTuneStopReleaseChannels = 8 /* afterwards, let the channels go */
  2118. };
  2119. /*
  2120. * TuneStop()
  2121. *
  2122. * Availability:
  2123. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2124. * CarbonLib: in CarbonLib 1.0 and later
  2125. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2126. * Windows: in qtmlClient.lib 3.0 and later
  2127. */
  2128. EXTERN_API( ComponentResult )
  2129. TuneStop(
  2130. TunePlayer tp,
  2131. long stopFlags) FIVEWORDINLINE(0x2F3C, 0x0004, 0x000D, 0x7000, 0xA82A);
  2132. /*
  2133. * TuneSetVolume()
  2134. *
  2135. * Availability:
  2136. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2137. * CarbonLib: in CarbonLib 1.0 and later
  2138. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2139. * Windows: in qtmlClient.lib 3.0 and later
  2140. */
  2141. EXTERN_API( ComponentResult )
  2142. TuneSetVolume(
  2143. TunePlayer tp,
  2144. Fixed volume) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0010, 0x7000, 0xA82A);
  2145. /*
  2146. * TuneGetVolume()
  2147. *
  2148. * Availability:
  2149. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2150. * CarbonLib: in CarbonLib 1.0 and later
  2151. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2152. * Windows: in qtmlClient.lib 3.0 and later
  2153. */
  2154. EXTERN_API( ComponentResult )
  2155. TuneGetVolume(TunePlayer tp) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0011, 0x7000, 0xA82A);
  2156. /*
  2157. * TunePreroll()
  2158. *
  2159. * Availability:
  2160. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2161. * CarbonLib: in CarbonLib 1.0 and later
  2162. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2163. * Windows: in qtmlClient.lib 3.0 and later
  2164. */
  2165. EXTERN_API( ComponentResult )
  2166. TunePreroll(TunePlayer tp) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0012, 0x7000, 0xA82A);
  2167. /*
  2168. * TuneUnroll()
  2169. *
  2170. * Availability:
  2171. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2172. * CarbonLib: in CarbonLib 1.0 and later
  2173. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2174. * Windows: in qtmlClient.lib 3.0 and later
  2175. */
  2176. EXTERN_API( ComponentResult )
  2177. TuneUnroll(TunePlayer tp) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0013, 0x7000, 0xA82A);
  2178. /*
  2179. * TuneSetNoteChannels()
  2180. *
  2181. * Availability:
  2182. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2183. * CarbonLib: in CarbonLib 1.0 and later
  2184. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2185. * Windows: in qtmlClient.lib 3.0 and later
  2186. */
  2187. EXTERN_API( ComponentResult )
  2188. TuneSetNoteChannels(
  2189. TunePlayer tp,
  2190. unsigned long count,
  2191. NoteChannel * noteChannelList,
  2192. TunePlayCallBackUPP playCallBackProc,
  2193. long refCon) FIVEWORDINLINE(0x2F3C, 0x0010, 0x0014, 0x7000, 0xA82A);
  2194. /*
  2195. * TuneSetPartTranspose()
  2196. *
  2197. * Availability:
  2198. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2199. * CarbonLib: in CarbonLib 1.0 and later
  2200. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2201. * Windows: in qtmlClient.lib 3.0 and later
  2202. */
  2203. EXTERN_API( ComponentResult )
  2204. TuneSetPartTranspose(
  2205. TunePlayer tp,
  2206. unsigned long part,
  2207. long transpose,
  2208. long velocityShift) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0015, 0x7000, 0xA82A);
  2209. /*
  2210. * TuneGetNoteAllocator()
  2211. *
  2212. * Availability:
  2213. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2214. * CarbonLib: in CarbonLib 1.0 and later
  2215. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2216. * Windows: in qtmlClient.lib 3.0 and later
  2217. */
  2218. EXTERN_API( NoteAllocator )
  2219. TuneGetNoteAllocator(TunePlayer tp) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0017, 0x7000, 0xA82A);
  2220. /*
  2221. * TuneSetSofter()
  2222. *
  2223. * Availability:
  2224. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2225. * CarbonLib: in CarbonLib 1.0 and later
  2226. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2227. * Windows: in qtmlClient.lib 3.0 and later
  2228. */
  2229. EXTERN_API( ComponentResult )
  2230. TuneSetSofter(
  2231. TunePlayer tp,
  2232. long softer) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  2233. /*
  2234. * TuneTask()
  2235. *
  2236. * Availability:
  2237. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2238. * CarbonLib: in CarbonLib 1.0 and later
  2239. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2240. * Windows: in qtmlClient.lib 3.0 and later
  2241. */
  2242. EXTERN_API( ComponentResult )
  2243. TuneTask(TunePlayer tp) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0019, 0x7000, 0xA82A);
  2244. /*
  2245. * TuneSetBalance()
  2246. *
  2247. * Availability:
  2248. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2249. * CarbonLib: in CarbonLib 1.0 and later
  2250. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2251. * Windows: in qtmlClient.lib 3.0 and later
  2252. */
  2253. EXTERN_API( ComponentResult )
  2254. TuneSetBalance(
  2255. TunePlayer tp,
  2256. long balance) FIVEWORDINLINE(0x2F3C, 0x0004, 0x001A, 0x7000, 0xA82A);
  2257. /*
  2258. * TuneSetSoundLocalization()
  2259. *
  2260. * Availability:
  2261. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2262. * CarbonLib: in CarbonLib 1.0 and later
  2263. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2264. * Windows: in qtmlClient.lib 3.0 and later
  2265. */
  2266. EXTERN_API( ComponentResult )
  2267. TuneSetSoundLocalization(
  2268. TunePlayer tp,
  2269. Handle data) FIVEWORDINLINE(0x2F3C, 0x0004, 0x001B, 0x7000, 0xA82A);
  2270. /*
  2271. * TuneSetHeaderWithSize()
  2272. *
  2273. * Availability:
  2274. * Non-Carbon CFM: in QuickTimeLib 2.5 and later
  2275. * CarbonLib: in CarbonLib 1.0 and later
  2276. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2277. * Windows: in qtmlClient.lib 3.0 and later
  2278. */
  2279. EXTERN_API( ComponentResult )
  2280. TuneSetHeaderWithSize(
  2281. TunePlayer tp,
  2282. unsigned long * header,
  2283. unsigned long size) FIVEWORDINLINE(0x2F3C, 0x0008, 0x001C, 0x7000, 0xA82A);
  2284. /* flags for part mix. */
  2285. enum {
  2286. kTuneMixMute = 1, /* disable a part */
  2287. kTuneMixSolo = 2 /* if any parts soloed, play only soloed parts */
  2288. };
  2289. /*
  2290. * TuneSetPartMix()
  2291. *
  2292. * Availability:
  2293. * Non-Carbon CFM: in QuickTimeLib 3.0 and later
  2294. * CarbonLib: in CarbonLib 1.0 and later
  2295. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2296. * Windows: in qtmlClient.lib 3.0 and later
  2297. */
  2298. EXTERN_API( ComponentResult )
  2299. TuneSetPartMix(
  2300. TunePlayer tp,
  2301. unsigned long partNumber,
  2302. long volume,
  2303. long balance,
  2304. long mixFlags) FIVEWORDINLINE(0x2F3C, 0x0010, 0x001D, 0x7000, 0xA82A);
  2305. /*
  2306. * TuneGetPartMix()
  2307. *
  2308. * Availability:
  2309. * Non-Carbon CFM: in QuickTimeLib 3.0 and later
  2310. * CarbonLib: in CarbonLib 1.0 and later
  2311. * Mac OS X: in version 10.0 and later but deprecated in 10.5
  2312. * Windows: in qtmlClient.lib 3.0 and later
  2313. */
  2314. EXTERN_API( ComponentResult )
  2315. TuneGetPartMix(
  2316. TunePlayer tp,
  2317. unsigned long partNumber,
  2318. long * volumeOut,
  2319. long * balanceOut,
  2320. long * mixFlagsOut) FIVEWORDINLINE(0x2F3C, 0x0010, 0x001E, 0x7000, 0xA82A);
  2321. typedef unsigned long MusicOpWord;
  2322. typedef MusicOpWord * MusicOpWordPtr;
  2323. /* QuickTime Music Track Event Formats:
  2324. At this time, QuickTime music tracks support 5 different event types -- REST events,
  2325. short NOTE events, short CONTROL events, short GENERAL events, Long NOTE events,
  2326. long CONTROL events, and variable GENERAL events.
  2327. o REST Event (4 bytes/event):
  2328. (0 0 0) (5-bit UNUSED) (24-bit Rest Duration)
  2329. o.Short NOTE Events (4 bytes/event):
  2330. (0 0 1) (5-bit Part) (6-bit Pitch) (7-bit Volume) (11-bit Duration)
  2331. where: Pitch is offset by 32 (Actual pitch = pitch field + 32)
  2332. o.Short CONTROL Events (4 bytes/event):
  2333. (0 1 0) (5-bit Part) (8-bit Controller) (1-bit UNUSED) (1-bit Sign) (7-bit MSB) (7-bit LSB)
  2334. ( or 15-bit Signed Value)
  2335. o Short GENERAL Event (4 bytes/event):
  2336. (0 1 1) (1-bit UNUSED) (12-bit Sub-Type) (16-bit Value)
  2337. o Long NOTE Events (8 bytes/event):
  2338. (1 0 0 1) (12-bit Part) (1-bit UNUSED) (7-bit Pitch) (1-bit UNUSED) (7-bit Volume)
  2339. (1 0) (8-bit UNUSED) (22-bit Duration)
  2340. o.Long CONTROL Event (8 bytes/event):
  2341. (1 0 1 0) (12-bit Part) (16-bit Value MSB)
  2342. (1 0) (14-bit Controller) (16-bit Value LSB)
  2343. o.Long KNOB Event (8 bytes/event):
  2344. (1 0 1 1) (12-bit Sub-Type) (16-bit Value MSB)
  2345. (1 0) (14-bit KNOB) (16-bit Value LSB)
  2346. o.Variable GENERAL Length Events (N bytes/event):
  2347. (1 1 1 1) (12-bit Sub-Type) (16-bit Length)
  2348. :
  2349. (32-bit Data values)
  2350. :
  2351. (1 1) (14-bit UNUSED) (16-bit Length)
  2352. where: Length field is the number of LONG words in the record.
  2353. Lengths include the first and last long words (Minimum length = 2)
  2354. The following event type values have not been used yet and are reserved for
  2355. future expansion:
  2356. o (1 0 0 0) (8 bytes/event)
  2357. o (1 1 0 0) (N bytes/event)
  2358. o (1 1 0 1) (N bytes/event)
  2359. o (1 1 1 0) (N bytes/event)
  2360. For all events, the following generalizations apply:
  2361. - All duration values are specified in Millisecond units.
  2362. - Pitch values are intended to map directly to the MIDI key numbers.
  2363. - Controllers from 0 to 127 correspond to the standard MIDI controllers.
  2364. Controllers greater than 127 correspond to other controls (i.e., Pitch Bend,
  2365. Key Pressure, and Channel Pressure).
  2366. */
  2367. /* Defines for the implemented music event data fields*/
  2368. enum {
  2369. kRestEventType = 0x00000000, /* lower 3-bits */
  2370. kNoteEventType = 0x00000001, /* lower 3-bits */
  2371. kControlEventType = 0x00000002, /* lower 3-bits */
  2372. kMarkerEventType = 0x00000003, /* lower 3-bits */
  2373. kUndefined1EventType = 0x00000008, /* 4-bits */
  2374. kXNoteEventType = 0x00000009, /* 4-bits */
  2375. kXControlEventType = 0x0000000A, /* 4-bits */
  2376. kKnobEventType = 0x0000000B, /* 4-bits */
  2377. kUndefined2EventType = 0x0000000C, /* 4-bits */
  2378. kUndefined3EventType = 0x0000000D, /* 4-bits */
  2379. kUndefined4EventType = 0x0000000E, /* 4-bits */
  2380. kGeneralEventType = 0x0000000F, /* 4-bits */
  2381. kXEventLengthBits = 0x00000002, /* 2 bits: indicates 8-byte event record */
  2382. kGeneralEventLengthBits = 0x00000003, /* 2 bits: indicates variable length event record */
  2383. kEventLen = 1L, /* length of events in long words */
  2384. kXEventLen = 2L,
  2385. kRestEventLen = kEventLen, /* length of events in long words */
  2386. kNoteEventLen = kEventLen,
  2387. kControlEventLen = kEventLen,
  2388. kMarkerEventLen = kEventLen,
  2389. kXNoteEventLen = kXEventLen,
  2390. kXControlEventLen = kXEventLen,
  2391. kGeneralEventLen = kXEventLen, /* 2 or more, however */
  2392. /* Universal Event Defines*/
  2393. kEventLengthFieldPos = 30, /* by looking at these two bits of the 1st or last word */
  2394. kEventLengthFieldWidth = 2, /* of an event you can determine the event length */
  2395. /* length field: 0 & 1 => 1 long; 2 => 2 longs; 3 => variable length */
  2396. kEventTypeFieldPos = 29, /* event type field for short events */
  2397. kEventTypeFieldWidth = 3, /* short type is 3 bits */
  2398. kXEventTypeFieldPos = 28, /* event type field for extended events */
  2399. kXEventTypeFieldWidth = 4, /* extended type is 4 bits */
  2400. kEventPartFieldPos = 24,
  2401. kEventPartFieldWidth = 5,
  2402. kXEventPartFieldPos = 16, /* in the 1st long word */
  2403. kXEventPartFieldWidth = 12, /* Rest Events*/
  2404. kRestEventDurationFieldPos = 0,
  2405. kRestEventDurationFieldWidth = 24,
  2406. kRestEventDurationMax = ((1L << kRestEventDurationFieldWidth) - 1), /* Note Events*/
  2407. kNoteEventPitchFieldPos = 18,
  2408. kNoteEventPitchFieldWidth = 6,
  2409. kNoteEventPitchOffset = 32, /* add to value in pitch field to get actual pitch */
  2410. kNoteEventVolumeFieldPos = 11,
  2411. kNoteEventVolumeFieldWidth = 7,
  2412. kNoteEventVolumeOffset = 0, /* add to value in volume field to get actual volume */
  2413. kNoteEventDurationFieldPos = 0,
  2414. kNoteEventDurationFieldWidth = 11,
  2415. kNoteEventDurationMax = ((1L << kNoteEventDurationFieldWidth) - 1),
  2416. kXNoteEventPitchFieldPos = 0, /* in the 1st long word */
  2417. kXNoteEventPitchFieldWidth = 16,
  2418. kXNoteEventDurationFieldPos = 0, /* in the 2nd long word */
  2419. kXNoteEventDurationFieldWidth = 22,
  2420. kXNoteEventDurationMax = ((1L << kXNoteEventDurationFieldWidth) - 1),
  2421. kXNoteEventVolumeFieldPos = 22, /* in the 2nd long word */
  2422. kXNoteEventVolumeFieldWidth = 7, /* Control Events*/
  2423. kControlEventControllerFieldPos = 16,
  2424. kControlEventControllerFieldWidth = 8,
  2425. kControlEventValueFieldPos = 0,
  2426. kControlEventValueFieldWidth = 16,
  2427. kXControlEventControllerFieldPos = 0, /* in the 2nd long word */
  2428. kXControlEventControllerFieldWidth = 16,
  2429. kXControlEventValueFieldPos = 0, /* in the 1st long word */
  2430. kXControlEventValueFieldWidth = 16, /* Knob Events*/
  2431. kKnobEventValueHighFieldPos = 0, /* 1st long word */
  2432. kKnobEventValueHighFieldWidth = 16,
  2433. kKnobEventKnobFieldPos = 16, /* 2nd long word */
  2434. kKnobEventKnobFieldWidth = 14,
  2435. kKnobEventValueLowFieldPos = 0, /* 2nd long word */
  2436. kKnobEventValueLowFieldWidth = 16, /* Marker Events*/
  2437. kMarkerEventSubtypeFieldPos = 16,
  2438. kMarkerEventSubtypeFieldWidth = 8,
  2439. kMarkerEventValueFieldPos = 0,
  2440. kMarkerEventValueFieldWidth = 16, /* General Events*/
  2441. kGeneralEventSubtypeFieldPos = 16, /* in the last long word */
  2442. kGeneralEventSubtypeFieldWidth = 14,
  2443. kGeneralEventLengthFieldPos = 0, /* in the 1st & last long words */
  2444. kGeneralEventLengthFieldWidth = 16
  2445. };
  2446. #if TARGET_RT_LITTLE_ENDIAN
  2447. enum {
  2448. kEndMarkerValue = 0x00000060
  2449. };
  2450. #else
  2451. enum {
  2452. kEndMarkerValue = 0x60000000
  2453. };
  2454. #endif /* TARGET_RT_LITTLE_ENDIAN */
  2455. /* macros for extracting various fields from the QuickTime event records*/
  2456. #define qtma_MASK(bitWidth) ((1L << (bitWidth)) - 1)
  2457. #define qtma_EXT(val, pos, width) ((EndianU32_BtoN(val) >> (pos)) & qtma_MASK(width))
  2458. #define qtma_EventLengthForward(xP,ulen) \
  2459. { \
  2460. unsigned long _ext; \
  2461. unsigned long *lP = (unsigned long *)(xP); \
  2462. _ext = qtma_EXT(*lP, kEventLengthFieldPos, kEventLengthFieldWidth); \
  2463. if (_ext != 3) { \
  2464. ulen = (_ext < 2) ? 1 : 2; \
  2465. } else { \
  2466. ulen = (unsigned short)qtma_EXT(*lP, kGeneralEventLengthFieldPos, kGeneralEventLengthFieldWidth); \
  2467. if (ulen < 2) { \
  2468. ulen = lP[1]; \
  2469. } \
  2470. } \
  2471. }
  2472. #define qtma_EventLengthBackward(xP,ulen) \
  2473. { \
  2474. unsigned long _ext; \
  2475. unsigned long *lP = (unsigned long *)(xP); \
  2476. _ext = qtma_EXT(*lP, kEventLengthFieldPos, kEventLengthFieldWidth); \
  2477. if (_ext != 3) { \
  2478. ulen = (_ext < 2) ? 1 : 2; \
  2479. } else { \
  2480. ulen = (unsigned short)qtma_EXT(*lP, kGeneralEventLengthFieldPos, kGeneralEventLengthFieldWidth); \
  2481. if (ulen < 2) { \
  2482. ulen = lP[-1]; \
  2483. } \
  2484. } \
  2485. }
  2486. #define qtma_EventType(x) ((qtma_EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth) > 3) ? qtma_EXT(x, kXEventTypeFieldPos, kXEventTypeFieldWidth) : qtma_EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth))
  2487. #define qtma_RestDuration(x) (qtma_EXT(x, kRestEventDurationFieldPos, kRestEventDurationFieldWidth))
  2488. #define qtma_Part(x) (qtma_EXT(x, kEventPartFieldPos, kEventPartFieldWidth))
  2489. #define qtma_XPart(m, l) (qtma_EXT(m, kXEventPartFieldPos, kXEventPartFieldWidth))
  2490. #define qtma_NotePitch(x) (qtma_EXT(x, kNoteEventPitchFieldPos, kNoteEventPitchFieldWidth) + kNoteEventPitchOffset)
  2491. #define qtma_NoteVolume(x) (qtma_EXT(x, kNoteEventVolumeFieldPos, kNoteEventVolumeFieldWidth) + kNoteEventVolumeOffset)
  2492. #define qtma_NoteDuration(x) (qtma_EXT(x, kNoteEventDurationFieldPos, kNoteEventDurationFieldWidth))
  2493. #define qtma_NoteVelocity qtma_NoteVolume
  2494. #define qtma_XNotePitch(m, l) (qtma_EXT(m, kXNoteEventPitchFieldPos, kXNoteEventPitchFieldWidth))
  2495. #define qtma_XNoteVolume(m, l) (qtma_EXT(l, kXNoteEventVolumeFieldPos, kXNoteEventVolumeFieldWidth))
  2496. #define qtma_XNoteDuration(m, l) (qtma_EXT(l, kXNoteEventDurationFieldPos, kXNoteEventDurationFieldWidth))
  2497. #define qtma_XNoteVelocity qtma_XNoteVolume
  2498. #define qtma_ControlController(x) (qtma_EXT(x, kControlEventControllerFieldPos, kControlEventControllerFieldWidth))
  2499. #define qtma_ControlValue(x) (qtma_EXT(x, kControlEventValueFieldPos, kControlEventValueFieldWidth))
  2500. #define qtma_XControlController(m, l) (qtma_EXT(l, kXControlEventControllerFieldPos, kXControlEventControllerFieldWidth))
  2501. #define qtma_XControlValue(m, l) (qtma_EXT(m, kXControlEventValueFieldPos, kXControlEventValueFieldWidth))
  2502. #define qtma_MarkerSubtype(x) (qtma_EXT(x,kMarkerEventSubtypeFieldPos,kMarkerEventSubtypeFieldWidth))
  2503. #define qtma_MarkerValue(x) (qtma_EXT(x, kMarkerEventValueFieldPos, kMarkerEventValueFieldWidth))
  2504. #define qtma_KnobValue(m,l) ((qtma_EXT(m,kKnobEventValueHighFieldPos,kKnobEventValueHighFieldWidth) << 16) \
  2505. | (qtma_EXT(l,kKnobEventValueLowFieldPos,kKnobEventValueLowFieldWidth)))
  2506. #define qtma_KnobKnob(m,l) (qtma_EXT(l,kKnobEventKnobFieldPos,kKnobEventKnobFieldWidth))
  2507. #define qtma_GeneralSubtype(m,l) (qtma_EXT(l,kGeneralEventSubtypeFieldPos,kGeneralEventSubtypeFieldWidth))
  2508. #define qtma_GeneralLength(m,l) (qtma_EXT(m,kGeneralEventLengthFieldPos,kGeneralEventLengthFieldWidth))
  2509. #define qtma_StuffRestEvent(x, duration) ( \
  2510. x = (kRestEventType << kEventTypeFieldPos) \
  2511. | ((long)(duration) << kRestEventDurationFieldPos), \
  2512. x = EndianU32_NtoB(x) )
  2513. #define qtma_StuffNoteEvent(x, part, pitch, volume, duration) ( \
  2514. x = (kNoteEventType << kEventTypeFieldPos) \
  2515. | ((long)(part) << kEventPartFieldPos) \
  2516. | (((long)(pitch) - kNoteEventPitchOffset) << kNoteEventPitchFieldPos) \
  2517. | (((long)(volume) - kNoteEventVolumeOffset) << kNoteEventVolumeFieldPos) \
  2518. | ((long)(duration) << kNoteEventDurationFieldPos), \
  2519. x = EndianU32_NtoB(x) )
  2520. #define qtma_StuffControlEvent(x, part, control, value) ( \
  2521. x = (kControlEventType << kEventTypeFieldPos) \
  2522. | ((long)(part) << kEventPartFieldPos) \
  2523. | ((long)(control) << kControlEventControllerFieldPos)\
  2524. | ((long)((value) & qtma_MASK(kControlEventValueFieldWidth)) << kControlEventValueFieldPos), \
  2525. x = EndianU32_NtoB(x) )
  2526. #define qtma_StuffMarkerEvent(x, markerType, markerValue) ( \
  2527. x = (kMarkerEventType << kEventTypeFieldPos) \
  2528. | ((long)(markerType) << kMarkerEventSubtypeFieldPos) \
  2529. | ((long)(markerValue) << kMarkerEventValueFieldPos), \
  2530. x = EndianU32_NtoB(x) )
  2531. #define qtma_StuffXNoteEvent(w1, w2, part, pitch, volume, duration) ( \
  2532. w1 = (kXNoteEventType << kXEventTypeFieldPos) \
  2533. | ((long)(part) << kXEventPartFieldPos) \
  2534. | ((long)(pitch) << kXNoteEventPitchFieldPos), \
  2535. w1 = EndianU32_NtoB(w1), \
  2536. w2 = (kXEventLengthBits << kEventLengthFieldPos) \
  2537. | ((long)(duration) << kXNoteEventDurationFieldPos) \
  2538. | ((long)(volume) << kXNoteEventVolumeFieldPos), \
  2539. w2 = EndianU32_NtoB(w2) )
  2540. #define qtma_StuffXControlEvent(w1, w2, part, control, value) ( \
  2541. w1 = (kXControlEventType << kXEventTypeFieldPos) \
  2542. | ((long)(part) << kXEventPartFieldPos) \
  2543. | ((long)((value) & qtma_MASK(kXControlEventValueFieldWidth)) << kXControlEventValueFieldPos), \
  2544. w1 = EndianU32_NtoB(w1), \
  2545. w2 = (kXEventLengthBits << kEventLengthFieldPos) \
  2546. | ((long)(control) << kXControlEventControllerFieldPos), \
  2547. w2 = EndianU32_NtoB(w2) )
  2548. #define qtma_StuffKnobEvent(w1, w2, part, knob, value) ( \
  2549. w1 = (kKnobEventType << kXEventTypeFieldPos) \
  2550. | ((long)(part) << kXEventPartFieldPos) \
  2551. | ((long)(value >> 16) << kKnobEventValueLowFieldPos), \
  2552. w1 = EndianU32_NtoB(w1), \
  2553. w2 = (kXEventLengthBits << kEventLengthFieldPos) \
  2554. | ((long)(knob) << kKnobEventKnobFieldPos) \
  2555. | ((long)(value & 0xFFFF) << kKnobEventValueLowFieldPos), \
  2556. w2 = EndianU32_NtoB(w2) )
  2557. #define qtma_StuffGeneralEvent(w1,w2,part,subType,length) ( \
  2558. w1 = (kGeneralEventType << kXEventTypeFieldPos) \
  2559. | ((long)(part) << kXEventPartFieldPos) \
  2560. | ((long)(length) << kGeneralEventLengthFieldPos), \
  2561. w1 = EndianU32_NtoB(w1), \
  2562. w2 = (kGeneralEventLengthBits << kEventLengthFieldPos) \
  2563. | ((long)(subType) << kGeneralEventSubtypeFieldPos) \
  2564. | ((long)(length) << kGeneralEventLengthFieldPos), \
  2565. w2 = EndianU32_NtoB(w2) )
  2566. #define qtma_NeedXGeneralEvent(length) (((unsigned long)(length)) > (unsigned long)0xffff)
  2567. /* General Event Defined Types*/
  2568. enum {
  2569. kGeneralEventNoteRequest = 1, /* Encapsulates NoteRequest data structure */
  2570. kGeneralEventPartKey = 4,
  2571. kGeneralEventTuneDifference = 5, /* Contains a standard sequence, with end marker, for the tune difference of a sequence piece (halts QuickTime 2.0 Music) */
  2572. kGeneralEventAtomicInstrument = 6, /* Encapsulates AtomicInstrument record */
  2573. kGeneralEventKnob = 7, /* knobID/knobValue pairs; smallest event is 4 longs */
  2574. kGeneralEventMIDIChannel = 8, /* used in tune header, one longword identifies the midi channel it originally came from */
  2575. kGeneralEventPartChange = 9, /* used in tune sequence, one longword identifies the tune part which can now take over this part's note channel (similar to program change) (halts QuickTime 2.0 Music)*/
  2576. kGeneralEventNoOp = 10, /* guaranteed to do nothing and be ignored. (halts QuickTime 2.0 Music) */
  2577. kGeneralEventUsedNotes = 11, /* four longwords specifying which midi notes are actually used, 0..127 msb to lsb */
  2578. kGeneralEventPartMix = 12 /* three longwords: Fixed volume, long balance, long flags */
  2579. };
  2580. /* Marker Event Defined Types // marker is 60 ee vv vv in hex, where e = event type, and v = value*/
  2581. enum {
  2582. kMarkerEventEnd = 0, /* marker type 0 means: value 0 - stop, value != 0 - ignore*/
  2583. kMarkerEventBeat = 1, /* value 0 = single beat; anything else is 65536ths-of-a-beat (quarter note)*/
  2584. kMarkerEventTempo = 2 /* value same as beat marker, but indicates that a tempo event should be computed (based on where the next beat or tempo marker is) and emitted upon export*/
  2585. };
  2586. enum {
  2587. kCurrentlyNativeEndian = 1,
  2588. kCurrentlyNotNativeEndian = 2
  2589. };
  2590. /* UPP call backs */
  2591. /*
  2592. * NewMusicMIDISendUPP()
  2593. *
  2594. * Availability:
  2595. * Non-Carbon CFM: available as macro/inline
  2596. * CarbonLib: in CarbonLib 1.0 and later
  2597. * Mac OS X: in version 10.0 and later
  2598. */
  2599. EXTERN_API_C( MusicMIDISendUPP )
  2600. NewMusicMIDISendUPP(MusicMIDISendProcPtr userRoutine);
  2601. #if !OPAQUE_UPP_TYPES
  2602. enum { uppMusicMIDISendProcInfo = 0x00000FF0 }; /* pascal 4_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  2603. #ifdef __cplusplus
  2604. inline DEFINE_API_C(MusicMIDISendUPP) NewMusicMIDISendUPP(MusicMIDISendProcPtr userRoutine) { return (MusicMIDISendUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicMIDISendProcInfo, GetCurrentArchitecture()); }
  2605. #else
  2606. #define NewMusicMIDISendUPP(userRoutine) (MusicMIDISendUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicMIDISendProcInfo, GetCurrentArchitecture())
  2607. #endif
  2608. #endif
  2609. /*
  2610. * NewMusicOfflineDataUPP()
  2611. *
  2612. * Availability:
  2613. * Non-Carbon CFM: available as macro/inline
  2614. * CarbonLib: in CarbonLib 1.0 and later
  2615. * Mac OS X: in version 10.0 and later
  2616. */
  2617. EXTERN_API_C( MusicOfflineDataUPP )
  2618. NewMusicOfflineDataUPP(MusicOfflineDataProcPtr userRoutine);
  2619. #if !OPAQUE_UPP_TYPES
  2620. enum { uppMusicOfflineDataProcInfo = 0x00000FF0 }; /* pascal 4_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  2621. #ifdef __cplusplus
  2622. inline DEFINE_API_C(MusicOfflineDataUPP) NewMusicOfflineDataUPP(MusicOfflineDataProcPtr userRoutine) { return (MusicOfflineDataUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicOfflineDataProcInfo, GetCurrentArchitecture()); }
  2623. #else
  2624. #define NewMusicOfflineDataUPP(userRoutine) (MusicOfflineDataUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicOfflineDataProcInfo, GetCurrentArchitecture())
  2625. #endif
  2626. #endif
  2627. /*
  2628. * NewTuneCallBackUPP()
  2629. *
  2630. * Availability:
  2631. * Non-Carbon CFM: available as macro/inline
  2632. * CarbonLib: in CarbonLib 1.0 and later
  2633. * Mac OS X: in version 10.0 and later
  2634. */
  2635. EXTERN_API_C( TuneCallBackUPP )
  2636. NewTuneCallBackUPP(TuneCallBackProcPtr userRoutine);
  2637. #if !OPAQUE_UPP_TYPES
  2638. enum { uppTuneCallBackProcInfo = 0x000003C0 }; /* pascal no_return_value Func(4_bytes, 4_bytes) */
  2639. #ifdef __cplusplus
  2640. inline DEFINE_API_C(TuneCallBackUPP) NewTuneCallBackUPP(TuneCallBackProcPtr userRoutine) { return (TuneCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTuneCallBackProcInfo, GetCurrentArchitecture()); }
  2641. #else
  2642. #define NewTuneCallBackUPP(userRoutine) (TuneCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTuneCallBackProcInfo, GetCurrentArchitecture())
  2643. #endif
  2644. #endif
  2645. /*
  2646. * NewTunePlayCallBackUPP()
  2647. *
  2648. * Availability:
  2649. * Non-Carbon CFM: available as macro/inline
  2650. * CarbonLib: in CarbonLib 1.0 and later
  2651. * Mac OS X: in version 10.0 and later
  2652. */
  2653. EXTERN_API_C( TunePlayCallBackUPP )
  2654. NewTunePlayCallBackUPP(TunePlayCallBackProcPtr userRoutine);
  2655. #if !OPAQUE_UPP_TYPES
  2656. enum { uppTunePlayCallBackProcInfo = 0x00000FC0 }; /* pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes) */
  2657. #ifdef __cplusplus
  2658. inline DEFINE_API_C(TunePlayCallBackUPP) NewTunePlayCallBackUPP(TunePlayCallBackProcPtr userRoutine) { return (TunePlayCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTunePlayCallBackProcInfo, GetCurrentArchitecture()); }
  2659. #else
  2660. #define NewTunePlayCallBackUPP(userRoutine) (TunePlayCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTunePlayCallBackProcInfo, GetCurrentArchitecture())
  2661. #endif
  2662. #endif
  2663. /*
  2664. * DisposeMusicMIDISendUPP()
  2665. *
  2666. * Availability:
  2667. * Non-Carbon CFM: available as macro/inline
  2668. * CarbonLib: in CarbonLib 1.0 and later
  2669. * Mac OS X: in version 10.0 and later
  2670. */
  2671. EXTERN_API_C( void )
  2672. DisposeMusicMIDISendUPP(MusicMIDISendUPP userUPP);
  2673. #if !OPAQUE_UPP_TYPES
  2674. #ifdef __cplusplus
  2675. inline DEFINE_API_C(void) DisposeMusicMIDISendUPP(MusicMIDISendUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  2676. #else
  2677. #define DisposeMusicMIDISendUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  2678. #endif
  2679. #endif
  2680. /*
  2681. * DisposeMusicOfflineDataUPP()
  2682. *
  2683. * Availability:
  2684. * Non-Carbon CFM: available as macro/inline
  2685. * CarbonLib: in CarbonLib 1.0 and later
  2686. * Mac OS X: in version 10.0 and later
  2687. */
  2688. EXTERN_API_C( void )
  2689. DisposeMusicOfflineDataUPP(MusicOfflineDataUPP userUPP);
  2690. #if !OPAQUE_UPP_TYPES
  2691. #ifdef __cplusplus
  2692. inline DEFINE_API_C(void) DisposeMusicOfflineDataUPP(MusicOfflineDataUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  2693. #else
  2694. #define DisposeMusicOfflineDataUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  2695. #endif
  2696. #endif
  2697. /*
  2698. * DisposeTuneCallBackUPP()
  2699. *
  2700. * Availability:
  2701. * Non-Carbon CFM: available as macro/inline
  2702. * CarbonLib: in CarbonLib 1.0 and later
  2703. * Mac OS X: in version 10.0 and later
  2704. */
  2705. EXTERN_API_C( void )
  2706. DisposeTuneCallBackUPP(TuneCallBackUPP userUPP);
  2707. #if !OPAQUE_UPP_TYPES
  2708. #ifdef __cplusplus
  2709. inline DEFINE_API_C(void) DisposeTuneCallBackUPP(TuneCallBackUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  2710. #else
  2711. #define DisposeTuneCallBackUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  2712. #endif
  2713. #endif
  2714. /*
  2715. * DisposeTunePlayCallBackUPP()
  2716. *
  2717. * Availability:
  2718. * Non-Carbon CFM: available as macro/inline
  2719. * CarbonLib: in CarbonLib 1.0 and later
  2720. * Mac OS X: in version 10.0 and later
  2721. */
  2722. EXTERN_API_C( void )
  2723. DisposeTunePlayCallBackUPP(TunePlayCallBackUPP userUPP);
  2724. #if !OPAQUE_UPP_TYPES
  2725. #ifdef __cplusplus
  2726. inline DEFINE_API_C(void) DisposeTunePlayCallBackUPP(TunePlayCallBackUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  2727. #else
  2728. #define DisposeTunePlayCallBackUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  2729. #endif
  2730. #endif
  2731. /*
  2732. * InvokeMusicMIDISendUPP()
  2733. *
  2734. * Availability:
  2735. * Non-Carbon CFM: available as macro/inline
  2736. * CarbonLib: in CarbonLib 1.0 and later
  2737. * Mac OS X: in version 10.0 and later
  2738. */
  2739. EXTERN_API_C( ComponentResult )
  2740. InvokeMusicMIDISendUPP(
  2741. ComponentInstance self,
  2742. long refCon,
  2743. MusicMIDIPacket * mmp,
  2744. MusicMIDISendUPP userUPP);
  2745. #if !OPAQUE_UPP_TYPES
  2746. #ifdef __cplusplus
  2747. inline DEFINE_API_C(ComponentResult) InvokeMusicMIDISendUPP(ComponentInstance self, long refCon, MusicMIDIPacket * mmp, MusicMIDISendUPP userUPP) { return (ComponentResult)CALL_THREE_PARAMETER_UPP(userUPP, uppMusicMIDISendProcInfo, self, refCon, mmp); }
  2748. #else
  2749. #define InvokeMusicMIDISendUPP(self, refCon, mmp, userUPP) (ComponentResult)CALL_THREE_PARAMETER_UPP((userUPP), uppMusicMIDISendProcInfo, (self), (refCon), (mmp))
  2750. #endif
  2751. #endif
  2752. /*
  2753. * InvokeMusicOfflineDataUPP()
  2754. *
  2755. * Availability:
  2756. * Non-Carbon CFM: available as macro/inline
  2757. * CarbonLib: in CarbonLib 1.0 and later
  2758. * Mac OS X: in version 10.0 and later
  2759. */
  2760. EXTERN_API_C( ComponentResult )
  2761. InvokeMusicOfflineDataUPP(
  2762. Ptr SoundData,
  2763. long numBytes,
  2764. long myRefCon,
  2765. MusicOfflineDataUPP userUPP);
  2766. #if !OPAQUE_UPP_TYPES
  2767. #ifdef __cplusplus
  2768. inline DEFINE_API_C(ComponentResult) InvokeMusicOfflineDataUPP(Ptr SoundData, long numBytes, long myRefCon, MusicOfflineDataUPP userUPP) { return (ComponentResult)CALL_THREE_PARAMETER_UPP(userUPP, uppMusicOfflineDataProcInfo, SoundData, numBytes, myRefCon); }
  2769. #else
  2770. #define InvokeMusicOfflineDataUPP(SoundData, numBytes, myRefCon, userUPP) (ComponentResult)CALL_THREE_PARAMETER_UPP((userUPP), uppMusicOfflineDataProcInfo, (SoundData), (numBytes), (myRefCon))
  2771. #endif
  2772. #endif
  2773. /*
  2774. * InvokeTuneCallBackUPP()
  2775. *
  2776. * Availability:
  2777. * Non-Carbon CFM: available as macro/inline
  2778. * CarbonLib: in CarbonLib 1.0 and later
  2779. * Mac OS X: in version 10.0 and later
  2780. */
  2781. EXTERN_API_C( void )
  2782. InvokeTuneCallBackUPP(
  2783. const TuneStatus * status,
  2784. long refCon,
  2785. TuneCallBackUPP userUPP);
  2786. #if !OPAQUE_UPP_TYPES
  2787. #ifdef __cplusplus
  2788. inline DEFINE_API_C(void) InvokeTuneCallBackUPP(const TuneStatus * status, long refCon, TuneCallBackUPP userUPP) { CALL_TWO_PARAMETER_UPP(userUPP, uppTuneCallBackProcInfo, status, refCon); }
  2789. #else
  2790. #define InvokeTuneCallBackUPP(status, refCon, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppTuneCallBackProcInfo, (status), (refCon))
  2791. #endif
  2792. #endif
  2793. /*
  2794. * InvokeTunePlayCallBackUPP()
  2795. *
  2796. * Availability:
  2797. * Non-Carbon CFM: available as macro/inline
  2798. * CarbonLib: in CarbonLib 1.0 and later
  2799. * Mac OS X: in version 10.0 and later
  2800. */
  2801. EXTERN_API_C( void )
  2802. InvokeTunePlayCallBackUPP(
  2803. unsigned long * event,
  2804. long seed,
  2805. long refCon,
  2806. TunePlayCallBackUPP userUPP);
  2807. #if !OPAQUE_UPP_TYPES
  2808. #ifdef __cplusplus
  2809. inline DEFINE_API_C(void) InvokeTunePlayCallBackUPP(unsigned long * event, long seed, long refCon, TunePlayCallBackUPP userUPP) { CALL_THREE_PARAMETER_UPP(userUPP, uppTunePlayCallBackProcInfo, event, seed, refCon); }
  2810. #else
  2811. #define InvokeTunePlayCallBackUPP(event, seed, refCon, userUPP) CALL_THREE_PARAMETER_UPP((userUPP), uppTunePlayCallBackProcInfo, (event), (seed), (refCon))
  2812. #endif
  2813. #endif
  2814. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  2815. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  2816. #define NewMusicMIDISendProc(userRoutine) NewMusicMIDISendUPP(userRoutine)
  2817. #define NewMusicOfflineDataProc(userRoutine) NewMusicOfflineDataUPP(userRoutine)
  2818. #define NewTuneCallBackProc(userRoutine) NewTuneCallBackUPP(userRoutine)
  2819. #define NewTunePlayCallBackProc(userRoutine) NewTunePlayCallBackUPP(userRoutine)
  2820. #define CallMusicMIDISendProc(userRoutine, self, refCon, mmp) InvokeMusicMIDISendUPP(self, refCon, mmp, userRoutine)
  2821. #define CallMusicOfflineDataProc(userRoutine, SoundData, numBytes, myRefCon) InvokeMusicOfflineDataUPP(SoundData, numBytes, myRefCon, userRoutine)
  2822. #define CallTuneCallBackProc(userRoutine, status, refCon) InvokeTuneCallBackUPP(status, refCon, userRoutine)
  2823. #define CallTunePlayCallBackProc(userRoutine, event, seed, refCon) InvokeTunePlayCallBackUPP(event, seed, refCon, userRoutine)
  2824. #endif /* CALL_NOT_IN_CARBON */
  2825. /* selectors for component calls */
  2826. enum {
  2827. kQTMIDIGetMIDIPortsSelect = 0x0001,
  2828. kQTMIDIUseSendPortSelect = 0x0002,
  2829. kQTMIDISendMIDISelect = 0x0003,
  2830. kMusicGetDescriptionSelect = 0x0001,
  2831. kMusicGetPartSelect = 0x0002,
  2832. kMusicSetPartSelect = 0x0003,
  2833. kMusicSetPartInstrumentNumberSelect = 0x0004,
  2834. kMusicGetPartInstrumentNumberSelect = 0x0005,
  2835. kMusicStorePartInstrumentSelect = 0x0006,
  2836. kMusicGetPartAtomicInstrumentSelect = 0x0009,
  2837. kMusicSetPartAtomicInstrumentSelect = 0x000A,
  2838. kMusicGetPartKnobSelect = 0x0010,
  2839. kMusicSetPartKnobSelect = 0x0011,
  2840. kMusicGetKnobSelect = 0x0012,
  2841. kMusicSetKnobSelect = 0x0013,
  2842. kMusicGetPartNameSelect = 0x0014,
  2843. kMusicSetPartNameSelect = 0x0015,
  2844. kMusicFindToneSelect = 0x0016,
  2845. kMusicPlayNoteSelect = 0x0017,
  2846. kMusicResetPartSelect = 0x0018,
  2847. kMusicSetPartControllerSelect = 0x0019,
  2848. kMusicGetPartControllerSelect = 0x001A,
  2849. kMusicGetMIDIProcSelect = 0x001B,
  2850. kMusicSetMIDIProcSelect = 0x001C,
  2851. kMusicGetInstrumentNamesSelect = 0x001D,
  2852. kMusicGetDrumNamesSelect = 0x001E,
  2853. kMusicGetMasterTuneSelect = 0x001F,
  2854. kMusicSetMasterTuneSelect = 0x0020,
  2855. kMusicGetInstrumentAboutInfoSelect = 0x0022,
  2856. kMusicGetDeviceConnectionSelect = 0x0023,
  2857. kMusicUseDeviceConnectionSelect = 0x0024,
  2858. kMusicGetKnobSettingStringsSelect = 0x0025,
  2859. kMusicGetMIDIPortsSelect = 0x0026,
  2860. kMusicSendMIDISelect = 0x0027,
  2861. kMusicStartOfflineSelect = 0x0029,
  2862. kMusicSetOfflineTimeToSelect = 0x002A,
  2863. kMusicGetInstrumentKnobDescriptionSelect = 0x002B,
  2864. kMusicGetDrumKnobDescriptionSelect = 0x002C,
  2865. kMusicGetKnobDescriptionSelect = 0x002D,
  2866. kMusicGetInfoTextSelect = 0x002E,
  2867. kMusicGetInstrumentInfoSelect = 0x002F,
  2868. kMusicTaskSelect = 0x0031,
  2869. kMusicSetPartInstrumentNumberInterruptSafeSelect = 0x0032,
  2870. kMusicSetPartSoundLocalizationSelect = 0x0033,
  2871. kMusicGenericConfigureSelect = 0x0100,
  2872. kMusicGenericGetPartSelect = 0x0101,
  2873. kMusicGenericGetKnobListSelect = 0x0102,
  2874. kMusicGenericSetResourceNumbersSelect = 0x0103,
  2875. kMusicDerivedMIDISendSelect = 0x0200,
  2876. kMusicDerivedSetKnobSelect = 0x0201,
  2877. kMusicDerivedSetPartSelect = 0x0202,
  2878. kMusicDerivedSetInstrumentSelect = 0x0203,
  2879. kMusicDerivedSetPartInstrumentNumberSelect = 0x0204,
  2880. kMusicDerivedSetMIDISelect = 0x0205,
  2881. kMusicDerivedStorePartInstrumentSelect = 0x0206,
  2882. kMusicDerivedOpenResFileSelect = 0x0207,
  2883. kMusicDerivedCloseResFileSelect = 0x0208,
  2884. kNARegisterMusicDeviceSelect = 0x0000,
  2885. kNAUnregisterMusicDeviceSelect = 0x0001,
  2886. kNAGetRegisteredMusicDeviceSelect = 0x0002,
  2887. kNASaveMusicConfigurationSelect = 0x0003,
  2888. kNANewNoteChannelSelect = 0x0004,
  2889. kNADisposeNoteChannelSelect = 0x0005,
  2890. kNAGetNoteChannelInfoSelect = 0x0006,
  2891. kNAPrerollNoteChannelSelect = 0x0007,
  2892. kNAUnrollNoteChannelSelect = 0x0008,
  2893. kNASetNoteChannelVolumeSelect = 0x000B,
  2894. kNAResetNoteChannelSelect = 0x000C,
  2895. kNAPlayNoteSelect = 0x000D,
  2896. kNASetControllerSelect = 0x000E,
  2897. kNASetKnobSelect = 0x000F,
  2898. kNAFindNoteChannelToneSelect = 0x0010,
  2899. kNASetInstrumentNumberSelect = 0x0011,
  2900. kNAPickInstrumentSelect = 0x0012,
  2901. kNAPickArrangementSelect = 0x0013,
  2902. kNAStuffToneDescriptionSelect = 0x001B,
  2903. kNACopyrightDialogSelect = 0x001C,
  2904. kNAGetIndNoteChannelSelect = 0x001F,
  2905. kNAGetMIDIPortsSelect = 0x0021,
  2906. kNAGetNoteRequestSelect = 0x0022,
  2907. kNASendMIDISelect = 0x0023,
  2908. kNAPickEditInstrumentSelect = 0x0024,
  2909. kNANewNoteChannelFromAtomicInstrumentSelect = 0x0025,
  2910. kNASetAtomicInstrumentSelect = 0x0026,
  2911. kNAGetKnobSelect = 0x0028,
  2912. kNATaskSelect = 0x0029,
  2913. kNASetNoteChannelBalanceSelect = 0x002A,
  2914. kNASetInstrumentNumberInterruptSafeSelect = 0x002B,
  2915. kNASetNoteChannelSoundLocalizationSelect = 0x002C,
  2916. kNAGetControllerSelect = 0x002D,
  2917. kTuneSetHeaderSelect = 0x0004,
  2918. kTuneGetTimeBaseSelect = 0x0005,
  2919. kTuneSetTimeScaleSelect = 0x0006,
  2920. kTuneGetTimeScaleSelect = 0x0007,
  2921. kTuneGetIndexedNoteChannelSelect = 0x0008,
  2922. kTuneQueueSelect = 0x000A,
  2923. kTuneInstantSelect = 0x000B,
  2924. kTuneGetStatusSelect = 0x000C,
  2925. kTuneStopSelect = 0x000D,
  2926. kTuneSetVolumeSelect = 0x0010,
  2927. kTuneGetVolumeSelect = 0x0011,
  2928. kTunePrerollSelect = 0x0012,
  2929. kTuneUnrollSelect = 0x0013,
  2930. kTuneSetNoteChannelsSelect = 0x0014,
  2931. kTuneSetPartTransposeSelect = 0x0015,
  2932. kTuneGetNoteAllocatorSelect = 0x0017,
  2933. kTuneSetSofterSelect = 0x0018,
  2934. kTuneTaskSelect = 0x0019,
  2935. kTuneSetBalanceSelect = 0x001A,
  2936. kTuneSetSoundLocalizationSelect = 0x001B,
  2937. kTuneSetHeaderWithSizeSelect = 0x001C,
  2938. kTuneSetPartMixSelect = 0x001D,
  2939. kTuneGetPartMixSelect = 0x001E
  2940. };
  2941. #endif // !__LP64__
  2942. #if PRAGMA_STRUCT_ALIGN
  2943. #pragma options align=reset
  2944. #elif PRAGMA_STRUCT_PACKPUSH
  2945. #pragma pack(pop)
  2946. #elif PRAGMA_STRUCT_PACK
  2947. #pragma pack()
  2948. #endif
  2949. #ifdef PRAGMA_IMPORT_OFF
  2950. #pragma import off
  2951. #elif PRAGMA_IMPORT
  2952. #pragma import reset
  2953. #endif
  2954. #ifdef __cplusplus
  2955. }
  2956. #endif
  2957. #endif /* __QUICKTIMEMUSIC__ */