QuickTimeMusic.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:118k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       QuickTimeMusic.h
  3.  
  4.      Contains:   QuickTime Interfaces.
  5.  
  6.      Version:    Technology: QuickTime 6.0
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1990-2001 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __QUICKTIMEMUSIC__
  18. #define __QUICKTIMEMUSIC__
  19. #ifndef __COMPONENTS__
  20. #include "Components.h"
  21. #endif
  22. #ifndef __IMAGECOMPRESSION__
  23. #include "ImageCompression.h"
  24. #endif
  25. #ifndef __MOVIES__
  26. #include "Movies.h"
  27. #endif
  28. #ifndef __QUICKDRAW__
  29. #include "Quickdraw.h"
  30. #endif
  31. #ifndef __VIDEO__
  32. #include "Video.h"
  33. #endif
  34. #ifndef __MACMEMORY__
  35. #include "MacMemory.h"
  36. #endif
  37. #ifndef __SOUND__
  38. #include "Sound.h"
  39. #endif
  40. #ifndef __ENDIAN__
  41. #include "Endian.h"
  42. #endif
  43. #if PRAGMA_ONCE
  44. #pragma once
  45. #endif
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49. #if PRAGMA_IMPORT
  50. #pragma import on
  51. #endif
  52. #if PRAGMA_STRUCT_ALIGN
  53.     #pragma options align=mac68k
  54. #elif PRAGMA_STRUCT_PACKPUSH
  55.     #pragma pack(push, 2)
  56. #elif PRAGMA_STRUCT_PACK
  57.     #pragma pack(2)
  58. #endif
  59. enum {
  60.     kaiToneDescType             = FOUR_CHAR_CODE('tone'),
  61.     kaiNoteRequestInfoType      = FOUR_CHAR_CODE('ntrq'),
  62.     kaiKnobListType             = FOUR_CHAR_CODE('knbl'),
  63.     kaiKeyRangeInfoType         = FOUR_CHAR_CODE('sinf'),
  64.     kaiSampleDescType           = FOUR_CHAR_CODE('sdsc'),
  65.     kaiSampleInfoType           = FOUR_CHAR_CODE('smin'),
  66.     kaiSampleDataType           = FOUR_CHAR_CODE('sdat'),
  67.     kaiSampleDataQUIDType       = FOUR_CHAR_CODE('quid'),
  68.     kaiInstInfoType             = FOUR_CHAR_CODE('iinf'),
  69.     kaiPictType                 = FOUR_CHAR_CODE('pict'),
  70.     kaiWriterType               = FOUR_CHAR_CODE('﹚rt'),
  71.     kaiCopyrightType            = FOUR_CHAR_CODE('ヽpy'),
  72.     kaiOtherStrType             = FOUR_CHAR_CODE('str '),
  73.     kaiInstrumentRefType        = FOUR_CHAR_CODE('iref'),
  74.     kaiInstGMQualityType        = FOUR_CHAR_CODE('qual'),
  75.     kaiLibraryInfoType          = FOUR_CHAR_CODE('linf'),
  76.     kaiLibraryDescType          = FOUR_CHAR_CODE('ldsc')
  77. };
  78. struct InstLibDescRec {
  79.     Str31                           libIDName;
  80. };
  81. typedef struct InstLibDescRec           InstLibDescRec;
  82. struct InstKnobRec {
  83.     BigEndianLong                   number;
  84.     BigEndianLong                   value;
  85. };
  86. typedef struct InstKnobRec              InstKnobRec;
  87. enum {
  88.     kInstKnobMissingUnknown     = 0,
  89.     kInstKnobMissingDefault     = (1 << 0)
  90. };
  91. struct InstKnobList {
  92.     BigEndianLong                   knobCount;
  93.     BigEndianLong                   knobFlags;
  94.     InstKnobRec                     knob[1];
  95. };
  96. typedef struct InstKnobList             InstKnobList;
  97. enum {
  98.     kMusicLoopTypeNormal        = 0,
  99.     kMusicLoopTypePalindrome    = 1                             /* back & forth*/
  100. };
  101. enum {
  102.     instSamplePreProcessFlag    = 1 << 0
  103. };
  104. struct InstSampleDescRec {
  105.     BigEndianOSType                 dataFormat;
  106.     BigEndianShort                  numChannels;
  107.     BigEndianShort                  sampleSize;
  108.     BigEndianUnsignedFixed          sampleRate;
  109.     BigEndianShort                  sampleDataID;
  110.     BigEndianLong                   offset;                     /* offset within SampleData - this could be just for internal use*/
  111.     BigEndianLong                   numSamples;                 /* this could also just be for internal use, we'll see*/
  112.     BigEndianLong                   loopType;
  113.     BigEndianLong                   loopStart;
  114.     BigEndianLong                   loopEnd;
  115.     BigEndianLong                   pitchNormal;
  116.     BigEndianLong                   pitchLow;
  117.     BigEndianLong                   pitchHigh;
  118. };
  119. typedef struct InstSampleDescRec        InstSampleDescRec;
  120. typedef Handle                          AtomicInstrument;
  121. typedef Ptr                             AtomicInstrumentPtr;
  122. enum {
  123.     kQTMIDIComponentType        = FOUR_CHAR_CODE('midi')
  124. };
  125. enum {
  126.     kOMSComponentSubType        = FOUR_CHAR_CODE('OMS '),
  127.     kFMSComponentSubType        = FOUR_CHAR_CODE('FMS '),
  128.     kMIDIManagerComponentSubType = FOUR_CHAR_CODE('mmgr'),
  129.     kOSXMIDIComponentSubType    = FOUR_CHAR_CODE('osxm')
  130. };
  131. typedef ComponentInstance               QTMIDIComponent;
  132. enum {
  133.     kMusicPacketPortLost        = 1,                            /* received when application loses the default input port */
  134.     kMusicPacketPortFound       = 2,                            /* received when application gets it back out from under someone else's claim */
  135.     kMusicPacketTimeGap         = 3                             /* data[0] = number of milliseconds to keep the MIDI line silent */
  136. };
  137. enum {
  138.     kAppleSysexID               = 0x11,                         /* apple sysex is followed by 2-byte command. 0001 is the command for samplesize */
  139.     kAppleSysexCmdSampleSize    = 0x0001,                       /* 21 bit number in 3 midi bytes follows sysex ID and 2 cmd bytes */
  140.     kAppleSysexCmdSampleBreak   = 0x0002,                       /* specifies that the sample should break right here */
  141.     kAppleSysexCmdAtomicInstrument = 0x0010,                    /* contents of atomic instrument handle */
  142.     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 */
  143. };
  144. struct MusicMIDIPacket {
  145.     unsigned short                  length;
  146.     unsigned long                   reserved;                   /* if length zero, then reserved = above enum */
  147.     UInt8                           data[249];
  148. };
  149. typedef struct MusicMIDIPacket          MusicMIDIPacket;
  150. typedef CALLBACK_API( ComponentResult , MusicMIDISendProcPtr )(ComponentInstance self, long refCon, MusicMIDIPacket *mmp);
  151. typedef CALLBACK_API( ComponentResult , MusicMIDIReadHookProcPtr )(MusicMIDIPacket *mp, long myRefCon);
  152. typedef STACK_UPP_TYPE(MusicMIDISendProcPtr)                    MusicMIDISendUPP;
  153. typedef STACK_UPP_TYPE(MusicMIDIReadHookProcPtr)                MusicMIDIReadHookUPP;
  154. enum {
  155.     kSynthesizerConnectionFMS   = 1,                            /* this connection imported from FMS */
  156.     kSynthesizerConnectionMMgr  = 2,                            /* this connection imported from the MIDI Mgr */
  157.     kSynthesizerConnectionOMS   = 4,                            /* this connection imported from OMS */
  158.     kSynthesizerConnectionQT    = 8,                            /* this connection is a QuickTime-only port */
  159.     kSynthesizerConnectionOSXMIDI = 16,                         /* this connection is an OS X CoreMIDI port */
  160.                                                                 /* lowest five bits are mutually exclusive; combinations reserved for future use.*/
  161.     kSynthesizerConnectionUnavailable = 256                     /* port exists, but cannot be used just now */
  162. };
  163. /*
  164.     The sampleBankFile field of this structure can be used to pass in a pointer to an FSSpec
  165.     that represents a SoundFont 2 or DLS file (otherwise set it to NULL ).
  166.     
  167.     You then pass in a structure with this field set (all other fields should be zero) to
  168.     NARegisterMusicDevice:
  169.         - with synthType as kSoftSynthComponentSubType 
  170.         - with name being used to return to the application the "name" of the synth 
  171.         that should be used in the synthesiserName field of the ToneDescription structure
  172.         and is also used to retrieve a particular MusicComponent with the
  173.         NAGetRegisteredMusicDevice call
  174.     
  175.     This call will create a MusicComponent of kSoftSynthComponentSubType, with the specified
  176.     sound bank as the sample data source.
  177. */
  178. struct SynthesizerConnections {
  179.     OSType                          clientID;
  180.     OSType                          inputPortID;                /* terminology death: this port is used to SEND to the midi synth */
  181.     OSType                          outputPortID;               /* terminology death: this port receives from a keyboard or other control device */
  182.     long                            midiChannel;                /* The system channel; others are configurable (or the nubus slot number) */
  183.     long                            flags;
  184.     long                            unique;                     /* unique id may be used instead of index, to getinfo and unregister calls */
  185.     FSSpecPtr                       sampleBankFile;             /*  see notes above */
  186.     long                            reserved2;                  /* should be zero */
  187. };
  188. typedef struct SynthesizerConnections   SynthesizerConnections;
  189. struct QTMIDIPort {
  190.     SynthesizerConnections          portConnections;
  191.     Str63                           portName;
  192. };
  193. typedef struct QTMIDIPort               QTMIDIPort;
  194. struct QTMIDIPortList {
  195.     short                           portCount;
  196.     QTMIDIPort                      port[1];
  197. };
  198. typedef struct QTMIDIPortList           QTMIDIPortList;
  199. typedef QTMIDIPortList *                QTMIDIPortListPtr;
  200. typedef QTMIDIPortListPtr *             QTMIDIPortListHandle;
  201. EXTERN_API( ComponentResult )
  202. QTMIDIGetMIDIPorts              (QTMIDIComponent        ci,
  203.                                  QTMIDIPortListHandle * inputPorts,
  204.                                  QTMIDIPortListHandle * outputPorts)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x0001, 0x7000, 0xA82A);
  205. EXTERN_API( ComponentResult )
  206. QTMIDIUseSendPort               (QTMIDIComponent        ci,
  207.                                  long                   portIndex,
  208.                                  long                   inUse)                              FIVEWORDINLINE(0x2F3C, 0x0008, 0x0002, 0x7000, 0xA82A);
  209. EXTERN_API( ComponentResult )
  210. QTMIDISendMIDI                  (QTMIDIComponent        ci,
  211.                                  long                   portIndex,
  212.                                  MusicMIDIPacket *      mp)                                 FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);
  213. EXTERN_API( ComponentResult )
  214. QTMIDIUseReceivePort            (QTMIDIComponent        ci,
  215.                                  long                   portIndex,
  216.                                  MusicMIDIReadHookUPP   readHook,
  217.                                  long                   refCon)                             FIVEWORDINLINE(0x2F3C, 0x000C, 0x0004, 0x7000, 0xA82A);
  218. enum {
  219.     kMusicComponentType         = FOUR_CHAR_CODE('musi'),
  220.     kInstrumentComponentType    = FOUR_CHAR_CODE('inst')
  221. };
  222. enum {
  223.     kSoftSynthComponentSubType  = FOUR_CHAR_CODE('ss  '),
  224.     kGMSynthComponentSubType    = FOUR_CHAR_CODE('gm  ')
  225. };
  226. typedef ComponentInstance               MusicComponent;
  227. /* MusicSynthesizerFlags*/
  228. enum {
  229.     kSynthesizerDynamicVoice    = 1 << 0,                       /* can assign voices on the fly (else, polyphony is very important */
  230.     kSynthesizerUsesMIDIPort    = 1 << 1,                       /* must be patched through MIDI Manager */
  231.     kSynthesizerMicrotone       = 1 << 2,                       /* can play microtonal scales */
  232.     kSynthesizerHasSamples      = 1 << 3,                       /* synthesizer has some use for sampled data */
  233.     kSynthesizerMixedDrums      = 1 << 4,                       /* any part can play drum parts, total = instrument parts */
  234.     kSynthesizerSoftware        = 1 << 5,                       /* implemented in main CPU software == uses cpu cycles */
  235.     kSynthesizerHardware        = 1 << 6,                       /* is a hardware device (such as nubus, or maybe DSP?) */
  236.     kSynthesizerDynamicChannel  = 1 << 7,                       /* can move any part to any channel or disable each part. (else we assume it lives on all channels in masks) */
  237.     kSynthesizerHogsSystemChannel = 1 << 8,                     /* can be channelwise dynamic, but always responds on its system channel */
  238.     kSynthesizerHasSystemChannel = 1 << 9,                      /* has some "system channel" notion to distinguish it from multiple instances of the same device (GM devices dont) */
  239.     kSynthesizerSlowSetPart     = 1 << 10,                      /* SetPart() and SetPartInstrumentNumber() calls do not have rapid response, may glitch notes */
  240.     kSynthesizerOffline         = 1 << 12,                      /* can enter an offline synthesis mode */
  241.     kSynthesizerGM              = 1 << 14,                      /* synth is a GM device */
  242.     kSynthesizerDLS             = 1 << 15,                      /* synth supports DLS level 1 */
  243.     kSynthesizerSoundLocalization = 1 << 16                     /* synth supports extremely baroque, nonstandard, and proprietary "apple game sprockets" localization parameter set */
  244. };
  245. /*
  246.  * Note that these controller numbers
  247.  * are _not_ identical to the MIDI controller numbers.
  248.  * These are _signed_ 8.8 values, and the LSB's are
  249.  * always sent to a MIDI device. Controllers 32-63 are
  250.  * reserved (for MIDI, they are LSB's for 0-31, but we
  251.  * always send both).
  252.  *
  253.  * The full range, therefore, is -128.00 to 127.7f.
  254.  *
  255.  * _Excepting_ _volume_, all controls default to zero.
  256.  *
  257.  * Pitch bend is specified in fractional semitones! No
  258.  * more "pitch bend range" nonsense. You can bend as far
  259.  * as you want, any time you want.
  260.  */
  261. typedef SInt32                          MusicController;
  262. enum {
  263.     kControllerModulationWheel  = 1,
  264.     kControllerBreath           = 2,
  265.     kControllerFoot             = 4,
  266.     kControllerPortamentoTime   = 5,                            /* time in 8.8 seconds, portamento on/off is omitted, 0 time = 'off' */
  267.     kControllerVolume           = 7,                            /* main volume control */
  268.     kControllerBalance          = 8,
  269.     kControllerPan              = 10,                           /* 0 - "default", 1 - n: positioned in output 1-n (incl fractions) */
  270.     kControllerExpression       = 11,                           /* secondary volume control */
  271.     kControllerLever1           = 16,                           /* general purpose controllers */
  272.     kControllerLever2           = 17,                           /* general purpose controllers */
  273.     kControllerLever3           = 18,                           /* general purpose controllers */
  274.     kControllerLever4           = 19,                           /* general purpose controllers */
  275.     kControllerLever5           = 80,                           /* general purpose controllers */
  276.     kControllerLever6           = 81,                           /* general purpose controllers */
  277.     kControllerLever7           = 82,                           /* general purpose controllers */
  278.     kControllerLever8           = 83,                           /* general purpose controllers */
  279.     kControllerPitchBend        = 32,                           /* positive & negative semitones, with 8 bits fraction, same units as transpose controllers*/
  280.     kControllerAfterTouch       = 33,                           /* aka channel pressure */
  281.     kControllerPartTranspose    = 40,                           /* identical to pitchbend, for overall part xpose */
  282.     kControllerTuneTranspose    = 41,                           /* another pitchbend, for "song global" pitch offset */
  283.     kControllerPartVolume       = 42,                           /* another volume control, passed right down from note allocator part volume */
  284.     kControllerTuneVolume       = 43,                           /* another volume control, used for "song global" volume - since we share one synthesizer across multiple tuneplayers*/
  285.     kControllerSustain          = 64,                           /* boolean - positive for on, 0 or negative off */
  286.     kControllerPortamento       = 65,                           /* boolean*/
  287.     kControllerSostenuto        = 66,                           /* boolean */
  288.     kControllerSoftPedal        = 67,                           /* boolean */
  289.     kControllerReverb           = 91,
  290.     kControllerTremolo          = 92,
  291.     kControllerChorus           = 93,
  292.     kControllerCeleste          = 94,
  293.     kControllerPhaser           = 95,
  294.     kControllerEditPart         = 113,                          /* last 16 controllers 113-128 and above are global controllers which respond on part zero */
  295.     kControllerMasterTune       = 114,
  296.     kControllerMasterTranspose  = 114,                          /* preferred*/
  297.     kControllerMasterVolume     = 115,
  298.     kControllerMasterCPULoad    = 116,
  299.     kControllerMasterPolyphony  = 117,
  300.     kControllerMasterFeatures   = 118
  301. };
  302. /* ID's of knobs supported by the QuickTime Music Synthesizer built into QuickTime*/
  303. enum {
  304.     kQTMSKnobStartID            = 0x02000000,
  305.     kQTMSKnobVolumeAttackTimeID = 0x02000001,
  306.     kQTMSKnobVolumeDecayTimeID  = 0x02000002,
  307.     kQTMSKnobVolumeSustainLevelID = 0x02000003,
  308.     kQTMSKnobVolumeRelease1RateID = 0x02000004,
  309.     kQTMSKnobVolumeDecayKeyScalingID = 0x02000005,
  310.     kQTMSKnobVolumeReleaseTimeID = 0x02000006,
  311.     kQTMSKnobVolumeLFODelayID   = 0x02000007,
  312.     kQTMSKnobVolumeLFORampTimeID = 0x02000008,
  313.     kQTMSKnobVolumeLFOPeriodID  = 0x02000009,
  314.     kQTMSKnobVolumeLFOShapeID   = 0x0200000A,
  315.     kQTMSKnobVolumeLFODepthID   = 0x0200000B,
  316.     kQTMSKnobVolumeOverallID    = 0x0200000C,
  317.     kQTMSKnobVolumeVelocity127ID = 0x0200000D,
  318.     kQTMSKnobVolumeVelocity96ID = 0x0200000E,
  319.     kQTMSKnobVolumeVelocity64ID = 0x0200000F,
  320.     kQTMSKnobVolumeVelocity32ID = 0x02000010,
  321.     kQTMSKnobVolumeVelocity16ID = 0x02000011,                   /* Pitch related knobs*/
  322.     kQTMSKnobPitchTransposeID   = 0x02000012,
  323.     kQTMSKnobPitchLFODelayID    = 0x02000013,
  324.     kQTMSKnobPitchLFORampTimeID = 0x02000014,
  325.     kQTMSKnobPitchLFOPeriodID   = 0x02000015,
  326.     kQTMSKnobPitchLFOShapeID    = 0x02000016,
  327.     kQTMSKnobPitchLFODepthID    = 0x02000017,
  328.     kQTMSKnobPitchLFOQuantizeID = 0x02000018,                   /* Stereo related knobs*/
  329.     kQTMSKnobStereoDefaultPanID = 0x02000019,
  330.     kQTMSKnobStereoPositionKeyScalingID = 0x0200001A,
  331.     kQTMSKnobPitchLFOOffsetID   = 0x0200001B,
  332.     kQTMSKnobExclusionGroupID   = 0x0200001C,                   /* Misc knobs, late additions*/
  333.     kQTMSKnobSustainTimeID      = 0x0200001D,
  334.     kQTMSKnobSustainInfiniteID  = 0x0200001E,
  335.     kQTMSKnobVolumeLFOStereoID  = 0x0200001F,
  336.     kQTMSKnobVelocityLowID      = 0x02000020,
  337.     kQTMSKnobVelocityHighID     = 0x02000021,
  338.     kQTMSKnobVelocitySensitivityID = 0x02000022,
  339.     kQTMSKnobPitchSensitivityID = 0x02000023,
  340.     kQTMSKnobVolumeLFODepthFromWheelID = 0x02000024,
  341.     kQTMSKnobPitchLFODepthFromWheelID = 0x02000025,             /* Volume Env again*/
  342.     kQTMSKnobVolumeExpOptionsID = 0x02000026,                   /* Env1*/
  343.     kQTMSKnobEnv1AttackTimeID   = 0x02000027,
  344.     kQTMSKnobEnv1DecayTimeID    = 0x02000028,
  345.     kQTMSKnobEnv1SustainLevelID = 0x02000029,
  346.     kQTMSKnobEnv1SustainTimeID  = 0x0200002A,
  347.     kQTMSKnobEnv1SustainInfiniteID = 0x0200002B,
  348.     kQTMSKnobEnv1ReleaseTimeID  = 0x0200002C,
  349.     kQTMSKnobEnv1ExpOptionsID   = 0x0200002D,                   /* Env2*/
  350.     kQTMSKnobEnv2AttackTimeID   = 0x0200002E,
  351.     kQTMSKnobEnv2DecayTimeID    = 0x0200002F,
  352.     kQTMSKnobEnv2SustainLevelID = 0x02000030,
  353.     kQTMSKnobEnv2SustainTimeID  = 0x02000031,
  354.     kQTMSKnobEnv2SustainInfiniteID = 0x02000032,
  355.     kQTMSKnobEnv2ReleaseTimeID  = 0x02000033,
  356.     kQTMSKnobEnv2ExpOptionsID   = 0x02000034,                   /* Pitch Env*/
  357.     kQTMSKnobPitchEnvelopeID    = 0x02000035,
  358.     kQTMSKnobPitchEnvelopeDepthID = 0x02000036,                 /* Filter*/
  359.     kQTMSKnobFilterKeyFollowID  = 0x02000037,
  360.     kQTMSKnobFilterTransposeID  = 0x02000038,
  361.     kQTMSKnobFilterQID          = 0x02000039,
  362.     kQTMSKnobFilterFrequencyEnvelopeID = 0x0200003A,
  363.     kQTMSKnobFilterFrequencyEnvelopeDepthID = 0x0200003B,
  364.     kQTMSKnobFilterQEnvelopeID  = 0x0200003C,
  365.     kQTMSKnobFilterQEnvelopeDepthID = 0x0200003D,               /* Reverb Threshhold*/
  366.     kQTMSKnobReverbThresholdID  = 0x0200003E,
  367.     kQTMSKnobVolumeAttackVelScalingID = 0x0200003F,
  368.     kQTMSKnobLastIDPlus1        = 0x02000040
  369. };
  370. enum {
  371.     kControllerMaximum          = 0x00007FFF,                   /* +01111111.11111111 */
  372.     kControllerMinimum          = (long)0xFFFF8000              /* -10000000.00000000 */
  373. };
  374. struct SynthesizerDescription {
  375.     OSType                          synthesizerType;            /* synthesizer type (must be same as component subtype) */
  376.     Str31                           name;                       /* text name of synthesizer type */
  377.     unsigned long                   flags;                      /* from the above enum */
  378.     unsigned long                   voiceCount;                 /* maximum polyphony */
  379.     unsigned long                   partCount;                  /* maximum multi-timbrality (and midi channels) */
  380.     unsigned long                   instrumentCount;            /* non gm, built in (rom) instruments only */
  381.     unsigned long                   modifiableInstrumentCount;  /* plus n-more are user modifiable */
  382.     unsigned long                   channelMask;                /* (midi device only) which channels device always uses */
  383.     unsigned long                   drumPartCount;              /* maximum multi-timbrality of drum parts */
  384.     unsigned long                   drumCount;                  /* non gm, built in (rom) drumkits only */
  385.     unsigned long                   modifiableDrumCount;        /* plus n-more are user modifiable */
  386.     unsigned long                   drumChannelMask;            /* (midi device only) which channels device always uses */
  387.     unsigned long                   outputCount;                /* number of audio outputs (usually two) */
  388.     unsigned long                   latency;                    /* response time in .Sec */
  389.     unsigned long                   controllers[4];             /* array of 128 bits */
  390.     unsigned long                   gmInstruments[4];           /* array of 128 bits */
  391.     unsigned long                   gmDrums[4];                 /* array of 128 bits */
  392. };
  393. typedef struct SynthesizerDescription   SynthesizerDescription;
  394. enum {
  395.     kVoiceCountDynamic          = -1                            /* constant to use to specify dynamic voicing */
  396. };
  397. struct ToneDescription {
  398.     BigEndianOSType                 synthesizerType;            /* synthesizer type */
  399.     Str31                           synthesizerName;            /* name of instantiation of synth */
  400.     Str31                           instrumentName;             /* preferred name for human use */
  401.     BigEndianLong                   instrumentNumber;           /* inst-number used if synth-name matches */
  402.     BigEndianLong                   gmNumber;                   /* Best matching general MIDI number */
  403. };
  404. typedef struct ToneDescription          ToneDescription;
  405. enum {
  406.     kFirstGMInstrument          = 0x00000001,
  407.     kLastGMInstrument           = 0x00000080,
  408.     kFirstGSInstrument          = 0x00000081,
  409.     kLastGSInstrument           = 0x00003FFF,
  410.     kFirstDrumkit               = 0x00004000,                   /* (first value is "no drum". instrument numbers from 16384->16384+128 are drumkits, and for GM they are _defined_ drumkits! */
  411.     kLastDrumkit                = 0x00004080,
  412.     kFirstROMInstrument         = 0x00008000,
  413.     kLastROMInstrument          = 0x0000FFFF,
  414.     kFirstUserInstrument        = 0x00010000,
  415.     kLastUserInstrument         = 0x0001FFFF
  416. };
  417. /* InstrumentMatch*/
  418. enum {
  419.     kInstrumentMatchSynthesizerType = 1,
  420.     kInstrumentMatchSynthesizerName = 2,
  421.     kInstrumentMatchName        = 4,
  422.     kInstrumentMatchNumber      = 8,
  423.     kInstrumentMatchGMNumber    = 16,
  424.     kInstrumentMatchGSNumber    = 32
  425. };
  426. /* KnobFlags*/
  427. enum {
  428.     kKnobBasic                  = 8,                            /* knob shows up in certain simplified lists of knobs */
  429.     kKnobReadOnly               = 16,                           /* knob value cannot be changed by user or with a SetKnob call */
  430.     kKnobInterruptUnsafe        = 32,                           /* only alter this knob from foreground task time (may access toolbox) */
  431.     kKnobKeyrangeOverride       = 64,                           /* knob can be overridden within a single keyrange (software synth only) */
  432.     kKnobGroupStart             = 128,                          /* knob is first in some logical group of knobs */
  433.     kKnobFixedPoint8            = 1024,
  434.     kKnobFixedPoint16           = 2048,                         /* One of these may be used at a time. */
  435.     kKnobTypeNumber             = 0 << 12,
  436.     kKnobTypeGroupName          = 1 << 12,                      /* "knob" is really a group name for display purposes */
  437.     kKnobTypeBoolean            = 2 << 12,                      /* if range is greater than 1, its a multi-checkbox field */
  438.     kKnobTypeNote               = 3 << 12,                      /* knob range is equivalent to MIDI keys */
  439.     kKnobTypePan                = 4 << 12,                      /* range goes left/right (lose this? ) */
  440.     kKnobTypeInstrument         = 5 << 12,                      /* knob value = reference to another instrument number */
  441.     kKnobTypeSetting            = 6 << 12,                      /* knob value is 1 of n different things (eg, fm algorithms) popup menu */
  442.     kKnobTypeMilliseconds       = 7 << 12,                      /* knob is a millisecond time range */
  443.     kKnobTypePercentage         = 8 << 12,                      /* knob range is displayed as a Percentage */
  444.     kKnobTypeHertz              = 9 << 12,                      /* knob represents frequency */
  445.     kKnobTypeButton             = 10 << 12                      /* momentary trigger push button */
  446. };
  447. enum {
  448.     kUnknownKnobValue           = 0x7FFFFFFF,                   /* a knob with this value means, we don't know it. */
  449.     kDefaultKnobValue           = 0x7FFFFFFE                    /* used to SET a knob to its default value. */
  450. };
  451. struct KnobDescription {
  452.     Str63                           name;
  453.     long                            lowValue;
  454.     long                            highValue;
  455.     long                            defaultValue;               /* a default instrument is made of all default values */
  456.     long                            flags;
  457.     long                            knobID;
  458. };
  459. typedef struct KnobDescription          KnobDescription;
  460. struct GCInstrumentData {
  461.     ToneDescription                 tone;
  462.     long                            knobCount;
  463.     long                            knob[1];
  464. };
  465. typedef struct GCInstrumentData         GCInstrumentData;
  466. typedef GCInstrumentData *              GCInstrumentDataPtr;
  467. typedef GCInstrumentDataPtr *           GCInstrumentDataHandle;
  468. struct InstrumentAboutInfo {
  469.     PicHandle                       p;
  470.     Str255                          author;
  471.     Str255                          copyright;
  472.     Str255                          other;
  473. };
  474. typedef struct InstrumentAboutInfo      InstrumentAboutInfo;
  475. enum {
  476.     notImplementedMusicErr      = (0x80000000 | (0xFFFF & (notImplementedMusicOSErr))),
  477.     cantSendToSynthesizerErr    = (0x80000000 | (0xFFFF & (cantSendToSynthesizerOSErr))),
  478.     cantReceiveFromSynthesizerErr = (0x80000000 | (0xFFFF & (cantReceiveFromSynthesizerOSErr))),
  479.     illegalVoiceAllocationErr   = (0x80000000 | (0xFFFF & (illegalVoiceAllocationOSErr))),
  480.     illegalPartErr              = (0x80000000 | (0xFFFF & (illegalPartOSErr))),
  481.     illegalChannelErr           = (0x80000000 | (0xFFFF & (illegalChannelOSErr))),
  482.     illegalKnobErr              = (0x80000000 | (0xFFFF & (illegalKnobOSErr))),
  483.     illegalKnobValueErr         = (0x80000000 | (0xFFFF & (illegalKnobValueOSErr))),
  484.     illegalInstrumentErr        = (0x80000000 | (0xFFFF & (illegalInstrumentOSErr))),
  485.     illegalControllerErr        = (0x80000000 | (0xFFFF & (illegalControllerOSErr))),
  486.     midiManagerAbsentErr        = (0x80000000 | (0xFFFF & (midiManagerAbsentOSErr))),
  487.     synthesizerNotRespondingErr = (0x80000000 | (0xFFFF & (synthesizerNotRespondingOSErr))),
  488.     synthesizerErr              = (0x80000000 | (0xFFFF & (synthesizerOSErr))),
  489.     illegalNoteChannelErr       = (0x80000000 | (0xFFFF & (illegalNoteChannelOSErr))),
  490.     noteChannelNotAllocatedErr  = (0x80000000 | (0xFFFF & (noteChannelNotAllocatedOSErr))),
  491.     tunePlayerFullErr           = (0x80000000 | (0xFFFF & (tunePlayerFullOSErr))),
  492.     tuneParseErr                = (0x80000000 | (0xFFFF & (tuneParseOSErr)))
  493. };
  494. enum {
  495.     kGetAtomicInstNoExpandedSamples = 1 << 0,
  496.     kGetAtomicInstNoOriginalSamples = 1 << 1,
  497.     kGetAtomicInstNoSamples     = kGetAtomicInstNoExpandedSamples | kGetAtomicInstNoOriginalSamples,
  498.     kGetAtomicInstNoKnobList    = 1 << 2,
  499.     kGetAtomicInstNoInstrumentInfo = 1 << 3,
  500.     kGetAtomicInstOriginalKnobList = 1 << 4,
  501.     kGetAtomicInstAllKnobs      = 1 << 5                        /* return even those that are set to default*/
  502. };
  503. /*
  504.    For non-gm instruments, instrument number of tone description == 0
  505.    If you want to speed up while running, slam the inst num with what Get instrument number returns
  506.    All missing knobs are slammed to the default value
  507. */
  508. enum {
  509.     kSetAtomicInstKeepOriginalInstrument = 1 << 0,
  510.     kSetAtomicInstShareAcrossParts = 1 << 1,                    /* inst disappears when app goes away*/
  511.     kSetAtomicInstCallerTosses  = 1 << 2,                       /* the caller isn't keeping a copy around (for NASetAtomicInstrument)*/
  512.     kSetAtomicInstCallerGuarantees = 1 << 3,                    /* the caller guarantees a copy is around*/
  513.     kSetAtomicInstInterruptSafe = 1 << 4,                       /* dont move memory at this time (but process at next task time)*/
  514.     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*/
  515. };
  516. enum {
  517.     kInstrumentNamesModifiable  = 1,
  518.     kInstrumentNamesBoth        = 2
  519. };
  520. /*
  521.  * Structures specific to the GenericMusicComponent
  522.  */
  523. enum {
  524.     kGenericMusicComponentSubtype = FOUR_CHAR_CODE('gene')
  525. };
  526. struct GenericKnobDescription {
  527.     KnobDescription                 kd;
  528.     long                            hw1;                        /* driver defined */
  529.     long                            hw2;                        /* driver defined */
  530.     long                            hw3;                        /* driver defined */
  531.     long                            settingsID;                 /* resource ID list for boolean and popup names */
  532. };
  533. typedef struct GenericKnobDescription   GenericKnobDescription;
  534. struct GenericKnobDescriptionList {
  535.     long                            knobCount;
  536.     GenericKnobDescription          knob[1];
  537. };
  538. typedef struct GenericKnobDescriptionList GenericKnobDescriptionList;
  539. typedef GenericKnobDescriptionList *    GenericKnobDescriptionListPtr;
  540. typedef GenericKnobDescriptionListPtr * GenericKnobDescriptionListHandle;
  541. /* knobTypes for MusicDerivedSetKnob */
  542. enum {
  543.     kGenericMusicKnob           = 1,
  544.     kGenericMusicInstrumentKnob = 2,
  545.     kGenericMusicDrumKnob       = 3,
  546.     kGenericMusicGlobalController = 4
  547. };
  548. enum {
  549.     kGenericMusicResFirst       = 0,
  550.     kGenericMusicResMiscStringList = 1,                         /* STR# 1: synth name, 2:about author,3:aboutcopyright,4:aboutother */
  551.     kGenericMusicResMiscLongList = 2,                           /* Long various params, see list below */
  552.     kGenericMusicResInstrumentList = 3,                         /* NmLs of names and shorts, categories prefixed by 'oo' */
  553.     kGenericMusicResDrumList    = 4,                            /* NmLs of names and shorts */
  554.     kGenericMusicResInstrumentKnobDescriptionList = 5,          /* Knob */
  555.     kGenericMusicResDrumKnobDescriptionList = 6,                /* Knob */
  556.     kGenericMusicResKnobDescriptionList = 7,                    /* Knob */
  557.     kGenericMusicResBitsLongList = 8,                           /* Long back to back bitmaps of controllers, gminstruments, and drums */
  558.     kGenericMusicResModifiableInstrumentHW = 9,                 /* Shrt same as the hw shorts trailing the instrument names, a shortlist */
  559.     kGenericMusicResGMTranslation = 10,                         /* Long 128 long entries, 1 for each gm inst, of local instrument numbers 1-n (not hw numbers) */
  560.     kGenericMusicResROMInstrumentData = 11,                     /* knob lists for ROM instruments, so the knob values may be known */
  561.     kGenericMusicResAboutPICT   = 12,                           /* picture for aboutlist. must be present for GetAbout call to work */
  562.     kGenericMusicResLast        = 13
  563. };
  564. /* elements of the misc long list */
  565. enum {
  566.     kGenericMusicMiscLongFirst  = 0,
  567.     kGenericMusicMiscLongVoiceCount = 1,
  568.     kGenericMusicMiscLongPartCount = 2,
  569.     kGenericMusicMiscLongModifiableInstrumentCount = 3,
  570.     kGenericMusicMiscLongChannelMask = 4,
  571.     kGenericMusicMiscLongDrumPartCount = 5,
  572.     kGenericMusicMiscLongModifiableDrumCount = 6,
  573.     kGenericMusicMiscLongDrumChannelMask = 7,
  574.     kGenericMusicMiscLongOutputCount = 8,
  575.     kGenericMusicMiscLongLatency = 9,
  576.     kGenericMusicMiscLongFlags  = 10,
  577.     kGenericMusicMiscLongFirstGMHW = 11,                        /* number to add to locate GM main instruments */
  578.     kGenericMusicMiscLongFirstGMDrumHW = 12,                    /* number to add to locate GM drumkits */
  579.     kGenericMusicMiscLongFirstUserHW = 13,                      /* First hw number of user instruments (presumed sequential) */
  580.     kGenericMusicMiscLongLast   = 14
  581. };
  582. struct GCPart {
  583.     long                            hwInstrumentNumber;         /* internal number of recalled instrument */
  584.     short                           controller[128];            /* current values for all controllers */
  585.     long                            volume;                     /* ctrl 7 is special case */
  586.     long                            polyphony;
  587.     long                            midiChannel;                /* 1-16 if in use */
  588.     GCInstrumentData                id;                         /* ToneDescription & knoblist, uncertain length */
  589. };
  590. typedef struct GCPart                   GCPart;
  591. /*
  592.  * Calls specific to the GenericMusicComponent
  593.  */
  594. enum {
  595.     kMusicGenericRange          = 0x0100,
  596.     kMusicDerivedRange          = 0x0200
  597. };
  598. /*
  599.  * Flags in GenericMusicConfigure call
  600.  */
  601. enum {
  602.     kGenericMusicDoMIDI         = 1 << 0,                       /* implement normal MIDI messages for note, controllers, and program changes 0-127 */
  603.     kGenericMusicBank0          = 1 << 1,                       /* implement instrument bank changes on controller 0 */
  604.     kGenericMusicBank32         = 1 << 2,                       /* implement instrument bank changes on controller 32 */
  605.     kGenericMusicErsatzMIDI     = 1 << 3,                       /* construct MIDI packets, but send them to the derived component */
  606.     kGenericMusicCallKnobs      = 1 << 4,                       /* call the derived component with special knob format call */
  607.     kGenericMusicCallParts      = 1 << 5,                       /* call the derived component with special part format call */
  608.     kGenericMusicCallInstrument = 1 << 6,                       /* call MusicDerivedSetInstrument for MusicSetInstrument calls */
  609.     kGenericMusicCallNumber     = 1 << 7,                       /* call MusicDerivedSetPartInstrumentNumber for MusicSetPartInstrumentNumber calls, & don't send any C0 or bank stuff */
  610.     kGenericMusicCallROMInstrument = 1 << 8,                    /* call MusicSetInstrument for MusicSetPartInstrumentNumber for "ROM" instruments, passing params from the ROMi resource */
  611.     kGenericMusicAllDefaults    = 1 << 9                        /* indicates that when a new instrument is recalled, all knobs are reset to DEFAULT settings. True for GS modules */
  612. };
  613. typedef CALLBACK_API( ComponentResult , MusicOfflineDataProcPtr )(Ptr SoundData, long numBytes, long myRefCon);
  614. typedef STACK_UPP_TYPE(MusicOfflineDataProcPtr)                 MusicOfflineDataUPP;
  615. struct OfflineSampleType {
  616.     unsigned long                   numChannels;                /*number of channels,  ie mono = 1*/
  617.     UnsignedFixed                   sampleRate;                 /*sample rate in Apples Fixed point representation*/
  618.     unsigned short                  sampleSize;                 /*number of bits in sample*/
  619. };
  620. typedef struct OfflineSampleType        OfflineSampleType;
  621. struct InstrumentInfoRecord {
  622.     long                            instrumentNumber;           /* instrument number (if 0, name is a catagory)*/
  623.     long                            flags;                      /* show in picker, etc.*/
  624.     long                            toneNameIndex;              /* index in toneNames (1 based)*/
  625.     long                            itxtNameAtomID;             /* index in itxtNames (itxt/name by index)*/
  626. };
  627. typedef struct InstrumentInfoRecord     InstrumentInfoRecord;
  628. struct InstrumentInfoList {
  629.     long                            recordCount;
  630.     Handle                          toneNames;                  /* name from tone description*/
  631.     QTAtomContainer                 itxtNames;                  /* itxt/name atoms for instruments*/
  632.     InstrumentInfoRecord            info[1];
  633. };
  634. typedef struct InstrumentInfoList       InstrumentInfoList;
  635. typedef InstrumentInfoList *            InstrumentInfoListPtr;
  636. typedef InstrumentInfoListPtr *         InstrumentInfoListHandle;
  637. EXTERN_API( ComponentResult )
  638. MusicGetDescription             (MusicComponent         mc,
  639.                                  SynthesizerDescription * sd)                               FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  640. EXTERN_API( ComponentResult )
  641. MusicGetPart                    (MusicComponent         mc,
  642.                                  long                   part,
  643.                                  long *                 midiChannel,
  644.                                  long *                 polyphony)                          FIVEWORDINLINE(0x2F3C, 0x000C, 0x0002, 0x7000, 0xA82A);
  645. EXTERN_API( ComponentResult )
  646. MusicSetPart                    (MusicComponent         mc,
  647.                                  long                   part,
  648.                                  long                   midiChannel,
  649.                                  long                   polyphony)                          FIVEWORDINLINE(0x2F3C, 0x000C, 0x0003, 0x7000, 0xA82A);
  650. EXTERN_API( ComponentResult )
  651. MusicSetPartInstrumentNumber    (MusicComponent         mc,
  652.                                  long                   part,
  653.                                  long                   instrumentNumber)                   FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  654. #if OLDROUTINENAMES
  655. #define MusicSetInstrumentNumber(ci,part,instrumentNumber) MusicSetPartInstrumentNumber(ci, part,instrumentNumber)
  656. #endif
  657. EXTERN_API( ComponentResult )
  658. MusicGetPartInstrumentNumber    (MusicComponent         mc,
  659.                                  long                   part)                               FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  660. EXTERN_API( ComponentResult )
  661. MusicStorePartInstrument        (MusicComponent         mc,
  662.                                  long                   part,
  663.                                  long                   instrumentNumber)                   FIVEWORDINLINE(0x2F3C, 0x0008, 0x0006, 0x7000, 0xA82A);
  664. EXTERN_API( ComponentResult )
  665. MusicGetPartAtomicInstrument    (MusicComponent         mc,
  666.                                  long                   part,
  667.                                  AtomicInstrument *     ai,
  668.                                  long                   flags)                              FIVEWORDINLINE(0x2F3C, 0x000C, 0x0009, 0x7000, 0xA82A);
  669. EXTERN_API( ComponentResult )
  670. MusicSetPartAtomicInstrument    (MusicComponent         mc,
  671.                                  long                   part,
  672.                                  AtomicInstrumentPtr    aiP,
  673.                                  long                   flags)                              FIVEWORDINLINE(0x2F3C, 0x000C, 0x000A, 0x7000, 0xA82A);
  674. /* Obsolete calls*/
  675. EXTERN_API( ComponentResult )
  676. MusicGetInstrumentKnobDescriptionObsolete (MusicComponent  mc,
  677.                                  long                   knobIndex,
  678.                                  void *                 mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x000D, 0x7000, 0xA82A);
  679. EXTERN_API( ComponentResult )
  680. MusicGetDrumKnobDescriptionObsolete (MusicComponent     mc,
  681.                                  long                   knobIndex,
  682.                                  void *                 mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x000E, 0x7000, 0xA82A);
  683. EXTERN_API( ComponentResult )
  684. MusicGetKnobDescriptionObsolete (MusicComponent         mc,
  685.                                  long                   knobIndex,
  686.                                  void *                 mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x000F, 0x7000, 0xA82A);
  687. EXTERN_API( ComponentResult )
  688. MusicGetPartKnob                (MusicComponent         mc,
  689.                                  long                   part,
  690.                                  long                   knobID)                             FIVEWORDINLINE(0x2F3C, 0x0008, 0x0010, 0x7000, 0xA82A);
  691. EXTERN_API( ComponentResult )
  692. MusicSetPartKnob                (MusicComponent         mc,
  693.                                  long                   part,
  694.                                  long                   knobID,
  695.                                  long                   knobValue)                          FIVEWORDINLINE(0x2F3C, 0x000C, 0x0011, 0x7000, 0xA82A);
  696. EXTERN_API( ComponentResult )
  697. MusicGetKnob                    (MusicComponent         mc,
  698.                                  long                   knobID)                             FIVEWORDINLINE(0x2F3C, 0x0004, 0x0012, 0x7000, 0xA82A);
  699. EXTERN_API( ComponentResult )
  700. MusicSetKnob                    (MusicComponent         mc,
  701.                                  long                   knobID,
  702.                                  long                   knobValue)                          FIVEWORDINLINE(0x2F3C, 0x0008, 0x0013, 0x7000, 0xA82A);
  703. EXTERN_API( ComponentResult )
  704. MusicGetPartName                (MusicComponent         mc,
  705.                                  long                   part,
  706.                                  StringPtr              name)                               FIVEWORDINLINE(0x2F3C, 0x0008, 0x0014, 0x7000, 0xA82A);
  707. EXTERN_API( ComponentResult )
  708. MusicSetPartName                (MusicComponent         mc,
  709.                                  long                   part,
  710.                                  StringPtr              name)                               FIVEWORDINLINE(0x2F3C, 0x0008, 0x0015, 0x7000, 0xA82A);
  711. EXTERN_API( ComponentResult )
  712. MusicFindTone                   (MusicComponent         mc,
  713.                                  ToneDescription *      td,
  714.                                  long *                 libraryIndexOut,
  715.                                  unsigned long *        fit)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0016, 0x7000, 0xA82A);
  716. EXTERN_API( ComponentResult )
  717. MusicPlayNote                   (MusicComponent         mc,
  718.                                  long                   part,
  719.                                  long                   pitch,
  720.                                  long                   velocity)                           FIVEWORDINLINE(0x2F3C, 0x000C, 0x0017, 0x7000, 0xA82A);
  721. EXTERN_API( ComponentResult )
  722. MusicResetPart                  (MusicComponent         mc,
  723.                                  long                   part)                               FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  724. EXTERN_API( ComponentResult )
  725. MusicSetPartController          (MusicComponent         mc,
  726.                                  long                   part,
  727.                                  MusicController        controllerNumber,
  728.                                  long                   controllerValue)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x0019, 0x7000, 0xA82A);
  729. #if OLDROUTINENAMES
  730. #define MusicSetController(ci,part,controllerNumber,controllerValue) MusicSetPartController(ci, part,controllerNumber,controllerValue)
  731. #endif
  732. EXTERN_API( ComponentResult )
  733. MusicGetPartController          (MusicComponent         mc,
  734.                                  long                   part,
  735.                                  MusicController        controllerNumber)                   FIVEWORDINLINE(0x2F3C, 0x0008, 0x001A, 0x7000, 0xA82A);
  736. EXTERN_API( ComponentResult )
  737. MusicGetMIDIProc                (MusicComponent         mc,
  738.                                  MusicMIDISendUPP *     midiSendProc,
  739.                                  long *                 refCon)                             FIVEWORDINLINE(0x2F3C, 0x0008, 0x001B, 0x7000, 0xA82A);
  740. EXTERN_API( ComponentResult )
  741. MusicSetMIDIProc                (MusicComponent         mc,
  742.                                  MusicMIDISendUPP       midiSendProc,
  743.                                  long                   refCon)                             FIVEWORDINLINE(0x2F3C, 0x0008, 0x001C, 0x7000, 0xA82A);
  744. EXTERN_API( ComponentResult )
  745. MusicGetInstrumentNames         (MusicComponent         mc,
  746.                                  long                   modifiableInstruments,
  747.                                  Handle *               instrumentNames,
  748.                                  Handle *               instrumentCategoryLasts,
  749.                                  Handle *               instrumentCategoryNames)            FIVEWORDINLINE(0x2F3C, 0x0010, 0x001D, 0x7000, 0xA82A);
  750. EXTERN_API( ComponentResult )
  751. MusicGetDrumNames               (MusicComponent         mc,
  752.                                  long                   modifiableInstruments,
  753.                                  Handle *               instrumentNumbers,
  754.                                  Handle *               instrumentNames)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x001E, 0x7000, 0xA82A);
  755. EXTERN_API( ComponentResult )
  756. MusicGetMasterTune              (MusicComponent         mc)                                 FIVEWORDINLINE(0x2F3C, 0x0000, 0x001F, 0x7000, 0xA82A);
  757. EXTERN_API( ComponentResult )
  758. MusicSetMasterTune              (MusicComponent         mc,
  759.                                  long                   masterTune)                         FIVEWORDINLINE(0x2F3C, 0x0004, 0x0020, 0x7000, 0xA82A);
  760. EXTERN_API( ComponentResult )
  761. MusicGetInstrumentAboutInfo     (MusicComponent         mc,
  762.                                  long                   part,
  763.                                  InstrumentAboutInfo *  iai)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0022, 0x7000, 0xA82A);
  764. EXTERN_API( ComponentResult )
  765. MusicGetDeviceConnection        (MusicComponent         mc,
  766.                                  long                   index,
  767.                                  long *                 id1,
  768.                                  long *                 id2)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0023, 0x7000, 0xA82A);
  769. EXTERN_API( ComponentResult )
  770. MusicUseDeviceConnection        (MusicComponent         mc,
  771.                                  long                   id1,
  772.                                  long                   id2)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0024, 0x7000, 0xA82A);
  773. EXTERN_API( ComponentResult )
  774. MusicGetKnobSettingStrings      (MusicComponent         mc,
  775.                                  long                   knobIndex,
  776.                                  long                   isGlobal,
  777.                                  Handle *               settingsNames,
  778.                                  Handle *               settingsCategoryLasts,
  779.                                  Handle *               settingsCategoryNames)              FIVEWORDINLINE(0x2F3C, 0x0014, 0x0025, 0x7000, 0xA82A);
  780. EXTERN_API( ComponentResult )
  781. MusicGetMIDIPorts               (MusicComponent         mc,
  782.                                  long *                 inputPortCount,
  783.                                  long *                 outputPortCount)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0026, 0x7000, 0xA82A);
  784. EXTERN_API( ComponentResult )
  785. MusicSendMIDI                   (MusicComponent         mc,
  786.                                  long                   portIndex,
  787.                                  MusicMIDIPacket *      mp)                                 FIVEWORDINLINE(0x2F3C, 0x0008, 0x0027, 0x7000, 0xA82A);
  788. EXTERN_API( ComponentResult )
  789. MusicReceiveMIDI                (MusicComponent         mc,
  790.                                  MusicMIDIReadHookUPP   readHook,
  791.                                  long                   refCon)                             FIVEWORDINLINE(0x2F3C, 0x0008, 0x0028, 0x7000, 0xA82A);
  792. EXTERN_API( ComponentResult )
  793. MusicStartOffline               (MusicComponent         mc,
  794.                                  unsigned long *        numChannels,
  795.                                  UnsignedFixed *        sampleRate,
  796.                                  unsigned short *       sampleSize,
  797.                                  MusicOfflineDataUPP    dataProc,
  798.                                  long                   dataProcRefCon)                     FIVEWORDINLINE(0x2F3C, 0x0014, 0x0029, 0x7000, 0xA82A);
  799. EXTERN_API( ComponentResult )
  800. MusicSetOfflineTimeTo           (MusicComponent         mc,
  801.                                  long                   newTimeStamp)                       FIVEWORDINLINE(0x2F3C, 0x0004, 0x002A, 0x7000, 0xA82A);
  802. EXTERN_API( ComponentResult )
  803. MusicGetInstrumentKnobDescription (MusicComponent       mc,
  804.                                  long                   knobIndex,
  805.                                  KnobDescription *      mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x002B, 0x7000, 0xA82A);
  806. EXTERN_API( ComponentResult )
  807. MusicGetDrumKnobDescription     (MusicComponent         mc,
  808.                                  long                   knobIndex,
  809.                                  KnobDescription *      mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x002C, 0x7000, 0xA82A);
  810. EXTERN_API( ComponentResult )
  811. MusicGetKnobDescription         (MusicComponent         mc,
  812.                                  long                   knobIndex,
  813.                                  KnobDescription *      mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x002D, 0x7000, 0xA82A);
  814. EXTERN_API( ComponentResult )
  815. MusicGetInfoText                (MusicComponent         mc,
  816.                                  long                   selector,
  817.                                  Handle *               textH,
  818.                                  Handle *               styleH)                             FIVEWORDINLINE(0x2F3C, 0x000C, 0x002E, 0x7000, 0xA82A);
  819. enum {
  820.     kGetInstrumentInfoNoBuiltIn = 1 << 0,
  821.     kGetInstrumentInfoMidiUserInst = 1 << 1,
  822.     kGetInstrumentInfoNoIText   = 1 << 2
  823. };
  824. EXTERN_API( ComponentResult )
  825. MusicGetInstrumentInfo          (MusicComponent         mc,
  826.                                  long                   getInstrumentInfoFlags,
  827.                                  InstrumentInfoListHandle * infoListH)                      FIVEWORDINLINE(0x2F3C, 0x0008, 0x002F, 0x7000, 0xA82A);
  828. EXTERN_API( ComponentResult )
  829. MusicTask                       (MusicComponent         mc)                                 FIVEWORDINLINE(0x2F3C, 0x0000, 0x0031, 0x7000, 0xA82A);
  830. EXTERN_API( ComponentResult )
  831. MusicSetPartInstrumentNumberInterruptSafe (MusicComponent  mc,
  832.                                  long                   part,
  833.                                  long                   instrumentNumber)                   FIVEWORDINLINE(0x2F3C, 0x0008, 0x0032, 0x7000, 0xA82A);
  834. EXTERN_API( ComponentResult )
  835. MusicSetPartSoundLocalization   (MusicComponent         mc,
  836.                                  long                   part,
  837.                                  Handle                 data)                               FIVEWORDINLINE(0x2F3C, 0x0008, 0x0033, 0x7000, 0xA82A);
  838. EXTERN_API( ComponentResult )
  839. MusicGenericConfigure           (MusicComponent         mc,
  840.                                  long                   mode,
  841.                                  long                   flags,
  842.                                  long                   baseResID)                          FIVEWORDINLINE(0x2F3C, 0x000C, 0x0100, 0x7000, 0xA82A);
  843. EXTERN_API( ComponentResult )
  844. MusicGenericGetPart             (MusicComponent         mc,
  845.                                  long                   partNumber,
  846.                                  GCPart **              part)                               FIVEWORDINLINE(0x2F3C, 0x0008, 0x0101, 0x7000, 0xA82A);
  847. EXTERN_API( ComponentResult )
  848. MusicGenericGetKnobList         (MusicComponent         mc,
  849.                                  long                   knobType,
  850.                                  GenericKnobDescriptionListHandle * gkdlH)                  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0102, 0x7000, 0xA82A);
  851. EXTERN_API( ComponentResult )
  852. MusicGenericSetResourceNumbers  (MusicComponent         mc,
  853.                                  Handle                 resourceIDH)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0103, 0x7000, 0xA82A);
  854. EXTERN_API( ComponentResult )
  855. MusicDerivedMIDISend            (MusicComponent         mc,
  856.                                  MusicMIDIPacket *      packet)                             FIVEWORDINLINE(0x2F3C, 0x0004, 0x0200, 0x7000, 0xA82A);
  857. EXTERN_API( ComponentResult )
  858. MusicDerivedSetKnob             (MusicComponent         mc,
  859.                                  long                   knobType,
  860.                                  long                   knobNumber,
  861.                                  long                   knobValue,
  862.                                  long                   partNumber,
  863.                                  GCPart *               p,
  864.                                  GenericKnobDescription * gkd)                              FIVEWORDINLINE(0x2F3C, 0x0018, 0x0201, 0x7000, 0xA82A);
  865. EXTERN_API( ComponentResult )
  866. MusicDerivedSetPart             (MusicComponent         mc,
  867.                                  long                   partNumber,
  868.                                  GCPart *               p)                                  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0202, 0x7000, 0xA82A);
  869. EXTERN_API( ComponentResult )
  870. MusicDerivedSetInstrument       (MusicComponent         mc,
  871.                                  long                   partNumber,
  872.                                  GCPart *               p)                                  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0203, 0x7000, 0xA82A);
  873. EXTERN_API( ComponentResult )
  874. MusicDerivedSetPartInstrumentNumber (MusicComponent     mc,
  875.                                  long                   partNumber,
  876.                                  GCPart *               p)                                  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0204, 0x7000, 0xA82A);
  877. EXTERN_API( ComponentResult )
  878. MusicDerivedSetMIDI             (MusicComponent         mc,
  879.                                  MusicMIDISendUPP       midiProc,
  880.                                  long                   refcon,
  881.                                  long                   midiChannel)                        FIVEWORDINLINE(0x2F3C, 0x000C, 0x0205, 0x7000, 0xA82A);
  882. EXTERN_API( ComponentResult )
  883. MusicDerivedStorePartInstrument (MusicComponent         mc,
  884.                                  long                   partNumber,
  885.                                  GCPart *               p,
  886.                                  long                   instrumentNumber)                   FIVEWORDINLINE(0x2F3C, 0x000C, 0x0206, 0x7000, 0xA82A);
  887. EXTERN_API( ComponentResult )
  888. MusicDerivedOpenResFile         (MusicComponent         mc)                                 FIVEWORDINLINE(0x2F3C, 0x0000, 0x0207, 0x7000, 0xA82A);
  889. EXTERN_API( ComponentResult )
  890. MusicDerivedCloseResFile        (MusicComponent         mc,
  891.                                  short                  resRefNum)                          FIVEWORDINLINE(0x2F3C, 0x0002, 0x0208, 0x7000, 0xA82A);
  892. /* Mask bit for returned value by InstrumentFind.*/
  893. enum {
  894.     kInstrumentExactMatch       = 0x00020000,
  895.     kInstrumentRecommendedSubstitute = 0x00010000,
  896.     kInstrumentQualityField     = (long)0xFF000000,
  897.     kInstrumentRoland8BitQuality = 0x05000000
  898. };
  899. typedef InstrumentAboutInfo *           InstrumentAboutInfoPtr;
  900. typedef InstrumentAboutInfoPtr *        InstrumentAboutInfoHandle;
  901. struct GMInstrumentInfo {
  902.     long                            cmpInstID;
  903.     long                            gmInstNum;
  904.     long                            instMatch;
  905. };
  906. typedef struct GMInstrumentInfo         GMInstrumentInfo;
  907. typedef GMInstrumentInfo *              GMInstrumentInfoPtr;
  908. typedef GMInstrumentInfoPtr *           GMInstrumentInfoHandle;
  909. struct nonGMInstrumentInfoRecord {
  910.     long                            cmpInstID;                  /* if 0, category name*/
  911.     long                            flags;                      /* match, show in picker*/
  912.     long                            toneNameIndex;              /* index in toneNames (1 based)*/
  913.     long                            itxtNameAtomID;             /* index in itxtNames (itxt/name by index)*/
  914. };
  915. typedef struct nonGMInstrumentInfoRecord nonGMInstrumentInfoRecord;
  916. struct nonGMInstrumentInfo {
  917.     long                            recordCount;
  918.     Handle                          toneNames;                  /* name from tone description*/
  919.     QTAtomContainer                 itxtNames;                  /* itext/name atoms for instruments*/
  920.     nonGMInstrumentInfoRecord       instInfo[1];
  921. };
  922. typedef struct nonGMInstrumentInfo      nonGMInstrumentInfo;
  923. typedef nonGMInstrumentInfo *           nonGMInstrumentInfoPtr;
  924. typedef nonGMInstrumentInfoPtr *        nonGMInstrumentInfoHandle;
  925. struct InstCompInfo {
  926.     long                            infoSize;                   /* size of this record*/
  927.     Str31                           InstrumentLibraryName;
  928.     QTAtomContainer                 InstrumentLibraryITxt;      /* itext/name atoms for instruments*/
  929.     long                            GMinstrumentCount;
  930.     GMInstrumentInfoHandle          GMinstrumentInfo;
  931.     long                            GMdrumCount;
  932.     GMInstrumentInfoHandle          GMdrumInfo;
  933.     long                            nonGMinstrumentCount;
  934.     nonGMInstrumentInfoHandle       nonGMinstrumentInfo;
  935. };
  936. typedef struct InstCompInfo             InstCompInfo;
  937. typedef InstCompInfo *                  InstCompInfoPtr;
  938. typedef InstCompInfoPtr *               InstCompInfoHandle;
  939. EXTERN_API( ComponentResult )
  940. InstrumentGetInst               (ComponentInstance      ci,
  941.                                  long                   instID,
  942.                                  AtomicInstrument *     atomicInst,
  943.                                  long                   flags)                              FIVEWORDINLINE(0x2F3C, 0x000C, 0x0001, 0x7000, 0xA82A);
  944. EXTERN_API( ComponentResult )
  945. InstrumentGetInfo               (ComponentInstance      ci,
  946.                                  long                   getInstrumentInfoFlags,
  947.                                  InstCompInfoHandle *   instInfo)                           FIVEWORDINLINE(0x2F3C, 0x0008, 0x0002, 0x7000, 0xA82A);
  948. EXTERN_API( ComponentResult )
  949. InstrumentInitialize            (ComponentInstance      ci,
  950.                                  long                   initFormat,
  951.                                  void *                 initParams)                         FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);
  952. EXTERN_API( ComponentResult )
  953. InstrumentOpenComponentResFile  (ComponentInstance      ci,
  954.                                  short *                resFile)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  955. EXTERN_API( ComponentResult )
  956. InstrumentCloseComponentResFile (ComponentInstance      ci,
  957.                                  short                  resFile)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0x0005, 0x7000, 0xA82A);
  958. EXTERN_API( ComponentResult )
  959. InstrumentGetComponentRefCon    (ComponentInstance      ci,
  960.                                  void **                refCon)                             FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  961. EXTERN_API( ComponentResult )
  962. InstrumentSetComponentRefCon    (ComponentInstance      ci,
  963.                                  void *                 refCon)                             FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  964. EXTERN_API( ComponentResult )
  965. InstrumentGetSynthesizerType    (ComponentInstance      ci,
  966.                                  OSType *               synthesizerType)                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0008, 0x7000, 0xA82A);
  967. /*--------------------------
  968.     Types
  969. --------------------------*/
  970. enum {
  971.     kNoteRequestNoGM            = 1,                            /* dont degrade to a GM synth */
  972.     kNoteRequestNoSynthType     = 2,                            /* dont degrade to another synth of same type but different name */
  973.     kNoteRequestSynthMustMatch  = 4                             /* synthType must be a match, including kGMSynthComponentSubType */
  974. };
  975. enum {
  976.     kNoteRequestSpecifyMIDIChannel = 0x80
  977. };
  978. typedef ComponentInstance               NoteAllocator;
  979. /*
  980.     The midiChannelAssignment field of this structure is used to assign a MIDI channel 
  981.     when a NoteChannel is created from a NoteRequest.
  982.     A value of 0 indicates a MIDI channel has *not* been assigned
  983.     A value of (kNoteRequestSpecifyMIDIChannel | 1->16) is a MIDI channel assignment
  984. */
  985. typedef UInt8                           NoteRequestMIDIChannel;
  986. struct NoteRequestInfo {
  987.     UInt8                           flags;                      /* 1: dont accept GM match, 2: dont accept same-synth-type match */
  988.     NoteRequestMIDIChannel          midiChannelAssignment;      /* (kNoteRequestSpecifyMIDIChannel | 1->16) as MIDI Channel assignement or zero - see notes above  */
  989.     BigEndianShort                  polyphony;                  /* Maximum number of voices */
  990.     BigEndianFixed                  typicalPolyphony;           /* Hint for level mixing */
  991. };
  992. typedef struct NoteRequestInfo          NoteRequestInfo;
  993. struct NoteRequest {
  994.     NoteRequestInfo                 info;
  995.     ToneDescription                 tone;
  996. };
  997. typedef struct NoteRequest              NoteRequest;
  998. typedef struct OpaqueNoteChannel*       NoteChannel;
  999. enum {
  1000.     kPickDontMix                = 1,                            /* dont mix instruments with drum sounds */
  1001.     kPickSameSynth              = 2,                            /* only allow the same device that went in, to come out */
  1002.     kPickUserInsts              = 4,                            /* show user insts in addition to ROM voices */
  1003.     kPickEditAllowEdit          = 8,                            /* lets user switch over to edit mode */
  1004.     kPickEditAllowPick          = 16,                           /* lets the user switch over to pick mode */
  1005.     kPickEditSynthGlobal        = 32,                           /* edit the global knobs of the synth */
  1006.     kPickEditControllers        = 64                            /* edit the controllers of the notechannel */
  1007. };
  1008. enum {
  1009.     kNoteAllocatorComponentType = FOUR_CHAR_CODE('nota')
  1010. };
  1011. /*--------------------------------
  1012.     Note Allocator Prototypes
  1013. --------------------------------*/
  1014. EXTERN_API( ComponentResult )
  1015. NARegisterMusicDevice           (NoteAllocator          na,
  1016.                                  OSType                 synthType,
  1017.                                  Str31                  name,
  1018.                                  SynthesizerConnections * connections)                      FIVEWORDINLINE(0x2F3C, 0x000C, 0x0000, 0x7000, 0xA82A);
  1019. EXTERN_API( ComponentResult )
  1020. NAUnregisterMusicDevice         (NoteAllocator          na,
  1021.                                  long                   index)                              FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  1022. EXTERN_API( ComponentResult )
  1023. NAGetRegisteredMusicDevice      (NoteAllocator          na,
  1024.                                  long                   index,
  1025.                                  OSType *               synthType,
  1026.                                  Str31                  name,
  1027.                                  SynthesizerConnections * connections,
  1028.                                  MusicComponent *       mc)                                 FIVEWORDINLINE(0x2F3C, 0x0014, 0x0002, 0x7000, 0xA82A);
  1029. EXTERN_API( ComponentResult )
  1030. NASaveMusicConfiguration        (NoteAllocator          na)                                 FIVEWORDINLINE(0x2F3C, 0x0000, 0x0003, 0x7000, 0xA82A);
  1031. EXTERN_API( ComponentResult )
  1032. NANewNoteChannel                (NoteAllocator          na,
  1033.                                  NoteRequest *          noteRequest,
  1034.                                  NoteChannel *          outChannel)                         FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  1035. EXTERN_API( ComponentResult )
  1036. NADisposeNoteChannel            (NoteAllocator          na,
  1037.                                  NoteChannel            noteChannel)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  1038. EXTERN_API( ComponentResult )
  1039. NAGetNoteChannelInfo            (NoteAllocator          na,
  1040.                                  NoteChannel            noteChannel,
  1041.                                  long *                 index,
  1042.                                  long *                 part)                               FIVEWORDINLINE(0x2F3C, 0x000C, 0x0006, 0x7000, 0xA82A);
  1043. EXTERN_API( ComponentResult )
  1044. NAPrerollNoteChannel            (NoteAllocator          na,
  1045.                                  NoteChannel            noteChannel)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  1046. EXTERN_API( ComponentResult )
  1047. NAUnrollNoteChannel             (NoteAllocator          na,
  1048.                                  NoteChannel            noteChannel)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0008, 0x7000, 0xA82A);
  1049. EXTERN_API( ComponentResult )
  1050. NASetNoteChannelVolume          (NoteAllocator          na,
  1051.                                  NoteChannel            noteChannel,
  1052.                                  Fixed                  volume)                             FIVEWORDINLINE(0x2F3C, 0x0008, 0x000B, 0x7000, 0xA82A);
  1053. EXTERN_API( ComponentResult )
  1054. NAResetNoteChannel              (NoteAllocator          na,
  1055.                                  NoteChannel            noteChannel)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  1056. EXTERN_API( ComponentResult )
  1057. NAPlayNote                      (NoteAllocator          na,
  1058.                                  NoteChannel            noteChannel,
  1059.                                  long                   pitch,
  1060.                                  long                   velocity)                           FIVEWORDINLINE(0x2F3C, 0x000C, 0x000D, 0x7000, 0xA82A);
  1061. EXTERN_API( ComponentResult )
  1062. NASetController                 (NoteAllocator          na,
  1063.                                  NoteChannel            noteChannel,
  1064.                                  long                   controllerNumber,
  1065.                                  long                   controllerValue)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x000E, 0x7000, 0xA82A);
  1066. EXTERN_API( ComponentResult )
  1067. NASetKnob                       (NoteAllocator          na,
  1068.                                  NoteChannel            noteChannel,
  1069.                                  long                   knobNumber,
  1070.                                  long                   knobValue)                          FIVEWORDINLINE(0x2F3C, 0x000C, 0x000F, 0x7000, 0xA82A);
  1071. EXTERN_API( ComponentResult )
  1072. NAFindNoteChannelTone           (NoteAllocator          na,
  1073.                                  NoteChannel            noteChannel,
  1074.                                  ToneDescription *      td,
  1075.                                  long *                 instrumentNumber)                   FIVEWORDINLINE(0x2F3C, 0x000C, 0x0010, 0x7000, 0xA82A);
  1076. EXTERN_API( ComponentResult )
  1077. NASetInstrumentNumber           (NoteAllocator          na,
  1078.                                  NoteChannel            noteChannel,
  1079.                                  long                   instrumentNumber)                   FIVEWORDINLINE(0x2F3C, 0x0008, 0x0011, 0x7000, 0xA82A);
  1080. #if OLDROUTINENAMES
  1081. #define NASetNoteChannelInstrument(ci, noteChannel,instrumentNumber ) NASetInstrumentNumber(ci, noteChannel,instrumentNumber)
  1082. #define NASetInstrument(ci, noteChannel,instrumentNumber ) NASetInstrumentNumber(ci, noteChannel,instrumentNumber)
  1083. #endif
  1084. EXTERN_API( ComponentResult )
  1085. NAPickInstrument                (NoteAllocator          na,
  1086.                                  ModalFilterUPP         filterProc,
  1087.                                  StringPtr              prompt,
  1088.                                  ToneDescription *      sd,
  1089.                                  unsigned long          flags,
  1090.                                  long                   refCon,
  1091.                                  long                   reserved1,
  1092.                                  long                   reserved2)                          FIVEWORDINLINE(0x2F3C, 0x001C, 0x0012, 0x7000, 0xA82A);
  1093. EXTERN_API( ComponentResult )
  1094. NAPickArrangement               (NoteAllocator          na,
  1095.                                  ModalFilterUPP         filterProc,
  1096.                                  StringPtr              prompt,
  1097.                                  long                   zero1,
  1098.                                  long                   zero2,
  1099.                                  Track                  t,
  1100.                                  StringPtr              songName)                           FIVEWORDINLINE(0x2F3C, 0x0018, 0x0013, 0x7000, 0xA82A);
  1101. EXTERN_API( ComponentResult )
  1102. NASetDefaultMIDIInput           (NoteAllocator          na,
  1103.                                  SynthesizerConnections * sc)                               FIVEWORDINLINE(0x2F3C, 0x0004, 0x0015, 0x7000, 0xA82A);
  1104. EXTERN_API( ComponentResult )
  1105. NAGetDefaultMIDIInput           (NoteAllocator          na,
  1106.                                  SynthesizerConnections * sc)                               FIVEWORDINLINE(0x2F3C, 0x0004, 0x0016, 0x7000, 0xA82A);
  1107. EXTERN_API( ComponentResult )
  1108. NAUseDefaultMIDIInput           (NoteAllocator          na,
  1109.                                  MusicMIDIReadHookUPP   readHook,
  1110.                                  long                   refCon,
  1111.                                  unsigned long          flags)                              FIVEWORDINLINE(0x2F3C, 0x000C, 0x0019, 0x7000, 0xA82A);
  1112. EXTERN_API( ComponentResult )
  1113. NALoseDefaultMIDIInput          (NoteAllocator          na)                                 FIVEWORDINLINE(0x2F3C, 0x0000, 0x001A, 0x7000, 0xA82A);
  1114. EXTERN_API( ComponentResult )
  1115. NAStuffToneDescription          (NoteAllocator          na,
  1116.                                  long                   gmNumber,
  1117.                                  ToneDescription *      td)                                 FIVEWORDINLINE(0x2F3C, 0x0008, 0x001B, 0x7000, 0xA82A);
  1118. EXTERN_API( ComponentResult )
  1119. NACopyrightDialog               (NoteAllocator          na,
  1120.                                  PicHandle              p,
  1121.                                  StringPtr              author,
  1122.                                  StringPtr              copyright,
  1123.                                  StringPtr              other,
  1124.                                  StringPtr              title,
  1125.                                  ModalFilterUPP         filterProc,
  1126.                                  long                   refCon)                             FIVEWORDINLINE(0x2F3C, 0x001C, 0x001C, 0x7000, 0xA82A);
  1127. /*
  1128.     kNADummyOneSelect = 29
  1129.     kNADummyTwoSelect = 30
  1130. */
  1131. EXTERN_API( ComponentResult )
  1132. NAGetIndNoteChannel             (NoteAllocator          na,
  1133.                                  long                   index,
  1134.                                  NoteChannel *          nc,
  1135.                                  long *                 seed)                               FIVEWORDINLINE(0x2F3C, 0x000C, 0x001F, 0x7000, 0xA82A);
  1136. EXTERN_API( ComponentResult )
  1137. NAGetMIDIPorts                  (NoteAllocator          na,
  1138.                                  QTMIDIPortListHandle * inputPorts,
  1139.                                  QTMIDIPortListHandle * outputPorts)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x0021, 0x7000, 0xA82A);
  1140. EXTERN_API( ComponentResult )
  1141. NAGetNoteRequest                (NoteAllocator          na,
  1142.                                  NoteChannel            noteChannel,
  1143.                                  NoteRequest *          nrOut)                              FIVEWORDINLINE(0x2F3C, 0x0008, 0x0022, 0x7000, 0xA82A);
  1144. EXTERN_API( ComponentResult )
  1145. NASendMIDI                      (NoteAllocator          na,
  1146.                                  NoteChannel            noteChannel,
  1147.                                  MusicMIDIPacket *      mp)                                 FIVEWORDINLINE(0x2F3C, 0x0008, 0x0023, 0x7000, 0xA82A);
  1148. EXTERN_API( ComponentResult )
  1149. NAPickEditInstrument            (NoteAllocator          na,
  1150.                                  ModalFilterUPP         filterProc,
  1151.                                  StringPtr              prompt,
  1152.                                  long                   refCon,
  1153.                                  NoteChannel            nc,
  1154.                                  AtomicInstrument       ai,
  1155.                                  long                   flags)                              FIVEWORDINLINE(0x2F3C, 0x0018, 0x0024, 0x7000, 0xA82A);
  1156. EXTERN_API( ComponentResult )
  1157. NANewNoteChannelFromAtomicInstrument (NoteAllocator     na,
  1158.                                  AtomicInstrumentPtr    instrument,
  1159.                                  long                   flags,
  1160.                                  NoteChannel *          outChannel)                         FIVEWORDINLINE(0x2F3C, 0x000C, 0x0025, 0x7000, 0xA82A);
  1161. EXTERN_API( ComponentResult )
  1162. NASetAtomicInstrument           (NoteAllocator          na,
  1163.                                  NoteChannel            noteChannel,
  1164.                                  AtomicInstrumentPtr    instrument,
  1165.                                  long                   flags)                              FIVEWORDINLINE(0x2F3C, 0x000C, 0x0026, 0x7000, 0xA82A);
  1166. EXTERN_API( ComponentResult )
  1167. NAGetKnob                       (NoteAllocator          na,
  1168.                                  NoteChannel            noteChannel,
  1169.                                  long                   knobNumber,
  1170.                                  long *                 knobValue)                          FIVEWORDINLINE(0x2F3C, 0x000C, 0x0028, 0x7000, 0xA82A);
  1171. EXTERN_API( ComponentResult )
  1172. NATask                          (NoteAllocator          na)                                 FIVEWORDINLINE(0x2F3C, 0x0000, 0x0029, 0x7000, 0xA82A);
  1173. EXTERN_API( ComponentResult )
  1174. NASetNoteChannelBalance         (NoteAllocator          na,
  1175.                                  NoteChannel            noteChannel,
  1176.                                  long                   balance)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x002A, 0x7000, 0xA82A);
  1177. EXTERN_API( ComponentResult )
  1178. NASetInstrumentNumberInterruptSafe (NoteAllocator       na,
  1179.                                  NoteChannel            noteChannel,
  1180.                                  long                   instrumentNumber)                   FIVEWORDINLINE(0x2F3C, 0x0008, 0x002B, 0x7000, 0xA82A);
  1181. EXTERN_API( ComponentResult )
  1182. NASetNoteChannelSoundLocalization (NoteAllocator        na,
  1183.                                  NoteChannel            noteChannel,
  1184.                                  Handle                 data)                               FIVEWORDINLINE(0x2F3C, 0x0008, 0x002C, 0x7000, 0xA82A);
  1185. EXTERN_API( ComponentResult )
  1186. NAGetController                 (NoteAllocator          na,
  1187.                                  NoteChannel            noteChannel,
  1188.                                  long                   controllerNumber,
  1189.                                  long *                 controllerValue)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x002D, 0x7000, 0xA82A);
  1190. enum {
  1191.     kTuneQueueDepth             = 8                             /* Deepest you can queue tune segments */
  1192. };
  1193. struct TuneStatus {
  1194.     unsigned long *                 tune;                       /* currently playing tune */
  1195.     unsigned long *                 tunePtr;                    /* position within currently playing piece */
  1196.     TimeValue                       time;                       /* current tune time */
  1197.     short                           queueCount;                 /* how many pieces queued up? */
  1198.     short                           queueSpots;                 /* How many more tunepieces can be queued */
  1199.     TimeValue                       queueTime;                  /* How much time is queued up? (can be very inaccurate) */
  1200.     long                            reserved[3];
  1201. };
  1202. typedef struct TuneStatus               TuneStatus;
  1203. typedef CALLBACK_API( void , TuneCallBackProcPtr )(const TuneStatus *status, long refCon);
  1204. typedef CALLBACK_API( void , TunePlayCallBackProcPtr )(unsigned long *event, long seed, long refCon);
  1205. typedef STACK_UPP_TYPE(TuneCallBackProcPtr)                     TuneCallBackUPP;
  1206. typedef STACK_UPP_TYPE(TunePlayCallBackProcPtr)                 TunePlayCallBackUPP;
  1207. typedef ComponentInstance               TunePlayer;
  1208. enum {
  1209.     kTunePlayerComponentType    = FOUR_CHAR_CODE('tune')
  1210. };
  1211. EXTERN_API( ComponentResult )
  1212. TuneSetHeader                   (TunePlayer             tp,
  1213.                                  unsigned long *        header)                             FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  1214. EXTERN_API( ComponentResult )
  1215. TuneGetTimeBase                 (TunePlayer             tp,
  1216.                                  TimeBase *             tb)                                 FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  1217. EXTERN_API( ComponentResult )
  1218. TuneSetTimeScale                (TunePlayer             tp,
  1219.                                  TimeScale              scale)                              FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  1220. EXTERN_API( ComponentResult )
  1221. TuneGetTimeScale                (TunePlayer             tp,
  1222.                                  TimeScale *            scale)                              FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  1223. EXTERN_API( ComponentResult )
  1224. TuneGetIndexedNoteChannel       (TunePlayer             tp,
  1225.                                  long                   i,
  1226.                                  NoteChannel *          nc)                                 FIVEWORDINLINE(0x2F3C, 0x0008, 0x0008, 0x7000, 0xA82A);
  1227. /* Values for when to start. */
  1228. enum {
  1229.     kTuneStartNow               = 1,                            /* start after buffer is implied */
  1230.     kTuneDontClipNotes          = 2,                            /* allow notes to finish their durations outside sample */
  1231.     kTuneExcludeEdgeNotes       = 4,                            /* dont play notes that start at end of tune */
  1232.     kTuneQuickStart             = 8,                            /* Leave all the controllers where they are, ignore start time */
  1233.     kTuneLoopUntil              = 16,                           /* loop a queued tune if there's nothing else in the queue*/
  1234.     kTunePlayDifference         = 32,                           /* by default, the tune difference is skipped*/
  1235.     kTunePlayConcurrent         = 64,                           /* dont block the next tune sequence with this one*/
  1236.     kTuneStartNewMaster         = 16384
  1237. };
  1238. EXTERN_API( ComponentResult )
  1239. TuneQueue                       (TunePlayer             tp,
  1240.                                  unsigned long *        tune,
  1241.                                  Fixed                  tuneRate,
  1242.                                  unsigned long          tuneStartPosition,
  1243.                                  unsigned long          tuneStopPosition,
  1244.                                  unsigned long          queueFlags,
  1245.                                  TuneCallBackUPP        callBackProc,
  1246.                                  long                   refCon)                             FIVEWORDINLINE(0x2F3C, 0x001C, 0x000A, 0x7000, 0xA82A);
  1247. EXTERN_API( ComponentResult )
  1248. TuneInstant                     (TunePlayer             tp,
  1249.                                  unsigned long *        tune,
  1250.                                  unsigned long          tunePosition)                       FIVEWORDINLINE(0x2F3C, 0x0008, 0x000B, 0x7000, 0xA82A);
  1251. EXTERN_API( ComponentResult )
  1252. TuneGetStatus                   (TunePlayer             tp,
  1253.                                  TuneStatus *           status)                             FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  1254. /* Values for stopping. */
  1255. enum {
  1256.     kTuneStopFade               = 1,                            /* do a quick, synchronous fadeout */
  1257.     kTuneStopSustain            = 2,                            /* don't silece notes */
  1258.     kTuneStopInstant            = 4,                            /* silence notes fast (else, decay them) */
  1259.     kTuneStopReleaseChannels    = 8                             /* afterwards, let the channels go */
  1260. };
  1261. EXTERN_API( ComponentResult )
  1262. TuneStop                        (TunePlayer             tp,
  1263.                                  long                   stopFlags)                          FIVEWORDINLINE(0x2F3C, 0x0004, 0x000D, 0x7000, 0xA82A);
  1264. EXTERN_API( ComponentResult )
  1265. TuneSetVolume                   (TunePlayer             tp,
  1266.                                  Fixed                  volume)                             FIVEWORDINLINE(0x2F3C, 0x0004, 0x0010, 0x7000, 0xA82A);
  1267. EXTERN_API( ComponentResult )
  1268. TuneGetVolume                   (TunePlayer             tp)                                 FIVEWORDINLINE(0x2F3C, 0x0000, 0x0011, 0x7000, 0xA82A);
  1269. EXTERN_API( ComponentResult )
  1270. TunePreroll                     (TunePlayer             tp)                                 FIVEWORDINLINE(0x2F3C, 0x0000, 0x0012, 0x7000, 0xA82A);
  1271. EXTERN_API( ComponentResult )
  1272. TuneUnroll                      (TunePlayer             tp)                                 FIVEWORDINLINE(0x2F3C, 0x0000, 0x0013, 0x7000, 0xA82A);
  1273. EXTERN_API( ComponentResult )
  1274. TuneSetNoteChannels             (TunePlayer             tp,
  1275.                                  unsigned long          count,
  1276.                                  NoteChannel *          noteChannelList,
  1277.                                  TunePlayCallBackUPP    playCallBackProc,
  1278.                                  long                   refCon)                             FIVEWORDINLINE(0x2F3C, 0x0010, 0x0014, 0x7000, 0xA82A);
  1279. EXTERN_API( ComponentResult )
  1280. TuneSetPartTranspose            (TunePlayer             tp,
  1281.                                  unsigned long          part,
  1282.                                  long                   transpose,
  1283.                                  long                   velocityShift)                      FIVEWORDINLINE(0x2F3C, 0x000C, 0x0015, 0x7000, 0xA82A);
  1284. EXTERN_API( NoteAllocator )
  1285. TuneGetNoteAllocator            (TunePlayer             tp)                                 FIVEWORDINLINE(0x2F3C, 0x0000, 0x0017, 0x7000, 0xA82A);
  1286. EXTERN_API( ComponentResult )
  1287. TuneSetSofter                   (TunePlayer             tp,
  1288.                                  long                   softer)                             FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  1289. EXTERN_API( ComponentResult )
  1290. TuneTask                        (TunePlayer             tp)                                 FIVEWORDINLINE(0x2F3C, 0x0000, 0x0019, 0x7000, 0xA82A);
  1291. EXTERN_API( ComponentResult )
  1292. TuneSetBalance                  (TunePlayer             tp,
  1293.                                  long                   balance)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x001A, 0x7000, 0xA82A);
  1294. EXTERN_API( ComponentResult )
  1295. TuneSetSoundLocalization        (TunePlayer             tp,
  1296.                                  Handle                 data)                               FIVEWORDINLINE(0x2F3C, 0x0004, 0x001B, 0x7000, 0xA82A);
  1297. EXTERN_API( ComponentResult )
  1298. TuneSetHeaderWithSize           (TunePlayer             tp,
  1299.                                  unsigned long *        header,
  1300.                                  unsigned long          size)                               FIVEWORDINLINE(0x2F3C, 0x0008, 0x001C, 0x7000, 0xA82A);
  1301. /* flags for part mix. */
  1302. enum {
  1303.     kTuneMixMute                = 1,                            /* disable a part */
  1304.     kTuneMixSolo                = 2                             /* if any parts soloed, play only soloed parts */
  1305. };
  1306. EXTERN_API( ComponentResult )
  1307. TuneSetPartMix                  (TunePlayer             tp,
  1308.                                  unsigned long          partNumber,
  1309.                                  long                   volume,
  1310.                                  long                   balance,
  1311.                                  long                   mixFlags)                           FIVEWORDINLINE(0x2F3C, 0x0010, 0x001D, 0x7000, 0xA82A);
  1312. EXTERN_API( ComponentResult )
  1313. TuneGetPartMix                  (TunePlayer             tp,
  1314.                                  unsigned long          partNumber,
  1315.                                  long *                 volumeOut,
  1316.                                  long *                 balanceOut,
  1317.                                  long *                 mixFlagsOut)                        FIVEWORDINLINE(0x2F3C, 0x0010, 0x001E, 0x7000, 0xA82A);
  1318. typedef unsigned long                   MusicOpWord;
  1319. typedef MusicOpWord *                   MusicOpWordPtr;
  1320. /*    QuickTime Music Track Event Formats:
  1321.     At this time, QuickTime music tracks support 5 different event types -- REST events,
  1322.     short NOTE events, short CONTROL events, short GENERAL events, Long NOTE events, 
  1323.     long CONTROL events, and variable GENERAL events.
  1324.  
  1325.         o REST Event (4 bytes/event):
  1326.     
  1327.             (0 0 0) (5-bit UNUSED) (24-bit Rest Duration)
  1328.         
  1329.         o.Short NOTE Events (4 bytes/event):
  1330.     
  1331.             (0 0 1) (5-bit Part) (6-bit Pitch) (7-bit Volume) (11-bit Duration)
  1332.         
  1333.             where:  Pitch is offset by 32 (Actual pitch = pitch field + 32)
  1334.         o.Short CONTROL Events (4 bytes/event):
  1335.     
  1336.             (0 1 0) (5-bit Part) (8-bit Controller) (1-bit UNUSED) (1-bit Sign) (7-bit MSB) (7-bit LSB)
  1337.                                                                          ( or 15-bit Signed Value)
  1338.         o Short GENERAL Event (4 bytes/event):
  1339.     
  1340.             (0 1 1) (1-bit UNUSED) (12-bit Sub-Type) (16-bit Value)
  1341.     
  1342.         o Long NOTE Events (8 bytes/event):
  1343.     
  1344.             (1 0 0 1) (12-bit Part) (1-bit UNUSED) (7-bit Pitch) (1-bit UNUSED) (7-bit Volume)
  1345.             (1 0) (8-bit UNUSED) (22-bit Duration)
  1346.         
  1347.         o.Long CONTROL Event (8 bytes/event):
  1348.         
  1349.             (1 0 1 0) (12-bit Part) (16-bit Value MSB) 
  1350.             (1 0) (14-bit Controller) (16-bit Value LSB)
  1351.     
  1352.         o.Long KNOB Event (8 bytes/event):
  1353.     
  1354.             (1 0 1 1) (12-bit Sub-Type) (16-bit Value MSB)
  1355.             (1 0) (14-bit KNOB) (16-bit Value LSB)
  1356.     
  1357.         o.Variable GENERAL Length Events (N bytes/event):
  1358.     
  1359.             (1 1 1 1) (12-bit Sub-Type) (16-bit Length)
  1360.                 :
  1361.             (32-bit Data values)
  1362.                 :
  1363.             (1 1) (14-bit UNUSED) (16-bit Length)
  1364.     
  1365.             where:  Length field is the number of LONG words in the record.
  1366.                     Lengths include the first and last long words (Minimum length = 2)
  1367.                 
  1368.     The following event type values have not been used yet and are reserved for 
  1369.     future expansion:
  1370.         
  1371.         o (1 0 0 0)     (8 bytes/event)
  1372.         o (1 1 0 0)     (N bytes/event)
  1373.         o (1 1 0 1)     (N bytes/event)
  1374.         o (1 1 1 0)     (N bytes/event)
  1375.         
  1376.     For all events, the following generalizations apply:
  1377.     
  1378.         -   All duration values are specified in Millisecond units.
  1379.         -   Pitch values are intended to map directly to the MIDI key numbers.
  1380.         -   Controllers from 0 to 127 correspond to the standard MIDI controllers.
  1381.             Controllers greater than 127 correspond to other controls (i.e., Pitch Bend, 
  1382.             Key Pressure, and Channel Pressure).    
  1383. */
  1384. /* Defines for the implemented music event data fields*/
  1385. enum {
  1386.     kRestEventType              = 0x00000000,                   /* lower 3-bits */
  1387.     kNoteEventType              = 0x00000001,                   /* lower 3-bits */
  1388.     kControlEventType           = 0x00000002,                   /* lower 3-bits */
  1389.     kMarkerEventType            = 0x00000003,                   /* lower 3-bits */
  1390.     kUndefined1EventType        = 0x00000008,                   /* 4-bits */
  1391.     kXNoteEventType             = 0x00000009,                   /* 4-bits */
  1392.     kXControlEventType          = 0x0000000A,                   /* 4-bits */
  1393.     kKnobEventType              = 0x0000000B,                   /* 4-bits */
  1394.     kUndefined2EventType        = 0x0000000C,                   /* 4-bits */
  1395.     kUndefined3EventType        = 0x0000000D,                   /* 4-bits */
  1396.     kUndefined4EventType        = 0x0000000E,                   /* 4-bits */
  1397.     kGeneralEventType           = 0x0000000F,                   /* 4-bits */
  1398.     kXEventLengthBits           = 0x00000002,                   /* 2 bits: indicates 8-byte event record */
  1399.     kGeneralEventLengthBits     = 0x00000003,                   /* 2 bits: indicates variable length event record */
  1400.     kEventLen                   = 1L,                           /* length of events in long words */
  1401.     kXEventLen                  = 2L,
  1402.     kRestEventLen               = kEventLen,                    /* length of events in long words */
  1403.     kNoteEventLen               = kEventLen,
  1404.     kControlEventLen            = kEventLen,
  1405.     kMarkerEventLen             = kEventLen,
  1406.     kXNoteEventLen              = kXEventLen,
  1407.     kXControlEventLen           = kXEventLen,
  1408.     kGeneralEventLen            = kXEventLen,                   /* 2 or more, however */
  1409.                                                                 /* Universal Event Defines*/
  1410.     kEventLengthFieldPos        = 30,                           /* by looking at these two bits of the 1st or last word         */
  1411.     kEventLengthFieldWidth      = 2,                            /* of an event you can determine the event length                */
  1412.                                                                 /* length field: 0 & 1 => 1 long; 2 => 2 longs; 3 => variable length */
  1413.     kEventTypeFieldPos          = 29,                           /* event type field for short events */
  1414.     kEventTypeFieldWidth        = 3,                            /* short type is 3 bits */
  1415.     kXEventTypeFieldPos         = 28,                           /* event type field for extended events */
  1416.     kXEventTypeFieldWidth       = 4,                            /* extended type is 4 bits */
  1417.     kEventPartFieldPos          = 24,
  1418.     kEventPartFieldWidth        = 5,
  1419.     kXEventPartFieldPos         = 16,                           /* in the 1st long word */
  1420.     kXEventPartFieldWidth       = 12,                           /* Rest Events*/
  1421.     kRestEventDurationFieldPos  = 0,
  1422.     kRestEventDurationFieldWidth = 24,
  1423.     kRestEventDurationMax       = ((1L << kRestEventDurationFieldWidth) - 1), /* Note Events*/
  1424.     kNoteEventPitchFieldPos     = 18,
  1425.     kNoteEventPitchFieldWidth   = 6,
  1426.     kNoteEventPitchOffset       = 32,                           /* add to value in pitch field to get actual pitch */
  1427.     kNoteEventVolumeFieldPos    = 11,
  1428.     kNoteEventVolumeFieldWidth  = 7,
  1429.     kNoteEventVolumeOffset      = 0,                            /* add to value in volume field to get actual volume */
  1430.     kNoteEventDurationFieldPos  = 0,
  1431.     kNoteEventDurationFieldWidth = 11,
  1432.     kNoteEventDurationMax       = ((1L << kNoteEventDurationFieldWidth) - 1),
  1433.     kXNoteEventPitchFieldPos    = 0,                            /* in the 1st long word */
  1434.     kXNoteEventPitchFieldWidth  = 16,
  1435.     kXNoteEventDurationFieldPos = 0,                            /* in the 2nd long word */
  1436.     kXNoteEventDurationFieldWidth = 22,
  1437.     kXNoteEventDurationMax      = ((1L << kXNoteEventDurationFieldWidth) - 1),
  1438.     kXNoteEventVolumeFieldPos   = 22,                           /* in the 2nd long word */
  1439.     kXNoteEventVolumeFieldWidth = 7,                            /* Control Events*/
  1440.     kControlEventControllerFieldPos = 16,
  1441.     kControlEventControllerFieldWidth = 8,
  1442.     kControlEventValueFieldPos  = 0,
  1443.     kControlEventValueFieldWidth = 16,
  1444.     kXControlEventControllerFieldPos = 0,                       /* in the 2nd long word */
  1445.     kXControlEventControllerFieldWidth = 16,
  1446.     kXControlEventValueFieldPos = 0,                            /* in the 1st long word */
  1447.     kXControlEventValueFieldWidth = 16,                         /* Knob Events*/
  1448.     kKnobEventValueHighFieldPos = 0,                            /* 1st long word */
  1449.     kKnobEventValueHighFieldWidth = 16,
  1450.     kKnobEventKnobFieldPos      = 16,                           /* 2nd long word */
  1451.     kKnobEventKnobFieldWidth    = 14,
  1452.     kKnobEventValueLowFieldPos  = 0,                            /* 2nd long word */
  1453.     kKnobEventValueLowFieldWidth = 16,                          /* Marker Events*/
  1454.     kMarkerEventSubtypeFieldPos = 16,
  1455.     kMarkerEventSubtypeFieldWidth = 8,
  1456.     kMarkerEventValueFieldPos   = 0,
  1457.     kMarkerEventValueFieldWidth = 16,                           /* General Events*/
  1458.     kGeneralEventSubtypeFieldPos = 16,                          /* in the last long word */
  1459.     kGeneralEventSubtypeFieldWidth = 14,
  1460.     kGeneralEventLengthFieldPos = 0,                            /* in the 1st & last long words */
  1461.     kGeneralEventLengthFieldWidth = 16
  1462. };
  1463. #if TARGET_RT_LITTLE_ENDIAN
  1464. enum {
  1465.     kEndMarkerValue             = 0x00000060
  1466. };
  1467. #else
  1468. enum {
  1469.     kEndMarkerValue             = 0x60000000
  1470. };
  1471. #endif  /* TARGET_RT_LITTLE_ENDIAN */
  1472. /* macros for extracting various fields from the QuickTime event records*/
  1473. #define qtma_MASK(bitWidth)             ((1L << (bitWidth)) - 1)
  1474. #define qtma_EXT(val, pos, width)       ((EndianU32_BtoN(val) >> (pos)) & qtma_MASK(width))
  1475. #define qtma_EventLengthForward(xP,ulen)        
  1476.     {                                           
  1477.         unsigned long _ext;                         
  1478.         unsigned long *lP = (unsigned long *)(xP);  
  1479.         _ext = qtma_EXT(*lP, kEventLengthFieldPos, kEventLengthFieldWidth); 
  1480.         if (_ext != 3) {                        
  1481.             ulen = (_ext < 2) ? 1 : 2;          
  1482.         } else {                                
  1483.             ulen = (unsigned short)qtma_EXT(*lP, kGeneralEventLengthFieldPos, kGeneralEventLengthFieldWidth); 
  1484.             if (ulen < 2) {                     
  1485.                 ulen = lP[1];                   
  1486.             }                                   
  1487.         }                                       
  1488.     }
  1489. #define qtma_EventLengthBackward(xP,ulen)       
  1490.     {                                           
  1491.         unsigned long _ext;                     
  1492.         unsigned long *lP = (unsigned long *)(xP); 
  1493.         _ext = qtma_EXT(*lP, kEventLengthFieldPos, kEventLengthFieldWidth);     
  1494.         if (_ext != 3) {                        
  1495.             ulen = (_ext < 2) ? 1 : 2;          
  1496.         } else {                                
  1497.             ulen = (unsigned short)qtma_EXT(*lP, kGeneralEventLengthFieldPos, kGeneralEventLengthFieldWidth);       
  1498.             if (ulen < 2) {                     
  1499.                 ulen = lP[-1];                  
  1500.             }                                   
  1501.         }                                       
  1502.     }
  1503. #define qtma_EventType(x)               ((qtma_EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth) > 3) ? qtma_EXT(x, kXEventTypeFieldPos, kXEventTypeFieldWidth) : qtma_EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth))
  1504. #define qtma_RestDuration(x)            (qtma_EXT(x, kRestEventDurationFieldPos, kRestEventDurationFieldWidth))
  1505. #define qtma_Part(x)                    (qtma_EXT(x, kEventPartFieldPos, kEventPartFieldWidth))
  1506. #define qtma_XPart(m, l)                (qtma_EXT(m, kXEventPartFieldPos, kXEventPartFieldWidth))
  1507. #define qtma_NotePitch(x)               (qtma_EXT(x, kNoteEventPitchFieldPos, kNoteEventPitchFieldWidth) + kNoteEventPitchOffset)
  1508. #define qtma_NoteVolume(x)              (qtma_EXT(x, kNoteEventVolumeFieldPos, kNoteEventVolumeFieldWidth) + kNoteEventVolumeOffset)
  1509. #define qtma_NoteDuration(x)            (qtma_EXT(x, kNoteEventDurationFieldPos, kNoteEventDurationFieldWidth))
  1510. #define qtma_NoteVelocity qtma_NoteVolume
  1511. #define qtma_XNotePitch(m, l)           (qtma_EXT(m, kXNoteEventPitchFieldPos, kXNoteEventPitchFieldWidth))
  1512. #define qtma_XNoteVolume(m, l)          (qtma_EXT(l, kXNoteEventVolumeFieldPos, kXNoteEventVolumeFieldWidth))
  1513. #define qtma_XNoteDuration(m, l)        (qtma_EXT(l, kXNoteEventDurationFieldPos, kXNoteEventDurationFieldWidth))
  1514. #define qtma_XNoteVelocity qtma_XNoteVolume
  1515. #define qtma_ControlController(x)       (qtma_EXT(x, kControlEventControllerFieldPos, kControlEventControllerFieldWidth))
  1516. #define qtma_ControlValue(x)            (qtma_EXT(x, kControlEventValueFieldPos, kControlEventValueFieldWidth))
  1517. #define qtma_XControlController(m, l)   (qtma_EXT(l, kXControlEventControllerFieldPos, kXControlEventControllerFieldWidth))
  1518. #define qtma_XControlValue(m, l)        (qtma_EXT(m, kXControlEventValueFieldPos, kXControlEventValueFieldWidth))
  1519. #define qtma_MarkerSubtype(x)           (qtma_EXT(x,kMarkerEventSubtypeFieldPos,kMarkerEventSubtypeFieldWidth))
  1520. #define qtma_MarkerValue(x)             (qtma_EXT(x, kMarkerEventValueFieldPos, kMarkerEventValueFieldWidth))
  1521. #define qtma_KnobValue(m,l)                ((qtma_EXT(m,kKnobEventValueHighFieldPos,kKnobEventValueHighFieldWidth) << 16)  
  1522.                                       | (qtma_EXT(l,kKnobEventValueLowFieldPos,kKnobEventValueLowFieldWidth)))
  1523. #define qtma_KnobKnob(m,l)              (qtma_EXT(l,kKnobEventKnobFieldPos,kKnobEventKnobFieldWidth))
  1524. #define qtma_GeneralSubtype(m,l)        (qtma_EXT(l,kGeneralEventSubtypeFieldPos,kGeneralEventSubtypeFieldWidth))
  1525. #define qtma_GeneralLength(m,l)           (qtma_EXT(m,kGeneralEventLengthFieldPos,kGeneralEventLengthFieldWidth))
  1526. #define qtma_StuffRestEvent(x, duration) ( 
  1527.     x =    (kRestEventType << kEventTypeFieldPos)   
  1528.         |  ((long)(duration) << kRestEventDurationFieldPos),    
  1529.     x = EndianU32_NtoB(x) )
  1530. #define qtma_StuffNoteEvent(x, part, pitch, volume, duration) ( 
  1531.     x =     (kNoteEventType << kEventTypeFieldPos)  
  1532.         |   ((long)(part) << kEventPartFieldPos)    
  1533.         |   (((long)(pitch) - kNoteEventPitchOffset) << kNoteEventPitchFieldPos)    
  1534.         |   (((long)(volume) - kNoteEventVolumeOffset) << kNoteEventVolumeFieldPos) 
  1535.         |   ((long)(duration) << kNoteEventDurationFieldPos), 
  1536.     x = EndianU32_NtoB(x) )
  1537. #define qtma_StuffControlEvent(x, part, control, value) ( 
  1538.     x =     (kControlEventType << kEventTypeFieldPos)           
  1539.         |   ((long)(part) << kEventPartFieldPos)                
  1540.         |   ((long)(control) << kControlEventControllerFieldPos)
  1541.         |   ((long)((value) & qtma_MASK(kControlEventValueFieldWidth)) << kControlEventValueFieldPos), 
  1542.     x = EndianU32_NtoB(x) )
  1543. #define qtma_StuffMarkerEvent(x, markerType, markerValue) ( 
  1544.     x =     (kMarkerEventType << kEventTypeFieldPos)    
  1545.         |   ((long)(markerType) << kMarkerEventSubtypeFieldPos) 
  1546.         |   ((long)(markerValue) << kMarkerEventValueFieldPos), 
  1547.     x = EndianU32_NtoB(x) )
  1548. #define qtma_StuffXNoteEvent(w1, w2, part, pitch, volume, duration) ( 
  1549.     w1 =    (kXNoteEventType << kXEventTypeFieldPos)            
  1550.         |   ((long)(part) << kXEventPartFieldPos)               
  1551.         |   ((long)(pitch) << kXNoteEventPitchFieldPos),        
  1552.     w1 = EndianU32_NtoB(w1),                                    
  1553.     w2 =     (kXEventLengthBits << kEventLengthFieldPos)        
  1554.         |   ((long)(duration) << kXNoteEventDurationFieldPos)   
  1555.         |   ((long)(volume) << kXNoteEventVolumeFieldPos),      
  1556.     w2 = EndianU32_NtoB(w2) )
  1557. #define qtma_StuffXControlEvent(w1, w2, part, control, value) (     
  1558.     w1 =    (kXControlEventType << kXEventTypeFieldPos)             
  1559.         |   ((long)(part) << kXEventPartFieldPos)                   
  1560.         |   ((long)((value) & qtma_MASK(kXControlEventValueFieldWidth)) << kXControlEventValueFieldPos), 
  1561.     w1 = EndianU32_NtoB(w1),                                        
  1562.     w2 =    (kXEventLengthBits << kEventLengthFieldPos)             
  1563.         |   ((long)(control) << kXControlEventControllerFieldPos),  
  1564.     w2 = EndianU32_NtoB(w2) )
  1565. #define qtma_StuffKnobEvent(w1, w2, part, knob, value) ( 
  1566.     w1 =    (kKnobEventType << kXEventTypeFieldPos)                 
  1567.         |   ((long)(part) << kXEventPartFieldPos)                   
  1568.         |   ((long)(value >> 16) << kKnobEventValueLowFieldPos),    
  1569.     w1 = EndianU32_NtoB(w1),                                        
  1570.     w2 =    (kXEventLengthBits << kEventLengthFieldPos)             
  1571.         |   ((long)(knob) << kKnobEventKnobFieldPos)                
  1572.         |   ((long)(value & 0xFFFF) << kKnobEventValueLowFieldPos), 
  1573.     w2 = EndianU32_NtoB(w2) )
  1574. #define qtma_StuffGeneralEvent(w1,w2,part,subType,length) ( 
  1575.     w1 =    (kGeneralEventType << kXEventTypeFieldPos)              
  1576.         |   ((long)(part) << kXEventPartFieldPos)                   
  1577.         |   ((long)(length) << kGeneralEventLengthFieldPos),        
  1578.     w1 = EndianU32_NtoB(w1),                                        
  1579.     w2 = (kGeneralEventLengthBits << kEventLengthFieldPos)          
  1580.         |   ((long)(subType) << kGeneralEventSubtypeFieldPos)       
  1581.         |   ((long)(length) << kGeneralEventLengthFieldPos),        
  1582.     w2 = EndianU32_NtoB(w2) )
  1583. #define qtma_NeedXGeneralEvent(length)   (((unsigned long)(length)) > (unsigned long)0xffff)
  1584. /* General Event Defined Types*/
  1585. enum {
  1586.     kGeneralEventNoteRequest    = 1,                            /* Encapsulates NoteRequest data structure */
  1587.     kGeneralEventPartKey        = 4,
  1588.     kGeneralEventTuneDifference = 5,                            /* Contains a standard sequence, with end marker, for the tune difference of a sequence piece (halts QuickTime 2.0 Music) */
  1589.     kGeneralEventAtomicInstrument = 6,                          /* Encapsulates AtomicInstrument record */
  1590.     kGeneralEventKnob           = 7,                            /* knobID/knobValue pairs; smallest event is 4 longs */
  1591.     kGeneralEventMIDIChannel    = 8,                            /* used in tune header, one longword identifies the midi channel it originally came from */
  1592.     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)*/
  1593.     kGeneralEventNoOp           = 10,                           /* guaranteed to do nothing and be ignored. (halts QuickTime 2.0 Music) */
  1594.     kGeneralEventUsedNotes      = 11,                           /* four longwords specifying which midi notes are actually used, 0..127 msb to lsb */
  1595.     kGeneralEventPartMix        = 12                            /* three longwords: Fixed volume, long balance, long flags */
  1596. };
  1597. /* Marker Event Defined Types       // marker is 60 ee vv vv in hex, where e = event type, and v = value*/
  1598. enum {
  1599.     kMarkerEventEnd             = 0,                            /* marker type 0 means: value 0 - stop, value != 0 - ignore*/
  1600.     kMarkerEventBeat            = 1,                            /* value 0 = single beat; anything else is 65536ths-of-a-beat (quarter note)*/
  1601.     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*/
  1602. };
  1603. enum {
  1604.     kCurrentlyNativeEndian      = 1,
  1605.     kCurrentlyNotNativeEndian   = 2
  1606. };
  1607. /* UPP call backs */
  1608. #if OPAQUE_UPP_TYPES
  1609.     EXTERN_API(MusicMIDISendUPP)
  1610.     NewMusicMIDISendUPP            (MusicMIDISendProcPtr    userRoutine);
  1611.     EXTERN_API(MusicMIDIReadHookUPP)
  1612.     NewMusicMIDIReadHookUPP        (MusicMIDIReadHookProcPtr userRoutine);
  1613.     EXTERN_API(MusicOfflineDataUPP)
  1614.     NewMusicOfflineDataUPP         (MusicOfflineDataProcPtr userRoutine);
  1615.     EXTERN_API(TuneCallBackUPP)
  1616.     NewTuneCallBackUPP             (TuneCallBackProcPtr     userRoutine);
  1617.     EXTERN_API(TunePlayCallBackUPP)
  1618.     NewTunePlayCallBackUPP         (TunePlayCallBackProcPtr userRoutine);
  1619.     EXTERN_API(void)
  1620.     DisposeMusicMIDISendUPP        (MusicMIDISendUPP        userUPP);
  1621.     EXTERN_API(void)
  1622.     DisposeMusicMIDIReadHookUPP    (MusicMIDIReadHookUPP    userUPP);
  1623.     EXTERN_API(void)
  1624.     DisposeMusicOfflineDataUPP     (MusicOfflineDataUPP     userUPP);
  1625.     EXTERN_API(void)
  1626.     DisposeTuneCallBackUPP         (TuneCallBackUPP         userUPP);
  1627.     EXTERN_API(void)
  1628.     DisposeTunePlayCallBackUPP     (TunePlayCallBackUPP     userUPP);
  1629.     EXTERN_API(ComponentResult)
  1630.     InvokeMusicMIDISendUPP         (ComponentInstance       self,
  1631.                                     long                    refCon,
  1632.                                     MusicMIDIPacket *       mmp,
  1633.                                     MusicMIDISendUPP        userUPP);
  1634.     EXTERN_API(ComponentResult)
  1635.     InvokeMusicMIDIReadHookUPP     (MusicMIDIPacket *       mp,
  1636.                                     long                    myRefCon,
  1637.                                     MusicMIDIReadHookUPP    userUPP);
  1638.     EXTERN_API(ComponentResult)
  1639.     InvokeMusicOfflineDataUPP      (Ptr                     SoundData,
  1640.                                     long                    numBytes,
  1641.                                     long                    myRefCon,
  1642.                                     MusicOfflineDataUPP     userUPP);
  1643.     EXTERN_API(void)
  1644.     InvokeTuneCallBackUPP          (const TuneStatus *      status,
  1645.                                     long                    refCon,
  1646.                                     TuneCallBackUPP         userUPP);
  1647.     EXTERN_API(void)
  1648.     InvokeTunePlayCallBackUPP      (unsigned long *         event,
  1649.                                     long                    seed,
  1650.                                     long                    refCon,
  1651.                                     TunePlayCallBackUPP     userUPP);
  1652. #else
  1653.     enum { uppMusicMIDISendProcInfo = 0x00000FF0 };                 /* pascal 4_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  1654.     enum { uppMusicMIDIReadHookProcInfo = 0x000003F0 };             /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  1655.     enum { uppMusicOfflineDataProcInfo = 0x00000FF0 };              /* pascal 4_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  1656.     enum { uppTuneCallBackProcInfo = 0x000003C0 };                  /* pascal no_return_value Func(4_bytes, 4_bytes) */
  1657.     enum { uppTunePlayCallBackProcInfo = 0x00000FC0 };              /* pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes) */
  1658.     #define NewMusicMIDISendUPP(userRoutine)                        (MusicMIDISendUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicMIDISendProcInfo, GetCurrentArchitecture())
  1659.     #define NewMusicMIDIReadHookUPP(userRoutine)                    (MusicMIDIReadHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicMIDIReadHookProcInfo, GetCurrentArchitecture())
  1660.     #define NewMusicOfflineDataUPP(userRoutine)                     (MusicOfflineDataUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicOfflineDataProcInfo, GetCurrentArchitecture())
  1661.     #define NewTuneCallBackUPP(userRoutine)                         (TuneCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTuneCallBackProcInfo, GetCurrentArchitecture())
  1662.     #define NewTunePlayCallBackUPP(userRoutine)                     (TunePlayCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTunePlayCallBackProcInfo, GetCurrentArchitecture())
  1663.     #define DisposeMusicMIDISendUPP(userUPP)                        DisposeRoutineDescriptor(userUPP)
  1664.     #define DisposeMusicMIDIReadHookUPP(userUPP)                    DisposeRoutineDescriptor(userUPP)
  1665.     #define DisposeMusicOfflineDataUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  1666.     #define DisposeTuneCallBackUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  1667.     #define DisposeTunePlayCallBackUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  1668.     #define InvokeMusicMIDISendUPP(self, refCon, mmp, userUPP)      (ComponentResult)CALL_THREE_PARAMETER_UPP((userUPP), uppMusicMIDISendProcInfo, (self), (refCon), (mmp))
  1669.     #define InvokeMusicMIDIReadHookUPP(mp, myRefCon, userUPP)       (ComponentResult)CALL_TWO_PARAMETER_UPP((userUPP), uppMusicMIDIReadHookProcInfo, (mp), (myRefCon))
  1670.     #define InvokeMusicOfflineDataUPP(SoundData, numBytes, myRefCon, userUPP)  (ComponentResult)CALL_THREE_PARAMETER_UPP((userUPP), uppMusicOfflineDataProcInfo, (SoundData), (numBytes), (myRefCon))
  1671.     #define InvokeTuneCallBackUPP(status, refCon, userUPP)          CALL_TWO_PARAMETER_UPP((userUPP), uppTuneCallBackProcInfo, (status), (refCon))
  1672.     #define InvokeTunePlayCallBackUPP(event, seed, refCon, userUPP)  CALL_THREE_PARAMETER_UPP((userUPP), uppTunePlayCallBackProcInfo, (event), (seed), (refCon))
  1673. #endif
  1674. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  1675. #define NewMusicMIDISendProc(userRoutine)                       NewMusicMIDISendUPP(userRoutine)
  1676. #define NewMusicMIDIReadHookProc(userRoutine)                   NewMusicMIDIReadHookUPP(userRoutine)
  1677. #define NewMusicOfflineDataProc(userRoutine)                    NewMusicOfflineDataUPP(userRoutine)
  1678. #define NewTuneCallBackProc(userRoutine)                        NewTuneCallBackUPP(userRoutine)
  1679. #define NewTunePlayCallBackProc(userRoutine)                    NewTunePlayCallBackUPP(userRoutine)
  1680. #define CallMusicMIDISendProc(userRoutine, self, refCon, mmp)   InvokeMusicMIDISendUPP(self, refCon, mmp, userRoutine)
  1681. #define CallMusicMIDIReadHookProc(userRoutine, mp, myRefCon)    InvokeMusicMIDIReadHookUPP(mp, myRefCon, userRoutine)
  1682. #define CallMusicOfflineDataProc(userRoutine, SoundData, numBytes, myRefCon) InvokeMusicOfflineDataUPP(SoundData, numBytes, myRefCon, userRoutine)
  1683. #define CallTuneCallBackProc(userRoutine, status, refCon)       InvokeTuneCallBackUPP(status, refCon, userRoutine)
  1684. #define CallTunePlayCallBackProc(userRoutine, event, seed, refCon) InvokeTunePlayCallBackUPP(event, seed, refCon, userRoutine)
  1685. /* selectors for component calls */
  1686. enum {
  1687.     kQTMIDIGetMIDIPortsSelect                  = 0x0001,
  1688.     kQTMIDIUseSendPortSelect                   = 0x0002,
  1689.     kQTMIDISendMIDISelect                      = 0x0003,
  1690.     kQTMIDIUseReceivePortSelect                = 0x0004,
  1691.     kMusicGetDescriptionSelect                 = 0x0001,
  1692.     kMusicGetPartSelect                        = 0x0002,
  1693.     kMusicSetPartSelect                        = 0x0003,
  1694.     kMusicSetPartInstrumentNumberSelect        = 0x0004,
  1695.     kMusicGetPartInstrumentNumberSelect        = 0x0005,
  1696.     kMusicStorePartInstrumentSelect            = 0x0006,
  1697.     kMusicGetPartAtomicInstrumentSelect        = 0x0009,
  1698.     kMusicSetPartAtomicInstrumentSelect        = 0x000A,
  1699.     kMusicGetInstrumentKnobDescriptionObsoleteSelect = 0x000D,
  1700.     kMusicGetDrumKnobDescriptionObsoleteSelect = 0x000E,
  1701.     kMusicGetKnobDescriptionObsoleteSelect     = 0x000F,
  1702.     kMusicGetPartKnobSelect                    = 0x0010,
  1703.     kMusicSetPartKnobSelect                    = 0x0011,
  1704.     kMusicGetKnobSelect                        = 0x0012,
  1705.     kMusicSetKnobSelect                        = 0x0013,
  1706.     kMusicGetPartNameSelect                    = 0x0014,
  1707.     kMusicSetPartNameSelect                    = 0x0015,
  1708.     kMusicFindToneSelect                       = 0x0016,
  1709.     kMusicPlayNoteSelect                       = 0x0017,
  1710.     kMusicResetPartSelect                      = 0x0018,
  1711.     kMusicSetPartControllerSelect              = 0x0019,
  1712.     kMusicGetPartControllerSelect              = 0x001A,
  1713.     kMusicGetMIDIProcSelect                    = 0x001B,
  1714.     kMusicSetMIDIProcSelect                    = 0x001C,
  1715.     kMusicGetInstrumentNamesSelect             = 0x001D,
  1716.     kMusicGetDrumNamesSelect                   = 0x001E,
  1717.     kMusicGetMasterTuneSelect                  = 0x001F,
  1718.     kMusicSetMasterTuneSelect                  = 0x0020,
  1719.     kMusicGetInstrumentAboutInfoSelect         = 0x0022,
  1720.     kMusicGetDeviceConnectionSelect            = 0x0023,
  1721.     kMusicUseDeviceConnectionSelect            = 0x0024,
  1722.     kMusicGetKnobSettingStringsSelect          = 0x0025,
  1723.     kMusicGetMIDIPortsSelect                   = 0x0026,
  1724.     kMusicSendMIDISelect                       = 0x0027,
  1725.     kMusicReceiveMIDISelect                    = 0x0028,
  1726.     kMusicStartOfflineSelect                   = 0x0029,
  1727.     kMusicSetOfflineTimeToSelect               = 0x002A,
  1728.     kMusicGetInstrumentKnobDescriptionSelect   = 0x002B,
  1729.     kMusicGetDrumKnobDescriptionSelect         = 0x002C,
  1730.     kMusicGetKnobDescriptionSelect             = 0x002D,
  1731.     kMusicGetInfoTextSelect                    = 0x002E,
  1732.     kMusicGetInstrumentInfoSelect              = 0x002F,
  1733.     kMusicTaskSelect                           = 0x0031,
  1734.     kMusicSetPartInstrumentNumberInterruptSafeSelect = 0x0032,
  1735.     kMusicSetPartSoundLocalizationSelect       = 0x0033,
  1736.     kMusicGenericConfigureSelect               = 0x0100,
  1737.     kMusicGenericGetPartSelect                 = 0x0101,
  1738.     kMusicGenericGetKnobListSelect             = 0x0102,
  1739.     kMusicGenericSetResourceNumbersSelect      = 0x0103,
  1740.     kMusicDerivedMIDISendSelect                = 0x0200,
  1741.     kMusicDerivedSetKnobSelect                 = 0x0201,
  1742.     kMusicDerivedSetPartSelect                 = 0x0202,
  1743.     kMusicDerivedSetInstrumentSelect           = 0x0203,
  1744.     kMusicDerivedSetPartInstrumentNumberSelect = 0x0204,
  1745.     kMusicDerivedSetMIDISelect                 = 0x0205,
  1746.     kMusicDerivedStorePartInstrumentSelect     = 0x0206,
  1747.     kMusicDerivedOpenResFileSelect             = 0x0207,
  1748.     kMusicDerivedCloseResFileSelect            = 0x0208,
  1749.     kInstrumentGetInstSelect                   = 0x0001,
  1750.     kInstrumentGetInfoSelect                   = 0x0002,
  1751.     kInstrumentInitializeSelect                = 0x0003,
  1752.     kInstrumentOpenComponentResFileSelect      = 0x0004,
  1753.     kInstrumentCloseComponentResFileSelect     = 0x0005,
  1754.     kInstrumentGetComponentRefConSelect        = 0x0006,
  1755.     kInstrumentSetComponentRefConSelect        = 0x0007,
  1756.     kInstrumentGetSynthesizerTypeSelect        = 0x0008,
  1757.     kNARegisterMusicDeviceSelect               = 0x0000,
  1758.     kNAUnregisterMusicDeviceSelect             = 0x0001,
  1759.     kNAGetRegisteredMusicDeviceSelect          = 0x0002,
  1760.     kNASaveMusicConfigurationSelect            = 0x0003,
  1761.     kNANewNoteChannelSelect                    = 0x0004,
  1762.     kNADisposeNoteChannelSelect                = 0x0005,
  1763.     kNAGetNoteChannelInfoSelect                = 0x0006,
  1764.     kNAPrerollNoteChannelSelect                = 0x0007,
  1765.     kNAUnrollNoteChannelSelect                 = 0x0008,
  1766.     kNASetNoteChannelVolumeSelect              = 0x000B,
  1767.     kNAResetNoteChannelSelect                  = 0x000C,
  1768.     kNAPlayNoteSelect                          = 0x000D,
  1769.     kNASetControllerSelect                     = 0x000E,
  1770.     kNASetKnobSelect                           = 0x000F,
  1771.     kNAFindNoteChannelToneSelect               = 0x0010,
  1772.     kNASetInstrumentNumberSelect               = 0x0011,
  1773.     kNAPickInstrumentSelect                    = 0x0012,
  1774.     kNAPickArrangementSelect                   = 0x0013,
  1775.     kNASetDefaultMIDIInputSelect               = 0x0015,
  1776.     kNAGetDefaultMIDIInputSelect               = 0x0016,
  1777.     kNAUseDefaultMIDIInputSelect               = 0x0019,
  1778.     kNALoseDefaultMIDIInputSelect              = 0x001A,
  1779.     kNAStuffToneDescriptionSelect              = 0x001B,
  1780.     kNACopyrightDialogSelect                   = 0x001C,
  1781.     kNAGetIndNoteChannelSelect                 = 0x001F,
  1782.     kNAGetMIDIPortsSelect                      = 0x0021,
  1783.     kNAGetNoteRequestSelect                    = 0x0022,
  1784.     kNASendMIDISelect                          = 0x0023,
  1785.     kNAPickEditInstrumentSelect                = 0x0024,
  1786.     kNANewNoteChannelFromAtomicInstrumentSelect = 0x0025,
  1787.     kNASetAtomicInstrumentSelect               = 0x0026,
  1788.     kNAGetKnobSelect                           = 0x0028,
  1789.     kNATaskSelect                              = 0x0029,
  1790.     kNASetNoteChannelBalanceSelect             = 0x002A,
  1791.     kNASetInstrumentNumberInterruptSafeSelect  = 0x002B,
  1792.     kNASetNoteChannelSoundLocalizationSelect   = 0x002C,
  1793.     kNAGetControllerSelect                     = 0x002D,
  1794.     kTuneSetHeaderSelect                       = 0x0004,
  1795.     kTuneGetTimeBaseSelect                     = 0x0005,
  1796.     kTuneSetTimeScaleSelect                    = 0x0006,
  1797.     kTuneGetTimeScaleSelect                    = 0x0007,
  1798.     kTuneGetIndexedNoteChannelSelect           = 0x0008,
  1799.     kTuneQueueSelect                           = 0x000A,
  1800.     kTuneInstantSelect                         = 0x000B,
  1801.     kTuneGetStatusSelect                       = 0x000C,
  1802.     kTuneStopSelect                            = 0x000D,
  1803.     kTuneSetVolumeSelect                       = 0x0010,
  1804.     kTuneGetVolumeSelect                       = 0x0011,
  1805.     kTunePrerollSelect                         = 0x0012,
  1806.     kTuneUnrollSelect                          = 0x0013,
  1807.     kTuneSetNoteChannelsSelect                 = 0x0014,
  1808.     kTuneSetPartTransposeSelect                = 0x0015,
  1809.     kTuneGetNoteAllocatorSelect                = 0x0017,
  1810.     kTuneSetSofterSelect                       = 0x0018,
  1811.     kTuneTaskSelect                            = 0x0019,
  1812.     kTuneSetBalanceSelect                      = 0x001A,
  1813.     kTuneSetSoundLocalizationSelect            = 0x001B,
  1814.     kTuneSetHeaderWithSizeSelect               = 0x001C,
  1815.     kTuneSetPartMixSelect                      = 0x001D,
  1816.     kTuneGetPartMixSelect                      = 0x001E
  1817. };
  1818. #if PRAGMA_STRUCT_ALIGN
  1819.     #pragma options align=reset
  1820. #elif PRAGMA_STRUCT_PACKPUSH
  1821.     #pragma pack(pop)
  1822. #elif PRAGMA_STRUCT_PACK
  1823.     #pragma pack()
  1824. #endif
  1825. #ifdef PRAGMA_IMPORT_OFF
  1826. #pragma import off
  1827. #elif PRAGMA_IMPORT
  1828. #pragma import reset
  1829. #endif
  1830. #ifdef __cplusplus
  1831. }
  1832. #endif
  1833. #endif /* __QUICKTIMEMUSIC__ */