home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Beta / Quicktime 2.0 Beta.iso / Programming Stuff / Interfaces / QuickTime Interfaces / QuickTimeComponents.h < prev   
Encoding:
C/C++ Source or Header  |  1994-05-02  |  128.7 KB  |  3,385 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        QuickTimeComponents.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __QUICKTIMECOMPONENTS__
  13. #define __QUICKTIMECOMPONENTS__
  14.  
  15. #ifndef __COMPONENTS__
  16. #include <Components.h>
  17. /*    #include <Types.h>                                            */
  18. /*        #include <ConditionalMacros.h>                            */
  19. /*        #include <MixedMode.h>                                    */
  20. /*            #include <Traps.h>                                    */
  21. #endif
  22.  
  23. #ifndef __IMAGECOMPRESSION__
  24. #include <ImageCompression.h>
  25. /*    #include <Quickdraw.h>                                        */
  26. /*        #include <QuickdrawText.h>                                */
  27. /*            #include <IntlResources.h>                            */
  28. /*    #include <QDOffscreen.h>                                    */
  29. /*    #include <StandardFile.h>                                    */
  30. /*        #include <Dialogs.h>                                    */
  31. /*            #include <Windows.h>                                */
  32. /*                #include <Events.h>                                */
  33. /*                    #include <OSUtils.h>                        */
  34. /*                #include <Controls.h>                            */
  35. /*                    #include <Menus.h>                            */
  36. /*            #include <TextEdit.h>                                */
  37. /*        #include <Files.h>                                        */
  38. /*            #include <SegLoad.h>                                */
  39. /*    #include <ToolUtils.h>                                        */
  40. /*        #include <TextUtils.h>                                    */
  41. /*            #include <Script.h>                                    */
  42. /*        #include <FixMath.h>                                    */
  43. #endif
  44.  
  45. #ifndef __MOVIES__
  46. #include <Movies.h>
  47. /*    #include <Aliases.h>                                        */
  48. /*        #include <AppleTalk.h>                                    */
  49. #endif
  50.  
  51. #ifndef __QUICKDRAW__
  52. #endif
  53.  
  54. #ifndef __VIDEO__
  55. #include <Video.h>
  56. #endif
  57.  
  58. #ifndef __MIDI__
  59. #include <MIDI.h>
  60. #endif
  61.  
  62. #ifndef __Dialogs__
  63. #endif
  64.  
  65. #define clockComponentType 'clok'
  66.  
  67. #define systemTickClock 'tick'
  68.  
  69. #define systemSecondClock 'seco'
  70.  
  71. #define systemMillisecondClock 'mill'
  72.  
  73. #define systemMicrosecondClock 'micr'
  74.  
  75. enum  {
  76.     kClockRateIsLinear            = 1,
  77.     kClockImplementsCallBacks    = 2
  78. };
  79.  
  80. #define ClockGetTime GetClockTime
  81.  
  82. #ifdef __cplusplus
  83. extern "C" {
  84. #endif
  85.  
  86. extern pascal ComponentResult GetClockTime(ComponentInstance aClock, TimeRecord *out)
  87.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1, 0x7000, 0xA82A);
  88. extern pascal QTCallBack ClockNewCallBack(ComponentInstance aClock, TimeBase tb, short callBackType)
  89.  FIVEWORDINLINE(0x2F3C, 0x6, 0x2, 0x7000, 0xA82A);
  90. extern pascal ComponentResult ClockDisposeCallBack(ComponentInstance aClock, QTCallBack cb)
  91.  FIVEWORDINLINE(0x2F3C, 0x4, 0x3, 0x7000, 0xA82A);
  92. extern pascal ComponentResult ClockCallMeWhen(ComponentInstance aClock, QTCallBack cb, long param1, long param2, long param3)
  93.  FIVEWORDINLINE(0x2F3C, 0x10, 0x4, 0x7000, 0xA82A);
  94. extern pascal ComponentResult ClockCancelCallBack(ComponentInstance aClock, QTCallBack cb)
  95.  FIVEWORDINLINE(0x2F3C, 0x4, 0x5, 0x7000, 0xA82A);
  96. extern pascal ComponentResult ClockRateChanged(ComponentInstance aClock, QTCallBack cb)
  97.  FIVEWORDINLINE(0x2F3C, 0x4, 0x6, 0x7000, 0xA82A);
  98. extern pascal ComponentResult ClockTimeChanged(ComponentInstance aClock, QTCallBack cb)
  99.  FIVEWORDINLINE(0x2F3C, 0x4, 0x7, 0x7000, 0xA82A);
  100. extern pascal ComponentResult ClockSetTimeBase(ComponentInstance aClock, TimeBase tb)
  101.  FIVEWORDINLINE(0x2F3C, 0x4, 0x8, 0x7000, 0xA82A);
  102. extern pascal ComponentResult ClockStartStopChanged(ComponentInstance aClock, QTCallBack cb, Boolean startChanged, Boolean stopChanged)
  103.  FIVEWORDINLINE(0x2F3C, 0x8, 0x9, 0x7000, 0xA82A);
  104. extern pascal ComponentResult ClockGetRate(ComponentInstance aClock, Fixed *rate)
  105.  FIVEWORDINLINE(0x2F3C, 0x4, 0xA, 0x7000, 0xA82A);
  106. #ifdef __cplusplus
  107. }
  108. #endif
  109.  
  110. enum  {
  111.     kClockGetTimeSelect            = 0x1,
  112.     kClockNewCallBackSelect        = 0x2,
  113.     kClockDisposeCallBackSelect    = 0x3,
  114.     kClockCallMeWhenSelect        = 0x4,
  115.     kClockCancelCallBackSelect    = 0x5,
  116.     kClockRateChangedSelect        = 0x6,
  117.     kClockTimeChangedSelect        = 0x7,
  118.     kClockSetTimeBaseSelect        = 0x8,
  119.     kClockStartStopChangedSelect = 0x9,
  120.     kClockGetRateSelect            = 0xA
  121. };
  122.  
  123. typedef ComponentInstance SeqGrabComponent;
  124.  
  125. typedef ComponentInstance SGChannel;
  126.  
  127. #define SeqGrabComponentType 'barg'
  128.  
  129. #define SeqGrabChannelType 'sgch'
  130.  
  131. #define SeqGrabPanelType 'sgpn'
  132.  
  133. #define SeqGrabCompressionPanelType 'comp'
  134.  
  135. #define SeqGrabSourcePanelType 'sour'
  136.  
  137. enum  {
  138.     seqGrabToDisk                = 1,
  139.     seqGrabToMemory                = 2,
  140.     seqGrabDontUseTempMemory    = 4,
  141.     seqGrabAppendToFile            = 8,
  142.     seqGrabDontAddMovieResource    = 16,
  143.     seqGrabDontMakeMovie        = 32,
  144.     seqGrabPreExtendFile        = 64,
  145.     seqGrabDataProcIsInterruptSafe = 128
  146. };
  147.  
  148. typedef unsigned long SeqGrabDataOutputEnum;
  149.  
  150. enum  {
  151.     seqGrabRecord                = 1,
  152.     seqGrabPreview                = 2,
  153.     seqGrabPlayDuringRecord        = 4
  154. };
  155.  
  156. typedef unsigned long SeqGrabUsageEnum;
  157.  
  158. enum  {
  159.     seqGrabHasBounds            = 1,
  160.     seqGrabHasVolume            = 2,
  161.     seqGrabHasDiscreteSamples    = 4
  162. };
  163.  
  164. typedef unsigned long SeqGrabChannelInfoEnum;
  165.  
  166. #if defined(powerc) || defined (__powerc)
  167. #pragma options align=mac68k
  168. #endif
  169. struct seqGrabFrameInfo {
  170.     long                        frameOffset;
  171.     long                        frameTime;
  172.     long                        frameSize;
  173.     SGChannel                    frameChannel;
  174.     long                        frameRefCon;
  175. };
  176. #if defined(powerc) || defined(__powerc)
  177. #pragma options align=reset
  178. #endif
  179.  
  180. typedef struct seqGrabFrameInfo seqGrabFrameInfo;
  181.  
  182. enum  {
  183.     grabPictOffScreen            = 1,
  184.     grabPictIgnoreClip            = 2,
  185.     grabPictCurrentImage        = 4
  186. };
  187.  
  188. #define sgFlagControlledGrab (1)
  189.  
  190. typedef pascal OSErr (*SGDataProcPtr)(SGChannel c, Ptr p, long len, long *offset, long chRefCon, TimeValue time, short writeType, long refCon);
  191.  
  192. enum {
  193.     uppSGDataProcInfo = kPascalStackBased
  194.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  195.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  196.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Ptr)))
  197.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  198.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long*)))
  199.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long)))
  200.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(TimeValue)))
  201.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(short)))
  202.          | STACK_ROUTINE_PARAMETER(8, SIZE_CODE(sizeof(long)))
  203. };
  204.  
  205. #if USESROUTINEDESCRIPTORS
  206. typedef UniversalProcPtr SGDataUPP;
  207.  
  208. #define CallSGDataProc(userRoutine, c, p, len, offset, chRefCon, time, writeType, refCon)        \
  209.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGDataProcInfo, (c), (p), (len), (offset), (chRefCon), (time), (writeType), (refCon))
  210. #define NewSGDataProc(userRoutine)        \
  211.         (SGDataUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGDataProcInfo, GetCurrentISA())
  212. #else
  213. typedef SGDataProcPtr SGDataUPP;
  214.  
  215. #define CallSGDataProc(userRoutine, c, p, len, offset, chRefCon, time, writeType, refCon)        \
  216.         (*(userRoutine))((c), (p), (len), (offset), (chRefCon), (time), (writeType), (refCon))
  217. #define NewSGDataProc(userRoutine)        \
  218.         (SGDataUPP)(userRoutine)
  219. #endif
  220.  
  221. #if defined(powerc) || defined (__powerc)
  222. #pragma options align=mac68k
  223. #endif
  224. struct SGDeviceName {
  225.     Str63                        name;
  226.     Handle                        icon;
  227.     long                        flags;
  228.     long                        refCon;
  229.     long                        reserved;
  230. };
  231. #if defined(powerc) || defined(__powerc)
  232. #pragma options align=reset
  233. #endif
  234.  
  235. typedef struct SGDeviceName SGDeviceName;
  236.  
  237. #define sgDeviceNameFlagDeviceUnavailable (1)
  238.  
  239. #if defined(powerc) || defined (__powerc)
  240. #pragma options align=mac68k
  241. #endif
  242. struct SGDeviceListRecord {
  243.     short                        count;
  244.     short                        selectedIndex;
  245.     long                        reserved;
  246.     SGDeviceName                entry[1];
  247. };
  248. #if defined(powerc) || defined(__powerc)
  249. #pragma options align=reset
  250. #endif
  251.  
  252. typedef struct SGDeviceListRecord SGDeviceListRecord;
  253.  
  254. typedef SGDeviceListRecord *SGDeviceListPtr, **SGDeviceList;
  255.  
  256. #define sgDeviceListWithIcons (1)
  257.  
  258. #define sgDeviceListDontCheckAvailability (2)
  259.  
  260. enum  {
  261.     seqGrabWriteAppend,
  262.     seqGrabWriteReserve,
  263.     seqGrabWriteFill
  264. };
  265.  
  266. enum  {
  267.     seqGrabUnpause                = 0,
  268.     seqGrabPause                = 1,
  269.     seqGrabPauseForMenu            = 3
  270. };
  271.  
  272. enum  {
  273.     channelFlagDontOpenResFile    = 2,
  274.     channelFlagHasDependency    = 4
  275. };
  276.  
  277. typedef pascal Boolean (*SGModalFilterProcPtr)(DialogPtr theDialog, EventRecord *theEvent, short *itemHit, long refCon);
  278.  
  279. enum {
  280.     uppSGModalFilterProcInfo = kPascalStackBased
  281.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  282.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DialogPtr)))
  283.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(EventRecord*)))
  284.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short*)))
  285.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  286. };
  287.  
  288. #if USESROUTINEDESCRIPTORS
  289. typedef UniversalProcPtr SGModalFilterUPP;
  290.  
  291. #define CallSGModalFilterProc(userRoutine, theDialog, theEvent, itemHit, refCon)        \
  292.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGModalFilterProcInfo, (theDialog), (theEvent), (itemHit), (refCon))
  293. #define NewSGModalFilterProc(userRoutine)        \
  294.         (SGModalFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGModalFilterProcInfo, GetCurrentISA())
  295. #else
  296. typedef SGModalFilterProcPtr SGModalFilterUPP;
  297.  
  298. #define CallSGModalFilterProc(userRoutine, theDialog, theEvent, itemHit, refCon)        \
  299.         (*(userRoutine))((theDialog), (theEvent), (itemHit), (refCon))
  300. #define NewSGModalFilterProc(userRoutine)        \
  301.         (SGModalFilterUPP)(userRoutine)
  302. #endif
  303.  
  304. enum  {
  305.     sgPanelFlagForPanel            = 1
  306. };
  307.  
  308. #if defined(powerc) || defined (__powerc)
  309. #pragma options align=mac68k
  310. #endif
  311. struct SGOutputRecord {
  312.     long                        data[1];
  313. };
  314. #if defined(powerc) || defined(__powerc)
  315. #pragma options align=reset
  316. #endif
  317.  
  318. typedef struct SGOutputRecord SGOutputRecord;
  319.  
  320. typedef SGOutputRecord *SGOutput;
  321.  
  322. #define channelPlayNormal 0
  323.  
  324. #define channelPlayFast 1
  325.  
  326. #define channelPlayHighQuality 2
  327.  
  328. #define channelPlayAllData 4
  329.  
  330. #ifdef __cplusplus
  331. extern "C" {
  332. #endif
  333.  
  334. extern pascal ComponentResult SGInitialize(SeqGrabComponent s)
  335.  FIVEWORDINLINE(0x2F3C, 0, 0x1, 0x7000, 0xA82A);
  336. extern pascal ComponentResult SGSetDataOutput(SeqGrabComponent s, FSSpec *movieFile, long whereFlags)
  337.  FIVEWORDINLINE(0x2F3C, 0x8, 0x2, 0x7000, 0xA82A);
  338. extern pascal ComponentResult SGGetDataOutput(SeqGrabComponent s, FSSpec *movieFile, long *whereFlags)
  339.  FIVEWORDINLINE(0x2F3C, 0x8, 0x3, 0x7000, 0xA82A);
  340. extern pascal ComponentResult SGSetGWorld(SeqGrabComponent s, CGrafPtr gp, GDHandle gd)
  341.  FIVEWORDINLINE(0x2F3C, 0x8, 0x4, 0x7000, 0xA82A);
  342. extern pascal ComponentResult SGGetGWorld(SeqGrabComponent s, CGrafPtr *gp, GDHandle *gd)
  343.  FIVEWORDINLINE(0x2F3C, 0x8, 0x5, 0x7000, 0xA82A);
  344. extern pascal ComponentResult SGNewChannel(SeqGrabComponent s, OSType channelType, SGChannel *ref)
  345.  FIVEWORDINLINE(0x2F3C, 0x8, 0x6, 0x7000, 0xA82A);
  346. extern pascal ComponentResult SGDisposeChannel(SeqGrabComponent s, SGChannel c)
  347.  FIVEWORDINLINE(0x2F3C, 0x4, 0x7, 0x7000, 0xA82A);
  348. extern pascal ComponentResult SGStartPreview(SeqGrabComponent s)
  349.  FIVEWORDINLINE(0x2F3C, 0, 0x10, 0x7000, 0xA82A);
  350. extern pascal ComponentResult SGStartRecord(SeqGrabComponent s)
  351.  FIVEWORDINLINE(0x2F3C, 0, 0x11, 0x7000, 0xA82A);
  352. extern pascal ComponentResult SGIdle(SeqGrabComponent s)
  353.  FIVEWORDINLINE(0x2F3C, 0, 0x12, 0x7000, 0xA82A);
  354. extern pascal ComponentResult SGStop(SeqGrabComponent s)
  355.  FIVEWORDINLINE(0x2F3C, 0, 0x13, 0x7000, 0xA82A);
  356. extern pascal ComponentResult SGPause(SeqGrabComponent s, Byte pause)
  357.  FIVEWORDINLINE(0x2F3C, 0x2, 0x14, 0x7000, 0xA82A);
  358. extern pascal ComponentResult SGPrepare(SeqGrabComponent s, Boolean prepareForPreview, Boolean prepareForRecord)
  359.  FIVEWORDINLINE(0x2F3C, 0x4, 0x15, 0x7000, 0xA82A);
  360. extern pascal ComponentResult SGRelease(SeqGrabComponent s)
  361.  FIVEWORDINLINE(0x2F3C, 0, 0x16, 0x7000, 0xA82A);
  362. extern pascal Movie SGGetMovie(SeqGrabComponent s)
  363.  FIVEWORDINLINE(0x2F3C, 0, 0x17, 0x7000, 0xA82A);
  364. extern pascal ComponentResult SGSetMaximumRecordTime(SeqGrabComponent s, unsigned long ticks)
  365.  FIVEWORDINLINE(0x2F3C, 0x4, 0x18, 0x7000, 0xA82A);
  366. extern pascal ComponentResult SGGetMaximumRecordTime(SeqGrabComponent s, unsigned long *ticks)
  367.  FIVEWORDINLINE(0x2F3C, 0x4, 0x19, 0x7000, 0xA82A);
  368. extern pascal ComponentResult SGGetStorageSpaceRemaining(SeqGrabComponent s, unsigned long *bytes)
  369.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1A, 0x7000, 0xA82A);
  370. extern pascal ComponentResult SGGetTimeRemaining(SeqGrabComponent s, long *ticksLeft)
  371.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1B, 0x7000, 0xA82A);
  372. extern pascal ComponentResult SGGrabPict(SeqGrabComponent s, PicHandle *p, const Rect *bounds, short offscreenDepth, long grabPictFlags)
  373.  FIVEWORDINLINE(0x2F3C, 0xE, 0x1C, 0x7000, 0xA82A);
  374. extern pascal ComponentResult SGGetLastMovieResID(SeqGrabComponent s, short *resID)
  375.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1D, 0x7000, 0xA82A);
  376. extern pascal ComponentResult SGSetFlags(SeqGrabComponent s, long sgFlags)
  377.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1E, 0x7000, 0xA82A);
  378. extern pascal ComponentResult SGGetFlags(SeqGrabComponent s, long *sgFlags)
  379.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1F, 0x7000, 0xA82A);
  380. extern pascal ComponentResult SGSetDataProc(SeqGrabComponent s, SGDataUPP proc, long refCon)
  381.  FIVEWORDINLINE(0x2F3C, 0x8, 0x20, 0x7000, 0xA82A);
  382. extern pascal ComponentResult SGNewChannelFromComponent(SeqGrabComponent s, SGChannel *newChannel, Component sgChannelComponent)
  383.  FIVEWORDINLINE(0x2F3C, 0x8, 0x21, 0x7000, 0xA82A);
  384. extern pascal ComponentResult SGDisposeDeviceList(SeqGrabComponent s, SGDeviceList list)
  385.  FIVEWORDINLINE(0x2F3C, 0x4, 0x22, 0x7000, 0xA82A);
  386. extern pascal ComponentResult SGAppendDeviceListToMenu(SeqGrabComponent s, SGDeviceList list, MenuHandle mh)
  387.  FIVEWORDINLINE(0x2F3C, 0x8, 0x23, 0x7000, 0xA82A);
  388. extern pascal ComponentResult SGSetSettings(SeqGrabComponent s, UserData ud, long flags)
  389.  FIVEWORDINLINE(0x2F3C, 0x8, 0x24, 0x7000, 0xA82A);
  390. extern pascal ComponentResult SGGetSettings(SeqGrabComponent s, UserData *ud, long flags)
  391.  FIVEWORDINLINE(0x2F3C, 0x8, 0x25, 0x7000, 0xA82A);
  392. extern pascal ComponentResult SGGetIndChannel(SeqGrabComponent s, short index, SGChannel *ref, OSType *chanType)
  393.  FIVEWORDINLINE(0x2F3C, 0xA, 0x26, 0x7000, 0xA82A);
  394. extern pascal ComponentResult SGUpdate(SeqGrabComponent s, RgnHandle updateRgn)
  395.  FIVEWORDINLINE(0x2F3C, 0x4, 0x27, 0x7000, 0xA82A);
  396. extern pascal ComponentResult SGGetPause(SeqGrabComponent s, Byte *paused)
  397.  FIVEWORDINLINE(0x2F3C, 0x4, 0x28, 0x7000, 0xA82A);
  398. extern pascal ComponentResult SGSettingsDialog(SeqGrabComponent s, SGChannel c, short numPanels, Component *panelList, long flags, SGModalFilterUPP proc, long procRefNum)
  399.  FIVEWORDINLINE(0x2F3C, 0x16, 0x29, 0x7000, 0xA82A);
  400. extern pascal ComponentResult SGGetAlignmentProc(SeqGrabComponent s, ICMAlignmentProcRecordPtr alignmentProc)
  401.  FIVEWORDINLINE(0x2F3C, 0x4, 0x2A, 0x7000, 0xA82A);
  402. extern pascal ComponentResult SGSetChannelSettings(SeqGrabComponent s, SGChannel c, UserData ud, long flags)
  403.  FIVEWORDINLINE(0x2F3C, 0xC, 0x2B, 0x7000, 0xA82A);
  404. extern pascal ComponentResult SGGetChannelSettings(SeqGrabComponent s, SGChannel c, UserData *ud, long flags)
  405.  FIVEWORDINLINE(0x2F3C, 0xC, 0x2C, 0x7000, 0xA82A);
  406. extern pascal ComponentResult SGGetMode(SeqGrabComponent s, Boolean *previewMode, Boolean *recordMode)
  407.  FIVEWORDINLINE(0x2F3C, 0x8, 0x2D, 0x7000, 0xA82A);
  408. extern pascal ComponentResult SGSetDataRef(SeqGrabComponent s, Handle dataRef, OSType dataRefType, long whereFlags)
  409.  FIVEWORDINLINE(0x2F3C, 0xC, 0x2E, 0x7000, 0xA82A);
  410. extern pascal ComponentResult SGGetDataRef(SeqGrabComponent s, Handle *dataRef, OSType *dataRefType, long *whereFlags)
  411.  FIVEWORDINLINE(0x2F3C, 0xC, 0x2F, 0x7000, 0xA82A);
  412. extern pascal ComponentResult SGNewOutput(SeqGrabComponent s, Handle dataRef, OSType dataRefType, long whereFlags, SGOutput *output)
  413.  FIVEWORDINLINE(0x2F3C, 0x10, 0x30, 0x7000, 0xA82A);
  414. extern pascal ComponentResult SGDisposeOutput(SeqGrabComponent s, SGOutput output)
  415.  FIVEWORDINLINE(0x2F3C, 0x4, 0x31, 0x7000, 0xA82A);
  416. extern pascal ComponentResult SGSetOutputFlags(SeqGrabComponent s, SGOutput output, long whereFlags)
  417.  FIVEWORDINLINE(0x2F3C, 0x8, 0x32, 0x7000, 0xA82A);
  418. extern pascal ComponentResult SGSetChannelOutput(SeqGrabComponent s, SGChannel c, SGOutput output)
  419.  FIVEWORDINLINE(0x2F3C, 0x8, 0x33, 0x7000, 0xA82A);
  420. extern pascal ComponentResult SGGetDataOutputStorageSpaceRemaining(SeqGrabComponent s, SGOutput output, unsigned long *space)
  421.  FIVEWORDINLINE(0x2F3C, 0x8, 0x34, 0x7000, 0xA82A);
  422. extern pascal ComponentResult SGWriteMovieData(SeqGrabComponent s, SGChannel c, Ptr p, long len, long *offset)
  423.  FIVEWORDINLINE(0x2F3C, 0x10, 0x100, 0x7000, 0xA82A);
  424. extern pascal ComponentResult SGAddFrameReference(SeqGrabComponent s, seqGrabFrameInfo *frameInfo)
  425.  FIVEWORDINLINE(0x2F3C, 0x4, 0x101, 0x7000, 0xA82A);
  426. extern pascal ComponentResult SGGetNextFrameReference(SeqGrabComponent s, seqGrabFrameInfo *frameInfo, TimeValue *frameDuration, long *frameNumber)
  427.  FIVEWORDINLINE(0x2F3C, 0xC, 0x102, 0x7000, 0xA82A);
  428. extern pascal ComponentResult SGGetTimeBase(SeqGrabComponent s, TimeBase *tb)
  429.  FIVEWORDINLINE(0x2F3C, 0x4, 0x103, 0x7000, 0xA82A);
  430. extern pascal ComponentResult SGSortDeviceList(SeqGrabComponent s, SGDeviceList list)
  431.  FIVEWORDINLINE(0x2F3C, 0x4, 0x104, 0x7000, 0xA82A);
  432. extern pascal ComponentResult SGAddMovieData(SeqGrabComponent s, SGChannel c, Ptr p, long len, long *offset, long chRefCon, TimeValue time, short writeType)
  433.  FIVEWORDINLINE(0x2F3C, 0x1A, 0x105, 0x7000, 0xA82A);
  434. extern pascal ComponentResult SGChangedSource(SeqGrabComponent s, SGChannel c)
  435.  FIVEWORDINLINE(0x2F3C, 0x4, 0x106, 0x7000, 0xA82A);
  436. extern pascal ComponentResult SGSetChannelUsage(SGChannel c, long usage)
  437.  FIVEWORDINLINE(0x2F3C, 0x4, 0x80, 0x7000, 0xA82A);
  438. extern pascal ComponentResult SGGetChannelUsage(SGChannel c, long *usage)
  439.  FIVEWORDINLINE(0x2F3C, 0x4, 0x81, 0x7000, 0xA82A);
  440. extern pascal ComponentResult SGSetChannelBounds(SGChannel c, const Rect *bounds)
  441.  FIVEWORDINLINE(0x2F3C, 0x4, 0x82, 0x7000, 0xA82A);
  442. extern pascal ComponentResult SGGetChannelBounds(SGChannel c, Rect *bounds)
  443.  FIVEWORDINLINE(0x2F3C, 0x4, 0x83, 0x7000, 0xA82A);
  444. extern pascal ComponentResult SGSetChannelVolume(SGChannel c, short volume)
  445.  FIVEWORDINLINE(0x2F3C, 0x2, 0x84, 0x7000, 0xA82A);
  446. extern pascal ComponentResult SGGetChannelVolume(SGChannel c, short *volume)
  447.  FIVEWORDINLINE(0x2F3C, 0x4, 0x85, 0x7000, 0xA82A);
  448. extern pascal ComponentResult SGGetChannelInfo(SGChannel c, long *channelInfo)
  449.  FIVEWORDINLINE(0x2F3C, 0x4, 0x86, 0x7000, 0xA82A);
  450. extern pascal ComponentResult SGSetChannelPlayFlags(SGChannel c, long playFlags)
  451.  FIVEWORDINLINE(0x2F3C, 0x4, 0x87, 0x7000, 0xA82A);
  452. extern pascal ComponentResult SGGetChannelPlayFlags(SGChannel c, long *playFlags)
  453.  FIVEWORDINLINE(0x2F3C, 0x4, 0x88, 0x7000, 0xA82A);
  454. extern pascal ComponentResult SGSetChannelMaxFrames(SGChannel c, long frameCount)
  455.  FIVEWORDINLINE(0x2F3C, 0x4, 0x89, 0x7000, 0xA82A);
  456. extern pascal ComponentResult SGGetChannelMaxFrames(SGChannel c, long *frameCount)
  457.  FIVEWORDINLINE(0x2F3C, 0x4, 0x8A, 0x7000, 0xA82A);
  458. extern pascal ComponentResult SGSetChannelRefCon(SGChannel c, long refCon)
  459.  FIVEWORDINLINE(0x2F3C, 0x4, 0x8B, 0x7000, 0xA82A);
  460. extern pascal ComponentResult SGSetChannelClip(SGChannel c, RgnHandle theClip)
  461.  FIVEWORDINLINE(0x2F3C, 0x4, 0x8C, 0x7000, 0xA82A);
  462. extern pascal ComponentResult SGGetChannelClip(SGChannel c, RgnHandle *theClip)
  463.  FIVEWORDINLINE(0x2F3C, 0x4, 0x8D, 0x7000, 0xA82A);
  464. extern pascal ComponentResult SGGetChannelSampleDescription(SGChannel c, Handle sampleDesc)
  465.  FIVEWORDINLINE(0x2F3C, 0x4, 0x8E, 0x7000, 0xA82A);
  466. extern pascal ComponentResult SGGetChannelDeviceList(SGChannel c, long selectionFlags, SGDeviceList *list)
  467.  FIVEWORDINLINE(0x2F3C, 0x8, 0x8F, 0x7000, 0xA82A);
  468. extern pascal ComponentResult SGSetChannelDevice(SGChannel c, StringPtr name)
  469.  FIVEWORDINLINE(0x2F3C, 0x4, 0x90, 0x7000, 0xA82A);
  470. extern pascal ComponentResult SGSetChannelMatrix(SGChannel c, const MatrixRecord *m)
  471.  FIVEWORDINLINE(0x2F3C, 0x4, 0x91, 0x7000, 0xA82A);
  472. extern pascal ComponentResult SGGetChannelMatrix(SGChannel c, MatrixRecord *m)
  473.  FIVEWORDINLINE(0x2F3C, 0x4, 0x92, 0x7000, 0xA82A);
  474. extern pascal ComponentResult SGGetChannelTimeScale(SGChannel c, TimeScale *scale)
  475.  FIVEWORDINLINE(0x2F3C, 0x4, 0x93, 0x7000, 0xA82A);
  476. extern pascal ComponentResult SGChannelPutPicture(SGChannel c)
  477.  FIVEWORDINLINE(0x2F3C, 0, 0x94, 0x7000, 0xA82A);
  478. extern pascal ComponentResult SGChannelSetRequestedDataRate(SGChannel c, long bytesPerSecond)
  479.  FIVEWORDINLINE(0x2F3C, 0x4, 0x95, 0x7000, 0xA82A);
  480. extern pascal ComponentResult SGChannelGetRequestedDataRate(SGChannel c, long *bytesPerSecond)
  481.  FIVEWORDINLINE(0x2F3C, 0x4, 0x96, 0x7000, 0xA82A);
  482. extern pascal ComponentResult SGInitChannel(SGChannel c, SeqGrabComponent owner)
  483.  FIVEWORDINLINE(0x2F3C, 0x4, 0x180, 0x7000, 0xA82A);
  484. extern pascal ComponentResult SGWriteSamples(SGChannel c, Movie m, AliasHandle theFile)
  485.  FIVEWORDINLINE(0x2F3C, 0x8, 0x181, 0x7000, 0xA82A);
  486. extern pascal ComponentResult SGGetDataRate(SGChannel c, long *bytesPerSecond)
  487.  FIVEWORDINLINE(0x2F3C, 0x4, 0x182, 0x7000, 0xA82A);
  488. extern pascal ComponentResult SGAlignChannelRect(SGChannel c, Rect *r)
  489.  FIVEWORDINLINE(0x2F3C, 0x4, 0x183, 0x7000, 0xA82A);
  490. extern pascal ComponentResult SGPanelGetDitl(SeqGrabComponent s, Handle *ditl)
  491.  FIVEWORDINLINE(0x2F3C, 0x4, 0x200, 0x7000, 0xA82A);
  492. extern pascal ComponentResult SGPanelGetTitle(SeqGrabComponent s, Str255 title)
  493.  FIVEWORDINLINE(0x2F3C, 0x4, 0x201, 0x7000, 0xA82A);
  494. extern pascal ComponentResult SGPanelCanRun(SeqGrabComponent s, SGChannel c)
  495.  FIVEWORDINLINE(0x2F3C, 0x4, 0x202, 0x7000, 0xA82A);
  496. extern pascal ComponentResult SGPanelInstall(SeqGrabComponent s, SGChannel c, DialogPtr d, short itemOffset)
  497.  FIVEWORDINLINE(0x2F3C, 0xA, 0x203, 0x7000, 0xA82A);
  498. extern pascal ComponentResult SGPanelEvent(SeqGrabComponent s, SGChannel c, DialogPtr d, short itemOffset, EventRecord *theEvent, short *itemHit, Boolean *handled)
  499.  FIVEWORDINLINE(0x2F3C, 0x16, 0x204, 0x7000, 0xA82A);
  500. extern pascal ComponentResult SGPanelItem(SeqGrabComponent s, SGChannel c, DialogPtr d, short itemOffset, short itemNum)
  501.  FIVEWORDINLINE(0x2F3C, 0xC, 0x205, 0x7000, 0xA82A);
  502. extern pascal ComponentResult SGPanelRemove(SeqGrabComponent s, SGChannel c, DialogPtr d, short itemOffset)
  503.  FIVEWORDINLINE(0x2F3C, 0xA, 0x206, 0x7000, 0xA82A);
  504. extern pascal ComponentResult SGPanelSetGrabber(SeqGrabComponent s, SeqGrabComponent sg)
  505.  FIVEWORDINLINE(0x2F3C, 0x4, 0x207, 0x7000, 0xA82A);
  506. extern pascal ComponentResult SGPanelSetResFile(SeqGrabComponent s, short resRef)
  507.  FIVEWORDINLINE(0x2F3C, 0x2, 0x208, 0x7000, 0xA82A);
  508. extern pascal ComponentResult SGPanelGetSettings(SeqGrabComponent s, SGChannel c, UserData *ud, long flags)
  509.  FIVEWORDINLINE(0x2F3C, 0xC, 0x209, 0x7000, 0xA82A);
  510. extern pascal ComponentResult SGPanelSetSettings(SeqGrabComponent s, SGChannel c, UserData ud, long flags)
  511.  FIVEWORDINLINE(0x2F3C, 0xC, 0x20A, 0x7000, 0xA82A);
  512. extern pascal ComponentResult SGPanelValidateInput(SeqGrabComponent s, Boolean *ok)
  513.  FIVEWORDINLINE(0x2F3C, 0x4, 0x20B, 0x7000, 0xA82A);
  514. extern pascal ComponentResult SGPanelSetEventFilter(SeqGrabComponent s, SGModalFilterUPP proc, long refCon)
  515.  FIVEWORDINLINE(0x2F3C, 0x8, 0x20C, 0x7000, 0xA82A);
  516. #ifdef __cplusplus
  517. }
  518. #endif
  519.  
  520. #if defined(powerc) || defined (__powerc)
  521. #pragma options align=mac68k
  522. #endif
  523. struct SGCompressInfo {
  524.     Ptr                            buffer;
  525.     unsigned long                bufferSize;
  526.     unsigned char                similarity;
  527.     unsigned char                reserved;
  528. };
  529. #if defined(powerc) || defined(__powerc)
  530. #pragma options align=reset
  531. #endif
  532.  
  533. typedef struct SGCompressInfo SGCompressInfo;
  534.  
  535. typedef pascal ComponentResult (*SGGrabProcPtr)(SGChannel c, short bufferNum, long refCon);
  536.  
  537. enum {
  538.     uppSGGrabProcInfo = kPascalStackBased
  539.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  540.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  541.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  542.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  543. };
  544.  
  545. #if USESROUTINEDESCRIPTORS
  546. typedef UniversalProcPtr SGGrabUPP;
  547.  
  548. #define CallSGGrabProc(userRoutine, c, bufferNum, refCon)        \
  549.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGGrabProcInfo, (c), (bufferNum), (refCon))
  550. #define NewSGGrabProc(userRoutine)        \
  551.         (SGGrabUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGGrabProcInfo, GetCurrentISA())
  552. #else
  553. typedef SGGrabProcPtr SGGrabUPP;
  554.  
  555. #define CallSGGrabProc(userRoutine, c, bufferNum, refCon)        \
  556.         (*(userRoutine))((c), (bufferNum), (refCon))
  557. #define NewSGGrabProc(userRoutine)        \
  558.         (SGGrabUPP)(userRoutine)
  559. #endif
  560.  
  561. typedef pascal ComponentResult (*SGGrabCompleteProcPtr)(SGChannel c, short bufferNum, Boolean *done, long refCon);
  562.  
  563. enum {
  564.     uppSGGrabCompleteProcInfo = kPascalStackBased
  565.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  566.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  567.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  568.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Boolean*)))
  569.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  570. };
  571.  
  572. #if USESROUTINEDESCRIPTORS
  573. typedef UniversalProcPtr SGGrabCompleteUPP;
  574.  
  575. #define CallSGGrabCompleteProc(userRoutine, c, bufferNum, done, refCon)        \
  576.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGGrabCompleteProcInfo, (c), (bufferNum), (done), (refCon))
  577. #define NewSGGrabCompleteProc(userRoutine)        \
  578.         (SGGrabCompleteUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGGrabCompleteProcInfo, GetCurrentISA())
  579. #else
  580. typedef SGGrabCompleteProcPtr SGGrabCompleteUPP;
  581.  
  582. #define CallSGGrabCompleteProc(userRoutine, c, bufferNum, done, refCon)        \
  583.         (*(userRoutine))((c), (bufferNum), (done), (refCon))
  584. #define NewSGGrabCompleteProc(userRoutine)        \
  585.         (SGGrabCompleteUPP)(userRoutine)
  586. #endif
  587.  
  588. typedef pascal ComponentResult (*SGDisplayProcPtr)(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn, long refCon);
  589.  
  590. enum {
  591.     uppSGDisplayProcInfo = kPascalStackBased
  592.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  593.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  594.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  595.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(MatrixRecord*)))
  596.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(RgnHandle)))
  597.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long)))
  598. };
  599.  
  600. #if USESROUTINEDESCRIPTORS
  601. typedef UniversalProcPtr SGDisplayUPP;
  602.  
  603. #define CallSGDisplayProc(userRoutine, c, bufferNum, mp, clipRgn, refCon)        \
  604.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGDisplayProcInfo, (c), (bufferNum), (mp), (clipRgn), (refCon))
  605. #define NewSGDisplayProc(userRoutine)        \
  606.         (SGDisplayUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGDisplayProcInfo, GetCurrentISA())
  607. #else
  608. typedef SGDisplayProcPtr SGDisplayUPP;
  609.  
  610. #define CallSGDisplayProc(userRoutine, c, bufferNum, mp, clipRgn, refCon)        \
  611.         (*(userRoutine))((c), (bufferNum), (mp), (clipRgn), (refCon))
  612. #define NewSGDisplayProc(userRoutine)        \
  613.         (SGDisplayUPP)(userRoutine)
  614. #endif
  615.  
  616. typedef pascal ComponentResult (*SGCompressProcPtr)(SGChannel c, short bufferNum, long refCon);
  617.  
  618. enum {
  619.     uppSGCompressProcInfo = kPascalStackBased
  620.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  621.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  622.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  623.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  624. };
  625.  
  626. #if USESROUTINEDESCRIPTORS
  627. typedef UniversalProcPtr SGCompressUPP;
  628.  
  629. #define CallSGCompressProc(userRoutine, c, bufferNum, refCon)        \
  630.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGCompressProcInfo, (c), (bufferNum), (refCon))
  631. #define NewSGCompressProc(userRoutine)        \
  632.         (SGCompressUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGCompressProcInfo, GetCurrentISA())
  633. #else
  634. typedef SGCompressProcPtr SGCompressUPP;
  635.  
  636. #define CallSGCompressProc(userRoutine, c, bufferNum, refCon)        \
  637.         (*(userRoutine))((c), (bufferNum), (refCon))
  638. #define NewSGCompressProc(userRoutine)        \
  639.         (SGCompressUPP)(userRoutine)
  640. #endif
  641.  
  642. typedef pascal ComponentResult (*SGCompressCompleteProcPtr)(SGChannel c, short bufferNum, Boolean *done, SGCompressInfo *ci, long refCon);
  643.  
  644. enum {
  645.     uppSGCompressCompleteProcInfo = kPascalStackBased
  646.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  647.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  648.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  649.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Boolean*)))
  650.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(SGCompressInfo*)))
  651.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long)))
  652. };
  653.  
  654. #if USESROUTINEDESCRIPTORS
  655. typedef UniversalProcPtr SGCompressCompleteUPP;
  656.  
  657. #define CallSGCompressCompleteProc(userRoutine, c, bufferNum, done, ci, refCon)        \
  658.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGCompressCompleteProcInfo, (c), (bufferNum), (done), (ci), (refCon))
  659. #define NewSGCompressCompleteProc(userRoutine)        \
  660.         (SGCompressCompleteUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGCompressCompleteProcInfo, GetCurrentISA())
  661. #else
  662. typedef SGCompressCompleteProcPtr SGCompressCompleteUPP;
  663.  
  664. #define CallSGCompressCompleteProc(userRoutine, c, bufferNum, done, ci, refCon)        \
  665.         (*(userRoutine))((c), (bufferNum), (done), (ci), (refCon))
  666. #define NewSGCompressCompleteProc(userRoutine)        \
  667.         (SGCompressCompleteUPP)(userRoutine)
  668. #endif
  669.  
  670. typedef pascal ComponentResult (*SGAddFrameProcPtr)(SGChannel c, short bufferNum, TimeValue atTime, TimeScale scale, const SGCompressInfo *ci, long refCon);
  671.  
  672. enum {
  673.     uppSGAddFrameProcInfo = kPascalStackBased
  674.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  675.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  676.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  677.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(TimeValue)))
  678.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(TimeScale)))
  679.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(SGCompressInfo*)))
  680.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long)))
  681. };
  682.  
  683. #if USESROUTINEDESCRIPTORS
  684. typedef UniversalProcPtr SGAddFrameUPP;
  685.  
  686. #define CallSGAddFrameProc(userRoutine, c, bufferNum, atTime, scale, ci, refCon)        \
  687.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGAddFrameProcInfo, (c), (bufferNum), (atTime), (scale), (ci), (refCon))
  688. #define NewSGAddFrameProc(userRoutine)        \
  689.         (SGAddFrameUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGAddFrameProcInfo, GetCurrentISA())
  690. #else
  691. typedef SGAddFrameProcPtr SGAddFrameUPP;
  692.  
  693. #define CallSGAddFrameProc(userRoutine, c, bufferNum, atTime, scale, ci, refCon)        \
  694.         (*(userRoutine))((c), (bufferNum), (atTime), (scale), (ci), (refCon))
  695. #define NewSGAddFrameProc(userRoutine)        \
  696.         (SGAddFrameUPP)(userRoutine)
  697. #endif
  698.  
  699. typedef pascal ComponentResult (*SGTransferFrameProcPtr)(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn, long refCon);
  700.  
  701. enum {
  702.     uppSGTransferFrameProcInfo = kPascalStackBased
  703.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  704.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  705.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  706.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(MatrixRecord*)))
  707.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(RgnHandle)))
  708.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long)))
  709. };
  710.  
  711. #if USESROUTINEDESCRIPTORS
  712. typedef UniversalProcPtr SGTransferFrameUPP;
  713.  
  714. #define CallSGTransferFrameProc(userRoutine, c, bufferNum, mp, clipRgn, refCon)        \
  715.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGTransferFrameProcInfo, (c), (bufferNum), (mp), (clipRgn), (refCon))
  716. #define NewSGTransferFrameProc(userRoutine)        \
  717.         (SGTransferFrameUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGTransferFrameProcInfo, GetCurrentISA())
  718. #else
  719. typedef SGTransferFrameProcPtr SGTransferFrameUPP;
  720.  
  721. #define CallSGTransferFrameProc(userRoutine, c, bufferNum, mp, clipRgn, refCon)        \
  722.         (*(userRoutine))((c), (bufferNum), (mp), (clipRgn), (refCon))
  723. #define NewSGTransferFrameProc(userRoutine)        \
  724.         (SGTransferFrameUPP)(userRoutine)
  725. #endif
  726.  
  727. typedef pascal ComponentResult (*SGGrabCompressCompleteProcPtr)(SGChannel c, Boolean *done, SGCompressInfo *ci, TimeRecord *t, long refCon);
  728.  
  729. enum {
  730.     uppSGGrabCompressCompleteProcInfo = kPascalStackBased
  731.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  732.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  733.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Boolean*)))
  734.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(SGCompressInfo*)))
  735.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(TimeRecord*)))
  736.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long)))
  737. };
  738.  
  739. #if USESROUTINEDESCRIPTORS
  740. typedef UniversalProcPtr SGGrabCompressCompleteUPP;
  741.  
  742. #define CallSGGrabCompressCompleteProc(userRoutine, c, done, ci, t, refCon)        \
  743.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGGrabCompressCompleteProcInfo, (c), (done), (ci), (t), (refCon))
  744. #define NewSGGrabCompressCompleteProc(userRoutine)        \
  745.         (SGGrabCompressCompleteUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGGrabCompressCompleteProcInfo, GetCurrentISA())
  746. #else
  747. typedef SGGrabCompressCompleteProcPtr SGGrabCompressCompleteUPP;
  748.  
  749. #define CallSGGrabCompressCompleteProc(userRoutine, c, done, ci, t, refCon)        \
  750.         (*(userRoutine))((c), (done), (ci), (t), (refCon))
  751. #define NewSGGrabCompressCompleteProc(userRoutine)        \
  752.         (SGGrabCompressCompleteUPP)(userRoutine)
  753. #endif
  754.  
  755. typedef pascal ComponentResult (*SGDisplayCompressProcPtr)(SGChannel c, Ptr dataPtr, ImageDescriptionHandle desc, MatrixRecord *mp, RgnHandle clipRgn, long refCon);
  756.  
  757. enum {
  758.     uppSGDisplayCompressProcInfo = kPascalStackBased
  759.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  760.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SGChannel)))
  761.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Ptr)))
  762.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(ImageDescriptionHandle)))
  763.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(MatrixRecord*)))
  764.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(RgnHandle)))
  765.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long)))
  766. };
  767.  
  768. #if USESROUTINEDESCRIPTORS
  769. typedef UniversalProcPtr SGDisplayCompressUPP;
  770.  
  771. #define CallSGDisplayCompressProc(userRoutine, c, dataPtr, desc, mp, clipRgn, refCon)        \
  772.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSGDisplayCompressProcInfo, (c), (dataPtr), (desc), (mp), (clipRgn), (refCon))
  773. #define NewSGDisplayCompressProc(userRoutine)        \
  774.         (SGDisplayCompressUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSGDisplayCompressProcInfo, GetCurrentISA())
  775. #else
  776. typedef SGDisplayCompressProcPtr SGDisplayCompressUPP;
  777.  
  778. #define CallSGDisplayCompressProc(userRoutine, c, dataPtr, desc, mp, clipRgn, refCon)        \
  779.         (*(userRoutine))((c), (dataPtr), (desc), (mp), (clipRgn), (refCon))
  780. #define NewSGDisplayCompressProc(userRoutine)        \
  781.         (SGDisplayCompressUPP)(userRoutine)
  782. #endif
  783.  
  784. #if defined(powerc) || defined (__powerc)
  785. #pragma options align=mac68k
  786. #endif
  787. struct VideoBottles {
  788.     short                        procCount;
  789.     SGGrabUPP                    grabProc;
  790.     SGGrabCompleteUPP            grabCompleteProc;
  791.     SGDisplayUPP                displayProc;
  792.     SGCompressUPP                compressProc;
  793.     SGCompressCompleteUPP        compressCompleteProc;
  794.     SGAddFrameUPP                addFrameProc;
  795.     SGTransferFrameUPP            transferFrameProc;
  796.     SGGrabCompressCompleteUPP    grabCompressCompleteProc;
  797.     SGDisplayCompressUPP        displayCompressProc;
  798. };
  799. #if defined(powerc) || defined(__powerc)
  800. #pragma options align=reset
  801. #endif
  802.  
  803. typedef struct VideoBottles VideoBottles;
  804.  
  805. #ifdef __cplusplus
  806. extern "C" {
  807. #endif
  808.  
  809. extern pascal ComponentResult SGGetSrcVideoBounds(SGChannel c, Rect *r)
  810.  FIVEWORDINLINE(0x2F3C, 0x4, 0x100, 0x7000, 0xA82A);
  811. extern pascal ComponentResult SGSetVideoRect(SGChannel c, Rect *r)
  812.  FIVEWORDINLINE(0x2F3C, 0x4, 0x101, 0x7000, 0xA82A);
  813. extern pascal ComponentResult SGGetVideoRect(SGChannel c, Rect *r)
  814.  FIVEWORDINLINE(0x2F3C, 0x4, 0x102, 0x7000, 0xA82A);
  815. extern pascal ComponentResult SGGetVideoCompressorType(SGChannel c, OSType *compressorType)
  816.  FIVEWORDINLINE(0x2F3C, 0x4, 0x103, 0x7000, 0xA82A);
  817. extern pascal ComponentResult SGSetVideoCompressorType(SGChannel c, OSType compressorType)
  818.  FIVEWORDINLINE(0x2F3C, 0x4, 0x104, 0x7000, 0xA82A);
  819. extern pascal ComponentResult SGSetVideoCompressor(SGChannel c, short depth, CompressorComponent compressor, CodecQ spatialQuality, CodecQ temporalQuality, long keyFrameRate)
  820.  FIVEWORDINLINE(0x2F3C, 0x12, 0x105, 0x7000, 0xA82A);
  821. extern pascal ComponentResult SGGetVideoCompressor(SGChannel c, short *depth, CompressorComponent *compressor, CodecQ *spatialQuality, CodecQ *temporalQuality, long *keyFrameRate)
  822.  FIVEWORDINLINE(0x2F3C, 0x14, 0x106, 0x7000, 0xA82A);
  823. extern pascal ComponentInstance SGGetVideoDigitizerComponent(SGChannel c)
  824.  FIVEWORDINLINE(0x2F3C, 0, 0x107, 0x7000, 0xA82A);
  825. extern pascal ComponentResult SGSetVideoDigitizerComponent(SGChannel c, ComponentInstance vdig)
  826.  FIVEWORDINLINE(0x2F3C, 0x4, 0x108, 0x7000, 0xA82A);
  827. extern pascal ComponentResult SGVideoDigitizerChanged(SGChannel c)
  828.  FIVEWORDINLINE(0x2F3C, 0, 0x109, 0x7000, 0xA82A);
  829. extern pascal ComponentResult SGSetVideoBottlenecks(SGChannel c, VideoBottles *vb)
  830.  FIVEWORDINLINE(0x2F3C, 0x4, 0x10A, 0x7000, 0xA82A);
  831. extern pascal ComponentResult SGGetVideoBottlenecks(SGChannel c, VideoBottles *vb)
  832.  FIVEWORDINLINE(0x2F3C, 0x4, 0x10B, 0x7000, 0xA82A);
  833. extern pascal ComponentResult SGGrabFrame(SGChannel c, short bufferNum)
  834.  FIVEWORDINLINE(0x2F3C, 0x2, 0x10C, 0x7000, 0xA82A);
  835. extern pascal ComponentResult SGGrabFrameComplete(SGChannel c, short bufferNum, Boolean *done)
  836.  FIVEWORDINLINE(0x2F3C, 0x6, 0x10D, 0x7000, 0xA82A);
  837. extern pascal ComponentResult SGDisplayFrame(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn)
  838.  FIVEWORDINLINE(0x2F3C, 0xA, 0x10E, 0x7000, 0xA82A);
  839. extern pascal ComponentResult SGCompressFrame(SGChannel c, short bufferNum)
  840.  FIVEWORDINLINE(0x2F3C, 0x2, 0x10F, 0x7000, 0xA82A);
  841. extern pascal ComponentResult SGCompressFrameComplete(SGChannel c, short bufferNum, Boolean *done, SGCompressInfo *ci)
  842.  FIVEWORDINLINE(0x2F3C, 0xA, 0x110, 0x7000, 0xA82A);
  843. extern pascal ComponentResult SGAddFrame(SGChannel c, short bufferNum, TimeValue atTime, TimeScale scale, const SGCompressInfo *ci)
  844.  FIVEWORDINLINE(0x2F3C, 0xE, 0x111, 0x7000, 0xA82A);
  845. extern pascal ComponentResult SGTransferFrameForCompress(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn)
  846.  FIVEWORDINLINE(0x2F3C, 0xA, 0x112, 0x7000, 0xA82A);
  847. extern pascal ComponentResult SGSetCompressBuffer(SGChannel c, short depth, const Rect *compressSize)
  848.  FIVEWORDINLINE(0x2F3C, 0x6, 0x113, 0x7000, 0xA82A);
  849. extern pascal ComponentResult SGGetCompressBuffer(SGChannel c, short *depth, Rect *compressSize)
  850.  FIVEWORDINLINE(0x2F3C, 0x8, 0x114, 0x7000, 0xA82A);
  851. extern pascal ComponentResult SGGetBufferInfo(SGChannel c, short bufferNum, PixMapHandle *bufferPM, Rect *bufferRect, GWorldPtr *compressBuffer, Rect *compressBufferRect)
  852.  FIVEWORDINLINE(0x2F3C, 0x12, 0x115, 0x7000, 0xA82A);
  853. extern pascal ComponentResult SGSetUseScreenBuffer(SGChannel c, Boolean useScreenBuffer)
  854.  FIVEWORDINLINE(0x2F3C, 0x2, 0x116, 0x7000, 0xA82A);
  855. extern pascal ComponentResult SGGetUseScreenBuffer(SGChannel c, Boolean *useScreenBuffer)
  856.  FIVEWORDINLINE(0x2F3C, 0x4, 0x117, 0x7000, 0xA82A);
  857. extern pascal ComponentResult SGGrabCompressComplete(SGChannel c, Boolean *done, SGCompressInfo *ci, TimeRecord *tr)
  858.  FIVEWORDINLINE(0x2F3C, 0xC, 0x118, 0x7000, 0xA82A);
  859. extern pascal ComponentResult SGDisplayCompress(SGChannel c, Ptr dataPtr, ImageDescriptionHandle desc, MatrixRecord *mp, RgnHandle clipRgn)
  860.  FIVEWORDINLINE(0x2F3C, 0x10, 0x119, 0x7000, 0xA82A);
  861. extern pascal ComponentResult SGSetFrameRate(SGChannel c, Fixed frameRate)
  862.  FIVEWORDINLINE(0x2F3C, 0x4, 0x11A, 0x7000, 0xA82A);
  863. extern pascal ComponentResult SGGetFrameRate(SGChannel c, Fixed *frameRate)
  864.  FIVEWORDINLINE(0x2F3C, 0x4, 0x11B, 0x7000, 0xA82A);
  865. #ifdef __cplusplus
  866. }
  867. #endif
  868.  
  869. #ifdef __cplusplus
  870. extern "C" {
  871. #endif
  872.  
  873. extern pascal ComponentResult SGSetSoundInputDriver(SGChannel c, const Str255 driverName)
  874.  FIVEWORDINLINE(0x2F3C, 0x4, 0x100, 0x7000, 0xA82A);
  875. extern pascal long SGGetSoundInputDriver(SGChannel c)
  876.  FIVEWORDINLINE(0x2F3C, 0, 0x101, 0x7000, 0xA82A);
  877. extern pascal ComponentResult SGSoundInputDriverChanged(SGChannel c)
  878.  FIVEWORDINLINE(0x2F3C, 0, 0x102, 0x7000, 0xA82A);
  879. extern pascal ComponentResult SGSetSoundRecordChunkSize(SGChannel c, long seconds)
  880.  FIVEWORDINLINE(0x2F3C, 0x4, 0x103, 0x7000, 0xA82A);
  881. extern pascal long SGGetSoundRecordChunkSize(SGChannel c)
  882.  FIVEWORDINLINE(0x2F3C, 0, 0x104, 0x7000, 0xA82A);
  883. extern pascal ComponentResult SGSetSoundInputRate(SGChannel c, Fixed rate)
  884.  FIVEWORDINLINE(0x2F3C, 0x4, 0x105, 0x7000, 0xA82A);
  885. extern pascal Fixed SGGetSoundInputRate(SGChannel c)
  886.  FIVEWORDINLINE(0x2F3C, 0, 0x106, 0x7000, 0xA82A);
  887. extern pascal ComponentResult SGSetSoundInputParameters(SGChannel c, short sampleSize, short numChannels, OSType compressionType)
  888.  FIVEWORDINLINE(0x2F3C, 0x8, 0x107, 0x7000, 0xA82A);
  889. extern pascal ComponentResult SGGetSoundInputParameters(SGChannel c, short *sampleSize, short *numChannels, OSType *compressionType)
  890.  FIVEWORDINLINE(0x2F3C, 0xC, 0x108, 0x7000, 0xA82A);
  891. #ifdef __cplusplus
  892. }
  893. #endif
  894.  
  895. #define sgChannelAtom 'chan'
  896.  
  897. #define sgChannelSettingsAtom 'ctom'
  898.  
  899. #define sgChannelDescription 'cdsc'
  900.  
  901. #define sgChannelSettings 'cset'
  902.  
  903. #define sgDeviceNameType 'name'
  904.  
  905. #define sgUsageType 'use '
  906.  
  907. #define sgPlayFlagsType 'plyf'
  908.  
  909. #define sgClipType 'clip'
  910.  
  911. #define sgMatrixType 'mtrx'
  912.  
  913. #define sgVolumeType 'volu'
  914.  
  915. #define sgPanelSettingsAtom 'ptom'
  916.  
  917. #define sgPanelDescription 'pdsc'
  918.  
  919. #define sgPanelSettings 'pset'
  920.  
  921. #define sgcSoundCompressionType 'scmp'
  922.  
  923. #define sgcSoundSampleRateType 'srat'
  924.  
  925. #define sgcSoundChannelCountType 'schn'
  926.  
  927. #define sgcSoundSampleSizeType 'ssiz'
  928.  
  929. #define sgcSoundInputType 'sinp'
  930.  
  931. #define sgcSoundGainType 'gain'
  932.  
  933. #define sgcVideoHueType 'hue '
  934.  
  935. #define sgcVideoSaturationType 'satr'
  936.  
  937. #define sgcVideoContrastType 'trst'
  938.  
  939. #define sgcVideoSharpnessType 'shrp'
  940.  
  941. #define sgcVideoBrigtnessType 'brit'
  942.  
  943. #define sgcVideoBlackLevelType 'blkl'
  944.  
  945. #define sgcVideoWhiteLevelType 'whtl'
  946.  
  947. #define sgcVideoInputType 'vinp'
  948.  
  949. #define sgcVideoFormatType 'vstd'
  950.  
  951. #define sgcVideoFilterType 'vflt'
  952.  
  953. #define sgcVideoRectType 'vrct'
  954.  
  955. #define sgVideoDigitizerType 'vdig'
  956.  
  957. enum  {
  958.     kSGInitializeSelect            = 0x1,
  959.     kSGSetDataOutputSelect        = 0x2,
  960.     kSGGetDataOutputSelect        = 0x3,
  961.     kSGSetGWorldSelect            = 0x4,
  962.     kSGGetGWorldSelect            = 0x5,
  963.     kSGNewChannelSelect            = 0x6,
  964.     kSGDisposeChannelSelect        = 0x7,
  965.     kSGStartPreviewSelect        = 0x10,
  966.     kSGStartRecordSelect        = 0x11,
  967.     kSGIdleSelect                = 0x12,
  968.     kSGStopSelect                = 0x13,
  969.     kSGPauseSelect                = 0x14,
  970.     kSGPrepareSelect            = 0x15,
  971.     kSGReleaseSelect            = 0x16,
  972.     kSGGetMovieSelect            = 0x17,
  973.     kSGSetMaximumRecordTimeSelect = 0x18,
  974.     kSGGetMaximumRecordTimeSelect = 0x19,
  975.     kSGGetStorageSpaceRemainingSelect = 0x1A,
  976.     kSGGetTimeRemainingSelect    = 0x1B,
  977.     kSGGrabPictSelect            = 0x1C,
  978.     kSGGetLastMovieResIDSelect    = 0x1D,
  979.     kSGSetFlagsSelect            = 0x1E,
  980.     kSGGetFlagsSelect            = 0x1F,
  981.     kSGSetDataProcSelect        = 0x20,
  982.     kSGNewChannelFromComponentSelect = 0x21,
  983.     kSGDisposeDeviceListSelect    = 0x22,
  984.     kSGAppendDeviceListToMenuSelect = 0x23,
  985.     kSGSetSettingsSelect        = 0x24,
  986.     kSGGetSettingsSelect        = 0x25,
  987.     kSGGetIndChannelSelect        = 0x26,
  988.     kSGUpdateSelect                = 0x27,
  989.     kSGGetPauseSelect            = 0x28,
  990.     kSGSettingsDialogSelect        = 0x29,
  991.     kSGGetAlignmentProcSelect    = 0x2A,
  992.     kSGSetChannelSettingsSelect    = 0x2B,
  993.     kSGGetChannelSettingsSelect    = 0x2C,
  994.     kSGGetModeSelect            = 0x2D,
  995.     kSGSetDataRefSelect            = 0x2E,
  996.     kSGGetDataRefSelect            = 0x2F,
  997.     kSGNewOutputSelect            = 0x30,
  998.     kSGDisposeOutputSelect        = 0x31,
  999.     kSGSetOutputFlagsSelect        = 0x32,
  1000.     kSGSetChannelOutputSelect    = 0x33,
  1001.     kSGGetDataOutputStorageSpaceRemainingSelect = 0x34,
  1002.     kSGWriteMovieDataSelect        = 0x100,
  1003.     kSGAddFrameReferenceSelect    = 0x101,
  1004.     kSGGetNextFrameReferenceSelect = 0x102,
  1005.     kSGGetTimeBaseSelect        = 0x103,
  1006.     kSGSortDeviceListSelect        = 0x104,
  1007.     kSGAddMovieDataSelect        = 0x105,
  1008.     kSGChangedSourceSelect        = 0x106,
  1009.     kSGCSetChannelUsageSelect    = 0x80,
  1010.     kSGCGetChannelUsageSelect    = 0x81,
  1011.     kSGCSetChannelBoundsSelect    = 0x82,
  1012.     kSGCGetChannelBoundsSelect    = 0x83,
  1013.     kSGCSetChannelVolumeSelect    = 0x84,
  1014.     kSGCGetChannelVolumeSelect    = 0x85,
  1015.     kSGCGetChannelInfoSelect    = 0x86,
  1016.     kSGCSetChannelPlayFlagsSelect = 0x87,
  1017.     kSGCGetChannelPlayFlagsSelect = 0x88,
  1018.     kSGCSetChannelMaxFramesSelect = 0x89,
  1019.     kSGCGetChannelMaxFramesSelect = 0x8A,
  1020.     kSGCSetChannelRefConSelect    = 0x8B,
  1021.     kSGCSetChannelClipSelect    = 0x8C,
  1022.     kSGCGetChannelClipSelect    = 0x8D,
  1023.     kSGCGetChannelSampleDescriptionSelect = 0x8E,
  1024.     kSGCGetChannelDeviceListSelect = 0x8F,
  1025.     kSGCSetChannelDeviceSelect    = 0x90,
  1026.     kSGCSetChannelMatrixSelect    = 0x91,
  1027.     kSGCGetChannelMatrixSelect    = 0x92,
  1028.     kSGCGetChannelTimeScaleSelect = 0x93,
  1029.     kSGCChannelPutPictureSelect    = 0x94,
  1030.     kSGCChannelSetRequestedDataRateSelect = 0x95,
  1031.     kSGCChannelGetRequestedDataRateSelect = 0x96,
  1032.     kSGCInitChannelSelect        = 0x180,
  1033.     kSGCWriteSamplesSelect        = 0x181,
  1034.     kSGCGetDataRateSelect        = 0x182,
  1035.     kSGCAlignChannelRectSelect    = 0x183,
  1036.     kSGCPanelGetDitlSelect        = 0x200,
  1037.     kSGCPanelGetTitleSelect        = 0x201,
  1038.     kSGCPanelCanRunSelect        = 0x202,
  1039.     kSGCPanelInstallSelect        = 0x203,
  1040.     kSGCPanelEventSelect        = 0x204,
  1041.     kSGCPanelItemSelect            = 0x205,
  1042.     kSGCPanelRemoveSelect        = 0x206,
  1043.     kSGCPanelSetGrabberSelect    = 0x207,
  1044.     kSGCPanelSetResFileSelect    = 0x208,
  1045.     kSGCPanelGetSettingsSelect    = 0x209,
  1046.     kSGCPanelSetSettingsSelect    = 0x20A,
  1047.     kSGCPanelValidateInputSelect = 0x20B,
  1048.     kSGCPanelSetEventFilterSelect = 0x20C,
  1049.     kSGCGetSrcVideoBoundsSelect    = 0x100,
  1050.     kSGCSetVideoRectSelect        = 0x101,
  1051.     kSGCGetVideoRectSelect        = 0x102,
  1052.     kSGCGetVideoCompressorTypeSelect = 0x103,
  1053.     kSGCSetVideoCompressorTypeSelect = 0x104,
  1054.     kSGCSetVideoCompressorSelect = 0x105,
  1055.     kSGCGetVideoCompressorSelect = 0x106,
  1056.     kSGCGetVideoDigitizerComponentSelect = 0x107,
  1057.     kSGCSetVideoDigitizerComponentSelect = 0x108,
  1058.     kSGCVideoDigitizerChangedSelect = 0x109,
  1059.     kSGCSetVideoBottlenecksSelect = 0x10A,
  1060.     kSGCGetVideoBottlenecksSelect = 0x10B,
  1061.     kSGCGrabFrameSelect            = 0x10C,
  1062.     kSGCGrabFrameCompleteSelect    = 0x10D,
  1063.     kSGCDisplayFrameSelect        = 0x10E,
  1064.     kSGCCompressFrameSelect        = 0x10F,
  1065.     kSGCCompressFrameCompleteSelect = 0x110,
  1066.     kSGCAddFrameSelect            = 0x111,
  1067.     kSGCTransferFrameForCompressSelect = 0x112,
  1068.     kSGCSetCompressBufferSelect    = 0x113,
  1069.     kSGCGetCompressBufferSelect    = 0x114,
  1070.     kSGCGetBufferInfoSelect        = 0x115,
  1071.     kSGCSetUseScreenBufferSelect = 0x116,
  1072.     kSGCGetUseScreenBufferSelect = 0x117,
  1073.     kSGCGrabCompressCompleteSelect = 0x118,
  1074.     kSGCDisplayCompressSelect    = 0x119,
  1075.     kSGCSetFrameRateSelect        = 0x11A,
  1076.     kSGCGetFrameRateSelect        = 0x11B,
  1077.     kSGCSetSoundInputDriverSelect = 0x100,
  1078.     kSGCGetSoundInputDriverSelect = 0x101,
  1079.     kSGCSoundInputDriverChangedSelect = 0x102,
  1080.     kSGCSetSoundRecordChunkSizeSelect = 0x103,
  1081.     kSGCGetSoundRecordChunkSizeSelect = 0x104,
  1082.     kSGCSetSoundInputRateSelect    = 0x105,
  1083.     kSGCGetSoundInputRateSelect    = 0x106,
  1084.     kSGCSetSoundInputParametersSelect = 0x107,
  1085.     kSGCGetSoundInputParametersSelect = 0x108
  1086. };
  1087.  
  1088. #define videoDigitizerComponentType 'vdig'
  1089.  
  1090. #define vdigInterfaceRev 2L
  1091.  
  1092. #define ntscIn 0
  1093.  
  1094. #define currentIn 0
  1095.  
  1096. #define palIn 1
  1097.  
  1098. #define secamIn 2
  1099.  
  1100. #define ntscReallyIn 3
  1101.  
  1102. #define compositeIn 0
  1103.  
  1104. #define sVideoIn 1
  1105.  
  1106. #define rgbComponentIn 2
  1107.  
  1108. #define rgbComponentSyncIn 3
  1109.  
  1110. #define yuvComponentIn 4
  1111.  
  1112. #define yuvComponentSyncIn 5
  1113.  
  1114. #define vdPlayThruOff 0
  1115.  
  1116. #define vdPlayThruOn 1
  1117.  
  1118. #define vdDigitizerBW 0
  1119.  
  1120. #define vdDigitizerRGB 1
  1121.  
  1122. #define vdBroadcastMode 0
  1123.  
  1124. #define vdVTRMode 1
  1125.  
  1126. #define vdUseAnyField 0
  1127.  
  1128. #define vdUseOddField 1
  1129.  
  1130. #define vdUseEvenField 2
  1131.  
  1132. #define vdTypeBasic 0
  1133.  
  1134. #define vdTypeAlpha 1
  1135.  
  1136. #define vdTypeMask 2
  1137.  
  1138. #define vdTypeKey 3
  1139.  
  1140. #define digiUnimpErr -2201
  1141.  
  1142. #define qtParamErr -2202
  1143.  
  1144. #define matrixErr -2203
  1145.  
  1146. #define notExactMatrix -2204
  1147.  
  1148. #define noMoreKeyColors -2205
  1149.  
  1150. #define notExactSize -2206
  1151.  
  1152. #define badDepth -2207
  1153.  
  1154. #define noDMA -2208
  1155.  
  1156. #define badCallOrder -2209
  1157.  
  1158. #define digiInDoesNTSC (1L<<0)
  1159.  
  1160. #define digiInDoesPAL (1L<<1)
  1161.  
  1162. #define digiInDoesSECAM (1L<<2)
  1163.  
  1164. #define digiInDoesGenLock (1L<<7)
  1165.  
  1166. #define digiInDoesComposite (1L<<8)
  1167.  
  1168. #define digiInDoesSVideo (1L<<9)
  1169.  
  1170. #define digiInDoesComponent (1L<<10)
  1171.  
  1172. #define digiInVTR_Broadcast (1L<<11)
  1173.  
  1174. #define digiInDoesColor (1L<<12)
  1175.  
  1176. #define digiInDoesBW (1L<<13)
  1177.  
  1178. #define digiInSignalLock (1L<<31)
  1179.  
  1180. #define digiOutDoes1 (1L<<0)
  1181.  
  1182. #define digiOutDoes2 (1L<<1)
  1183.  
  1184. #define digiOutDoes4 (1L<<2)
  1185.  
  1186. #define digiOutDoes8 (1L<<3)
  1187.  
  1188. #define digiOutDoes16 (1L<<4)
  1189.  
  1190. #define digiOutDoes32 (1L<<5)
  1191.  
  1192. #define digiOutDoesDither (1L<<6)
  1193.  
  1194. #define digiOutDoesStretch (1L<<7)
  1195.  
  1196. #define digiOutDoesShrink (1L<<8)
  1197.  
  1198. #define digiOutDoesMask (1L<<9)
  1199.  
  1200. #define digiOutDoesDouble (1L<<11)
  1201.  
  1202. #define digiOutDoesQuad (1L<<12)
  1203.  
  1204. #define digiOutDoesQuarter (1L<<13)
  1205.  
  1206. #define digiOutDoesSixteenth (1L<<14)
  1207.  
  1208. #define digiOutDoesRotate (1L<<15)
  1209.  
  1210. #define digiOutDoesHorizFlip (1L<<16)
  1211.  
  1212. #define digiOutDoesVertFlip (1L<<17)
  1213.  
  1214. #define digiOutDoesSkew (1L<<18)
  1215.  
  1216. #define digiOutDoesBlend (1L<<19)
  1217.  
  1218. #define digiOutDoesWarp (1L<<20)
  1219.  
  1220. #define digiOutDoesHW_DMA (1L<<21)
  1221.  
  1222. #define digiOutDoesHWPlayThru (1L<<22)
  1223.  
  1224. #define digiOutDoesILUT (1L<<23)
  1225.  
  1226. #define digiOutDoesKeyColor (1L<<24)
  1227.  
  1228. #define digiOutDoesAsyncGrabs (1L<<25)
  1229.  
  1230. #define digiOutDoesUnreadableScreenBits (1L<<26)
  1231.  
  1232. #define digiOutDoesCompress (1L<<27)
  1233.  
  1234. #define digiOutDoesCompressOnly (1L<<28)
  1235.  
  1236. #define digiOutDoesPlayThruDuringCompress (1L<<29)
  1237.  
  1238. typedef ComponentInstance VideoDigitizerComponent;
  1239.  
  1240. typedef ComponentResult VideoDigitizerError;
  1241.  
  1242. #if defined(powerc) || defined (__powerc)
  1243. #pragma options align=mac68k
  1244. #endif
  1245. struct DigitizerInfo {
  1246.     short                        vdigType;
  1247.     long                        inputCapabilityFlags;
  1248.     long                        outputCapabilityFlags;
  1249.     long                        inputCurrentFlags;
  1250.     long                        outputCurrentFlags;
  1251.     short                        slot;
  1252.     GDHandle                    gdh;
  1253.     GDHandle                    maskgdh;
  1254.     short                        minDestHeight;
  1255.     short                        minDestWidth;
  1256.     short                        maxDestHeight;
  1257.     short                        maxDestWidth;
  1258.     short                        blendLevels;
  1259.     long                        reserved;
  1260. };
  1261. #if defined(powerc) || defined(__powerc)
  1262. #pragma options align=reset
  1263. #endif
  1264.  
  1265. typedef struct DigitizerInfo DigitizerInfo;
  1266.  
  1267. #if defined(powerc) || defined (__powerc)
  1268. #pragma options align=mac68k
  1269. #endif
  1270. struct VdigType {
  1271.     long                        type;
  1272.     long                        reserved;
  1273. };
  1274. #if defined(powerc) || defined(__powerc)
  1275. #pragma options align=reset
  1276. #endif
  1277.  
  1278. typedef struct VdigType VdigType;
  1279.  
  1280. #if defined(powerc) || defined (__powerc)
  1281. #pragma options align=mac68k
  1282. #endif
  1283. struct VdigTypeList {
  1284.     short                        count;
  1285.     VdigType                    list[1];
  1286. };
  1287. #if defined(powerc) || defined(__powerc)
  1288. #pragma options align=reset
  1289. #endif
  1290.  
  1291. typedef struct VdigTypeList VdigTypeList;
  1292.  
  1293. #if defined(powerc) || defined (__powerc)
  1294. #pragma options align=mac68k
  1295. #endif
  1296. struct VdigBufferRec {
  1297.     PixMapHandle                dest;
  1298.     Point                        location;
  1299.     long                        reserved;
  1300. };
  1301. #if defined(powerc) || defined(__powerc)
  1302. #pragma options align=reset
  1303. #endif
  1304.  
  1305. typedef struct VdigBufferRec VdigBufferRec;
  1306.  
  1307. #if defined(powerc) || defined (__powerc)
  1308. #pragma options align=mac68k
  1309. #endif
  1310. struct VdigBufferRecList {
  1311.     short                        count;
  1312.     MatrixRecordPtr                matrix;
  1313.     RgnHandle                    mask;
  1314.     VdigBufferRec                list[1];
  1315. };
  1316. #if defined(powerc) || defined(__powerc)
  1317. #pragma options align=reset
  1318. #endif
  1319.  
  1320. typedef struct VdigBufferRecList VdigBufferRecList;
  1321.  
  1322. typedef VdigBufferRecList *VdigBufferRecListPtr, **VdigBufferRecListHandle;
  1323.  
  1324. typedef pascal void (*VdigIntProcPtr)(long flags, long refcon);
  1325.  
  1326. enum {
  1327.     uppVdigIntProcInfo = kPascalStackBased
  1328.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  1329.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  1330. };
  1331.  
  1332. #if USESROUTINEDESCRIPTORS
  1333. typedef UniversalProcPtr VdigIntUPP;
  1334.  
  1335. #define CallVdigIntProc(userRoutine, flags, refcon)        \
  1336.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppVdigIntProcInfo, (flags), (refcon))
  1337. #define NewVdigIntProc(userRoutine)        \
  1338.         (VdigIntUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppVdigIntProcInfo, GetCurrentISA())
  1339. #else
  1340. typedef VdigIntProcPtr VdigIntUPP;
  1341.  
  1342. #define CallVdigIntProc(userRoutine, flags, refcon)        \
  1343.         (*(userRoutine))((flags), (refcon))
  1344. #define NewVdigIntProc(userRoutine)        \
  1345.         (VdigIntUPP)(userRoutine)
  1346. #endif
  1347.  
  1348. #if defined(powerc) || defined (__powerc)
  1349. #pragma options align=mac68k
  1350. #endif
  1351. struct VDCompressionList {
  1352.     CodecComponent                codec;
  1353.     CodecType                    cType;
  1354.     Str63                        typeName;
  1355.     Str63                        name;
  1356.     long                        formatFlags;
  1357.     long                        compressFlags;
  1358.     long                        reserved;
  1359. };
  1360. #if defined(powerc) || defined(__powerc)
  1361. #pragma options align=reset
  1362. #endif
  1363.  
  1364. typedef struct VDCompressionList VDCompressionList;
  1365.  
  1366. typedef VDCompressionList *VDCompressionListPtr, **VDCompressionListHandle;
  1367.  
  1368. enum  {
  1369.     dmaDepth1                    = 1,
  1370.     dmaDepth2                    = 2,
  1371.     dmaDepth4                    = 4,
  1372.     dmaDepth8                    = 8,
  1373.     dmaDepth16                    = 16,
  1374.     dmaDepth32                    = 32,
  1375.     dmaDepth2Gray                = 64,
  1376.     dmaDepth4Gray                = 128,
  1377.     dmaDepth8Gray                = 256
  1378. };
  1379.  
  1380. #define kVDIGControlledFrameRate (-1)
  1381.  
  1382. enum  {
  1383.     kvdigSelectors                = 82
  1384. };
  1385.  
  1386. #ifdef __cplusplus
  1387. extern "C" {
  1388. #endif
  1389.  
  1390. extern pascal VideoDigitizerError VDGetMaxSrcRect(VideoDigitizerComponent ci, short inputStd, Rect *maxSrcRect)
  1391.  FIVEWORDINLINE(0x2F3C, 0x6, 0x1, 0x7000, 0xA82A);
  1392. extern pascal VideoDigitizerError VDGetActiveSrcRect(VideoDigitizerComponent ci, short inputStd, Rect *activeSrcRect)
  1393.  FIVEWORDINLINE(0x2F3C, 0x6, 0x2, 0x7000, 0xA82A);
  1394. extern pascal VideoDigitizerError VDSetDigitizerRect(VideoDigitizerComponent ci, Rect *digitizerRect)
  1395.  FIVEWORDINLINE(0x2F3C, 0x4, 0x3, 0x7000, 0xA82A);
  1396. extern pascal VideoDigitizerError VDGetDigitizerRect(VideoDigitizerComponent ci, Rect *digitizerRect)
  1397.  FIVEWORDINLINE(0x2F3C, 0x4, 0x4, 0x7000, 0xA82A);
  1398. extern pascal VideoDigitizerError VDGetVBlankRect(VideoDigitizerComponent ci, short inputStd, Rect *vBlankRect)
  1399.  FIVEWORDINLINE(0x2F3C, 0x6, 0x5, 0x7000, 0xA82A);
  1400. extern pascal VideoDigitizerError VDGetMaskPixMap(VideoDigitizerComponent ci, PixMapHandle maskPixMap)
  1401.  FIVEWORDINLINE(0x2F3C, 0x4, 0x6, 0x7000, 0xA82A);
  1402. extern pascal VideoDigitizerError VDGetPlayThruDestination(VideoDigitizerComponent ci, PixMapHandle *dest, Rect *destRect, MatrixRecord *m, RgnHandle *mask)
  1403.  FIVEWORDINLINE(0x2F3C, 0x10, 0x8, 0x7000, 0xA82A);
  1404. extern pascal VideoDigitizerError VDUseThisCLUT(VideoDigitizerComponent ci, CTabHandle colorTableHandle)
  1405.  FIVEWORDINLINE(0x2F3C, 0x4, 0x9, 0x7000, 0xA82A);
  1406. extern pascal VideoDigitizerError VDSetInputGammaValue(VideoDigitizerComponent ci, Fixed channel1, Fixed channel2, Fixed channel3)
  1407.  FIVEWORDINLINE(0x2F3C, 0xC, 0xA, 0x7000, 0xA82A);
  1408. extern pascal VideoDigitizerError VDGetInputGammaValue(VideoDigitizerComponent ci, Fixed *channel1, Fixed *channel2, Fixed *channel3)
  1409.  FIVEWORDINLINE(0x2F3C, 0xC, 0xB, 0x7000, 0xA82A);
  1410. extern pascal VideoDigitizerError VDSetBrightness(VideoDigitizerComponent ci, unsigned short *brightness)
  1411.  FIVEWORDINLINE(0x2F3C, 0x4, 0xC, 0x7000, 0xA82A);
  1412. extern pascal VideoDigitizerError VDGetBrightness(VideoDigitizerComponent ci, unsigned short *brightness)
  1413.  FIVEWORDINLINE(0x2F3C, 0x4, 0xD, 0x7000, 0xA82A);
  1414. extern pascal VideoDigitizerError VDSetContrast(VideoDigitizerComponent ci, unsigned short *contrast)
  1415.  FIVEWORDINLINE(0x2F3C, 0x4, 0xE, 0x7000, 0xA82A);
  1416. extern pascal VideoDigitizerError VDSetHue(VideoDigitizerComponent ci, unsigned short *hue)
  1417.  FIVEWORDINLINE(0x2F3C, 0x4, 0xF, 0x7000, 0xA82A);
  1418. extern pascal VideoDigitizerError VDSetSharpness(VideoDigitizerComponent ci, unsigned short *sharpness)
  1419.  FIVEWORDINLINE(0x2F3C, 0x4, 0x10, 0x7000, 0xA82A);
  1420. extern pascal VideoDigitizerError VDSetSaturation(VideoDigitizerComponent ci, unsigned short *saturation)
  1421.  FIVEWORDINLINE(0x2F3C, 0x4, 0x11, 0x7000, 0xA82A);
  1422. extern pascal VideoDigitizerError VDGetContrast(VideoDigitizerComponent ci, unsigned short *contrast)
  1423.  FIVEWORDINLINE(0x2F3C, 0x4, 0x12, 0x7000, 0xA82A);
  1424. extern pascal VideoDigitizerError VDGetHue(VideoDigitizerComponent ci, unsigned short *hue)
  1425.  FIVEWORDINLINE(0x2F3C, 0x4, 0x13, 0x7000, 0xA82A);
  1426. extern pascal VideoDigitizerError VDGetSharpness(VideoDigitizerComponent ci, unsigned short *sharpness)
  1427.  FIVEWORDINLINE(0x2F3C, 0x4, 0x14, 0x7000, 0xA82A);
  1428. extern pascal VideoDigitizerError VDGetSaturation(VideoDigitizerComponent ci, unsigned short *saturation)
  1429.  FIVEWORDINLINE(0x2F3C, 0x4, 0x15, 0x7000, 0xA82A);
  1430. extern pascal VideoDigitizerError VDGrabOneFrame(VideoDigitizerComponent ci)
  1431.  FIVEWORDINLINE(0x2F3C, 0, 0x16, 0x7000, 0xA82A);
  1432. extern pascal VideoDigitizerError VDGetMaxAuxBuffer(VideoDigitizerComponent ci, PixMapHandle *pm, Rect *r)
  1433.  FIVEWORDINLINE(0x2F3C, 0x8, 0x17, 0x7000, 0xA82A);
  1434. extern pascal VideoDigitizerError VDGetDigitizerInfo(VideoDigitizerComponent ci, DigitizerInfo *info)
  1435.  FIVEWORDINLINE(0x2F3C, 0x4, 0x19, 0x7000, 0xA82A);
  1436. extern pascal VideoDigitizerError VDGetCurrentFlags(VideoDigitizerComponent ci, long *inputCurrentFlag, long *outputCurrentFlag)
  1437.  FIVEWORDINLINE(0x2F3C, 0x8, 0x1A, 0x7000, 0xA82A);
  1438. extern pascal VideoDigitizerError VDSetKeyColor(VideoDigitizerComponent ci, long index)
  1439.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1B, 0x7000, 0xA82A);
  1440. extern pascal VideoDigitizerError VDGetKeyColor(VideoDigitizerComponent ci, long *index)
  1441.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1C, 0x7000, 0xA82A);
  1442. extern pascal VideoDigitizerError VDAddKeyColor(VideoDigitizerComponent ci, long *index)
  1443.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1D, 0x7000, 0xA82A);
  1444. extern pascal VideoDigitizerError VDGetNextKeyColor(VideoDigitizerComponent ci, long index)
  1445.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1E, 0x7000, 0xA82A);
  1446. extern pascal VideoDigitizerError VDSetKeyColorRange(VideoDigitizerComponent ci, RGBColor *minRGB, RGBColor *maxRGB)
  1447.  FIVEWORDINLINE(0x2F3C, 0x8, 0x1F, 0x7000, 0xA82A);
  1448. extern pascal VideoDigitizerError VDGetKeyColorRange(VideoDigitizerComponent ci, RGBColor *minRGB, RGBColor *maxRGB)
  1449.  FIVEWORDINLINE(0x2F3C, 0x8, 0x20, 0x7000, 0xA82A);
  1450. extern pascal VideoDigitizerError VDSetDigitizerUserInterrupt(VideoDigitizerComponent ci, long flags, VdigIntUPP userInterruptProc, long refcon)
  1451.  FIVEWORDINLINE(0x2F3C, 0xC, 0x21, 0x7000, 0xA82A);
  1452. extern pascal VideoDigitizerError VDSetInputColorSpaceMode(VideoDigitizerComponent ci, short colorSpaceMode)
  1453.  FIVEWORDINLINE(0x2F3C, 0x2, 0x22, 0x7000, 0xA82A);
  1454. extern pascal VideoDigitizerError VDGetInputColorSpaceMode(VideoDigitizerComponent ci, short *colorSpaceMode)
  1455.  FIVEWORDINLINE(0x2F3C, 0x4, 0x23, 0x7000, 0xA82A);
  1456. extern pascal VideoDigitizerError VDSetClipState(VideoDigitizerComponent ci, short clipEnable)
  1457.  FIVEWORDINLINE(0x2F3C, 0x2, 0x24, 0x7000, 0xA82A);
  1458. extern pascal VideoDigitizerError VDGetClipState(VideoDigitizerComponent ci, short *clipEnable)
  1459.  FIVEWORDINLINE(0x2F3C, 0x4, 0x25, 0x7000, 0xA82A);
  1460. extern pascal VideoDigitizerError VDSetClipRgn(VideoDigitizerComponent ci, RgnHandle clipRegion)
  1461.  FIVEWORDINLINE(0x2F3C, 0x4, 0x26, 0x7000, 0xA82A);
  1462. extern pascal VideoDigitizerError VDClearClipRgn(VideoDigitizerComponent ci, RgnHandle clipRegion)
  1463.  FIVEWORDINLINE(0x2F3C, 0x4, 0x27, 0x7000, 0xA82A);
  1464. extern pascal VideoDigitizerError VDGetCLUTInUse(VideoDigitizerComponent ci, CTabHandle *colorTableHandle)
  1465.  FIVEWORDINLINE(0x2F3C, 0x4, 0x28, 0x7000, 0xA82A);
  1466. extern pascal VideoDigitizerError VDSetPLLFilterType(VideoDigitizerComponent ci, short pllType)
  1467.  FIVEWORDINLINE(0x2F3C, 0x2, 0x29, 0x7000, 0xA82A);
  1468. extern pascal VideoDigitizerError VDGetPLLFilterType(VideoDigitizerComponent ci, short *pllType)
  1469.  FIVEWORDINLINE(0x2F3C, 0x4, 0x2A, 0x7000, 0xA82A);
  1470. extern pascal VideoDigitizerError VDGetMaskandValue(VideoDigitizerComponent ci, unsigned short blendLevel, long *mask, long *value)
  1471.  FIVEWORDINLINE(0x2F3C, 0xA, 0x2B, 0x7000, 0xA82A);
  1472. extern pascal VideoDigitizerError VDSetMasterBlendLevel(VideoDigitizerComponent ci, unsigned short *blendLevel)
  1473.  FIVEWORDINLINE(0x2F3C, 0x4, 0x2C, 0x7000, 0xA82A);
  1474. extern pascal VideoDigitizerError VDSetPlayThruDestination(VideoDigitizerComponent ci, PixMapHandle dest, Rect *destRect, MatrixRecord *m, RgnHandle mask)
  1475.  FIVEWORDINLINE(0x2F3C, 0x10, 0x2D, 0x7000, 0xA82A);
  1476. extern pascal VideoDigitizerError VDSetPlayThruOnOff(VideoDigitizerComponent ci, short state)
  1477.  FIVEWORDINLINE(0x2F3C, 0x2, 0x2E, 0x7000, 0xA82A);
  1478. extern pascal VideoDigitizerError VDSetFieldPreference(VideoDigitizerComponent ci, short fieldFlag)
  1479.  FIVEWORDINLINE(0x2F3C, 0x2, 0x2F, 0x7000, 0xA82A);
  1480. extern pascal VideoDigitizerError VDGetFieldPreference(VideoDigitizerComponent ci, short *fieldFlag)
  1481.  FIVEWORDINLINE(0x2F3C, 0x4, 0x30, 0x7000, 0xA82A);
  1482. extern pascal VideoDigitizerError VDPreflightDestination(VideoDigitizerComponent ci, Rect *digitizerRect, PixMap **dest, Rect *destRect, MatrixRecord *m)
  1483.  FIVEWORDINLINE(0x2F3C, 0x10, 0x32, 0x7000, 0xA82A);
  1484. extern pascal VideoDigitizerError VDPreflightGlobalRect(VideoDigitizerComponent ci, GrafPtr theWindow, Rect *globalRect)
  1485.  FIVEWORDINLINE(0x2F3C, 0x8, 0x33, 0x7000, 0xA82A);
  1486. extern pascal VideoDigitizerError VDSetPlayThruGlobalRect(VideoDigitizerComponent ci, GrafPtr theWindow, Rect *globalRect)
  1487.  FIVEWORDINLINE(0x2F3C, 0x8, 0x34, 0x7000, 0xA82A);
  1488. extern pascal VideoDigitizerError VDSetInputGammaRecord(VideoDigitizerComponent ci, VDGamRecPtr inputGammaPtr)
  1489.  FIVEWORDINLINE(0x2F3C, 0x4, 0x35, 0x7000, 0xA82A);
  1490. extern pascal VideoDigitizerError VDGetInputGammaRecord(VideoDigitizerComponent ci, VDGamRecPtr *inputGammaPtr)
  1491.  FIVEWORDINLINE(0x2F3C, 0x4, 0x36, 0x7000, 0xA82A);
  1492. extern pascal VideoDigitizerError VDSetBlackLevelValue(VideoDigitizerComponent ci, unsigned short *blackLevel)
  1493.  FIVEWORDINLINE(0x2F3C, 0x4, 0x37, 0x7000, 0xA82A);
  1494. extern pascal VideoDigitizerError VDGetBlackLevelValue(VideoDigitizerComponent ci, unsigned short *blackLevel)
  1495.  FIVEWORDINLINE(0x2F3C, 0x4, 0x38, 0x7000, 0xA82A);
  1496. extern pascal VideoDigitizerError VDSetWhiteLevelValue(VideoDigitizerComponent ci, unsigned short *whiteLevel)
  1497.  FIVEWORDINLINE(0x2F3C, 0x4, 0x39, 0x7000, 0xA82A);
  1498. extern pascal VideoDigitizerError VDGetWhiteLevelValue(VideoDigitizerComponent ci, unsigned short *whiteLevel)
  1499.  FIVEWORDINLINE(0x2F3C, 0x4, 0x3A, 0x7000, 0xA82A);
  1500. extern pascal VideoDigitizerError VDGetVideoDefaults(VideoDigitizerComponent ci, unsigned short *blackLevel, unsigned short *whiteLevel, unsigned short *brightness, unsigned short *hue, unsigned short *saturation, unsigned short *contrast, unsigned short *sharpness)
  1501.  FIVEWORDINLINE(0x2F3C, 0x1C, 0x3B, 0x7000, 0xA82A);
  1502. extern pascal VideoDigitizerError VDGetNumberOfInputs(VideoDigitizerComponent ci, short *inputs)
  1503.  FIVEWORDINLINE(0x2F3C, 0x4, 0x3C, 0x7000, 0xA82A);
  1504. extern pascal VideoDigitizerError VDGetInputFormat(VideoDigitizerComponent ci, short input, short *format)
  1505.  FIVEWORDINLINE(0x2F3C, 0x6, 0x3D, 0x7000, 0xA82A);
  1506. extern pascal VideoDigitizerError VDSetInput(VideoDigitizerComponent ci, short input)
  1507.  FIVEWORDINLINE(0x2F3C, 0x2, 0x3E, 0x7000, 0xA82A);
  1508. extern pascal VideoDigitizerError VDGetInput(VideoDigitizerComponent ci, short *input)
  1509.  FIVEWORDINLINE(0x2F3C, 0x4, 0x3F, 0x7000, 0xA82A);
  1510. extern pascal VideoDigitizerError VDSetInputStandard(VideoDigitizerComponent ci, short inputStandard)
  1511.  FIVEWORDINLINE(0x2F3C, 0x2, 0x40, 0x7000, 0xA82A);
  1512. extern pascal VideoDigitizerError VDSetupBuffers(VideoDigitizerComponent ci, VdigBufferRecListHandle bufferList)
  1513.  FIVEWORDINLINE(0x2F3C, 0x4, 0x41, 0x7000, 0xA82A);
  1514. extern pascal VideoDigitizerError VDGrabOneFrameAsync(VideoDigitizerComponent ci, short buffer)
  1515.  FIVEWORDINLINE(0x2F3C, 0x2, 0x42, 0x7000, 0xA82A);
  1516. extern pascal VideoDigitizerError VDDone(VideoDigitizerComponent ci, short buffer)
  1517.  FIVEWORDINLINE(0x2F3C, 0x2, 0x43, 0x7000, 0xA82A);
  1518. extern pascal VideoDigitizerError VDSetCompression(VideoDigitizerComponent ci, OSType compressType, short depth, Rect *bounds, CodecQ spatialQuality, CodecQ temporalQuality, long keyFrameRate)
  1519.  FIVEWORDINLINE(0x2F3C, 0x16, 0x44, 0x7000, 0xA82A);
  1520. extern pascal VideoDigitizerError VDCompressOneFrameAsync(VideoDigitizerComponent ci)
  1521.  FIVEWORDINLINE(0x2F3C, 0, 0x45, 0x7000, 0xA82A);
  1522. extern pascal VideoDigitizerError VDCompressDone(VideoDigitizerComponent ci, Boolean *done, Ptr *theData, long *dataSize, unsigned char *similarity, TimeRecord *t)
  1523.  FIVEWORDINLINE(0x2F3C, 0x14, 0x46, 0x7000, 0xA82A);
  1524. extern pascal VideoDigitizerError VDReleaseCompressBuffer(VideoDigitizerComponent ci, Ptr bufferAddr)
  1525.  FIVEWORDINLINE(0x2F3C, 0x4, 0x47, 0x7000, 0xA82A);
  1526. extern pascal VideoDigitizerError VDGetImageDescription(VideoDigitizerComponent ci, ImageDescriptionHandle desc)
  1527.  FIVEWORDINLINE(0x2F3C, 0x4, 0x48, 0x7000, 0xA82A);
  1528. extern pascal VideoDigitizerError VDResetCompressSequence(VideoDigitizerComponent ci)
  1529.  FIVEWORDINLINE(0x2F3C, 0, 0x49, 0x7000, 0xA82A);
  1530. extern pascal VideoDigitizerError VDSetCompressionOnOff(VideoDigitizerComponent ci, Boolean state)
  1531.  FIVEWORDINLINE(0x2F3C, 0x2, 0x4A, 0x7000, 0xA82A);
  1532. extern pascal VideoDigitizerError VDGetCompressionTypes(VideoDigitizerComponent ci, VDCompressionListHandle h)
  1533.  FIVEWORDINLINE(0x2F3C, 0x4, 0x4B, 0x7000, 0xA82A);
  1534. extern pascal VideoDigitizerError VDSetTimeBase(VideoDigitizerComponent ci, TimeBase t)
  1535.  FIVEWORDINLINE(0x2F3C, 0x4, 0x4C, 0x7000, 0xA82A);
  1536. extern pascal VideoDigitizerError VDSetFrameRate(VideoDigitizerComponent ci, Fixed framesPerSecond)
  1537.  FIVEWORDINLINE(0x2F3C, 0x4, 0x4D, 0x7000, 0xA82A);
  1538. extern pascal VideoDigitizerError VDGetDataRate(VideoDigitizerComponent ci, long *milliSecPerFrame, Fixed *framesPerSecond, long *bytesPerSecond)
  1539.  FIVEWORDINLINE(0x2F3C, 0xC, 0x4E, 0x7000, 0xA82A);
  1540. extern pascal VideoDigitizerError VDGetSoundInputDriver(VideoDigitizerComponent ci, Str255 soundDriverName)
  1541.  FIVEWORDINLINE(0x2F3C, 0x4, 0x4F, 0x7000, 0xA82A);
  1542. extern pascal VideoDigitizerError VDGetDMADepths(VideoDigitizerComponent ci, long *depthArray, long *preferredDepth)
  1543.  FIVEWORDINLINE(0x2F3C, 0x8, 0x50, 0x7000, 0xA82A);
  1544. extern pascal VideoDigitizerError VDGetPreferredTimeScale(VideoDigitizerComponent ci, TimeScale *preferred)
  1545.  FIVEWORDINLINE(0x2F3C, 0x4, 0x51, 0x7000, 0xA82A);
  1546. extern pascal VideoDigitizerError VDReleaseAsyncBuffers(VideoDigitizerComponent ci)
  1547.  FIVEWORDINLINE(0x2F3C, 0, 0x52, 0x7000, 0xA82A);
  1548. extern pascal VideoDigitizerError VDSetDataRate(VideoDigitizerComponent ci, long bytesPerSecond)
  1549.  FIVEWORDINLINE(0x2F3C, 0x4, 0x54, 0x7000, 0xA82A);
  1550. #ifdef __cplusplus
  1551. }
  1552. #endif
  1553.  
  1554. enum  {
  1555.     kSelectVDGetMaxSrcRect        = 0x1,
  1556.     kSelectVDGetActiveSrcRect    = 0x2,
  1557.     kSelectVDSetDigitizerRect    = 0x3,
  1558.     kSelectVDGetDigitizerRect    = 0x4,
  1559.     kSelectVDGetVBlankRect        = 0x5,
  1560.     kSelectVDGetMaskPixMap        = 0x6,
  1561.     kSelectVDGetPlayThruDestination = 0x8,
  1562.     kSelectVDUseThisCLUT        = 0x9,
  1563.     kSelectVDSetInputGammaValue    = 0xA,
  1564.     kSelectVDGetInputGammaValue    = 0xB,
  1565.     kSelectVDSetBrightness        = 0xC,
  1566.     kSelectVDGetBrightness        = 0xD,
  1567.     kSelectVDSetContrast        = 0xE,
  1568.     kSelectVDSetHue                = 0xF,
  1569.     kSelectVDSetSharpness        = 0x10,
  1570.     kSelectVDSetSaturation        = 0x11,
  1571.     kSelectVDGetContrast        = 0x12,
  1572.     kSelectVDGetHue                = 0x13,
  1573.     kSelectVDGetSharpness        = 0x14,
  1574.     kSelectVDGetSaturation        = 0x15,
  1575.     kSelectVDGrabOneFrame        = 0x16,
  1576.     kSelectVDGetMaxAuxBuffer    = 0x17,
  1577.     kSelectVDGetDigitizerInfo    = 0x19,
  1578.     kSelectVDGetCurrentFlags    = 0x1A,
  1579.     kSelectVDSetKeyColor        = 0x1B,
  1580.     kSelectVDGetKeyColor        = 0x1C,
  1581.     kSelectVDAddKeyColor        = 0x1D,
  1582.     kSelectVDGetNextKeyColor    = 0x1E,
  1583.     kSelectVDSetKeyColorRange    = 0x1F,
  1584.     kSelectVDGetKeyColorRange    = 0x20,
  1585.     kSelectVDSetDigitizerUserInterrupt = 0x21,
  1586.     kSelectVDSetInputColorSpaceMode = 0x22,
  1587.     kSelectVDGetInputColorSpaceMode = 0x23,
  1588.     kSelectVDSetClipState        = 0x24,
  1589.     kSelectVDGetClipState        = 0x25,
  1590.     kSelectVDSetClipRgn            = 0x26,
  1591.     kSelectVDClearClipRgn        = 0x27,
  1592.     kSelectVDGetCLUTInUse        = 0x28,
  1593.     kSelectVDSetPLLFilterType    = 0x29,
  1594.     kSelectVDGetPLLFilterType    = 0x2A,
  1595.     kSelectVDGetMaskandValue    = 0x2B,
  1596.     kSelectVDSetMasterBlendLevel = 0x2C,
  1597.     kSelectVDSetPlayThruDestination = 0x2D,
  1598.     kSelectVDSetPlayThruOnOff    = 0x2E,
  1599.     kSelectVDSetFieldPreference    = 0x2F,
  1600.     kSelectVDGetFieldPreference    = 0x30,
  1601.     kSelectVDPreflightDestination = 0x32,
  1602.     kSelectVDPreflightGlobalRect = 0x33,
  1603.     kSelectVDSetPlayThruGlobalRect = 0x34,
  1604.     kSelectVDSetInputGammaRecord = 0x35,
  1605.     kSelectVDGetInputGammaRecord = 0x36,
  1606.     kSelectVDSetBlackLevelValue    = 0x37,
  1607.     kSelectVDGetBlackLevelValue    = 0x38,
  1608.     kSelectVDSetWhiteLevelValue    = 0x39,
  1609.     kSelectVDGetWhiteLevelValue    = 0x3A,
  1610.     kSelectVDGetVideoDefaults    = 0x3B,
  1611.     kSelectVDGetNumberOfInputs    = 0x3C,
  1612.     kSelectVDGetInputFormat        = 0x3D,
  1613.     kSelectVDSetInput            = 0x3E,
  1614.     kSelectVDGetInput            = 0x3F,
  1615.     kSelectVDSetInputStandard    = 0x40,
  1616.     kSelectVDSetupBuffers        = 0x41,
  1617.     kSelectVDGrabOneFrameAsync    = 0x42,
  1618.     kSelectVDDone                = 0x43,
  1619.     kSelectVDSetCompression        = 0x44,
  1620.     kSelectVDCompressOneFrameAsync = 0x45,
  1621.     kSelectVDCompressDone        = 0x46,
  1622.     kSelectVDReleaseCompressBuffer = 0x47,
  1623.     kSelectVDGetImageDescription = 0x48,
  1624.     kSelectVDResetCompressSequence = 0x49,
  1625.     kSelectVDSetCompressionOnOff = 0x4A,
  1626.     kSelectVDGetCompressionTypes = 0x4B,
  1627.     kSelectVDSetTimeBase        = 0x4C,
  1628.     kSelectVDSetFrameRate        = 0x4D,
  1629.     kSelectVDGetDataRate        = 0x4E,
  1630.     kSelectVDGetSoundInputDriver = 0x4F,
  1631.     kSelectVDGetDMADepths        = 0x50,
  1632.     kSelectVDGetPreferredTimeScale = 0x51,
  1633.     kSelectVDReleaseAsyncBuffers = 0x52,
  1634.     kSelectVDSetDataRate        = 0x54
  1635. };
  1636.  
  1637. #define StandardCompressionType 'scdi'
  1638.  
  1639. #define StandardCompressionSubType 'imag'
  1640.  
  1641. typedef pascal Boolean (*SCModalFilterProcPtr)(DialogPtr theDialog, EventRecord *theEvent, short *itemHit, long refcon);
  1642.  
  1643. enum {
  1644.     uppSCModalFilterProcInfo = kPascalStackBased
  1645.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  1646.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DialogPtr)))
  1647.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(EventRecord*)))
  1648.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short*)))
  1649.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  1650. };
  1651.  
  1652. #if USESROUTINEDESCRIPTORS
  1653. typedef UniversalProcPtr SCModalFilterUPP;
  1654.  
  1655. #define CallSCModalFilterProc(userRoutine, theDialog, theEvent, itemHit, refcon)        \
  1656.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSCModalFilterProcInfo, (theDialog), (theEvent), (itemHit), (refcon))
  1657. #define NewSCModalFilterProc(userRoutine)        \
  1658.         (SCModalFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSCModalFilterProcInfo, GetCurrentISA())
  1659. #else
  1660. typedef SCModalFilterProcPtr SCModalFilterUPP;
  1661.  
  1662. #define CallSCModalFilterProc(userRoutine, theDialog, theEvent, itemHit, refcon)        \
  1663.         (*(userRoutine))((theDialog), (theEvent), (itemHit), (refcon))
  1664. #define NewSCModalFilterProc(userRoutine)        \
  1665.         (SCModalFilterUPP)(userRoutine)
  1666. #endif
  1667.  
  1668. typedef pascal short (*SCModalHookProcPtr)(DialogPtr theDialog, short itemHit, void *params, long refcon);
  1669.  
  1670. enum {
  1671.     uppSCModalHookProcInfo = kPascalStackBased
  1672.          | RESULT_SIZE(SIZE_CODE(sizeof(short)))
  1673.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DialogPtr)))
  1674.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  1675.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void*)))
  1676.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  1677. };
  1678.  
  1679. #if USESROUTINEDESCRIPTORS
  1680. typedef UniversalProcPtr SCModalHookUPP;
  1681.  
  1682. #define CallSCModalHookProc(userRoutine, theDialog, itemHit, params, refcon)        \
  1683.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSCModalHookProcInfo, (theDialog), (itemHit), (params), (refcon))
  1684. #define NewSCModalHookProc(userRoutine)        \
  1685.         (SCModalHookUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSCModalHookProcInfo, GetCurrentISA())
  1686. #else
  1687. typedef SCModalHookProcPtr SCModalHookUPP;
  1688.  
  1689. #define CallSCModalHookProc(userRoutine, theDialog, itemHit, params, refcon)        \
  1690.         (*(userRoutine))((theDialog), (itemHit), (params), (refcon))
  1691. #define NewSCModalHookProc(userRoutine)        \
  1692.         (SCModalHookUPP)(userRoutine)
  1693. #endif
  1694.  
  1695. #define scListEveryCodec (1L<<1)
  1696.  
  1697. #define scAllowZeroFrameRate (1L<<2)
  1698.  
  1699. #define scAllowZeroKeyFrameRate (1L<<3)
  1700.  
  1701. #define scShowBestDepth (1L<<4)
  1702.  
  1703. #define scUseMovableModal (1L<<5)
  1704.  
  1705. #define scPreferCropping (1<<0)
  1706.  
  1707. #define scPreferScaling (1<<1)
  1708.  
  1709. #define scPreferScalingAndCropping (scPreferScaling + scPreferCropping)
  1710.  
  1711. #define scTestImageWidth 80
  1712.  
  1713. #define scTestImageHeight 80
  1714.  
  1715. #define scOKItem 1
  1716.  
  1717. #define scCancelItem 2
  1718.  
  1719. #define scCustomItem 3
  1720.  
  1721. #define scUserCancelled 1
  1722.  
  1723. #define scPositionRect 2
  1724.  
  1725. #define scPositionDialog 3
  1726.  
  1727. #define scSetTestImagePictHandle 4
  1728.  
  1729. #define scSetTestImagePictFile 5
  1730.  
  1731. #define scSetTestImagePixMap 6
  1732.  
  1733. #define scGetBestDeviceRect 7
  1734.  
  1735. #define scRequestImageSettings 10
  1736.  
  1737. #define scCompressImage 11
  1738.  
  1739. #define scCompressPicture 12
  1740.  
  1741. #define scCompressPictureFile 13
  1742.  
  1743. #define scRequestSequenceSettings 14
  1744.  
  1745. #define scCompressSequenceBegin 15
  1746.  
  1747. #define scCompressSequenceFrame 16
  1748.  
  1749. #define scCompressSequenceEnd 17
  1750.  
  1751. #define scDefaultPictHandleSettings 18
  1752.  
  1753. #define scDefaultPictFileSettings 19
  1754.  
  1755. #define scDefaultPixMapSettings 20
  1756.  
  1757. #define scGetInfo 21
  1758.  
  1759. #define scSetInfo 22
  1760.  
  1761. #define scNewGWorld 23
  1762.  
  1763. #if defined(powerc) || defined (__powerc)
  1764. #pragma options align=mac68k
  1765. #endif
  1766. struct SCSpatialSettings {
  1767.     CodecType                    codecType;
  1768.     CodecComponent                codec;
  1769.     short                        depth;
  1770.     CodecQ                        spatialQuality;
  1771. };
  1772. #if defined(powerc) || defined(__powerc)
  1773. #pragma options align=reset
  1774. #endif
  1775.  
  1776. typedef struct SCSpatialSettings SCSpatialSettings;
  1777.  
  1778. #if defined(powerc) || defined (__powerc)
  1779. #pragma options align=mac68k
  1780. #endif
  1781. struct SCTemporalSettings {
  1782.     CodecQ                        temporalQuality;
  1783.     Fixed                        frameRate;
  1784.     long                        keyFrameRate;
  1785. };
  1786. #if defined(powerc) || defined(__powerc)
  1787. #pragma options align=reset
  1788. #endif
  1789.  
  1790. typedef struct SCTemporalSettings SCTemporalSettings;
  1791.  
  1792. #if defined(powerc) || defined (__powerc)
  1793. #pragma options align=mac68k
  1794. #endif
  1795. struct SCDataRateSettings {
  1796.     long                        dataRate;
  1797.     long                        frameDuration;
  1798.     CodecQ                        minSpatialQuality;
  1799.     CodecQ                        minTemporalQuality;
  1800. };
  1801. #if defined(powerc) || defined(__powerc)
  1802. #pragma options align=reset
  1803. #endif
  1804.  
  1805. typedef struct SCDataRateSettings SCDataRateSettings;
  1806.  
  1807. #if defined(powerc) || defined (__powerc)
  1808. #pragma options align=mac68k
  1809. #endif
  1810. struct SCExtendedProcs {
  1811.     SCModalFilterUPP            filterProc;
  1812.     SCModalHookUPP                hookProc;
  1813.     long                        refcon;
  1814.     Str31                        customName;
  1815. };
  1816. #if defined(powerc) || defined(__powerc)
  1817. #pragma options align=reset
  1818. #endif
  1819.  
  1820. typedef struct SCExtendedProcs SCExtendedProcs;
  1821.  
  1822. #define scSpatialSettingsType 'sptl'
  1823.  
  1824. #define scTemporalSettingsType 'tprl'
  1825.  
  1826. #define scDataRateSettingsType 'drat'
  1827.  
  1828. #define scColorTableType 'clut'
  1829.  
  1830. #define scProgressProcType 'prog'
  1831.  
  1832. #define scExtendedProcsType 'xprc'
  1833.  
  1834. #define scPreferenceFlagsType 'pref'
  1835.  
  1836. #define scSettingsStateType 'ssta'
  1837.  
  1838. #define scSequenceIDType 'sequ'
  1839.  
  1840. #define scWindowPositionType 'wndw'
  1841.  
  1842. #define scCodecFlagsType 'cflg'
  1843.  
  1844. #define scCodecSettingsType 'cdec'
  1845.  
  1846. #define scForceKeyValueType 'ksim'
  1847.  
  1848. #ifdef __cplusplus
  1849. extern "C" {
  1850. #endif
  1851.  
  1852. extern pascal ComponentResult SCPositionRect(ComponentInstance ci, Rect *rp, Point *where)
  1853.  FIVEWORDINLINE(0x2F3C, 0x8, 0x2, 0x7000, 0xA82A);
  1854. extern pascal ComponentResult SCPositionDialog(ComponentInstance ci, short id, Point *where)
  1855.  FIVEWORDINLINE(0x2F3C, 0x6, 0x3, 0x7000, 0xA82A);
  1856. extern pascal ComponentResult SCSetTestImagePictHandle(ComponentInstance ci, PicHandle testPict, Rect *testRect, short testFlags)
  1857.  FIVEWORDINLINE(0x2F3C, 0xA, 0x4, 0x7000, 0xA82A);
  1858. extern pascal ComponentResult SCSetTestImagePictFile(ComponentInstance ci, short testFileRef, Rect *testRect, short testFlags)
  1859.  FIVEWORDINLINE(0x2F3C, 0x8, 0x5, 0x7000, 0xA82A);
  1860. extern pascal ComponentResult SCSetTestImagePixMap(ComponentInstance ci, PixMapHandle testPixMap, Rect *testRect, short testFlags)
  1861.  FIVEWORDINLINE(0x2F3C, 0xA, 0x6, 0x7000, 0xA82A);
  1862. extern pascal ComponentResult SCGetBestDeviceRect(ComponentInstance ci, Rect *r)
  1863.  FIVEWORDINLINE(0x2F3C, 0x4, 0x7, 0x7000, 0xA82A);
  1864. extern pascal ComponentResult SCRequestImageSettings(ComponentInstance ci)
  1865.  FIVEWORDINLINE(0x2F3C, 0, 0xA, 0x7000, 0xA82A);
  1866. extern pascal ComponentResult SCCompressImage(ComponentInstance ci, PixMapHandle src, Rect *srcRect, ImageDescriptionHandle *desc, Handle *data)
  1867.  FIVEWORDINLINE(0x2F3C, 0x10, 0xB, 0x7000, 0xA82A);
  1868. extern pascal ComponentResult SCCompressPicture(ComponentInstance ci, PicHandle srcPicture, PicHandle dstPicture)
  1869.  FIVEWORDINLINE(0x2F3C, 0x8, 0xC, 0x7000, 0xA82A);
  1870. extern pascal ComponentResult SCCompressPictureFile(ComponentInstance ci, short srcRefNum, short dstRefNum)
  1871.  FIVEWORDINLINE(0x2F3C, 0x4, 0xD, 0x7000, 0xA82A);
  1872. extern pascal ComponentResult SCRequestSequenceSettings(ComponentInstance ci)
  1873.  FIVEWORDINLINE(0x2F3C, 0, 0xE, 0x7000, 0xA82A);
  1874. extern pascal ComponentResult SCCompressSequenceBegin(ComponentInstance ci, PixMapHandle src, Rect *srcRect, ImageDescriptionHandle *desc)
  1875.  FIVEWORDINLINE(0x2F3C, 0xC, 0xF, 0x7000, 0xA82A);
  1876. extern pascal ComponentResult SCCompressSequenceFrame(ComponentInstance ci, PixMapHandle src, Rect *srcRect, Handle *data, long *dataSize, short *notSyncFlag)
  1877.  FIVEWORDINLINE(0x2F3C, 0x14, 0x10, 0x7000, 0xA82A);
  1878. extern pascal ComponentResult SCCompressSequenceEnd(ComponentInstance ci)
  1879.  FIVEWORDINLINE(0x2F3C, 0, 0x11, 0x7000, 0xA82A);
  1880. extern pascal ComponentResult SCDefaultPictHandleSettings(ComponentInstance ci, PicHandle srcPicture, short motion)
  1881.  FIVEWORDINLINE(0x2F3C, 0x6, 0x12, 0x7000, 0xA82A);
  1882. extern pascal ComponentResult SCDefaultPictFileSettings(ComponentInstance ci, short srcRef, short motion)
  1883.  FIVEWORDINLINE(0x2F3C, 0x4, 0x13, 0x7000, 0xA82A);
  1884. extern pascal ComponentResult SCDefaultPixMapSettings(ComponentInstance ci, PixMapHandle src, short motion)
  1885.  FIVEWORDINLINE(0x2F3C, 0x6, 0x14, 0x7000, 0xA82A);
  1886. extern pascal ComponentResult SCGetInfo(ComponentInstance ci, OSType type, void *info)
  1887.  FIVEWORDINLINE(0x2F3C, 0x8, 0x15, 0x7000, 0xA82A);
  1888. extern pascal ComponentResult SCSetInfo(ComponentInstance ci, OSType type, void *info)
  1889.  FIVEWORDINLINE(0x2F3C, 0x8, 0x16, 0x7000, 0xA82A);
  1890. extern pascal ComponentResult SCNewGWorld(ComponentInstance ci, GWorldPtr *gwp, Rect *rp, GWorldFlags flags)
  1891.  FIVEWORDINLINE(0x2F3C, 0xC, 0x17, 0x7000, 0xA82A);
  1892. extern pascal ComponentResult SCSetCompressFlags(ComponentInstance ci, long flags)
  1893.  FIVEWORDINLINE(0x2F3C, 0x4, 0x18, 0x7000, 0xA82A);
  1894. extern pascal ComponentResult SCGetCompressFlags(ComponentInstance ci, long *flags)
  1895.  FIVEWORDINLINE(0x2F3C, 0x4, 0x19, 0x7000, 0xA82A);
  1896. #ifdef __cplusplus
  1897. }
  1898. #endif
  1899.  
  1900. #if defined(powerc) || defined (__powerc)
  1901. #pragma options align=mac68k
  1902. #endif
  1903. struct SCParams {
  1904.     long                        flags;
  1905.     CodecType                    theCodecType;
  1906.     CodecComponent                theCodec;
  1907.     CodecQ                        spatialQuality;
  1908.     CodecQ                        temporalQuality;
  1909.     short                        depth;
  1910.     Fixed                        frameRate;
  1911.     long                        keyFrameRate;
  1912.     long                        reserved1;
  1913.     long                        reserved2;
  1914. };
  1915. #if defined(powerc) || defined(__powerc)
  1916. #pragma options align=reset
  1917. #endif
  1918.  
  1919. typedef struct SCParams SCParams;
  1920.  
  1921. #define scGetCompression 1
  1922.  
  1923. #define scShowMotionSettings (1L<<0)
  1924.  
  1925. #define scSettingsChangedItem -1
  1926.  
  1927. #define scCompressFlagIgnoreIdenticalFrames 1
  1928.  
  1929. #ifdef __cplusplus
  1930. extern "C" {
  1931. #endif
  1932.  
  1933. extern pascal ComponentResult SCGetCompressionExtended(ComponentInstance ci, SCParams *params, Point where, SCModalFilterUPP filterProc, SCModalHookUPP hookProc, long refcon, StringPtr customName)
  1934.  FIVEWORDINLINE(0x2F3C, 0x18, 0x1, 0x7000, 0xA82A);
  1935. #define SCGetCompression(ci, params, where) SCGetCompressionExtended(ci,params,where,0,0,0,0)
  1936.  
  1937. #ifdef __cplusplus
  1938. }
  1939. #endif
  1940.  
  1941. typedef ComponentInstance MovieImportComponent, MovieExportComponent;
  1942.  
  1943. #define MovieImportType 'eat '
  1944.  
  1945. #define MovieExportType 'spit'
  1946.  
  1947. enum  {
  1948.     canMovieImportHandles        = 1 << 0,
  1949.     canMovieImportFiles            = 1 << 1,
  1950.     hasMovieImportUserInterface    = 1 << 2,
  1951.     canMovieExportHandles        = 1 << 3,
  1952.     canMovieExportFiles            = 1 << 4,
  1953.     hasMovieExportUserInterface    = 1 << 5,
  1954.     dontAutoFileMovieImport        = 1 << 6,
  1955.     canMovieExportAuxDataHandle    = 1 << 7,
  1956.     canMovieImportValidateHandles = 1 << 8,
  1957.     canMovieImportValidateFile    = 1 << 9,
  1958.     dontRegisterWithEasyOpen    = 1 << 10,
  1959.     canMovieImportInPlace        = 1 << 11,
  1960.     movieImportSubTypeIsFileExtension = 1 << 12
  1961. };
  1962.  
  1963. enum  {
  1964.     kMovieImportExportOpenSelect = kComponentOpenSelect,
  1965.     kMovieImportExportCloseSelect = kComponentCloseSelect,
  1966.     kMovieImportExportCanDoSelect = kComponentCanDoSelect,
  1967.     kMovieImportExportVersionSelect = kComponentVersionSelect,
  1968.     kMovieImportHandleSelect    = 1,
  1969.     kMovieImportFileSelect        = 2,
  1970.     kMovieImportSetSampleDurationSelect = 3,
  1971.     kMovieImportSetSampleDescriptionSelect = 4,
  1972.     kMovieImportSetMediaFileSelect = 5,
  1973.     kMovieImportSetDimensionsSelect = 6,
  1974.     kMovieImportSetChunkSizeSelect = 7,
  1975.     kMovieImportSetProgressProcSelect = 8,
  1976.     kMovieImportSetAuxiliaryDataSelect = 9,
  1977.     kMovieImportSetFromScrapSelect = 10,
  1978.     kMovieImportDoUserDialogSelect = 11,
  1979.     kMovieImportSetDurationSelect = 12,
  1980.     kMovieImportGetAuxiliaryDataTypeSelect = 13,
  1981.     kMovieImportValidateSelect    = 14,
  1982.     kMovieImportGetFileTypeSelect = 15,
  1983.     kMovieExportToHandleSelect    = 128,
  1984.     kMovieExportToFileSelect    = 129,
  1985.     kMovieExportDoUserDialogSelect = 130,
  1986.     kMovieExportGetAuxiliaryDataSelect = 131,
  1987.     kMovieExportSetProgressProcSelect = 132,
  1988.     kMovieExportSetSampleDescriptionSelect = 133
  1989. };
  1990.  
  1991. enum  {
  1992.     movieImportCreateTrack        = 1,
  1993.     movieImportInParallel        = 2,
  1994.     movieImportMustUseTrack        = 4
  1995. };
  1996.  
  1997. enum  {
  1998.     movieImportResultUsedMultipleTracks = 8
  1999. };
  2000.  
  2001. #ifdef __cplusplus
  2002. extern "C" {
  2003. #endif
  2004.  
  2005. extern pascal ComponentResult MovieImportHandle(MovieImportComponent ci, Handle dataH, Movie theMovie, Track targetTrack, Track *usedTrack, TimeValue atTime, TimeValue *addedDuration, long inFlags, long *outFlags)
  2006.  FIVEWORDINLINE(0x2F3C, 0x20, 0x1, 0x7000, 0xA82A);
  2007. extern pascal ComponentResult MovieImportFile(MovieImportComponent ci, const FSSpec *theFile, Movie theMovie, Track targetTrack, Track *usedTrack, TimeValue atTime, TimeValue *addedDuration, long inFlags, long *outFlags)
  2008.  FIVEWORDINLINE(0x2F3C, 0x20, 0x2, 0x7000, 0xA82A);
  2009. extern pascal ComponentResult MovieImportSetSampleDuration(MovieImportComponent ci, TimeValue duration, TimeScale scale)
  2010.  FIVEWORDINLINE(0x2F3C, 0x8, 0x3, 0x7000, 0xA82A);
  2011. extern pascal ComponentResult MovieImportSetSampleDescription(MovieImportComponent ci, SampleDescriptionHandle desc, OSType mediaType)
  2012.  FIVEWORDINLINE(0x2F3C, 0x8, 0x4, 0x7000, 0xA82A);
  2013. extern pascal ComponentResult MovieImportSetMediaFile(MovieImportComponent ci, AliasHandle alias)
  2014.  FIVEWORDINLINE(0x2F3C, 0x4, 0x5, 0x7000, 0xA82A);
  2015. extern pascal ComponentResult MovieImportSetDimensions(MovieImportComponent ci, Fixed width, Fixed height)
  2016.  FIVEWORDINLINE(0x2F3C, 0x8, 0x6, 0x7000, 0xA82A);
  2017. extern pascal ComponentResult MovieImportSetChunkSize(MovieImportComponent ci, long chunkSize)
  2018.  FIVEWORDINLINE(0x2F3C, 0x4, 0x7, 0x7000, 0xA82A);
  2019. extern pascal ComponentResult MovieImportSetProgressProc(MovieImportComponent ci, MovieProgressUPP proc, long refcon)
  2020.  FIVEWORDINLINE(0x2F3C, 0x8, 0x8, 0x7000, 0xA82A);
  2021. extern pascal ComponentResult MovieImportSetAuxiliaryData(MovieImportComponent ci, Handle data, OSType handleType)
  2022.  FIVEWORDINLINE(0x2F3C, 0x8, 0x9, 0x7000, 0xA82A);
  2023. extern pascal ComponentResult MovieImportSetFromScrap(MovieImportComponent ci, Boolean fromScrap)
  2024.  FIVEWORDINLINE(0x2F3C, 0x2, 0xA, 0x7000, 0xA82A);
  2025. extern pascal ComponentResult MovieImportDoUserDialog(MovieImportComponent ci, const FSSpec *theFile, Handle theData, Boolean *canceled)
  2026.  FIVEWORDINLINE(0x2F3C, 0xC, 0xB, 0x7000, 0xA82A);
  2027. extern pascal ComponentResult MovieImportSetDuration(MovieImportComponent ci, TimeValue duration)
  2028.  FIVEWORDINLINE(0x2F3C, 0x4, 0xC, 0x7000, 0xA82A);
  2029. extern pascal ComponentResult MovieImportGetAuxiliaryDataType(MovieImportComponent ci, OSType *auxType)
  2030.  FIVEWORDINLINE(0x2F3C, 0x4, 0xD, 0x7000, 0xA82A);
  2031. extern pascal ComponentResult MovieImportValidate(MovieImportComponent ci, const FSSpec *theFile, Handle theData, Boolean *valid)
  2032.  FIVEWORDINLINE(0x2F3C, 0xC, 0xE, 0x7000, 0xA82A);
  2033. extern pascal ComponentResult MovieImportGetFileType(MovieImportComponent ci, OSType *fileType)
  2034.  FIVEWORDINLINE(0x2F3C, 0x4, 0xF, 0x7000, 0xA82A);
  2035. extern pascal ComponentResult MovieExportToHandle(MovieExportComponent ci, Handle dataH, Movie theMovie, Track onlyThisTrack, TimeValue startTime, TimeValue duration)
  2036.  FIVEWORDINLINE(0x2F3C, 0x14, 0x80, 0x7000, 0xA82A);
  2037. extern pascal ComponentResult MovieExportToFile(MovieExportComponent ci, const FSSpec *theFile, Movie theMovie, Track onlyThisTrack, TimeValue startTime, TimeValue duration)
  2038.  FIVEWORDINLINE(0x2F3C, 0x14, 0x81, 0x7000, 0xA82A);
  2039. extern pascal ComponentResult MovieExportDoUserDialog(MovieExportComponent ci, Movie theMovie, Track onlyThisTrack, TimeValue startTime, TimeValue duration, Boolean *canceled)
  2040.  FIVEWORDINLINE(0x2F3C, 0x14, 0x82, 0x7000, 0xA82A);
  2041. extern pascal ComponentResult MovieExportGetAuxiliaryData(MovieExportComponent ci, Handle dataH, OSType *handleType)
  2042.  FIVEWORDINLINE(0x2F3C, 0x8, 0x83, 0x7000, 0xA82A);
  2043. extern pascal ComponentResult MovieExportSetProgressProc(MovieExportComponent ci, MovieProgressUPP proc, long refcon)
  2044.  FIVEWORDINLINE(0x2F3C, 0x8, 0x84, 0x7000, 0xA82A);
  2045. extern pascal ComponentResult MovieExportSetSampleDescription(MovieExportComponent ci, SampleDescriptionHandle desc, OSType mediaType)
  2046.  FIVEWORDINLINE(0x2F3C, 0x8, 0x85, 0x7000, 0xA82A);
  2047. extern pascal ComponentResult MovieExportGetCreatorType(MovieExportComponent ci, OSType *creator)
  2048.  FIVEWORDINLINE(0x2F3C, 0x4, 0x86, 0x7000, 0xA82A);
  2049. #if defined(powerc) || defined (__powerc)
  2050. #pragma options align=mac68k
  2051. #endif
  2052. struct TextDisplayData {
  2053.     long                        displayFlags;
  2054.     long                        textJustification;
  2055.     RGBColor                    bgColor;
  2056.     Rect                        textBox;
  2057.     short                        beginHilite;
  2058.     short                        endHilite;
  2059.     RGBColor                    hiliteColor;
  2060.     Boolean                        doHiliteColor;
  2061.     TimeValue                    scrollDelayDur;
  2062.     Point                        dropShadowOffset;
  2063.     short                        dropShadowTransparency;
  2064. };
  2065. #if defined(powerc) || defined(__powerc)
  2066. #pragma options align=reset
  2067. #endif
  2068.  
  2069. typedef struct TextDisplayData TextDisplayData;
  2070.  
  2071. typedef ComponentInstance TextExportComponent;
  2072.  
  2073. extern pascal ComponentResult TextExportGetDisplayData(TextExportComponent ci, TextDisplayData *textDisplay)
  2074.  FIVEWORDINLINE(0x2F3C, 0x4, 0x100, 0x7000, 0xA82A);
  2075. #ifdef __cplusplus
  2076. }
  2077. #endif
  2078.  
  2079. typedef ComponentInstance pnotComponent;
  2080.  
  2081. enum  {
  2082.     pnotComponentWantsEvents    = 1,
  2083.     pnotComponentNeedsNoCache    = 2
  2084. };
  2085.  
  2086. enum  {
  2087.     kPreviewOpenSelector        = 0,
  2088.     kPreviewCloseSelector        = -1,
  2089.     kPreviewCanDoSelector        = -2,
  2090.     kPreviewVersionSelector        = -3,
  2091.     kPreviewShowDataSelector    = 1,
  2092.     kPreviewMakePreviewSelector    = 2,
  2093.     kPreviewMakePreviewReferenceSelector = 3,
  2094.     kPreviewEventSelector        = 4
  2095. };
  2096.  
  2097. #define ShowFilePreviewComponentType 'pnot'
  2098.  
  2099. #define CreateFilePreviewComponentType 'pmak'
  2100.  
  2101. #ifdef __cplusplus
  2102. extern "C" {
  2103. #endif
  2104.  
  2105. extern pascal ComponentResult PreviewShowData(pnotComponent p, OSType dataType, Handle data, const Rect *inHere)
  2106.  FIVEWORDINLINE(0x2F3C, 0xC, 0x1, 0x7000, 0xA82A);
  2107. extern pascal ComponentResult PreviewMakePreview(pnotComponent p, OSType *previewType, Handle *previewResult, const FSSpec *sourceFile, ICMProgressProcRecordPtr progress)
  2108.  FIVEWORDINLINE(0x2F3C, 0x10, 0x2, 0x7000, 0xA82A);
  2109. extern pascal ComponentResult PreviewMakePreviewReference(pnotComponent p, OSType *previewType, short *resID, const FSSpec *sourceFile)
  2110.  FIVEWORDINLINE(0x2F3C, 0xC, 0x3, 0x7000, 0xA82A);
  2111. extern pascal ComponentResult PreviewEvent(pnotComponent p, EventRecord *e, Boolean *handledEvent)
  2112.  FIVEWORDINLINE(0x2F3C, 0x8, 0x4, 0x7000, 0xA82A);
  2113. #ifdef __cplusplus
  2114. }
  2115. #endif
  2116.  
  2117. typedef pascal void (*DataHCompletionProcPtr)(Ptr request, long refcon, OSErr err);
  2118.  
  2119. enum {
  2120.     uppDataHCompletionProcInfo = kPascalStackBased
  2121.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
  2122.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  2123.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(OSErr)))
  2124. };
  2125.  
  2126. #if USESROUTINEDESCRIPTORS
  2127. typedef UniversalProcPtr DataHCompletionUPP;
  2128.  
  2129. #define CallDataHCompletionProc(userRoutine, request, refcon, err)        \
  2130.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDataHCompletionProcInfo, (request), (refcon), (err))
  2131. #define NewDataHCompletionProc(userRoutine)        \
  2132.         (DataHCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDataHCompletionProcInfo, GetCurrentISA())
  2133. #else
  2134. typedef DataHCompletionProcPtr DataHCompletionUPP;
  2135.  
  2136. #define CallDataHCompletionProc(userRoutine, request, refcon, err)        \
  2137.         (*(userRoutine))((request), (refcon), (err))
  2138. #define NewDataHCompletionProc(userRoutine)        \
  2139.         (DataHCompletionUPP)(userRoutine)
  2140. #endif
  2141.  
  2142. enum  {
  2143.     kDataHCanRead                = 1L << 0,
  2144.     kDataHSpecialRead            = 1L << 1,
  2145.     kDataHSpecialReadFile        = 1L << 2,
  2146.     kDataHCanWrite                = 1L << 3,
  2147.     kDataHSpecialWrite            = 1 << 4,
  2148.     kDataHSpecialWriteFile        = 1 << 5,
  2149.     kDataHCanStreamingWrite        = 1 << 6,
  2150.     kDataHMustCheckDataRef        = 1 << 7
  2151. };
  2152.  
  2153. #if defined(powerc) || defined (__powerc)
  2154. #pragma options align=mac68k
  2155. #endif
  2156. struct DataHVolumeListRecord {
  2157.     short                        vRefNum;
  2158.     long                        flags;
  2159. };
  2160. #if defined(powerc) || defined(__powerc)
  2161. #pragma options align=reset
  2162. #endif
  2163.  
  2164. typedef struct DataHVolumeListRecord DataHVolumeListRecord;
  2165.  
  2166. typedef DataHVolumeListRecord *DataHVolumeListPtr;
  2167.  
  2168. typedef DataHVolumeListPtr *DataHVolumeList;
  2169.  
  2170. #define kDataHExtendedSchedule 'xtnd'
  2171.  
  2172. #if defined(powerc) || defined (__powerc)
  2173. #pragma options align=mac68k
  2174. #endif
  2175. struct DataHScheduleRecord {
  2176.     TimeRecord                    timeNeededBy;
  2177.     long                        extendedID;
  2178.     long                        extendedVers;
  2179.     Fixed                        priority;
  2180. };
  2181. #if defined(powerc) || defined(__powerc)
  2182. #pragma options align=reset
  2183. #endif
  2184.  
  2185. typedef struct DataHScheduleRecord DataHScheduleRecord;
  2186.  
  2187. typedef DataHScheduleRecord *DataHSchedulePtr;
  2188.  
  2189. extern pascal ComponentResult DataHGetData(DataHandler dh, Handle h, long hOffset, long offset, long size)
  2190.  FIVEWORDINLINE(0x2F3C, 0x10, 0x2, 0x7000, 0xA82A);
  2191. extern pascal ComponentResult DataHPutData(DataHandler dh, Handle h, long hOffset, long *offset, long size)
  2192.  FIVEWORDINLINE(0x2F3C, 0x10, 0x3, 0x7000, 0xA82A);
  2193. extern pascal ComponentResult DataHFlushData(DataHandler dh)
  2194.  FIVEWORDINLINE(0x2F3C, 0, 0x4, 0x7000, 0xA82A);
  2195. extern pascal ComponentResult DataHOpenForWrite(DataHandler dh)
  2196.  FIVEWORDINLINE(0x2F3C, 0, 0x5, 0x7000, 0xA82A);
  2197. extern pascal ComponentResult DataHCloseForWrite(DataHandler dh)
  2198.  FIVEWORDINLINE(0x2F3C, 0, 0x6, 0x7000, 0xA82A);
  2199. extern pascal ComponentResult DataHOpenForRead(DataHandler dh)
  2200.  FIVEWORDINLINE(0x2F3C, 0, 0x8, 0x7000, 0xA82A);
  2201. extern pascal ComponentResult DataHCloseForRead(DataHandler dh)
  2202.  FIVEWORDINLINE(0x2F3C, 0, 0x9, 0x7000, 0xA82A);
  2203. extern pascal ComponentResult DataHSetDataRef(DataHandler dh, Handle dataRef)
  2204.  FIVEWORDINLINE(0x2F3C, 0x4, 0xA, 0x7000, 0xA82A);
  2205. extern pascal ComponentResult DataHGetDataRef(DataHandler dh, Handle *dataRef)
  2206.  FIVEWORDINLINE(0x2F3C, 0x4, 0xB, 0x7000, 0xA82A);
  2207. extern pascal ComponentResult DataHCompareDataRef(DataHandler dh, Handle dataRef, Boolean *equal)
  2208.  FIVEWORDINLINE(0x2F3C, 0x8, 0xC, 0x7000, 0xA82A);
  2209. extern pascal ComponentResult DataHTask(DataHandler dh)
  2210.  FIVEWORDINLINE(0x2F3C, 0, 0xD, 0x7000, 0xA82A);
  2211. extern pascal ComponentResult DataHScheduleData(DataHandler dh, Ptr PlaceToPutDataPtr, long FileOffset, long DataSize, long RefCon, DataHSchedulePtr scheduleRec, DataHCompletionUPP CompletionRtn)
  2212.  FIVEWORDINLINE(0x2F3C, 0x18, 0xE, 0x7000, 0xA82A);
  2213. extern pascal ComponentResult DataHFinishData(DataHandler dh, Ptr PlaceToPutDataPtr, Boolean Cancel)
  2214.  FIVEWORDINLINE(0x2F3C, 0x6, 0xF, 0x7000, 0xA82A);
  2215. extern pascal ComponentResult DataHFlushCache(DataHandler dh)
  2216.  FIVEWORDINLINE(0x2F3C, 0, 0x10, 0x7000, 0xA82A);
  2217. extern pascal ComponentResult DataHResolveDataRef(DataHandler dh, Handle theDataRef, Boolean *wasChanged, Boolean userInterfaceAllowed)
  2218.  FIVEWORDINLINE(0x2F3C, 0xA, 0x11, 0x7000, 0xA82A);
  2219. extern pascal ComponentResult DataHGetFileSize(DataHandler dh, long *fileSize)
  2220.  FIVEWORDINLINE(0x2F3C, 0x4, 0x12, 0x7000, 0xA82A);
  2221. extern pascal ComponentResult DataHCanUseDataRef(DataHandler dh, Handle dataRef, long *useFlags)
  2222.  FIVEWORDINLINE(0x2F3C, 0x8, 0x13, 0x7000, 0xA82A);
  2223. extern pascal ComponentResult DataHGetVolumeList(DataHandler dh, DataHVolumeList *volumeList)
  2224.  FIVEWORDINLINE(0x2F3C, 0x4, 0x14, 0x7000, 0xA82A);
  2225. extern pascal ComponentResult DataHWrite(DataHandler dh, Ptr data, long offset, long size, DataHCompletionUPP completion, long refCon)
  2226.  FIVEWORDINLINE(0x2F3C, 0x14, 0x15, 0x7000, 0xA82A);
  2227. extern pascal ComponentResult DataHPreextend(DataHandler dh, long maxToAdd, long *spaceAdded)
  2228.  FIVEWORDINLINE(0x2F3C, 0x8, 0x16, 0x7000, 0xA82A);
  2229. extern pascal ComponentResult DataHSetFileSize(DataHandler dh, long fileSize)
  2230.  FIVEWORDINLINE(0x2F3C, 0x4, 0x17, 0x7000, 0xA82A);
  2231. extern pascal ComponentResult DataHGetFreeSpace(DataHandler dh, unsigned long *freeSize)
  2232.  FIVEWORDINLINE(0x2F3C, 0x4, 0x18, 0x7000, 0xA82A);
  2233. extern pascal ComponentResult DataHCreateFile(DataHandler dh, OSType creator, Boolean deleteExisting)
  2234.  FIVEWORDINLINE(0x2F3C, 0x6, 0x19, 0x7000, 0xA82A);
  2235. extern pascal ComponentResult DataHGetPreferredBlockSize(DataHandler dh, long *blockSize)
  2236.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1A, 0x7000, 0xA82A);
  2237. extern pascal ComponentResult DataHGetDeviceIndex(DataHandler dh, long *deviceIndex)
  2238.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1B, 0x7000, 0xA82A);
  2239. extern pascal ComponentResult DataHIsStreamingDataHandler(DataHandler dh, Boolean *yes)
  2240.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1C, 0x7000, 0xA82A);
  2241. extern pascal ComponentResult DataHGetDataInBuffer(DataHandler dh, long startOffset, long *size)
  2242.  FIVEWORDINLINE(0x2F3C, 0x8, 0x1D, 0x7000, 0xA82A);
  2243. extern pascal ComponentResult DataHGetScheduleAheadTime(DataHandler dh, long *millisecs)
  2244.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1E, 0x7000, 0xA82A);
  2245. extern pascal ComponentResult DataHPlaybackHints(DataHandler dh, long flags, unsigned long minFileOffset, unsigned long maxFileOffset, long bytesPerSecond)
  2246.  FIVEWORDINLINE(0x2F3C, 0x10, 0x103, 0x7000, 0xA82A);
  2247. enum  {
  2248.     kDataHGetDataSelect            = 0x2,
  2249.     kDataHPutDataSelect            = 0x3,
  2250.     kDataHFlushDataSelect        = 0x4,
  2251.     kDataHOpenForWriteSelect    = 0x5,
  2252.     kDataHCloseForWriteSelect    = 0x6,
  2253.     kDataHOpenForReadSelect        = 0x8,
  2254.     kDataHCloseForReadSelect    = 0x9,
  2255.     kDataHSetDataRefSelect        = 0xA,
  2256.     kDataHGetDataRefSelect        = 0xB,
  2257.     kDataHCompareDataRefSelect    = 0xC,
  2258.     kDataHTaskSelect            = 0xD,
  2259.     kDataHScheduleDataSelect    = 0xE,
  2260.     kDataHFinishDataSelect        = 0xF,
  2261.     kDataHFlushCacheSelect        = 0x10,
  2262.     kDataHResolveDataRefSelect    = 0x11,
  2263.     kDataHGetFileSizeSelect        = 0x12,
  2264.     kDataHCanUseDataRefSelect    = 0x13,
  2265.     kDataHGetVolumeListSelect    = 0x14,
  2266.     kDataHWriteSelect            = 0x15,
  2267.     kDataHPreextendSelect        = 0x16,
  2268.     kDataHSetFileSizeSelect        = 0x17,
  2269.     kDataHGetFreeSpaceSelect    = 0x18,
  2270.     kDataHCreateFileSelect        = 0x19,
  2271.     kDataHGetPreferredBlockSizeSelect = 0x1A,
  2272.     kDataHGetDeviceIndexSelect    = 0x1B,
  2273.     kDataHIsStreamingDataHandlerSelect = 0x1C,
  2274.     kDataHGetDataInBufferSelect    = 0x1D,
  2275.     kDataHGetScheduleAheadTimeSelect = 0x1E,
  2276.     kDataHPlaybackHintsSelect    = 0x103
  2277. };
  2278.  
  2279. #define kMusicComponentType 'musi'
  2280.  
  2281. typedef ComponentInstance MusicComponent;
  2282.  
  2283. enum  {
  2284.     kSynthesizerDynamicVoice    = 1,
  2285.     kSynthesizerUsesMIDIPort    = 2,
  2286.     kSynthesizerMicrotone        = 4,
  2287.     kSynthesizerLimitedMicrotone = 8,
  2288.     kSynthesizerMixedDrums        = 16,
  2289.     kSynthesizerSoftware        = 32,
  2290.     kSynthesizerGMSuperset        = 8192,
  2291.     kSynthesizerGM                = 16384
  2292. };
  2293.  
  2294. enum MusicControllers {
  2295.     kControllerModulationWheel    = 1,
  2296.     kControllerBreath            = 2,
  2297.     kControllerFoot                = 4,
  2298.     kControllerPortamentoTime    = 5,
  2299.     kControllerVolume            = 7,
  2300.     kControllerBalance            = 8,
  2301.     kControllerPan                = 10,
  2302.     kControllerExpression        = 11,
  2303.     kControllerPitchBend        = 32,
  2304.     kControllerAfterTouch        = 33,
  2305.     kControllerSustain            = 64,
  2306.     kControllerPortamento        = 65,
  2307.     kControllerSostenuto        = 66,
  2308.     kControllerSoftPedal        = 67,
  2309.     kControllerReverb            = 91,
  2310.     kControllerTremolo            = 92,
  2311.     kControllerChorus            = 93,
  2312.     kControllerCeleste            = 94,
  2313.     kControllerPhaser            = 95
  2314. };
  2315.  
  2316. #define kControllerMaximum 0x7FFF
  2317.  
  2318. #define kControllerMinimum 0x8000
  2319.  
  2320. #if defined(powerc) || defined (__powerc)
  2321. #pragma options align=mac68k
  2322. #endif
  2323. struct SynthesizerDescription {
  2324.     OSType                        type;
  2325.     Str31                        name;
  2326.     unsigned long                flags;
  2327.     unsigned long                voiceCount;
  2328.     unsigned long                partCount;
  2329.     unsigned long                instrumentCount;
  2330.     unsigned long                modifiableInstrumentCount;
  2331.     unsigned long                channelMask;
  2332.     unsigned long                drumPartCount;
  2333.     unsigned long                drumCount;
  2334.     unsigned long                modifiableDrumCount;
  2335.     unsigned long                drumChannelMask;
  2336.     unsigned long                outputCount;
  2337.     unsigned long                latency;
  2338.     unsigned long                controllers[4];
  2339.     unsigned long                gmInstruments[4];
  2340.     unsigned long                gmDrums[4];
  2341. };
  2342. #if defined(powerc) || defined(__powerc)
  2343. #pragma options align=reset
  2344. #endif
  2345.  
  2346. typedef struct SynthesizerDescription SynthesizerDescription;
  2347.  
  2348. #define kVoiceCountDynamic -1
  2349.  
  2350. #if defined(powerc) || defined (__powerc)
  2351. #pragma options align=mac68k
  2352. #endif
  2353. struct ToneDescription {
  2354.     OSType                        synthesizerType;
  2355.     Str31                        synthesizerName;
  2356.     Str31                        instrumentName;
  2357.     long                        instrumentNumber;
  2358.     long                        gmNumber;
  2359. };
  2360. #if defined(powerc) || defined(__powerc)
  2361. #pragma options align=reset
  2362. #endif
  2363.  
  2364. typedef struct ToneDescription ToneDescription;
  2365.  
  2366. #define kFirstDrumkit 16385
  2367.  
  2368. #define kLastDrumkit (kFirstDrumkit+127)
  2369.  
  2370. enum  {
  2371.     kInstrumentMatchSynthesizerType = 1,
  2372.     kInstrumentMatchSynthesizerName = 2,
  2373.     kInstrumentMatchName        = 4,
  2374.     kInstrumentMatchNumber        = 8,
  2375.     kInstrumentMatchGMNumber    = 16
  2376. };
  2377.  
  2378. enum  {
  2379.     kKnobRealtime                = 1,
  2380.     kKnobNextNote                = 2,
  2381.     kKnobAction                    = 4,
  2382.     kKnobNotInstrument            = 8,
  2383.     kKnobGroupStart                = 128,
  2384.     kKnobTypeNumber                = 0 << 12,
  2385.     kKnobTypeBoolean            = 1 << 12,
  2386.     kKnobTypeNote                = 2 << 12,
  2387.     kKnobTypePan                = 3 << 12
  2388. };
  2389.  
  2390. #if defined(powerc) || defined (__powerc)
  2391. #pragma options align=mac68k
  2392. #endif
  2393. struct KnobDescription {
  2394.     Str31                        name;
  2395.     long                        lowValue;
  2396.     long                        highValue;
  2397.     long                        defaultValue;
  2398.     long                        flags;
  2399. };
  2400. #if defined(powerc) || defined(__powerc)
  2401. #pragma options align=reset
  2402. #endif
  2403.  
  2404. typedef struct KnobDescription KnobDescription;
  2405.  
  2406. #if defined(powerc) || defined (__powerc)
  2407. #pragma options align=mac68k
  2408. #endif
  2409. struct InstrumentData {
  2410.     long                        size;
  2411.     OSType                        type;
  2412.     ToneDescription                tone;
  2413.     unsigned long                data[1];
  2414. };
  2415. #if defined(powerc) || defined(__powerc)
  2416. #pragma options align=reset
  2417. #endif
  2418.  
  2419. typedef struct InstrumentData InstrumentData;
  2420.  
  2421. typedef InstrumentData **InstrumentDataHandle;
  2422.  
  2423. #if defined(powerc) || defined (__powerc)
  2424. #pragma options align=mac68k
  2425. #endif
  2426. struct GenericMIDIDescription {
  2427.     SynthesizerDescription        description;
  2428.     short                        instrumentNames;
  2429.     short                        instrumentCategoryLasts;
  2430.     short                        instrumentCategoryNames;
  2431.     short                        gmInstrumentMap;
  2432.     short                        drumNames;
  2433.     short                        drumNumbers;
  2434.     short                        gmDrumMap;
  2435. };
  2436. #if defined(powerc) || defined(__powerc)
  2437. #pragma options align=reset
  2438. #endif
  2439.  
  2440. typedef struct GenericMIDIDescription GenericMIDIDescription;
  2441.  
  2442. #if defined(powerc) || defined (__powerc)
  2443. #pragma options align=mac68k
  2444. #endif
  2445. struct SingleInstrumentSample {
  2446.     unsigned long                offset;
  2447.     unsigned long                loopBegin;
  2448.     unsigned long                loopEnd;
  2449.     unsigned long                sampleEnd;
  2450.     unsigned long                highestNote;
  2451. };
  2452. #if defined(powerc) || defined(__powerc)
  2453. #pragma options align=reset
  2454. #endif
  2455.  
  2456. typedef struct SingleInstrumentSample SingleInstrumentSample;
  2457.  
  2458. #if defined(powerc) || defined (__powerc)
  2459. #pragma options align=mac68k
  2460. #endif
  2461. struct MultipleInstrumentSample {
  2462.     unsigned long                sampleType;
  2463.     unsigned long                sampleRate;
  2464.     unsigned long                soundCount;
  2465.     SingleInstrumentSample        sound[1];
  2466.     char                        data[1];
  2467. };
  2468. #if defined(powerc) || defined(__powerc)
  2469. #pragma options align=reset
  2470. #endif
  2471.  
  2472. typedef struct MultipleInstrumentSample MultipleInstrumentSample;
  2473.  
  2474. #if defined(powerc) || defined (__powerc)
  2475. #pragma options align=mac68k
  2476. #endif
  2477. struct InstrumentAboutInfo {
  2478.     PicHandle                    p;
  2479.     Str255                        author;
  2480.     Str255                        copyright;
  2481.     Str255                        other;
  2482. };
  2483. #if defined(powerc) || defined(__powerc)
  2484. #pragma options align=reset
  2485. #endif
  2486.  
  2487. typedef struct InstrumentAboutInfo InstrumentAboutInfo;
  2488.  
  2489. #if defined(powerc) || defined (__powerc)
  2490. #pragma options align=mac68k
  2491. #endif
  2492. struct MusicMIDIPacket {
  2493.     unsigned short                length;
  2494.     unsigned long                reserved;
  2495.     unsigned char                data[249];
  2496. };
  2497. #if defined(powerc) || defined(__powerc)
  2498. #pragma options align=reset
  2499. #endif
  2500.  
  2501. typedef struct MusicMIDIPacket MusicMIDIPacket;
  2502.  
  2503. typedef pascal ComponentResult (*MusicMIDISendProcPtr)(MusicComponent self, long refCon, MusicMIDIPacket *mmp);
  2504.  
  2505. enum  {
  2506.     kMusicFirstSelect            = 0,
  2507.     kMusicGetDescriptionSelect,
  2508.     kMusicGetPartSelect,
  2509.     kMusicSetPartSelect,
  2510.     kMusicSetInstrumentNumberSelect,
  2511.     kMusicGetInstrumentNumberSelect,
  2512.     kMusicStoreInstrumentSelect,
  2513.     kMusicGetInstrumentSelect,
  2514.     kMusicSetInstrumentSelect,
  2515.     kMusicGetInstrumentsSelect,
  2516.     kMusicSetInstrumentsSelect,
  2517.     kMusicGetInstrumentKnobDescriptionSelect,
  2518.     kMusicGetDrumKnobDescriptionSelect,
  2519.     kMusicGetKnobDescriptionSelect,
  2520.     kMusicGetPartKnobSelect,
  2521.     kMusicSetPartKnobSelect,
  2522.     kMusicGetKnobSelect,
  2523.     kMusicSetKnobSelect,
  2524.     kMusicGetPartNameSelect,
  2525.     kMusicSetPartNameSelect,
  2526.     kMusicFindToneSelect,
  2527.     kMusicPlayNoteSelect,
  2528.     kMusicResetPartSelect,
  2529.     kMusicSetControllerSelect,
  2530.     kMusicGetControllerSelect,
  2531.     kMusicGetMIDIProcSelect,
  2532.     kMusicSetMIDIProcSelect,
  2533.     kMusicGetInstrumentNamesSelect,
  2534.     kMusicGetDrumNamesSelect,
  2535.     kMusicGetMasterTuneSelect,
  2536.     kMusicSetMasterTuneSelect,
  2537.     kMusicSetFlatInstrumentSelect,
  2538.     kMusicGetInstrumentAboutInfoSelect,
  2539.     kMusicSetGenericMIDIDescriptionSelect = 1001
  2540. };
  2541.  
  2542. #define MusicError(x) (0x80000000 | ((short)(x)) )
  2543.  
  2544. #define notImplementedMusicErr MusicError(-2000)
  2545.  
  2546. #define cantSendToSynthesizerErr MusicError(-2001)
  2547.  
  2548. #define cantReceiveFromSynthesizerErr MusicError(-2002)
  2549.  
  2550. #define illegalVoiceAllocationErr MusicError(-2003)
  2551.  
  2552. #define illegalPartErr MusicError(-2004)
  2553.  
  2554. #define illegalChannelErr MusicError(-2005)
  2555.  
  2556. #define illegalKnobErr MusicError(-2006)
  2557.  
  2558. #define illegalKnobValueErr MusicError(-2007)
  2559.  
  2560. #define illegalInstrumentErr MusicError(-2008)
  2561.  
  2562. #define illegalControllerErr MusicError(-2010)
  2563.  
  2564. #define midiManagerAbsentErr MusicError(-2011)
  2565.  
  2566. #define synthesizerNotRespondingErr MusicError(-2012)
  2567.  
  2568. #define synthesizerErr MusicError(-2013)
  2569.  
  2570. #define kGMType 'gm  '
  2571.  
  2572. #define kGenericMIDIType 'gene'
  2573.  
  2574. extern pascal ComponentResult MusicGetPart(MusicComponent mc, long part, long *midiChannel, long *polyphony)
  2575.  FIVEWORDINLINE(0x2F3C, 0xC, kMusicGetPartSelect, 0x7000, 0xA82A);
  2576. extern pascal ComponentResult MusicSetPart(MusicComponent mc, long part, long midiChannel, long polyphony)
  2577.  FIVEWORDINLINE(0x2F3C, 0xC, kMusicSetPartSelect, 0x7000, 0xA82A);
  2578. extern pascal ComponentResult MusicGetDescription(MusicComponent mc, SynthesizerDescription *sd)
  2579.  FIVEWORDINLINE(0x2F3C, 0x4, kMusicGetDescriptionSelect, 0x7000, 0xA82A);
  2580. extern pascal ComponentResult MusicGetInstrumentAboutInfo(MusicComponent mc, long part, InstrumentAboutInfo *iai)
  2581.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicGetInstrumentAboutInfoSelect, 0x7000, 0xA82A);
  2582. extern pascal ComponentResult MusicSetInstrumentNumber(MusicComponent mc, long part, long instrumentNumber)
  2583.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicSetInstrumentNumberSelect, 0x7000, 0xA82A);
  2584. extern pascal ComponentResult MusicGetInstrumentNumber(MusicComponent mc, long part)
  2585.  FIVEWORDINLINE(0x2F3C, 0x4, kMusicGetInstrumentNumberSelect, 0x7000, 0xA82A);
  2586. extern pascal ComponentResult MusicStoreInstrument(MusicComponent mc, long part, long instrumentNumber)
  2587.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicStoreInstrumentSelect, 0x7000, 0xA82A);
  2588. extern pascal ComponentResult MusicGetInstrument(MusicComponent mc, long part, InstrumentDataHandle *iH)
  2589.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicGetInstrumentSelect, 0x7000, 0xA82A);
  2590. extern pascal ComponentResult MusicSetInstrument(MusicComponent mc, long part, InstrumentDataHandle iH)
  2591.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicSetInstrumentSelect, 0x7000, 0xA82A);
  2592. extern pascal ComponentResult MusicGetInstruments(MusicComponent mc, Handle *instruments)
  2593.  FIVEWORDINLINE(0x2F3C, 0x4, kMusicGetInstrumentsSelect, 0x7000, 0xA82A);
  2594. extern pascal ComponentResult MusicSetInstruments(MusicComponent mc, Handle instruments)
  2595.  FIVEWORDINLINE(0x2F3C, 0x4, kMusicSetInstrumentsSelect, 0x7000, 0xA82A);
  2596. extern pascal ComponentResult MusicSetFlatInstrument(MusicComponent mc, long part, Ptr flatInstrument)
  2597.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicSetFlatInstrumentSelect, 0x7000, 0xA82A);
  2598. extern pascal ComponentResult MusicGetInstrumentKnobDescription(MusicComponent mc, long knobNumber, KnobDescription *mkd)
  2599.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicGetInstrumentKnobDescriptionSelect, 0x7000, 0xA82A);
  2600. extern pascal ComponentResult MusicGetDrumKnobDescription(MusicComponent mc, long knobNumber, KnobDescription *mkd)
  2601.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicGetDrumKnobDescriptionSelect, 0x7000, 0xA82A);
  2602. extern pascal ComponentResult MusicGetPartKnob(MusicComponent mc, long part, long knobNumber)
  2603.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicGetPartKnobSelect, 0x7000, 0xA82A);
  2604. extern pascal ComponentResult MusicSetPartKnob(MusicComponent mc, long part, long knobNumber, long knobValue)
  2605.  FIVEWORDINLINE(0x2F3C, 0xC, kMusicSetPartKnobSelect, 0x7000, 0xA82A);
  2606. extern pascal ComponentResult MusicGetKnobDescription(MusicComponent mc, long knobNumber, KnobDescription *mkd)
  2607.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicGetKnobDescriptionSelect, 0x7000, 0xA82A);
  2608. extern pascal ComponentResult MusicGetKnob(MusicComponent mc, long knobNumber)
  2609.  FIVEWORDINLINE(0x2F3C, 0x4, kMusicGetKnobSelect, 0x7000, 0xA82A);
  2610. extern pascal ComponentResult MusicSetKnob(MusicComponent mc, long knobNumber, long knobValue)
  2611.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicSetKnobSelect, 0x7000, 0xA82A);
  2612. extern pascal ComponentResult MusicGetPartName(MusicComponent mc, long part, Str31 name)
  2613.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicGetPartNameSelect, 0x7000, 0xA82A);
  2614. extern pascal ComponentResult MusicSetPartName(MusicComponent mc, long part, Str31 name)
  2615.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicSetPartNameSelect, 0x7000, 0xA82A);
  2616. extern pascal ComponentResult MusicFindTone(MusicComponent mc, ToneDescription *td, long *instrumentNumber, unsigned long *fit)
  2617.  FIVEWORDINLINE(0x2F3C, 0xC, kMusicFindToneSelect, 0x7000, 0xA82A);
  2618. extern pascal ComponentResult MusicGetInstrumentNames(MusicComponent mc, long modifiableInstruments, Handle *instrumentNames, Handle *instrumentCategoryLasts, Handle *instrumentCategoryNames)
  2619.  FIVEWORDINLINE(0x2F3C, 0x10, kMusicGetInstrumentNamesSelect, 0x7000, 0xA82A);
  2620. extern pascal ComponentResult MusicGetDrumNames(MusicComponent mc, long modifiableInstruments, Handle *instrumentNumbers, Handle *instrumentNames)
  2621.  FIVEWORDINLINE(0x2F3C, 0xC, kMusicGetDrumNamesSelect, 0x7000, 0xA82A);
  2622. extern pascal ComponentResult MusicPlayNote(MusicComponent mc, long part, long pitch, long velocity)
  2623.  FIVEWORDINLINE(0x2F3C, 0xC, kMusicPlayNoteSelect, 0x7000, 0xA82A);
  2624. extern pascal ComponentResult MusicResetPart(MusicComponent mc, long part)
  2625.  FIVEWORDINLINE(0x2F3C, 0x4, kMusicResetPartSelect, 0x7000, 0xA82A);
  2626. extern pascal ComponentResult MusicSetController(MusicComponent mc, long part, long controllerNumber, long controllerValue)
  2627.  FIVEWORDINLINE(0x2F3C, 0xC, kMusicSetControllerSelect, 0x7000, 0xA82A);
  2628. extern pascal ComponentResult MusicGetController(MusicComponent mc, long part, long controllerNumber)
  2629.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicGetControllerSelect, 0x7000, 0xA82A);
  2630. extern pascal ComponentResult MusicGetMIDIProc(MusicComponent mc, MusicMIDISendProcPtr *midiSendProc, long *refCon)
  2631.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicGetMIDIProcSelect, 0x7000, 0xA82A);
  2632. extern pascal ComponentResult MusicSetMIDIProc(MusicComponent mc, MusicMIDISendProcPtr midiSendProc, long refCon)
  2633.  FIVEWORDINLINE(0x2F3C, 0x8, kMusicSetMIDIProcSelect, 0x7000, 0xA82A);
  2634. extern pascal ComponentResult MusicSetMasterTune(MusicComponent mc, Fixed masterTune)
  2635.  FIVEWORDINLINE(0x2F3C, 0x4, kMusicSetMasterTuneSelect, 0x7000, 0xA82A);
  2636. extern pascal ComponentResult MusicGetMasterTune(MusicComponent mc)
  2637.  FIVEWORDINLINE(0x2F3C, 0, kMusicGetMasterTuneSelect, 0x7000, 0xA82A);
  2638. extern pascal ComponentResult MusicSetGenericMIDIDescription(MusicComponent mc, GenericMIDIDescription *gmd)
  2639.  FIVEWORDINLINE(0x2F3C, 0x4, kMusicSetGenericMIDIDescriptionSelect, 0x7000, 0xA82A);
  2640. typedef struct privateNoteChannel *NoteChannel;
  2641.  
  2642. #if defined(powerc) || defined (__powerc)
  2643. #pragma options align=mac68k
  2644. #endif
  2645. struct SynthesizerConnections {
  2646.     OSType                        clientID;
  2647.     OSType                        inputPortID;
  2648.     OSType                        outputPortID;
  2649.     long                        midiChannel;
  2650. };
  2651. #if defined(powerc) || defined(__powerc)
  2652. #pragma options align=reset
  2653. #endif
  2654.  
  2655. typedef struct SynthesizerConnections SynthesizerConnections;
  2656.  
  2657. #if defined(powerc) || defined (__powerc)
  2658. #pragma options align=mac68k
  2659. #endif
  2660. struct NoteRequest {
  2661.     long                        polyphony;
  2662.     Fixed                        typicalPolyphony;
  2663.     ToneDescription                tone;
  2664. };
  2665. #if defined(powerc) || defined(__powerc)
  2666. #pragma options align=reset
  2667. #endif
  2668.  
  2669. typedef struct NoteRequest NoteRequest;
  2670.  
  2671. enum  {
  2672.     kNAFirstSelector            = -7,
  2673.     kNATargetSelect,
  2674.     kNARegisterSelect,
  2675.     kNAVersionSelect,
  2676.     kNACanDoSelect,
  2677.     kNACloseSelect,
  2678.     kNAOpenSelect,
  2679.     kNARegisterMusicDeviceSelect,
  2680.     kNAUnregisterMusicDeviceSelect,
  2681.     kNAGetRegisteredMusicDeviceSelect,
  2682.     kNASaveMusicConfigurationSelect,
  2683.     kNANewNoteChannelSelect,
  2684.     kNADisposeNoteChannelSelect,
  2685.     kNAGetNoteChannelInfoSelect,
  2686.     kNAPrerollNoteChannelSelect,
  2687.     kNAUnrollNoteChannelSelect,
  2688.     kNAEngageNoteChannelSelect,
  2689.     kNADisengageNoteChannelSelect,
  2690.     kNASetNoteChannelVolumeSelect,
  2691.     kNAResetNoteChannelSelect,
  2692.     kNAPlayNoteSelect,
  2693.     kNASetControllerSelect,
  2694.     kNASetKnobSelect,
  2695.     kNAFindNoteChannelToneSelect,
  2696.     kNASetNoteChannelInstrumentSelect,
  2697.     kNAPickInstrumentSelect,
  2698.     kNAPickArrangementSelect,
  2699.     kNAGetStatusBlockSelect,
  2700.     kNASetDefaultMIDIInputSelect,
  2701.     kNAGetDefaultMIDIInputSelect,
  2702.     kNAGetNoteChannelStateSelect,
  2703.     kNASetNoteChannelStateSelect,
  2704.     kNAUseDefaultMIDIInputSelect,
  2705.     kNALoseDefaultMIDIInputSelect,
  2706.     kNAStuffToneDescriptionSelect,
  2707.     kNACopyrightDialogSelect,
  2708.     kNALastSelector
  2709. };
  2710.  
  2711. #undef NAComponentCall
  2712. #undef NAComponentError
  2713. typedef ComponentInstance NoteAllocator;
  2714.  
  2715. enum  {
  2716.     illegalNoteChannelErr        = -2200,
  2717.     noteChannelNotAllocatedErr    = -2201
  2718. };
  2719.  
  2720. enum  {
  2721.     kPickDontMix                = 1,
  2722.     kPickSameSynth                = 2
  2723. };
  2724.  
  2725. typedef pascal ComponentResult (*MusicMIDIReadHookProcPtr)(MusicMIDIPacket *mp, long myRefCon);
  2726.  
  2727. enum {
  2728.     uppMusicMIDIReadHookProcInfo = kPascalStackBased
  2729.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  2730.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(MusicMIDIPacket*)))
  2731.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  2732. };
  2733.  
  2734. #if USESROUTINEDESCRIPTORS
  2735. typedef UniversalProcPtr MusicMIDIReadHookUPP;
  2736.  
  2737. #define CallMusicMIDIReadHookProc(userRoutine, mp, myRefCon)        \
  2738.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppMusicMIDIReadHookProcInfo, (mp), (myRefCon))
  2739. #define NewMusicMIDIReadHookProc(userRoutine)        \
  2740.         (MusicMIDIReadHookUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicMIDIReadHookProcInfo, GetCurrentISA())
  2741. #else
  2742. typedef MusicMIDIReadHookProcPtr MusicMIDIReadHookUPP;
  2743.  
  2744. #define CallMusicMIDIReadHookProc(userRoutine, mp, myRefCon)        \
  2745.         (*(userRoutine))((mp), (myRefCon))
  2746. #define NewMusicMIDIReadHookProc(userRoutine)        \
  2747.         (MusicMIDIReadHookUPP)(userRoutine)
  2748. #endif
  2749.  
  2750. #define kNoteAllocatorType 'nota'
  2751.  
  2752. extern pascal ComponentResult NARegisterMusicDevice(NoteAllocator na, OSType synthType, Str31 name, SynthesizerConnections *connections)
  2753.  FIVEWORDINLINE(0x2F3C, 0xC, kNARegisterMusicDeviceSelect, 0x7000, 0xA82A);
  2754. extern pascal ComponentResult NAUnregisterMusicDevice(NoteAllocator na, long index)
  2755.  FIVEWORDINLINE(0x2F3C, 0x4, kNAUnregisterMusicDeviceSelect, 0x7000, 0xA82A);
  2756. extern pascal ComponentResult NAGetRegisteredMusicDevice(NoteAllocator na, long index, OSType *synthType, Str31 name, SynthesizerConnections *connections, MusicComponent *mc)
  2757.  FIVEWORDINLINE(0x2F3C, 0x14, kNAGetRegisteredMusicDeviceSelect, 0x7000, 0xA82A);
  2758. extern pascal ComponentResult NASetDefaultMIDIInput(NoteAllocator na, SynthesizerConnections *sc)
  2759.  FIVEWORDINLINE(0x2F3C, 0x4, kNASetDefaultMIDIInputSelect, 0x7000, 0xA82A);
  2760. extern pascal ComponentResult NAGetDefaultMIDIInput(NoteAllocator na, SynthesizerConnections *sc)
  2761.  FIVEWORDINLINE(0x2F3C, 0x4, kNAGetDefaultMIDIInputSelect, 0x7000, 0xA82A);
  2762. extern pascal ComponentResult NASaveMusicConfiguration(NoteAllocator na)
  2763.  FIVEWORDINLINE(0x2F3C, 0, kNASaveMusicConfigurationSelect, 0x7000, 0xA82A);
  2764. extern pascal ComponentResult NANewNoteChannel(NoteAllocator na, NoteRequest *noteRequest, NoteChannel *outChannel)
  2765.  FIVEWORDINLINE(0x2F3C, 0x8, kNANewNoteChannelSelect, 0x7000, 0xA82A);
  2766. extern pascal ComponentResult NADisposeNoteChannel(NoteAllocator na, NoteChannel noteChannel)
  2767.  FIVEWORDINLINE(0x2F3C, 0x4, kNADisposeNoteChannelSelect, 0x7000, 0xA82A);
  2768. extern pascal ComponentResult NAGetNoteChannelInfo(NoteAllocator na, NoteChannel noteChannel, long *index, long *part)
  2769.  FIVEWORDINLINE(0x2F3C, 0xC, kNAGetNoteChannelInfoSelect, 0x7000, 0xA82A);
  2770. extern pascal ComponentResult NAUseDefaultMIDIInput(NoteAllocator na, MusicMIDIReadHookUPP readHook, long refCon, unsigned long flags)
  2771.  FIVEWORDINLINE(0x2F3C, 0xC, kNAUseDefaultMIDIInputSelect, 0x7000, 0xA82A);
  2772. extern pascal ComponentResult NALoseDefaultMIDIInput(NoteAllocator na)
  2773.  FIVEWORDINLINE(0x2F3C, 0, kNALoseDefaultMIDIInputSelect, 0x7000, 0xA82A);
  2774. extern pascal ComponentResult NAPrerollNoteChannel(NoteAllocator na, NoteChannel noteChannel)
  2775.  FIVEWORDINLINE(0x2F3C, 0x4, kNAPrerollNoteChannelSelect, 0x7000, 0xA82A);
  2776. extern pascal ComponentResult NAUnrollNoteChannel(NoteAllocator na, NoteChannel noteChannel)
  2777.  FIVEWORDINLINE(0x2F3C, 0x4, kNAUnrollNoteChannelSelect, 0x7000, 0xA82A);
  2778. extern pascal ComponentResult NAEngageNoteChannel(NoteAllocator na, NoteChannel noteChannel)
  2779.  FIVEWORDINLINE(0x2F3C, 0x4, kNAEngageNoteChannelSelect, 0x7000, 0xA82A);
  2780. extern pascal ComponentResult NADisengageNoteChannel(NoteAllocator na, NoteChannel noteChannel, long silenceNotes)
  2781.  FIVEWORDINLINE(0x2F3C, 0x8, kNADisengageNoteChannelSelect, 0x7000, 0xA82A);
  2782. extern pascal ComponentResult NAGetNoteChannelState(NoteAllocator na, NoteChannel noteChannel, long instrumentNumber, Handle *state)
  2783.  FIVEWORDINLINE(0x2F3C, 0xC, kNAGetNoteChannelStateSelect, 0x7000, 0xA82A);
  2784. extern pascal ComponentResult NASetNoteChannelState(NoteAllocator na, NoteChannel noteChannel, long instrumentNumber, Handle state)
  2785.  FIVEWORDINLINE(0x2F3C, 0xC, kNASetNoteChannelStateSelect, 0x7000, 0xA82A);
  2786. extern pascal ComponentResult NAResetNoteChannel(NoteAllocator na, NoteChannel noteChannel)
  2787.  FIVEWORDINLINE(0x2F3C, 0x4, kNAResetNoteChannelSelect, 0x7000, 0xA82A);
  2788. extern pascal ComponentResult NASetNoteChannelVolume(NoteAllocator na, NoteChannel noteChannel, Fixed volume)
  2789.  FIVEWORDINLINE(0x2F3C, 0x8, kNASetNoteChannelVolumeSelect, 0x7000, 0xA82A);
  2790. extern pascal ComponentResult NAPlayNote(NoteAllocator na, NoteChannel noteChannel, long pitch, long velocity)
  2791.  FIVEWORDINLINE(0x2F3C, 0xC, kNAPlayNoteSelect, 0x7000, 0xA82A);
  2792. extern pascal ComponentResult NASetController(NoteAllocator na, NoteChannel noteChannel, long controllerNumber, long controllerValue)
  2793.  FIVEWORDINLINE(0x2F3C, 0xC, kNASetControllerSelect, 0x7000, 0xA82A);
  2794. extern pascal ComponentResult NASetKnob(NoteAllocator na, NoteChannel noteChannel, long knobNumber, long knobValue)
  2795.  FIVEWORDINLINE(0x2F3C, 0xC, kNASetKnobSelect, 0x7000, 0xA82A);
  2796. extern pascal ComponentResult NAFindNoteChannelTone(NoteAllocator na, NoteChannel noteChannel, ToneDescription *td, long *instrumentNumber)
  2797.  FIVEWORDINLINE(0x2F3C, 0xC, kNAFindNoteChannelToneSelect, 0x7000, 0xA82A);
  2798. extern pascal ComponentResult NASetNoteChannelInstrument(NoteAllocator na, NoteChannel noteChannel, long instrumentNumber)
  2799.  FIVEWORDINLINE(0x2F3C, 0x8, kNASetNoteChannelInstrumentSelect, 0x7000, 0xA82A);
  2800. extern pascal ComponentResult NAPickInstrument(NoteAllocator na, ModalFilterUPP filterProc, StringPtr prompt, ToneDescription *sd, unsigned long flags, long flatCount, Ptr *flatList, long *flatChoiceIndex)
  2801.  FIVEWORDINLINE(0x2F3C, 0x1C, kNAPickInstrumentSelect, 0x7000, 0xA82A);
  2802. extern pascal ComponentResult NAStuffToneDescription(NoteAllocator na, long gmNumber, ToneDescription *td)
  2803.  FIVEWORDINLINE(0x2F3C, 0x8, kNAStuffToneDescriptionSelect, 0x7000, 0xA82A);
  2804. extern pascal ComponentResult NAPickArrangement(NoteAllocator na, ModalFilterUPP filterProc, StringPtr prompt, long partCount, NoteRequest *noteRequestList, Track t, StringPtr songName)
  2805.  FIVEWORDINLINE(0x2F3C, 0x18, kNAPickArrangementSelect, 0x7000, 0xA82A);
  2806. extern pascal ComponentResult NACopyrightDialog(NoteAllocator na, PicHandle p, StringPtr author, StringPtr copyright, StringPtr other, StringPtr title, ModalFilterUPP filterProc, long refCon)
  2807.  FIVEWORDINLINE(0x2F3C, 0x1C, kNACopyrightDialogSelect, 0x7000, 0xA82A);
  2808. #if defined(powerc) || defined (__powerc)
  2809. #pragma options align=mac68k
  2810. #endif
  2811. struct NAStatPiece {
  2812.     Str31                        clientName;
  2813.     Str31                        synthesizerName;
  2814.     long                        part;
  2815.     long                        midiChannel;
  2816.     long                        polyphony;
  2817.     long                        valid;
  2818. };
  2819. #if defined(powerc) || defined(__powerc)
  2820. #pragma options align=reset
  2821. #endif
  2822.  
  2823. typedef struct NAStatPiece NAStatPiece;
  2824.  
  2825. #if defined(powerc) || defined (__powerc)
  2826. #pragma options align=mac68k
  2827. #endif
  2828. struct NAStat {
  2829.     long                        pieceCount;
  2830.     NAStatPiece                    piece[64];
  2831. };
  2832. #if defined(powerc) || defined(__powerc)
  2833. #pragma options align=reset
  2834. #endif
  2835.  
  2836. typedef struct NAStat NAStat;
  2837.  
  2838. extern pascal ComponentResult NAGetStatusBlock(NoteAllocator na, NAStat *stat)
  2839.  FIVEWORDINLINE(0x2F3C, 0x4, kNAGetStatusBlockSelect, 0x7000, 0xA82A);
  2840. #define kTuneQueueDepth 8
  2841.  
  2842. #if defined(powerc) || defined (__powerc)
  2843. #pragma options align=mac68k
  2844. #endif
  2845. struct TuneStatus {
  2846.     long                        position;
  2847.     TimeValue                    time;
  2848. };
  2849. #if defined(powerc) || defined(__powerc)
  2850. #pragma options align=reset
  2851. #endif
  2852.  
  2853. typedef struct TuneStatus TuneStatus;
  2854.  
  2855. #define kStopTuneFade 1
  2856.  
  2857. #define kStopTuneSustain 2
  2858.  
  2859. #define kStopTuneInstant 4
  2860.  
  2861. #define kStopTuneReleaseChannels 8
  2862.  
  2863. enum  {
  2864.     kTuneSelect                    = 3,
  2865.     kTuneSetHeaderSelect,
  2866.     kTuneGetTimeBaseSelect,
  2867.     kTuneSetTimeScaleSelect,
  2868.     kTuneGetTimeScaleSelect,
  2869.     kTuneGetIndexedNoteChannelSelect,
  2870.     kTuneDummy,
  2871.     kTuneQueueSelect,
  2872.     kTuneInstantSelect,
  2873.     kTuneGetStatusSelect,
  2874.     kTuneStopSelect,
  2875.     kTuneResumeSelect,
  2876.     kTuneFlushSelect,
  2877.     kTuneSetVolumeSelect,
  2878.     kTuneGetVolumeSelect,
  2879.     kTunePrerollSelect,
  2880.     kTuneUnrollSelect,
  2881.     kTuneLastSelector
  2882. };
  2883.  
  2884. typedef pascal void (*TuneCallBackProcPtr)(const TuneStatus *status, long refCon);
  2885.  
  2886. enum {
  2887.     uppTuneCallBackProcInfo = kPascalStackBased
  2888.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TuneStatus*)))
  2889.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  2890. };
  2891.  
  2892. #if USESROUTINEDESCRIPTORS
  2893. typedef UniversalProcPtr TuneCallBackUPP;
  2894.  
  2895. #define CallTuneCallBackProc(userRoutine, status, refCon)        \
  2896.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTuneCallBackProcInfo, (status), (refCon))
  2897. #define NewTuneCallBackProc(userRoutine)        \
  2898.         (TuneCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTuneCallBackProcInfo, GetCurrentISA())
  2899. #else
  2900. typedef TuneCallBackProcPtr TuneCallBackUPP;
  2901.  
  2902. #define CallTuneCallBackProc(userRoutine, status, refCon)        \
  2903.         (*(userRoutine))((status), (refCon))
  2904. #define NewTuneCallBackProc(userRoutine)        \
  2905.         (TuneCallBackUPP)(userRoutine)
  2906. #endif
  2907.  
  2908. typedef ComponentInstance TunePlayer;
  2909.  
  2910. #define kMaxTunePlayerParts 32
  2911.  
  2912. enum  {
  2913.     tunePlayerRunning            = -2100
  2914. };
  2915.  
  2916. #define kTunePlayerType 'tune'
  2917.  
  2918. extern pascal ComponentResult TuneSetHeader(TunePlayer tp, unsigned long *header)
  2919.  FIVEWORDINLINE(0x2F3C, 0x4, kTuneSetHeaderSelect, 0x7000, 0xA82A);
  2920. extern pascal ComponentResult TuneGetTimeBase(TunePlayer tp, TimeBase *tb)
  2921.  FIVEWORDINLINE(0x2F3C, 0x4, kTuneGetTimeBaseSelect, 0x7000, 0xA82A);
  2922. extern pascal ComponentResult TuneSetTimeScale(TunePlayer tp, TimeScale scale)
  2923.  FIVEWORDINLINE(0x2F3C, 0x4, kTuneSetTimeScaleSelect, 0x7000, 0xA82A);
  2924. extern pascal ComponentResult TuneGetTimeScale(TunePlayer tp, TimeScale *scale)
  2925.  FIVEWORDINLINE(0x2F3C, 0x4, kTuneGetTimeScaleSelect, 0x7000, 0xA82A);
  2926. extern pascal ComponentResult TuneGetIndexedNoteChannel(TunePlayer tp, long i, NoteChannel *nc)
  2927.  FIVEWORDINLINE(0x2F3C, 0x8, kTuneGetIndexedNoteChannelSelect, 0x7000, 0xA82A);
  2928. enum  {
  2929.     kTuneStartNow                = 1,
  2930.     kTuneDontClipNotes            = 2,
  2931.     kTuneExcludeEdgeNotes        = 4,
  2932.     kTuneStartNewMaster            = 16384
  2933. };
  2934.  
  2935. extern pascal ComponentResult TuneQueue(TunePlayer tp, unsigned long *tune, Fixed tuneRate, unsigned long tuneStartPosition, unsigned long tuneStopPosition, unsigned long queueFlags, TuneCallBackUPP callBackProc, long refCon)
  2936.  FIVEWORDINLINE(0x2F3C, 0x1C, kTuneQueueSelect, 0x7000, 0xA82A);
  2937. extern pascal ComponentResult TuneInstant(TunePlayer tp, unsigned long *tune, long tunePosition)
  2938.  FIVEWORDINLINE(0x2F3C, 0x8, kTuneInstantSelect, 0x7000, 0xA82A);
  2939. extern pascal ComponentResult TuneGetStatus(TunePlayer tp, TuneStatus *status)
  2940.  FIVEWORDINLINE(0x2F3C, 0x4, kTuneGetStatusSelect, 0x7000, 0xA82A);
  2941. enum  {
  2942.     kStopSustain                = 1,
  2943.     kStopFadeout                = 2
  2944. };
  2945.  
  2946. extern pascal ComponentResult TuneStop(TunePlayer tp, long stopFlags)
  2947.  FIVEWORDINLINE(0x2F3C, 0x4, kTuneStopSelect, 0x7000, 0xA82A);
  2948. extern pascal ComponentResult TuneResume(TunePlayer tp)
  2949.  FIVEWORDINLINE(0x2F3C, 0, kTuneResumeSelect, 0x7000, 0xA82A);
  2950. extern pascal ComponentResult TuneFlush(TunePlayer tp)
  2951.  FIVEWORDINLINE(0x2F3C, 0, kTuneFlushSelect, 0x7000, 0xA82A);
  2952. extern pascal ComponentResult TuneSetVolume(TunePlayer tp, Fixed volume)
  2953.  FIVEWORDINLINE(0x2F3C, 0x4, kTuneSetVolumeSelect, 0x7000, 0xA82A);
  2954. extern pascal ComponentResult TuneGetVolume(TunePlayer tp)
  2955.  FIVEWORDINLINE(0x2F3C, 0, kTuneGetVolumeSelect, 0x7000, 0xA82A);
  2956. extern pascal ComponentResult TunePreroll(TunePlayer tp)
  2957.  FIVEWORDINLINE(0x2F3C, 0, kTunePrerollSelect, 0x7000, 0xA82A);
  2958. extern pascal ComponentResult TuneUnroll(TunePlayer tp)
  2959.  FIVEWORDINLINE(0x2F3C, 0, kTuneUnrollSelect, 0x7000, 0xA82A);
  2960. #ifndef __MusicTrackEvent__
  2961. #define __MusicTrackEvent__
  2962.  
  2963. typedef unsigned long MusicOpWord, *MusicOpWordPtr;
  2964.  
  2965. #define kRestEventType 0x0L
  2966.  
  2967. #define kNoteEventType 0x1L
  2968.  
  2969. #define kControlEventType 0x2L
  2970.  
  2971. #define kMarkerEventType 0x3L
  2972.  
  2973. #define kUndefined1EventType 0x8L
  2974.  
  2975. #define kXNoteEventType 0x9L
  2976.  
  2977. #define kXControlEventType 0xAL
  2978.  
  2979. #define kKnobEventType 0xBL
  2980.  
  2981. #define kUndefined2EventType 0xCL
  2982.  
  2983. #define kUndefined3EventType 0xDL
  2984.  
  2985. #define kUndefined4EventType 0xEL
  2986.  
  2987. #define kGeneralEventType 0xFL
  2988.  
  2989. #define kXEventLengthBits 0x2L
  2990.  
  2991. #define kGeneralEventLengthBits 0x3L
  2992.  
  2993. #define kEventLen 1L
  2994.  
  2995. #define kXEventLen 2L
  2996.  
  2997. #define kRestEventLen kEventLen
  2998.  
  2999. #define kNoteEventLen kEventLen
  3000.  
  3001. #define kControlEventLen kEventLen
  3002.  
  3003. #define kMarkerEventLen kEventLen
  3004.  
  3005. #define kXNoteEventLen kXEventLen
  3006.  
  3007. #define kXControlEventLen kXEventLen
  3008.  
  3009. #define kGeneralEventLen kXEventLen
  3010.  
  3011. #define kEventLengthFieldPos 30
  3012.  
  3013. #define kEventLengthFieldWidth 2
  3014.  
  3015. #define kEventTypeFieldPos 29
  3016.  
  3017. #define kEventTypeFieldWidth 3
  3018.  
  3019. #define kXEventTypeFieldPos 28
  3020.  
  3021. #define kXEventTypeFieldWidth 4
  3022.  
  3023. #define kEventInstrumentFieldPos 24
  3024.  
  3025. #define kEventInstrumentFieldWidth 5
  3026.  
  3027. #define kXEventInstrumentFieldPos 16
  3028.  
  3029. #define kXEventInstrumentFieldWidth 12
  3030.  
  3031. #define kRestEventDurationFieldPos 0
  3032.  
  3033. #define kRestEventDurationFieldWidth 24
  3034.  
  3035. #define kRestEventDurationMax ((1 << kRestEventDurationFieldWidth) - 1)
  3036.  
  3037. #define kNoteEventPitchFieldPos 18
  3038.  
  3039. #define kNoteEventPitchFieldWidth 6
  3040.  
  3041. #define kNoteEventPitchOffset 32
  3042.  
  3043. #define kNoteEventVolumeFieldPos 11
  3044.  
  3045. #define kNoteEventVolumeFieldWidth 7
  3046.  
  3047. #define kNoteEventVolumeOffset 0
  3048.  
  3049. #define kNoteEventDurationFieldPos 0
  3050.  
  3051. #define kNoteEventDurationFieldWidth 11
  3052.  
  3053. #define kNoteEventDurationMax ((1 << kNoteEventDurationFieldWidth) - 1)
  3054.  
  3055. #define kXNoteEventPitchFieldPos 0
  3056.  
  3057. #define kXNoteEventPitchFieldWidth 16
  3058.  
  3059. #define kXNoteEventDurationFieldPos 0
  3060.  
  3061. #define kXNoteEventDurationFieldWidth 22
  3062.  
  3063. #define kXNoteEventDurationMax ((1 << kXNoteEventDurationFieldWidth) - 1)
  3064.  
  3065. #define kXNoteEventVolumeFieldPos 22
  3066.  
  3067. #define kXNoteEventVolumeFieldWidth 7
  3068.  
  3069. #define kControlEventControllerFieldPos 16
  3070.  
  3071. #define kControlEventControllerFieldWidth 8
  3072.  
  3073. #define kControlEventValueFieldPos 0
  3074.  
  3075. #define kControlEventValueFieldWidth 16
  3076.  
  3077. #define kXControlEventControllerFieldPos 0
  3078.  
  3079. #define kXControlEventControllerFieldWidth 16
  3080.  
  3081. #define kXControlEventValueFieldPos 0
  3082.  
  3083. #define kXControlEventValueFieldWidth 16
  3084.  
  3085. #define kKnobEventValueHighFieldPos 0
  3086.  
  3087. #define kKnobEventValueHighFieldWidth 16
  3088.  
  3089. #define kKnobEventKnobFieldPos 16
  3090.  
  3091. #define kKnobEventKnobFieldWidth 14
  3092.  
  3093. #define kKnobEventValueLowFieldPos 0
  3094.  
  3095. #define kKnobEventValueLowFieldWidth 16
  3096.  
  3097. #define kMarkerEventSubtypeFieldPos 16
  3098.  
  3099. #define kMarkerEventSubtypeFieldWidth 8
  3100.  
  3101. #define kMarkerEventValueFieldPos 0
  3102.  
  3103. #define kMarkerEventValueFieldWidth 16
  3104.  
  3105. #define kGeneralEventSubtypeFieldPos 16
  3106.  
  3107. #define kGeneralEventSubtypeFieldWidth 14
  3108.  
  3109. #define kGeneralEventLengthFieldPos 0
  3110.  
  3111. #define kGeneralEventLengthFieldWidth 16
  3112.  
  3113. #define MASK(bitWidth) ((1 << (bitWidth)) - 1)
  3114.  
  3115. #define EXT(val, pos, width) (((val) >> (pos)) & MASK(width))
  3116.  
  3117. #define _EventLength(x) ((EXT(x, kEventLengthFieldPos,  \
  3118.     kEventLengthFieldWidth) < 2) ? 1 :  \
  3119.     ((EXT(x, kEventLengthFieldPos, kEventLengthFieldWidth) == 2) ? 2 :  \
  3120.     EXT(x, kGeneralEventLengthFieldPos, kGeneralEventLengthFieldWidth)))
  3121.  
  3122. #define _EventType(x) ((EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth) > 3) ? EXT(x, kXEventTypeFieldPos, kXEventTypeFieldWidth) : EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth))
  3123.  
  3124. #define _RestDuration(x) (EXT(x, kRestEventDurationFieldPos, kRestEventDurationFieldWidth))
  3125.  
  3126. #define _Instrument(x) (EXT(x, kEventInstrumentFieldPos, kEventInstrumentFieldWidth))
  3127.  
  3128. #define _XInstrument(m, l) (EXT(m, kXEventInstrumentFieldPos, kXEventInstrumentFieldWidth))
  3129.  
  3130. #define _NotePitch(x) (EXT(x, kNoteEventPitchFieldPos, kNoteEventPitchFieldWidth) + kNoteEventPitchOffset)
  3131.  
  3132. #define _NoteVolume(x) (EXT(x, kNoteEventVolumeFieldPos, kNoteEventVolumeFieldWidth) + kNoteEventVolumeOffset)
  3133.  
  3134. #define _NoteDuration(x) (EXT(x, kNoteEventDurationFieldPos, kNoteEventDurationFieldWidth))
  3135.  
  3136. #define _NoteVelocity _NoteVolume
  3137.  
  3138. #define _XNotePitch(m, l) (EXT(m, kXNoteEventPitchFieldPos, kXNoteEventPitchFieldWidth))
  3139.  
  3140. #define _XNoteVolume(m, l) (EXT(l, kXNoteEventVolumeFieldPos, kXNoteEventVolumeFieldWidth))
  3141.  
  3142. #define _XNoteDuration(m, l) (EXT(l, kXNoteEventDurationFieldPos, kXNoteEventDurationFieldWidth))
  3143.  
  3144. #define _XNoteVelocity _XNoteVolume
  3145.  
  3146. #define _ControlController(x) (EXT(x, kControlEventControllerFieldPos, kControlEventControllerFieldWidth))
  3147.  
  3148. #define _ControlValue(x) (EXT(x, kControlEventValueFieldPos, kControlEventValueFieldWidth))
  3149.  
  3150. #define _XControlController(m, l) (EXT(m, kXControlEventControllerFieldPos, kXControlEventControllerFieldWidth))
  3151.  
  3152. #define _XControlValue(m, l) (EXT(m, kXControlEventValueFieldPos, kXControlEventValueFieldWidth))
  3153.  
  3154. #define _MarkerSubtype(x) (EXT(x,kMarkerEventSubtypeFieldPos,kMarkerEventSubtypeFieldWidth))
  3155.  
  3156. #define _MarkerValue(x) (EXT(x, kMarkerEventValueFieldPos, kMarkerEventValueFieldWidth))
  3157.  
  3158. #define _KnobValue(m, l) ((EXT(m,kKnobEventValueHighFieldPos,kKnobEventValueHighFieldWidth) << 16)     \
  3159.     | (EXT(l,kKnobEventValueLowFieldPos,kKnobEventValueLowFieldWidth)))
  3160.  
  3161. #define _KnobKnob(m, l) (EXT(l,kKnobEventKnobFieldPos,kKnobEventKnobFieldWidth))
  3162.  
  3163. #define _GeneralSubtype(m, l) (EXT(l,kGeneralEventSubtypeFieldPos,kGeneralEventSubtypeFieldWidth))
  3164.  
  3165. #define _GeneralLength(m, l) (EXT(m,kGeneralEventLengthFieldPos,kGeneralEventLengthFieldWidth))
  3166.  
  3167. #define _StuffRestEvent(x, duration)  \
  3168.     x = (kRestEventType << kEventTypeFieldPos)     \
  3169.     |    ((long)(duration) << kRestEventDurationFieldPos)
  3170.  
  3171. #define _StuffNoteEvent(x, instrument, pitch, volume, duration)  \
  3172.     x = (kNoteEventType << kEventTypeFieldPos)     \
  3173.     | ((long)(instrument) << kEventInstrumentFieldPos)     \
  3174.     |    (((long)(pitch) - kNoteEventPitchOffset) << kNoteEventPitchFieldPos)     \
  3175.     |    (((long)(volume) - kNoteEventVolumeOffset) << kNoteEventVolumeFieldPos)     \
  3176.     |    ((long)(duration) << kNoteEventDurationFieldPos)
  3177.  
  3178. #define _StuffControlEvent(x, instrument, control, value)  \
  3179.     x = (kControlEventType << kEventTypeFieldPos)     \
  3180.     | ((long)(instrument) << kEventInstrumentFieldPos)     \
  3181.     |    ((long)(control) << kControlEventControllerFieldPos)     \
  3182.     |    ((long)((value) & MASK(kControlEventValueFieldWidth)) << kControlEventValueFieldPos)
  3183.  
  3184. #define _StuffXNoteEvent(w1, w2, instrument, pitch, volume, duration)  \
  3185.     w1 = (kXNoteEventType << kXEventTypeFieldPos)     \
  3186.     |    ((long)(instrument) << kXEventInstrumentFieldPos)     \
  3187.     |    ((long)(pitch) << kXNoteEventPitchFieldPos),     \
  3188.     w2 =    (kXEventLengthBits << kEventLengthFieldPos)     \
  3189.     |    ((long)(duration) << kXNoteEventDurationFieldPos)     \
  3190.     |    ((long)(volume) << kXNoteEventVolumeFieldPos)    
  3191.  
  3192. #define _StuffXControlEvent(w1, w2, instrument, control, value)  \
  3193.     w1 = (kXControlEventType << kXEventTypeFieldPos)     \
  3194.     |    ((long)(instrument) << kXEventInstrumentFieldPos)     \
  3195.     |    ((long)((value) & MASK(kXControlEventValueFieldWidth)) << kXControlEventValueFieldPos),  \
  3196.     w2 =    (kXEventLengthBits << kEventLengthFieldPos)     \
  3197.     |    ((long)(control) << kXControlEventControllerFieldPos)
  3198.  
  3199. #define _StuffKnobEvent(w1, w2, instrument, knob, value)  \
  3200.     w1 =    (kKnobEventType << kXEventTypeFieldPos)     \
  3201.     |    ((long)(instrument) << kXEventInstrumentFieldPos)     \
  3202.     |    ((long)(value >> 16) << kKnobEventValueLowFieldPos),     \
  3203.     w2 =    (kXEventLengthBits << kEventLengthFieldPos)     \
  3204.     |    ((long)(knob) << kKnobEventKnobFieldPos)     \
  3205.     |    ((long)(value & 0xFFFF) << kKnobEventValueLowFieldPos)
  3206.  
  3207. #define _StuffGeneralEvent(w1, w2, instrument, subType, length)  \
  3208.     w1 =    (kGeneralEventType << kXEventTypeFieldPos)     \
  3209.     |    ((long)(instrument) << kXEventInstrumentFieldPos)     \
  3210.     |    ((long)(length) << kGeneralEventLengthFieldPos),     \
  3211.     w2 =    (kGeneralEventLengthBits << kEventLengthFieldPos)     \
  3212.     |    ((long)(subType) << kGeneralEventSubtypeFieldPos)     \
  3213.     |    ((long)(length) << kGeneralEventLengthFieldPos)
  3214.  
  3215. #define kGeneralEventNoteRequest 1
  3216.  
  3217. #define kGeneralEventInstrument 2
  3218.  
  3219. #define kGeneralEventSampleSound 3
  3220.  
  3221. #define kGeneralEventPartName 4
  3222.  
  3223. #define kGeneralEventPartKey 5
  3224.  
  3225. #endif
  3226.  
  3227. #ifndef _TimeCodeMediaHandler_
  3228. #define _TimeCodeMediaHandler_
  3229.  
  3230. #define TimeCodeMediaType 'tmcd'
  3231.  
  3232. #define TCSourceRefNameType 'name'
  3233.  
  3234. enum  {
  3235.     tcDropFrame                    = 1 << 0,
  3236.     tc24HourMax                    = 1 << 1,
  3237.     tcNegTimesOK                = 1 << 2,
  3238.     tcCounter                    = 1 << 3
  3239. };
  3240.  
  3241. #if defined(powerc) || defined (__powerc)
  3242. #pragma options align=mac68k
  3243. #endif
  3244. struct TimeCodeDef {
  3245.     long                        flags;
  3246.     TimeScale                    fTimeScale;
  3247.     TimeValue                    frameDuration;
  3248.     unsigned char                numFrames;
  3249. };
  3250. #if defined(powerc) || defined(__powerc)
  3251. #pragma options align=reset
  3252. #endif
  3253.  
  3254. typedef struct TimeCodeDef TimeCodeDef;
  3255.  
  3256. enum  {
  3257.     tctNegFlag                    = 0x80
  3258. };
  3259.  
  3260. #if defined(powerc) || defined (__powerc)
  3261. #pragma options align=mac68k
  3262. #endif
  3263. struct TimeCodeTime {
  3264.     unsigned char                hours;
  3265.     unsigned char                minutes;
  3266.     unsigned char                seconds;
  3267.     unsigned char                frames;
  3268. };
  3269. #if defined(powerc) || defined(__powerc)
  3270. #pragma options align=reset
  3271. #endif
  3272.  
  3273. typedef struct TimeCodeTime TimeCodeTime;
  3274.  
  3275. #if defined(powerc) || defined (__powerc)
  3276. #pragma options align=mac68k
  3277. #endif
  3278. struct TimeCodeCounter {
  3279.     long                        counter;
  3280. };
  3281. #if defined(powerc) || defined(__powerc)
  3282. #pragma options align=reset
  3283. #endif
  3284.  
  3285. typedef struct TimeCodeCounter TimeCodeCounter;
  3286.  
  3287. #if defined(powerc) || defined (__powerc)
  3288. #pragma options align=mac68k
  3289. #endif
  3290. union TimeCodeRecord {
  3291.     TimeCodeTime                t;
  3292.     TimeCodeCounter                c;
  3293. };
  3294. #if defined(powerc) || defined(__powerc)
  3295. #pragma options align=reset
  3296. #endif
  3297.  
  3298. typedef union TimeCodeRecord TimeCodeRecord;
  3299.  
  3300. #if defined(powerc) || defined (__powerc)
  3301. #pragma options align=mac68k
  3302. #endif
  3303. struct TimeCodeDescription {
  3304.     long                        descSize;
  3305.     long                        dataFormat;
  3306.     long                        resvd1;
  3307.     short                        resvd2;
  3308.     short                        dataRefIndex;
  3309.     long                        flags;
  3310.     TimeCodeDef                    timeCodeDef;
  3311.     long                        srcRef[1];
  3312. };
  3313. #if defined(powerc) || defined(__powerc)
  3314. #pragma options align=reset
  3315. #endif
  3316.  
  3317. typedef struct TimeCodeDescription TimeCodeDescription;
  3318.  
  3319. typedef TimeCodeDescription *TimeCodeDescriptionPtr;
  3320.  
  3321. typedef TimeCodeDescriptionPtr *TimeCodeDescriptionHandle;
  3322.  
  3323. enum  {
  3324.     tcdfShowTimeCode            = 1 << 0
  3325. };
  3326.  
  3327. enum  {
  3328.     kTCGetCurrentTimeCodeSelect    = 0x100 + 1,
  3329.     kTCGetTimeCodeAtTimeSelect,
  3330.     kTCTimeCodeToStringSelect,
  3331.     kTCTimeCodeToFrameNumberSelect,
  3332.     kTCFrameNumberToTimeCodeSelect,
  3333.     kTCGetSourceRefSelect,
  3334.     kTCSetSourceRefSelect,
  3335.     kTCSetTimeCodeFlagsSelect,
  3336.     kTCGetTimeCodeFlagsSelect,
  3337.     kTCSetDisplayOptionsSelect,
  3338.     kTCGetDisplayOptionsSelect
  3339. };
  3340.  
  3341. #if defined(powerc) || defined (__powerc)
  3342. #pragma options align=mac68k
  3343. #endif
  3344. struct TCTextOptions {
  3345.     short                        txFont;
  3346.     short                        txFace;
  3347.     short                        txSize;
  3348.     RGBColor                    foreColor;
  3349.     RGBColor                    backColor;
  3350. };
  3351. #if defined(powerc) || defined(__powerc)
  3352. #pragma options align=reset
  3353. #endif
  3354.  
  3355. typedef struct TCTextOptions TCTextOptions;
  3356.  
  3357. typedef TCTextOptions *TCTextOptionsPtr;
  3358.  
  3359. extern pascal HandlerError TCGetCurrentTimeCode(MediaHandler mh, long *frameNum, TimeCodeDef *tcdef, TimeCodeRecord *tcrec, UserData *srcRefH)
  3360.  FIVEWORDINLINE(0x2F3C, 0x10, kTCGetCurrentTimeCodeSelect, 0x7000, 0xA82A);
  3361. extern pascal HandlerError TCGetTimeCodeAtTime(MediaHandler mh, TimeValue mediaTime, long *frameNum, TimeCodeDef *tcdef, TimeCodeRecord *tcdata, UserData *srcRefH)
  3362.  FIVEWORDINLINE(0x2F3C, 0x14, kTCGetTimeCodeAtTimeSelect, 0x7000, 0xA82A);
  3363. extern pascal HandlerError TCTimeCodeToFrameNumber(MediaHandler mh, TimeCodeDef *tcdef, TimeCodeRecord *tcrec, long *frameNumber)
  3364.  FIVEWORDINLINE(0x2F3C, 0xC, kTCTimeCodeToFrameNumberSelect, 0x7000, 0xA82A);
  3365. extern pascal HandlerError TCFrameNumberToTimeCode(MediaHandler mh, long frameNumber, TimeCodeDef *tcdef, TimeCodeRecord *tcrec)
  3366.  FIVEWORDINLINE(0x2F3C, 0xC, kTCFrameNumberToTimeCodeSelect, 0x7000, 0xA82A);
  3367. extern pascal HandlerError TCTimeCodeToString(MediaHandler mh, TimeCodeDef *tcdef, TimeCodeRecord *tcrec, StringPtr tcStr)
  3368.  FIVEWORDINLINE(0x2F3C, 0xC, kTCTimeCodeToStringSelect, 0x7000, 0xA82A);
  3369. extern pascal HandlerError TCGetSourceRef(MediaHandler mh, TimeCodeDescriptionHandle tcdH, UserData *srefH)
  3370.  FIVEWORDINLINE(0x2F3C, 0x8, kTCGetSourceRefSelect, 0x7000, 0xA82A);
  3371. extern pascal HandlerError TCSetSourceRef(MediaHandler mh, TimeCodeDescriptionHandle tcdH, UserData srefH)
  3372.  FIVEWORDINLINE(0x2F3C, 0x8, kTCSetSourceRefSelect, 0x7000, 0xA82A);
  3373. extern pascal HandlerError TCSetTimeCodeFlags(MediaHandler mh, long flags, long flagsMask)
  3374.  FIVEWORDINLINE(0x2F3C, 0x8, kTCSetTimeCodeFlagsSelect, 0x7000, 0xA82A);
  3375. extern pascal HandlerError TCGetTimeCodeFlags(MediaHandler mh, long *flags)
  3376.  FIVEWORDINLINE(0x2F3C, 0x4, kTCGetTimeCodeFlagsSelect, 0x7000, 0xA82A);
  3377. extern pascal HandlerError TCSetDisplayOptions(MediaHandler mh, TCTextOptionsPtr textOptions)
  3378.  FIVEWORDINLINE(0x2F3C, 0x4, kTCSetDisplayOptionsSelect, 0x7000, 0xA82A);
  3379. extern pascal HandlerError TCGetDisplayOptions(MediaHandler mh, TCTextOptionsPtr textOptions)
  3380.  FIVEWORDINLINE(0x2F3C, 0x4, kTCGetDisplayOptionsSelect, 0x7000, 0xA82A);
  3381. #endif
  3382.  
  3383. #endif
  3384.  
  3385.