1/*
2 * Copyright (c) 2009 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*
24     File:       IsochronousDataHandler.i.c
25
26     Contains:   Component Manager based Isochronous Data Handler
27
28     Copyright:  � 1997-2001 by Apple Computer, Inc., all rights reserved.
29
30     Warning:    *** APPLE INTERNAL USE ONLY ***
31                 This file may contain unreleased API's
32
33     BuildInfo:  Built by:            wgulland
34                 On:                  Tue Mar 12 16:49:01 2002
35                 With Interfacer:     3.0d35   (Mac OS X for PowerPC)
36                 From:                IsochronousDataHandler.i
37                     Revision:        1.5
38                     Dated:           2001/10/05 16:46:32
39                     Last change by:  wgulland
40                     Last comment:    Add inputFormat to IDHDeviceStatus structure
41
42     Bugs:       Report bugs to Radar component "System Interfaces", "Latest"
43                 List the version information (from above) in the Problem Description.
44
45*/
46
47
48#include <CoreServices/CoreServices.h>
49//#include <CarbonCore/MixedMode.h>
50//#include <CarbonCore/Components.h>
51#include <DVComponentGlue/IsochronousDataHandler.h>
52#if MP_SUPPORT
53	#include "MPMixedModeSupport.h"
54#endif
55
56#define TOOLBOX_TRAPADDRESS(trapNum) (*(((UniversalProcPtr*)(((trapNum & 0x03FF) << 2) + 0xE00))))
57#define OS_TRAPADDRESS(trapNum)      (*(((UniversalProcPtr*)(((trapNum & 0x00FF) << 2) + 0x400))))
58
59#ifndef TRAPGLUE_NO_COMPONENT_CALL
60DEFINE_API( ComponentResult ) IDHGetDeviceList(ComponentInstance idh, QTAtomContainer* deviceList)
61{
62	#if PRAGMA_STRUCT_ALIGN
63	  #pragma options align=mac68k
64	#elif PRAGMA_STRUCT_PACKPUSH
65	  #pragma pack(push, 2)
66	#elif PRAGMA_STRUCT_PACK
67	  #pragma pack(2)
68	#endif
69	struct IDHGetDeviceListGluePB {
70		unsigned char                  componentFlags;
71		unsigned char                  componentParamSize;
72		short                          componentWhat;
73		QTAtomContainer*               deviceList;
74		ComponentInstance              idh;
75	};
76	#if PRAGMA_STRUCT_ALIGN
77	  #pragma options align=reset
78	#elif PRAGMA_STRUCT_PACKPUSH
79	  #pragma pack(pop)
80	#elif PRAGMA_STRUCT_PACK
81	  #pragma pack()
82	#endif
83
84	#if OLD_COMPONENT_GLUE
85	struct IDHGetDeviceListGluePB myIDHGetDeviceListGluePB = {
86		0,
87		4,
88		1
89	};
90
91	#else
92	struct IDHGetDeviceListGluePB myIDHGetDeviceListGluePB;
93//	*((unsigned long*)&myIDHGetDeviceListGluePB) = 0x00040001;
94
95	myIDHGetDeviceListGluePB.componentFlags = 0;
96	myIDHGetDeviceListGluePB.componentParamSize = 4;
97	myIDHGetDeviceListGluePB.componentWhat = 1;
98
99	#endif
100
101	myIDHGetDeviceListGluePB.deviceList = deviceList;
102	myIDHGetDeviceListGluePB.idh = idh;
103
104	#if TARGET_API_MAC_OS8
105		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHGetDeviceListGluePB);
106	#else
107		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHGetDeviceListGluePB );
108	#endif
109}
110#endif
111
112
113#ifndef TRAPGLUE_NO_COMPONENT_CALL
114DEFINE_API( ComponentResult ) IDHGetDeviceConfiguration(ComponentInstance idh, QTAtomSpec* configurationID)
115{
116	#if PRAGMA_STRUCT_ALIGN
117	  #pragma options align=mac68k
118	#elif PRAGMA_STRUCT_PACKPUSH
119	  #pragma pack(push, 2)
120	#elif PRAGMA_STRUCT_PACK
121	  #pragma pack(2)
122	#endif
123	struct IDHGetDeviceConfigurationGluePB {
124		unsigned char                  componentFlags;
125		unsigned char                  componentParamSize;
126		short                          componentWhat;
127		QTAtomSpec*                    configurationID;
128		ComponentInstance              idh;
129	};
130	#if PRAGMA_STRUCT_ALIGN
131	  #pragma options align=reset
132	#elif PRAGMA_STRUCT_PACKPUSH
133	  #pragma pack(pop)
134	#elif PRAGMA_STRUCT_PACK
135	  #pragma pack()
136	#endif
137
138	#if OLD_COMPONENT_GLUE
139	struct IDHGetDeviceConfigurationGluePB myIDHGetDeviceConfigurationGluePB = {
140		0,
141		4,
142		2
143	};
144
145	#else
146	struct IDHGetDeviceConfigurationGluePB myIDHGetDeviceConfigurationGluePB;
147//	*((unsigned long*)&myIDHGetDeviceConfigurationGluePB) = 0x00040002;
148
149	myIDHGetDeviceConfigurationGluePB.componentFlags = 0;
150	myIDHGetDeviceConfigurationGluePB.componentParamSize = 4;
151	myIDHGetDeviceConfigurationGluePB.componentWhat = 2;
152
153	#endif
154
155	myIDHGetDeviceConfigurationGluePB.configurationID = configurationID;
156	myIDHGetDeviceConfigurationGluePB.idh = idh;
157
158	#if TARGET_API_MAC_OS8
159		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHGetDeviceConfigurationGluePB);
160	#else
161		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHGetDeviceConfigurationGluePB );
162	#endif
163}
164#endif
165
166
167#ifndef TRAPGLUE_NO_COMPONENT_CALL
168DEFINE_API( ComponentResult ) IDHSetDeviceConfiguration(ComponentInstance idh, const QTAtomSpec* configurationID)
169{
170	#if PRAGMA_STRUCT_ALIGN
171	  #pragma options align=mac68k
172	#elif PRAGMA_STRUCT_PACKPUSH
173	  #pragma pack(push, 2)
174	#elif PRAGMA_STRUCT_PACK
175	  #pragma pack(2)
176	#endif
177	struct IDHSetDeviceConfigurationGluePB {
178		unsigned char                  componentFlags;
179		unsigned char                  componentParamSize;
180		short                          componentWhat;
181		const QTAtomSpec*              configurationID;
182		ComponentInstance              idh;
183	};
184	#if PRAGMA_STRUCT_ALIGN
185	  #pragma options align=reset
186	#elif PRAGMA_STRUCT_PACKPUSH
187	  #pragma pack(pop)
188	#elif PRAGMA_STRUCT_PACK
189	  #pragma pack()
190	#endif
191
192	#if OLD_COMPONENT_GLUE
193	struct IDHSetDeviceConfigurationGluePB myIDHSetDeviceConfigurationGluePB = {
194		0,
195		4,
196		3
197	};
198
199	#else
200	struct IDHSetDeviceConfigurationGluePB myIDHSetDeviceConfigurationGluePB;
201	//*((unsigned long*)&myIDHSetDeviceConfigurationGluePB) = 0x00040003;
202
203	myIDHSetDeviceConfigurationGluePB.componentFlags = 0;
204	myIDHSetDeviceConfigurationGluePB.componentParamSize = 4;
205	myIDHSetDeviceConfigurationGluePB.componentWhat = 3;
206
207	#endif
208
209	myIDHSetDeviceConfigurationGluePB.configurationID = configurationID;
210	myIDHSetDeviceConfigurationGluePB.idh = idh;
211
212	#if TARGET_API_MAC_OS8
213		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHSetDeviceConfigurationGluePB);
214	#else
215		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHSetDeviceConfigurationGluePB );
216	#endif
217}
218#endif
219
220
221#ifndef TRAPGLUE_NO_COMPONENT_CALL
222DEFINE_API( ComponentResult ) IDHGetDeviceStatus(ComponentInstance idh, const QTAtomSpec* configurationID, IDHDeviceStatus* status)
223{
224	#if PRAGMA_STRUCT_ALIGN
225	  #pragma options align=mac68k
226	#elif PRAGMA_STRUCT_PACKPUSH
227	  #pragma pack(push, 2)
228	#elif PRAGMA_STRUCT_PACK
229	  #pragma pack(2)
230	#endif
231	struct IDHGetDeviceStatusGluePB {
232		unsigned char                  componentFlags;
233		unsigned char                  componentParamSize;
234		short                          componentWhat;
235		IDHDeviceStatus*               status;
236		const QTAtomSpec*              configurationID;
237		ComponentInstance              idh;
238	};
239	#if PRAGMA_STRUCT_ALIGN
240	  #pragma options align=reset
241	#elif PRAGMA_STRUCT_PACKPUSH
242	  #pragma pack(pop)
243	#elif PRAGMA_STRUCT_PACK
244	  #pragma pack()
245	#endif
246
247	#if OLD_COMPONENT_GLUE
248	struct IDHGetDeviceStatusGluePB myIDHGetDeviceStatusGluePB = {
249		0,
250		8,
251		4
252	};
253
254	#else
255	struct IDHGetDeviceStatusGluePB myIDHGetDeviceStatusGluePB;
256//	*((unsigned long*)&myIDHGetDeviceStatusGluePB) = 0x00080004;
257
258	myIDHGetDeviceStatusGluePB.componentFlags = 0;
259	myIDHGetDeviceStatusGluePB.componentParamSize = 8;
260	myIDHGetDeviceStatusGluePB.componentWhat = 4;
261
262	#endif
263
264	myIDHGetDeviceStatusGluePB.status = status;
265	myIDHGetDeviceStatusGluePB.configurationID = configurationID;
266	myIDHGetDeviceStatusGluePB.idh = idh;
267
268	#if TARGET_API_MAC_OS8
269		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHGetDeviceStatusGluePB);
270	#else
271		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHGetDeviceStatusGluePB );
272	#endif
273}
274#endif
275
276
277#ifndef TRAPGLUE_NO_COMPONENT_CALL
278DEFINE_API( ComponentResult ) IDHGetDeviceClock(ComponentInstance idh, Component* clock)
279{
280	#if PRAGMA_STRUCT_ALIGN
281	  #pragma options align=mac68k
282	#elif PRAGMA_STRUCT_PACKPUSH
283	  #pragma pack(push, 2)
284	#elif PRAGMA_STRUCT_PACK
285	  #pragma pack(2)
286	#endif
287	struct IDHGetDeviceClockGluePB {
288		unsigned char                  componentFlags;
289		unsigned char                  componentParamSize;
290		short                          componentWhat;
291		Component*                     clock;
292		ComponentInstance              idh;
293	};
294	#if PRAGMA_STRUCT_ALIGN
295	  #pragma options align=reset
296	#elif PRAGMA_STRUCT_PACKPUSH
297	  #pragma pack(pop)
298	#elif PRAGMA_STRUCT_PACK
299	  #pragma pack()
300	#endif
301
302	#if OLD_COMPONENT_GLUE
303	struct IDHGetDeviceClockGluePB myIDHGetDeviceClockGluePB = {
304		0,
305		4,
306		5
307	};
308
309	#else
310	struct IDHGetDeviceClockGluePB myIDHGetDeviceClockGluePB;
311//	*((unsigned long*)&myIDHGetDeviceClockGluePB) = 0x00040005;
312
313	myIDHGetDeviceClockGluePB.componentFlags = 0;
314	myIDHGetDeviceClockGluePB.componentParamSize = 4;
315	myIDHGetDeviceClockGluePB.componentWhat = 5;
316
317	#endif
318
319	myIDHGetDeviceClockGluePB.clock = clock;
320	myIDHGetDeviceClockGluePB.idh = idh;
321
322	#if TARGET_API_MAC_OS8
323		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHGetDeviceClockGluePB);
324	#else
325		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHGetDeviceClockGluePB );
326	#endif
327}
328#endif
329
330
331#ifndef TRAPGLUE_NO_COMPONENT_CALL
332DEFINE_API( ComponentResult ) IDHOpenDevice(ComponentInstance idh, UInt32 permissions)
333{
334	#if PRAGMA_STRUCT_ALIGN
335	  #pragma options align=mac68k
336	#elif PRAGMA_STRUCT_PACKPUSH
337	  #pragma pack(push, 2)
338	#elif PRAGMA_STRUCT_PACK
339	  #pragma pack(2)
340	#endif
341	struct IDHOpenDeviceGluePB {
342		unsigned char                  componentFlags;
343		unsigned char                  componentParamSize;
344		short                          componentWhat;
345		UInt32                         permissions;
346		ComponentInstance              idh;
347	};
348	#if PRAGMA_STRUCT_ALIGN
349	  #pragma options align=reset
350	#elif PRAGMA_STRUCT_PACKPUSH
351	  #pragma pack(pop)
352	#elif PRAGMA_STRUCT_PACK
353	  #pragma pack()
354	#endif
355
356	#if OLD_COMPONENT_GLUE
357	struct IDHOpenDeviceGluePB myIDHOpenDeviceGluePB = {
358		0,
359		4,
360		6
361	};
362
363	#else
364	struct IDHOpenDeviceGluePB myIDHOpenDeviceGluePB;
365//	*((unsigned long*)&myIDHOpenDeviceGluePB) = 0x00040006;
366
367	myIDHOpenDeviceGluePB.componentFlags = 0;
368	myIDHOpenDeviceGluePB.componentParamSize = 4;
369	myIDHOpenDeviceGluePB.componentWhat = 6;
370
371	#endif
372
373	myIDHOpenDeviceGluePB.permissions = permissions;
374	myIDHOpenDeviceGluePB.idh = idh;
375
376	#if TARGET_API_MAC_OS8
377		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHOpenDeviceGluePB);
378	#else
379		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHOpenDeviceGluePB );
380	#endif
381}
382#endif
383
384
385#ifndef TRAPGLUE_NO_COMPONENT_CALL
386DEFINE_API( ComponentResult ) IDHCloseDevice(ComponentInstance idh)
387{
388	#if PRAGMA_STRUCT_ALIGN
389	  #pragma options align=mac68k
390	#elif PRAGMA_STRUCT_PACKPUSH
391	  #pragma pack(push, 2)
392	#elif PRAGMA_STRUCT_PACK
393	  #pragma pack(2)
394	#endif
395	struct IDHCloseDeviceGluePB {
396		unsigned char                  componentFlags;
397		unsigned char                  componentParamSize;
398		short                          componentWhat;
399		ComponentInstance              idh;
400	};
401	#if PRAGMA_STRUCT_ALIGN
402	  #pragma options align=reset
403	#elif PRAGMA_STRUCT_PACKPUSH
404	  #pragma pack(pop)
405	#elif PRAGMA_STRUCT_PACK
406	  #pragma pack()
407	#endif
408
409	#if OLD_COMPONENT_GLUE
410	struct IDHCloseDeviceGluePB myIDHCloseDeviceGluePB = {
411		0,
412		0,
413		7
414	};
415
416	#else
417	struct IDHCloseDeviceGluePB myIDHCloseDeviceGluePB;
418	//*((unsigned long*)&myIDHCloseDeviceGluePB) = 0x00000007;
419
420	myIDHCloseDeviceGluePB.componentFlags = 0;
421	myIDHCloseDeviceGluePB.componentParamSize = 0;
422	myIDHCloseDeviceGluePB.componentWhat = 7;
423
424	#endif
425
426	myIDHCloseDeviceGluePB.idh = idh;
427
428	#if TARGET_API_MAC_OS8
429		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHCloseDeviceGluePB);
430	#else
431		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHCloseDeviceGluePB );
432	#endif
433}
434#endif
435
436
437#ifndef TRAPGLUE_NO_COMPONENT_CALL
438DEFINE_API( ComponentResult ) IDHRead(ComponentInstance idh, IDHParameterBlock* pb)
439{
440	#if PRAGMA_STRUCT_ALIGN
441	  #pragma options align=mac68k
442	#elif PRAGMA_STRUCT_PACKPUSH
443	  #pragma pack(push, 2)
444	#elif PRAGMA_STRUCT_PACK
445	  #pragma pack(2)
446	#endif
447	struct IDHReadGluePB {
448		unsigned char                  componentFlags;
449		unsigned char                  componentParamSize;
450		short                          componentWhat;
451		IDHParameterBlock*             pb;
452		ComponentInstance              idh;
453	};
454	#if PRAGMA_STRUCT_ALIGN
455	  #pragma options align=reset
456	#elif PRAGMA_STRUCT_PACKPUSH
457	  #pragma pack(pop)
458	#elif PRAGMA_STRUCT_PACK
459	  #pragma pack()
460	#endif
461
462	#if OLD_COMPONENT_GLUE
463	struct IDHReadGluePB myIDHReadGluePB = {
464		0,
465		4,
466		8
467	};
468
469	#else
470	struct IDHReadGluePB myIDHReadGluePB;
471	//*((unsigned long*)&myIDHReadGluePB) = 0x00040008;
472
473	myIDHReadGluePB.componentFlags = 0;
474	myIDHReadGluePB.componentParamSize = 4;
475	myIDHReadGluePB.componentWhat = 8;
476
477	#endif
478
479	myIDHReadGluePB.pb = pb;
480	myIDHReadGluePB.idh = idh;
481
482	#if TARGET_API_MAC_OS8
483		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHReadGluePB);
484	#else
485		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHReadGluePB );
486	#endif
487}
488#endif
489
490
491#ifndef TRAPGLUE_NO_COMPONENT_CALL
492DEFINE_API( ComponentResult ) IDHWrite(ComponentInstance idh, IDHParameterBlock* pb)
493{
494	#if PRAGMA_STRUCT_ALIGN
495	  #pragma options align=mac68k
496	#elif PRAGMA_STRUCT_PACKPUSH
497	  #pragma pack(push, 2)
498	#elif PRAGMA_STRUCT_PACK
499	  #pragma pack(2)
500	#endif
501	struct IDHWriteGluePB {
502		unsigned char                  componentFlags;
503		unsigned char                  componentParamSize;
504		short                          componentWhat;
505		IDHParameterBlock*             pb;
506		ComponentInstance              idh;
507	};
508	#if PRAGMA_STRUCT_ALIGN
509	  #pragma options align=reset
510	#elif PRAGMA_STRUCT_PACKPUSH
511	  #pragma pack(pop)
512	#elif PRAGMA_STRUCT_PACK
513	  #pragma pack()
514	#endif
515
516	#if OLD_COMPONENT_GLUE
517	struct IDHWriteGluePB myIDHWriteGluePB = {
518		0,
519		4,
520		9
521	};
522
523	#else
524	struct IDHWriteGluePB myIDHWriteGluePB;
525	*((unsigned long*)&myIDHWriteGluePB) = 0x00040009;
526
527	myIDHWriteGluePB.componentFlags = 0;
528	myIDHWriteGluePB.componentParamSize = 4;
529	myIDHWriteGluePB.componentWhat = 9;
530
531	#endif
532
533	myIDHWriteGluePB.pb = pb;
534	myIDHWriteGluePB.idh = idh;
535
536	#if TARGET_API_MAC_OS8
537		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHWriteGluePB);
538	#else
539		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHWriteGluePB );
540	#endif
541}
542#endif
543
544
545#ifndef TRAPGLUE_NO_COMPONENT_CALL
546DEFINE_API( ComponentResult ) IDHNewNotification(ComponentInstance idh, IDHDeviceID deviceID, IDHNotificationUPP notificationProc, void* userData, IDHNotificationID* notificationID)
547{
548	//printf( "IDHNewNotification\n" );
549
550	#if PRAGMA_STRUCT_ALIGN
551	  #pragma options align=mac68k
552	#elif PRAGMA_STRUCT_PACKPUSH
553	  #pragma pack(push, 2)
554	#elif PRAGMA_STRUCT_PACK
555	  #pragma pack(2)
556	#endif
557	struct IDHNewNotificationGluePB {
558		unsigned char                  componentFlags;
559		unsigned char                  componentParamSize;
560		short                          componentWhat;
561		IDHNotificationID*             notificationID;
562		void*                          userData;
563		IDHNotificationUPP             notificationProc;
564		IDHDeviceID                    deviceID;
565		ComponentInstance              idh;
566	};
567	#if PRAGMA_STRUCT_ALIGN
568	  #pragma options align=reset
569	#elif PRAGMA_STRUCT_PACKPUSH
570	  #pragma pack(pop)
571	#elif PRAGMA_STRUCT_PACK
572	  #pragma pack()
573	#endif
574
575	#if OLD_COMPONENT_GLUE
576	struct IDHNewNotificationGluePB myIDHNewNotificationGluePB = {
577		0,
578		16,
579		10
580	};
581
582	#else
583	struct IDHNewNotificationGluePB myIDHNewNotificationGluePB;
584	//*((unsigned long*)&myIDHNewNotificationGluePB) = 0x0010000A;
585
586	myIDHNewNotificationGluePB.componentFlags = 0;
587	myIDHNewNotificationGluePB.componentParamSize = 16;
588	myIDHNewNotificationGluePB.componentWhat = 10;
589	#endif
590
591	myIDHNewNotificationGluePB.notificationID = notificationID;
592	myIDHNewNotificationGluePB.userData = userData;
593	myIDHNewNotificationGluePB.notificationProc = notificationProc;
594	myIDHNewNotificationGluePB.deviceID = deviceID;
595	myIDHNewNotificationGluePB.idh = idh;
596
597	#if TARGET_API_MAC_OS8
598		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHNewNotificationGluePB);
599	#else
600		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHNewNotificationGluePB );
601	#endif
602}
603#endif
604
605
606#ifndef TRAPGLUE_NO_COMPONENT_CALL
607DEFINE_API( ComponentResult ) IDHNotifyMeWhen(ComponentInstance idh, IDHNotificationID notificationID, IDHEvent events)
608{
609	#if PRAGMA_STRUCT_ALIGN
610	  #pragma options align=mac68k
611	#elif PRAGMA_STRUCT_PACKPUSH
612	  #pragma pack(push, 2)
613	#elif PRAGMA_STRUCT_PACK
614	  #pragma pack(2)
615	#endif
616	struct IDHNotifyMeWhenGluePB {
617		unsigned char                  componentFlags;
618		unsigned char                  componentParamSize;
619		short                          componentWhat;
620		IDHEvent                       events;
621		IDHNotificationID              notificationID;
622		ComponentInstance              idh;
623	};
624	#if PRAGMA_STRUCT_ALIGN
625	  #pragma options align=reset
626	#elif PRAGMA_STRUCT_PACKPUSH
627	  #pragma pack(pop)
628	#elif PRAGMA_STRUCT_PACK
629	  #pragma pack()
630	#endif
631
632	#if OLD_COMPONENT_GLUE
633	struct IDHNotifyMeWhenGluePB myIDHNotifyMeWhenGluePB = {
634		0,
635		8,
636		11
637	};
638
639	#else
640	struct IDHNotifyMeWhenGluePB myIDHNotifyMeWhenGluePB;
641	//*((unsigned long*)&myIDHNotifyMeWhenGluePB) = 0x0008000B;
642
643	myIDHNotifyMeWhenGluePB.componentFlags = 0;
644	myIDHNotifyMeWhenGluePB.componentParamSize = 8;
645	myIDHNotifyMeWhenGluePB.componentWhat = 11;
646
647	#endif
648
649	myIDHNotifyMeWhenGluePB.events = events;
650	myIDHNotifyMeWhenGluePB.notificationID = notificationID;
651	myIDHNotifyMeWhenGluePB.idh = idh;
652
653	#if TARGET_API_MAC_OS8
654		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHNotifyMeWhenGluePB);
655	#else
656		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHNotifyMeWhenGluePB );
657	#endif
658}
659#endif
660
661
662#ifndef TRAPGLUE_NO_COMPONENT_CALL
663DEFINE_API( ComponentResult ) IDHCancelNotification(ComponentInstance idh, IDHNotificationID notificationID)
664{
665	#if PRAGMA_STRUCT_ALIGN
666	  #pragma options align=mac68k
667	#elif PRAGMA_STRUCT_PACKPUSH
668	  #pragma pack(push, 2)
669	#elif PRAGMA_STRUCT_PACK
670	  #pragma pack(2)
671	#endif
672	struct IDHCancelNotificationGluePB {
673		unsigned char                  componentFlags;
674		unsigned char                  componentParamSize;
675		short                          componentWhat;
676		IDHNotificationID              notificationID;
677		ComponentInstance              idh;
678	};
679	#if PRAGMA_STRUCT_ALIGN
680	  #pragma options align=reset
681	#elif PRAGMA_STRUCT_PACKPUSH
682	  #pragma pack(pop)
683	#elif PRAGMA_STRUCT_PACK
684	  #pragma pack()
685	#endif
686
687	#if OLD_COMPONENT_GLUE
688	struct IDHCancelNotificationGluePB myIDHCancelNotificationGluePB = {
689		0,
690		4,
691		12
692	};
693
694	#else
695	struct IDHCancelNotificationGluePB myIDHCancelNotificationGluePB;
696//	*((unsigned long*)&myIDHCancelNotificationGluePB) = 0x0004000C;
697
698	myIDHCancelNotificationGluePB.componentFlags = 0;
699	myIDHCancelNotificationGluePB.componentParamSize = 4;
700	myIDHCancelNotificationGluePB.componentWhat = 12;
701
702	#endif
703
704	myIDHCancelNotificationGluePB.notificationID = notificationID;
705	myIDHCancelNotificationGluePB.idh = idh;
706
707	#if TARGET_API_MAC_OS8
708		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHCancelNotificationGluePB);
709	#else
710		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHCancelNotificationGluePB );
711	#endif
712}
713#endif
714
715
716#ifndef TRAPGLUE_NO_COMPONENT_CALL
717DEFINE_API( ComponentResult ) IDHDisposeNotification(ComponentInstance idh, IDHNotificationID notificationID)
718{
719	#if PRAGMA_STRUCT_ALIGN
720	  #pragma options align=mac68k
721	#elif PRAGMA_STRUCT_PACKPUSH
722	  #pragma pack(push, 2)
723	#elif PRAGMA_STRUCT_PACK
724	  #pragma pack(2)
725	#endif
726	struct IDHDisposeNotificationGluePB {
727		unsigned char                  componentFlags;
728		unsigned char                  componentParamSize;
729		short                          componentWhat;
730		IDHNotificationID              notificationID;
731		ComponentInstance              idh;
732	};
733	#if PRAGMA_STRUCT_ALIGN
734	  #pragma options align=reset
735	#elif PRAGMA_STRUCT_PACKPUSH
736	  #pragma pack(pop)
737	#elif PRAGMA_STRUCT_PACK
738	  #pragma pack()
739	#endif
740
741	#if OLD_COMPONENT_GLUE
742	struct IDHDisposeNotificationGluePB myIDHDisposeNotificationGluePB = {
743		0,
744		4,
745		13
746	};
747
748	#else
749	struct IDHDisposeNotificationGluePB myIDHDisposeNotificationGluePB;
750//	*((unsigned long*)&myIDHDisposeNotificationGluePB) = 0x0004000D;
751
752	myIDHDisposeNotificationGluePB.componentFlags = 0;
753	myIDHDisposeNotificationGluePB.componentParamSize = 4;
754	myIDHDisposeNotificationGluePB.componentWhat = 13;
755
756	#endif
757
758	myIDHDisposeNotificationGluePB.notificationID = notificationID;
759	myIDHDisposeNotificationGluePB.idh = idh;
760
761	#if TARGET_API_MAC_OS8
762		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHDisposeNotificationGluePB);
763	#else
764		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHDisposeNotificationGluePB );
765	#endif
766}
767#endif
768
769
770#ifndef TRAPGLUE_NO_COMPONENT_CALL
771DEFINE_API( ComponentResult ) IDHReleaseBuffer(ComponentInstance idh, IDHParameterBlock* pb)
772{
773	#if PRAGMA_STRUCT_ALIGN
774	  #pragma options align=mac68k
775	#elif PRAGMA_STRUCT_PACKPUSH
776	  #pragma pack(push, 2)
777	#elif PRAGMA_STRUCT_PACK
778	  #pragma pack(2)
779	#endif
780	struct IDHReleaseBufferGluePB {
781		unsigned char                  componentFlags;
782		unsigned char                  componentParamSize;
783		short                          componentWhat;
784		IDHParameterBlock*             pb;
785		ComponentInstance              idh;
786	};
787	#if PRAGMA_STRUCT_ALIGN
788	  #pragma options align=reset
789	#elif PRAGMA_STRUCT_PACKPUSH
790	  #pragma pack(pop)
791	#elif PRAGMA_STRUCT_PACK
792	  #pragma pack()
793	#endif
794
795	#if OLD_COMPONENT_GLUE
796	struct IDHReleaseBufferGluePB myIDHReleaseBufferGluePB = {
797		0,
798		4,
799		14
800	};
801
802	#else
803	struct IDHReleaseBufferGluePB myIDHReleaseBufferGluePB;
804//	*((unsigned long*)&myIDHReleaseBufferGluePB) = 0x0004000E;
805
806	myIDHReleaseBufferGluePB.componentFlags = 0;
807	myIDHReleaseBufferGluePB.componentParamSize = 4;
808	myIDHReleaseBufferGluePB.componentWhat = 14;
809
810	#endif
811
812	myIDHReleaseBufferGluePB.pb = pb;
813	myIDHReleaseBufferGluePB.idh = idh;
814
815	#if TARGET_API_MAC_OS8
816		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHReleaseBufferGluePB);
817	#else
818		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHReleaseBufferGluePB );
819	#endif
820}
821#endif
822
823
824#ifndef TRAPGLUE_NO_COMPONENT_CALL
825DEFINE_API( ComponentResult ) IDHCancelPendingIO(ComponentInstance idh, IDHParameterBlock* pb)
826{
827	#if PRAGMA_STRUCT_ALIGN
828	  #pragma options align=mac68k
829	#elif PRAGMA_STRUCT_PACKPUSH
830	  #pragma pack(push, 2)
831	#elif PRAGMA_STRUCT_PACK
832	  #pragma pack(2)
833	#endif
834	struct IDHCancelPendingIOGluePB {
835		unsigned char                  componentFlags;
836		unsigned char                  componentParamSize;
837		short                          componentWhat;
838		IDHParameterBlock*             pb;
839		ComponentInstance              idh;
840	};
841	#if PRAGMA_STRUCT_ALIGN
842	  #pragma options align=reset
843	#elif PRAGMA_STRUCT_PACKPUSH
844	  #pragma pack(pop)
845	#elif PRAGMA_STRUCT_PACK
846	  #pragma pack()
847	#endif
848
849	#if OLD_COMPONENT_GLUE
850	struct IDHCancelPendingIOGluePB myIDHCancelPendingIOGluePB = {
851		0,
852		4,
853		15
854	};
855
856	#else
857	struct IDHCancelPendingIOGluePB myIDHCancelPendingIOGluePB;
858//	*((unsigned long*)&myIDHCancelPendingIOGluePB) = 0x0004000F;
859
860	myIDHCancelPendingIOGluePB.componentFlags = 0;
861	myIDHCancelPendingIOGluePB.componentParamSize = 4;
862	myIDHCancelPendingIOGluePB.componentWhat = 15;
863
864	#endif
865
866	myIDHCancelPendingIOGluePB.pb = pb;
867	myIDHCancelPendingIOGluePB.idh = idh;
868
869	#if TARGET_API_MAC_OS8
870		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHCancelPendingIOGluePB);
871	#else
872		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHCancelPendingIOGluePB );
873	#endif
874}
875#endif
876
877
878#ifndef TRAPGLUE_NO_COMPONENT_CALL
879DEFINE_API( ComponentResult ) IDHGetDeviceControl(ComponentInstance idh, ComponentInstance* deviceControl)
880{
881	#if PRAGMA_STRUCT_ALIGN
882	  #pragma options align=mac68k
883	#elif PRAGMA_STRUCT_PACKPUSH
884	  #pragma pack(push, 2)
885	#elif PRAGMA_STRUCT_PACK
886	  #pragma pack(2)
887	#endif
888	struct IDHGetDeviceControlGluePB {
889		unsigned char                  componentFlags;
890		unsigned char                  componentParamSize;
891		short                          componentWhat;
892		ComponentInstance*             deviceControl;
893		ComponentInstance              idh;
894	};
895	#if PRAGMA_STRUCT_ALIGN
896	  #pragma options align=reset
897	#elif PRAGMA_STRUCT_PACKPUSH
898	  #pragma pack(pop)
899	#elif PRAGMA_STRUCT_PACK
900	  #pragma pack()
901	#endif
902
903	#if OLD_COMPONENT_GLUE
904	struct IDHGetDeviceControlGluePB myIDHGetDeviceControlGluePB = {
905		0,
906		4,
907		16
908	};
909
910	#else
911	struct IDHGetDeviceControlGluePB myIDHGetDeviceControlGluePB;
912//	*((unsigned long*)&myIDHGetDeviceControlGluePB) = 0x00040010;
913
914	myIDHGetDeviceControlGluePB.componentFlags = 0;
915	myIDHGetDeviceControlGluePB.componentParamSize = 4;
916	myIDHGetDeviceControlGluePB.componentWhat = 16;
917
918	#endif
919
920	myIDHGetDeviceControlGluePB.deviceControl = deviceControl;
921	myIDHGetDeviceControlGluePB.idh = idh;
922
923	#if TARGET_API_MAC_OS8
924		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHGetDeviceControlGluePB);
925	#else
926		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHGetDeviceControlGluePB );
927	#endif
928}
929#endif
930
931
932#ifndef TRAPGLUE_NO_COMPONENT_CALL
933DEFINE_API( ComponentResult ) IDHUpdateDeviceList(ComponentInstance idh, QTAtomContainer* deviceList)
934{
935	#if PRAGMA_STRUCT_ALIGN
936	  #pragma options align=mac68k
937	#elif PRAGMA_STRUCT_PACKPUSH
938	  #pragma pack(push, 2)
939	#elif PRAGMA_STRUCT_PACK
940	  #pragma pack(2)
941	#endif
942	struct IDHUpdateDeviceListGluePB {
943		unsigned char                  componentFlags;
944		unsigned char                  componentParamSize;
945		short                          componentWhat;
946		QTAtomContainer*               deviceList;
947		ComponentInstance              idh;
948	};
949	#if PRAGMA_STRUCT_ALIGN
950	  #pragma options align=reset
951	#elif PRAGMA_STRUCT_PACKPUSH
952	  #pragma pack(pop)
953	#elif PRAGMA_STRUCT_PACK
954	  #pragma pack()
955	#endif
956
957	#if OLD_COMPONENT_GLUE
958	struct IDHUpdateDeviceListGluePB myIDHUpdateDeviceListGluePB = {
959		0,
960		4,
961		17
962	};
963
964	#else
965	struct IDHUpdateDeviceListGluePB myIDHUpdateDeviceListGluePB;
966//	*((unsigned long*)&myIDHUpdateDeviceListGluePB) = 0x00040011;
967
968	myIDHUpdateDeviceListGluePB.componentFlags = 0;
969	myIDHUpdateDeviceListGluePB.componentParamSize = 4;
970	myIDHUpdateDeviceListGluePB.componentWhat = 17;
971
972	#endif
973
974	myIDHUpdateDeviceListGluePB.deviceList = deviceList;
975	myIDHUpdateDeviceListGluePB.idh = idh;
976
977	#if TARGET_API_MAC_OS8
978		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHUpdateDeviceListGluePB);
979	#else
980		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHUpdateDeviceListGluePB );
981	#endif
982}
983#endif
984
985
986#ifndef TRAPGLUE_NO_COMPONENT_CALL
987DEFINE_API( ComponentResult ) IDHGetDeviceTime(ComponentInstance idh, TimeRecord* deviceTime)
988{
989	#if PRAGMA_STRUCT_ALIGN
990	  #pragma options align=mac68k
991	#elif PRAGMA_STRUCT_PACKPUSH
992	  #pragma pack(push, 2)
993	#elif PRAGMA_STRUCT_PACK
994	  #pragma pack(2)
995	#endif
996	struct IDHGetDeviceTimeGluePB {
997		unsigned char                  componentFlags;
998		unsigned char                  componentParamSize;
999		short                          componentWhat;
1000		TimeRecord*                    deviceTime;
1001		ComponentInstance              idh;
1002	};
1003	#if PRAGMA_STRUCT_ALIGN
1004	  #pragma options align=reset
1005	#elif PRAGMA_STRUCT_PACKPUSH
1006	  #pragma pack(pop)
1007	#elif PRAGMA_STRUCT_PACK
1008	  #pragma pack()
1009	#endif
1010
1011	#if OLD_COMPONENT_GLUE
1012	struct IDHGetDeviceTimeGluePB myIDHGetDeviceTimeGluePB = {
1013		0,
1014		4,
1015		18
1016	};
1017
1018	#else
1019	struct IDHGetDeviceTimeGluePB myIDHGetDeviceTimeGluePB;
1020//	*((unsigned long*)&myIDHGetDeviceTimeGluePB) = 0x00040012;
1021
1022	myIDHGetDeviceTimeGluePB.componentFlags = 0;
1023	myIDHGetDeviceTimeGluePB.componentParamSize = 4;
1024	myIDHGetDeviceTimeGluePB.componentWhat = 18;
1025
1026	#endif
1027
1028	myIDHGetDeviceTimeGluePB.deviceTime = deviceTime;
1029	myIDHGetDeviceTimeGluePB.idh = idh;
1030
1031	#if TARGET_API_MAC_OS8
1032		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHGetDeviceTimeGluePB);
1033	#else
1034		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHGetDeviceTimeGluePB );
1035	#endif
1036}
1037#endif
1038
1039
1040#ifndef TRAPGLUE_NO_COMPONENT_CALL
1041DEFINE_API( ComponentResult ) IDHSetFormat(ComponentInstance idh, UInt32 format)
1042{
1043	#if PRAGMA_STRUCT_ALIGN
1044	  #pragma options align=mac68k
1045	#elif PRAGMA_STRUCT_PACKPUSH
1046	  #pragma pack(push, 2)
1047	#elif PRAGMA_STRUCT_PACK
1048	  #pragma pack(2)
1049	#endif
1050	struct IDHSetFormatGluePB {
1051		unsigned char                  componentFlags;
1052		unsigned char                  componentParamSize;
1053		short                          componentWhat;
1054		UInt32                         format;
1055		ComponentInstance              idh;
1056	};
1057	#if PRAGMA_STRUCT_ALIGN
1058	  #pragma options align=reset
1059	#elif PRAGMA_STRUCT_PACKPUSH
1060	  #pragma pack(pop)
1061	#elif PRAGMA_STRUCT_PACK
1062	  #pragma pack()
1063	#endif
1064
1065	#if OLD_COMPONENT_GLUE
1066	struct IDHSetFormatGluePB myIDHSetFormatGluePB = {
1067		0,
1068		4,
1069		19
1070	};
1071
1072	#else
1073	struct IDHSetFormatGluePB myIDHSetFormatGluePB;
1074//	*((unsigned long*)&myIDHSetFormatGluePB) = 0x00040013;
1075
1076	myIDHSetFormatGluePB.componentFlags = 0;
1077	myIDHSetFormatGluePB.componentParamSize = 4;
1078	myIDHSetFormatGluePB.componentWhat = 19;
1079
1080	#endif
1081
1082	myIDHSetFormatGluePB.format = format;
1083	myIDHSetFormatGluePB.idh = idh;
1084
1085	#if TARGET_API_MAC_OS8
1086		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHSetFormatGluePB);
1087	#else
1088		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHSetFormatGluePB );
1089	#endif
1090}
1091#endif
1092
1093
1094#ifndef TRAPGLUE_NO_COMPONENT_CALL
1095DEFINE_API( ComponentResult ) IDHGetFormat(ComponentInstance idh, UInt32* format)
1096{
1097	#if PRAGMA_STRUCT_ALIGN
1098	  #pragma options align=mac68k
1099	#elif PRAGMA_STRUCT_PACKPUSH
1100	  #pragma pack(push, 2)
1101	#elif PRAGMA_STRUCT_PACK
1102	  #pragma pack(2)
1103	#endif
1104	struct IDHGetFormatGluePB {
1105		unsigned char                  componentFlags;
1106		unsigned char                  componentParamSize;
1107		short                          componentWhat;
1108		UInt32*                        format;
1109		ComponentInstance              idh;
1110	};
1111	#if PRAGMA_STRUCT_ALIGN
1112	  #pragma options align=reset
1113	#elif PRAGMA_STRUCT_PACKPUSH
1114	  #pragma pack(pop)
1115	#elif PRAGMA_STRUCT_PACK
1116	  #pragma pack()
1117	#endif
1118
1119	#if OLD_COMPONENT_GLUE
1120	struct IDHGetFormatGluePB myIDHGetFormatGluePB = {
1121		0,
1122		4,
1123		20
1124	};
1125
1126	#else
1127	struct IDHGetFormatGluePB myIDHGetFormatGluePB;
1128//	*((unsigned long*)&myIDHGetFormatGluePB) = 0x00040014;
1129
1130	myIDHGetFormatGluePB.componentFlags = 0;
1131	myIDHGetFormatGluePB.componentParamSize = 4;
1132	myIDHGetFormatGluePB.componentWhat = 20;
1133
1134	#endif
1135
1136	myIDHGetFormatGluePB.format = format;
1137	myIDHGetFormatGluePB.idh = idh;
1138
1139	#if TARGET_API_MAC_OS8
1140		return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myIDHGetFormatGluePB);
1141	#else
1142		return (ComponentResult)CallComponentDispatch( (ComponentParameters*)&myIDHGetFormatGluePB );
1143	#endif
1144}
1145#endif
1146
1147
1148