blob: 69347da576ab3384587a5817ad7cb3f5ec77ae18 [file] [log] [blame]
Jack Jansen453ced51995-11-30 17:42:08 +00001
2/* =========================== Module Qt ============================ */
3
4#include "Python.h"
5
6
7
Jack Jansen453ced51995-11-30 17:42:08 +00008#include "macglue.h"
Jack Jansen9d8b96c2000-07-14 22:16:45 +00009#include "pymactoolbox.h"
Jack Jansen453ced51995-11-30 17:42:08 +000010
11#include <Movies.h>
12
Jack Jansenb2006391998-04-23 13:22:44 +000013
Jack Jansenc59996e2000-03-17 16:49:59 +000014/* Macro to allow us to GetNextInterestingTime without duration */
15#define GetMediaNextInterestingTimeOnly(media, flags, time, rate, rv) GetMediaNextInterestingTime(media, flags, time, rate, rv, NULL)
16
Jack Jansenb2006391998-04-23 13:22:44 +000017/*
18** Parse/generate time records
19*/
20static PyObject *
21QtTimeRecord_New(itself)
22 TimeRecord *itself;
23{
Jack Jansen6f3fceb2000-03-06 16:34:49 +000024 if (itself->base)
25 return Py_BuildValue("O&lO&", PyMac_Buildwide, &itself->value, itself->scale,
Jack Jansenb2006391998-04-23 13:22:44 +000026 TimeBaseObj_New, itself->base);
Jack Jansen6f3fceb2000-03-06 16:34:49 +000027 else
28 return Py_BuildValue("O&lO", PyMac_Buildwide, &itself->value, itself->scale,
29 Py_None);
Jack Jansenb2006391998-04-23 13:22:44 +000030}
31
32static int
33QtTimeRecord_Convert(v, p_itself)
34 PyObject *v;
35 TimeRecord *p_itself;
36{
Jack Jansen6f3fceb2000-03-06 16:34:49 +000037 PyObject *base = NULL;
38 if( !PyArg_ParseTuple(v, "O&l|O", PyMac_Getwide, &p_itself->value, &p_itself->scale,
39 &base) )
Jack Jansenb2006391998-04-23 13:22:44 +000040 return 0;
Jack Jansen6f3fceb2000-03-06 16:34:49 +000041 if ( base == NULL || base == Py_None )
42 p_itself->base = NULL;
43 else
44 if ( !TimeBaseObj_Convert(base, &p_itself->base) )
45 return 0;
Jack Jansenb2006391998-04-23 13:22:44 +000046 return 1;
47}
48
Jack Jansen453ced51995-11-30 17:42:08 +000049
50
51
52static PyObject *Qt_Error;
53
Jack Jansen9cfea101995-12-09 14:05:56 +000054/* ------------------ Object type MovieController ------------------- */
55
56PyTypeObject MovieController_Type;
57
58#define MovieCtlObj_Check(x) ((x)->ob_type == &MovieController_Type)
59
60typedef struct MovieControllerObject {
61 PyObject_HEAD
62 MovieController ob_itself;
63} MovieControllerObject;
64
65PyObject *MovieCtlObj_New(itself)
66 MovieController itself;
67{
68 MovieControllerObject *it;
69 if (itself == NULL) {
70 PyErr_SetString(Qt_Error,"Cannot create null MovieController");
71 return NULL;
72 }
73 it = PyObject_NEW(MovieControllerObject, &MovieController_Type);
74 if (it == NULL) return NULL;
75 it->ob_itself = itself;
76 return (PyObject *)it;
77}
78MovieCtlObj_Convert(v, p_itself)
79 PyObject *v;
80 MovieController *p_itself;
81{
82 if (!MovieCtlObj_Check(v))
83 {
84 PyErr_SetString(PyExc_TypeError, "MovieController required");
85 return 0;
86 }
87 *p_itself = ((MovieControllerObject *)v)->ob_itself;
88 return 1;
89}
90
91static void MovieCtlObj_dealloc(self)
92 MovieControllerObject *self;
93{
94 DisposeMovieController(self->ob_itself);
95 PyMem_DEL(self);
96}
97
98static PyObject *MovieCtlObj_MCSetMovie(_self, _args)
99 MovieControllerObject *_self;
100 PyObject *_args;
101{
102 PyObject *_res = NULL;
103 ComponentResult _rv;
104 Movie theMovie;
105 WindowPtr movieWindow;
106 Point where;
107 if (!PyArg_ParseTuple(_args, "O&O&O&",
108 MovieObj_Convert, &theMovie,
109 WinObj_Convert, &movieWindow,
110 PyMac_GetPoint, &where))
111 return NULL;
112 _rv = MCSetMovie(_self->ob_itself,
113 theMovie,
114 movieWindow,
115 where);
116 _res = Py_BuildValue("l",
117 _rv);
118 return _res;
119}
120
121static PyObject *MovieCtlObj_MCGetIndMovie(_self, _args)
122 MovieControllerObject *_self;
123 PyObject *_args;
124{
125 PyObject *_res = NULL;
126 Movie _rv;
127 short index;
128 if (!PyArg_ParseTuple(_args, "h",
129 &index))
130 return NULL;
131 _rv = MCGetIndMovie(_self->ob_itself,
132 index);
133 _res = Py_BuildValue("O&",
134 MovieObj_New, _rv);
135 return _res;
136}
137
Jack Jansen1c4e6141998-04-21 15:23:55 +0000138static PyObject *MovieCtlObj_MCRemoveAllMovies(_self, _args)
139 MovieControllerObject *_self;
140 PyObject *_args;
141{
142 PyObject *_res = NULL;
143 ComponentResult _rv;
144 if (!PyArg_ParseTuple(_args, ""))
145 return NULL;
146 _rv = MCRemoveAllMovies(_self->ob_itself);
147 _res = Py_BuildValue("l",
148 _rv);
149 return _res;
150}
151
152static PyObject *MovieCtlObj_MCRemoveAMovie(_self, _args)
153 MovieControllerObject *_self;
154 PyObject *_args;
155{
156 PyObject *_res = NULL;
157 ComponentResult _rv;
158 Movie m;
159 if (!PyArg_ParseTuple(_args, "O&",
160 MovieObj_Convert, &m))
161 return NULL;
162 _rv = MCRemoveAMovie(_self->ob_itself,
163 m);
164 _res = Py_BuildValue("l",
165 _rv);
166 return _res;
167}
168
Jack Jansen9cfea101995-12-09 14:05:56 +0000169static PyObject *MovieCtlObj_MCRemoveMovie(_self, _args)
170 MovieControllerObject *_self;
171 PyObject *_args;
172{
173 PyObject *_res = NULL;
174 ComponentResult _rv;
175 if (!PyArg_ParseTuple(_args, ""))
176 return NULL;
177 _rv = MCRemoveMovie(_self->ob_itself);
178 _res = Py_BuildValue("l",
179 _rv);
180 return _res;
181}
182
183static PyObject *MovieCtlObj_MCIsPlayerEvent(_self, _args)
184 MovieControllerObject *_self;
185 PyObject *_args;
186{
187 PyObject *_res = NULL;
188 ComponentResult _rv;
189 EventRecord e;
190 if (!PyArg_ParseTuple(_args, "O&",
191 PyMac_GetEventRecord, &e))
192 return NULL;
193 _rv = MCIsPlayerEvent(_self->ob_itself,
194 &e);
195 _res = Py_BuildValue("l",
196 _rv);
197 return _res;
198}
199
200static PyObject *MovieCtlObj_MCDoAction(_self, _args)
201 MovieControllerObject *_self;
202 PyObject *_args;
203{
204 PyObject *_res = NULL;
205 ComponentResult _rv;
206 short action;
207 void * params;
208 if (!PyArg_ParseTuple(_args, "hs",
209 &action,
210 &params))
211 return NULL;
212 _rv = MCDoAction(_self->ob_itself,
213 action,
214 params);
215 _res = Py_BuildValue("l",
216 _rv);
217 return _res;
218}
219
220static PyObject *MovieCtlObj_MCSetControllerAttached(_self, _args)
221 MovieControllerObject *_self;
222 PyObject *_args;
223{
224 PyObject *_res = NULL;
225 ComponentResult _rv;
226 Boolean attach;
227 if (!PyArg_ParseTuple(_args, "b",
228 &attach))
229 return NULL;
230 _rv = MCSetControllerAttached(_self->ob_itself,
231 attach);
232 _res = Py_BuildValue("l",
233 _rv);
234 return _res;
235}
236
237static PyObject *MovieCtlObj_MCIsControllerAttached(_self, _args)
238 MovieControllerObject *_self;
239 PyObject *_args;
240{
241 PyObject *_res = NULL;
242 ComponentResult _rv;
243 if (!PyArg_ParseTuple(_args, ""))
244 return NULL;
245 _rv = MCIsControllerAttached(_self->ob_itself);
246 _res = Py_BuildValue("l",
247 _rv);
248 return _res;
249}
250
Jack Jansene0cf87b1997-04-09 15:53:46 +0000251static PyObject *MovieCtlObj_MCSetControllerPort(_self, _args)
252 MovieControllerObject *_self;
253 PyObject *_args;
254{
255 PyObject *_res = NULL;
256 ComponentResult _rv;
257 CGrafPtr gp;
258 if (!PyArg_ParseTuple(_args, "O&",
259 GrafObj_Convert, &gp))
260 return NULL;
261 _rv = MCSetControllerPort(_self->ob_itself,
262 gp);
263 _res = Py_BuildValue("l",
264 _rv);
265 return _res;
266}
267
268static PyObject *MovieCtlObj_MCGetControllerPort(_self, _args)
269 MovieControllerObject *_self;
270 PyObject *_args;
271{
272 PyObject *_res = NULL;
273 CGrafPtr _rv;
274 if (!PyArg_ParseTuple(_args, ""))
275 return NULL;
276 _rv = MCGetControllerPort(_self->ob_itself);
277 _res = Py_BuildValue("O&",
278 GrafObj_New, _rv);
279 return _res;
280}
281
Jack Jansen9cfea101995-12-09 14:05:56 +0000282static PyObject *MovieCtlObj_MCSetVisible(_self, _args)
283 MovieControllerObject *_self;
284 PyObject *_args;
285{
286 PyObject *_res = NULL;
287 ComponentResult _rv;
288 Boolean visible;
289 if (!PyArg_ParseTuple(_args, "b",
290 &visible))
291 return NULL;
292 _rv = MCSetVisible(_self->ob_itself,
293 visible);
294 _res = Py_BuildValue("l",
295 _rv);
296 return _res;
297}
298
299static PyObject *MovieCtlObj_MCGetVisible(_self, _args)
300 MovieControllerObject *_self;
301 PyObject *_args;
302{
303 PyObject *_res = NULL;
304 ComponentResult _rv;
305 if (!PyArg_ParseTuple(_args, ""))
306 return NULL;
307 _rv = MCGetVisible(_self->ob_itself);
308 _res = Py_BuildValue("l",
309 _rv);
310 return _res;
311}
312
313static PyObject *MovieCtlObj_MCGetControllerBoundsRect(_self, _args)
314 MovieControllerObject *_self;
315 PyObject *_args;
316{
317 PyObject *_res = NULL;
318 ComponentResult _rv;
319 Rect bounds;
320 if (!PyArg_ParseTuple(_args, ""))
321 return NULL;
322 _rv = MCGetControllerBoundsRect(_self->ob_itself,
323 &bounds);
324 _res = Py_BuildValue("lO&",
325 _rv,
326 PyMac_BuildRect, &bounds);
327 return _res;
328}
329
330static PyObject *MovieCtlObj_MCSetControllerBoundsRect(_self, _args)
331 MovieControllerObject *_self;
332 PyObject *_args;
333{
334 PyObject *_res = NULL;
335 ComponentResult _rv;
336 Rect bounds;
337 if (!PyArg_ParseTuple(_args, "O&",
338 PyMac_GetRect, &bounds))
339 return NULL;
340 _rv = MCSetControllerBoundsRect(_self->ob_itself,
341 &bounds);
342 _res = Py_BuildValue("l",
343 _rv);
344 return _res;
345}
346
347static PyObject *MovieCtlObj_MCGetControllerBoundsRgn(_self, _args)
348 MovieControllerObject *_self;
349 PyObject *_args;
350{
351 PyObject *_res = NULL;
352 RgnHandle _rv;
353 if (!PyArg_ParseTuple(_args, ""))
354 return NULL;
355 _rv = MCGetControllerBoundsRgn(_self->ob_itself);
356 _res = Py_BuildValue("O&",
357 ResObj_New, _rv);
358 return _res;
359}
360
361static PyObject *MovieCtlObj_MCGetWindowRgn(_self, _args)
362 MovieControllerObject *_self;
363 PyObject *_args;
364{
365 PyObject *_res = NULL;
366 RgnHandle _rv;
367 WindowPtr w;
368 if (!PyArg_ParseTuple(_args, "O&",
369 WinObj_Convert, &w))
370 return NULL;
371 _rv = MCGetWindowRgn(_self->ob_itself,
372 w);
373 _res = Py_BuildValue("O&",
374 ResObj_New, _rv);
375 return _res;
376}
377
378static PyObject *MovieCtlObj_MCMovieChanged(_self, _args)
379 MovieControllerObject *_self;
380 PyObject *_args;
381{
382 PyObject *_res = NULL;
383 ComponentResult _rv;
384 Movie m;
385 if (!PyArg_ParseTuple(_args, "O&",
386 MovieObj_Convert, &m))
387 return NULL;
388 _rv = MCMovieChanged(_self->ob_itself,
389 m);
390 _res = Py_BuildValue("l",
391 _rv);
392 return _res;
393}
394
395static PyObject *MovieCtlObj_MCSetDuration(_self, _args)
396 MovieControllerObject *_self;
397 PyObject *_args;
398{
399 PyObject *_res = NULL;
400 ComponentResult _rv;
401 TimeValue duration;
402 if (!PyArg_ParseTuple(_args, "l",
403 &duration))
404 return NULL;
405 _rv = MCSetDuration(_self->ob_itself,
406 duration);
407 _res = Py_BuildValue("l",
408 _rv);
409 return _res;
410}
411
412static PyObject *MovieCtlObj_MCGetCurrentTime(_self, _args)
413 MovieControllerObject *_self;
414 PyObject *_args;
415{
416 PyObject *_res = NULL;
417 TimeValue _rv;
418 TimeScale scale;
419 if (!PyArg_ParseTuple(_args, ""))
420 return NULL;
421 _rv = MCGetCurrentTime(_self->ob_itself,
422 &scale);
423 _res = Py_BuildValue("ll",
424 _rv,
425 scale);
426 return _res;
427}
428
429static PyObject *MovieCtlObj_MCNewAttachedController(_self, _args)
430 MovieControllerObject *_self;
431 PyObject *_args;
432{
433 PyObject *_res = NULL;
434 ComponentResult _rv;
435 Movie theMovie;
436 WindowPtr w;
437 Point where;
438 if (!PyArg_ParseTuple(_args, "O&O&O&",
439 MovieObj_Convert, &theMovie,
440 WinObj_Convert, &w,
441 PyMac_GetPoint, &where))
442 return NULL;
443 _rv = MCNewAttachedController(_self->ob_itself,
444 theMovie,
445 w,
446 where);
447 _res = Py_BuildValue("l",
448 _rv);
449 return _res;
450}
451
452static PyObject *MovieCtlObj_MCDraw(_self, _args)
453 MovieControllerObject *_self;
454 PyObject *_args;
455{
456 PyObject *_res = NULL;
457 ComponentResult _rv;
458 WindowPtr w;
459 if (!PyArg_ParseTuple(_args, "O&",
460 WinObj_Convert, &w))
461 return NULL;
462 _rv = MCDraw(_self->ob_itself,
463 w);
464 _res = Py_BuildValue("l",
465 _rv);
466 return _res;
467}
468
469static PyObject *MovieCtlObj_MCActivate(_self, _args)
470 MovieControllerObject *_self;
471 PyObject *_args;
472{
473 PyObject *_res = NULL;
474 ComponentResult _rv;
475 WindowPtr w;
476 Boolean activate;
477 if (!PyArg_ParseTuple(_args, "O&b",
478 WinObj_Convert, &w,
479 &activate))
480 return NULL;
481 _rv = MCActivate(_self->ob_itself,
482 w,
483 activate);
484 _res = Py_BuildValue("l",
485 _rv);
486 return _res;
487}
488
489static PyObject *MovieCtlObj_MCIdle(_self, _args)
490 MovieControllerObject *_self;
491 PyObject *_args;
492{
493 PyObject *_res = NULL;
494 ComponentResult _rv;
495 if (!PyArg_ParseTuple(_args, ""))
496 return NULL;
497 _rv = MCIdle(_self->ob_itself);
498 _res = Py_BuildValue("l",
499 _rv);
500 return _res;
501}
502
503static PyObject *MovieCtlObj_MCKey(_self, _args)
504 MovieControllerObject *_self;
505 PyObject *_args;
506{
507 PyObject *_res = NULL;
508 ComponentResult _rv;
509 SInt8 key;
510 long modifiers;
511 if (!PyArg_ParseTuple(_args, "bl",
512 &key,
513 &modifiers))
514 return NULL;
515 _rv = MCKey(_self->ob_itself,
516 key,
517 modifiers);
518 _res = Py_BuildValue("l",
519 _rv);
520 return _res;
521}
522
523static PyObject *MovieCtlObj_MCClick(_self, _args)
524 MovieControllerObject *_self;
525 PyObject *_args;
526{
527 PyObject *_res = NULL;
528 ComponentResult _rv;
529 WindowPtr w;
530 Point where;
531 long when;
532 long modifiers;
533 if (!PyArg_ParseTuple(_args, "O&O&ll",
534 WinObj_Convert, &w,
535 PyMac_GetPoint, &where,
536 &when,
537 &modifiers))
538 return NULL;
539 _rv = MCClick(_self->ob_itself,
540 w,
541 where,
542 when,
543 modifiers);
544 _res = Py_BuildValue("l",
545 _rv);
546 return _res;
547}
548
549static PyObject *MovieCtlObj_MCEnableEditing(_self, _args)
550 MovieControllerObject *_self;
551 PyObject *_args;
552{
553 PyObject *_res = NULL;
554 ComponentResult _rv;
555 Boolean enabled;
556 if (!PyArg_ParseTuple(_args, "b",
557 &enabled))
558 return NULL;
559 _rv = MCEnableEditing(_self->ob_itself,
560 enabled);
561 _res = Py_BuildValue("l",
562 _rv);
563 return _res;
564}
565
566static PyObject *MovieCtlObj_MCIsEditingEnabled(_self, _args)
567 MovieControllerObject *_self;
568 PyObject *_args;
569{
570 PyObject *_res = NULL;
571 long _rv;
572 if (!PyArg_ParseTuple(_args, ""))
573 return NULL;
574 _rv = MCIsEditingEnabled(_self->ob_itself);
575 _res = Py_BuildValue("l",
576 _rv);
577 return _res;
578}
579
580static PyObject *MovieCtlObj_MCCopy(_self, _args)
581 MovieControllerObject *_self;
582 PyObject *_args;
583{
584 PyObject *_res = NULL;
585 Movie _rv;
586 if (!PyArg_ParseTuple(_args, ""))
587 return NULL;
588 _rv = MCCopy(_self->ob_itself);
589 _res = Py_BuildValue("O&",
590 MovieObj_New, _rv);
591 return _res;
592}
593
594static PyObject *MovieCtlObj_MCCut(_self, _args)
595 MovieControllerObject *_self;
596 PyObject *_args;
597{
598 PyObject *_res = NULL;
599 Movie _rv;
600 if (!PyArg_ParseTuple(_args, ""))
601 return NULL;
602 _rv = MCCut(_self->ob_itself);
603 _res = Py_BuildValue("O&",
604 MovieObj_New, _rv);
605 return _res;
606}
607
608static PyObject *MovieCtlObj_MCPaste(_self, _args)
609 MovieControllerObject *_self;
610 PyObject *_args;
611{
612 PyObject *_res = NULL;
613 ComponentResult _rv;
614 Movie srcMovie;
615 if (!PyArg_ParseTuple(_args, "O&",
616 MovieObj_Convert, &srcMovie))
617 return NULL;
618 _rv = MCPaste(_self->ob_itself,
619 srcMovie);
620 _res = Py_BuildValue("l",
621 _rv);
622 return _res;
623}
624
625static PyObject *MovieCtlObj_MCClear(_self, _args)
626 MovieControllerObject *_self;
627 PyObject *_args;
628{
629 PyObject *_res = NULL;
630 ComponentResult _rv;
631 if (!PyArg_ParseTuple(_args, ""))
632 return NULL;
633 _rv = MCClear(_self->ob_itself);
634 _res = Py_BuildValue("l",
635 _rv);
636 return _res;
637}
638
639static PyObject *MovieCtlObj_MCUndo(_self, _args)
640 MovieControllerObject *_self;
641 PyObject *_args;
642{
643 PyObject *_res = NULL;
644 ComponentResult _rv;
645 if (!PyArg_ParseTuple(_args, ""))
646 return NULL;
647 _rv = MCUndo(_self->ob_itself);
648 _res = Py_BuildValue("l",
649 _rv);
650 return _res;
651}
652
653static PyObject *MovieCtlObj_MCPositionController(_self, _args)
654 MovieControllerObject *_self;
655 PyObject *_args;
656{
657 PyObject *_res = NULL;
658 ComponentResult _rv;
659 Rect movieRect;
660 Rect controllerRect;
661 long someFlags;
662 if (!PyArg_ParseTuple(_args, "O&O&l",
663 PyMac_GetRect, &movieRect,
664 PyMac_GetRect, &controllerRect,
665 &someFlags))
666 return NULL;
667 _rv = MCPositionController(_self->ob_itself,
668 &movieRect,
669 &controllerRect,
670 someFlags);
671 _res = Py_BuildValue("l",
672 _rv);
673 return _res;
674}
675
676static PyObject *MovieCtlObj_MCGetControllerInfo(_self, _args)
677 MovieControllerObject *_self;
678 PyObject *_args;
679{
680 PyObject *_res = NULL;
681 ComponentResult _rv;
682 long someFlags;
683 if (!PyArg_ParseTuple(_args, ""))
684 return NULL;
685 _rv = MCGetControllerInfo(_self->ob_itself,
686 &someFlags);
687 _res = Py_BuildValue("ll",
688 _rv,
689 someFlags);
690 return _res;
691}
692
693static PyObject *MovieCtlObj_MCSetClip(_self, _args)
694 MovieControllerObject *_self;
695 PyObject *_args;
696{
697 PyObject *_res = NULL;
698 ComponentResult _rv;
699 RgnHandle theClip;
700 RgnHandle movieClip;
701 if (!PyArg_ParseTuple(_args, "O&O&",
702 ResObj_Convert, &theClip,
703 ResObj_Convert, &movieClip))
704 return NULL;
705 _rv = MCSetClip(_self->ob_itself,
706 theClip,
707 movieClip);
708 _res = Py_BuildValue("l",
709 _rv);
710 return _res;
711}
712
713static PyObject *MovieCtlObj_MCGetClip(_self, _args)
714 MovieControllerObject *_self;
715 PyObject *_args;
716{
717 PyObject *_res = NULL;
718 ComponentResult _rv;
719 RgnHandle theClip;
720 RgnHandle movieClip;
721 if (!PyArg_ParseTuple(_args, ""))
722 return NULL;
723 _rv = MCGetClip(_self->ob_itself,
724 &theClip,
725 &movieClip);
726 _res = Py_BuildValue("lO&O&",
727 _rv,
728 ResObj_New, theClip,
729 ResObj_New, movieClip);
730 return _res;
731}
732
733static PyObject *MovieCtlObj_MCDrawBadge(_self, _args)
734 MovieControllerObject *_self;
735 PyObject *_args;
736{
737 PyObject *_res = NULL;
738 ComponentResult _rv;
739 RgnHandle movieRgn;
740 RgnHandle badgeRgn;
741 if (!PyArg_ParseTuple(_args, "O&",
742 ResObj_Convert, &movieRgn))
743 return NULL;
744 _rv = MCDrawBadge(_self->ob_itself,
745 movieRgn,
746 &badgeRgn);
747 _res = Py_BuildValue("lO&",
748 _rv,
749 ResObj_New, badgeRgn);
750 return _res;
751}
752
753static PyObject *MovieCtlObj_MCSetUpEditMenu(_self, _args)
754 MovieControllerObject *_self;
755 PyObject *_args;
756{
757 PyObject *_res = NULL;
758 ComponentResult _rv;
759 long modifiers;
760 MenuHandle mh;
761 if (!PyArg_ParseTuple(_args, "lO&",
762 &modifiers,
763 MenuObj_Convert, &mh))
764 return NULL;
765 _rv = MCSetUpEditMenu(_self->ob_itself,
766 modifiers,
767 mh);
768 _res = Py_BuildValue("l",
769 _rv);
770 return _res;
771}
772
773static PyObject *MovieCtlObj_MCGetMenuString(_self, _args)
774 MovieControllerObject *_self;
775 PyObject *_args;
776{
777 PyObject *_res = NULL;
778 ComponentResult _rv;
779 long modifiers;
780 short item;
781 Str255 aString;
782 if (!PyArg_ParseTuple(_args, "lhO&",
783 &modifiers,
784 &item,
785 PyMac_GetStr255, aString))
786 return NULL;
787 _rv = MCGetMenuString(_self->ob_itself,
788 modifiers,
789 item,
790 aString);
791 _res = Py_BuildValue("l",
792 _rv);
793 return _res;
794}
795
Jack Jansen1c4e6141998-04-21 15:23:55 +0000796static PyObject *MovieCtlObj_MCPtInController(_self, _args)
797 MovieControllerObject *_self;
798 PyObject *_args;
799{
800 PyObject *_res = NULL;
801 ComponentResult _rv;
802 Point thePt;
803 Boolean inController;
804 if (!PyArg_ParseTuple(_args, "O&",
805 PyMac_GetPoint, &thePt))
806 return NULL;
807 _rv = MCPtInController(_self->ob_itself,
808 thePt,
809 &inController);
810 _res = Py_BuildValue("lb",
811 _rv,
812 inController);
813 return _res;
814}
815
816static PyObject *MovieCtlObj_MCInvalidate(_self, _args)
817 MovieControllerObject *_self;
818 PyObject *_args;
819{
820 PyObject *_res = NULL;
821 ComponentResult _rv;
822 WindowPtr w;
823 RgnHandle invalidRgn;
824 if (!PyArg_ParseTuple(_args, "O&O&",
825 WinObj_Convert, &w,
826 ResObj_Convert, &invalidRgn))
827 return NULL;
828 _rv = MCInvalidate(_self->ob_itself,
829 w,
830 invalidRgn);
831 _res = Py_BuildValue("l",
832 _rv);
833 return _res;
834}
835
836static PyObject *MovieCtlObj_MCAdjustCursor(_self, _args)
837 MovieControllerObject *_self;
838 PyObject *_args;
839{
840 PyObject *_res = NULL;
841 ComponentResult _rv;
842 WindowPtr w;
843 Point where;
844 long modifiers;
845 if (!PyArg_ParseTuple(_args, "O&O&l",
846 WinObj_Convert, &w,
847 PyMac_GetPoint, &where,
848 &modifiers))
849 return NULL;
850 _rv = MCAdjustCursor(_self->ob_itself,
851 w,
852 where,
853 modifiers);
854 _res = Py_BuildValue("l",
855 _rv);
856 return _res;
857}
858
859static PyObject *MovieCtlObj_MCGetInterfaceElement(_self, _args)
860 MovieControllerObject *_self;
861 PyObject *_args;
862{
863 PyObject *_res = NULL;
864 ComponentResult _rv;
865 MCInterfaceElement whichElement;
866 void * element;
867 if (!PyArg_ParseTuple(_args, "ls",
868 &whichElement,
869 &element))
870 return NULL;
871 _rv = MCGetInterfaceElement(_self->ob_itself,
872 whichElement,
873 element);
874 _res = Py_BuildValue("l",
875 _rv);
876 return _res;
877}
878
Jack Jansen9cfea101995-12-09 14:05:56 +0000879static PyMethodDef MovieCtlObj_methods[] = {
880 {"MCSetMovie", (PyCFunction)MovieCtlObj_MCSetMovie, 1,
881 "(Movie theMovie, WindowPtr movieWindow, Point where) -> (ComponentResult _rv)"},
882 {"MCGetIndMovie", (PyCFunction)MovieCtlObj_MCGetIndMovie, 1,
883 "(short index) -> (Movie _rv)"},
Jack Jansen1c4e6141998-04-21 15:23:55 +0000884 {"MCRemoveAllMovies", (PyCFunction)MovieCtlObj_MCRemoveAllMovies, 1,
885 "() -> (ComponentResult _rv)"},
886 {"MCRemoveAMovie", (PyCFunction)MovieCtlObj_MCRemoveAMovie, 1,
887 "(Movie m) -> (ComponentResult _rv)"},
Jack Jansen9cfea101995-12-09 14:05:56 +0000888 {"MCRemoveMovie", (PyCFunction)MovieCtlObj_MCRemoveMovie, 1,
889 "() -> (ComponentResult _rv)"},
890 {"MCIsPlayerEvent", (PyCFunction)MovieCtlObj_MCIsPlayerEvent, 1,
891 "(EventRecord e) -> (ComponentResult _rv)"},
892 {"MCDoAction", (PyCFunction)MovieCtlObj_MCDoAction, 1,
893 "(short action, void * params) -> (ComponentResult _rv)"},
894 {"MCSetControllerAttached", (PyCFunction)MovieCtlObj_MCSetControllerAttached, 1,
895 "(Boolean attach) -> (ComponentResult _rv)"},
896 {"MCIsControllerAttached", (PyCFunction)MovieCtlObj_MCIsControllerAttached, 1,
897 "() -> (ComponentResult _rv)"},
Jack Jansene0cf87b1997-04-09 15:53:46 +0000898 {"MCSetControllerPort", (PyCFunction)MovieCtlObj_MCSetControllerPort, 1,
899 "(CGrafPtr gp) -> (ComponentResult _rv)"},
900 {"MCGetControllerPort", (PyCFunction)MovieCtlObj_MCGetControllerPort, 1,
901 "() -> (CGrafPtr _rv)"},
Jack Jansen9cfea101995-12-09 14:05:56 +0000902 {"MCSetVisible", (PyCFunction)MovieCtlObj_MCSetVisible, 1,
903 "(Boolean visible) -> (ComponentResult _rv)"},
904 {"MCGetVisible", (PyCFunction)MovieCtlObj_MCGetVisible, 1,
905 "() -> (ComponentResult _rv)"},
906 {"MCGetControllerBoundsRect", (PyCFunction)MovieCtlObj_MCGetControllerBoundsRect, 1,
907 "() -> (ComponentResult _rv, Rect bounds)"},
908 {"MCSetControllerBoundsRect", (PyCFunction)MovieCtlObj_MCSetControllerBoundsRect, 1,
909 "(Rect bounds) -> (ComponentResult _rv)"},
910 {"MCGetControllerBoundsRgn", (PyCFunction)MovieCtlObj_MCGetControllerBoundsRgn, 1,
911 "() -> (RgnHandle _rv)"},
912 {"MCGetWindowRgn", (PyCFunction)MovieCtlObj_MCGetWindowRgn, 1,
913 "(WindowPtr w) -> (RgnHandle _rv)"},
914 {"MCMovieChanged", (PyCFunction)MovieCtlObj_MCMovieChanged, 1,
915 "(Movie m) -> (ComponentResult _rv)"},
916 {"MCSetDuration", (PyCFunction)MovieCtlObj_MCSetDuration, 1,
917 "(TimeValue duration) -> (ComponentResult _rv)"},
918 {"MCGetCurrentTime", (PyCFunction)MovieCtlObj_MCGetCurrentTime, 1,
919 "() -> (TimeValue _rv, TimeScale scale)"},
920 {"MCNewAttachedController", (PyCFunction)MovieCtlObj_MCNewAttachedController, 1,
921 "(Movie theMovie, WindowPtr w, Point where) -> (ComponentResult _rv)"},
922 {"MCDraw", (PyCFunction)MovieCtlObj_MCDraw, 1,
923 "(WindowPtr w) -> (ComponentResult _rv)"},
924 {"MCActivate", (PyCFunction)MovieCtlObj_MCActivate, 1,
925 "(WindowPtr w, Boolean activate) -> (ComponentResult _rv)"},
926 {"MCIdle", (PyCFunction)MovieCtlObj_MCIdle, 1,
927 "() -> (ComponentResult _rv)"},
928 {"MCKey", (PyCFunction)MovieCtlObj_MCKey, 1,
929 "(SInt8 key, long modifiers) -> (ComponentResult _rv)"},
930 {"MCClick", (PyCFunction)MovieCtlObj_MCClick, 1,
931 "(WindowPtr w, Point where, long when, long modifiers) -> (ComponentResult _rv)"},
932 {"MCEnableEditing", (PyCFunction)MovieCtlObj_MCEnableEditing, 1,
933 "(Boolean enabled) -> (ComponentResult _rv)"},
934 {"MCIsEditingEnabled", (PyCFunction)MovieCtlObj_MCIsEditingEnabled, 1,
935 "() -> (long _rv)"},
936 {"MCCopy", (PyCFunction)MovieCtlObj_MCCopy, 1,
937 "() -> (Movie _rv)"},
938 {"MCCut", (PyCFunction)MovieCtlObj_MCCut, 1,
939 "() -> (Movie _rv)"},
940 {"MCPaste", (PyCFunction)MovieCtlObj_MCPaste, 1,
941 "(Movie srcMovie) -> (ComponentResult _rv)"},
942 {"MCClear", (PyCFunction)MovieCtlObj_MCClear, 1,
943 "() -> (ComponentResult _rv)"},
944 {"MCUndo", (PyCFunction)MovieCtlObj_MCUndo, 1,
945 "() -> (ComponentResult _rv)"},
946 {"MCPositionController", (PyCFunction)MovieCtlObj_MCPositionController, 1,
947 "(Rect movieRect, Rect controllerRect, long someFlags) -> (ComponentResult _rv)"},
948 {"MCGetControllerInfo", (PyCFunction)MovieCtlObj_MCGetControllerInfo, 1,
949 "() -> (ComponentResult _rv, long someFlags)"},
950 {"MCSetClip", (PyCFunction)MovieCtlObj_MCSetClip, 1,
951 "(RgnHandle theClip, RgnHandle movieClip) -> (ComponentResult _rv)"},
952 {"MCGetClip", (PyCFunction)MovieCtlObj_MCGetClip, 1,
953 "() -> (ComponentResult _rv, RgnHandle theClip, RgnHandle movieClip)"},
954 {"MCDrawBadge", (PyCFunction)MovieCtlObj_MCDrawBadge, 1,
955 "(RgnHandle movieRgn) -> (ComponentResult _rv, RgnHandle badgeRgn)"},
956 {"MCSetUpEditMenu", (PyCFunction)MovieCtlObj_MCSetUpEditMenu, 1,
957 "(long modifiers, MenuHandle mh) -> (ComponentResult _rv)"},
958 {"MCGetMenuString", (PyCFunction)MovieCtlObj_MCGetMenuString, 1,
959 "(long modifiers, short item, Str255 aString) -> (ComponentResult _rv)"},
Jack Jansen1c4e6141998-04-21 15:23:55 +0000960 {"MCPtInController", (PyCFunction)MovieCtlObj_MCPtInController, 1,
961 "(Point thePt) -> (ComponentResult _rv, Boolean inController)"},
962 {"MCInvalidate", (PyCFunction)MovieCtlObj_MCInvalidate, 1,
963 "(WindowPtr w, RgnHandle invalidRgn) -> (ComponentResult _rv)"},
964 {"MCAdjustCursor", (PyCFunction)MovieCtlObj_MCAdjustCursor, 1,
965 "(WindowPtr w, Point where, long modifiers) -> (ComponentResult _rv)"},
966 {"MCGetInterfaceElement", (PyCFunction)MovieCtlObj_MCGetInterfaceElement, 1,
967 "(MCInterfaceElement whichElement, void * element) -> (ComponentResult _rv)"},
Jack Jansen9cfea101995-12-09 14:05:56 +0000968 {NULL, NULL, 0}
969};
970
971PyMethodChain MovieCtlObj_chain = { MovieCtlObj_methods, NULL };
972
973static PyObject *MovieCtlObj_getattr(self, name)
974 MovieControllerObject *self;
975 char *name;
976{
977 return Py_FindMethodInChain(&MovieCtlObj_chain, (PyObject *)self, name);
978}
979
980#define MovieCtlObj_setattr NULL
981
Jack Jansena05ac601999-12-12 21:41:51 +0000982#define MovieCtlObj_compare NULL
983
984#define MovieCtlObj_repr NULL
985
986#define MovieCtlObj_hash NULL
987
Jack Jansen9cfea101995-12-09 14:05:56 +0000988PyTypeObject MovieController_Type = {
989 PyObject_HEAD_INIT(&PyType_Type)
990 0, /*ob_size*/
991 "MovieController", /*tp_name*/
992 sizeof(MovieControllerObject), /*tp_basicsize*/
993 0, /*tp_itemsize*/
994 /* methods */
995 (destructor) MovieCtlObj_dealloc, /*tp_dealloc*/
996 0, /*tp_print*/
997 (getattrfunc) MovieCtlObj_getattr, /*tp_getattr*/
998 (setattrfunc) MovieCtlObj_setattr, /*tp_setattr*/
Jack Jansena05ac601999-12-12 21:41:51 +0000999 (cmpfunc) MovieCtlObj_compare, /*tp_compare*/
1000 (reprfunc) MovieCtlObj_repr, /*tp_repr*/
1001 (PyNumberMethods *)0, /* tp_as_number */
1002 (PySequenceMethods *)0, /* tp_as_sequence */
1003 (PyMappingMethods *)0, /* tp_as_mapping */
1004 (hashfunc) MovieCtlObj_hash, /*tp_hash*/
Jack Jansen9cfea101995-12-09 14:05:56 +00001005};
1006
1007/* ---------------- End object type MovieController ----------------- */
1008
1009
Jack Jansen453ced51995-11-30 17:42:08 +00001010/* ---------------------- Object type TimeBase ---------------------- */
1011
1012PyTypeObject TimeBase_Type;
1013
1014#define TimeBaseObj_Check(x) ((x)->ob_type == &TimeBase_Type)
1015
1016typedef struct TimeBaseObject {
1017 PyObject_HEAD
1018 TimeBase ob_itself;
1019} TimeBaseObject;
1020
1021PyObject *TimeBaseObj_New(itself)
1022 TimeBase itself;
1023{
1024 TimeBaseObject *it;
1025 if (itself == NULL) {
1026 PyErr_SetString(Qt_Error,"Cannot create null TimeBase");
1027 return NULL;
1028 }
1029 it = PyObject_NEW(TimeBaseObject, &TimeBase_Type);
1030 if (it == NULL) return NULL;
1031 it->ob_itself = itself;
1032 return (PyObject *)it;
1033}
1034TimeBaseObj_Convert(v, p_itself)
1035 PyObject *v;
1036 TimeBase *p_itself;
1037{
1038 if (!TimeBaseObj_Check(v))
1039 {
1040 PyErr_SetString(PyExc_TypeError, "TimeBase required");
1041 return 0;
1042 }
1043 *p_itself = ((TimeBaseObject *)v)->ob_itself;
1044 return 1;
1045}
1046
1047static void TimeBaseObj_dealloc(self)
1048 TimeBaseObject *self;
1049{
Jack Jansenb2006391998-04-23 13:22:44 +00001050 /* Cleanup of self->ob_itself goes here */
Jack Jansen453ced51995-11-30 17:42:08 +00001051 PyMem_DEL(self);
1052}
1053
Jack Jansenb2006391998-04-23 13:22:44 +00001054static PyObject *TimeBaseObj_DisposeTimeBase(_self, _args)
1055 TimeBaseObject *_self;
1056 PyObject *_args;
1057{
1058 PyObject *_res = NULL;
1059 if (!PyArg_ParseTuple(_args, ""))
1060 return NULL;
1061 DisposeTimeBase(_self->ob_itself);
1062 Py_INCREF(Py_None);
1063 _res = Py_None;
1064 return _res;
1065}
1066
1067static PyObject *TimeBaseObj_GetTimeBaseTime(_self, _args)
1068 TimeBaseObject *_self;
1069 PyObject *_args;
1070{
1071 PyObject *_res = NULL;
1072 TimeValue _rv;
1073 TimeScale s;
1074 TimeRecord tr;
1075 if (!PyArg_ParseTuple(_args, "l",
1076 &s))
1077 return NULL;
1078 _rv = GetTimeBaseTime(_self->ob_itself,
1079 s,
1080 &tr);
1081 _res = Py_BuildValue("lO&",
1082 _rv,
1083 QtTimeRecord_New, &tr);
1084 return _res;
1085}
1086
1087static PyObject *TimeBaseObj_SetTimeBaseTime(_self, _args)
1088 TimeBaseObject *_self;
1089 PyObject *_args;
1090{
1091 PyObject *_res = NULL;
1092 TimeRecord tr;
1093 if (!PyArg_ParseTuple(_args, "O&",
1094 QtTimeRecord_Convert, &tr))
1095 return NULL;
1096 SetTimeBaseTime(_self->ob_itself,
1097 &tr);
1098 Py_INCREF(Py_None);
1099 _res = Py_None;
1100 return _res;
1101}
1102
Jack Jansen453ced51995-11-30 17:42:08 +00001103static PyObject *TimeBaseObj_SetTimeBaseValue(_self, _args)
1104 TimeBaseObject *_self;
1105 PyObject *_args;
1106{
1107 PyObject *_res = NULL;
1108 TimeValue t;
1109 TimeScale s;
1110 if (!PyArg_ParseTuple(_args, "ll",
1111 &t,
1112 &s))
1113 return NULL;
1114 SetTimeBaseValue(_self->ob_itself,
1115 t,
1116 s);
1117 Py_INCREF(Py_None);
1118 _res = Py_None;
1119 return _res;
1120}
1121
1122static PyObject *TimeBaseObj_GetTimeBaseRate(_self, _args)
1123 TimeBaseObject *_self;
1124 PyObject *_args;
1125{
1126 PyObject *_res = NULL;
1127 Fixed _rv;
1128 if (!PyArg_ParseTuple(_args, ""))
1129 return NULL;
1130 _rv = GetTimeBaseRate(_self->ob_itself);
1131 _res = Py_BuildValue("O&",
1132 PyMac_BuildFixed, _rv);
1133 return _res;
1134}
1135
1136static PyObject *TimeBaseObj_SetTimeBaseRate(_self, _args)
1137 TimeBaseObject *_self;
1138 PyObject *_args;
1139{
1140 PyObject *_res = NULL;
1141 Fixed r;
1142 if (!PyArg_ParseTuple(_args, "O&",
1143 PyMac_GetFixed, &r))
1144 return NULL;
1145 SetTimeBaseRate(_self->ob_itself,
1146 r);
1147 Py_INCREF(Py_None);
1148 _res = Py_None;
1149 return _res;
1150}
1151
Jack Jansenb2006391998-04-23 13:22:44 +00001152static PyObject *TimeBaseObj_GetTimeBaseStartTime(_self, _args)
1153 TimeBaseObject *_self;
1154 PyObject *_args;
1155{
1156 PyObject *_res = NULL;
1157 TimeValue _rv;
1158 TimeScale s;
1159 TimeRecord tr;
1160 if (!PyArg_ParseTuple(_args, "l",
1161 &s))
1162 return NULL;
1163 _rv = GetTimeBaseStartTime(_self->ob_itself,
1164 s,
1165 &tr);
1166 _res = Py_BuildValue("lO&",
1167 _rv,
1168 QtTimeRecord_New, &tr);
1169 return _res;
1170}
1171
1172static PyObject *TimeBaseObj_SetTimeBaseStartTime(_self, _args)
1173 TimeBaseObject *_self;
1174 PyObject *_args;
1175{
1176 PyObject *_res = NULL;
1177 TimeRecord tr;
1178 if (!PyArg_ParseTuple(_args, "O&",
1179 QtTimeRecord_Convert, &tr))
1180 return NULL;
1181 SetTimeBaseStartTime(_self->ob_itself,
1182 &tr);
1183 Py_INCREF(Py_None);
1184 _res = Py_None;
1185 return _res;
1186}
1187
1188static PyObject *TimeBaseObj_GetTimeBaseStopTime(_self, _args)
1189 TimeBaseObject *_self;
1190 PyObject *_args;
1191{
1192 PyObject *_res = NULL;
1193 TimeValue _rv;
1194 TimeScale s;
1195 TimeRecord tr;
1196 if (!PyArg_ParseTuple(_args, "l",
1197 &s))
1198 return NULL;
1199 _rv = GetTimeBaseStopTime(_self->ob_itself,
1200 s,
1201 &tr);
1202 _res = Py_BuildValue("lO&",
1203 _rv,
1204 QtTimeRecord_New, &tr);
1205 return _res;
1206}
1207
1208static PyObject *TimeBaseObj_SetTimeBaseStopTime(_self, _args)
1209 TimeBaseObject *_self;
1210 PyObject *_args;
1211{
1212 PyObject *_res = NULL;
1213 TimeRecord tr;
1214 if (!PyArg_ParseTuple(_args, "O&",
1215 QtTimeRecord_Convert, &tr))
1216 return NULL;
1217 SetTimeBaseStopTime(_self->ob_itself,
1218 &tr);
1219 Py_INCREF(Py_None);
1220 _res = Py_None;
1221 return _res;
1222}
1223
Jack Jansen453ced51995-11-30 17:42:08 +00001224static PyObject *TimeBaseObj_GetTimeBaseFlags(_self, _args)
1225 TimeBaseObject *_self;
1226 PyObject *_args;
1227{
1228 PyObject *_res = NULL;
1229 long _rv;
1230 if (!PyArg_ParseTuple(_args, ""))
1231 return NULL;
1232 _rv = GetTimeBaseFlags(_self->ob_itself);
1233 _res = Py_BuildValue("l",
1234 _rv);
1235 return _res;
1236}
1237
1238static PyObject *TimeBaseObj_SetTimeBaseFlags(_self, _args)
1239 TimeBaseObject *_self;
1240 PyObject *_args;
1241{
1242 PyObject *_res = NULL;
1243 long timeBaseFlags;
1244 if (!PyArg_ParseTuple(_args, "l",
1245 &timeBaseFlags))
1246 return NULL;
1247 SetTimeBaseFlags(_self->ob_itself,
1248 timeBaseFlags);
1249 Py_INCREF(Py_None);
1250 _res = Py_None;
1251 return _res;
1252}
1253
Jack Jansenb2006391998-04-23 13:22:44 +00001254static PyObject *TimeBaseObj_SetTimeBaseMasterTimeBase(_self, _args)
1255 TimeBaseObject *_self;
1256 PyObject *_args;
1257{
1258 PyObject *_res = NULL;
1259 TimeBase master;
1260 TimeRecord slaveZero;
1261 if (!PyArg_ParseTuple(_args, "O&O&",
1262 TimeBaseObj_Convert, &master,
1263 QtTimeRecord_Convert, &slaveZero))
1264 return NULL;
1265 SetTimeBaseMasterTimeBase(_self->ob_itself,
1266 master,
1267 &slaveZero);
1268 Py_INCREF(Py_None);
1269 _res = Py_None;
1270 return _res;
1271}
1272
Jack Jansen453ced51995-11-30 17:42:08 +00001273static PyObject *TimeBaseObj_GetTimeBaseMasterTimeBase(_self, _args)
1274 TimeBaseObject *_self;
1275 PyObject *_args;
1276{
1277 PyObject *_res = NULL;
1278 TimeBase _rv;
1279 if (!PyArg_ParseTuple(_args, ""))
1280 return NULL;
1281 _rv = GetTimeBaseMasterTimeBase(_self->ob_itself);
1282 _res = Py_BuildValue("O&",
1283 TimeBaseObj_New, _rv);
1284 return _res;
1285}
1286
Jack Jansenb2006391998-04-23 13:22:44 +00001287static PyObject *TimeBaseObj_SetTimeBaseMasterClock(_self, _args)
1288 TimeBaseObject *_self;
1289 PyObject *_args;
1290{
1291 PyObject *_res = NULL;
1292 Component clockMeister;
1293 TimeRecord slaveZero;
1294 if (!PyArg_ParseTuple(_args, "O&O&",
1295 CmpObj_Convert, &clockMeister,
1296 QtTimeRecord_Convert, &slaveZero))
1297 return NULL;
1298 SetTimeBaseMasterClock(_self->ob_itself,
1299 clockMeister,
1300 &slaveZero);
1301 Py_INCREF(Py_None);
1302 _res = Py_None;
1303 return _res;
1304}
1305
Jack Jansen453ced51995-11-30 17:42:08 +00001306static PyObject *TimeBaseObj_GetTimeBaseMasterClock(_self, _args)
1307 TimeBaseObject *_self;
1308 PyObject *_args;
1309{
1310 PyObject *_res = NULL;
1311 ComponentInstance _rv;
1312 if (!PyArg_ParseTuple(_args, ""))
1313 return NULL;
1314 _rv = GetTimeBaseMasterClock(_self->ob_itself);
1315 _res = Py_BuildValue("O&",
1316 CmpInstObj_New, _rv);
1317 return _res;
1318}
1319
Jack Jansenb2006391998-04-23 13:22:44 +00001320static PyObject *TimeBaseObj_GetTimeBaseStatus(_self, _args)
1321 TimeBaseObject *_self;
1322 PyObject *_args;
1323{
1324 PyObject *_res = NULL;
1325 long _rv;
1326 TimeRecord unpinnedTime;
1327 if (!PyArg_ParseTuple(_args, ""))
1328 return NULL;
1329 _rv = GetTimeBaseStatus(_self->ob_itself,
1330 &unpinnedTime);
1331 _res = Py_BuildValue("lO&",
1332 _rv,
1333 QtTimeRecord_New, &unpinnedTime);
1334 return _res;
1335}
1336
1337static PyObject *TimeBaseObj_SetTimeBaseZero(_self, _args)
1338 TimeBaseObject *_self;
1339 PyObject *_args;
1340{
1341 PyObject *_res = NULL;
1342 TimeRecord zero;
Jack Jansen1b7a70f2000-03-03 17:06:13 +00001343 if (!PyArg_ParseTuple(_args, "O&",
1344 QtTimeRecord_Convert, &zero))
Jack Jansenb2006391998-04-23 13:22:44 +00001345 return NULL;
1346 SetTimeBaseZero(_self->ob_itself,
1347 &zero);
Jack Jansen1b7a70f2000-03-03 17:06:13 +00001348 Py_INCREF(Py_None);
1349 _res = Py_None;
Jack Jansenb2006391998-04-23 13:22:44 +00001350 return _res;
1351}
1352
Jack Jansen453ced51995-11-30 17:42:08 +00001353static PyObject *TimeBaseObj_GetTimeBaseEffectiveRate(_self, _args)
1354 TimeBaseObject *_self;
1355 PyObject *_args;
1356{
1357 PyObject *_res = NULL;
1358 Fixed _rv;
1359 if (!PyArg_ParseTuple(_args, ""))
1360 return NULL;
1361 _rv = GetTimeBaseEffectiveRate(_self->ob_itself);
1362 _res = Py_BuildValue("O&",
1363 PyMac_BuildFixed, _rv);
1364 return _res;
1365}
1366
1367static PyMethodDef TimeBaseObj_methods[] = {
Jack Jansenb2006391998-04-23 13:22:44 +00001368 {"DisposeTimeBase", (PyCFunction)TimeBaseObj_DisposeTimeBase, 1,
1369 "() -> None"},
1370 {"GetTimeBaseTime", (PyCFunction)TimeBaseObj_GetTimeBaseTime, 1,
1371 "(TimeScale s) -> (TimeValue _rv, TimeRecord tr)"},
1372 {"SetTimeBaseTime", (PyCFunction)TimeBaseObj_SetTimeBaseTime, 1,
1373 "(TimeRecord tr) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00001374 {"SetTimeBaseValue", (PyCFunction)TimeBaseObj_SetTimeBaseValue, 1,
1375 "(TimeValue t, TimeScale s) -> None"},
1376 {"GetTimeBaseRate", (PyCFunction)TimeBaseObj_GetTimeBaseRate, 1,
1377 "() -> (Fixed _rv)"},
1378 {"SetTimeBaseRate", (PyCFunction)TimeBaseObj_SetTimeBaseRate, 1,
1379 "(Fixed r) -> None"},
Jack Jansenb2006391998-04-23 13:22:44 +00001380 {"GetTimeBaseStartTime", (PyCFunction)TimeBaseObj_GetTimeBaseStartTime, 1,
1381 "(TimeScale s) -> (TimeValue _rv, TimeRecord tr)"},
1382 {"SetTimeBaseStartTime", (PyCFunction)TimeBaseObj_SetTimeBaseStartTime, 1,
1383 "(TimeRecord tr) -> None"},
1384 {"GetTimeBaseStopTime", (PyCFunction)TimeBaseObj_GetTimeBaseStopTime, 1,
1385 "(TimeScale s) -> (TimeValue _rv, TimeRecord tr)"},
1386 {"SetTimeBaseStopTime", (PyCFunction)TimeBaseObj_SetTimeBaseStopTime, 1,
1387 "(TimeRecord tr) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00001388 {"GetTimeBaseFlags", (PyCFunction)TimeBaseObj_GetTimeBaseFlags, 1,
1389 "() -> (long _rv)"},
1390 {"SetTimeBaseFlags", (PyCFunction)TimeBaseObj_SetTimeBaseFlags, 1,
1391 "(long timeBaseFlags) -> None"},
Jack Jansenb2006391998-04-23 13:22:44 +00001392 {"SetTimeBaseMasterTimeBase", (PyCFunction)TimeBaseObj_SetTimeBaseMasterTimeBase, 1,
1393 "(TimeBase master, TimeRecord slaveZero) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00001394 {"GetTimeBaseMasterTimeBase", (PyCFunction)TimeBaseObj_GetTimeBaseMasterTimeBase, 1,
1395 "() -> (TimeBase _rv)"},
Jack Jansenb2006391998-04-23 13:22:44 +00001396 {"SetTimeBaseMasterClock", (PyCFunction)TimeBaseObj_SetTimeBaseMasterClock, 1,
1397 "(Component clockMeister, TimeRecord slaveZero) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00001398 {"GetTimeBaseMasterClock", (PyCFunction)TimeBaseObj_GetTimeBaseMasterClock, 1,
1399 "() -> (ComponentInstance _rv)"},
Jack Jansenb2006391998-04-23 13:22:44 +00001400 {"GetTimeBaseStatus", (PyCFunction)TimeBaseObj_GetTimeBaseStatus, 1,
1401 "() -> (long _rv, TimeRecord unpinnedTime)"},
1402 {"SetTimeBaseZero", (PyCFunction)TimeBaseObj_SetTimeBaseZero, 1,
Jack Jansen1b7a70f2000-03-03 17:06:13 +00001403 "(TimeRecord zero) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00001404 {"GetTimeBaseEffectiveRate", (PyCFunction)TimeBaseObj_GetTimeBaseEffectiveRate, 1,
1405 "() -> (Fixed _rv)"},
1406 {NULL, NULL, 0}
1407};
1408
1409PyMethodChain TimeBaseObj_chain = { TimeBaseObj_methods, NULL };
1410
1411static PyObject *TimeBaseObj_getattr(self, name)
1412 TimeBaseObject *self;
1413 char *name;
1414{
1415 return Py_FindMethodInChain(&TimeBaseObj_chain, (PyObject *)self, name);
1416}
1417
1418#define TimeBaseObj_setattr NULL
1419
Jack Jansena05ac601999-12-12 21:41:51 +00001420#define TimeBaseObj_compare NULL
1421
1422#define TimeBaseObj_repr NULL
1423
1424#define TimeBaseObj_hash NULL
1425
Jack Jansen453ced51995-11-30 17:42:08 +00001426PyTypeObject TimeBase_Type = {
1427 PyObject_HEAD_INIT(&PyType_Type)
1428 0, /*ob_size*/
1429 "TimeBase", /*tp_name*/
1430 sizeof(TimeBaseObject), /*tp_basicsize*/
1431 0, /*tp_itemsize*/
1432 /* methods */
1433 (destructor) TimeBaseObj_dealloc, /*tp_dealloc*/
1434 0, /*tp_print*/
1435 (getattrfunc) TimeBaseObj_getattr, /*tp_getattr*/
1436 (setattrfunc) TimeBaseObj_setattr, /*tp_setattr*/
Jack Jansena05ac601999-12-12 21:41:51 +00001437 (cmpfunc) TimeBaseObj_compare, /*tp_compare*/
1438 (reprfunc) TimeBaseObj_repr, /*tp_repr*/
1439 (PyNumberMethods *)0, /* tp_as_number */
1440 (PySequenceMethods *)0, /* tp_as_sequence */
1441 (PyMappingMethods *)0, /* tp_as_mapping */
1442 (hashfunc) TimeBaseObj_hash, /*tp_hash*/
Jack Jansen453ced51995-11-30 17:42:08 +00001443};
1444
1445/* -------------------- End object type TimeBase -------------------- */
1446
1447
1448/* ---------------------- Object type UserData ---------------------- */
1449
1450PyTypeObject UserData_Type;
1451
1452#define UserDataObj_Check(x) ((x)->ob_type == &UserData_Type)
1453
1454typedef struct UserDataObject {
1455 PyObject_HEAD
1456 UserData ob_itself;
1457} UserDataObject;
1458
1459PyObject *UserDataObj_New(itself)
1460 UserData itself;
1461{
1462 UserDataObject *it;
1463 if (itself == NULL) {
1464 PyErr_SetString(Qt_Error,"Cannot create null UserData");
1465 return NULL;
1466 }
1467 it = PyObject_NEW(UserDataObject, &UserData_Type);
1468 if (it == NULL) return NULL;
1469 it->ob_itself = itself;
1470 return (PyObject *)it;
1471}
1472UserDataObj_Convert(v, p_itself)
1473 PyObject *v;
1474 UserData *p_itself;
1475{
1476 if (!UserDataObj_Check(v))
1477 {
1478 PyErr_SetString(PyExc_TypeError, "UserData required");
1479 return 0;
1480 }
1481 *p_itself = ((UserDataObject *)v)->ob_itself;
1482 return 1;
1483}
1484
1485static void UserDataObj_dealloc(self)
1486 UserDataObject *self;
1487{
1488 DisposeUserData(self->ob_itself);
1489 PyMem_DEL(self);
1490}
1491
1492static PyObject *UserDataObj_GetUserData(_self, _args)
1493 UserDataObject *_self;
1494 PyObject *_args;
1495{
1496 PyObject *_res = NULL;
1497 OSErr _err;
1498 Handle data;
1499 OSType udType;
1500 long index;
1501 if (!PyArg_ParseTuple(_args, "O&O&l",
1502 ResObj_Convert, &data,
1503 PyMac_GetOSType, &udType,
1504 &index))
1505 return NULL;
1506 _err = GetUserData(_self->ob_itself,
1507 data,
1508 udType,
1509 index);
1510 if (_err != noErr) return PyMac_Error(_err);
1511 Py_INCREF(Py_None);
1512 _res = Py_None;
1513 return _res;
1514}
1515
1516static PyObject *UserDataObj_AddUserData(_self, _args)
1517 UserDataObject *_self;
1518 PyObject *_args;
1519{
1520 PyObject *_res = NULL;
1521 OSErr _err;
1522 Handle data;
1523 OSType udType;
1524 if (!PyArg_ParseTuple(_args, "O&O&",
1525 ResObj_Convert, &data,
1526 PyMac_GetOSType, &udType))
1527 return NULL;
1528 _err = AddUserData(_self->ob_itself,
1529 data,
1530 udType);
1531 if (_err != noErr) return PyMac_Error(_err);
1532 Py_INCREF(Py_None);
1533 _res = Py_None;
1534 return _res;
1535}
1536
1537static PyObject *UserDataObj_RemoveUserData(_self, _args)
1538 UserDataObject *_self;
1539 PyObject *_args;
1540{
1541 PyObject *_res = NULL;
1542 OSErr _err;
1543 OSType udType;
1544 long index;
1545 if (!PyArg_ParseTuple(_args, "O&l",
1546 PyMac_GetOSType, &udType,
1547 &index))
1548 return NULL;
1549 _err = RemoveUserData(_self->ob_itself,
1550 udType,
1551 index);
1552 if (_err != noErr) return PyMac_Error(_err);
1553 Py_INCREF(Py_None);
1554 _res = Py_None;
1555 return _res;
1556}
1557
1558static PyObject *UserDataObj_CountUserDataType(_self, _args)
1559 UserDataObject *_self;
1560 PyObject *_args;
1561{
1562 PyObject *_res = NULL;
1563 short _rv;
1564 OSType udType;
1565 if (!PyArg_ParseTuple(_args, "O&",
1566 PyMac_GetOSType, &udType))
1567 return NULL;
1568 _rv = CountUserDataType(_self->ob_itself,
1569 udType);
1570 _res = Py_BuildValue("h",
1571 _rv);
1572 return _res;
1573}
1574
1575static PyObject *UserDataObj_GetNextUserDataType(_self, _args)
1576 UserDataObject *_self;
1577 PyObject *_args;
1578{
1579 PyObject *_res = NULL;
1580 long _rv;
1581 OSType udType;
1582 if (!PyArg_ParseTuple(_args, "O&",
1583 PyMac_GetOSType, &udType))
1584 return NULL;
1585 _rv = GetNextUserDataType(_self->ob_itself,
1586 udType);
1587 _res = Py_BuildValue("l",
1588 _rv);
1589 return _res;
1590}
1591
1592static PyObject *UserDataObj_AddUserDataText(_self, _args)
1593 UserDataObject *_self;
1594 PyObject *_args;
1595{
1596 PyObject *_res = NULL;
1597 OSErr _err;
1598 Handle data;
1599 OSType udType;
1600 long index;
1601 short itlRegionTag;
1602 if (!PyArg_ParseTuple(_args, "O&O&lh",
1603 ResObj_Convert, &data,
1604 PyMac_GetOSType, &udType,
1605 &index,
1606 &itlRegionTag))
1607 return NULL;
1608 _err = AddUserDataText(_self->ob_itself,
1609 data,
1610 udType,
1611 index,
1612 itlRegionTag);
1613 if (_err != noErr) return PyMac_Error(_err);
1614 Py_INCREF(Py_None);
1615 _res = Py_None;
1616 return _res;
1617}
1618
1619static PyObject *UserDataObj_GetUserDataText(_self, _args)
1620 UserDataObject *_self;
1621 PyObject *_args;
1622{
1623 PyObject *_res = NULL;
1624 OSErr _err;
1625 Handle data;
1626 OSType udType;
1627 long index;
1628 short itlRegionTag;
1629 if (!PyArg_ParseTuple(_args, "O&O&lh",
1630 ResObj_Convert, &data,
1631 PyMac_GetOSType, &udType,
1632 &index,
1633 &itlRegionTag))
1634 return NULL;
1635 _err = GetUserDataText(_self->ob_itself,
1636 data,
1637 udType,
1638 index,
1639 itlRegionTag);
1640 if (_err != noErr) return PyMac_Error(_err);
1641 Py_INCREF(Py_None);
1642 _res = Py_None;
1643 return _res;
1644}
1645
1646static PyObject *UserDataObj_RemoveUserDataText(_self, _args)
1647 UserDataObject *_self;
1648 PyObject *_args;
1649{
1650 PyObject *_res = NULL;
1651 OSErr _err;
1652 OSType udType;
1653 long index;
1654 short itlRegionTag;
1655 if (!PyArg_ParseTuple(_args, "O&lh",
1656 PyMac_GetOSType, &udType,
1657 &index,
1658 &itlRegionTag))
1659 return NULL;
1660 _err = RemoveUserDataText(_self->ob_itself,
1661 udType,
1662 index,
1663 itlRegionTag);
1664 if (_err != noErr) return PyMac_Error(_err);
1665 Py_INCREF(Py_None);
1666 _res = Py_None;
1667 return _res;
1668}
1669
1670static PyObject *UserDataObj_PutUserDataIntoHandle(_self, _args)
1671 UserDataObject *_self;
1672 PyObject *_args;
1673{
1674 PyObject *_res = NULL;
1675 OSErr _err;
1676 Handle h;
1677 if (!PyArg_ParseTuple(_args, "O&",
1678 ResObj_Convert, &h))
1679 return NULL;
1680 _err = PutUserDataIntoHandle(_self->ob_itself,
1681 h);
1682 if (_err != noErr) return PyMac_Error(_err);
1683 Py_INCREF(Py_None);
1684 _res = Py_None;
1685 return _res;
1686}
1687
1688static PyMethodDef UserDataObj_methods[] = {
1689 {"GetUserData", (PyCFunction)UserDataObj_GetUserData, 1,
1690 "(Handle data, OSType udType, long index) -> None"},
1691 {"AddUserData", (PyCFunction)UserDataObj_AddUserData, 1,
1692 "(Handle data, OSType udType) -> None"},
1693 {"RemoveUserData", (PyCFunction)UserDataObj_RemoveUserData, 1,
1694 "(OSType udType, long index) -> None"},
1695 {"CountUserDataType", (PyCFunction)UserDataObj_CountUserDataType, 1,
1696 "(OSType udType) -> (short _rv)"},
1697 {"GetNextUserDataType", (PyCFunction)UserDataObj_GetNextUserDataType, 1,
1698 "(OSType udType) -> (long _rv)"},
1699 {"AddUserDataText", (PyCFunction)UserDataObj_AddUserDataText, 1,
1700 "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
1701 {"GetUserDataText", (PyCFunction)UserDataObj_GetUserDataText, 1,
1702 "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
1703 {"RemoveUserDataText", (PyCFunction)UserDataObj_RemoveUserDataText, 1,
1704 "(OSType udType, long index, short itlRegionTag) -> None"},
1705 {"PutUserDataIntoHandle", (PyCFunction)UserDataObj_PutUserDataIntoHandle, 1,
1706 "(Handle h) -> None"},
1707 {NULL, NULL, 0}
1708};
1709
1710PyMethodChain UserDataObj_chain = { UserDataObj_methods, NULL };
1711
1712static PyObject *UserDataObj_getattr(self, name)
1713 UserDataObject *self;
1714 char *name;
1715{
1716 return Py_FindMethodInChain(&UserDataObj_chain, (PyObject *)self, name);
1717}
1718
1719#define UserDataObj_setattr NULL
1720
Jack Jansena05ac601999-12-12 21:41:51 +00001721#define UserDataObj_compare NULL
1722
1723#define UserDataObj_repr NULL
1724
1725#define UserDataObj_hash NULL
1726
Jack Jansen453ced51995-11-30 17:42:08 +00001727PyTypeObject UserData_Type = {
1728 PyObject_HEAD_INIT(&PyType_Type)
1729 0, /*ob_size*/
1730 "UserData", /*tp_name*/
1731 sizeof(UserDataObject), /*tp_basicsize*/
1732 0, /*tp_itemsize*/
1733 /* methods */
1734 (destructor) UserDataObj_dealloc, /*tp_dealloc*/
1735 0, /*tp_print*/
1736 (getattrfunc) UserDataObj_getattr, /*tp_getattr*/
1737 (setattrfunc) UserDataObj_setattr, /*tp_setattr*/
Jack Jansena05ac601999-12-12 21:41:51 +00001738 (cmpfunc) UserDataObj_compare, /*tp_compare*/
1739 (reprfunc) UserDataObj_repr, /*tp_repr*/
1740 (PyNumberMethods *)0, /* tp_as_number */
1741 (PySequenceMethods *)0, /* tp_as_sequence */
1742 (PyMappingMethods *)0, /* tp_as_mapping */
1743 (hashfunc) UserDataObj_hash, /*tp_hash*/
Jack Jansen453ced51995-11-30 17:42:08 +00001744};
1745
1746/* -------------------- End object type UserData -------------------- */
1747
1748
1749/* ----------------------- Object type Media ------------------------ */
1750
1751PyTypeObject Media_Type;
1752
1753#define MediaObj_Check(x) ((x)->ob_type == &Media_Type)
1754
1755typedef struct MediaObject {
1756 PyObject_HEAD
1757 Media ob_itself;
1758} MediaObject;
1759
1760PyObject *MediaObj_New(itself)
1761 Media itself;
1762{
1763 MediaObject *it;
1764 if (itself == NULL) {
1765 PyErr_SetString(Qt_Error,"Cannot create null Media");
1766 return NULL;
1767 }
1768 it = PyObject_NEW(MediaObject, &Media_Type);
1769 if (it == NULL) return NULL;
1770 it->ob_itself = itself;
1771 return (PyObject *)it;
1772}
1773MediaObj_Convert(v, p_itself)
1774 PyObject *v;
1775 Media *p_itself;
1776{
1777 if (!MediaObj_Check(v))
1778 {
1779 PyErr_SetString(PyExc_TypeError, "Media required");
1780 return 0;
1781 }
1782 *p_itself = ((MediaObject *)v)->ob_itself;
1783 return 1;
1784}
1785
1786static void MediaObj_dealloc(self)
1787 MediaObject *self;
1788{
1789 DisposeTrackMedia(self->ob_itself);
1790 PyMem_DEL(self);
1791}
1792
1793static PyObject *MediaObj_LoadMediaIntoRam(_self, _args)
1794 MediaObject *_self;
1795 PyObject *_args;
1796{
1797 PyObject *_res = NULL;
1798 OSErr _err;
1799 TimeValue time;
1800 TimeValue duration;
1801 long flags;
1802 if (!PyArg_ParseTuple(_args, "lll",
1803 &time,
1804 &duration,
1805 &flags))
1806 return NULL;
1807 _err = LoadMediaIntoRam(_self->ob_itself,
1808 time,
1809 duration,
1810 flags);
1811 if (_err != noErr) return PyMac_Error(_err);
1812 Py_INCREF(Py_None);
1813 _res = Py_None;
1814 return _res;
1815}
1816
1817static PyObject *MediaObj_GetMediaTrack(_self, _args)
1818 MediaObject *_self;
1819 PyObject *_args;
1820{
1821 PyObject *_res = NULL;
1822 Track _rv;
1823 if (!PyArg_ParseTuple(_args, ""))
1824 return NULL;
1825 _rv = GetMediaTrack(_self->ob_itself);
1826 _res = Py_BuildValue("O&",
1827 TrackObj_New, _rv);
1828 return _res;
1829}
1830
Jack Jansene0cf87b1997-04-09 15:53:46 +00001831static PyObject *MediaObj_GetMediaCreationTime(_self, _args)
1832 MediaObject *_self;
1833 PyObject *_args;
1834{
1835 PyObject *_res = NULL;
1836 unsigned long _rv;
1837 if (!PyArg_ParseTuple(_args, ""))
1838 return NULL;
1839 _rv = GetMediaCreationTime(_self->ob_itself);
1840 _res = Py_BuildValue("l",
1841 _rv);
1842 return _res;
1843}
1844
1845static PyObject *MediaObj_GetMediaModificationTime(_self, _args)
1846 MediaObject *_self;
1847 PyObject *_args;
1848{
1849 PyObject *_res = NULL;
1850 unsigned long _rv;
1851 if (!PyArg_ParseTuple(_args, ""))
1852 return NULL;
1853 _rv = GetMediaModificationTime(_self->ob_itself);
1854 _res = Py_BuildValue("l",
1855 _rv);
1856 return _res;
1857}
1858
Jack Jansen453ced51995-11-30 17:42:08 +00001859static PyObject *MediaObj_GetMediaTimeScale(_self, _args)
1860 MediaObject *_self;
1861 PyObject *_args;
1862{
1863 PyObject *_res = NULL;
1864 TimeScale _rv;
1865 if (!PyArg_ParseTuple(_args, ""))
1866 return NULL;
1867 _rv = GetMediaTimeScale(_self->ob_itself);
1868 _res = Py_BuildValue("l",
1869 _rv);
1870 return _res;
1871}
1872
1873static PyObject *MediaObj_SetMediaTimeScale(_self, _args)
1874 MediaObject *_self;
1875 PyObject *_args;
1876{
1877 PyObject *_res = NULL;
1878 TimeScale timeScale;
1879 if (!PyArg_ParseTuple(_args, "l",
1880 &timeScale))
1881 return NULL;
1882 SetMediaTimeScale(_self->ob_itself,
1883 timeScale);
1884 Py_INCREF(Py_None);
1885 _res = Py_None;
1886 return _res;
1887}
1888
1889static PyObject *MediaObj_GetMediaDuration(_self, _args)
1890 MediaObject *_self;
1891 PyObject *_args;
1892{
1893 PyObject *_res = NULL;
1894 TimeValue _rv;
1895 if (!PyArg_ParseTuple(_args, ""))
1896 return NULL;
1897 _rv = GetMediaDuration(_self->ob_itself);
1898 _res = Py_BuildValue("l",
1899 _rv);
1900 return _res;
1901}
1902
1903static PyObject *MediaObj_GetMediaLanguage(_self, _args)
1904 MediaObject *_self;
1905 PyObject *_args;
1906{
1907 PyObject *_res = NULL;
1908 short _rv;
1909 if (!PyArg_ParseTuple(_args, ""))
1910 return NULL;
1911 _rv = GetMediaLanguage(_self->ob_itself);
1912 _res = Py_BuildValue("h",
1913 _rv);
1914 return _res;
1915}
1916
1917static PyObject *MediaObj_SetMediaLanguage(_self, _args)
1918 MediaObject *_self;
1919 PyObject *_args;
1920{
1921 PyObject *_res = NULL;
1922 short language;
1923 if (!PyArg_ParseTuple(_args, "h",
1924 &language))
1925 return NULL;
1926 SetMediaLanguage(_self->ob_itself,
1927 language);
1928 Py_INCREF(Py_None);
1929 _res = Py_None;
1930 return _res;
1931}
1932
1933static PyObject *MediaObj_GetMediaQuality(_self, _args)
1934 MediaObject *_self;
1935 PyObject *_args;
1936{
1937 PyObject *_res = NULL;
1938 short _rv;
1939 if (!PyArg_ParseTuple(_args, ""))
1940 return NULL;
1941 _rv = GetMediaQuality(_self->ob_itself);
1942 _res = Py_BuildValue("h",
1943 _rv);
1944 return _res;
1945}
1946
1947static PyObject *MediaObj_SetMediaQuality(_self, _args)
1948 MediaObject *_self;
1949 PyObject *_args;
1950{
1951 PyObject *_res = NULL;
1952 short quality;
1953 if (!PyArg_ParseTuple(_args, "h",
1954 &quality))
1955 return NULL;
1956 SetMediaQuality(_self->ob_itself,
1957 quality);
1958 Py_INCREF(Py_None);
1959 _res = Py_None;
1960 return _res;
1961}
1962
1963static PyObject *MediaObj_GetMediaHandlerDescription(_self, _args)
1964 MediaObject *_self;
1965 PyObject *_args;
1966{
1967 PyObject *_res = NULL;
1968 OSType mediaType;
1969 Str255 creatorName;
1970 OSType creatorManufacturer;
1971 if (!PyArg_ParseTuple(_args, "O&",
1972 PyMac_GetStr255, creatorName))
1973 return NULL;
1974 GetMediaHandlerDescription(_self->ob_itself,
1975 &mediaType,
1976 creatorName,
1977 &creatorManufacturer);
1978 _res = Py_BuildValue("O&O&",
1979 PyMac_BuildOSType, mediaType,
1980 PyMac_BuildOSType, creatorManufacturer);
1981 return _res;
1982}
1983
1984static PyObject *MediaObj_GetMediaUserData(_self, _args)
1985 MediaObject *_self;
1986 PyObject *_args;
1987{
1988 PyObject *_res = NULL;
1989 UserData _rv;
1990 if (!PyArg_ParseTuple(_args, ""))
1991 return NULL;
1992 _rv = GetMediaUserData(_self->ob_itself);
1993 _res = Py_BuildValue("O&",
1994 UserDataObj_New, _rv);
1995 return _res;
1996}
1997
1998static PyObject *MediaObj_GetMediaHandler(_self, _args)
1999 MediaObject *_self;
2000 PyObject *_args;
2001{
2002 PyObject *_res = NULL;
2003 MediaHandler _rv;
2004 if (!PyArg_ParseTuple(_args, ""))
2005 return NULL;
2006 _rv = GetMediaHandler(_self->ob_itself);
2007 _res = Py_BuildValue("O&",
2008 CmpInstObj_New, _rv);
2009 return _res;
2010}
2011
2012static PyObject *MediaObj_SetMediaHandler(_self, _args)
2013 MediaObject *_self;
2014 PyObject *_args;
2015{
2016 PyObject *_res = NULL;
2017 OSErr _err;
2018 MediaHandlerComponent mH;
2019 if (!PyArg_ParseTuple(_args, "O&",
2020 CmpObj_Convert, &mH))
2021 return NULL;
2022 _err = SetMediaHandler(_self->ob_itself,
2023 mH);
2024 if (_err != noErr) return PyMac_Error(_err);
2025 Py_INCREF(Py_None);
2026 _res = Py_None;
2027 return _res;
2028}
2029
2030static PyObject *MediaObj_BeginMediaEdits(_self, _args)
2031 MediaObject *_self;
2032 PyObject *_args;
2033{
2034 PyObject *_res = NULL;
2035 OSErr _err;
2036 if (!PyArg_ParseTuple(_args, ""))
2037 return NULL;
2038 _err = BeginMediaEdits(_self->ob_itself);
2039 if (_err != noErr) return PyMac_Error(_err);
2040 Py_INCREF(Py_None);
2041 _res = Py_None;
2042 return _res;
2043}
2044
2045static PyObject *MediaObj_EndMediaEdits(_self, _args)
2046 MediaObject *_self;
2047 PyObject *_args;
2048{
2049 PyObject *_res = NULL;
2050 OSErr _err;
2051 if (!PyArg_ParseTuple(_args, ""))
2052 return NULL;
2053 _err = EndMediaEdits(_self->ob_itself);
2054 if (_err != noErr) return PyMac_Error(_err);
2055 Py_INCREF(Py_None);
2056 _res = Py_None;
2057 return _res;
2058}
2059
2060static PyObject *MediaObj_SetMediaDefaultDataRefIndex(_self, _args)
2061 MediaObject *_self;
2062 PyObject *_args;
2063{
2064 PyObject *_res = NULL;
2065 OSErr _err;
2066 short index;
2067 if (!PyArg_ParseTuple(_args, "h",
2068 &index))
2069 return NULL;
2070 _err = SetMediaDefaultDataRefIndex(_self->ob_itself,
2071 index);
2072 if (_err != noErr) return PyMac_Error(_err);
2073 Py_INCREF(Py_None);
2074 _res = Py_None;
2075 return _res;
2076}
2077
2078static PyObject *MediaObj_GetMediaDataHandlerDescription(_self, _args)
2079 MediaObject *_self;
2080 PyObject *_args;
2081{
2082 PyObject *_res = NULL;
2083 short index;
2084 OSType dhType;
2085 Str255 creatorName;
2086 OSType creatorManufacturer;
2087 if (!PyArg_ParseTuple(_args, "hO&",
2088 &index,
2089 PyMac_GetStr255, creatorName))
2090 return NULL;
2091 GetMediaDataHandlerDescription(_self->ob_itself,
2092 index,
2093 &dhType,
2094 creatorName,
2095 &creatorManufacturer);
2096 _res = Py_BuildValue("O&O&",
2097 PyMac_BuildOSType, dhType,
2098 PyMac_BuildOSType, creatorManufacturer);
2099 return _res;
2100}
2101
2102static PyObject *MediaObj_GetMediaDataHandler(_self, _args)
2103 MediaObject *_self;
2104 PyObject *_args;
2105{
2106 PyObject *_res = NULL;
2107 DataHandler _rv;
2108 short index;
2109 if (!PyArg_ParseTuple(_args, "h",
2110 &index))
2111 return NULL;
2112 _rv = GetMediaDataHandler(_self->ob_itself,
2113 index);
2114 _res = Py_BuildValue("O&",
2115 CmpInstObj_New, _rv);
2116 return _res;
2117}
2118
2119static PyObject *MediaObj_SetMediaDataHandler(_self, _args)
2120 MediaObject *_self;
2121 PyObject *_args;
2122{
2123 PyObject *_res = NULL;
2124 OSErr _err;
2125 short index;
2126 DataHandlerComponent dataHandler;
2127 if (!PyArg_ParseTuple(_args, "hO&",
2128 &index,
2129 CmpObj_Convert, &dataHandler))
2130 return NULL;
2131 _err = SetMediaDataHandler(_self->ob_itself,
2132 index,
2133 dataHandler);
2134 if (_err != noErr) return PyMac_Error(_err);
2135 Py_INCREF(Py_None);
2136 _res = Py_None;
2137 return _res;
2138}
2139
2140static PyObject *MediaObj_GetMediaSampleDescriptionCount(_self, _args)
2141 MediaObject *_self;
2142 PyObject *_args;
2143{
2144 PyObject *_res = NULL;
2145 long _rv;
2146 if (!PyArg_ParseTuple(_args, ""))
2147 return NULL;
2148 _rv = GetMediaSampleDescriptionCount(_self->ob_itself);
2149 _res = Py_BuildValue("l",
2150 _rv);
2151 return _res;
2152}
2153
2154static PyObject *MediaObj_GetMediaSampleDescription(_self, _args)
2155 MediaObject *_self;
2156 PyObject *_args;
2157{
2158 PyObject *_res = NULL;
2159 long index;
2160 SampleDescriptionHandle descH;
2161 if (!PyArg_ParseTuple(_args, "lO&",
2162 &index,
2163 ResObj_Convert, &descH))
2164 return NULL;
2165 GetMediaSampleDescription(_self->ob_itself,
2166 index,
2167 descH);
2168 Py_INCREF(Py_None);
2169 _res = Py_None;
2170 return _res;
2171}
2172
2173static PyObject *MediaObj_SetMediaSampleDescription(_self, _args)
2174 MediaObject *_self;
2175 PyObject *_args;
2176{
2177 PyObject *_res = NULL;
2178 OSErr _err;
2179 long index;
2180 SampleDescriptionHandle descH;
2181 if (!PyArg_ParseTuple(_args, "lO&",
2182 &index,
2183 ResObj_Convert, &descH))
2184 return NULL;
2185 _err = SetMediaSampleDescription(_self->ob_itself,
2186 index,
2187 descH);
2188 if (_err != noErr) return PyMac_Error(_err);
2189 Py_INCREF(Py_None);
2190 _res = Py_None;
2191 return _res;
2192}
2193
2194static PyObject *MediaObj_GetMediaSampleCount(_self, _args)
2195 MediaObject *_self;
2196 PyObject *_args;
2197{
2198 PyObject *_res = NULL;
2199 long _rv;
2200 if (!PyArg_ParseTuple(_args, ""))
2201 return NULL;
2202 _rv = GetMediaSampleCount(_self->ob_itself);
2203 _res = Py_BuildValue("l",
2204 _rv);
2205 return _res;
2206}
2207
Jack Jansen1c4e6141998-04-21 15:23:55 +00002208static PyObject *MediaObj_GetMediaSyncSampleCount(_self, _args)
2209 MediaObject *_self;
2210 PyObject *_args;
2211{
2212 PyObject *_res = NULL;
2213 long _rv;
2214 if (!PyArg_ParseTuple(_args, ""))
2215 return NULL;
2216 _rv = GetMediaSyncSampleCount(_self->ob_itself);
2217 _res = Py_BuildValue("l",
2218 _rv);
2219 return _res;
2220}
2221
Jack Jansen453ced51995-11-30 17:42:08 +00002222static PyObject *MediaObj_SampleNumToMediaTime(_self, _args)
2223 MediaObject *_self;
2224 PyObject *_args;
2225{
2226 PyObject *_res = NULL;
2227 long logicalSampleNum;
2228 TimeValue sampleTime;
2229 TimeValue sampleDuration;
2230 if (!PyArg_ParseTuple(_args, "l",
2231 &logicalSampleNum))
2232 return NULL;
2233 SampleNumToMediaTime(_self->ob_itself,
2234 logicalSampleNum,
2235 &sampleTime,
2236 &sampleDuration);
2237 _res = Py_BuildValue("ll",
2238 sampleTime,
2239 sampleDuration);
2240 return _res;
2241}
2242
2243static PyObject *MediaObj_MediaTimeToSampleNum(_self, _args)
2244 MediaObject *_self;
2245 PyObject *_args;
2246{
2247 PyObject *_res = NULL;
2248 TimeValue time;
2249 long sampleNum;
2250 TimeValue sampleTime;
2251 TimeValue sampleDuration;
2252 if (!PyArg_ParseTuple(_args, "l",
2253 &time))
2254 return NULL;
2255 MediaTimeToSampleNum(_self->ob_itself,
2256 time,
2257 &sampleNum,
2258 &sampleTime,
2259 &sampleDuration);
2260 _res = Py_BuildValue("lll",
2261 sampleNum,
2262 sampleTime,
2263 sampleDuration);
2264 return _res;
2265}
2266
2267static PyObject *MediaObj_AddMediaSample(_self, _args)
2268 MediaObject *_self;
2269 PyObject *_args;
2270{
2271 PyObject *_res = NULL;
2272 OSErr _err;
2273 Handle dataIn;
2274 long inOffset;
2275 unsigned long size;
2276 TimeValue durationPerSample;
2277 SampleDescriptionHandle sampleDescriptionH;
2278 long numberOfSamples;
2279 short sampleFlags;
2280 TimeValue sampleTime;
2281 if (!PyArg_ParseTuple(_args, "O&lllO&lh",
2282 ResObj_Convert, &dataIn,
2283 &inOffset,
2284 &size,
2285 &durationPerSample,
2286 ResObj_Convert, &sampleDescriptionH,
2287 &numberOfSamples,
2288 &sampleFlags))
2289 return NULL;
2290 _err = AddMediaSample(_self->ob_itself,
2291 dataIn,
2292 inOffset,
2293 size,
2294 durationPerSample,
2295 sampleDescriptionH,
2296 numberOfSamples,
2297 sampleFlags,
2298 &sampleTime);
2299 if (_err != noErr) return PyMac_Error(_err);
2300 _res = Py_BuildValue("l",
2301 sampleTime);
2302 return _res;
2303}
2304
2305static PyObject *MediaObj_AddMediaSampleReference(_self, _args)
2306 MediaObject *_self;
2307 PyObject *_args;
2308{
2309 PyObject *_res = NULL;
2310 OSErr _err;
2311 long dataOffset;
2312 unsigned long size;
2313 TimeValue durationPerSample;
2314 SampleDescriptionHandle sampleDescriptionH;
2315 long numberOfSamples;
2316 short sampleFlags;
2317 TimeValue sampleTime;
2318 if (!PyArg_ParseTuple(_args, "lllO&lh",
2319 &dataOffset,
2320 &size,
2321 &durationPerSample,
2322 ResObj_Convert, &sampleDescriptionH,
2323 &numberOfSamples,
2324 &sampleFlags))
2325 return NULL;
2326 _err = AddMediaSampleReference(_self->ob_itself,
2327 dataOffset,
2328 size,
2329 durationPerSample,
2330 sampleDescriptionH,
2331 numberOfSamples,
2332 sampleFlags,
2333 &sampleTime);
2334 if (_err != noErr) return PyMac_Error(_err);
2335 _res = Py_BuildValue("l",
2336 sampleTime);
2337 return _res;
2338}
2339
2340static PyObject *MediaObj_GetMediaSample(_self, _args)
2341 MediaObject *_self;
2342 PyObject *_args;
2343{
2344 PyObject *_res = NULL;
2345 OSErr _err;
2346 Handle dataOut;
2347 long maxSizeToGrow;
2348 long size;
2349 TimeValue time;
2350 TimeValue sampleTime;
2351 TimeValue durationPerSample;
2352 SampleDescriptionHandle sampleDescriptionH;
2353 long sampleDescriptionIndex;
2354 long maxNumberOfSamples;
2355 long numberOfSamples;
2356 short sampleFlags;
2357 if (!PyArg_ParseTuple(_args, "O&llO&l",
2358 ResObj_Convert, &dataOut,
2359 &maxSizeToGrow,
2360 &time,
2361 ResObj_Convert, &sampleDescriptionH,
2362 &maxNumberOfSamples))
2363 return NULL;
2364 _err = GetMediaSample(_self->ob_itself,
2365 dataOut,
2366 maxSizeToGrow,
2367 &size,
2368 time,
2369 &sampleTime,
2370 &durationPerSample,
2371 sampleDescriptionH,
2372 &sampleDescriptionIndex,
2373 maxNumberOfSamples,
2374 &numberOfSamples,
2375 &sampleFlags);
2376 if (_err != noErr) return PyMac_Error(_err);
2377 _res = Py_BuildValue("lllllh",
2378 size,
2379 sampleTime,
2380 durationPerSample,
2381 sampleDescriptionIndex,
2382 numberOfSamples,
2383 sampleFlags);
2384 return _res;
2385}
2386
2387static PyObject *MediaObj_GetMediaSampleReference(_self, _args)
2388 MediaObject *_self;
2389 PyObject *_args;
2390{
2391 PyObject *_res = NULL;
2392 OSErr _err;
2393 long dataOffset;
2394 long size;
2395 TimeValue time;
2396 TimeValue sampleTime;
2397 TimeValue durationPerSample;
2398 SampleDescriptionHandle sampleDescriptionH;
2399 long sampleDescriptionIndex;
2400 long maxNumberOfSamples;
2401 long numberOfSamples;
2402 short sampleFlags;
2403 if (!PyArg_ParseTuple(_args, "lO&l",
2404 &time,
2405 ResObj_Convert, &sampleDescriptionH,
2406 &maxNumberOfSamples))
2407 return NULL;
2408 _err = GetMediaSampleReference(_self->ob_itself,
2409 &dataOffset,
2410 &size,
2411 time,
2412 &sampleTime,
2413 &durationPerSample,
2414 sampleDescriptionH,
2415 &sampleDescriptionIndex,
2416 maxNumberOfSamples,
2417 &numberOfSamples,
2418 &sampleFlags);
2419 if (_err != noErr) return PyMac_Error(_err);
2420 _res = Py_BuildValue("llllllh",
2421 dataOffset,
2422 size,
2423 sampleTime,
2424 durationPerSample,
2425 sampleDescriptionIndex,
2426 numberOfSamples,
2427 sampleFlags);
2428 return _res;
2429}
2430
2431static PyObject *MediaObj_SetMediaPreferredChunkSize(_self, _args)
2432 MediaObject *_self;
2433 PyObject *_args;
2434{
2435 PyObject *_res = NULL;
2436 OSErr _err;
2437 long maxChunkSize;
2438 if (!PyArg_ParseTuple(_args, "l",
2439 &maxChunkSize))
2440 return NULL;
2441 _err = SetMediaPreferredChunkSize(_self->ob_itself,
2442 maxChunkSize);
2443 if (_err != noErr) return PyMac_Error(_err);
2444 Py_INCREF(Py_None);
2445 _res = Py_None;
2446 return _res;
2447}
2448
2449static PyObject *MediaObj_GetMediaPreferredChunkSize(_self, _args)
2450 MediaObject *_self;
2451 PyObject *_args;
2452{
2453 PyObject *_res = NULL;
2454 OSErr _err;
2455 long maxChunkSize;
2456 if (!PyArg_ParseTuple(_args, ""))
2457 return NULL;
2458 _err = GetMediaPreferredChunkSize(_self->ob_itself,
2459 &maxChunkSize);
2460 if (_err != noErr) return PyMac_Error(_err);
2461 _res = Py_BuildValue("l",
2462 maxChunkSize);
2463 return _res;
2464}
2465
2466static PyObject *MediaObj_SetMediaShadowSync(_self, _args)
2467 MediaObject *_self;
2468 PyObject *_args;
2469{
2470 PyObject *_res = NULL;
2471 OSErr _err;
2472 long frameDiffSampleNum;
2473 long syncSampleNum;
2474 if (!PyArg_ParseTuple(_args, "ll",
2475 &frameDiffSampleNum,
2476 &syncSampleNum))
2477 return NULL;
2478 _err = SetMediaShadowSync(_self->ob_itself,
2479 frameDiffSampleNum,
2480 syncSampleNum);
2481 if (_err != noErr) return PyMac_Error(_err);
2482 Py_INCREF(Py_None);
2483 _res = Py_None;
2484 return _res;
2485}
2486
2487static PyObject *MediaObj_GetMediaShadowSync(_self, _args)
2488 MediaObject *_self;
2489 PyObject *_args;
2490{
2491 PyObject *_res = NULL;
2492 OSErr _err;
2493 long frameDiffSampleNum;
2494 long syncSampleNum;
2495 if (!PyArg_ParseTuple(_args, "l",
2496 &frameDiffSampleNum))
2497 return NULL;
2498 _err = GetMediaShadowSync(_self->ob_itself,
2499 frameDiffSampleNum,
2500 &syncSampleNum);
2501 if (_err != noErr) return PyMac_Error(_err);
2502 _res = Py_BuildValue("l",
2503 syncSampleNum);
2504 return _res;
2505}
2506
2507static PyObject *MediaObj_GetMediaDataSize(_self, _args)
2508 MediaObject *_self;
2509 PyObject *_args;
2510{
2511 PyObject *_res = NULL;
2512 long _rv;
2513 TimeValue startTime;
2514 TimeValue duration;
2515 if (!PyArg_ParseTuple(_args, "ll",
2516 &startTime,
2517 &duration))
2518 return NULL;
2519 _rv = GetMediaDataSize(_self->ob_itself,
2520 startTime,
2521 duration);
2522 _res = Py_BuildValue("l",
2523 _rv);
2524 return _res;
2525}
2526
Jack Jansen723ad8a2000-12-12 22:10:21 +00002527static PyObject *MediaObj_GetMediaDataSize64(_self, _args)
2528 MediaObject *_self;
2529 PyObject *_args;
2530{
2531 PyObject *_res = NULL;
2532 OSErr _err;
2533 TimeValue startTime;
2534 TimeValue duration;
2535 wide dataSize;
2536 if (!PyArg_ParseTuple(_args, "ll",
2537 &startTime,
2538 &duration))
2539 return NULL;
2540 _err = GetMediaDataSize64(_self->ob_itself,
2541 startTime,
2542 duration,
2543 &dataSize);
2544 if (_err != noErr) return PyMac_Error(_err);
2545 _res = Py_BuildValue("O&",
2546 PyMac_Buildwide, dataSize);
2547 return _res;
2548}
2549
Jack Jansen453ced51995-11-30 17:42:08 +00002550static PyObject *MediaObj_GetMediaNextInterestingTime(_self, _args)
2551 MediaObject *_self;
2552 PyObject *_args;
2553{
2554 PyObject *_res = NULL;
2555 short interestingTimeFlags;
2556 TimeValue time;
2557 Fixed rate;
2558 TimeValue interestingTime;
2559 TimeValue interestingDuration;
2560 if (!PyArg_ParseTuple(_args, "hlO&",
2561 &interestingTimeFlags,
2562 &time,
2563 PyMac_GetFixed, &rate))
2564 return NULL;
2565 GetMediaNextInterestingTime(_self->ob_itself,
2566 interestingTimeFlags,
2567 time,
2568 rate,
2569 &interestingTime,
2570 &interestingDuration);
2571 _res = Py_BuildValue("ll",
2572 interestingTime,
2573 interestingDuration);
2574 return _res;
2575}
2576
2577static PyObject *MediaObj_GetMediaDataRef(_self, _args)
2578 MediaObject *_self;
2579 PyObject *_args;
2580{
2581 PyObject *_res = NULL;
2582 OSErr _err;
2583 short index;
2584 Handle dataRef;
2585 OSType dataRefType;
2586 long dataRefAttributes;
2587 if (!PyArg_ParseTuple(_args, "h",
2588 &index))
2589 return NULL;
2590 _err = GetMediaDataRef(_self->ob_itself,
2591 index,
2592 &dataRef,
2593 &dataRefType,
2594 &dataRefAttributes);
2595 if (_err != noErr) return PyMac_Error(_err);
2596 _res = Py_BuildValue("O&O&l",
2597 ResObj_New, dataRef,
2598 PyMac_BuildOSType, dataRefType,
2599 dataRefAttributes);
2600 return _res;
2601}
2602
2603static PyObject *MediaObj_SetMediaDataRef(_self, _args)
2604 MediaObject *_self;
2605 PyObject *_args;
2606{
2607 PyObject *_res = NULL;
2608 OSErr _err;
2609 short index;
2610 Handle dataRef;
2611 OSType dataRefType;
2612 if (!PyArg_ParseTuple(_args, "hO&O&",
2613 &index,
2614 ResObj_Convert, &dataRef,
2615 PyMac_GetOSType, &dataRefType))
2616 return NULL;
2617 _err = SetMediaDataRef(_self->ob_itself,
2618 index,
2619 dataRef,
2620 dataRefType);
2621 if (_err != noErr) return PyMac_Error(_err);
2622 Py_INCREF(Py_None);
2623 _res = Py_None;
2624 return _res;
2625}
2626
2627static PyObject *MediaObj_SetMediaDataRefAttributes(_self, _args)
2628 MediaObject *_self;
2629 PyObject *_args;
2630{
2631 PyObject *_res = NULL;
2632 OSErr _err;
2633 short index;
2634 long dataRefAttributes;
2635 if (!PyArg_ParseTuple(_args, "hl",
2636 &index,
2637 &dataRefAttributes))
2638 return NULL;
2639 _err = SetMediaDataRefAttributes(_self->ob_itself,
2640 index,
2641 dataRefAttributes);
2642 if (_err != noErr) return PyMac_Error(_err);
2643 Py_INCREF(Py_None);
2644 _res = Py_None;
2645 return _res;
2646}
2647
2648static PyObject *MediaObj_AddMediaDataRef(_self, _args)
2649 MediaObject *_self;
2650 PyObject *_args;
2651{
2652 PyObject *_res = NULL;
2653 OSErr _err;
2654 short index;
2655 Handle dataRef;
2656 OSType dataRefType;
2657 if (!PyArg_ParseTuple(_args, "O&O&",
2658 ResObj_Convert, &dataRef,
2659 PyMac_GetOSType, &dataRefType))
2660 return NULL;
2661 _err = AddMediaDataRef(_self->ob_itself,
2662 &index,
2663 dataRef,
2664 dataRefType);
2665 if (_err != noErr) return PyMac_Error(_err);
2666 _res = Py_BuildValue("h",
2667 index);
2668 return _res;
2669}
2670
2671static PyObject *MediaObj_GetMediaDataRefCount(_self, _args)
2672 MediaObject *_self;
2673 PyObject *_args;
2674{
2675 PyObject *_res = NULL;
2676 OSErr _err;
2677 short count;
2678 if (!PyArg_ParseTuple(_args, ""))
2679 return NULL;
2680 _err = GetMediaDataRefCount(_self->ob_itself,
2681 &count);
2682 if (_err != noErr) return PyMac_Error(_err);
2683 _res = Py_BuildValue("h",
2684 count);
2685 return _res;
2686}
2687
2688static PyObject *MediaObj_SetMediaPlayHints(_self, _args)
2689 MediaObject *_self;
2690 PyObject *_args;
2691{
2692 PyObject *_res = NULL;
2693 long flags;
2694 long flagsMask;
2695 if (!PyArg_ParseTuple(_args, "ll",
2696 &flags,
2697 &flagsMask))
2698 return NULL;
2699 SetMediaPlayHints(_self->ob_itself,
2700 flags,
2701 flagsMask);
2702 Py_INCREF(Py_None);
2703 _res = Py_None;
2704 return _res;
2705}
2706
Jack Jansen1c4e6141998-04-21 15:23:55 +00002707static PyObject *MediaObj_GetMediaPlayHints(_self, _args)
2708 MediaObject *_self;
2709 PyObject *_args;
2710{
2711 PyObject *_res = NULL;
2712 long flags;
2713 if (!PyArg_ParseTuple(_args, ""))
2714 return NULL;
2715 GetMediaPlayHints(_self->ob_itself,
2716 &flags);
2717 _res = Py_BuildValue("l",
2718 flags);
2719 return _res;
2720}
2721
Jack Jansenc59996e2000-03-17 16:49:59 +00002722static PyObject *MediaObj_GetMediaNextInterestingTimeOnly(_self, _args)
2723 MediaObject *_self;
2724 PyObject *_args;
2725{
2726 PyObject *_res = NULL;
2727 short interestingTimeFlags;
2728 TimeValue time;
2729 Fixed rate;
2730 TimeValue interestingTime;
2731 if (!PyArg_ParseTuple(_args, "hlO&",
2732 &interestingTimeFlags,
2733 &time,
2734 PyMac_GetFixed, &rate))
2735 return NULL;
2736 GetMediaNextInterestingTimeOnly(_self->ob_itself,
2737 interestingTimeFlags,
2738 time,
2739 rate,
2740 &interestingTime);
2741 _res = Py_BuildValue("l",
2742 interestingTime);
2743 return _res;
2744}
2745
Jack Jansen453ced51995-11-30 17:42:08 +00002746static PyMethodDef MediaObj_methods[] = {
2747 {"LoadMediaIntoRam", (PyCFunction)MediaObj_LoadMediaIntoRam, 1,
2748 "(TimeValue time, TimeValue duration, long flags) -> None"},
2749 {"GetMediaTrack", (PyCFunction)MediaObj_GetMediaTrack, 1,
2750 "() -> (Track _rv)"},
Jack Jansene0cf87b1997-04-09 15:53:46 +00002751 {"GetMediaCreationTime", (PyCFunction)MediaObj_GetMediaCreationTime, 1,
2752 "() -> (unsigned long _rv)"},
2753 {"GetMediaModificationTime", (PyCFunction)MediaObj_GetMediaModificationTime, 1,
2754 "() -> (unsigned long _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00002755 {"GetMediaTimeScale", (PyCFunction)MediaObj_GetMediaTimeScale, 1,
2756 "() -> (TimeScale _rv)"},
2757 {"SetMediaTimeScale", (PyCFunction)MediaObj_SetMediaTimeScale, 1,
2758 "(TimeScale timeScale) -> None"},
2759 {"GetMediaDuration", (PyCFunction)MediaObj_GetMediaDuration, 1,
2760 "() -> (TimeValue _rv)"},
2761 {"GetMediaLanguage", (PyCFunction)MediaObj_GetMediaLanguage, 1,
2762 "() -> (short _rv)"},
2763 {"SetMediaLanguage", (PyCFunction)MediaObj_SetMediaLanguage, 1,
2764 "(short language) -> None"},
2765 {"GetMediaQuality", (PyCFunction)MediaObj_GetMediaQuality, 1,
2766 "() -> (short _rv)"},
2767 {"SetMediaQuality", (PyCFunction)MediaObj_SetMediaQuality, 1,
2768 "(short quality) -> None"},
2769 {"GetMediaHandlerDescription", (PyCFunction)MediaObj_GetMediaHandlerDescription, 1,
2770 "(Str255 creatorName) -> (OSType mediaType, OSType creatorManufacturer)"},
2771 {"GetMediaUserData", (PyCFunction)MediaObj_GetMediaUserData, 1,
2772 "() -> (UserData _rv)"},
2773 {"GetMediaHandler", (PyCFunction)MediaObj_GetMediaHandler, 1,
2774 "() -> (MediaHandler _rv)"},
2775 {"SetMediaHandler", (PyCFunction)MediaObj_SetMediaHandler, 1,
2776 "(MediaHandlerComponent mH) -> None"},
2777 {"BeginMediaEdits", (PyCFunction)MediaObj_BeginMediaEdits, 1,
2778 "() -> None"},
2779 {"EndMediaEdits", (PyCFunction)MediaObj_EndMediaEdits, 1,
2780 "() -> None"},
2781 {"SetMediaDefaultDataRefIndex", (PyCFunction)MediaObj_SetMediaDefaultDataRefIndex, 1,
2782 "(short index) -> None"},
2783 {"GetMediaDataHandlerDescription", (PyCFunction)MediaObj_GetMediaDataHandlerDescription, 1,
2784 "(short index, Str255 creatorName) -> (OSType dhType, OSType creatorManufacturer)"},
2785 {"GetMediaDataHandler", (PyCFunction)MediaObj_GetMediaDataHandler, 1,
2786 "(short index) -> (DataHandler _rv)"},
2787 {"SetMediaDataHandler", (PyCFunction)MediaObj_SetMediaDataHandler, 1,
2788 "(short index, DataHandlerComponent dataHandler) -> None"},
2789 {"GetMediaSampleDescriptionCount", (PyCFunction)MediaObj_GetMediaSampleDescriptionCount, 1,
2790 "() -> (long _rv)"},
2791 {"GetMediaSampleDescription", (PyCFunction)MediaObj_GetMediaSampleDescription, 1,
2792 "(long index, SampleDescriptionHandle descH) -> None"},
2793 {"SetMediaSampleDescription", (PyCFunction)MediaObj_SetMediaSampleDescription, 1,
2794 "(long index, SampleDescriptionHandle descH) -> None"},
2795 {"GetMediaSampleCount", (PyCFunction)MediaObj_GetMediaSampleCount, 1,
2796 "() -> (long _rv)"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00002797 {"GetMediaSyncSampleCount", (PyCFunction)MediaObj_GetMediaSyncSampleCount, 1,
2798 "() -> (long _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00002799 {"SampleNumToMediaTime", (PyCFunction)MediaObj_SampleNumToMediaTime, 1,
2800 "(long logicalSampleNum) -> (TimeValue sampleTime, TimeValue sampleDuration)"},
2801 {"MediaTimeToSampleNum", (PyCFunction)MediaObj_MediaTimeToSampleNum, 1,
2802 "(TimeValue time) -> (long sampleNum, TimeValue sampleTime, TimeValue sampleDuration)"},
2803 {"AddMediaSample", (PyCFunction)MediaObj_AddMediaSample, 1,
2804 "(Handle dataIn, long inOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
2805 {"AddMediaSampleReference", (PyCFunction)MediaObj_AddMediaSampleReference, 1,
2806 "(long dataOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
2807 {"GetMediaSample", (PyCFunction)MediaObj_GetMediaSample, 1,
2808 "(Handle dataOut, long maxSizeToGrow, TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
2809 {"GetMediaSampleReference", (PyCFunction)MediaObj_GetMediaSampleReference, 1,
2810 "(TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long dataOffset, long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
2811 {"SetMediaPreferredChunkSize", (PyCFunction)MediaObj_SetMediaPreferredChunkSize, 1,
2812 "(long maxChunkSize) -> None"},
2813 {"GetMediaPreferredChunkSize", (PyCFunction)MediaObj_GetMediaPreferredChunkSize, 1,
2814 "() -> (long maxChunkSize)"},
2815 {"SetMediaShadowSync", (PyCFunction)MediaObj_SetMediaShadowSync, 1,
2816 "(long frameDiffSampleNum, long syncSampleNum) -> None"},
2817 {"GetMediaShadowSync", (PyCFunction)MediaObj_GetMediaShadowSync, 1,
2818 "(long frameDiffSampleNum) -> (long syncSampleNum)"},
2819 {"GetMediaDataSize", (PyCFunction)MediaObj_GetMediaDataSize, 1,
2820 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
Jack Jansen723ad8a2000-12-12 22:10:21 +00002821 {"GetMediaDataSize64", (PyCFunction)MediaObj_GetMediaDataSize64, 1,
2822 "(TimeValue startTime, TimeValue duration) -> (wide dataSize)"},
Jack Jansen453ced51995-11-30 17:42:08 +00002823 {"GetMediaNextInterestingTime", (PyCFunction)MediaObj_GetMediaNextInterestingTime, 1,
2824 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
2825 {"GetMediaDataRef", (PyCFunction)MediaObj_GetMediaDataRef, 1,
2826 "(short index) -> (Handle dataRef, OSType dataRefType, long dataRefAttributes)"},
2827 {"SetMediaDataRef", (PyCFunction)MediaObj_SetMediaDataRef, 1,
2828 "(short index, Handle dataRef, OSType dataRefType) -> None"},
2829 {"SetMediaDataRefAttributes", (PyCFunction)MediaObj_SetMediaDataRefAttributes, 1,
2830 "(short index, long dataRefAttributes) -> None"},
2831 {"AddMediaDataRef", (PyCFunction)MediaObj_AddMediaDataRef, 1,
2832 "(Handle dataRef, OSType dataRefType) -> (short index)"},
2833 {"GetMediaDataRefCount", (PyCFunction)MediaObj_GetMediaDataRefCount, 1,
2834 "() -> (short count)"},
2835 {"SetMediaPlayHints", (PyCFunction)MediaObj_SetMediaPlayHints, 1,
2836 "(long flags, long flagsMask) -> None"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00002837 {"GetMediaPlayHints", (PyCFunction)MediaObj_GetMediaPlayHints, 1,
2838 "() -> (long flags)"},
Jack Jansenc59996e2000-03-17 16:49:59 +00002839 {"GetMediaNextInterestingTimeOnly", (PyCFunction)MediaObj_GetMediaNextInterestingTimeOnly, 1,
2840 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime)"},
Jack Jansen453ced51995-11-30 17:42:08 +00002841 {NULL, NULL, 0}
2842};
2843
2844PyMethodChain MediaObj_chain = { MediaObj_methods, NULL };
2845
2846static PyObject *MediaObj_getattr(self, name)
2847 MediaObject *self;
2848 char *name;
2849{
2850 return Py_FindMethodInChain(&MediaObj_chain, (PyObject *)self, name);
2851}
2852
2853#define MediaObj_setattr NULL
2854
Jack Jansena05ac601999-12-12 21:41:51 +00002855#define MediaObj_compare NULL
2856
2857#define MediaObj_repr NULL
2858
2859#define MediaObj_hash NULL
2860
Jack Jansen453ced51995-11-30 17:42:08 +00002861PyTypeObject Media_Type = {
2862 PyObject_HEAD_INIT(&PyType_Type)
2863 0, /*ob_size*/
2864 "Media", /*tp_name*/
2865 sizeof(MediaObject), /*tp_basicsize*/
2866 0, /*tp_itemsize*/
2867 /* methods */
2868 (destructor) MediaObj_dealloc, /*tp_dealloc*/
2869 0, /*tp_print*/
2870 (getattrfunc) MediaObj_getattr, /*tp_getattr*/
2871 (setattrfunc) MediaObj_setattr, /*tp_setattr*/
Jack Jansena05ac601999-12-12 21:41:51 +00002872 (cmpfunc) MediaObj_compare, /*tp_compare*/
2873 (reprfunc) MediaObj_repr, /*tp_repr*/
2874 (PyNumberMethods *)0, /* tp_as_number */
2875 (PySequenceMethods *)0, /* tp_as_sequence */
2876 (PyMappingMethods *)0, /* tp_as_mapping */
2877 (hashfunc) MediaObj_hash, /*tp_hash*/
Jack Jansen453ced51995-11-30 17:42:08 +00002878};
2879
2880/* --------------------- End object type Media ---------------------- */
2881
2882
2883/* ----------------------- Object type Track ------------------------ */
2884
2885PyTypeObject Track_Type;
2886
2887#define TrackObj_Check(x) ((x)->ob_type == &Track_Type)
2888
2889typedef struct TrackObject {
2890 PyObject_HEAD
2891 Track ob_itself;
2892} TrackObject;
2893
2894PyObject *TrackObj_New(itself)
2895 Track itself;
2896{
2897 TrackObject *it;
2898 if (itself == NULL) {
2899 PyErr_SetString(Qt_Error,"Cannot create null Track");
2900 return NULL;
2901 }
2902 it = PyObject_NEW(TrackObject, &Track_Type);
2903 if (it == NULL) return NULL;
2904 it->ob_itself = itself;
2905 return (PyObject *)it;
2906}
2907TrackObj_Convert(v, p_itself)
2908 PyObject *v;
2909 Track *p_itself;
2910{
2911 if (!TrackObj_Check(v))
2912 {
2913 PyErr_SetString(PyExc_TypeError, "Track required");
2914 return 0;
2915 }
2916 *p_itself = ((TrackObject *)v)->ob_itself;
2917 return 1;
2918}
2919
2920static void TrackObj_dealloc(self)
2921 TrackObject *self;
2922{
2923 DisposeMovieTrack(self->ob_itself);
2924 PyMem_DEL(self);
2925}
2926
2927static PyObject *TrackObj_LoadTrackIntoRam(_self, _args)
2928 TrackObject *_self;
2929 PyObject *_args;
2930{
2931 PyObject *_res = NULL;
2932 OSErr _err;
2933 TimeValue time;
2934 TimeValue duration;
2935 long flags;
2936 if (!PyArg_ParseTuple(_args, "lll",
2937 &time,
2938 &duration,
2939 &flags))
2940 return NULL;
2941 _err = LoadTrackIntoRam(_self->ob_itself,
2942 time,
2943 duration,
2944 flags);
2945 if (_err != noErr) return PyMac_Error(_err);
2946 Py_INCREF(Py_None);
2947 _res = Py_None;
2948 return _res;
2949}
2950
2951static PyObject *TrackObj_GetTrackPict(_self, _args)
2952 TrackObject *_self;
2953 PyObject *_args;
2954{
2955 PyObject *_res = NULL;
2956 PicHandle _rv;
2957 TimeValue time;
2958 if (!PyArg_ParseTuple(_args, "l",
2959 &time))
2960 return NULL;
2961 _rv = GetTrackPict(_self->ob_itself,
2962 time);
2963 _res = Py_BuildValue("O&",
2964 ResObj_New, _rv);
2965 return _res;
2966}
2967
2968static PyObject *TrackObj_GetTrackClipRgn(_self, _args)
2969 TrackObject *_self;
2970 PyObject *_args;
2971{
2972 PyObject *_res = NULL;
2973 RgnHandle _rv;
2974 if (!PyArg_ParseTuple(_args, ""))
2975 return NULL;
2976 _rv = GetTrackClipRgn(_self->ob_itself);
2977 _res = Py_BuildValue("O&",
2978 ResObj_New, _rv);
2979 return _res;
2980}
2981
2982static PyObject *TrackObj_SetTrackClipRgn(_self, _args)
2983 TrackObject *_self;
2984 PyObject *_args;
2985{
2986 PyObject *_res = NULL;
2987 RgnHandle theClip;
2988 if (!PyArg_ParseTuple(_args, "O&",
2989 ResObj_Convert, &theClip))
2990 return NULL;
2991 SetTrackClipRgn(_self->ob_itself,
2992 theClip);
2993 Py_INCREF(Py_None);
2994 _res = Py_None;
2995 return _res;
2996}
2997
2998static PyObject *TrackObj_GetTrackDisplayBoundsRgn(_self, _args)
2999 TrackObject *_self;
3000 PyObject *_args;
3001{
3002 PyObject *_res = NULL;
3003 RgnHandle _rv;
3004 if (!PyArg_ParseTuple(_args, ""))
3005 return NULL;
3006 _rv = GetTrackDisplayBoundsRgn(_self->ob_itself);
3007 _res = Py_BuildValue("O&",
3008 ResObj_New, _rv);
3009 return _res;
3010}
3011
3012static PyObject *TrackObj_GetTrackMovieBoundsRgn(_self, _args)
3013 TrackObject *_self;
3014 PyObject *_args;
3015{
3016 PyObject *_res = NULL;
3017 RgnHandle _rv;
3018 if (!PyArg_ParseTuple(_args, ""))
3019 return NULL;
3020 _rv = GetTrackMovieBoundsRgn(_self->ob_itself);
3021 _res = Py_BuildValue("O&",
3022 ResObj_New, _rv);
3023 return _res;
3024}
3025
3026static PyObject *TrackObj_GetTrackBoundsRgn(_self, _args)
3027 TrackObject *_self;
3028 PyObject *_args;
3029{
3030 PyObject *_res = NULL;
3031 RgnHandle _rv;
3032 if (!PyArg_ParseTuple(_args, ""))
3033 return NULL;
3034 _rv = GetTrackBoundsRgn(_self->ob_itself);
3035 _res = Py_BuildValue("O&",
3036 ResObj_New, _rv);
3037 return _res;
3038}
3039
3040static PyObject *TrackObj_GetTrackMatte(_self, _args)
3041 TrackObject *_self;
3042 PyObject *_args;
3043{
3044 PyObject *_res = NULL;
3045 PixMapHandle _rv;
3046 if (!PyArg_ParseTuple(_args, ""))
3047 return NULL;
3048 _rv = GetTrackMatte(_self->ob_itself);
3049 _res = Py_BuildValue("O&",
3050 ResObj_New, _rv);
3051 return _res;
3052}
3053
3054static PyObject *TrackObj_SetTrackMatte(_self, _args)
3055 TrackObject *_self;
3056 PyObject *_args;
3057{
3058 PyObject *_res = NULL;
3059 PixMapHandle theMatte;
3060 if (!PyArg_ParseTuple(_args, "O&",
3061 ResObj_Convert, &theMatte))
3062 return NULL;
3063 SetTrackMatte(_self->ob_itself,
3064 theMatte);
3065 Py_INCREF(Py_None);
3066 _res = Py_None;
3067 return _res;
3068}
3069
3070static PyObject *TrackObj_GetTrackID(_self, _args)
3071 TrackObject *_self;
3072 PyObject *_args;
3073{
3074 PyObject *_res = NULL;
3075 long _rv;
3076 if (!PyArg_ParseTuple(_args, ""))
3077 return NULL;
3078 _rv = GetTrackID(_self->ob_itself);
3079 _res = Py_BuildValue("l",
3080 _rv);
3081 return _res;
3082}
3083
3084static PyObject *TrackObj_GetTrackMovie(_self, _args)
3085 TrackObject *_self;
3086 PyObject *_args;
3087{
3088 PyObject *_res = NULL;
3089 Movie _rv;
3090 if (!PyArg_ParseTuple(_args, ""))
3091 return NULL;
3092 _rv = GetTrackMovie(_self->ob_itself);
3093 _res = Py_BuildValue("O&",
3094 MovieObj_New, _rv);
3095 return _res;
3096}
3097
Jack Jansene0cf87b1997-04-09 15:53:46 +00003098static PyObject *TrackObj_GetTrackCreationTime(_self, _args)
3099 TrackObject *_self;
3100 PyObject *_args;
3101{
3102 PyObject *_res = NULL;
3103 unsigned long _rv;
3104 if (!PyArg_ParseTuple(_args, ""))
3105 return NULL;
3106 _rv = GetTrackCreationTime(_self->ob_itself);
3107 _res = Py_BuildValue("l",
3108 _rv);
3109 return _res;
3110}
3111
3112static PyObject *TrackObj_GetTrackModificationTime(_self, _args)
3113 TrackObject *_self;
3114 PyObject *_args;
3115{
3116 PyObject *_res = NULL;
3117 unsigned long _rv;
3118 if (!PyArg_ParseTuple(_args, ""))
3119 return NULL;
3120 _rv = GetTrackModificationTime(_self->ob_itself);
3121 _res = Py_BuildValue("l",
3122 _rv);
3123 return _res;
3124}
3125
Jack Jansen453ced51995-11-30 17:42:08 +00003126static PyObject *TrackObj_GetTrackEnabled(_self, _args)
3127 TrackObject *_self;
3128 PyObject *_args;
3129{
3130 PyObject *_res = NULL;
3131 Boolean _rv;
3132 if (!PyArg_ParseTuple(_args, ""))
3133 return NULL;
3134 _rv = GetTrackEnabled(_self->ob_itself);
3135 _res = Py_BuildValue("b",
3136 _rv);
3137 return _res;
3138}
3139
3140static PyObject *TrackObj_SetTrackEnabled(_self, _args)
3141 TrackObject *_self;
3142 PyObject *_args;
3143{
3144 PyObject *_res = NULL;
3145 Boolean isEnabled;
3146 if (!PyArg_ParseTuple(_args, "b",
3147 &isEnabled))
3148 return NULL;
3149 SetTrackEnabled(_self->ob_itself,
3150 isEnabled);
3151 Py_INCREF(Py_None);
3152 _res = Py_None;
3153 return _res;
3154}
3155
3156static PyObject *TrackObj_GetTrackUsage(_self, _args)
3157 TrackObject *_self;
3158 PyObject *_args;
3159{
3160 PyObject *_res = NULL;
3161 long _rv;
3162 if (!PyArg_ParseTuple(_args, ""))
3163 return NULL;
3164 _rv = GetTrackUsage(_self->ob_itself);
3165 _res = Py_BuildValue("l",
3166 _rv);
3167 return _res;
3168}
3169
3170static PyObject *TrackObj_SetTrackUsage(_self, _args)
3171 TrackObject *_self;
3172 PyObject *_args;
3173{
3174 PyObject *_res = NULL;
3175 long usage;
3176 if (!PyArg_ParseTuple(_args, "l",
3177 &usage))
3178 return NULL;
3179 SetTrackUsage(_self->ob_itself,
3180 usage);
3181 Py_INCREF(Py_None);
3182 _res = Py_None;
3183 return _res;
3184}
3185
3186static PyObject *TrackObj_GetTrackDuration(_self, _args)
3187 TrackObject *_self;
3188 PyObject *_args;
3189{
3190 PyObject *_res = NULL;
3191 TimeValue _rv;
3192 if (!PyArg_ParseTuple(_args, ""))
3193 return NULL;
3194 _rv = GetTrackDuration(_self->ob_itself);
3195 _res = Py_BuildValue("l",
3196 _rv);
3197 return _res;
3198}
3199
3200static PyObject *TrackObj_GetTrackOffset(_self, _args)
3201 TrackObject *_self;
3202 PyObject *_args;
3203{
3204 PyObject *_res = NULL;
3205 TimeValue _rv;
3206 if (!PyArg_ParseTuple(_args, ""))
3207 return NULL;
3208 _rv = GetTrackOffset(_self->ob_itself);
3209 _res = Py_BuildValue("l",
3210 _rv);
3211 return _res;
3212}
3213
3214static PyObject *TrackObj_SetTrackOffset(_self, _args)
3215 TrackObject *_self;
3216 PyObject *_args;
3217{
3218 PyObject *_res = NULL;
3219 TimeValue movieOffsetTime;
3220 if (!PyArg_ParseTuple(_args, "l",
3221 &movieOffsetTime))
3222 return NULL;
3223 SetTrackOffset(_self->ob_itself,
3224 movieOffsetTime);
3225 Py_INCREF(Py_None);
3226 _res = Py_None;
3227 return _res;
3228}
3229
3230static PyObject *TrackObj_GetTrackLayer(_self, _args)
3231 TrackObject *_self;
3232 PyObject *_args;
3233{
3234 PyObject *_res = NULL;
3235 short _rv;
3236 if (!PyArg_ParseTuple(_args, ""))
3237 return NULL;
3238 _rv = GetTrackLayer(_self->ob_itself);
3239 _res = Py_BuildValue("h",
3240 _rv);
3241 return _res;
3242}
3243
3244static PyObject *TrackObj_SetTrackLayer(_self, _args)
3245 TrackObject *_self;
3246 PyObject *_args;
3247{
3248 PyObject *_res = NULL;
3249 short layer;
3250 if (!PyArg_ParseTuple(_args, "h",
3251 &layer))
3252 return NULL;
3253 SetTrackLayer(_self->ob_itself,
3254 layer);
3255 Py_INCREF(Py_None);
3256 _res = Py_None;
3257 return _res;
3258}
3259
3260static PyObject *TrackObj_GetTrackAlternate(_self, _args)
3261 TrackObject *_self;
3262 PyObject *_args;
3263{
3264 PyObject *_res = NULL;
3265 Track _rv;
3266 if (!PyArg_ParseTuple(_args, ""))
3267 return NULL;
3268 _rv = GetTrackAlternate(_self->ob_itself);
3269 _res = Py_BuildValue("O&",
3270 TrackObj_New, _rv);
3271 return _res;
3272}
3273
3274static PyObject *TrackObj_SetTrackAlternate(_self, _args)
3275 TrackObject *_self;
3276 PyObject *_args;
3277{
3278 PyObject *_res = NULL;
3279 Track alternateT;
3280 if (!PyArg_ParseTuple(_args, "O&",
3281 TrackObj_Convert, &alternateT))
3282 return NULL;
3283 SetTrackAlternate(_self->ob_itself,
3284 alternateT);
3285 Py_INCREF(Py_None);
3286 _res = Py_None;
3287 return _res;
3288}
3289
3290static PyObject *TrackObj_GetTrackVolume(_self, _args)
3291 TrackObject *_self;
3292 PyObject *_args;
3293{
3294 PyObject *_res = NULL;
3295 short _rv;
3296 if (!PyArg_ParseTuple(_args, ""))
3297 return NULL;
3298 _rv = GetTrackVolume(_self->ob_itself);
3299 _res = Py_BuildValue("h",
3300 _rv);
3301 return _res;
3302}
3303
3304static PyObject *TrackObj_SetTrackVolume(_self, _args)
3305 TrackObject *_self;
3306 PyObject *_args;
3307{
3308 PyObject *_res = NULL;
3309 short volume;
3310 if (!PyArg_ParseTuple(_args, "h",
3311 &volume))
3312 return NULL;
3313 SetTrackVolume(_self->ob_itself,
3314 volume);
3315 Py_INCREF(Py_None);
3316 _res = Py_None;
3317 return _res;
3318}
3319
3320static PyObject *TrackObj_GetTrackDimensions(_self, _args)
3321 TrackObject *_self;
3322 PyObject *_args;
3323{
3324 PyObject *_res = NULL;
3325 Fixed width;
3326 Fixed height;
3327 if (!PyArg_ParseTuple(_args, ""))
3328 return NULL;
3329 GetTrackDimensions(_self->ob_itself,
3330 &width,
3331 &height);
3332 _res = Py_BuildValue("O&O&",
3333 PyMac_BuildFixed, width,
3334 PyMac_BuildFixed, height);
3335 return _res;
3336}
3337
3338static PyObject *TrackObj_SetTrackDimensions(_self, _args)
3339 TrackObject *_self;
3340 PyObject *_args;
3341{
3342 PyObject *_res = NULL;
3343 Fixed width;
3344 Fixed height;
3345 if (!PyArg_ParseTuple(_args, "O&O&",
3346 PyMac_GetFixed, &width,
3347 PyMac_GetFixed, &height))
3348 return NULL;
3349 SetTrackDimensions(_self->ob_itself,
3350 width,
3351 height);
3352 Py_INCREF(Py_None);
3353 _res = Py_None;
3354 return _res;
3355}
3356
3357static PyObject *TrackObj_GetTrackUserData(_self, _args)
3358 TrackObject *_self;
3359 PyObject *_args;
3360{
3361 PyObject *_res = NULL;
3362 UserData _rv;
3363 if (!PyArg_ParseTuple(_args, ""))
3364 return NULL;
3365 _rv = GetTrackUserData(_self->ob_itself);
3366 _res = Py_BuildValue("O&",
3367 UserDataObj_New, _rv);
3368 return _res;
3369}
3370
Jack Jansen1c4e6141998-04-21 15:23:55 +00003371static PyObject *TrackObj_GetTrackSoundLocalizationSettings(_self, _args)
3372 TrackObject *_self;
3373 PyObject *_args;
3374{
3375 PyObject *_res = NULL;
3376 OSErr _err;
3377 Handle settings;
3378 if (!PyArg_ParseTuple(_args, ""))
3379 return NULL;
3380 _err = GetTrackSoundLocalizationSettings(_self->ob_itself,
3381 &settings);
3382 if (_err != noErr) return PyMac_Error(_err);
3383 _res = Py_BuildValue("O&",
3384 ResObj_New, settings);
3385 return _res;
3386}
3387
3388static PyObject *TrackObj_SetTrackSoundLocalizationSettings(_self, _args)
3389 TrackObject *_self;
3390 PyObject *_args;
3391{
3392 PyObject *_res = NULL;
3393 OSErr _err;
3394 Handle settings;
3395 if (!PyArg_ParseTuple(_args, "O&",
3396 ResObj_Convert, &settings))
3397 return NULL;
3398 _err = SetTrackSoundLocalizationSettings(_self->ob_itself,
3399 settings);
3400 if (_err != noErr) return PyMac_Error(_err);
3401 Py_INCREF(Py_None);
3402 _res = Py_None;
3403 return _res;
3404}
3405
Jack Jansen453ced51995-11-30 17:42:08 +00003406static PyObject *TrackObj_NewTrackMedia(_self, _args)
3407 TrackObject *_self;
3408 PyObject *_args;
3409{
3410 PyObject *_res = NULL;
3411 Media _rv;
3412 OSType mediaType;
3413 TimeScale timeScale;
3414 Handle dataRef;
3415 OSType dataRefType;
3416 if (!PyArg_ParseTuple(_args, "O&lO&O&",
3417 PyMac_GetOSType, &mediaType,
3418 &timeScale,
3419 ResObj_Convert, &dataRef,
3420 PyMac_GetOSType, &dataRefType))
3421 return NULL;
3422 _rv = NewTrackMedia(_self->ob_itself,
3423 mediaType,
3424 timeScale,
3425 dataRef,
3426 dataRefType);
3427 _res = Py_BuildValue("O&",
3428 MediaObj_New, _rv);
3429 return _res;
3430}
3431
3432static PyObject *TrackObj_GetTrackMedia(_self, _args)
3433 TrackObject *_self;
3434 PyObject *_args;
3435{
3436 PyObject *_res = NULL;
3437 Media _rv;
3438 if (!PyArg_ParseTuple(_args, ""))
3439 return NULL;
3440 _rv = GetTrackMedia(_self->ob_itself);
3441 _res = Py_BuildValue("O&",
3442 MediaObj_New, _rv);
3443 return _res;
3444}
3445
3446static PyObject *TrackObj_InsertMediaIntoTrack(_self, _args)
3447 TrackObject *_self;
3448 PyObject *_args;
3449{
3450 PyObject *_res = NULL;
3451 OSErr _err;
3452 TimeValue trackStart;
3453 TimeValue mediaTime;
3454 TimeValue mediaDuration;
3455 Fixed mediaRate;
3456 if (!PyArg_ParseTuple(_args, "lllO&",
3457 &trackStart,
3458 &mediaTime,
3459 &mediaDuration,
3460 PyMac_GetFixed, &mediaRate))
3461 return NULL;
3462 _err = InsertMediaIntoTrack(_self->ob_itself,
3463 trackStart,
3464 mediaTime,
3465 mediaDuration,
3466 mediaRate);
3467 if (_err != noErr) return PyMac_Error(_err);
3468 Py_INCREF(Py_None);
3469 _res = Py_None;
3470 return _res;
3471}
3472
3473static PyObject *TrackObj_InsertTrackSegment(_self, _args)
3474 TrackObject *_self;
3475 PyObject *_args;
3476{
3477 PyObject *_res = NULL;
3478 OSErr _err;
3479 Track dstTrack;
3480 TimeValue srcIn;
3481 TimeValue srcDuration;
3482 TimeValue dstIn;
3483 if (!PyArg_ParseTuple(_args, "O&lll",
3484 TrackObj_Convert, &dstTrack,
3485 &srcIn,
3486 &srcDuration,
3487 &dstIn))
3488 return NULL;
3489 _err = InsertTrackSegment(_self->ob_itself,
3490 dstTrack,
3491 srcIn,
3492 srcDuration,
3493 dstIn);
3494 if (_err != noErr) return PyMac_Error(_err);
3495 Py_INCREF(Py_None);
3496 _res = Py_None;
3497 return _res;
3498}
3499
3500static PyObject *TrackObj_InsertEmptyTrackSegment(_self, _args)
3501 TrackObject *_self;
3502 PyObject *_args;
3503{
3504 PyObject *_res = NULL;
3505 OSErr _err;
3506 TimeValue dstIn;
3507 TimeValue dstDuration;
3508 if (!PyArg_ParseTuple(_args, "ll",
3509 &dstIn,
3510 &dstDuration))
3511 return NULL;
3512 _err = InsertEmptyTrackSegment(_self->ob_itself,
3513 dstIn,
3514 dstDuration);
3515 if (_err != noErr) return PyMac_Error(_err);
3516 Py_INCREF(Py_None);
3517 _res = Py_None;
3518 return _res;
3519}
3520
3521static PyObject *TrackObj_DeleteTrackSegment(_self, _args)
3522 TrackObject *_self;
3523 PyObject *_args;
3524{
3525 PyObject *_res = NULL;
3526 OSErr _err;
3527 TimeValue startTime;
3528 TimeValue duration;
3529 if (!PyArg_ParseTuple(_args, "ll",
3530 &startTime,
3531 &duration))
3532 return NULL;
3533 _err = DeleteTrackSegment(_self->ob_itself,
3534 startTime,
3535 duration);
3536 if (_err != noErr) return PyMac_Error(_err);
3537 Py_INCREF(Py_None);
3538 _res = Py_None;
3539 return _res;
3540}
3541
3542static PyObject *TrackObj_ScaleTrackSegment(_self, _args)
3543 TrackObject *_self;
3544 PyObject *_args;
3545{
3546 PyObject *_res = NULL;
3547 OSErr _err;
3548 TimeValue startTime;
3549 TimeValue oldDuration;
3550 TimeValue newDuration;
3551 if (!PyArg_ParseTuple(_args, "lll",
3552 &startTime,
3553 &oldDuration,
3554 &newDuration))
3555 return NULL;
3556 _err = ScaleTrackSegment(_self->ob_itself,
3557 startTime,
3558 oldDuration,
3559 newDuration);
3560 if (_err != noErr) return PyMac_Error(_err);
3561 Py_INCREF(Py_None);
3562 _res = Py_None;
3563 return _res;
3564}
3565
3566static PyObject *TrackObj_IsScrapMovie(_self, _args)
3567 TrackObject *_self;
3568 PyObject *_args;
3569{
3570 PyObject *_res = NULL;
3571 Component _rv;
3572 if (!PyArg_ParseTuple(_args, ""))
3573 return NULL;
3574 _rv = IsScrapMovie(_self->ob_itself);
3575 _res = Py_BuildValue("O&",
3576 CmpObj_New, _rv);
3577 return _res;
3578}
3579
3580static PyObject *TrackObj_CopyTrackSettings(_self, _args)
3581 TrackObject *_self;
3582 PyObject *_args;
3583{
3584 PyObject *_res = NULL;
3585 OSErr _err;
3586 Track dstTrack;
3587 if (!PyArg_ParseTuple(_args, "O&",
3588 TrackObj_Convert, &dstTrack))
3589 return NULL;
3590 _err = CopyTrackSettings(_self->ob_itself,
3591 dstTrack);
3592 if (_err != noErr) return PyMac_Error(_err);
3593 Py_INCREF(Py_None);
3594 _res = Py_None;
3595 return _res;
3596}
3597
3598static PyObject *TrackObj_AddEmptyTrackToMovie(_self, _args)
3599 TrackObject *_self;
3600 PyObject *_args;
3601{
3602 PyObject *_res = NULL;
3603 OSErr _err;
3604 Movie dstMovie;
3605 Handle dataRef;
3606 OSType dataRefType;
3607 Track dstTrack;
3608 if (!PyArg_ParseTuple(_args, "O&O&O&",
3609 MovieObj_Convert, &dstMovie,
3610 ResObj_Convert, &dataRef,
3611 PyMac_GetOSType, &dataRefType))
3612 return NULL;
3613 _err = AddEmptyTrackToMovie(_self->ob_itself,
3614 dstMovie,
3615 dataRef,
3616 dataRefType,
3617 &dstTrack);
3618 if (_err != noErr) return PyMac_Error(_err);
3619 _res = Py_BuildValue("O&",
3620 TrackObj_New, dstTrack);
3621 return _res;
3622}
3623
3624static PyObject *TrackObj_AddTrackReference(_self, _args)
3625 TrackObject *_self;
3626 PyObject *_args;
3627{
3628 PyObject *_res = NULL;
3629 OSErr _err;
3630 Track refTrack;
3631 OSType refType;
3632 long addedIndex;
3633 if (!PyArg_ParseTuple(_args, "O&O&",
3634 TrackObj_Convert, &refTrack,
3635 PyMac_GetOSType, &refType))
3636 return NULL;
3637 _err = AddTrackReference(_self->ob_itself,
3638 refTrack,
3639 refType,
3640 &addedIndex);
3641 if (_err != noErr) return PyMac_Error(_err);
3642 _res = Py_BuildValue("l",
3643 addedIndex);
3644 return _res;
3645}
3646
3647static PyObject *TrackObj_DeleteTrackReference(_self, _args)
3648 TrackObject *_self;
3649 PyObject *_args;
3650{
3651 PyObject *_res = NULL;
3652 OSErr _err;
3653 OSType refType;
3654 long index;
3655 if (!PyArg_ParseTuple(_args, "O&l",
3656 PyMac_GetOSType, &refType,
3657 &index))
3658 return NULL;
3659 _err = DeleteTrackReference(_self->ob_itself,
3660 refType,
3661 index);
3662 if (_err != noErr) return PyMac_Error(_err);
3663 Py_INCREF(Py_None);
3664 _res = Py_None;
3665 return _res;
3666}
3667
3668static PyObject *TrackObj_SetTrackReference(_self, _args)
3669 TrackObject *_self;
3670 PyObject *_args;
3671{
3672 PyObject *_res = NULL;
3673 OSErr _err;
3674 Track refTrack;
3675 OSType refType;
3676 long index;
3677 if (!PyArg_ParseTuple(_args, "O&O&l",
3678 TrackObj_Convert, &refTrack,
3679 PyMac_GetOSType, &refType,
3680 &index))
3681 return NULL;
3682 _err = SetTrackReference(_self->ob_itself,
3683 refTrack,
3684 refType,
3685 index);
3686 if (_err != noErr) return PyMac_Error(_err);
3687 Py_INCREF(Py_None);
3688 _res = Py_None;
3689 return _res;
3690}
3691
3692static PyObject *TrackObj_GetTrackReference(_self, _args)
3693 TrackObject *_self;
3694 PyObject *_args;
3695{
3696 PyObject *_res = NULL;
3697 Track _rv;
3698 OSType refType;
3699 long index;
3700 if (!PyArg_ParseTuple(_args, "O&l",
3701 PyMac_GetOSType, &refType,
3702 &index))
3703 return NULL;
3704 _rv = GetTrackReference(_self->ob_itself,
3705 refType,
3706 index);
3707 _res = Py_BuildValue("O&",
3708 TrackObj_New, _rv);
3709 return _res;
3710}
3711
3712static PyObject *TrackObj_GetNextTrackReferenceType(_self, _args)
3713 TrackObject *_self;
3714 PyObject *_args;
3715{
3716 PyObject *_res = NULL;
3717 OSType _rv;
3718 OSType refType;
3719 if (!PyArg_ParseTuple(_args, "O&",
3720 PyMac_GetOSType, &refType))
3721 return NULL;
3722 _rv = GetNextTrackReferenceType(_self->ob_itself,
3723 refType);
3724 _res = Py_BuildValue("O&",
3725 PyMac_BuildOSType, _rv);
3726 return _res;
3727}
3728
3729static PyObject *TrackObj_GetTrackReferenceCount(_self, _args)
3730 TrackObject *_self;
3731 PyObject *_args;
3732{
3733 PyObject *_res = NULL;
3734 long _rv;
3735 OSType refType;
3736 if (!PyArg_ParseTuple(_args, "O&",
3737 PyMac_GetOSType, &refType))
3738 return NULL;
3739 _rv = GetTrackReferenceCount(_self->ob_itself,
3740 refType);
3741 _res = Py_BuildValue("l",
3742 _rv);
3743 return _res;
3744}
3745
3746static PyObject *TrackObj_GetTrackEditRate(_self, _args)
3747 TrackObject *_self;
3748 PyObject *_args;
3749{
3750 PyObject *_res = NULL;
3751 Fixed _rv;
3752 TimeValue atTime;
3753 if (!PyArg_ParseTuple(_args, "l",
3754 &atTime))
3755 return NULL;
3756 _rv = GetTrackEditRate(_self->ob_itself,
3757 atTime);
3758 _res = Py_BuildValue("O&",
3759 PyMac_BuildFixed, _rv);
3760 return _res;
3761}
3762
3763static PyObject *TrackObj_GetTrackDataSize(_self, _args)
3764 TrackObject *_self;
3765 PyObject *_args;
3766{
3767 PyObject *_res = NULL;
3768 long _rv;
3769 TimeValue startTime;
3770 TimeValue duration;
3771 if (!PyArg_ParseTuple(_args, "ll",
3772 &startTime,
3773 &duration))
3774 return NULL;
3775 _rv = GetTrackDataSize(_self->ob_itself,
3776 startTime,
3777 duration);
3778 _res = Py_BuildValue("l",
3779 _rv);
3780 return _res;
3781}
3782
Jack Jansen723ad8a2000-12-12 22:10:21 +00003783static PyObject *TrackObj_GetTrackDataSize64(_self, _args)
3784 TrackObject *_self;
3785 PyObject *_args;
3786{
3787 PyObject *_res = NULL;
3788 OSErr _err;
3789 TimeValue startTime;
3790 TimeValue duration;
3791 wide dataSize;
3792 if (!PyArg_ParseTuple(_args, "ll",
3793 &startTime,
3794 &duration))
3795 return NULL;
3796 _err = GetTrackDataSize64(_self->ob_itself,
3797 startTime,
3798 duration,
3799 &dataSize);
3800 if (_err != noErr) return PyMac_Error(_err);
3801 _res = Py_BuildValue("O&",
3802 PyMac_Buildwide, dataSize);
3803 return _res;
3804}
3805
Jack Jansen453ced51995-11-30 17:42:08 +00003806static PyObject *TrackObj_PtInTrack(_self, _args)
3807 TrackObject *_self;
3808 PyObject *_args;
3809{
3810 PyObject *_res = NULL;
3811 Boolean _rv;
3812 Point pt;
3813 if (!PyArg_ParseTuple(_args, "O&",
3814 PyMac_GetPoint, &pt))
3815 return NULL;
3816 _rv = PtInTrack(_self->ob_itself,
3817 pt);
3818 _res = Py_BuildValue("b",
3819 _rv);
3820 return _res;
3821}
3822
3823static PyObject *TrackObj_GetTrackNextInterestingTime(_self, _args)
3824 TrackObject *_self;
3825 PyObject *_args;
3826{
3827 PyObject *_res = NULL;
3828 short interestingTimeFlags;
3829 TimeValue time;
3830 Fixed rate;
3831 TimeValue interestingTime;
3832 TimeValue interestingDuration;
3833 if (!PyArg_ParseTuple(_args, "hlO&",
3834 &interestingTimeFlags,
3835 &time,
3836 PyMac_GetFixed, &rate))
3837 return NULL;
3838 GetTrackNextInterestingTime(_self->ob_itself,
3839 interestingTimeFlags,
3840 time,
3841 rate,
3842 &interestingTime,
3843 &interestingDuration);
3844 _res = Py_BuildValue("ll",
3845 interestingTime,
3846 interestingDuration);
3847 return _res;
3848}
3849
3850static PyObject *TrackObj_GetTrackSegmentDisplayBoundsRgn(_self, _args)
3851 TrackObject *_self;
3852 PyObject *_args;
3853{
3854 PyObject *_res = NULL;
3855 RgnHandle _rv;
3856 TimeValue time;
3857 TimeValue duration;
3858 if (!PyArg_ParseTuple(_args, "ll",
3859 &time,
3860 &duration))
3861 return NULL;
3862 _rv = GetTrackSegmentDisplayBoundsRgn(_self->ob_itself,
3863 time,
3864 duration);
3865 _res = Py_BuildValue("O&",
3866 ResObj_New, _rv);
3867 return _res;
3868}
3869
3870static PyObject *TrackObj_GetTrackStatus(_self, _args)
3871 TrackObject *_self;
3872 PyObject *_args;
3873{
3874 PyObject *_res = NULL;
3875 ComponentResult _rv;
3876 if (!PyArg_ParseTuple(_args, ""))
3877 return NULL;
3878 _rv = GetTrackStatus(_self->ob_itself);
3879 _res = Py_BuildValue("l",
3880 _rv);
3881 return _res;
3882}
3883
3884static PyObject *TrackObj_SetTrackLoadSettings(_self, _args)
3885 TrackObject *_self;
3886 PyObject *_args;
3887{
3888 PyObject *_res = NULL;
3889 TimeValue preloadTime;
3890 TimeValue preloadDuration;
3891 long preloadFlags;
3892 long defaultHints;
3893 if (!PyArg_ParseTuple(_args, "llll",
3894 &preloadTime,
3895 &preloadDuration,
3896 &preloadFlags,
3897 &defaultHints))
3898 return NULL;
3899 SetTrackLoadSettings(_self->ob_itself,
3900 preloadTime,
3901 preloadDuration,
3902 preloadFlags,
3903 defaultHints);
3904 Py_INCREF(Py_None);
3905 _res = Py_None;
3906 return _res;
3907}
3908
3909static PyObject *TrackObj_GetTrackLoadSettings(_self, _args)
3910 TrackObject *_self;
3911 PyObject *_args;
3912{
3913 PyObject *_res = NULL;
3914 TimeValue preloadTime;
3915 TimeValue preloadDuration;
3916 long preloadFlags;
3917 long defaultHints;
3918 if (!PyArg_ParseTuple(_args, ""))
3919 return NULL;
3920 GetTrackLoadSettings(_self->ob_itself,
3921 &preloadTime,
3922 &preloadDuration,
3923 &preloadFlags,
3924 &defaultHints);
3925 _res = Py_BuildValue("llll",
3926 preloadTime,
3927 preloadDuration,
3928 preloadFlags,
3929 defaultHints);
3930 return _res;
3931}
3932
3933static PyMethodDef TrackObj_methods[] = {
3934 {"LoadTrackIntoRam", (PyCFunction)TrackObj_LoadTrackIntoRam, 1,
3935 "(TimeValue time, TimeValue duration, long flags) -> None"},
3936 {"GetTrackPict", (PyCFunction)TrackObj_GetTrackPict, 1,
3937 "(TimeValue time) -> (PicHandle _rv)"},
3938 {"GetTrackClipRgn", (PyCFunction)TrackObj_GetTrackClipRgn, 1,
3939 "() -> (RgnHandle _rv)"},
3940 {"SetTrackClipRgn", (PyCFunction)TrackObj_SetTrackClipRgn, 1,
3941 "(RgnHandle theClip) -> None"},
3942 {"GetTrackDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackDisplayBoundsRgn, 1,
3943 "() -> (RgnHandle _rv)"},
3944 {"GetTrackMovieBoundsRgn", (PyCFunction)TrackObj_GetTrackMovieBoundsRgn, 1,
3945 "() -> (RgnHandle _rv)"},
3946 {"GetTrackBoundsRgn", (PyCFunction)TrackObj_GetTrackBoundsRgn, 1,
3947 "() -> (RgnHandle _rv)"},
3948 {"GetTrackMatte", (PyCFunction)TrackObj_GetTrackMatte, 1,
3949 "() -> (PixMapHandle _rv)"},
3950 {"SetTrackMatte", (PyCFunction)TrackObj_SetTrackMatte, 1,
3951 "(PixMapHandle theMatte) -> None"},
3952 {"GetTrackID", (PyCFunction)TrackObj_GetTrackID, 1,
3953 "() -> (long _rv)"},
3954 {"GetTrackMovie", (PyCFunction)TrackObj_GetTrackMovie, 1,
3955 "() -> (Movie _rv)"},
Jack Jansene0cf87b1997-04-09 15:53:46 +00003956 {"GetTrackCreationTime", (PyCFunction)TrackObj_GetTrackCreationTime, 1,
3957 "() -> (unsigned long _rv)"},
3958 {"GetTrackModificationTime", (PyCFunction)TrackObj_GetTrackModificationTime, 1,
3959 "() -> (unsigned long _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00003960 {"GetTrackEnabled", (PyCFunction)TrackObj_GetTrackEnabled, 1,
3961 "() -> (Boolean _rv)"},
3962 {"SetTrackEnabled", (PyCFunction)TrackObj_SetTrackEnabled, 1,
3963 "(Boolean isEnabled) -> None"},
3964 {"GetTrackUsage", (PyCFunction)TrackObj_GetTrackUsage, 1,
3965 "() -> (long _rv)"},
3966 {"SetTrackUsage", (PyCFunction)TrackObj_SetTrackUsage, 1,
3967 "(long usage) -> None"},
3968 {"GetTrackDuration", (PyCFunction)TrackObj_GetTrackDuration, 1,
3969 "() -> (TimeValue _rv)"},
3970 {"GetTrackOffset", (PyCFunction)TrackObj_GetTrackOffset, 1,
3971 "() -> (TimeValue _rv)"},
3972 {"SetTrackOffset", (PyCFunction)TrackObj_SetTrackOffset, 1,
3973 "(TimeValue movieOffsetTime) -> None"},
3974 {"GetTrackLayer", (PyCFunction)TrackObj_GetTrackLayer, 1,
3975 "() -> (short _rv)"},
3976 {"SetTrackLayer", (PyCFunction)TrackObj_SetTrackLayer, 1,
3977 "(short layer) -> None"},
3978 {"GetTrackAlternate", (PyCFunction)TrackObj_GetTrackAlternate, 1,
3979 "() -> (Track _rv)"},
3980 {"SetTrackAlternate", (PyCFunction)TrackObj_SetTrackAlternate, 1,
3981 "(Track alternateT) -> None"},
3982 {"GetTrackVolume", (PyCFunction)TrackObj_GetTrackVolume, 1,
3983 "() -> (short _rv)"},
3984 {"SetTrackVolume", (PyCFunction)TrackObj_SetTrackVolume, 1,
3985 "(short volume) -> None"},
3986 {"GetTrackDimensions", (PyCFunction)TrackObj_GetTrackDimensions, 1,
3987 "() -> (Fixed width, Fixed height)"},
3988 {"SetTrackDimensions", (PyCFunction)TrackObj_SetTrackDimensions, 1,
3989 "(Fixed width, Fixed height) -> None"},
3990 {"GetTrackUserData", (PyCFunction)TrackObj_GetTrackUserData, 1,
3991 "() -> (UserData _rv)"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00003992 {"GetTrackSoundLocalizationSettings", (PyCFunction)TrackObj_GetTrackSoundLocalizationSettings, 1,
3993 "() -> (Handle settings)"},
3994 {"SetTrackSoundLocalizationSettings", (PyCFunction)TrackObj_SetTrackSoundLocalizationSettings, 1,
3995 "(Handle settings) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00003996 {"NewTrackMedia", (PyCFunction)TrackObj_NewTrackMedia, 1,
3997 "(OSType mediaType, TimeScale timeScale, Handle dataRef, OSType dataRefType) -> (Media _rv)"},
3998 {"GetTrackMedia", (PyCFunction)TrackObj_GetTrackMedia, 1,
3999 "() -> (Media _rv)"},
4000 {"InsertMediaIntoTrack", (PyCFunction)TrackObj_InsertMediaIntoTrack, 1,
4001 "(TimeValue trackStart, TimeValue mediaTime, TimeValue mediaDuration, Fixed mediaRate) -> None"},
4002 {"InsertTrackSegment", (PyCFunction)TrackObj_InsertTrackSegment, 1,
4003 "(Track dstTrack, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
4004 {"InsertEmptyTrackSegment", (PyCFunction)TrackObj_InsertEmptyTrackSegment, 1,
4005 "(TimeValue dstIn, TimeValue dstDuration) -> None"},
4006 {"DeleteTrackSegment", (PyCFunction)TrackObj_DeleteTrackSegment, 1,
4007 "(TimeValue startTime, TimeValue duration) -> None"},
4008 {"ScaleTrackSegment", (PyCFunction)TrackObj_ScaleTrackSegment, 1,
4009 "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
4010 {"IsScrapMovie", (PyCFunction)TrackObj_IsScrapMovie, 1,
4011 "() -> (Component _rv)"},
4012 {"CopyTrackSettings", (PyCFunction)TrackObj_CopyTrackSettings, 1,
4013 "(Track dstTrack) -> None"},
4014 {"AddEmptyTrackToMovie", (PyCFunction)TrackObj_AddEmptyTrackToMovie, 1,
4015 "(Movie dstMovie, Handle dataRef, OSType dataRefType) -> (Track dstTrack)"},
4016 {"AddTrackReference", (PyCFunction)TrackObj_AddTrackReference, 1,
4017 "(Track refTrack, OSType refType) -> (long addedIndex)"},
4018 {"DeleteTrackReference", (PyCFunction)TrackObj_DeleteTrackReference, 1,
4019 "(OSType refType, long index) -> None"},
4020 {"SetTrackReference", (PyCFunction)TrackObj_SetTrackReference, 1,
4021 "(Track refTrack, OSType refType, long index) -> None"},
4022 {"GetTrackReference", (PyCFunction)TrackObj_GetTrackReference, 1,
4023 "(OSType refType, long index) -> (Track _rv)"},
4024 {"GetNextTrackReferenceType", (PyCFunction)TrackObj_GetNextTrackReferenceType, 1,
4025 "(OSType refType) -> (OSType _rv)"},
4026 {"GetTrackReferenceCount", (PyCFunction)TrackObj_GetTrackReferenceCount, 1,
4027 "(OSType refType) -> (long _rv)"},
4028 {"GetTrackEditRate", (PyCFunction)TrackObj_GetTrackEditRate, 1,
4029 "(TimeValue atTime) -> (Fixed _rv)"},
4030 {"GetTrackDataSize", (PyCFunction)TrackObj_GetTrackDataSize, 1,
4031 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
Jack Jansen723ad8a2000-12-12 22:10:21 +00004032 {"GetTrackDataSize64", (PyCFunction)TrackObj_GetTrackDataSize64, 1,
4033 "(TimeValue startTime, TimeValue duration) -> (wide dataSize)"},
Jack Jansen453ced51995-11-30 17:42:08 +00004034 {"PtInTrack", (PyCFunction)TrackObj_PtInTrack, 1,
4035 "(Point pt) -> (Boolean _rv)"},
4036 {"GetTrackNextInterestingTime", (PyCFunction)TrackObj_GetTrackNextInterestingTime, 1,
4037 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
4038 {"GetTrackSegmentDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackSegmentDisplayBoundsRgn, 1,
4039 "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
4040 {"GetTrackStatus", (PyCFunction)TrackObj_GetTrackStatus, 1,
4041 "() -> (ComponentResult _rv)"},
4042 {"SetTrackLoadSettings", (PyCFunction)TrackObj_SetTrackLoadSettings, 1,
4043 "(TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints) -> None"},
4044 {"GetTrackLoadSettings", (PyCFunction)TrackObj_GetTrackLoadSettings, 1,
4045 "() -> (TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints)"},
4046 {NULL, NULL, 0}
4047};
4048
4049PyMethodChain TrackObj_chain = { TrackObj_methods, NULL };
4050
4051static PyObject *TrackObj_getattr(self, name)
4052 TrackObject *self;
4053 char *name;
4054{
4055 return Py_FindMethodInChain(&TrackObj_chain, (PyObject *)self, name);
4056}
4057
4058#define TrackObj_setattr NULL
4059
Jack Jansena05ac601999-12-12 21:41:51 +00004060#define TrackObj_compare NULL
4061
4062#define TrackObj_repr NULL
4063
4064#define TrackObj_hash NULL
4065
Jack Jansen453ced51995-11-30 17:42:08 +00004066PyTypeObject Track_Type = {
4067 PyObject_HEAD_INIT(&PyType_Type)
4068 0, /*ob_size*/
4069 "Track", /*tp_name*/
4070 sizeof(TrackObject), /*tp_basicsize*/
4071 0, /*tp_itemsize*/
4072 /* methods */
4073 (destructor) TrackObj_dealloc, /*tp_dealloc*/
4074 0, /*tp_print*/
4075 (getattrfunc) TrackObj_getattr, /*tp_getattr*/
4076 (setattrfunc) TrackObj_setattr, /*tp_setattr*/
Jack Jansena05ac601999-12-12 21:41:51 +00004077 (cmpfunc) TrackObj_compare, /*tp_compare*/
4078 (reprfunc) TrackObj_repr, /*tp_repr*/
4079 (PyNumberMethods *)0, /* tp_as_number */
4080 (PySequenceMethods *)0, /* tp_as_sequence */
4081 (PyMappingMethods *)0, /* tp_as_mapping */
4082 (hashfunc) TrackObj_hash, /*tp_hash*/
Jack Jansen453ced51995-11-30 17:42:08 +00004083};
4084
4085/* --------------------- End object type Track ---------------------- */
4086
4087
4088/* ----------------------- Object type Movie ------------------------ */
4089
4090PyTypeObject Movie_Type;
4091
4092#define MovieObj_Check(x) ((x)->ob_type == &Movie_Type)
4093
4094typedef struct MovieObject {
4095 PyObject_HEAD
4096 Movie ob_itself;
4097} MovieObject;
4098
4099PyObject *MovieObj_New(itself)
4100 Movie itself;
4101{
4102 MovieObject *it;
4103 if (itself == NULL) {
4104 PyErr_SetString(Qt_Error,"Cannot create null Movie");
4105 return NULL;
4106 }
4107 it = PyObject_NEW(MovieObject, &Movie_Type);
4108 if (it == NULL) return NULL;
4109 it->ob_itself = itself;
4110 return (PyObject *)it;
4111}
4112MovieObj_Convert(v, p_itself)
4113 PyObject *v;
4114 Movie *p_itself;
4115{
4116 if (!MovieObj_Check(v))
4117 {
4118 PyErr_SetString(PyExc_TypeError, "Movie required");
4119 return 0;
4120 }
4121 *p_itself = ((MovieObject *)v)->ob_itself;
4122 return 1;
4123}
4124
4125static void MovieObj_dealloc(self)
4126 MovieObject *self;
4127{
4128 DisposeMovie(self->ob_itself);
4129 PyMem_DEL(self);
4130}
4131
4132static PyObject *MovieObj_MoviesTask(_self, _args)
4133 MovieObject *_self;
4134 PyObject *_args;
4135{
4136 PyObject *_res = NULL;
4137 long maxMilliSecToUse;
4138 if (!PyArg_ParseTuple(_args, "l",
4139 &maxMilliSecToUse))
4140 return NULL;
4141 MoviesTask(_self->ob_itself,
4142 maxMilliSecToUse);
4143 Py_INCREF(Py_None);
4144 _res = Py_None;
4145 return _res;
4146}
4147
4148static PyObject *MovieObj_PrerollMovie(_self, _args)
4149 MovieObject *_self;
4150 PyObject *_args;
4151{
4152 PyObject *_res = NULL;
4153 OSErr _err;
4154 TimeValue time;
4155 Fixed Rate;
4156 if (!PyArg_ParseTuple(_args, "lO&",
4157 &time,
4158 PyMac_GetFixed, &Rate))
4159 return NULL;
4160 _err = PrerollMovie(_self->ob_itself,
4161 time,
4162 Rate);
4163 if (_err != noErr) return PyMac_Error(_err);
4164 Py_INCREF(Py_None);
4165 _res = Py_None;
4166 return _res;
4167}
4168
Jack Jansen723ad8a2000-12-12 22:10:21 +00004169static PyObject *MovieObj_AbortPrePrerollMovie(_self, _args)
4170 MovieObject *_self;
4171 PyObject *_args;
4172{
4173 PyObject *_res = NULL;
4174 OSErr err;
4175 if (!PyArg_ParseTuple(_args, "h",
4176 &err))
4177 return NULL;
4178 AbortPrePrerollMovie(_self->ob_itself,
4179 err);
4180 Py_INCREF(Py_None);
4181 _res = Py_None;
4182 return _res;
4183}
4184
Jack Jansen453ced51995-11-30 17:42:08 +00004185static PyObject *MovieObj_LoadMovieIntoRam(_self, _args)
4186 MovieObject *_self;
4187 PyObject *_args;
4188{
4189 PyObject *_res = NULL;
4190 OSErr _err;
4191 TimeValue time;
4192 TimeValue duration;
4193 long flags;
4194 if (!PyArg_ParseTuple(_args, "lll",
4195 &time,
4196 &duration,
4197 &flags))
4198 return NULL;
4199 _err = LoadMovieIntoRam(_self->ob_itself,
4200 time,
4201 duration,
4202 flags);
4203 if (_err != noErr) return PyMac_Error(_err);
4204 Py_INCREF(Py_None);
4205 _res = Py_None;
4206 return _res;
4207}
4208
4209static PyObject *MovieObj_SetMovieActive(_self, _args)
4210 MovieObject *_self;
4211 PyObject *_args;
4212{
4213 PyObject *_res = NULL;
4214 Boolean active;
4215 if (!PyArg_ParseTuple(_args, "b",
4216 &active))
4217 return NULL;
4218 SetMovieActive(_self->ob_itself,
4219 active);
4220 Py_INCREF(Py_None);
4221 _res = Py_None;
4222 return _res;
4223}
4224
4225static PyObject *MovieObj_GetMovieActive(_self, _args)
4226 MovieObject *_self;
4227 PyObject *_args;
4228{
4229 PyObject *_res = NULL;
4230 Boolean _rv;
4231 if (!PyArg_ParseTuple(_args, ""))
4232 return NULL;
4233 _rv = GetMovieActive(_self->ob_itself);
4234 _res = Py_BuildValue("b",
4235 _rv);
4236 return _res;
4237}
4238
4239static PyObject *MovieObj_StartMovie(_self, _args)
4240 MovieObject *_self;
4241 PyObject *_args;
4242{
4243 PyObject *_res = NULL;
4244 if (!PyArg_ParseTuple(_args, ""))
4245 return NULL;
4246 StartMovie(_self->ob_itself);
4247 Py_INCREF(Py_None);
4248 _res = Py_None;
4249 return _res;
4250}
4251
4252static PyObject *MovieObj_StopMovie(_self, _args)
4253 MovieObject *_self;
4254 PyObject *_args;
4255{
4256 PyObject *_res = NULL;
4257 if (!PyArg_ParseTuple(_args, ""))
4258 return NULL;
4259 StopMovie(_self->ob_itself);
4260 Py_INCREF(Py_None);
4261 _res = Py_None;
4262 return _res;
4263}
4264
4265static PyObject *MovieObj_GoToBeginningOfMovie(_self, _args)
4266 MovieObject *_self;
4267 PyObject *_args;
4268{
4269 PyObject *_res = NULL;
4270 if (!PyArg_ParseTuple(_args, ""))
4271 return NULL;
4272 GoToBeginningOfMovie(_self->ob_itself);
4273 Py_INCREF(Py_None);
4274 _res = Py_None;
4275 return _res;
4276}
4277
4278static PyObject *MovieObj_GoToEndOfMovie(_self, _args)
4279 MovieObject *_self;
4280 PyObject *_args;
4281{
4282 PyObject *_res = NULL;
4283 if (!PyArg_ParseTuple(_args, ""))
4284 return NULL;
4285 GoToEndOfMovie(_self->ob_itself);
4286 Py_INCREF(Py_None);
4287 _res = Py_None;
4288 return _res;
4289}
4290
4291static PyObject *MovieObj_IsMovieDone(_self, _args)
4292 MovieObject *_self;
4293 PyObject *_args;
4294{
4295 PyObject *_res = NULL;
4296 Boolean _rv;
4297 if (!PyArg_ParseTuple(_args, ""))
4298 return NULL;
4299 _rv = IsMovieDone(_self->ob_itself);
4300 _res = Py_BuildValue("b",
4301 _rv);
4302 return _res;
4303}
4304
4305static PyObject *MovieObj_GetMoviePreviewMode(_self, _args)
4306 MovieObject *_self;
4307 PyObject *_args;
4308{
4309 PyObject *_res = NULL;
4310 Boolean _rv;
4311 if (!PyArg_ParseTuple(_args, ""))
4312 return NULL;
4313 _rv = GetMoviePreviewMode(_self->ob_itself);
4314 _res = Py_BuildValue("b",
4315 _rv);
4316 return _res;
4317}
4318
4319static PyObject *MovieObj_SetMoviePreviewMode(_self, _args)
4320 MovieObject *_self;
4321 PyObject *_args;
4322{
4323 PyObject *_res = NULL;
4324 Boolean usePreview;
4325 if (!PyArg_ParseTuple(_args, "b",
4326 &usePreview))
4327 return NULL;
4328 SetMoviePreviewMode(_self->ob_itself,
4329 usePreview);
4330 Py_INCREF(Py_None);
4331 _res = Py_None;
4332 return _res;
4333}
4334
4335static PyObject *MovieObj_ShowMoviePoster(_self, _args)
4336 MovieObject *_self;
4337 PyObject *_args;
4338{
4339 PyObject *_res = NULL;
4340 if (!PyArg_ParseTuple(_args, ""))
4341 return NULL;
4342 ShowMoviePoster(_self->ob_itself);
4343 Py_INCREF(Py_None);
4344 _res = Py_None;
4345 return _res;
4346}
4347
4348static PyObject *MovieObj_GetMovieTimeBase(_self, _args)
4349 MovieObject *_self;
4350 PyObject *_args;
4351{
4352 PyObject *_res = NULL;
4353 TimeBase _rv;
4354 if (!PyArg_ParseTuple(_args, ""))
4355 return NULL;
4356 _rv = GetMovieTimeBase(_self->ob_itself);
4357 _res = Py_BuildValue("O&",
4358 TimeBaseObj_New, _rv);
4359 return _res;
4360}
4361
Jack Jansenb2006391998-04-23 13:22:44 +00004362static PyObject *MovieObj_SetMovieMasterTimeBase(_self, _args)
4363 MovieObject *_self;
4364 PyObject *_args;
4365{
4366 PyObject *_res = NULL;
4367 TimeBase tb;
4368 TimeRecord slaveZero;
4369 if (!PyArg_ParseTuple(_args, "O&O&",
4370 TimeBaseObj_Convert, &tb,
4371 QtTimeRecord_Convert, &slaveZero))
4372 return NULL;
4373 SetMovieMasterTimeBase(_self->ob_itself,
4374 tb,
4375 &slaveZero);
4376 Py_INCREF(Py_None);
4377 _res = Py_None;
4378 return _res;
4379}
4380
4381static PyObject *MovieObj_SetMovieMasterClock(_self, _args)
4382 MovieObject *_self;
4383 PyObject *_args;
4384{
4385 PyObject *_res = NULL;
4386 Component clockMeister;
4387 TimeRecord slaveZero;
4388 if (!PyArg_ParseTuple(_args, "O&O&",
4389 CmpObj_Convert, &clockMeister,
4390 QtTimeRecord_Convert, &slaveZero))
4391 return NULL;
4392 SetMovieMasterClock(_self->ob_itself,
4393 clockMeister,
4394 &slaveZero);
4395 Py_INCREF(Py_None);
4396 _res = Py_None;
4397 return _res;
4398}
4399
Jack Jansene0cf87b1997-04-09 15:53:46 +00004400static PyObject *MovieObj_GetMovieGWorld(_self, _args)
4401 MovieObject *_self;
4402 PyObject *_args;
4403{
4404 PyObject *_res = NULL;
4405 CGrafPtr port;
4406 GDHandle gdh;
4407 if (!PyArg_ParseTuple(_args, ""))
4408 return NULL;
4409 GetMovieGWorld(_self->ob_itself,
4410 &port,
4411 &gdh);
4412 _res = Py_BuildValue("O&O&",
4413 GrafObj_New, port,
Jack Jansend81fc3c1998-07-22 13:37:37 +00004414 OptResObj_New, gdh);
Jack Jansene0cf87b1997-04-09 15:53:46 +00004415 return _res;
4416}
4417
4418static PyObject *MovieObj_SetMovieGWorld(_self, _args)
4419 MovieObject *_self;
4420 PyObject *_args;
4421{
4422 PyObject *_res = NULL;
4423 CGrafPtr port;
4424 GDHandle gdh;
4425 if (!PyArg_ParseTuple(_args, "O&O&",
4426 GrafObj_Convert, &port,
Jack Jansend81fc3c1998-07-22 13:37:37 +00004427 OptResObj_Convert, &gdh))
Jack Jansene0cf87b1997-04-09 15:53:46 +00004428 return NULL;
4429 SetMovieGWorld(_self->ob_itself,
4430 port,
4431 gdh);
4432 Py_INCREF(Py_None);
4433 _res = Py_None;
4434 return _res;
4435}
4436
Jack Jansen1c4e6141998-04-21 15:23:55 +00004437static PyObject *MovieObj_GetMovieNaturalBoundsRect(_self, _args)
4438 MovieObject *_self;
4439 PyObject *_args;
4440{
4441 PyObject *_res = NULL;
4442 Rect naturalBounds;
4443 if (!PyArg_ParseTuple(_args, ""))
4444 return NULL;
4445 GetMovieNaturalBoundsRect(_self->ob_itself,
4446 &naturalBounds);
4447 _res = Py_BuildValue("O&",
4448 PyMac_BuildRect, &naturalBounds);
4449 return _res;
4450}
4451
Jack Jansen453ced51995-11-30 17:42:08 +00004452static PyObject *MovieObj_GetNextTrackForCompositing(_self, _args)
4453 MovieObject *_self;
4454 PyObject *_args;
4455{
4456 PyObject *_res = NULL;
4457 Track _rv;
4458 Track theTrack;
4459 if (!PyArg_ParseTuple(_args, "O&",
4460 TrackObj_Convert, &theTrack))
4461 return NULL;
4462 _rv = GetNextTrackForCompositing(_self->ob_itself,
4463 theTrack);
4464 _res = Py_BuildValue("O&",
4465 TrackObj_New, _rv);
4466 return _res;
4467}
4468
4469static PyObject *MovieObj_GetPrevTrackForCompositing(_self, _args)
4470 MovieObject *_self;
4471 PyObject *_args;
4472{
4473 PyObject *_res = NULL;
4474 Track _rv;
4475 Track theTrack;
4476 if (!PyArg_ParseTuple(_args, "O&",
4477 TrackObj_Convert, &theTrack))
4478 return NULL;
4479 _rv = GetPrevTrackForCompositing(_self->ob_itself,
4480 theTrack);
4481 _res = Py_BuildValue("O&",
4482 TrackObj_New, _rv);
4483 return _res;
4484}
4485
4486static PyObject *MovieObj_GetMoviePict(_self, _args)
4487 MovieObject *_self;
4488 PyObject *_args;
4489{
4490 PyObject *_res = NULL;
4491 PicHandle _rv;
4492 TimeValue time;
4493 if (!PyArg_ParseTuple(_args, "l",
4494 &time))
4495 return NULL;
4496 _rv = GetMoviePict(_self->ob_itself,
4497 time);
4498 _res = Py_BuildValue("O&",
4499 ResObj_New, _rv);
4500 return _res;
4501}
4502
4503static PyObject *MovieObj_GetMoviePosterPict(_self, _args)
4504 MovieObject *_self;
4505 PyObject *_args;
4506{
4507 PyObject *_res = NULL;
4508 PicHandle _rv;
4509 if (!PyArg_ParseTuple(_args, ""))
4510 return NULL;
4511 _rv = GetMoviePosterPict(_self->ob_itself);
4512 _res = Py_BuildValue("O&",
4513 ResObj_New, _rv);
4514 return _res;
4515}
4516
4517static PyObject *MovieObj_UpdateMovie(_self, _args)
4518 MovieObject *_self;
4519 PyObject *_args;
4520{
4521 PyObject *_res = NULL;
4522 OSErr _err;
4523 if (!PyArg_ParseTuple(_args, ""))
4524 return NULL;
4525 _err = UpdateMovie(_self->ob_itself);
4526 if (_err != noErr) return PyMac_Error(_err);
4527 Py_INCREF(Py_None);
4528 _res = Py_None;
4529 return _res;
4530}
4531
Jack Jansen1c4e6141998-04-21 15:23:55 +00004532static PyObject *MovieObj_InvalidateMovieRegion(_self, _args)
4533 MovieObject *_self;
4534 PyObject *_args;
4535{
4536 PyObject *_res = NULL;
4537 OSErr _err;
4538 RgnHandle invalidRgn;
4539 if (!PyArg_ParseTuple(_args, "O&",
4540 ResObj_Convert, &invalidRgn))
4541 return NULL;
4542 _err = InvalidateMovieRegion(_self->ob_itself,
4543 invalidRgn);
4544 if (_err != noErr) return PyMac_Error(_err);
4545 Py_INCREF(Py_None);
4546 _res = Py_None;
4547 return _res;
4548}
4549
Jack Jansen453ced51995-11-30 17:42:08 +00004550static PyObject *MovieObj_GetMovieBox(_self, _args)
4551 MovieObject *_self;
4552 PyObject *_args;
4553{
4554 PyObject *_res = NULL;
4555 Rect boxRect;
4556 if (!PyArg_ParseTuple(_args, ""))
4557 return NULL;
4558 GetMovieBox(_self->ob_itself,
4559 &boxRect);
4560 _res = Py_BuildValue("O&",
4561 PyMac_BuildRect, &boxRect);
4562 return _res;
4563}
4564
4565static PyObject *MovieObj_SetMovieBox(_self, _args)
4566 MovieObject *_self;
4567 PyObject *_args;
4568{
4569 PyObject *_res = NULL;
4570 Rect boxRect;
4571 if (!PyArg_ParseTuple(_args, "O&",
4572 PyMac_GetRect, &boxRect))
4573 return NULL;
4574 SetMovieBox(_self->ob_itself,
4575 &boxRect);
4576 Py_INCREF(Py_None);
4577 _res = Py_None;
4578 return _res;
4579}
4580
4581static PyObject *MovieObj_GetMovieDisplayClipRgn(_self, _args)
4582 MovieObject *_self;
4583 PyObject *_args;
4584{
4585 PyObject *_res = NULL;
4586 RgnHandle _rv;
4587 if (!PyArg_ParseTuple(_args, ""))
4588 return NULL;
4589 _rv = GetMovieDisplayClipRgn(_self->ob_itself);
4590 _res = Py_BuildValue("O&",
4591 ResObj_New, _rv);
4592 return _res;
4593}
4594
4595static PyObject *MovieObj_SetMovieDisplayClipRgn(_self, _args)
4596 MovieObject *_self;
4597 PyObject *_args;
4598{
4599 PyObject *_res = NULL;
4600 RgnHandle theClip;
4601 if (!PyArg_ParseTuple(_args, "O&",
4602 ResObj_Convert, &theClip))
4603 return NULL;
4604 SetMovieDisplayClipRgn(_self->ob_itself,
4605 theClip);
4606 Py_INCREF(Py_None);
4607 _res = Py_None;
4608 return _res;
4609}
4610
4611static PyObject *MovieObj_GetMovieClipRgn(_self, _args)
4612 MovieObject *_self;
4613 PyObject *_args;
4614{
4615 PyObject *_res = NULL;
4616 RgnHandle _rv;
4617 if (!PyArg_ParseTuple(_args, ""))
4618 return NULL;
4619 _rv = GetMovieClipRgn(_self->ob_itself);
4620 _res = Py_BuildValue("O&",
4621 ResObj_New, _rv);
4622 return _res;
4623}
4624
4625static PyObject *MovieObj_SetMovieClipRgn(_self, _args)
4626 MovieObject *_self;
4627 PyObject *_args;
4628{
4629 PyObject *_res = NULL;
4630 RgnHandle theClip;
4631 if (!PyArg_ParseTuple(_args, "O&",
4632 ResObj_Convert, &theClip))
4633 return NULL;
4634 SetMovieClipRgn(_self->ob_itself,
4635 theClip);
4636 Py_INCREF(Py_None);
4637 _res = Py_None;
4638 return _res;
4639}
4640
4641static PyObject *MovieObj_GetMovieDisplayBoundsRgn(_self, _args)
4642 MovieObject *_self;
4643 PyObject *_args;
4644{
4645 PyObject *_res = NULL;
4646 RgnHandle _rv;
4647 if (!PyArg_ParseTuple(_args, ""))
4648 return NULL;
4649 _rv = GetMovieDisplayBoundsRgn(_self->ob_itself);
4650 _res = Py_BuildValue("O&",
4651 ResObj_New, _rv);
4652 return _res;
4653}
4654
4655static PyObject *MovieObj_GetMovieBoundsRgn(_self, _args)
4656 MovieObject *_self;
4657 PyObject *_args;
4658{
4659 PyObject *_res = NULL;
4660 RgnHandle _rv;
4661 if (!PyArg_ParseTuple(_args, ""))
4662 return NULL;
4663 _rv = GetMovieBoundsRgn(_self->ob_itself);
4664 _res = Py_BuildValue("O&",
4665 ResObj_New, _rv);
4666 return _res;
4667}
4668
4669static PyObject *MovieObj_PutMovieIntoHandle(_self, _args)
4670 MovieObject *_self;
4671 PyObject *_args;
4672{
4673 PyObject *_res = NULL;
4674 OSErr _err;
4675 Handle publicMovie;
4676 if (!PyArg_ParseTuple(_args, "O&",
4677 ResObj_Convert, &publicMovie))
4678 return NULL;
4679 _err = PutMovieIntoHandle(_self->ob_itself,
4680 publicMovie);
4681 if (_err != noErr) return PyMac_Error(_err);
4682 Py_INCREF(Py_None);
4683 _res = Py_None;
4684 return _res;
4685}
4686
4687static PyObject *MovieObj_PutMovieIntoDataFork(_self, _args)
4688 MovieObject *_self;
4689 PyObject *_args;
4690{
4691 PyObject *_res = NULL;
4692 OSErr _err;
4693 short fRefNum;
4694 long offset;
4695 long maxSize;
4696 if (!PyArg_ParseTuple(_args, "hll",
4697 &fRefNum,
4698 &offset,
4699 &maxSize))
4700 return NULL;
4701 _err = PutMovieIntoDataFork(_self->ob_itself,
4702 fRefNum,
4703 offset,
4704 maxSize);
4705 if (_err != noErr) return PyMac_Error(_err);
4706 Py_INCREF(Py_None);
4707 _res = Py_None;
4708 return _res;
4709}
4710
Jack Jansen723ad8a2000-12-12 22:10:21 +00004711static PyObject *MovieObj_PutMovieIntoDataFork64(_self, _args)
4712 MovieObject *_self;
4713 PyObject *_args;
4714{
4715 PyObject *_res = NULL;
4716 OSErr _err;
4717 long fRefNum;
4718 wide offset;
4719 unsigned long maxSize;
4720 if (!PyArg_ParseTuple(_args, "lO&l",
4721 &fRefNum,
4722 PyMac_Getwide, &offset,
4723 &maxSize))
4724 return NULL;
4725 _err = PutMovieIntoDataFork64(_self->ob_itself,
4726 fRefNum,
4727 &offset,
4728 maxSize);
4729 if (_err != noErr) return PyMac_Error(_err);
4730 Py_INCREF(Py_None);
4731 _res = Py_None;
4732 return _res;
4733}
4734
Jack Jansene0cf87b1997-04-09 15:53:46 +00004735static PyObject *MovieObj_GetMovieCreationTime(_self, _args)
4736 MovieObject *_self;
4737 PyObject *_args;
4738{
4739 PyObject *_res = NULL;
4740 unsigned long _rv;
4741 if (!PyArg_ParseTuple(_args, ""))
4742 return NULL;
4743 _rv = GetMovieCreationTime(_self->ob_itself);
4744 _res = Py_BuildValue("l",
4745 _rv);
4746 return _res;
4747}
4748
4749static PyObject *MovieObj_GetMovieModificationTime(_self, _args)
4750 MovieObject *_self;
4751 PyObject *_args;
4752{
4753 PyObject *_res = NULL;
4754 unsigned long _rv;
4755 if (!PyArg_ParseTuple(_args, ""))
4756 return NULL;
4757 _rv = GetMovieModificationTime(_self->ob_itself);
4758 _res = Py_BuildValue("l",
4759 _rv);
4760 return _res;
4761}
4762
Jack Jansen453ced51995-11-30 17:42:08 +00004763static PyObject *MovieObj_GetMovieTimeScale(_self, _args)
4764 MovieObject *_self;
4765 PyObject *_args;
4766{
4767 PyObject *_res = NULL;
4768 TimeScale _rv;
4769 if (!PyArg_ParseTuple(_args, ""))
4770 return NULL;
4771 _rv = GetMovieTimeScale(_self->ob_itself);
4772 _res = Py_BuildValue("l",
4773 _rv);
4774 return _res;
4775}
4776
4777static PyObject *MovieObj_SetMovieTimeScale(_self, _args)
4778 MovieObject *_self;
4779 PyObject *_args;
4780{
4781 PyObject *_res = NULL;
4782 TimeScale timeScale;
4783 if (!PyArg_ParseTuple(_args, "l",
4784 &timeScale))
4785 return NULL;
4786 SetMovieTimeScale(_self->ob_itself,
4787 timeScale);
4788 Py_INCREF(Py_None);
4789 _res = Py_None;
4790 return _res;
4791}
4792
4793static PyObject *MovieObj_GetMovieDuration(_self, _args)
4794 MovieObject *_self;
4795 PyObject *_args;
4796{
4797 PyObject *_res = NULL;
4798 TimeValue _rv;
4799 if (!PyArg_ParseTuple(_args, ""))
4800 return NULL;
4801 _rv = GetMovieDuration(_self->ob_itself);
4802 _res = Py_BuildValue("l",
4803 _rv);
4804 return _res;
4805}
4806
4807static PyObject *MovieObj_GetMovieRate(_self, _args)
4808 MovieObject *_self;
4809 PyObject *_args;
4810{
4811 PyObject *_res = NULL;
4812 Fixed _rv;
4813 if (!PyArg_ParseTuple(_args, ""))
4814 return NULL;
4815 _rv = GetMovieRate(_self->ob_itself);
4816 _res = Py_BuildValue("O&",
4817 PyMac_BuildFixed, _rv);
4818 return _res;
4819}
4820
4821static PyObject *MovieObj_SetMovieRate(_self, _args)
4822 MovieObject *_self;
4823 PyObject *_args;
4824{
4825 PyObject *_res = NULL;
4826 Fixed rate;
4827 if (!PyArg_ParseTuple(_args, "O&",
4828 PyMac_GetFixed, &rate))
4829 return NULL;
4830 SetMovieRate(_self->ob_itself,
4831 rate);
4832 Py_INCREF(Py_None);
4833 _res = Py_None;
4834 return _res;
4835}
4836
4837static PyObject *MovieObj_GetMoviePreferredRate(_self, _args)
4838 MovieObject *_self;
4839 PyObject *_args;
4840{
4841 PyObject *_res = NULL;
4842 Fixed _rv;
4843 if (!PyArg_ParseTuple(_args, ""))
4844 return NULL;
4845 _rv = GetMoviePreferredRate(_self->ob_itself);
4846 _res = Py_BuildValue("O&",
4847 PyMac_BuildFixed, _rv);
4848 return _res;
4849}
4850
4851static PyObject *MovieObj_SetMoviePreferredRate(_self, _args)
4852 MovieObject *_self;
4853 PyObject *_args;
4854{
4855 PyObject *_res = NULL;
4856 Fixed rate;
4857 if (!PyArg_ParseTuple(_args, "O&",
4858 PyMac_GetFixed, &rate))
4859 return NULL;
4860 SetMoviePreferredRate(_self->ob_itself,
4861 rate);
4862 Py_INCREF(Py_None);
4863 _res = Py_None;
4864 return _res;
4865}
4866
4867static PyObject *MovieObj_GetMoviePreferredVolume(_self, _args)
4868 MovieObject *_self;
4869 PyObject *_args;
4870{
4871 PyObject *_res = NULL;
4872 short _rv;
4873 if (!PyArg_ParseTuple(_args, ""))
4874 return NULL;
4875 _rv = GetMoviePreferredVolume(_self->ob_itself);
4876 _res = Py_BuildValue("h",
4877 _rv);
4878 return _res;
4879}
4880
4881static PyObject *MovieObj_SetMoviePreferredVolume(_self, _args)
4882 MovieObject *_self;
4883 PyObject *_args;
4884{
4885 PyObject *_res = NULL;
4886 short volume;
4887 if (!PyArg_ParseTuple(_args, "h",
4888 &volume))
4889 return NULL;
4890 SetMoviePreferredVolume(_self->ob_itself,
4891 volume);
4892 Py_INCREF(Py_None);
4893 _res = Py_None;
4894 return _res;
4895}
4896
4897static PyObject *MovieObj_GetMovieVolume(_self, _args)
4898 MovieObject *_self;
4899 PyObject *_args;
4900{
4901 PyObject *_res = NULL;
4902 short _rv;
4903 if (!PyArg_ParseTuple(_args, ""))
4904 return NULL;
4905 _rv = GetMovieVolume(_self->ob_itself);
4906 _res = Py_BuildValue("h",
4907 _rv);
4908 return _res;
4909}
4910
4911static PyObject *MovieObj_SetMovieVolume(_self, _args)
4912 MovieObject *_self;
4913 PyObject *_args;
4914{
4915 PyObject *_res = NULL;
4916 short volume;
4917 if (!PyArg_ParseTuple(_args, "h",
4918 &volume))
4919 return NULL;
4920 SetMovieVolume(_self->ob_itself,
4921 volume);
4922 Py_INCREF(Py_None);
4923 _res = Py_None;
4924 return _res;
4925}
4926
4927static PyObject *MovieObj_GetMoviePreviewTime(_self, _args)
4928 MovieObject *_self;
4929 PyObject *_args;
4930{
4931 PyObject *_res = NULL;
4932 TimeValue previewTime;
4933 TimeValue previewDuration;
4934 if (!PyArg_ParseTuple(_args, ""))
4935 return NULL;
4936 GetMoviePreviewTime(_self->ob_itself,
4937 &previewTime,
4938 &previewDuration);
4939 _res = Py_BuildValue("ll",
4940 previewTime,
4941 previewDuration);
4942 return _res;
4943}
4944
4945static PyObject *MovieObj_SetMoviePreviewTime(_self, _args)
4946 MovieObject *_self;
4947 PyObject *_args;
4948{
4949 PyObject *_res = NULL;
4950 TimeValue previewTime;
4951 TimeValue previewDuration;
4952 if (!PyArg_ParseTuple(_args, "ll",
4953 &previewTime,
4954 &previewDuration))
4955 return NULL;
4956 SetMoviePreviewTime(_self->ob_itself,
4957 previewTime,
4958 previewDuration);
4959 Py_INCREF(Py_None);
4960 _res = Py_None;
4961 return _res;
4962}
4963
4964static PyObject *MovieObj_GetMoviePosterTime(_self, _args)
4965 MovieObject *_self;
4966 PyObject *_args;
4967{
4968 PyObject *_res = NULL;
4969 TimeValue _rv;
4970 if (!PyArg_ParseTuple(_args, ""))
4971 return NULL;
4972 _rv = GetMoviePosterTime(_self->ob_itself);
4973 _res = Py_BuildValue("l",
4974 _rv);
4975 return _res;
4976}
4977
4978static PyObject *MovieObj_SetMoviePosterTime(_self, _args)
4979 MovieObject *_self;
4980 PyObject *_args;
4981{
4982 PyObject *_res = NULL;
4983 TimeValue posterTime;
4984 if (!PyArg_ParseTuple(_args, "l",
4985 &posterTime))
4986 return NULL;
4987 SetMoviePosterTime(_self->ob_itself,
4988 posterTime);
4989 Py_INCREF(Py_None);
4990 _res = Py_None;
4991 return _res;
4992}
4993
4994static PyObject *MovieObj_GetMovieSelection(_self, _args)
4995 MovieObject *_self;
4996 PyObject *_args;
4997{
4998 PyObject *_res = NULL;
4999 TimeValue selectionTime;
5000 TimeValue selectionDuration;
5001 if (!PyArg_ParseTuple(_args, ""))
5002 return NULL;
5003 GetMovieSelection(_self->ob_itself,
5004 &selectionTime,
5005 &selectionDuration);
5006 _res = Py_BuildValue("ll",
5007 selectionTime,
5008 selectionDuration);
5009 return _res;
5010}
5011
5012static PyObject *MovieObj_SetMovieSelection(_self, _args)
5013 MovieObject *_self;
5014 PyObject *_args;
5015{
5016 PyObject *_res = NULL;
5017 TimeValue selectionTime;
5018 TimeValue selectionDuration;
5019 if (!PyArg_ParseTuple(_args, "ll",
5020 &selectionTime,
5021 &selectionDuration))
5022 return NULL;
5023 SetMovieSelection(_self->ob_itself,
5024 selectionTime,
5025 selectionDuration);
5026 Py_INCREF(Py_None);
5027 _res = Py_None;
5028 return _res;
5029}
5030
5031static PyObject *MovieObj_SetMovieActiveSegment(_self, _args)
5032 MovieObject *_self;
5033 PyObject *_args;
5034{
5035 PyObject *_res = NULL;
5036 TimeValue startTime;
5037 TimeValue duration;
5038 if (!PyArg_ParseTuple(_args, "ll",
5039 &startTime,
5040 &duration))
5041 return NULL;
5042 SetMovieActiveSegment(_self->ob_itself,
5043 startTime,
5044 duration);
5045 Py_INCREF(Py_None);
5046 _res = Py_None;
5047 return _res;
5048}
5049
5050static PyObject *MovieObj_GetMovieActiveSegment(_self, _args)
5051 MovieObject *_self;
5052 PyObject *_args;
5053{
5054 PyObject *_res = NULL;
5055 TimeValue startTime;
5056 TimeValue duration;
5057 if (!PyArg_ParseTuple(_args, ""))
5058 return NULL;
5059 GetMovieActiveSegment(_self->ob_itself,
5060 &startTime,
5061 &duration);
5062 _res = Py_BuildValue("ll",
5063 startTime,
5064 duration);
5065 return _res;
5066}
5067
Jack Jansenb2006391998-04-23 13:22:44 +00005068static PyObject *MovieObj_GetMovieTime(_self, _args)
5069 MovieObject *_self;
5070 PyObject *_args;
5071{
5072 PyObject *_res = NULL;
5073 TimeValue _rv;
5074 TimeRecord currentTime;
5075 if (!PyArg_ParseTuple(_args, ""))
5076 return NULL;
5077 _rv = GetMovieTime(_self->ob_itself,
5078 &currentTime);
5079 _res = Py_BuildValue("lO&",
5080 _rv,
5081 QtTimeRecord_New, &currentTime);
5082 return _res;
5083}
5084
5085static PyObject *MovieObj_SetMovieTime(_self, _args)
5086 MovieObject *_self;
5087 PyObject *_args;
5088{
5089 PyObject *_res = NULL;
5090 TimeRecord newtime;
5091 if (!PyArg_ParseTuple(_args, "O&",
5092 QtTimeRecord_Convert, &newtime))
5093 return NULL;
5094 SetMovieTime(_self->ob_itself,
5095 &newtime);
5096 Py_INCREF(Py_None);
5097 _res = Py_None;
5098 return _res;
5099}
5100
Jack Jansen453ced51995-11-30 17:42:08 +00005101static PyObject *MovieObj_SetMovieTimeValue(_self, _args)
5102 MovieObject *_self;
5103 PyObject *_args;
5104{
5105 PyObject *_res = NULL;
5106 TimeValue newtime;
5107 if (!PyArg_ParseTuple(_args, "l",
5108 &newtime))
5109 return NULL;
5110 SetMovieTimeValue(_self->ob_itself,
5111 newtime);
5112 Py_INCREF(Py_None);
5113 _res = Py_None;
5114 return _res;
5115}
5116
5117static PyObject *MovieObj_GetMovieUserData(_self, _args)
5118 MovieObject *_self;
5119 PyObject *_args;
5120{
5121 PyObject *_res = NULL;
5122 UserData _rv;
5123 if (!PyArg_ParseTuple(_args, ""))
5124 return NULL;
5125 _rv = GetMovieUserData(_self->ob_itself);
5126 _res = Py_BuildValue("O&",
5127 UserDataObj_New, _rv);
5128 return _res;
5129}
5130
5131static PyObject *MovieObj_GetMovieTrackCount(_self, _args)
5132 MovieObject *_self;
5133 PyObject *_args;
5134{
5135 PyObject *_res = NULL;
5136 long _rv;
5137 if (!PyArg_ParseTuple(_args, ""))
5138 return NULL;
5139 _rv = GetMovieTrackCount(_self->ob_itself);
5140 _res = Py_BuildValue("l",
5141 _rv);
5142 return _res;
5143}
5144
5145static PyObject *MovieObj_GetMovieTrack(_self, _args)
5146 MovieObject *_self;
5147 PyObject *_args;
5148{
5149 PyObject *_res = NULL;
5150 Track _rv;
5151 long trackID;
5152 if (!PyArg_ParseTuple(_args, "l",
5153 &trackID))
5154 return NULL;
5155 _rv = GetMovieTrack(_self->ob_itself,
5156 trackID);
5157 _res = Py_BuildValue("O&",
5158 TrackObj_New, _rv);
5159 return _res;
5160}
5161
5162static PyObject *MovieObj_GetMovieIndTrack(_self, _args)
5163 MovieObject *_self;
5164 PyObject *_args;
5165{
5166 PyObject *_res = NULL;
5167 Track _rv;
5168 long index;
5169 if (!PyArg_ParseTuple(_args, "l",
5170 &index))
5171 return NULL;
5172 _rv = GetMovieIndTrack(_self->ob_itself,
5173 index);
5174 _res = Py_BuildValue("O&",
5175 TrackObj_New, _rv);
5176 return _res;
5177}
5178
5179static PyObject *MovieObj_GetMovieIndTrackType(_self, _args)
5180 MovieObject *_self;
5181 PyObject *_args;
5182{
5183 PyObject *_res = NULL;
5184 Track _rv;
5185 long index;
5186 OSType trackType;
5187 long flags;
5188 if (!PyArg_ParseTuple(_args, "lO&l",
5189 &index,
5190 PyMac_GetOSType, &trackType,
5191 &flags))
5192 return NULL;
5193 _rv = GetMovieIndTrackType(_self->ob_itself,
5194 index,
5195 trackType,
5196 flags);
5197 _res = Py_BuildValue("O&",
5198 TrackObj_New, _rv);
5199 return _res;
5200}
5201
5202static PyObject *MovieObj_NewMovieTrack(_self, _args)
5203 MovieObject *_self;
5204 PyObject *_args;
5205{
5206 PyObject *_res = NULL;
5207 Track _rv;
5208 Fixed width;
5209 Fixed height;
5210 short trackVolume;
5211 if (!PyArg_ParseTuple(_args, "O&O&h",
5212 PyMac_GetFixed, &width,
5213 PyMac_GetFixed, &height,
5214 &trackVolume))
5215 return NULL;
5216 _rv = NewMovieTrack(_self->ob_itself,
5217 width,
5218 height,
5219 trackVolume);
5220 _res = Py_BuildValue("O&",
5221 TrackObj_New, _rv);
5222 return _res;
5223}
5224
5225static PyObject *MovieObj_SetAutoTrackAlternatesEnabled(_self, _args)
5226 MovieObject *_self;
5227 PyObject *_args;
5228{
5229 PyObject *_res = NULL;
5230 Boolean enable;
5231 if (!PyArg_ParseTuple(_args, "b",
5232 &enable))
5233 return NULL;
5234 SetAutoTrackAlternatesEnabled(_self->ob_itself,
5235 enable);
5236 Py_INCREF(Py_None);
5237 _res = Py_None;
5238 return _res;
5239}
5240
5241static PyObject *MovieObj_SelectMovieAlternates(_self, _args)
5242 MovieObject *_self;
5243 PyObject *_args;
5244{
5245 PyObject *_res = NULL;
5246 if (!PyArg_ParseTuple(_args, ""))
5247 return NULL;
5248 SelectMovieAlternates(_self->ob_itself);
5249 Py_INCREF(Py_None);
5250 _res = Py_None;
5251 return _res;
5252}
5253
5254static PyObject *MovieObj_InsertMovieSegment(_self, _args)
5255 MovieObject *_self;
5256 PyObject *_args;
5257{
5258 PyObject *_res = NULL;
5259 OSErr _err;
5260 Movie dstMovie;
5261 TimeValue srcIn;
5262 TimeValue srcDuration;
5263 TimeValue dstIn;
5264 if (!PyArg_ParseTuple(_args, "O&lll",
5265 MovieObj_Convert, &dstMovie,
5266 &srcIn,
5267 &srcDuration,
5268 &dstIn))
5269 return NULL;
5270 _err = InsertMovieSegment(_self->ob_itself,
5271 dstMovie,
5272 srcIn,
5273 srcDuration,
5274 dstIn);
5275 if (_err != noErr) return PyMac_Error(_err);
5276 Py_INCREF(Py_None);
5277 _res = Py_None;
5278 return _res;
5279}
5280
5281static PyObject *MovieObj_InsertEmptyMovieSegment(_self, _args)
5282 MovieObject *_self;
5283 PyObject *_args;
5284{
5285 PyObject *_res = NULL;
5286 OSErr _err;
5287 TimeValue dstIn;
5288 TimeValue dstDuration;
5289 if (!PyArg_ParseTuple(_args, "ll",
5290 &dstIn,
5291 &dstDuration))
5292 return NULL;
5293 _err = InsertEmptyMovieSegment(_self->ob_itself,
5294 dstIn,
5295 dstDuration);
5296 if (_err != noErr) return PyMac_Error(_err);
5297 Py_INCREF(Py_None);
5298 _res = Py_None;
5299 return _res;
5300}
5301
5302static PyObject *MovieObj_DeleteMovieSegment(_self, _args)
5303 MovieObject *_self;
5304 PyObject *_args;
5305{
5306 PyObject *_res = NULL;
5307 OSErr _err;
5308 TimeValue startTime;
5309 TimeValue duration;
5310 if (!PyArg_ParseTuple(_args, "ll",
5311 &startTime,
5312 &duration))
5313 return NULL;
5314 _err = DeleteMovieSegment(_self->ob_itself,
5315 startTime,
5316 duration);
5317 if (_err != noErr) return PyMac_Error(_err);
5318 Py_INCREF(Py_None);
5319 _res = Py_None;
5320 return _res;
5321}
5322
5323static PyObject *MovieObj_ScaleMovieSegment(_self, _args)
5324 MovieObject *_self;
5325 PyObject *_args;
5326{
5327 PyObject *_res = NULL;
5328 OSErr _err;
5329 TimeValue startTime;
5330 TimeValue oldDuration;
5331 TimeValue newDuration;
5332 if (!PyArg_ParseTuple(_args, "lll",
5333 &startTime,
5334 &oldDuration,
5335 &newDuration))
5336 return NULL;
5337 _err = ScaleMovieSegment(_self->ob_itself,
5338 startTime,
5339 oldDuration,
5340 newDuration);
5341 if (_err != noErr) return PyMac_Error(_err);
5342 Py_INCREF(Py_None);
5343 _res = Py_None;
5344 return _res;
5345}
5346
5347static PyObject *MovieObj_CutMovieSelection(_self, _args)
5348 MovieObject *_self;
5349 PyObject *_args;
5350{
5351 PyObject *_res = NULL;
5352 Movie _rv;
5353 if (!PyArg_ParseTuple(_args, ""))
5354 return NULL;
5355 _rv = CutMovieSelection(_self->ob_itself);
5356 _res = Py_BuildValue("O&",
5357 MovieObj_New, _rv);
5358 return _res;
5359}
5360
5361static PyObject *MovieObj_CopyMovieSelection(_self, _args)
5362 MovieObject *_self;
5363 PyObject *_args;
5364{
5365 PyObject *_res = NULL;
5366 Movie _rv;
5367 if (!PyArg_ParseTuple(_args, ""))
5368 return NULL;
5369 _rv = CopyMovieSelection(_self->ob_itself);
5370 _res = Py_BuildValue("O&",
5371 MovieObj_New, _rv);
5372 return _res;
5373}
5374
5375static PyObject *MovieObj_PasteMovieSelection(_self, _args)
5376 MovieObject *_self;
5377 PyObject *_args;
5378{
5379 PyObject *_res = NULL;
5380 Movie src;
5381 if (!PyArg_ParseTuple(_args, "O&",
5382 MovieObj_Convert, &src))
5383 return NULL;
5384 PasteMovieSelection(_self->ob_itself,
5385 src);
5386 Py_INCREF(Py_None);
5387 _res = Py_None;
5388 return _res;
5389}
5390
5391static PyObject *MovieObj_AddMovieSelection(_self, _args)
5392 MovieObject *_self;
5393 PyObject *_args;
5394{
5395 PyObject *_res = NULL;
5396 Movie src;
5397 if (!PyArg_ParseTuple(_args, "O&",
5398 MovieObj_Convert, &src))
5399 return NULL;
5400 AddMovieSelection(_self->ob_itself,
5401 src);
5402 Py_INCREF(Py_None);
5403 _res = Py_None;
5404 return _res;
5405}
5406
5407static PyObject *MovieObj_ClearMovieSelection(_self, _args)
5408 MovieObject *_self;
5409 PyObject *_args;
5410{
5411 PyObject *_res = NULL;
5412 if (!PyArg_ParseTuple(_args, ""))
5413 return NULL;
5414 ClearMovieSelection(_self->ob_itself);
5415 Py_INCREF(Py_None);
5416 _res = Py_None;
5417 return _res;
5418}
5419
5420static PyObject *MovieObj_PutMovieIntoTypedHandle(_self, _args)
5421 MovieObject *_self;
5422 PyObject *_args;
5423{
5424 PyObject *_res = NULL;
5425 OSErr _err;
5426 Track targetTrack;
5427 OSType handleType;
5428 Handle publicMovie;
5429 TimeValue start;
5430 TimeValue dur;
5431 long flags;
5432 ComponentInstance userComp;
5433 if (!PyArg_ParseTuple(_args, "O&O&O&lllO&",
5434 TrackObj_Convert, &targetTrack,
5435 PyMac_GetOSType, &handleType,
5436 ResObj_Convert, &publicMovie,
5437 &start,
5438 &dur,
5439 &flags,
5440 CmpInstObj_Convert, &userComp))
5441 return NULL;
5442 _err = PutMovieIntoTypedHandle(_self->ob_itself,
5443 targetTrack,
5444 handleType,
5445 publicMovie,
5446 start,
5447 dur,
5448 flags,
5449 userComp);
5450 if (_err != noErr) return PyMac_Error(_err);
5451 Py_INCREF(Py_None);
5452 _res = Py_None;
5453 return _res;
5454}
5455
5456static PyObject *MovieObj_CopyMovieSettings(_self, _args)
5457 MovieObject *_self;
5458 PyObject *_args;
5459{
5460 PyObject *_res = NULL;
5461 OSErr _err;
5462 Movie dstMovie;
5463 if (!PyArg_ParseTuple(_args, "O&",
5464 MovieObj_Convert, &dstMovie))
5465 return NULL;
5466 _err = CopyMovieSettings(_self->ob_itself,
5467 dstMovie);
5468 if (_err != noErr) return PyMac_Error(_err);
5469 Py_INCREF(Py_None);
5470 _res = Py_None;
5471 return _res;
5472}
5473
5474static PyObject *MovieObj_ConvertMovieToFile(_self, _args)
5475 MovieObject *_self;
5476 PyObject *_args;
5477{
5478 PyObject *_res = NULL;
5479 OSErr _err;
5480 Track onlyTrack;
5481 FSSpec outputFile;
5482 OSType fileType;
5483 OSType creator;
5484 ScriptCode scriptTag;
5485 short resID;
5486 long flags;
5487 ComponentInstance userComp;
5488 if (!PyArg_ParseTuple(_args, "O&O&O&O&hlO&",
5489 TrackObj_Convert, &onlyTrack,
5490 PyMac_GetFSSpec, &outputFile,
5491 PyMac_GetOSType, &fileType,
5492 PyMac_GetOSType, &creator,
5493 &scriptTag,
5494 &flags,
5495 CmpInstObj_Convert, &userComp))
5496 return NULL;
5497 _err = ConvertMovieToFile(_self->ob_itself,
5498 onlyTrack,
5499 &outputFile,
5500 fileType,
5501 creator,
5502 scriptTag,
5503 &resID,
5504 flags,
5505 userComp);
5506 if (_err != noErr) return PyMac_Error(_err);
5507 _res = Py_BuildValue("h",
5508 resID);
5509 return _res;
5510}
5511
5512static PyObject *MovieObj_GetMovieDataSize(_self, _args)
5513 MovieObject *_self;
5514 PyObject *_args;
5515{
5516 PyObject *_res = NULL;
5517 long _rv;
5518 TimeValue startTime;
5519 TimeValue duration;
5520 if (!PyArg_ParseTuple(_args, "ll",
5521 &startTime,
5522 &duration))
5523 return NULL;
5524 _rv = GetMovieDataSize(_self->ob_itself,
5525 startTime,
5526 duration);
5527 _res = Py_BuildValue("l",
5528 _rv);
5529 return _res;
5530}
5531
Jack Jansen723ad8a2000-12-12 22:10:21 +00005532static PyObject *MovieObj_GetMovieDataSize64(_self, _args)
5533 MovieObject *_self;
5534 PyObject *_args;
5535{
5536 PyObject *_res = NULL;
5537 OSErr _err;
5538 TimeValue startTime;
5539 TimeValue duration;
5540 wide dataSize;
5541 if (!PyArg_ParseTuple(_args, "ll",
5542 &startTime,
5543 &duration))
5544 return NULL;
5545 _err = GetMovieDataSize64(_self->ob_itself,
5546 startTime,
5547 duration,
5548 &dataSize);
5549 if (_err != noErr) return PyMac_Error(_err);
5550 _res = Py_BuildValue("O&",
5551 PyMac_Buildwide, dataSize);
5552 return _res;
5553}
5554
Jack Jansen453ced51995-11-30 17:42:08 +00005555static PyObject *MovieObj_PtInMovie(_self, _args)
5556 MovieObject *_self;
5557 PyObject *_args;
5558{
5559 PyObject *_res = NULL;
5560 Boolean _rv;
5561 Point pt;
5562 if (!PyArg_ParseTuple(_args, "O&",
5563 PyMac_GetPoint, &pt))
5564 return NULL;
5565 _rv = PtInMovie(_self->ob_itself,
5566 pt);
5567 _res = Py_BuildValue("b",
5568 _rv);
5569 return _res;
5570}
5571
5572static PyObject *MovieObj_SetMovieLanguage(_self, _args)
5573 MovieObject *_self;
5574 PyObject *_args;
5575{
5576 PyObject *_res = NULL;
5577 long language;
5578 if (!PyArg_ParseTuple(_args, "l",
5579 &language))
5580 return NULL;
5581 SetMovieLanguage(_self->ob_itself,
5582 language);
5583 Py_INCREF(Py_None);
5584 _res = Py_None;
5585 return _res;
5586}
5587
5588static PyObject *MovieObj_GetMovieNextInterestingTime(_self, _args)
5589 MovieObject *_self;
5590 PyObject *_args;
5591{
5592 PyObject *_res = NULL;
5593 short interestingTimeFlags;
5594 short numMediaTypes;
5595 OSType whichMediaTypes;
5596 TimeValue time;
5597 Fixed rate;
5598 TimeValue interestingTime;
5599 TimeValue interestingDuration;
5600 if (!PyArg_ParseTuple(_args, "hhO&lO&",
5601 &interestingTimeFlags,
5602 &numMediaTypes,
5603 PyMac_GetOSType, &whichMediaTypes,
5604 &time,
5605 PyMac_GetFixed, &rate))
5606 return NULL;
5607 GetMovieNextInterestingTime(_self->ob_itself,
5608 interestingTimeFlags,
5609 numMediaTypes,
5610 &whichMediaTypes,
5611 time,
5612 rate,
5613 &interestingTime,
5614 &interestingDuration);
5615 _res = Py_BuildValue("ll",
5616 interestingTime,
5617 interestingDuration);
5618 return _res;
5619}
5620
5621static PyObject *MovieObj_AddMovieResource(_self, _args)
5622 MovieObject *_self;
5623 PyObject *_args;
5624{
5625 PyObject *_res = NULL;
5626 OSErr _err;
5627 short resRefNum;
5628 short resId;
5629 Str255 resName;
5630 if (!PyArg_ParseTuple(_args, "hO&",
5631 &resRefNum,
5632 PyMac_GetStr255, resName))
5633 return NULL;
5634 _err = AddMovieResource(_self->ob_itself,
5635 resRefNum,
5636 &resId,
5637 resName);
5638 if (_err != noErr) return PyMac_Error(_err);
5639 _res = Py_BuildValue("h",
5640 resId);
5641 return _res;
5642}
5643
5644static PyObject *MovieObj_UpdateMovieResource(_self, _args)
5645 MovieObject *_self;
5646 PyObject *_args;
5647{
5648 PyObject *_res = NULL;
5649 OSErr _err;
5650 short resRefNum;
5651 short resId;
5652 Str255 resName;
5653 if (!PyArg_ParseTuple(_args, "hhO&",
5654 &resRefNum,
5655 &resId,
5656 PyMac_GetStr255, resName))
5657 return NULL;
5658 _err = UpdateMovieResource(_self->ob_itself,
5659 resRefNum,
5660 resId,
5661 resName);
5662 if (_err != noErr) return PyMac_Error(_err);
5663 Py_INCREF(Py_None);
5664 _res = Py_None;
5665 return _res;
5666}
5667
5668static PyObject *MovieObj_HasMovieChanged(_self, _args)
5669 MovieObject *_self;
5670 PyObject *_args;
5671{
5672 PyObject *_res = NULL;
5673 Boolean _rv;
5674 if (!PyArg_ParseTuple(_args, ""))
5675 return NULL;
5676 _rv = HasMovieChanged(_self->ob_itself);
5677 _res = Py_BuildValue("b",
5678 _rv);
5679 return _res;
5680}
5681
5682static PyObject *MovieObj_ClearMovieChanged(_self, _args)
5683 MovieObject *_self;
5684 PyObject *_args;
5685{
5686 PyObject *_res = NULL;
5687 if (!PyArg_ParseTuple(_args, ""))
5688 return NULL;
5689 ClearMovieChanged(_self->ob_itself);
5690 Py_INCREF(Py_None);
5691 _res = Py_None;
5692 return _res;
5693}
5694
5695static PyObject *MovieObj_SetMovieDefaultDataRef(_self, _args)
5696 MovieObject *_self;
5697 PyObject *_args;
5698{
5699 PyObject *_res = NULL;
5700 OSErr _err;
5701 Handle dataRef;
5702 OSType dataRefType;
5703 if (!PyArg_ParseTuple(_args, "O&O&",
5704 ResObj_Convert, &dataRef,
5705 PyMac_GetOSType, &dataRefType))
5706 return NULL;
5707 _err = SetMovieDefaultDataRef(_self->ob_itself,
5708 dataRef,
5709 dataRefType);
5710 if (_err != noErr) return PyMac_Error(_err);
5711 Py_INCREF(Py_None);
5712 _res = Py_None;
5713 return _res;
5714}
5715
5716static PyObject *MovieObj_GetMovieDefaultDataRef(_self, _args)
5717 MovieObject *_self;
5718 PyObject *_args;
5719{
5720 PyObject *_res = NULL;
5721 OSErr _err;
5722 Handle dataRef;
5723 OSType dataRefType;
5724 if (!PyArg_ParseTuple(_args, ""))
5725 return NULL;
5726 _err = GetMovieDefaultDataRef(_self->ob_itself,
5727 &dataRef,
5728 &dataRefType);
5729 if (_err != noErr) return PyMac_Error(_err);
5730 _res = Py_BuildValue("O&O&",
5731 ResObj_New, dataRef,
5732 PyMac_BuildOSType, dataRefType);
5733 return _res;
5734}
5735
Jack Jansen723ad8a2000-12-12 22:10:21 +00005736static PyObject *MovieObj_SetMovieAnchorDataRef(_self, _args)
5737 MovieObject *_self;
5738 PyObject *_args;
5739{
5740 PyObject *_res = NULL;
5741 OSErr _err;
5742 Handle dataRef;
5743 OSType dataRefType;
5744 if (!PyArg_ParseTuple(_args, "O&O&",
5745 ResObj_Convert, &dataRef,
5746 PyMac_GetOSType, &dataRefType))
5747 return NULL;
5748 _err = SetMovieAnchorDataRef(_self->ob_itself,
5749 dataRef,
5750 dataRefType);
5751 if (_err != noErr) return PyMac_Error(_err);
5752 Py_INCREF(Py_None);
5753 _res = Py_None;
5754 return _res;
5755}
5756
5757static PyObject *MovieObj_GetMovieAnchorDataRef(_self, _args)
5758 MovieObject *_self;
5759 PyObject *_args;
5760{
5761 PyObject *_res = NULL;
5762 OSErr _err;
5763 Handle dataRef;
5764 OSType dataRefType;
5765 long outFlags;
5766 if (!PyArg_ParseTuple(_args, ""))
5767 return NULL;
5768 _err = GetMovieAnchorDataRef(_self->ob_itself,
5769 &dataRef,
5770 &dataRefType,
5771 &outFlags);
5772 if (_err != noErr) return PyMac_Error(_err);
5773 _res = Py_BuildValue("O&O&l",
5774 ResObj_New, dataRef,
5775 PyMac_BuildOSType, dataRefType,
5776 outFlags);
5777 return _res;
5778}
5779
Jack Jansen453ced51995-11-30 17:42:08 +00005780static PyObject *MovieObj_SetMovieColorTable(_self, _args)
5781 MovieObject *_self;
5782 PyObject *_args;
5783{
5784 PyObject *_res = NULL;
5785 OSErr _err;
5786 CTabHandle ctab;
5787 if (!PyArg_ParseTuple(_args, "O&",
5788 ResObj_Convert, &ctab))
5789 return NULL;
5790 _err = SetMovieColorTable(_self->ob_itself,
5791 ctab);
5792 if (_err != noErr) return PyMac_Error(_err);
5793 Py_INCREF(Py_None);
5794 _res = Py_None;
5795 return _res;
5796}
5797
5798static PyObject *MovieObj_GetMovieColorTable(_self, _args)
5799 MovieObject *_self;
5800 PyObject *_args;
5801{
5802 PyObject *_res = NULL;
5803 OSErr _err;
5804 CTabHandle ctab;
5805 if (!PyArg_ParseTuple(_args, ""))
5806 return NULL;
5807 _err = GetMovieColorTable(_self->ob_itself,
5808 &ctab);
5809 if (_err != noErr) return PyMac_Error(_err);
5810 _res = Py_BuildValue("O&",
5811 ResObj_New, ctab);
5812 return _res;
5813}
5814
5815static PyObject *MovieObj_FlattenMovie(_self, _args)
5816 MovieObject *_self;
5817 PyObject *_args;
5818{
5819 PyObject *_res = NULL;
5820 long movieFlattenFlags;
5821 FSSpec theFile;
5822 OSType creator;
5823 ScriptCode scriptTag;
5824 long createMovieFileFlags;
5825 short resId;
5826 Str255 resName;
5827 if (!PyArg_ParseTuple(_args, "lO&O&hlO&",
5828 &movieFlattenFlags,
5829 PyMac_GetFSSpec, &theFile,
5830 PyMac_GetOSType, &creator,
5831 &scriptTag,
5832 &createMovieFileFlags,
5833 PyMac_GetStr255, resName))
5834 return NULL;
5835 FlattenMovie(_self->ob_itself,
5836 movieFlattenFlags,
5837 &theFile,
5838 creator,
5839 scriptTag,
5840 createMovieFileFlags,
5841 &resId,
5842 resName);
5843 _res = Py_BuildValue("h",
5844 resId);
5845 return _res;
5846}
5847
5848static PyObject *MovieObj_FlattenMovieData(_self, _args)
5849 MovieObject *_self;
5850 PyObject *_args;
5851{
5852 PyObject *_res = NULL;
5853 Movie _rv;
5854 long movieFlattenFlags;
5855 FSSpec theFile;
5856 OSType creator;
5857 ScriptCode scriptTag;
5858 long createMovieFileFlags;
5859 if (!PyArg_ParseTuple(_args, "lO&O&hl",
5860 &movieFlattenFlags,
5861 PyMac_GetFSSpec, &theFile,
5862 PyMac_GetOSType, &creator,
5863 &scriptTag,
5864 &createMovieFileFlags))
5865 return NULL;
5866 _rv = FlattenMovieData(_self->ob_itself,
5867 movieFlattenFlags,
5868 &theFile,
5869 creator,
5870 scriptTag,
5871 createMovieFileFlags);
5872 _res = Py_BuildValue("O&",
5873 MovieObj_New, _rv);
5874 return _res;
5875}
5876
5877static PyObject *MovieObj_MovieSearchText(_self, _args)
5878 MovieObject *_self;
5879 PyObject *_args;
5880{
5881 PyObject *_res = NULL;
5882 OSErr _err;
5883 Ptr text;
5884 long size;
5885 long searchFlags;
5886 Track searchTrack;
5887 TimeValue searchTime;
5888 long searchOffset;
5889 if (!PyArg_ParseTuple(_args, "sll",
5890 &text,
5891 &size,
5892 &searchFlags))
5893 return NULL;
5894 _err = MovieSearchText(_self->ob_itself,
5895 text,
5896 size,
5897 searchFlags,
5898 &searchTrack,
5899 &searchTime,
5900 &searchOffset);
5901 if (_err != noErr) return PyMac_Error(_err);
5902 _res = Py_BuildValue("O&ll",
5903 TrackObj_New, searchTrack,
5904 searchTime,
5905 searchOffset);
5906 return _res;
5907}
5908
5909static PyObject *MovieObj_GetPosterBox(_self, _args)
5910 MovieObject *_self;
5911 PyObject *_args;
5912{
5913 PyObject *_res = NULL;
5914 Rect boxRect;
5915 if (!PyArg_ParseTuple(_args, ""))
5916 return NULL;
5917 GetPosterBox(_self->ob_itself,
5918 &boxRect);
5919 _res = Py_BuildValue("O&",
5920 PyMac_BuildRect, &boxRect);
5921 return _res;
5922}
5923
5924static PyObject *MovieObj_SetPosterBox(_self, _args)
5925 MovieObject *_self;
5926 PyObject *_args;
5927{
5928 PyObject *_res = NULL;
5929 Rect boxRect;
5930 if (!PyArg_ParseTuple(_args, "O&",
5931 PyMac_GetRect, &boxRect))
5932 return NULL;
5933 SetPosterBox(_self->ob_itself,
5934 &boxRect);
5935 Py_INCREF(Py_None);
5936 _res = Py_None;
5937 return _res;
5938}
5939
5940static PyObject *MovieObj_GetMovieSegmentDisplayBoundsRgn(_self, _args)
5941 MovieObject *_self;
5942 PyObject *_args;
5943{
5944 PyObject *_res = NULL;
5945 RgnHandle _rv;
5946 TimeValue time;
5947 TimeValue duration;
5948 if (!PyArg_ParseTuple(_args, "ll",
5949 &time,
5950 &duration))
5951 return NULL;
5952 _rv = GetMovieSegmentDisplayBoundsRgn(_self->ob_itself,
5953 time,
5954 duration);
5955 _res = Py_BuildValue("O&",
5956 ResObj_New, _rv);
5957 return _res;
5958}
5959
5960static PyObject *MovieObj_GetMovieStatus(_self, _args)
5961 MovieObject *_self;
5962 PyObject *_args;
5963{
5964 PyObject *_res = NULL;
5965 ComponentResult _rv;
5966 Track firstProblemTrack;
5967 if (!PyArg_ParseTuple(_args, ""))
5968 return NULL;
5969 _rv = GetMovieStatus(_self->ob_itself,
5970 &firstProblemTrack);
5971 _res = Py_BuildValue("lO&",
5972 _rv,
5973 TrackObj_New, firstProblemTrack);
5974 return _res;
5975}
5976
Jack Jansen723ad8a2000-12-12 22:10:21 +00005977static PyObject *MovieObj_GetMovieLoadState(_self, _args)
5978 MovieObject *_self;
5979 PyObject *_args;
5980{
5981 PyObject *_res = NULL;
5982 long _rv;
5983 if (!PyArg_ParseTuple(_args, ""))
5984 return NULL;
5985 _rv = GetMovieLoadState(_self->ob_itself);
5986 _res = Py_BuildValue("l",
5987 _rv);
5988 return _res;
5989}
5990
Jack Jansen453ced51995-11-30 17:42:08 +00005991static PyObject *MovieObj_NewMovieController(_self, _args)
5992 MovieObject *_self;
5993 PyObject *_args;
5994{
5995 PyObject *_res = NULL;
Jack Jansen9cfea101995-12-09 14:05:56 +00005996 MovieController _rv;
Jack Jansen453ced51995-11-30 17:42:08 +00005997 Rect movieRect;
5998 long someFlags;
5999 if (!PyArg_ParseTuple(_args, "O&l",
6000 PyMac_GetRect, &movieRect,
6001 &someFlags))
6002 return NULL;
6003 _rv = NewMovieController(_self->ob_itself,
6004 &movieRect,
6005 someFlags);
6006 _res = Py_BuildValue("O&",
Jack Jansen9cfea101995-12-09 14:05:56 +00006007 MovieCtlObj_New, _rv);
Jack Jansen453ced51995-11-30 17:42:08 +00006008 return _res;
6009}
6010
6011static PyObject *MovieObj_PutMovieOnScrap(_self, _args)
6012 MovieObject *_self;
6013 PyObject *_args;
6014{
6015 PyObject *_res = NULL;
6016 OSErr _err;
6017 long movieScrapFlags;
6018 if (!PyArg_ParseTuple(_args, "l",
6019 &movieScrapFlags))
6020 return NULL;
6021 _err = PutMovieOnScrap(_self->ob_itself,
6022 movieScrapFlags);
6023 if (_err != noErr) return PyMac_Error(_err);
6024 Py_INCREF(Py_None);
6025 _res = Py_None;
6026 return _res;
6027}
6028
6029static PyObject *MovieObj_SetMoviePlayHints(_self, _args)
6030 MovieObject *_self;
6031 PyObject *_args;
6032{
6033 PyObject *_res = NULL;
6034 long flags;
6035 long flagsMask;
6036 if (!PyArg_ParseTuple(_args, "ll",
6037 &flags,
6038 &flagsMask))
6039 return NULL;
6040 SetMoviePlayHints(_self->ob_itself,
6041 flags,
6042 flagsMask);
6043 Py_INCREF(Py_None);
6044 _res = Py_None;
6045 return _res;
6046}
6047
Jack Jansen1c4e6141998-04-21 15:23:55 +00006048static PyObject *MovieObj_GetMaxLoadedTimeInMovie(_self, _args)
6049 MovieObject *_self;
6050 PyObject *_args;
6051{
6052 PyObject *_res = NULL;
6053 OSErr _err;
6054 TimeValue time;
6055 if (!PyArg_ParseTuple(_args, ""))
6056 return NULL;
6057 _err = GetMaxLoadedTimeInMovie(_self->ob_itself,
6058 &time);
6059 if (_err != noErr) return PyMac_Error(_err);
6060 _res = Py_BuildValue("l",
6061 time);
6062 return _res;
6063}
6064
6065static PyObject *MovieObj_QTMovieNeedsTimeTable(_self, _args)
6066 MovieObject *_self;
6067 PyObject *_args;
6068{
6069 PyObject *_res = NULL;
6070 OSErr _err;
6071 Boolean needsTimeTable;
6072 if (!PyArg_ParseTuple(_args, ""))
6073 return NULL;
6074 _err = QTMovieNeedsTimeTable(_self->ob_itself,
6075 &needsTimeTable);
6076 if (_err != noErr) return PyMac_Error(_err);
6077 _res = Py_BuildValue("b",
6078 needsTimeTable);
6079 return _res;
6080}
6081
6082static PyObject *MovieObj_QTGetDataRefMaxFileOffset(_self, _args)
6083 MovieObject *_self;
6084 PyObject *_args;
6085{
6086 PyObject *_res = NULL;
6087 OSErr _err;
6088 OSType dataRefType;
6089 Handle dataRef;
6090 long offset;
6091 if (!PyArg_ParseTuple(_args, "O&O&",
6092 PyMac_GetOSType, &dataRefType,
6093 ResObj_Convert, &dataRef))
6094 return NULL;
6095 _err = QTGetDataRefMaxFileOffset(_self->ob_itself,
6096 dataRefType,
6097 dataRef,
6098 &offset);
6099 if (_err != noErr) return PyMac_Error(_err);
6100 _res = Py_BuildValue("l",
6101 offset);
6102 return _res;
6103}
6104
Jack Jansen453ced51995-11-30 17:42:08 +00006105static PyMethodDef MovieObj_methods[] = {
6106 {"MoviesTask", (PyCFunction)MovieObj_MoviesTask, 1,
6107 "(long maxMilliSecToUse) -> None"},
6108 {"PrerollMovie", (PyCFunction)MovieObj_PrerollMovie, 1,
6109 "(TimeValue time, Fixed Rate) -> None"},
Jack Jansen723ad8a2000-12-12 22:10:21 +00006110 {"AbortPrePrerollMovie", (PyCFunction)MovieObj_AbortPrePrerollMovie, 1,
6111 "(OSErr err) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00006112 {"LoadMovieIntoRam", (PyCFunction)MovieObj_LoadMovieIntoRam, 1,
6113 "(TimeValue time, TimeValue duration, long flags) -> None"},
6114 {"SetMovieActive", (PyCFunction)MovieObj_SetMovieActive, 1,
6115 "(Boolean active) -> None"},
6116 {"GetMovieActive", (PyCFunction)MovieObj_GetMovieActive, 1,
6117 "() -> (Boolean _rv)"},
6118 {"StartMovie", (PyCFunction)MovieObj_StartMovie, 1,
6119 "() -> None"},
6120 {"StopMovie", (PyCFunction)MovieObj_StopMovie, 1,
6121 "() -> None"},
6122 {"GoToBeginningOfMovie", (PyCFunction)MovieObj_GoToBeginningOfMovie, 1,
6123 "() -> None"},
6124 {"GoToEndOfMovie", (PyCFunction)MovieObj_GoToEndOfMovie, 1,
6125 "() -> None"},
6126 {"IsMovieDone", (PyCFunction)MovieObj_IsMovieDone, 1,
6127 "() -> (Boolean _rv)"},
6128 {"GetMoviePreviewMode", (PyCFunction)MovieObj_GetMoviePreviewMode, 1,
6129 "() -> (Boolean _rv)"},
6130 {"SetMoviePreviewMode", (PyCFunction)MovieObj_SetMoviePreviewMode, 1,
6131 "(Boolean usePreview) -> None"},
6132 {"ShowMoviePoster", (PyCFunction)MovieObj_ShowMoviePoster, 1,
6133 "() -> None"},
6134 {"GetMovieTimeBase", (PyCFunction)MovieObj_GetMovieTimeBase, 1,
6135 "() -> (TimeBase _rv)"},
Jack Jansenb2006391998-04-23 13:22:44 +00006136 {"SetMovieMasterTimeBase", (PyCFunction)MovieObj_SetMovieMasterTimeBase, 1,
6137 "(TimeBase tb, TimeRecord slaveZero) -> None"},
6138 {"SetMovieMasterClock", (PyCFunction)MovieObj_SetMovieMasterClock, 1,
6139 "(Component clockMeister, TimeRecord slaveZero) -> None"},
Jack Jansene0cf87b1997-04-09 15:53:46 +00006140 {"GetMovieGWorld", (PyCFunction)MovieObj_GetMovieGWorld, 1,
6141 "() -> (CGrafPtr port, GDHandle gdh)"},
6142 {"SetMovieGWorld", (PyCFunction)MovieObj_SetMovieGWorld, 1,
6143 "(CGrafPtr port, GDHandle gdh) -> None"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00006144 {"GetMovieNaturalBoundsRect", (PyCFunction)MovieObj_GetMovieNaturalBoundsRect, 1,
6145 "() -> (Rect naturalBounds)"},
Jack Jansen453ced51995-11-30 17:42:08 +00006146 {"GetNextTrackForCompositing", (PyCFunction)MovieObj_GetNextTrackForCompositing, 1,
6147 "(Track theTrack) -> (Track _rv)"},
6148 {"GetPrevTrackForCompositing", (PyCFunction)MovieObj_GetPrevTrackForCompositing, 1,
6149 "(Track theTrack) -> (Track _rv)"},
6150 {"GetMoviePict", (PyCFunction)MovieObj_GetMoviePict, 1,
6151 "(TimeValue time) -> (PicHandle _rv)"},
6152 {"GetMoviePosterPict", (PyCFunction)MovieObj_GetMoviePosterPict, 1,
6153 "() -> (PicHandle _rv)"},
6154 {"UpdateMovie", (PyCFunction)MovieObj_UpdateMovie, 1,
6155 "() -> None"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00006156 {"InvalidateMovieRegion", (PyCFunction)MovieObj_InvalidateMovieRegion, 1,
6157 "(RgnHandle invalidRgn) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00006158 {"GetMovieBox", (PyCFunction)MovieObj_GetMovieBox, 1,
6159 "() -> (Rect boxRect)"},
6160 {"SetMovieBox", (PyCFunction)MovieObj_SetMovieBox, 1,
6161 "(Rect boxRect) -> None"},
6162 {"GetMovieDisplayClipRgn", (PyCFunction)MovieObj_GetMovieDisplayClipRgn, 1,
6163 "() -> (RgnHandle _rv)"},
6164 {"SetMovieDisplayClipRgn", (PyCFunction)MovieObj_SetMovieDisplayClipRgn, 1,
6165 "(RgnHandle theClip) -> None"},
6166 {"GetMovieClipRgn", (PyCFunction)MovieObj_GetMovieClipRgn, 1,
6167 "() -> (RgnHandle _rv)"},
6168 {"SetMovieClipRgn", (PyCFunction)MovieObj_SetMovieClipRgn, 1,
6169 "(RgnHandle theClip) -> None"},
6170 {"GetMovieDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieDisplayBoundsRgn, 1,
6171 "() -> (RgnHandle _rv)"},
6172 {"GetMovieBoundsRgn", (PyCFunction)MovieObj_GetMovieBoundsRgn, 1,
6173 "() -> (RgnHandle _rv)"},
6174 {"PutMovieIntoHandle", (PyCFunction)MovieObj_PutMovieIntoHandle, 1,
6175 "(Handle publicMovie) -> None"},
6176 {"PutMovieIntoDataFork", (PyCFunction)MovieObj_PutMovieIntoDataFork, 1,
6177 "(short fRefNum, long offset, long maxSize) -> None"},
Jack Jansen723ad8a2000-12-12 22:10:21 +00006178 {"PutMovieIntoDataFork64", (PyCFunction)MovieObj_PutMovieIntoDataFork64, 1,
6179 "(long fRefNum, wide offset, unsigned long maxSize) -> None"},
Jack Jansene0cf87b1997-04-09 15:53:46 +00006180 {"GetMovieCreationTime", (PyCFunction)MovieObj_GetMovieCreationTime, 1,
6181 "() -> (unsigned long _rv)"},
6182 {"GetMovieModificationTime", (PyCFunction)MovieObj_GetMovieModificationTime, 1,
6183 "() -> (unsigned long _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00006184 {"GetMovieTimeScale", (PyCFunction)MovieObj_GetMovieTimeScale, 1,
6185 "() -> (TimeScale _rv)"},
6186 {"SetMovieTimeScale", (PyCFunction)MovieObj_SetMovieTimeScale, 1,
6187 "(TimeScale timeScale) -> None"},
6188 {"GetMovieDuration", (PyCFunction)MovieObj_GetMovieDuration, 1,
6189 "() -> (TimeValue _rv)"},
6190 {"GetMovieRate", (PyCFunction)MovieObj_GetMovieRate, 1,
6191 "() -> (Fixed _rv)"},
6192 {"SetMovieRate", (PyCFunction)MovieObj_SetMovieRate, 1,
6193 "(Fixed rate) -> None"},
6194 {"GetMoviePreferredRate", (PyCFunction)MovieObj_GetMoviePreferredRate, 1,
6195 "() -> (Fixed _rv)"},
6196 {"SetMoviePreferredRate", (PyCFunction)MovieObj_SetMoviePreferredRate, 1,
6197 "(Fixed rate) -> None"},
6198 {"GetMoviePreferredVolume", (PyCFunction)MovieObj_GetMoviePreferredVolume, 1,
6199 "() -> (short _rv)"},
6200 {"SetMoviePreferredVolume", (PyCFunction)MovieObj_SetMoviePreferredVolume, 1,
6201 "(short volume) -> None"},
6202 {"GetMovieVolume", (PyCFunction)MovieObj_GetMovieVolume, 1,
6203 "() -> (short _rv)"},
6204 {"SetMovieVolume", (PyCFunction)MovieObj_SetMovieVolume, 1,
6205 "(short volume) -> None"},
6206 {"GetMoviePreviewTime", (PyCFunction)MovieObj_GetMoviePreviewTime, 1,
6207 "() -> (TimeValue previewTime, TimeValue previewDuration)"},
6208 {"SetMoviePreviewTime", (PyCFunction)MovieObj_SetMoviePreviewTime, 1,
6209 "(TimeValue previewTime, TimeValue previewDuration) -> None"},
6210 {"GetMoviePosterTime", (PyCFunction)MovieObj_GetMoviePosterTime, 1,
6211 "() -> (TimeValue _rv)"},
6212 {"SetMoviePosterTime", (PyCFunction)MovieObj_SetMoviePosterTime, 1,
6213 "(TimeValue posterTime) -> None"},
6214 {"GetMovieSelection", (PyCFunction)MovieObj_GetMovieSelection, 1,
6215 "() -> (TimeValue selectionTime, TimeValue selectionDuration)"},
6216 {"SetMovieSelection", (PyCFunction)MovieObj_SetMovieSelection, 1,
6217 "(TimeValue selectionTime, TimeValue selectionDuration) -> None"},
6218 {"SetMovieActiveSegment", (PyCFunction)MovieObj_SetMovieActiveSegment, 1,
6219 "(TimeValue startTime, TimeValue duration) -> None"},
6220 {"GetMovieActiveSegment", (PyCFunction)MovieObj_GetMovieActiveSegment, 1,
6221 "() -> (TimeValue startTime, TimeValue duration)"},
Jack Jansenb2006391998-04-23 13:22:44 +00006222 {"GetMovieTime", (PyCFunction)MovieObj_GetMovieTime, 1,
6223 "() -> (TimeValue _rv, TimeRecord currentTime)"},
6224 {"SetMovieTime", (PyCFunction)MovieObj_SetMovieTime, 1,
6225 "(TimeRecord newtime) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00006226 {"SetMovieTimeValue", (PyCFunction)MovieObj_SetMovieTimeValue, 1,
6227 "(TimeValue newtime) -> None"},
6228 {"GetMovieUserData", (PyCFunction)MovieObj_GetMovieUserData, 1,
6229 "() -> (UserData _rv)"},
6230 {"GetMovieTrackCount", (PyCFunction)MovieObj_GetMovieTrackCount, 1,
6231 "() -> (long _rv)"},
6232 {"GetMovieTrack", (PyCFunction)MovieObj_GetMovieTrack, 1,
6233 "(long trackID) -> (Track _rv)"},
6234 {"GetMovieIndTrack", (PyCFunction)MovieObj_GetMovieIndTrack, 1,
6235 "(long index) -> (Track _rv)"},
6236 {"GetMovieIndTrackType", (PyCFunction)MovieObj_GetMovieIndTrackType, 1,
6237 "(long index, OSType trackType, long flags) -> (Track _rv)"},
6238 {"NewMovieTrack", (PyCFunction)MovieObj_NewMovieTrack, 1,
6239 "(Fixed width, Fixed height, short trackVolume) -> (Track _rv)"},
6240 {"SetAutoTrackAlternatesEnabled", (PyCFunction)MovieObj_SetAutoTrackAlternatesEnabled, 1,
6241 "(Boolean enable) -> None"},
6242 {"SelectMovieAlternates", (PyCFunction)MovieObj_SelectMovieAlternates, 1,
6243 "() -> None"},
6244 {"InsertMovieSegment", (PyCFunction)MovieObj_InsertMovieSegment, 1,
6245 "(Movie dstMovie, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
6246 {"InsertEmptyMovieSegment", (PyCFunction)MovieObj_InsertEmptyMovieSegment, 1,
6247 "(TimeValue dstIn, TimeValue dstDuration) -> None"},
6248 {"DeleteMovieSegment", (PyCFunction)MovieObj_DeleteMovieSegment, 1,
6249 "(TimeValue startTime, TimeValue duration) -> None"},
6250 {"ScaleMovieSegment", (PyCFunction)MovieObj_ScaleMovieSegment, 1,
6251 "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
6252 {"CutMovieSelection", (PyCFunction)MovieObj_CutMovieSelection, 1,
6253 "() -> (Movie _rv)"},
6254 {"CopyMovieSelection", (PyCFunction)MovieObj_CopyMovieSelection, 1,
6255 "() -> (Movie _rv)"},
6256 {"PasteMovieSelection", (PyCFunction)MovieObj_PasteMovieSelection, 1,
6257 "(Movie src) -> None"},
6258 {"AddMovieSelection", (PyCFunction)MovieObj_AddMovieSelection, 1,
6259 "(Movie src) -> None"},
6260 {"ClearMovieSelection", (PyCFunction)MovieObj_ClearMovieSelection, 1,
6261 "() -> None"},
6262 {"PutMovieIntoTypedHandle", (PyCFunction)MovieObj_PutMovieIntoTypedHandle, 1,
6263 "(Track targetTrack, OSType handleType, Handle publicMovie, TimeValue start, TimeValue dur, long flags, ComponentInstance userComp) -> None"},
6264 {"CopyMovieSettings", (PyCFunction)MovieObj_CopyMovieSettings, 1,
6265 "(Movie dstMovie) -> None"},
6266 {"ConvertMovieToFile", (PyCFunction)MovieObj_ConvertMovieToFile, 1,
6267 "(Track onlyTrack, FSSpec outputFile, OSType fileType, OSType creator, ScriptCode scriptTag, long flags, ComponentInstance userComp) -> (short resID)"},
6268 {"GetMovieDataSize", (PyCFunction)MovieObj_GetMovieDataSize, 1,
6269 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
Jack Jansen723ad8a2000-12-12 22:10:21 +00006270 {"GetMovieDataSize64", (PyCFunction)MovieObj_GetMovieDataSize64, 1,
6271 "(TimeValue startTime, TimeValue duration) -> (wide dataSize)"},
Jack Jansen453ced51995-11-30 17:42:08 +00006272 {"PtInMovie", (PyCFunction)MovieObj_PtInMovie, 1,
6273 "(Point pt) -> (Boolean _rv)"},
6274 {"SetMovieLanguage", (PyCFunction)MovieObj_SetMovieLanguage, 1,
6275 "(long language) -> None"},
6276 {"GetMovieNextInterestingTime", (PyCFunction)MovieObj_GetMovieNextInterestingTime, 1,
6277 "(short interestingTimeFlags, short numMediaTypes, OSType whichMediaTypes, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
6278 {"AddMovieResource", (PyCFunction)MovieObj_AddMovieResource, 1,
6279 "(short resRefNum, Str255 resName) -> (short resId)"},
6280 {"UpdateMovieResource", (PyCFunction)MovieObj_UpdateMovieResource, 1,
6281 "(short resRefNum, short resId, Str255 resName) -> None"},
6282 {"HasMovieChanged", (PyCFunction)MovieObj_HasMovieChanged, 1,
6283 "() -> (Boolean _rv)"},
6284 {"ClearMovieChanged", (PyCFunction)MovieObj_ClearMovieChanged, 1,
6285 "() -> None"},
6286 {"SetMovieDefaultDataRef", (PyCFunction)MovieObj_SetMovieDefaultDataRef, 1,
6287 "(Handle dataRef, OSType dataRefType) -> None"},
6288 {"GetMovieDefaultDataRef", (PyCFunction)MovieObj_GetMovieDefaultDataRef, 1,
6289 "() -> (Handle dataRef, OSType dataRefType)"},
Jack Jansen723ad8a2000-12-12 22:10:21 +00006290 {"SetMovieAnchorDataRef", (PyCFunction)MovieObj_SetMovieAnchorDataRef, 1,
6291 "(Handle dataRef, OSType dataRefType) -> None"},
6292 {"GetMovieAnchorDataRef", (PyCFunction)MovieObj_GetMovieAnchorDataRef, 1,
6293 "() -> (Handle dataRef, OSType dataRefType, long outFlags)"},
Jack Jansen453ced51995-11-30 17:42:08 +00006294 {"SetMovieColorTable", (PyCFunction)MovieObj_SetMovieColorTable, 1,
6295 "(CTabHandle ctab) -> None"},
6296 {"GetMovieColorTable", (PyCFunction)MovieObj_GetMovieColorTable, 1,
6297 "() -> (CTabHandle ctab)"},
6298 {"FlattenMovie", (PyCFunction)MovieObj_FlattenMovie, 1,
6299 "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, Str255 resName) -> (short resId)"},
6300 {"FlattenMovieData", (PyCFunction)MovieObj_FlattenMovieData, 1,
6301 "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (Movie _rv)"},
6302 {"MovieSearchText", (PyCFunction)MovieObj_MovieSearchText, 1,
6303 "(Ptr text, long size, long searchFlags) -> (Track searchTrack, TimeValue searchTime, long searchOffset)"},
6304 {"GetPosterBox", (PyCFunction)MovieObj_GetPosterBox, 1,
6305 "() -> (Rect boxRect)"},
6306 {"SetPosterBox", (PyCFunction)MovieObj_SetPosterBox, 1,
6307 "(Rect boxRect) -> None"},
6308 {"GetMovieSegmentDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieSegmentDisplayBoundsRgn, 1,
6309 "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
6310 {"GetMovieStatus", (PyCFunction)MovieObj_GetMovieStatus, 1,
6311 "() -> (ComponentResult _rv, Track firstProblemTrack)"},
Jack Jansen723ad8a2000-12-12 22:10:21 +00006312 {"GetMovieLoadState", (PyCFunction)MovieObj_GetMovieLoadState, 1,
6313 "() -> (long _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00006314 {"NewMovieController", (PyCFunction)MovieObj_NewMovieController, 1,
Jack Jansen9cfea101995-12-09 14:05:56 +00006315 "(Rect movieRect, long someFlags) -> (MovieController _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00006316 {"PutMovieOnScrap", (PyCFunction)MovieObj_PutMovieOnScrap, 1,
6317 "(long movieScrapFlags) -> None"},
6318 {"SetMoviePlayHints", (PyCFunction)MovieObj_SetMoviePlayHints, 1,
6319 "(long flags, long flagsMask) -> None"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00006320 {"GetMaxLoadedTimeInMovie", (PyCFunction)MovieObj_GetMaxLoadedTimeInMovie, 1,
6321 "() -> (TimeValue time)"},
6322 {"QTMovieNeedsTimeTable", (PyCFunction)MovieObj_QTMovieNeedsTimeTable, 1,
6323 "() -> (Boolean needsTimeTable)"},
6324 {"QTGetDataRefMaxFileOffset", (PyCFunction)MovieObj_QTGetDataRefMaxFileOffset, 1,
6325 "(OSType dataRefType, Handle dataRef) -> (long offset)"},
Jack Jansen453ced51995-11-30 17:42:08 +00006326 {NULL, NULL, 0}
6327};
6328
6329PyMethodChain MovieObj_chain = { MovieObj_methods, NULL };
6330
6331static PyObject *MovieObj_getattr(self, name)
6332 MovieObject *self;
6333 char *name;
6334{
6335 return Py_FindMethodInChain(&MovieObj_chain, (PyObject *)self, name);
6336}
6337
6338#define MovieObj_setattr NULL
6339
Jack Jansena05ac601999-12-12 21:41:51 +00006340#define MovieObj_compare NULL
6341
6342#define MovieObj_repr NULL
6343
6344#define MovieObj_hash NULL
6345
Jack Jansen453ced51995-11-30 17:42:08 +00006346PyTypeObject Movie_Type = {
6347 PyObject_HEAD_INIT(&PyType_Type)
6348 0, /*ob_size*/
6349 "Movie", /*tp_name*/
6350 sizeof(MovieObject), /*tp_basicsize*/
6351 0, /*tp_itemsize*/
6352 /* methods */
6353 (destructor) MovieObj_dealloc, /*tp_dealloc*/
6354 0, /*tp_print*/
6355 (getattrfunc) MovieObj_getattr, /*tp_getattr*/
6356 (setattrfunc) MovieObj_setattr, /*tp_setattr*/
Jack Jansena05ac601999-12-12 21:41:51 +00006357 (cmpfunc) MovieObj_compare, /*tp_compare*/
6358 (reprfunc) MovieObj_repr, /*tp_repr*/
6359 (PyNumberMethods *)0, /* tp_as_number */
6360 (PySequenceMethods *)0, /* tp_as_sequence */
6361 (PyMappingMethods *)0, /* tp_as_mapping */
6362 (hashfunc) MovieObj_hash, /*tp_hash*/
Jack Jansen453ced51995-11-30 17:42:08 +00006363};
6364
6365/* --------------------- End object type Movie ---------------------- */
6366
6367
Jack Jansen74a1e632000-07-14 22:37:27 +00006368#if !TARGET_API_MAC_CARBON
Jack Jansen8d929ae2000-06-21 22:07:06 +00006369
Jack Jansena05ac601999-12-12 21:41:51 +00006370static PyObject *Qt_CheckQuickTimeRegistration(_self, _args)
6371 PyObject *_self;
6372 PyObject *_args;
6373{
6374 PyObject *_res = NULL;
6375 void * registrationKey;
6376 long flags;
6377 if (!PyArg_ParseTuple(_args, "sl",
6378 &registrationKey,
6379 &flags))
6380 return NULL;
6381 CheckQuickTimeRegistration(registrationKey,
6382 flags);
6383 Py_INCREF(Py_None);
6384 _res = Py_None;
6385 return _res;
6386}
Jack Jansen8d929ae2000-06-21 22:07:06 +00006387#endif
Jack Jansena05ac601999-12-12 21:41:51 +00006388
Jack Jansen453ced51995-11-30 17:42:08 +00006389static PyObject *Qt_EnterMovies(_self, _args)
6390 PyObject *_self;
6391 PyObject *_args;
6392{
6393 PyObject *_res = NULL;
6394 OSErr _err;
6395 if (!PyArg_ParseTuple(_args, ""))
6396 return NULL;
6397 _err = EnterMovies();
6398 if (_err != noErr) return PyMac_Error(_err);
6399 Py_INCREF(Py_None);
6400 _res = Py_None;
6401 return _res;
6402}
6403
6404static PyObject *Qt_ExitMovies(_self, _args)
6405 PyObject *_self;
6406 PyObject *_args;
6407{
6408 PyObject *_res = NULL;
6409 if (!PyArg_ParseTuple(_args, ""))
6410 return NULL;
6411 ExitMovies();
6412 Py_INCREF(Py_None);
6413 _res = Py_None;
6414 return _res;
6415}
6416
6417static PyObject *Qt_GetMoviesError(_self, _args)
6418 PyObject *_self;
6419 PyObject *_args;
6420{
6421 PyObject *_res = NULL;
6422 OSErr _err;
6423 if (!PyArg_ParseTuple(_args, ""))
6424 return NULL;
6425 _err = GetMoviesError();
6426 if (_err != noErr) return PyMac_Error(_err);
6427 Py_INCREF(Py_None);
6428 _res = Py_None;
6429 return _res;
6430}
6431
6432static PyObject *Qt_ClearMoviesStickyError(_self, _args)
6433 PyObject *_self;
6434 PyObject *_args;
6435{
6436 PyObject *_res = NULL;
6437 if (!PyArg_ParseTuple(_args, ""))
6438 return NULL;
6439 ClearMoviesStickyError();
6440 Py_INCREF(Py_None);
6441 _res = Py_None;
6442 return _res;
6443}
6444
6445static PyObject *Qt_GetMoviesStickyError(_self, _args)
6446 PyObject *_self;
6447 PyObject *_args;
6448{
6449 PyObject *_res = NULL;
6450 OSErr _err;
6451 if (!PyArg_ParseTuple(_args, ""))
6452 return NULL;
6453 _err = GetMoviesStickyError();
6454 if (_err != noErr) return PyMac_Error(_err);
6455 Py_INCREF(Py_None);
6456 _res = Py_None;
6457 return _res;
6458}
6459
6460static PyObject *Qt_DisposeMatte(_self, _args)
6461 PyObject *_self;
6462 PyObject *_args;
6463{
6464 PyObject *_res = NULL;
6465 PixMapHandle theMatte;
6466 if (!PyArg_ParseTuple(_args, "O&",
6467 ResObj_Convert, &theMatte))
6468 return NULL;
6469 DisposeMatte(theMatte);
6470 Py_INCREF(Py_None);
6471 _res = Py_None;
6472 return _res;
6473}
6474
6475static PyObject *Qt_NewMovie(_self, _args)
6476 PyObject *_self;
6477 PyObject *_args;
6478{
6479 PyObject *_res = NULL;
6480 Movie _rv;
6481 long flags;
6482 if (!PyArg_ParseTuple(_args, "l",
6483 &flags))
6484 return NULL;
6485 _rv = NewMovie(flags);
6486 _res = Py_BuildValue("O&",
6487 MovieObj_New, _rv);
6488 return _res;
6489}
6490
6491static PyObject *Qt_GetDataHandler(_self, _args)
6492 PyObject *_self;
6493 PyObject *_args;
6494{
6495 PyObject *_res = NULL;
6496 Component _rv;
6497 Handle dataRef;
6498 OSType dataHandlerSubType;
6499 long flags;
6500 if (!PyArg_ParseTuple(_args, "O&O&l",
6501 ResObj_Convert, &dataRef,
6502 PyMac_GetOSType, &dataHandlerSubType,
6503 &flags))
6504 return NULL;
6505 _rv = GetDataHandler(dataRef,
6506 dataHandlerSubType,
6507 flags);
6508 _res = Py_BuildValue("O&",
6509 CmpObj_New, _rv);
6510 return _res;
6511}
6512
Jack Jansen723ad8a2000-12-12 22:10:21 +00006513static PyObject *Qt_OpenADataHandler(_self, _args)
6514 PyObject *_self;
6515 PyObject *_args;
6516{
6517 PyObject *_res = NULL;
6518 OSErr _err;
6519 Handle dataRef;
6520 OSType dataHandlerSubType;
6521 Handle anchorDataRef;
6522 OSType anchorDataRefType;
6523 TimeBase tb;
6524 long flags;
6525 ComponentInstance dh;
6526 if (!PyArg_ParseTuple(_args, "O&O&O&O&O&l",
6527 ResObj_Convert, &dataRef,
6528 PyMac_GetOSType, &dataHandlerSubType,
6529 ResObj_Convert, &anchorDataRef,
6530 PyMac_GetOSType, &anchorDataRefType,
6531 TimeBaseObj_Convert, &tb,
6532 &flags))
6533 return NULL;
6534 _err = OpenADataHandler(dataRef,
6535 dataHandlerSubType,
6536 anchorDataRef,
6537 anchorDataRefType,
6538 tb,
6539 flags,
6540 &dh);
6541 if (_err != noErr) return PyMac_Error(_err);
6542 _res = Py_BuildValue("O&",
6543 CmpInstObj_New, dh);
6544 return _res;
6545}
6546
Jack Jansen453ced51995-11-30 17:42:08 +00006547static PyObject *Qt_PasteHandleIntoMovie(_self, _args)
6548 PyObject *_self;
6549 PyObject *_args;
6550{
6551 PyObject *_res = NULL;
6552 OSErr _err;
6553 Handle h;
6554 OSType handleType;
6555 Movie theMovie;
6556 long flags;
6557 ComponentInstance userComp;
6558 if (!PyArg_ParseTuple(_args, "O&O&O&lO&",
6559 ResObj_Convert, &h,
6560 PyMac_GetOSType, &handleType,
6561 MovieObj_Convert, &theMovie,
6562 &flags,
6563 CmpInstObj_Convert, &userComp))
6564 return NULL;
6565 _err = PasteHandleIntoMovie(h,
6566 handleType,
6567 theMovie,
6568 flags,
6569 userComp);
6570 if (_err != noErr) return PyMac_Error(_err);
6571 Py_INCREF(Py_None);
6572 _res = Py_None;
6573 return _res;
6574}
6575
Jack Jansen1c4e6141998-04-21 15:23:55 +00006576static PyObject *Qt_GetMovieImporterForDataRef(_self, _args)
6577 PyObject *_self;
6578 PyObject *_args;
6579{
6580 PyObject *_res = NULL;
6581 OSErr _err;
6582 OSType dataRefType;
6583 Handle dataRef;
6584 long flags;
6585 Component importer;
6586 if (!PyArg_ParseTuple(_args, "O&O&l",
6587 PyMac_GetOSType, &dataRefType,
6588 ResObj_Convert, &dataRef,
6589 &flags))
6590 return NULL;
6591 _err = GetMovieImporterForDataRef(dataRefType,
6592 dataRef,
6593 flags,
6594 &importer);
6595 if (_err != noErr) return PyMac_Error(_err);
6596 _res = Py_BuildValue("O&",
6597 CmpObj_New, importer);
6598 return _res;
6599}
6600
Jack Jansen453ced51995-11-30 17:42:08 +00006601static PyObject *Qt_TrackTimeToMediaTime(_self, _args)
6602 PyObject *_self;
6603 PyObject *_args;
6604{
6605 PyObject *_res = NULL;
6606 TimeValue _rv;
6607 TimeValue value;
6608 Track theTrack;
6609 if (!PyArg_ParseTuple(_args, "lO&",
6610 &value,
6611 TrackObj_Convert, &theTrack))
6612 return NULL;
6613 _rv = TrackTimeToMediaTime(value,
6614 theTrack);
6615 _res = Py_BuildValue("l",
6616 _rv);
6617 return _res;
6618}
6619
6620static PyObject *Qt_NewUserData(_self, _args)
6621 PyObject *_self;
6622 PyObject *_args;
6623{
6624 PyObject *_res = NULL;
6625 OSErr _err;
6626 UserData theUserData;
6627 if (!PyArg_ParseTuple(_args, ""))
6628 return NULL;
6629 _err = NewUserData(&theUserData);
6630 if (_err != noErr) return PyMac_Error(_err);
6631 _res = Py_BuildValue("O&",
6632 UserDataObj_New, theUserData);
6633 return _res;
6634}
6635
6636static PyObject *Qt_NewUserDataFromHandle(_self, _args)
6637 PyObject *_self;
6638 PyObject *_args;
6639{
6640 PyObject *_res = NULL;
6641 OSErr _err;
6642 Handle h;
6643 UserData theUserData;
6644 if (!PyArg_ParseTuple(_args, "O&",
6645 ResObj_Convert, &h))
6646 return NULL;
6647 _err = NewUserDataFromHandle(h,
6648 &theUserData);
6649 if (_err != noErr) return PyMac_Error(_err);
6650 _res = Py_BuildValue("O&",
6651 UserDataObj_New, theUserData);
6652 return _res;
6653}
6654
6655static PyObject *Qt_CreateMovieFile(_self, _args)
6656 PyObject *_self;
6657 PyObject *_args;
6658{
6659 PyObject *_res = NULL;
6660 OSErr _err;
6661 FSSpec fileSpec;
6662 OSType creator;
6663 ScriptCode scriptTag;
6664 long createMovieFileFlags;
6665 short resRefNum;
6666 Movie newmovie;
6667 if (!PyArg_ParseTuple(_args, "O&O&hl",
6668 PyMac_GetFSSpec, &fileSpec,
6669 PyMac_GetOSType, &creator,
6670 &scriptTag,
6671 &createMovieFileFlags))
6672 return NULL;
6673 _err = CreateMovieFile(&fileSpec,
6674 creator,
6675 scriptTag,
6676 createMovieFileFlags,
6677 &resRefNum,
6678 &newmovie);
6679 if (_err != noErr) return PyMac_Error(_err);
6680 _res = Py_BuildValue("hO&",
6681 resRefNum,
6682 MovieObj_New, newmovie);
6683 return _res;
6684}
6685
6686static PyObject *Qt_OpenMovieFile(_self, _args)
6687 PyObject *_self;
6688 PyObject *_args;
6689{
6690 PyObject *_res = NULL;
6691 OSErr _err;
6692 FSSpec fileSpec;
6693 short resRefNum;
6694 SInt8 permission;
6695 if (!PyArg_ParseTuple(_args, "O&b",
6696 PyMac_GetFSSpec, &fileSpec,
6697 &permission))
6698 return NULL;
6699 _err = OpenMovieFile(&fileSpec,
6700 &resRefNum,
6701 permission);
6702 if (_err != noErr) return PyMac_Error(_err);
6703 _res = Py_BuildValue("h",
6704 resRefNum);
6705 return _res;
6706}
6707
6708static PyObject *Qt_CloseMovieFile(_self, _args)
6709 PyObject *_self;
6710 PyObject *_args;
6711{
6712 PyObject *_res = NULL;
6713 OSErr _err;
6714 short resRefNum;
6715 if (!PyArg_ParseTuple(_args, "h",
6716 &resRefNum))
6717 return NULL;
6718 _err = CloseMovieFile(resRefNum);
6719 if (_err != noErr) return PyMac_Error(_err);
6720 Py_INCREF(Py_None);
6721 _res = Py_None;
6722 return _res;
6723}
6724
6725static PyObject *Qt_DeleteMovieFile(_self, _args)
6726 PyObject *_self;
6727 PyObject *_args;
6728{
6729 PyObject *_res = NULL;
6730 OSErr _err;
6731 FSSpec fileSpec;
6732 if (!PyArg_ParseTuple(_args, "O&",
6733 PyMac_GetFSSpec, &fileSpec))
6734 return NULL;
6735 _err = DeleteMovieFile(&fileSpec);
6736 if (_err != noErr) return PyMac_Error(_err);
6737 Py_INCREF(Py_None);
6738 _res = Py_None;
6739 return _res;
6740}
6741
6742static PyObject *Qt_NewMovieFromFile(_self, _args)
6743 PyObject *_self;
6744 PyObject *_args;
6745{
6746 PyObject *_res = NULL;
6747 OSErr _err;
6748 Movie theMovie;
6749 short resRefNum;
Jack Jansene0cf87b1997-04-09 15:53:46 +00006750 short resId;
Jack Jansen453ced51995-11-30 17:42:08 +00006751 short newMovieFlags;
6752 Boolean dataRefWasChanged;
Jack Jansene0cf87b1997-04-09 15:53:46 +00006753 if (!PyArg_ParseTuple(_args, "hhh",
Jack Jansen453ced51995-11-30 17:42:08 +00006754 &resRefNum,
Jack Jansene0cf87b1997-04-09 15:53:46 +00006755 &resId,
Jack Jansen453ced51995-11-30 17:42:08 +00006756 &newMovieFlags))
6757 return NULL;
6758 _err = NewMovieFromFile(&theMovie,
6759 resRefNum,
Jack Jansene0cf87b1997-04-09 15:53:46 +00006760 &resId,
Jack Jansen9cfea101995-12-09 14:05:56 +00006761 (StringPtr)0,
Jack Jansen453ced51995-11-30 17:42:08 +00006762 newMovieFlags,
6763 &dataRefWasChanged);
6764 if (_err != noErr) return PyMac_Error(_err);
Jack Jansene0cf87b1997-04-09 15:53:46 +00006765 _res = Py_BuildValue("O&hb",
Jack Jansen453ced51995-11-30 17:42:08 +00006766 MovieObj_New, theMovie,
Jack Jansene0cf87b1997-04-09 15:53:46 +00006767 resId,
Jack Jansen453ced51995-11-30 17:42:08 +00006768 dataRefWasChanged);
6769 return _res;
6770}
6771
6772static PyObject *Qt_NewMovieFromHandle(_self, _args)
6773 PyObject *_self;
6774 PyObject *_args;
6775{
6776 PyObject *_res = NULL;
6777 OSErr _err;
6778 Movie theMovie;
6779 Handle h;
6780 short newMovieFlags;
6781 Boolean dataRefWasChanged;
6782 if (!PyArg_ParseTuple(_args, "O&h",
6783 ResObj_Convert, &h,
6784 &newMovieFlags))
6785 return NULL;
6786 _err = NewMovieFromHandle(&theMovie,
6787 h,
6788 newMovieFlags,
6789 &dataRefWasChanged);
6790 if (_err != noErr) return PyMac_Error(_err);
6791 _res = Py_BuildValue("O&b",
6792 MovieObj_New, theMovie,
6793 dataRefWasChanged);
6794 return _res;
6795}
6796
6797static PyObject *Qt_NewMovieFromDataFork(_self, _args)
6798 PyObject *_self;
6799 PyObject *_args;
6800{
6801 PyObject *_res = NULL;
6802 OSErr _err;
6803 Movie theMovie;
6804 short fRefNum;
6805 long fileOffset;
6806 short newMovieFlags;
6807 Boolean dataRefWasChanged;
6808 if (!PyArg_ParseTuple(_args, "hlh",
6809 &fRefNum,
6810 &fileOffset,
6811 &newMovieFlags))
6812 return NULL;
6813 _err = NewMovieFromDataFork(&theMovie,
6814 fRefNum,
6815 fileOffset,
6816 newMovieFlags,
6817 &dataRefWasChanged);
6818 if (_err != noErr) return PyMac_Error(_err);
6819 _res = Py_BuildValue("O&b",
6820 MovieObj_New, theMovie,
6821 dataRefWasChanged);
6822 return _res;
6823}
6824
Jack Jansen723ad8a2000-12-12 22:10:21 +00006825static PyObject *Qt_NewMovieFromDataFork64(_self, _args)
6826 PyObject *_self;
6827 PyObject *_args;
6828{
6829 PyObject *_res = NULL;
6830 OSErr _err;
6831 Movie theMovie;
6832 long fRefNum;
6833 wide fileOffset;
6834 short newMovieFlags;
6835 Boolean dataRefWasChanged;
6836 if (!PyArg_ParseTuple(_args, "lO&h",
6837 &fRefNum,
6838 PyMac_Getwide, &fileOffset,
6839 &newMovieFlags))
6840 return NULL;
6841 _err = NewMovieFromDataFork64(&theMovie,
6842 fRefNum,
6843 &fileOffset,
6844 newMovieFlags,
6845 &dataRefWasChanged);
6846 if (_err != noErr) return PyMac_Error(_err);
6847 _res = Py_BuildValue("O&b",
6848 MovieObj_New, theMovie,
6849 dataRefWasChanged);
6850 return _res;
6851}
6852
Jack Jansen1c4e6141998-04-21 15:23:55 +00006853static PyObject *Qt_NewMovieFromDataRef(_self, _args)
6854 PyObject *_self;
6855 PyObject *_args;
6856{
6857 PyObject *_res = NULL;
6858 OSErr _err;
6859 Movie m;
6860 short flags;
6861 short id;
6862 Handle dataRef;
6863 OSType dataRefType;
6864 if (!PyArg_ParseTuple(_args, "hO&O&",
6865 &flags,
6866 ResObj_Convert, &dataRef,
6867 PyMac_GetOSType, &dataRefType))
6868 return NULL;
6869 _err = NewMovieFromDataRef(&m,
6870 flags,
6871 &id,
6872 dataRef,
6873 dataRefType);
6874 if (_err != noErr) return PyMac_Error(_err);
6875 _res = Py_BuildValue("O&h",
6876 MovieObj_New, m,
6877 id);
6878 return _res;
6879}
6880
Jack Jansen453ced51995-11-30 17:42:08 +00006881static PyObject *Qt_RemoveMovieResource(_self, _args)
6882 PyObject *_self;
6883 PyObject *_args;
6884{
6885 PyObject *_res = NULL;
6886 OSErr _err;
6887 short resRefNum;
6888 short resId;
6889 if (!PyArg_ParseTuple(_args, "hh",
6890 &resRefNum,
6891 &resId))
6892 return NULL;
6893 _err = RemoveMovieResource(resRefNum,
6894 resId);
6895 if (_err != noErr) return PyMac_Error(_err);
6896 Py_INCREF(Py_None);
6897 _res = Py_None;
6898 return _res;
6899}
6900
Jack Jansen723ad8a2000-12-12 22:10:21 +00006901static PyObject *Qt_CreateShortcutMovieFile(_self, _args)
6902 PyObject *_self;
6903 PyObject *_args;
6904{
6905 PyObject *_res = NULL;
6906 OSErr _err;
6907 FSSpec fileSpec;
6908 OSType creator;
6909 ScriptCode scriptTag;
6910 long createMovieFileFlags;
6911 Handle targetDataRef;
6912 OSType targetDataRefType;
6913 if (!PyArg_ParseTuple(_args, "O&O&hlO&O&",
6914 PyMac_GetFSSpec, &fileSpec,
6915 PyMac_GetOSType, &creator,
6916 &scriptTag,
6917 &createMovieFileFlags,
6918 ResObj_Convert, &targetDataRef,
6919 PyMac_GetOSType, &targetDataRefType))
6920 return NULL;
6921 _err = CreateShortcutMovieFile(&fileSpec,
6922 creator,
6923 scriptTag,
6924 createMovieFileFlags,
6925 targetDataRef,
6926 targetDataRefType);
6927 if (_err != noErr) return PyMac_Error(_err);
6928 Py_INCREF(Py_None);
6929 _res = Py_None;
6930 return _res;
6931}
6932
Jack Jansen453ced51995-11-30 17:42:08 +00006933static PyObject *Qt_NewMovieFromScrap(_self, _args)
6934 PyObject *_self;
6935 PyObject *_args;
6936{
6937 PyObject *_res = NULL;
6938 Movie _rv;
6939 long newMovieFlags;
6940 if (!PyArg_ParseTuple(_args, "l",
6941 &newMovieFlags))
6942 return NULL;
6943 _rv = NewMovieFromScrap(newMovieFlags);
6944 _res = Py_BuildValue("O&",
6945 MovieObj_New, _rv);
6946 return _res;
6947}
6948
Jack Jansen1c4e6141998-04-21 15:23:55 +00006949static PyObject *Qt_QTNewAlias(_self, _args)
6950 PyObject *_self;
6951 PyObject *_args;
6952{
6953 PyObject *_res = NULL;
6954 OSErr _err;
6955 FSSpec fss;
6956 AliasHandle alias;
6957 Boolean minimal;
6958 if (!PyArg_ParseTuple(_args, "O&b",
6959 PyMac_GetFSSpec, &fss,
6960 &minimal))
6961 return NULL;
6962 _err = QTNewAlias(&fss,
6963 &alias,
6964 minimal);
6965 if (_err != noErr) return PyMac_Error(_err);
6966 _res = Py_BuildValue("O&",
6967 ResObj_New, alias);
6968 return _res;
6969}
6970
6971static PyObject *Qt_EndFullScreen(_self, _args)
6972 PyObject *_self;
6973 PyObject *_args;
6974{
6975 PyObject *_res = NULL;
6976 OSErr _err;
6977 Ptr fullState;
6978 long flags;
6979 if (!PyArg_ParseTuple(_args, "sl",
6980 &fullState,
6981 &flags))
6982 return NULL;
6983 _err = EndFullScreen(fullState,
6984 flags);
6985 if (_err != noErr) return PyMac_Error(_err);
6986 Py_INCREF(Py_None);
6987 _res = Py_None;
6988 return _res;
6989}
6990
6991static PyObject *Qt_AddSoundDescriptionExtension(_self, _args)
6992 PyObject *_self;
6993 PyObject *_args;
6994{
6995 PyObject *_res = NULL;
6996 OSErr _err;
6997 SoundDescriptionHandle desc;
6998 Handle extension;
6999 OSType idType;
7000 if (!PyArg_ParseTuple(_args, "O&O&O&",
7001 ResObj_Convert, &desc,
7002 ResObj_Convert, &extension,
7003 PyMac_GetOSType, &idType))
7004 return NULL;
7005 _err = AddSoundDescriptionExtension(desc,
7006 extension,
7007 idType);
7008 if (_err != noErr) return PyMac_Error(_err);
7009 Py_INCREF(Py_None);
7010 _res = Py_None;
7011 return _res;
7012}
7013
7014static PyObject *Qt_GetSoundDescriptionExtension(_self, _args)
7015 PyObject *_self;
7016 PyObject *_args;
7017{
7018 PyObject *_res = NULL;
7019 OSErr _err;
7020 SoundDescriptionHandle desc;
7021 Handle extension;
7022 OSType idType;
7023 if (!PyArg_ParseTuple(_args, "O&O&",
7024 ResObj_Convert, &desc,
7025 PyMac_GetOSType, &idType))
7026 return NULL;
7027 _err = GetSoundDescriptionExtension(desc,
7028 &extension,
7029 idType);
7030 if (_err != noErr) return PyMac_Error(_err);
7031 _res = Py_BuildValue("O&",
7032 ResObj_New, extension);
7033 return _res;
7034}
7035
7036static PyObject *Qt_RemoveSoundDescriptionExtension(_self, _args)
7037 PyObject *_self;
7038 PyObject *_args;
7039{
7040 PyObject *_res = NULL;
7041 OSErr _err;
7042 SoundDescriptionHandle desc;
7043 OSType idType;
7044 if (!PyArg_ParseTuple(_args, "O&O&",
7045 ResObj_Convert, &desc,
7046 PyMac_GetOSType, &idType))
7047 return NULL;
7048 _err = RemoveSoundDescriptionExtension(desc,
7049 idType);
7050 if (_err != noErr) return PyMac_Error(_err);
7051 Py_INCREF(Py_None);
7052 _res = Py_None;
7053 return _res;
7054}
7055
7056static PyObject *Qt_QTIsStandardParameterDialogEvent(_self, _args)
7057 PyObject *_self;
7058 PyObject *_args;
7059{
7060 PyObject *_res = NULL;
7061 OSErr _err;
7062 EventRecord pEvent;
7063 QTParameterDialog createdDialog;
7064 if (!PyArg_ParseTuple(_args, "l",
7065 &createdDialog))
7066 return NULL;
7067 _err = QTIsStandardParameterDialogEvent(&pEvent,
7068 createdDialog);
7069 if (_err != noErr) return PyMac_Error(_err);
7070 _res = Py_BuildValue("O&",
7071 PyMac_BuildEventRecord, &pEvent);
7072 return _res;
7073}
7074
7075static PyObject *Qt_QTDismissStandardParameterDialog(_self, _args)
7076 PyObject *_self;
7077 PyObject *_args;
7078{
7079 PyObject *_res = NULL;
7080 OSErr _err;
7081 QTParameterDialog createdDialog;
7082 if (!PyArg_ParseTuple(_args, "l",
7083 &createdDialog))
7084 return NULL;
7085 _err = QTDismissStandardParameterDialog(createdDialog);
7086 if (_err != noErr) return PyMac_Error(_err);
7087 Py_INCREF(Py_None);
7088 _res = Py_None;
7089 return _res;
7090}
7091
7092static PyObject *Qt_QTStandardParameterDialogDoAction(_self, _args)
7093 PyObject *_self;
7094 PyObject *_args;
7095{
7096 PyObject *_res = NULL;
7097 OSErr _err;
7098 QTParameterDialog createdDialog;
7099 long action;
7100 void * params;
7101 if (!PyArg_ParseTuple(_args, "lls",
7102 &createdDialog,
7103 &action,
7104 &params))
7105 return NULL;
7106 _err = QTStandardParameterDialogDoAction(createdDialog,
7107 action,
7108 params);
7109 if (_err != noErr) return PyMac_Error(_err);
7110 Py_INCREF(Py_None);
7111 _res = Py_None;
7112 return _res;
7113}
7114
7115static PyObject *Qt_QTRegisterAccessKey(_self, _args)
7116 PyObject *_self;
7117 PyObject *_args;
7118{
7119 PyObject *_res = NULL;
7120 OSErr _err;
7121 Str255 accessKeyType;
7122 long flags;
7123 Handle accessKey;
7124 if (!PyArg_ParseTuple(_args, "O&lO&",
7125 PyMac_GetStr255, accessKeyType,
7126 &flags,
7127 ResObj_Convert, &accessKey))
7128 return NULL;
7129 _err = QTRegisterAccessKey(accessKeyType,
7130 flags,
7131 accessKey);
7132 if (_err != noErr) return PyMac_Error(_err);
7133 Py_INCREF(Py_None);
7134 _res = Py_None;
7135 return _res;
7136}
7137
7138static PyObject *Qt_QTUnregisterAccessKey(_self, _args)
7139 PyObject *_self;
7140 PyObject *_args;
7141{
7142 PyObject *_res = NULL;
7143 OSErr _err;
7144 Str255 accessKeyType;
7145 long flags;
7146 Handle accessKey;
7147 if (!PyArg_ParseTuple(_args, "O&lO&",
7148 PyMac_GetStr255, accessKeyType,
7149 &flags,
7150 ResObj_Convert, &accessKey))
7151 return NULL;
7152 _err = QTUnregisterAccessKey(accessKeyType,
7153 flags,
7154 accessKey);
7155 if (_err != noErr) return PyMac_Error(_err);
7156 Py_INCREF(Py_None);
7157 _res = Py_None;
7158 return _res;
7159}
7160
7161static PyObject *Qt_QTTextToNativeText(_self, _args)
7162 PyObject *_self;
7163 PyObject *_args;
7164{
7165 PyObject *_res = NULL;
7166 OSErr _err;
7167 Handle theText;
7168 long encoding;
7169 long flags;
7170 if (!PyArg_ParseTuple(_args, "O&ll",
7171 ResObj_Convert, &theText,
7172 &encoding,
7173 &flags))
7174 return NULL;
7175 _err = QTTextToNativeText(theText,
7176 encoding,
7177 flags);
7178 if (_err != noErr) return PyMac_Error(_err);
7179 Py_INCREF(Py_None);
7180 _res = Py_None;
7181 return _res;
7182}
7183
7184static PyObject *Qt_VideoMediaResetStatistics(_self, _args)
7185 PyObject *_self;
7186 PyObject *_args;
7187{
7188 PyObject *_res = NULL;
7189 ComponentResult _rv;
7190 MediaHandler mh;
7191 if (!PyArg_ParseTuple(_args, "O&",
7192 CmpInstObj_Convert, &mh))
7193 return NULL;
7194 _rv = VideoMediaResetStatistics(mh);
7195 _res = Py_BuildValue("l",
7196 _rv);
7197 return _res;
7198}
7199
7200static PyObject *Qt_VideoMediaGetStatistics(_self, _args)
7201 PyObject *_self;
7202 PyObject *_args;
7203{
7204 PyObject *_res = NULL;
7205 ComponentResult _rv;
7206 MediaHandler mh;
7207 if (!PyArg_ParseTuple(_args, "O&",
7208 CmpInstObj_Convert, &mh))
7209 return NULL;
7210 _rv = VideoMediaGetStatistics(mh);
7211 _res = Py_BuildValue("l",
7212 _rv);
7213 return _res;
7214}
7215
Jack Jansena05ac601999-12-12 21:41:51 +00007216static PyObject *Qt_VideoMediaGetStallCount(_self, _args)
7217 PyObject *_self;
7218 PyObject *_args;
7219{
7220 PyObject *_res = NULL;
7221 ComponentResult _rv;
7222 MediaHandler mh;
7223 unsigned long stalls;
7224 if (!PyArg_ParseTuple(_args, "O&",
7225 CmpInstObj_Convert, &mh))
7226 return NULL;
7227 _rv = VideoMediaGetStallCount(mh,
7228 &stalls);
7229 _res = Py_BuildValue("ll",
7230 _rv,
7231 stalls);
7232 return _res;
7233}
7234
Jack Jansen723ad8a2000-12-12 22:10:21 +00007235static PyObject *Qt_VideoMediaSetCodecParameter(_self, _args)
7236 PyObject *_self;
7237 PyObject *_args;
7238{
7239 PyObject *_res = NULL;
7240 ComponentResult _rv;
7241 MediaHandler mh;
7242 CodecType cType;
7243 OSType parameterID;
7244 long parameterChangeSeed;
7245 void * dataPtr;
7246 long dataSize;
7247 if (!PyArg_ParseTuple(_args, "O&O&O&lsl",
7248 CmpInstObj_Convert, &mh,
7249 PyMac_GetOSType, &cType,
7250 PyMac_GetOSType, &parameterID,
7251 &parameterChangeSeed,
7252 &dataPtr,
7253 &dataSize))
7254 return NULL;
7255 _rv = VideoMediaSetCodecParameter(mh,
7256 cType,
7257 parameterID,
7258 parameterChangeSeed,
7259 dataPtr,
7260 dataSize);
7261 _res = Py_BuildValue("l",
7262 _rv);
7263 return _res;
7264}
7265
7266static PyObject *Qt_VideoMediaGetCodecParameter(_self, _args)
7267 PyObject *_self;
7268 PyObject *_args;
7269{
7270 PyObject *_res = NULL;
7271 ComponentResult _rv;
7272 MediaHandler mh;
7273 CodecType cType;
7274 OSType parameterID;
7275 Handle outParameterData;
7276 if (!PyArg_ParseTuple(_args, "O&O&O&O&",
7277 CmpInstObj_Convert, &mh,
7278 PyMac_GetOSType, &cType,
7279 PyMac_GetOSType, &parameterID,
7280 ResObj_Convert, &outParameterData))
7281 return NULL;
7282 _rv = VideoMediaGetCodecParameter(mh,
7283 cType,
7284 parameterID,
7285 outParameterData);
7286 _res = Py_BuildValue("l",
7287 _rv);
7288 return _res;
7289}
7290
Jack Jansen1c4e6141998-04-21 15:23:55 +00007291static PyObject *Qt_TextMediaAddTextSample(_self, _args)
7292 PyObject *_self;
7293 PyObject *_args;
7294{
7295 PyObject *_res = NULL;
7296 ComponentResult _rv;
7297 MediaHandler mh;
7298 Ptr text;
7299 unsigned long size;
7300 short fontNumber;
7301 short fontSize;
7302 Style textFace;
7303 RGBColor textColor;
7304 RGBColor backColor;
7305 short textJustification;
7306 Rect textBox;
7307 long displayFlags;
7308 TimeValue scrollDelay;
7309 short hiliteStart;
7310 short hiliteEnd;
7311 RGBColor rgbHiliteColor;
7312 TimeValue duration;
7313 TimeValue sampleTime;
7314 if (!PyArg_ParseTuple(_args, "O&slhhbhllhhl",
7315 CmpInstObj_Convert, &mh,
7316 &text,
7317 &size,
7318 &fontNumber,
7319 &fontSize,
7320 &textFace,
7321 &textJustification,
7322 &displayFlags,
7323 &scrollDelay,
7324 &hiliteStart,
7325 &hiliteEnd,
7326 &duration))
7327 return NULL;
7328 _rv = TextMediaAddTextSample(mh,
7329 text,
7330 size,
7331 fontNumber,
7332 fontSize,
7333 textFace,
7334 &textColor,
7335 &backColor,
7336 textJustification,
7337 &textBox,
7338 displayFlags,
7339 scrollDelay,
7340 hiliteStart,
7341 hiliteEnd,
7342 &rgbHiliteColor,
7343 duration,
7344 &sampleTime);
7345 _res = Py_BuildValue("lO&O&O&O&l",
7346 _rv,
7347 QdRGB_New, &textColor,
7348 QdRGB_New, &backColor,
7349 PyMac_BuildRect, &textBox,
7350 QdRGB_New, &rgbHiliteColor,
7351 sampleTime);
7352 return _res;
7353}
7354
7355static PyObject *Qt_TextMediaAddTESample(_self, _args)
7356 PyObject *_self;
7357 PyObject *_args;
7358{
7359 PyObject *_res = NULL;
7360 ComponentResult _rv;
7361 MediaHandler mh;
7362 TEHandle hTE;
7363 RGBColor backColor;
7364 short textJustification;
7365 Rect textBox;
7366 long displayFlags;
7367 TimeValue scrollDelay;
7368 short hiliteStart;
7369 short hiliteEnd;
7370 RGBColor rgbHiliteColor;
7371 TimeValue duration;
7372 TimeValue sampleTime;
7373 if (!PyArg_ParseTuple(_args, "O&O&hllhhl",
7374 CmpInstObj_Convert, &mh,
7375 ResObj_Convert, &hTE,
7376 &textJustification,
7377 &displayFlags,
7378 &scrollDelay,
7379 &hiliteStart,
7380 &hiliteEnd,
7381 &duration))
7382 return NULL;
7383 _rv = TextMediaAddTESample(mh,
7384 hTE,
7385 &backColor,
7386 textJustification,
7387 &textBox,
7388 displayFlags,
7389 scrollDelay,
7390 hiliteStart,
7391 hiliteEnd,
7392 &rgbHiliteColor,
7393 duration,
7394 &sampleTime);
7395 _res = Py_BuildValue("lO&O&O&l",
7396 _rv,
7397 QdRGB_New, &backColor,
7398 PyMac_BuildRect, &textBox,
7399 QdRGB_New, &rgbHiliteColor,
7400 sampleTime);
7401 return _res;
7402}
7403
7404static PyObject *Qt_TextMediaAddHiliteSample(_self, _args)
7405 PyObject *_self;
7406 PyObject *_args;
7407{
7408 PyObject *_res = NULL;
7409 ComponentResult _rv;
7410 MediaHandler mh;
7411 short hiliteStart;
7412 short hiliteEnd;
7413 RGBColor rgbHiliteColor;
7414 TimeValue duration;
7415 TimeValue sampleTime;
7416 if (!PyArg_ParseTuple(_args, "O&hhl",
7417 CmpInstObj_Convert, &mh,
7418 &hiliteStart,
7419 &hiliteEnd,
7420 &duration))
7421 return NULL;
7422 _rv = TextMediaAddHiliteSample(mh,
7423 hiliteStart,
7424 hiliteEnd,
7425 &rgbHiliteColor,
7426 duration,
7427 &sampleTime);
7428 _res = Py_BuildValue("lO&l",
7429 _rv,
7430 QdRGB_New, &rgbHiliteColor,
7431 sampleTime);
7432 return _res;
7433}
7434
Jack Jansen723ad8a2000-12-12 22:10:21 +00007435static PyObject *Qt_TextMediaDrawRaw(_self, _args)
7436 PyObject *_self;
7437 PyObject *_args;
7438{
7439 PyObject *_res = NULL;
7440 ComponentResult _rv;
7441 MediaHandler mh;
7442 GWorldPtr gw;
7443 GDHandle gd;
7444 void * data;
7445 long dataSize;
7446 TextDescriptionHandle tdh;
7447 if (!PyArg_ParseTuple(_args, "O&O&O&slO&",
7448 CmpInstObj_Convert, &mh,
7449 GWorldObj_Convert, &gw,
7450 OptResObj_Convert, &gd,
7451 &data,
7452 &dataSize,
7453 ResObj_Convert, &tdh))
7454 return NULL;
7455 _rv = TextMediaDrawRaw(mh,
7456 gw,
7457 gd,
7458 data,
7459 dataSize,
7460 tdh);
7461 _res = Py_BuildValue("l",
7462 _rv);
7463 return _res;
7464}
7465
7466static PyObject *Qt_TextMediaSetTextProperty(_self, _args)
7467 PyObject *_self;
7468 PyObject *_args;
7469{
7470 PyObject *_res = NULL;
7471 ComponentResult _rv;
7472 MediaHandler mh;
7473 TimeValue atMediaTime;
7474 long propertyType;
7475 void * data;
7476 long dataSize;
7477 if (!PyArg_ParseTuple(_args, "O&llsl",
7478 CmpInstObj_Convert, &mh,
7479 &atMediaTime,
7480 &propertyType,
7481 &data,
7482 &dataSize))
7483 return NULL;
7484 _rv = TextMediaSetTextProperty(mh,
7485 atMediaTime,
7486 propertyType,
7487 data,
7488 dataSize);
7489 _res = Py_BuildValue("l",
7490 _rv);
7491 return _res;
7492}
7493
7494static PyObject *Qt_TextMediaRawSetup(_self, _args)
7495 PyObject *_self;
7496 PyObject *_args;
7497{
7498 PyObject *_res = NULL;
7499 ComponentResult _rv;
7500 MediaHandler mh;
7501 GWorldPtr gw;
7502 GDHandle gd;
7503 void * data;
7504 long dataSize;
7505 TextDescriptionHandle tdh;
7506 TimeValue sampleDuration;
7507 if (!PyArg_ParseTuple(_args, "O&O&O&slO&l",
7508 CmpInstObj_Convert, &mh,
7509 GWorldObj_Convert, &gw,
7510 OptResObj_Convert, &gd,
7511 &data,
7512 &dataSize,
7513 ResObj_Convert, &tdh,
7514 &sampleDuration))
7515 return NULL;
7516 _rv = TextMediaRawSetup(mh,
7517 gw,
7518 gd,
7519 data,
7520 dataSize,
7521 tdh,
7522 sampleDuration);
7523 _res = Py_BuildValue("l",
7524 _rv);
7525 return _res;
7526}
7527
7528static PyObject *Qt_TextMediaRawIdle(_self, _args)
7529 PyObject *_self;
7530 PyObject *_args;
7531{
7532 PyObject *_res = NULL;
7533 ComponentResult _rv;
7534 MediaHandler mh;
7535 GWorldPtr gw;
7536 GDHandle gd;
7537 TimeValue sampleTime;
7538 long flagsIn;
7539 long flagsOut;
7540 if (!PyArg_ParseTuple(_args, "O&O&O&ll",
7541 CmpInstObj_Convert, &mh,
7542 GWorldObj_Convert, &gw,
7543 OptResObj_Convert, &gd,
7544 &sampleTime,
7545 &flagsIn))
7546 return NULL;
7547 _rv = TextMediaRawIdle(mh,
7548 gw,
7549 gd,
7550 sampleTime,
7551 flagsIn,
7552 &flagsOut);
7553 _res = Py_BuildValue("ll",
7554 _rv,
7555 flagsOut);
7556 return _res;
7557}
7558
Jack Jansen1c4e6141998-04-21 15:23:55 +00007559static PyObject *Qt_TextMediaFindNextText(_self, _args)
7560 PyObject *_self;
7561 PyObject *_args;
7562{
7563 PyObject *_res = NULL;
7564 ComponentResult _rv;
7565 MediaHandler mh;
7566 Ptr text;
7567 long size;
7568 short findFlags;
7569 TimeValue startTime;
7570 TimeValue foundTime;
7571 TimeValue foundDuration;
7572 long offset;
7573 if (!PyArg_ParseTuple(_args, "O&slhl",
7574 CmpInstObj_Convert, &mh,
7575 &text,
7576 &size,
7577 &findFlags,
7578 &startTime))
7579 return NULL;
7580 _rv = TextMediaFindNextText(mh,
7581 text,
7582 size,
7583 findFlags,
7584 startTime,
7585 &foundTime,
7586 &foundDuration,
7587 &offset);
7588 _res = Py_BuildValue("llll",
7589 _rv,
7590 foundTime,
7591 foundDuration,
7592 offset);
7593 return _res;
7594}
7595
7596static PyObject *Qt_TextMediaHiliteTextSample(_self, _args)
7597 PyObject *_self;
7598 PyObject *_args;
7599{
7600 PyObject *_res = NULL;
7601 ComponentResult _rv;
7602 MediaHandler mh;
7603 TimeValue sampleTime;
7604 short hiliteStart;
7605 short hiliteEnd;
7606 RGBColor rgbHiliteColor;
7607 if (!PyArg_ParseTuple(_args, "O&lhh",
7608 CmpInstObj_Convert, &mh,
7609 &sampleTime,
7610 &hiliteStart,
7611 &hiliteEnd))
7612 return NULL;
7613 _rv = TextMediaHiliteTextSample(mh,
7614 sampleTime,
7615 hiliteStart,
7616 hiliteEnd,
7617 &rgbHiliteColor);
7618 _res = Py_BuildValue("lO&",
7619 _rv,
7620 QdRGB_New, &rgbHiliteColor);
7621 return _res;
7622}
7623
7624static PyObject *Qt_TextMediaSetTextSampleData(_self, _args)
7625 PyObject *_self;
7626 PyObject *_args;
7627{
7628 PyObject *_res = NULL;
7629 ComponentResult _rv;
7630 MediaHandler mh;
7631 void * data;
7632 OSType dataType;
7633 if (!PyArg_ParseTuple(_args, "O&sO&",
7634 CmpInstObj_Convert, &mh,
7635 &data,
7636 PyMac_GetOSType, &dataType))
7637 return NULL;
7638 _rv = TextMediaSetTextSampleData(mh,
7639 data,
7640 dataType);
7641 _res = Py_BuildValue("l",
7642 _rv);
7643 return _res;
7644}
7645
7646static PyObject *Qt_SpriteMediaSetProperty(_self, _args)
7647 PyObject *_self;
7648 PyObject *_args;
7649{
7650 PyObject *_res = NULL;
7651 ComponentResult _rv;
7652 MediaHandler mh;
7653 short spriteIndex;
7654 long propertyType;
7655 void * propertyValue;
7656 if (!PyArg_ParseTuple(_args, "O&hls",
7657 CmpInstObj_Convert, &mh,
7658 &spriteIndex,
7659 &propertyType,
7660 &propertyValue))
7661 return NULL;
7662 _rv = SpriteMediaSetProperty(mh,
7663 spriteIndex,
7664 propertyType,
7665 propertyValue);
7666 _res = Py_BuildValue("l",
7667 _rv);
7668 return _res;
7669}
7670
7671static PyObject *Qt_SpriteMediaGetProperty(_self, _args)
7672 PyObject *_self;
7673 PyObject *_args;
7674{
7675 PyObject *_res = NULL;
7676 ComponentResult _rv;
7677 MediaHandler mh;
7678 short spriteIndex;
7679 long propertyType;
7680 void * propertyValue;
7681 if (!PyArg_ParseTuple(_args, "O&hls",
7682 CmpInstObj_Convert, &mh,
7683 &spriteIndex,
7684 &propertyType,
7685 &propertyValue))
7686 return NULL;
7687 _rv = SpriteMediaGetProperty(mh,
7688 spriteIndex,
7689 propertyType,
7690 propertyValue);
7691 _res = Py_BuildValue("l",
7692 _rv);
7693 return _res;
7694}
7695
7696static PyObject *Qt_SpriteMediaHitTestSprites(_self, _args)
7697 PyObject *_self;
7698 PyObject *_args;
7699{
7700 PyObject *_res = NULL;
7701 ComponentResult _rv;
7702 MediaHandler mh;
7703 long flags;
7704 Point loc;
7705 short spriteHitIndex;
7706 if (!PyArg_ParseTuple(_args, "O&lO&",
7707 CmpInstObj_Convert, &mh,
7708 &flags,
7709 PyMac_GetPoint, &loc))
7710 return NULL;
7711 _rv = SpriteMediaHitTestSprites(mh,
7712 flags,
7713 loc,
7714 &spriteHitIndex);
7715 _res = Py_BuildValue("lh",
7716 _rv,
7717 spriteHitIndex);
7718 return _res;
7719}
7720
7721static PyObject *Qt_SpriteMediaCountSprites(_self, _args)
7722 PyObject *_self;
7723 PyObject *_args;
7724{
7725 PyObject *_res = NULL;
7726 ComponentResult _rv;
7727 MediaHandler mh;
7728 short numSprites;
7729 if (!PyArg_ParseTuple(_args, "O&",
7730 CmpInstObj_Convert, &mh))
7731 return NULL;
7732 _rv = SpriteMediaCountSprites(mh,
7733 &numSprites);
7734 _res = Py_BuildValue("lh",
7735 _rv,
7736 numSprites);
7737 return _res;
7738}
7739
7740static PyObject *Qt_SpriteMediaCountImages(_self, _args)
7741 PyObject *_self;
7742 PyObject *_args;
7743{
7744 PyObject *_res = NULL;
7745 ComponentResult _rv;
7746 MediaHandler mh;
7747 short numImages;
7748 if (!PyArg_ParseTuple(_args, "O&",
7749 CmpInstObj_Convert, &mh))
7750 return NULL;
7751 _rv = SpriteMediaCountImages(mh,
7752 &numImages);
7753 _res = Py_BuildValue("lh",
7754 _rv,
7755 numImages);
7756 return _res;
7757}
7758
7759static PyObject *Qt_SpriteMediaGetIndImageDescription(_self, _args)
7760 PyObject *_self;
7761 PyObject *_args;
7762{
7763 PyObject *_res = NULL;
7764 ComponentResult _rv;
7765 MediaHandler mh;
7766 short imageIndex;
7767 ImageDescriptionHandle imageDescription;
7768 if (!PyArg_ParseTuple(_args, "O&hO&",
7769 CmpInstObj_Convert, &mh,
7770 &imageIndex,
7771 ResObj_Convert, &imageDescription))
7772 return NULL;
7773 _rv = SpriteMediaGetIndImageDescription(mh,
7774 imageIndex,
7775 imageDescription);
7776 _res = Py_BuildValue("l",
7777 _rv);
7778 return _res;
7779}
7780
7781static PyObject *Qt_SpriteMediaGetDisplayedSampleNumber(_self, _args)
7782 PyObject *_self;
7783 PyObject *_args;
7784{
7785 PyObject *_res = NULL;
7786 ComponentResult _rv;
7787 MediaHandler mh;
7788 long sampleNum;
7789 if (!PyArg_ParseTuple(_args, "O&",
7790 CmpInstObj_Convert, &mh))
7791 return NULL;
7792 _rv = SpriteMediaGetDisplayedSampleNumber(mh,
7793 &sampleNum);
7794 _res = Py_BuildValue("ll",
7795 _rv,
7796 sampleNum);
7797 return _res;
7798}
7799
7800static PyObject *Qt_SpriteMediaGetSpriteName(_self, _args)
7801 PyObject *_self;
7802 PyObject *_args;
7803{
7804 PyObject *_res = NULL;
7805 ComponentResult _rv;
7806 MediaHandler mh;
7807 QTAtomID spriteID;
7808 Str255 spriteName;
7809 if (!PyArg_ParseTuple(_args, "O&lO&",
7810 CmpInstObj_Convert, &mh,
7811 &spriteID,
7812 PyMac_GetStr255, spriteName))
7813 return NULL;
7814 _rv = SpriteMediaGetSpriteName(mh,
7815 spriteID,
7816 spriteName);
7817 _res = Py_BuildValue("l",
7818 _rv);
7819 return _res;
7820}
7821
7822static PyObject *Qt_SpriteMediaGetImageName(_self, _args)
7823 PyObject *_self;
7824 PyObject *_args;
7825{
7826 PyObject *_res = NULL;
7827 ComponentResult _rv;
7828 MediaHandler mh;
7829 short imageIndex;
7830 Str255 imageName;
7831 if (!PyArg_ParseTuple(_args, "O&hO&",
7832 CmpInstObj_Convert, &mh,
7833 &imageIndex,
7834 PyMac_GetStr255, imageName))
7835 return NULL;
7836 _rv = SpriteMediaGetImageName(mh,
7837 imageIndex,
7838 imageName);
7839 _res = Py_BuildValue("l",
7840 _rv);
7841 return _res;
7842}
7843
7844static PyObject *Qt_SpriteMediaSetSpriteProperty(_self, _args)
7845 PyObject *_self;
7846 PyObject *_args;
7847{
7848 PyObject *_res = NULL;
7849 ComponentResult _rv;
7850 MediaHandler mh;
7851 QTAtomID spriteID;
7852 long propertyType;
7853 void * propertyValue;
7854 if (!PyArg_ParseTuple(_args, "O&lls",
7855 CmpInstObj_Convert, &mh,
7856 &spriteID,
7857 &propertyType,
7858 &propertyValue))
7859 return NULL;
7860 _rv = SpriteMediaSetSpriteProperty(mh,
7861 spriteID,
7862 propertyType,
7863 propertyValue);
7864 _res = Py_BuildValue("l",
7865 _rv);
7866 return _res;
7867}
7868
7869static PyObject *Qt_SpriteMediaGetSpriteProperty(_self, _args)
7870 PyObject *_self;
7871 PyObject *_args;
7872{
7873 PyObject *_res = NULL;
7874 ComponentResult _rv;
7875 MediaHandler mh;
7876 QTAtomID spriteID;
7877 long propertyType;
7878 void * propertyValue;
7879 if (!PyArg_ParseTuple(_args, "O&lls",
7880 CmpInstObj_Convert, &mh,
7881 &spriteID,
7882 &propertyType,
7883 &propertyValue))
7884 return NULL;
7885 _rv = SpriteMediaGetSpriteProperty(mh,
7886 spriteID,
7887 propertyType,
7888 propertyValue);
7889 _res = Py_BuildValue("l",
7890 _rv);
7891 return _res;
7892}
7893
7894static PyObject *Qt_SpriteMediaHitTestAllSprites(_self, _args)
7895 PyObject *_self;
7896 PyObject *_args;
7897{
7898 PyObject *_res = NULL;
7899 ComponentResult _rv;
7900 MediaHandler mh;
7901 long flags;
7902 Point loc;
7903 QTAtomID spriteHitID;
7904 if (!PyArg_ParseTuple(_args, "O&lO&",
7905 CmpInstObj_Convert, &mh,
7906 &flags,
7907 PyMac_GetPoint, &loc))
7908 return NULL;
7909 _rv = SpriteMediaHitTestAllSprites(mh,
7910 flags,
7911 loc,
7912 &spriteHitID);
7913 _res = Py_BuildValue("ll",
7914 _rv,
7915 spriteHitID);
7916 return _res;
7917}
7918
7919static PyObject *Qt_SpriteMediaHitTestOneSprite(_self, _args)
7920 PyObject *_self;
7921 PyObject *_args;
7922{
7923 PyObject *_res = NULL;
7924 ComponentResult _rv;
7925 MediaHandler mh;
7926 QTAtomID spriteID;
7927 long flags;
7928 Point loc;
7929 Boolean wasHit;
7930 if (!PyArg_ParseTuple(_args, "O&llO&",
7931 CmpInstObj_Convert, &mh,
7932 &spriteID,
7933 &flags,
7934 PyMac_GetPoint, &loc))
7935 return NULL;
7936 _rv = SpriteMediaHitTestOneSprite(mh,
7937 spriteID,
7938 flags,
7939 loc,
7940 &wasHit);
7941 _res = Py_BuildValue("lb",
7942 _rv,
7943 wasHit);
7944 return _res;
7945}
7946
7947static PyObject *Qt_SpriteMediaSpriteIndexToID(_self, _args)
7948 PyObject *_self;
7949 PyObject *_args;
7950{
7951 PyObject *_res = NULL;
7952 ComponentResult _rv;
7953 MediaHandler mh;
7954 short spriteIndex;
7955 QTAtomID spriteID;
7956 if (!PyArg_ParseTuple(_args, "O&h",
7957 CmpInstObj_Convert, &mh,
7958 &spriteIndex))
7959 return NULL;
7960 _rv = SpriteMediaSpriteIndexToID(mh,
7961 spriteIndex,
7962 &spriteID);
7963 _res = Py_BuildValue("ll",
7964 _rv,
7965 spriteID);
7966 return _res;
7967}
7968
7969static PyObject *Qt_SpriteMediaSpriteIDToIndex(_self, _args)
7970 PyObject *_self;
7971 PyObject *_args;
7972{
7973 PyObject *_res = NULL;
7974 ComponentResult _rv;
7975 MediaHandler mh;
7976 QTAtomID spriteID;
7977 short spriteIndex;
7978 if (!PyArg_ParseTuple(_args, "O&l",
7979 CmpInstObj_Convert, &mh,
7980 &spriteID))
7981 return NULL;
7982 _rv = SpriteMediaSpriteIDToIndex(mh,
7983 spriteID,
7984 &spriteIndex);
7985 _res = Py_BuildValue("lh",
7986 _rv,
7987 spriteIndex);
7988 return _res;
7989}
7990
7991static PyObject *Qt_SpriteMediaSetActionVariable(_self, _args)
7992 PyObject *_self;
7993 PyObject *_args;
7994{
7995 PyObject *_res = NULL;
7996 ComponentResult _rv;
7997 MediaHandler mh;
7998 QTAtomID variableID;
7999 float value;
8000 if (!PyArg_ParseTuple(_args, "O&lf",
8001 CmpInstObj_Convert, &mh,
8002 &variableID,
8003 &value))
8004 return NULL;
8005 _rv = SpriteMediaSetActionVariable(mh,
8006 variableID,
8007 &value);
8008 _res = Py_BuildValue("l",
8009 _rv);
8010 return _res;
8011}
8012
8013static PyObject *Qt_SpriteMediaGetActionVariable(_self, _args)
8014 PyObject *_self;
8015 PyObject *_args;
8016{
8017 PyObject *_res = NULL;
8018 ComponentResult _rv;
8019 MediaHandler mh;
8020 QTAtomID variableID;
8021 float value;
8022 if (!PyArg_ParseTuple(_args, "O&l",
8023 CmpInstObj_Convert, &mh,
8024 &variableID))
8025 return NULL;
8026 _rv = SpriteMediaGetActionVariable(mh,
8027 variableID,
8028 &value);
8029 _res = Py_BuildValue("lf",
8030 _rv,
8031 value);
8032 return _res;
8033}
8034
Jack Jansen74a1e632000-07-14 22:37:27 +00008035#if !TARGET_API_MAC_CARBON
Jack Jansen8d929ae2000-06-21 22:07:06 +00008036
Jack Jansen1c4e6141998-04-21 15:23:55 +00008037static PyObject *Qt_SpriteMediaGetIndImageProperty(_self, _args)
8038 PyObject *_self;
8039 PyObject *_args;
8040{
8041 PyObject *_res = NULL;
8042 ComponentResult _rv;
8043 MediaHandler mh;
8044 short imageIndex;
8045 long imagePropertyType;
8046 void * imagePropertyValue;
8047 if (!PyArg_ParseTuple(_args, "O&hls",
8048 CmpInstObj_Convert, &mh,
8049 &imageIndex,
8050 &imagePropertyType,
8051 &imagePropertyValue))
8052 return NULL;
8053 _rv = SpriteMediaGetIndImageProperty(mh,
8054 imageIndex,
8055 imagePropertyType,
8056 imagePropertyValue);
8057 _res = Py_BuildValue("l",
8058 _rv);
8059 return _res;
8060}
Jack Jansen8d929ae2000-06-21 22:07:06 +00008061#endif
Jack Jansen1c4e6141998-04-21 15:23:55 +00008062
Jack Jansen723ad8a2000-12-12 22:10:21 +00008063static PyObject *Qt_SpriteMediaDisposeSprite(_self, _args)
8064 PyObject *_self;
8065 PyObject *_args;
8066{
8067 PyObject *_res = NULL;
8068 ComponentResult _rv;
8069 MediaHandler mh;
8070 QTAtomID spriteID;
8071 if (!PyArg_ParseTuple(_args, "O&l",
8072 CmpInstObj_Convert, &mh,
8073 &spriteID))
8074 return NULL;
8075 _rv = SpriteMediaDisposeSprite(mh,
8076 spriteID);
8077 _res = Py_BuildValue("l",
8078 _rv);
8079 return _res;
8080}
8081
8082static PyObject *Qt_SpriteMediaSetActionVariableToString(_self, _args)
8083 PyObject *_self;
8084 PyObject *_args;
8085{
8086 PyObject *_res = NULL;
8087 ComponentResult _rv;
8088 MediaHandler mh;
8089 QTAtomID variableID;
8090 Ptr theCString;
8091 if (!PyArg_ParseTuple(_args, "O&ls",
8092 CmpInstObj_Convert, &mh,
8093 &variableID,
8094 &theCString))
8095 return NULL;
8096 _rv = SpriteMediaSetActionVariableToString(mh,
8097 variableID,
8098 theCString);
8099 _res = Py_BuildValue("l",
8100 _rv);
8101 return _res;
8102}
8103
8104static PyObject *Qt_SpriteMediaGetActionVariableAsString(_self, _args)
8105 PyObject *_self;
8106 PyObject *_args;
8107{
8108 PyObject *_res = NULL;
8109 ComponentResult _rv;
8110 MediaHandler mh;
8111 QTAtomID variableID;
8112 Handle theCString;
8113 if (!PyArg_ParseTuple(_args, "O&l",
8114 CmpInstObj_Convert, &mh,
8115 &variableID))
8116 return NULL;
8117 _rv = SpriteMediaGetActionVariableAsString(mh,
8118 variableID,
8119 &theCString);
8120 _res = Py_BuildValue("lO&",
8121 _rv,
8122 ResObj_New, theCString);
8123 return _res;
8124}
8125
8126static PyObject *Qt_FlashMediaSetPan(_self, _args)
8127 PyObject *_self;
8128 PyObject *_args;
8129{
8130 PyObject *_res = NULL;
8131 ComponentResult _rv;
8132 MediaHandler mh;
8133 short xPercent;
8134 short yPercent;
8135 if (!PyArg_ParseTuple(_args, "O&hh",
8136 CmpInstObj_Convert, &mh,
8137 &xPercent,
8138 &yPercent))
8139 return NULL;
8140 _rv = FlashMediaSetPan(mh,
8141 xPercent,
8142 yPercent);
8143 _res = Py_BuildValue("l",
8144 _rv);
8145 return _res;
8146}
8147
8148static PyObject *Qt_FlashMediaSetZoom(_self, _args)
8149 PyObject *_self;
8150 PyObject *_args;
8151{
8152 PyObject *_res = NULL;
8153 ComponentResult _rv;
8154 MediaHandler mh;
8155 short factor;
8156 if (!PyArg_ParseTuple(_args, "O&h",
8157 CmpInstObj_Convert, &mh,
8158 &factor))
8159 return NULL;
8160 _rv = FlashMediaSetZoom(mh,
8161 factor);
8162 _res = Py_BuildValue("l",
8163 _rv);
8164 return _res;
8165}
8166
8167static PyObject *Qt_FlashMediaSetZoomRect(_self, _args)
8168 PyObject *_self;
8169 PyObject *_args;
8170{
8171 PyObject *_res = NULL;
8172 ComponentResult _rv;
8173 MediaHandler mh;
8174 long left;
8175 long top;
8176 long right;
8177 long bottom;
8178 if (!PyArg_ParseTuple(_args, "O&llll",
8179 CmpInstObj_Convert, &mh,
8180 &left,
8181 &top,
8182 &right,
8183 &bottom))
8184 return NULL;
8185 _rv = FlashMediaSetZoomRect(mh,
8186 left,
8187 top,
8188 right,
8189 bottom);
8190 _res = Py_BuildValue("l",
8191 _rv);
8192 return _res;
8193}
8194
8195static PyObject *Qt_FlashMediaGetRefConBounds(_self, _args)
8196 PyObject *_self;
8197 PyObject *_args;
8198{
8199 PyObject *_res = NULL;
8200 ComponentResult _rv;
8201 MediaHandler mh;
8202 long refCon;
8203 long left;
8204 long top;
8205 long right;
8206 long bottom;
8207 if (!PyArg_ParseTuple(_args, "O&l",
8208 CmpInstObj_Convert, &mh,
8209 &refCon))
8210 return NULL;
8211 _rv = FlashMediaGetRefConBounds(mh,
8212 refCon,
8213 &left,
8214 &top,
8215 &right,
8216 &bottom);
8217 _res = Py_BuildValue("lllll",
8218 _rv,
8219 left,
8220 top,
8221 right,
8222 bottom);
8223 return _res;
8224}
8225
8226static PyObject *Qt_FlashMediaGetRefConID(_self, _args)
8227 PyObject *_self;
8228 PyObject *_args;
8229{
8230 PyObject *_res = NULL;
8231 ComponentResult _rv;
8232 MediaHandler mh;
8233 long refCon;
8234 long refConID;
8235 if (!PyArg_ParseTuple(_args, "O&l",
8236 CmpInstObj_Convert, &mh,
8237 &refCon))
8238 return NULL;
8239 _rv = FlashMediaGetRefConID(mh,
8240 refCon,
8241 &refConID);
8242 _res = Py_BuildValue("ll",
8243 _rv,
8244 refConID);
8245 return _res;
8246}
8247
8248static PyObject *Qt_FlashMediaIDToRefCon(_self, _args)
8249 PyObject *_self;
8250 PyObject *_args;
8251{
8252 PyObject *_res = NULL;
8253 ComponentResult _rv;
8254 MediaHandler mh;
8255 long refConID;
8256 long refCon;
8257 if (!PyArg_ParseTuple(_args, "O&l",
8258 CmpInstObj_Convert, &mh,
8259 &refConID))
8260 return NULL;
8261 _rv = FlashMediaIDToRefCon(mh,
8262 refConID,
8263 &refCon);
8264 _res = Py_BuildValue("ll",
8265 _rv,
8266 refCon);
8267 return _res;
8268}
8269
8270static PyObject *Qt_FlashMediaGetDisplayedFrameNumber(_self, _args)
8271 PyObject *_self;
8272 PyObject *_args;
8273{
8274 PyObject *_res = NULL;
8275 ComponentResult _rv;
8276 MediaHandler mh;
8277 long flashFrameNumber;
8278 if (!PyArg_ParseTuple(_args, "O&",
8279 CmpInstObj_Convert, &mh))
8280 return NULL;
8281 _rv = FlashMediaGetDisplayedFrameNumber(mh,
8282 &flashFrameNumber);
8283 _res = Py_BuildValue("ll",
8284 _rv,
8285 flashFrameNumber);
8286 return _res;
8287}
8288
8289static PyObject *Qt_FlashMediaFrameNumberToMovieTime(_self, _args)
8290 PyObject *_self;
8291 PyObject *_args;
8292{
8293 PyObject *_res = NULL;
8294 ComponentResult _rv;
8295 MediaHandler mh;
8296 long flashFrameNumber;
8297 TimeValue movieTime;
8298 if (!PyArg_ParseTuple(_args, "O&l",
8299 CmpInstObj_Convert, &mh,
8300 &flashFrameNumber))
8301 return NULL;
8302 _rv = FlashMediaFrameNumberToMovieTime(mh,
8303 flashFrameNumber,
8304 &movieTime);
8305 _res = Py_BuildValue("ll",
8306 _rv,
8307 movieTime);
8308 return _res;
8309}
8310
8311static PyObject *Qt_FlashMediaFrameLabelToMovieTime(_self, _args)
8312 PyObject *_self;
8313 PyObject *_args;
8314{
8315 PyObject *_res = NULL;
8316 ComponentResult _rv;
8317 MediaHandler mh;
8318 Ptr theLabel;
8319 TimeValue movieTime;
8320 if (!PyArg_ParseTuple(_args, "O&s",
8321 CmpInstObj_Convert, &mh,
8322 &theLabel))
8323 return NULL;
8324 _rv = FlashMediaFrameLabelToMovieTime(mh,
8325 theLabel,
8326 &movieTime);
8327 _res = Py_BuildValue("ll",
8328 _rv,
8329 movieTime);
8330 return _res;
8331}
8332
8333static PyObject *Qt_MovieMediaGetCurrentMovieProperty(_self, _args)
8334 PyObject *_self;
8335 PyObject *_args;
8336{
8337 PyObject *_res = NULL;
8338 ComponentResult _rv;
8339 MediaHandler mh;
8340 OSType whichProperty;
8341 void * value;
8342 if (!PyArg_ParseTuple(_args, "O&O&s",
8343 CmpInstObj_Convert, &mh,
8344 PyMac_GetOSType, &whichProperty,
8345 &value))
8346 return NULL;
8347 _rv = MovieMediaGetCurrentMovieProperty(mh,
8348 whichProperty,
8349 value);
8350 _res = Py_BuildValue("l",
8351 _rv);
8352 return _res;
8353}
8354
8355static PyObject *Qt_MovieMediaGetCurrentTrackProperty(_self, _args)
8356 PyObject *_self;
8357 PyObject *_args;
8358{
8359 PyObject *_res = NULL;
8360 ComponentResult _rv;
8361 MediaHandler mh;
8362 long trackID;
8363 OSType whichProperty;
8364 void * value;
8365 if (!PyArg_ParseTuple(_args, "O&lO&s",
8366 CmpInstObj_Convert, &mh,
8367 &trackID,
8368 PyMac_GetOSType, &whichProperty,
8369 &value))
8370 return NULL;
8371 _rv = MovieMediaGetCurrentTrackProperty(mh,
8372 trackID,
8373 whichProperty,
8374 value);
8375 _res = Py_BuildValue("l",
8376 _rv);
8377 return _res;
8378}
8379
8380static PyObject *Qt_MovieMediaGetChildMovieDataReference(_self, _args)
8381 PyObject *_self;
8382 PyObject *_args;
8383{
8384 PyObject *_res = NULL;
8385 ComponentResult _rv;
8386 MediaHandler mh;
8387 QTAtomID dataRefID;
8388 short dataRefIndex;
8389 OSType dataRefType;
8390 Handle dataRef;
8391 QTAtomID dataRefIDOut;
8392 short dataRefIndexOut;
8393 if (!PyArg_ParseTuple(_args, "O&lh",
8394 CmpInstObj_Convert, &mh,
8395 &dataRefID,
8396 &dataRefIndex))
8397 return NULL;
8398 _rv = MovieMediaGetChildMovieDataReference(mh,
8399 dataRefID,
8400 dataRefIndex,
8401 &dataRefType,
8402 &dataRef,
8403 &dataRefIDOut,
8404 &dataRefIndexOut);
8405 _res = Py_BuildValue("lO&O&lh",
8406 _rv,
8407 PyMac_BuildOSType, dataRefType,
8408 ResObj_New, dataRef,
8409 dataRefIDOut,
8410 dataRefIndexOut);
8411 return _res;
8412}
8413
8414static PyObject *Qt_MovieMediaSetChildMovieDataReference(_self, _args)
8415 PyObject *_self;
8416 PyObject *_args;
8417{
8418 PyObject *_res = NULL;
8419 ComponentResult _rv;
8420 MediaHandler mh;
8421 QTAtomID dataRefID;
8422 OSType dataRefType;
8423 Handle dataRef;
8424 if (!PyArg_ParseTuple(_args, "O&lO&O&",
8425 CmpInstObj_Convert, &mh,
8426 &dataRefID,
8427 PyMac_GetOSType, &dataRefType,
8428 ResObj_Convert, &dataRef))
8429 return NULL;
8430 _rv = MovieMediaSetChildMovieDataReference(mh,
8431 dataRefID,
8432 dataRefType,
8433 dataRef);
8434 _res = Py_BuildValue("l",
8435 _rv);
8436 return _res;
8437}
8438
8439static PyObject *Qt_MovieMediaLoadChildMovieFromDataReference(_self, _args)
8440 PyObject *_self;
8441 PyObject *_args;
8442{
8443 PyObject *_res = NULL;
8444 ComponentResult _rv;
8445 MediaHandler mh;
8446 QTAtomID dataRefID;
8447 if (!PyArg_ParseTuple(_args, "O&l",
8448 CmpInstObj_Convert, &mh,
8449 &dataRefID))
8450 return NULL;
8451 _rv = MovieMediaLoadChildMovieFromDataReference(mh,
8452 dataRefID);
8453 _res = Py_BuildValue("l",
8454 _rv);
8455 return _res;
8456}
8457
8458static PyObject *Qt_Media3DGetCurrentGroup(_self, _args)
8459 PyObject *_self;
8460 PyObject *_args;
8461{
8462 PyObject *_res = NULL;
8463 ComponentResult _rv;
8464 MediaHandler mh;
8465 void * group;
8466 if (!PyArg_ParseTuple(_args, "O&s",
8467 CmpInstObj_Convert, &mh,
8468 &group))
8469 return NULL;
8470 _rv = Media3DGetCurrentGroup(mh,
8471 group);
8472 _res = Py_BuildValue("l",
8473 _rv);
8474 return _res;
8475}
8476
8477static PyObject *Qt_Media3DTranslateNamedObjectTo(_self, _args)
8478 PyObject *_self;
8479 PyObject *_args;
8480{
8481 PyObject *_res = NULL;
8482 ComponentResult _rv;
8483 MediaHandler mh;
8484 char objectName;
8485 Fixed x;
8486 Fixed y;
8487 Fixed z;
8488 if (!PyArg_ParseTuple(_args, "O&O&O&O&",
8489 CmpInstObj_Convert, &mh,
8490 PyMac_GetFixed, &x,
8491 PyMac_GetFixed, &y,
8492 PyMac_GetFixed, &z))
8493 return NULL;
8494 _rv = Media3DTranslateNamedObjectTo(mh,
8495 &objectName,
8496 x,
8497 y,
8498 z);
8499 _res = Py_BuildValue("lc",
8500 _rv,
8501 objectName);
8502 return _res;
8503}
8504
8505static PyObject *Qt_Media3DScaleNamedObjectTo(_self, _args)
8506 PyObject *_self;
8507 PyObject *_args;
8508{
8509 PyObject *_res = NULL;
8510 ComponentResult _rv;
8511 MediaHandler mh;
8512 char objectName;
8513 Fixed xScale;
8514 Fixed yScale;
8515 Fixed zScale;
8516 if (!PyArg_ParseTuple(_args, "O&O&O&O&",
8517 CmpInstObj_Convert, &mh,
8518 PyMac_GetFixed, &xScale,
8519 PyMac_GetFixed, &yScale,
8520 PyMac_GetFixed, &zScale))
8521 return NULL;
8522 _rv = Media3DScaleNamedObjectTo(mh,
8523 &objectName,
8524 xScale,
8525 yScale,
8526 zScale);
8527 _res = Py_BuildValue("lc",
8528 _rv,
8529 objectName);
8530 return _res;
8531}
8532
8533static PyObject *Qt_Media3DRotateNamedObjectTo(_self, _args)
8534 PyObject *_self;
8535 PyObject *_args;
8536{
8537 PyObject *_res = NULL;
8538 ComponentResult _rv;
8539 MediaHandler mh;
8540 char objectName;
8541 Fixed xDegrees;
8542 Fixed yDegrees;
8543 Fixed zDegrees;
8544 if (!PyArg_ParseTuple(_args, "O&O&O&O&",
8545 CmpInstObj_Convert, &mh,
8546 PyMac_GetFixed, &xDegrees,
8547 PyMac_GetFixed, &yDegrees,
8548 PyMac_GetFixed, &zDegrees))
8549 return NULL;
8550 _rv = Media3DRotateNamedObjectTo(mh,
8551 &objectName,
8552 xDegrees,
8553 yDegrees,
8554 zDegrees);
8555 _res = Py_BuildValue("lc",
8556 _rv,
8557 objectName);
8558 return _res;
8559}
8560
8561static PyObject *Qt_Media3DSetCameraData(_self, _args)
8562 PyObject *_self;
8563 PyObject *_args;
8564{
8565 PyObject *_res = NULL;
8566 ComponentResult _rv;
8567 MediaHandler mh;
8568 void * cameraData;
8569 if (!PyArg_ParseTuple(_args, "O&s",
8570 CmpInstObj_Convert, &mh,
8571 &cameraData))
8572 return NULL;
8573 _rv = Media3DSetCameraData(mh,
8574 cameraData);
8575 _res = Py_BuildValue("l",
8576 _rv);
8577 return _res;
8578}
8579
8580static PyObject *Qt_Media3DGetCameraData(_self, _args)
8581 PyObject *_self;
8582 PyObject *_args;
8583{
8584 PyObject *_res = NULL;
8585 ComponentResult _rv;
8586 MediaHandler mh;
8587 void * cameraData;
8588 if (!PyArg_ParseTuple(_args, "O&s",
8589 CmpInstObj_Convert, &mh,
8590 &cameraData))
8591 return NULL;
8592 _rv = Media3DGetCameraData(mh,
8593 cameraData);
8594 _res = Py_BuildValue("l",
8595 _rv);
8596 return _res;
8597}
8598
8599static PyObject *Qt_Media3DSetCameraAngleAspect(_self, _args)
8600 PyObject *_self;
8601 PyObject *_args;
8602{
8603 PyObject *_res = NULL;
8604 ComponentResult _rv;
8605 MediaHandler mh;
8606 QTFloatSingle fov;
8607 QTFloatSingle aspectRatioXToY;
8608 if (!PyArg_ParseTuple(_args, "O&ff",
8609 CmpInstObj_Convert, &mh,
8610 &fov,
8611 &aspectRatioXToY))
8612 return NULL;
8613 _rv = Media3DSetCameraAngleAspect(mh,
8614 fov,
8615 aspectRatioXToY);
8616 _res = Py_BuildValue("l",
8617 _rv);
8618 return _res;
8619}
8620
8621static PyObject *Qt_Media3DGetCameraAngleAspect(_self, _args)
8622 PyObject *_self;
8623 PyObject *_args;
8624{
8625 PyObject *_res = NULL;
8626 ComponentResult _rv;
8627 MediaHandler mh;
8628 QTFloatSingle fov;
8629 QTFloatSingle aspectRatioXToY;
8630 if (!PyArg_ParseTuple(_args, "O&",
8631 CmpInstObj_Convert, &mh))
8632 return NULL;
8633 _rv = Media3DGetCameraAngleAspect(mh,
8634 &fov,
8635 &aspectRatioXToY);
8636 _res = Py_BuildValue("lff",
8637 _rv,
8638 fov,
8639 aspectRatioXToY);
8640 return _res;
8641}
8642
8643static PyObject *Qt_Media3DSetCameraRange(_self, _args)
8644 PyObject *_self;
8645 PyObject *_args;
8646{
8647 PyObject *_res = NULL;
8648 ComponentResult _rv;
8649 MediaHandler mh;
8650 void * tQ3CameraRange;
8651 if (!PyArg_ParseTuple(_args, "O&s",
8652 CmpInstObj_Convert, &mh,
8653 &tQ3CameraRange))
8654 return NULL;
8655 _rv = Media3DSetCameraRange(mh,
8656 tQ3CameraRange);
8657 _res = Py_BuildValue("l",
8658 _rv);
8659 return _res;
8660}
8661
8662static PyObject *Qt_Media3DGetCameraRange(_self, _args)
8663 PyObject *_self;
8664 PyObject *_args;
8665{
8666 PyObject *_res = NULL;
8667 ComponentResult _rv;
8668 MediaHandler mh;
8669 void * tQ3CameraRange;
8670 if (!PyArg_ParseTuple(_args, "O&s",
8671 CmpInstObj_Convert, &mh,
8672 &tQ3CameraRange))
8673 return NULL;
8674 _rv = Media3DGetCameraRange(mh,
8675 tQ3CameraRange);
8676 _res = Py_BuildValue("l",
8677 _rv);
8678 return _res;
8679}
8680
8681static PyObject *Qt_Media3DGetViewObject(_self, _args)
8682 PyObject *_self;
8683 PyObject *_args;
8684{
8685 PyObject *_res = NULL;
8686 ComponentResult _rv;
8687 MediaHandler mh;
8688 void * tq3viewObject;
8689 if (!PyArg_ParseTuple(_args, "O&s",
8690 CmpInstObj_Convert, &mh,
8691 &tq3viewObject))
8692 return NULL;
8693 _rv = Media3DGetViewObject(mh,
8694 tq3viewObject);
8695 _res = Py_BuildValue("l",
8696 _rv);
8697 return _res;
8698}
8699
Jack Jansen453ced51995-11-30 17:42:08 +00008700static PyObject *Qt_NewTimeBase(_self, _args)
8701 PyObject *_self;
8702 PyObject *_args;
8703{
8704 PyObject *_res = NULL;
8705 TimeBase _rv;
8706 if (!PyArg_ParseTuple(_args, ""))
8707 return NULL;
8708 _rv = NewTimeBase();
8709 _res = Py_BuildValue("O&",
8710 TimeBaseObj_New, _rv);
8711 return _res;
8712}
8713
Jack Jansenb2006391998-04-23 13:22:44 +00008714static PyObject *Qt_ConvertTime(_self, _args)
8715 PyObject *_self;
8716 PyObject *_args;
8717{
8718 PyObject *_res = NULL;
8719 TimeRecord inout;
8720 TimeBase newBase;
Jack Jansen1b7a70f2000-03-03 17:06:13 +00008721 if (!PyArg_ParseTuple(_args, "O&O&",
8722 QtTimeRecord_Convert, &inout,
Jack Jansenb2006391998-04-23 13:22:44 +00008723 TimeBaseObj_Convert, &newBase))
8724 return NULL;
8725 ConvertTime(&inout,
8726 newBase);
8727 _res = Py_BuildValue("O&",
8728 QtTimeRecord_New, &inout);
8729 return _res;
8730}
8731
8732static PyObject *Qt_ConvertTimeScale(_self, _args)
8733 PyObject *_self;
8734 PyObject *_args;
8735{
8736 PyObject *_res = NULL;
8737 TimeRecord inout;
8738 TimeScale newScale;
Jack Jansen1b7a70f2000-03-03 17:06:13 +00008739 if (!PyArg_ParseTuple(_args, "O&l",
8740 QtTimeRecord_Convert, &inout,
Jack Jansenb2006391998-04-23 13:22:44 +00008741 &newScale))
8742 return NULL;
8743 ConvertTimeScale(&inout,
8744 newScale);
8745 _res = Py_BuildValue("O&",
8746 QtTimeRecord_New, &inout);
8747 return _res;
8748}
8749
8750static PyObject *Qt_AddTime(_self, _args)
8751 PyObject *_self;
8752 PyObject *_args;
8753{
8754 PyObject *_res = NULL;
8755 TimeRecord dst;
8756 TimeRecord src;
Jack Jansen1b7a70f2000-03-03 17:06:13 +00008757 if (!PyArg_ParseTuple(_args, "O&O&",
8758 QtTimeRecord_Convert, &dst,
Jack Jansenb2006391998-04-23 13:22:44 +00008759 QtTimeRecord_Convert, &src))
8760 return NULL;
8761 AddTime(&dst,
8762 &src);
8763 _res = Py_BuildValue("O&",
8764 QtTimeRecord_New, &dst);
8765 return _res;
8766}
8767
8768static PyObject *Qt_SubtractTime(_self, _args)
8769 PyObject *_self;
8770 PyObject *_args;
8771{
8772 PyObject *_res = NULL;
8773 TimeRecord dst;
8774 TimeRecord src;
Jack Jansen1b7a70f2000-03-03 17:06:13 +00008775 if (!PyArg_ParseTuple(_args, "O&O&",
8776 QtTimeRecord_Convert, &dst,
Jack Jansenb2006391998-04-23 13:22:44 +00008777 QtTimeRecord_Convert, &src))
8778 return NULL;
8779 SubtractTime(&dst,
8780 &src);
8781 _res = Py_BuildValue("O&",
8782 QtTimeRecord_New, &dst);
8783 return _res;
8784}
8785
Jack Jansen1c4e6141998-04-21 15:23:55 +00008786static PyObject *Qt_MusicMediaGetIndexedTunePlayer(_self, _args)
8787 PyObject *_self;
8788 PyObject *_args;
8789{
8790 PyObject *_res = NULL;
8791 ComponentResult _rv;
8792 ComponentInstance ti;
8793 long sampleDescIndex;
8794 ComponentInstance tp;
8795 if (!PyArg_ParseTuple(_args, "O&l",
8796 CmpInstObj_Convert, &ti,
8797 &sampleDescIndex))
8798 return NULL;
8799 _rv = MusicMediaGetIndexedTunePlayer(ti,
8800 sampleDescIndex,
8801 &tp);
8802 _res = Py_BuildValue("lO&",
8803 _rv,
8804 CmpInstObj_New, tp);
8805 return _res;
8806}
8807
Jack Jansen9cfea101995-12-09 14:05:56 +00008808static PyObject *Qt_AlignWindow(_self, _args)
8809 PyObject *_self;
8810 PyObject *_args;
8811{
8812 PyObject *_res = NULL;
8813 WindowPtr wp;
8814 Boolean front;
8815 if (!PyArg_ParseTuple(_args, "O&b",
8816 WinObj_Convert, &wp,
8817 &front))
8818 return NULL;
8819 AlignWindow(wp,
8820 front,
8821 (Rect *)0,
8822 (ICMAlignmentProcRecordPtr)0);
8823 Py_INCREF(Py_None);
8824 _res = Py_None;
8825 return _res;
8826}
8827
8828static PyObject *Qt_DragAlignedWindow(_self, _args)
8829 PyObject *_self;
8830 PyObject *_args;
8831{
8832 PyObject *_res = NULL;
8833 WindowPtr wp;
8834 Point startPt;
8835 Rect boundsRect;
8836 if (!PyArg_ParseTuple(_args, "O&O&O&",
8837 WinObj_Convert, &wp,
8838 PyMac_GetPoint, &startPt,
8839 PyMac_GetRect, &boundsRect))
8840 return NULL;
8841 DragAlignedWindow(wp,
8842 startPt,
8843 &boundsRect,
8844 (Rect *)0,
8845 (ICMAlignmentProcRecordPtr)0);
8846 Py_INCREF(Py_None);
8847 _res = Py_None;
8848 return _res;
8849}
8850
Jack Jansend81fc3c1998-07-22 13:37:37 +00008851static PyObject *Qt_MoviesTask(_self, _args)
8852 PyObject *_self;
8853 PyObject *_args;
8854{
8855 PyObject *_res = NULL;
8856 long maxMilliSecToUse;
8857 if (!PyArg_ParseTuple(_args, "l",
8858 &maxMilliSecToUse))
8859 return NULL;
8860 MoviesTask((Movie)0,
8861 maxMilliSecToUse);
8862 Py_INCREF(Py_None);
8863 _res = Py_None;
8864 return _res;
8865}
8866
Jack Jansen453ced51995-11-30 17:42:08 +00008867static PyMethodDef Qt_methods[] = {
Jack Jansen8d929ae2000-06-21 22:07:06 +00008868
Jack Jansen74a1e632000-07-14 22:37:27 +00008869#if !TARGET_API_MAC_CARBON
Jack Jansena05ac601999-12-12 21:41:51 +00008870 {"CheckQuickTimeRegistration", (PyCFunction)Qt_CheckQuickTimeRegistration, 1,
8871 "(void * registrationKey, long flags) -> None"},
Jack Jansen8d929ae2000-06-21 22:07:06 +00008872#endif
Jack Jansen453ced51995-11-30 17:42:08 +00008873 {"EnterMovies", (PyCFunction)Qt_EnterMovies, 1,
8874 "() -> None"},
8875 {"ExitMovies", (PyCFunction)Qt_ExitMovies, 1,
8876 "() -> None"},
8877 {"GetMoviesError", (PyCFunction)Qt_GetMoviesError, 1,
8878 "() -> None"},
8879 {"ClearMoviesStickyError", (PyCFunction)Qt_ClearMoviesStickyError, 1,
8880 "() -> None"},
8881 {"GetMoviesStickyError", (PyCFunction)Qt_GetMoviesStickyError, 1,
8882 "() -> None"},
8883 {"DisposeMatte", (PyCFunction)Qt_DisposeMatte, 1,
8884 "(PixMapHandle theMatte) -> None"},
8885 {"NewMovie", (PyCFunction)Qt_NewMovie, 1,
8886 "(long flags) -> (Movie _rv)"},
8887 {"GetDataHandler", (PyCFunction)Qt_GetDataHandler, 1,
8888 "(Handle dataRef, OSType dataHandlerSubType, long flags) -> (Component _rv)"},
Jack Jansen723ad8a2000-12-12 22:10:21 +00008889 {"OpenADataHandler", (PyCFunction)Qt_OpenADataHandler, 1,
8890 "(Handle dataRef, OSType dataHandlerSubType, Handle anchorDataRef, OSType anchorDataRefType, TimeBase tb, long flags) -> (ComponentInstance dh)"},
Jack Jansen453ced51995-11-30 17:42:08 +00008891 {"PasteHandleIntoMovie", (PyCFunction)Qt_PasteHandleIntoMovie, 1,
8892 "(Handle h, OSType handleType, Movie theMovie, long flags, ComponentInstance userComp) -> None"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00008893 {"GetMovieImporterForDataRef", (PyCFunction)Qt_GetMovieImporterForDataRef, 1,
8894 "(OSType dataRefType, Handle dataRef, long flags) -> (Component importer)"},
Jack Jansen453ced51995-11-30 17:42:08 +00008895 {"TrackTimeToMediaTime", (PyCFunction)Qt_TrackTimeToMediaTime, 1,
8896 "(TimeValue value, Track theTrack) -> (TimeValue _rv)"},
8897 {"NewUserData", (PyCFunction)Qt_NewUserData, 1,
8898 "() -> (UserData theUserData)"},
8899 {"NewUserDataFromHandle", (PyCFunction)Qt_NewUserDataFromHandle, 1,
8900 "(Handle h) -> (UserData theUserData)"},
8901 {"CreateMovieFile", (PyCFunction)Qt_CreateMovieFile, 1,
8902 "(FSSpec fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (short resRefNum, Movie newmovie)"},
8903 {"OpenMovieFile", (PyCFunction)Qt_OpenMovieFile, 1,
8904 "(FSSpec fileSpec, SInt8 permission) -> (short resRefNum)"},
8905 {"CloseMovieFile", (PyCFunction)Qt_CloseMovieFile, 1,
8906 "(short resRefNum) -> None"},
8907 {"DeleteMovieFile", (PyCFunction)Qt_DeleteMovieFile, 1,
8908 "(FSSpec fileSpec) -> None"},
8909 {"NewMovieFromFile", (PyCFunction)Qt_NewMovieFromFile, 1,
Jack Jansene0cf87b1997-04-09 15:53:46 +00008910 "(short resRefNum, short resId, short newMovieFlags) -> (Movie theMovie, short resId, Boolean dataRefWasChanged)"},
Jack Jansen453ced51995-11-30 17:42:08 +00008911 {"NewMovieFromHandle", (PyCFunction)Qt_NewMovieFromHandle, 1,
8912 "(Handle h, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
8913 {"NewMovieFromDataFork", (PyCFunction)Qt_NewMovieFromDataFork, 1,
8914 "(short fRefNum, long fileOffset, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
Jack Jansen723ad8a2000-12-12 22:10:21 +00008915 {"NewMovieFromDataFork64", (PyCFunction)Qt_NewMovieFromDataFork64, 1,
8916 "(long fRefNum, wide fileOffset, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00008917 {"NewMovieFromDataRef", (PyCFunction)Qt_NewMovieFromDataRef, 1,
8918 "(short flags, Handle dataRef, OSType dataRefType) -> (Movie m, short id)"},
Jack Jansen453ced51995-11-30 17:42:08 +00008919 {"RemoveMovieResource", (PyCFunction)Qt_RemoveMovieResource, 1,
8920 "(short resRefNum, short resId) -> None"},
Jack Jansen723ad8a2000-12-12 22:10:21 +00008921 {"CreateShortcutMovieFile", (PyCFunction)Qt_CreateShortcutMovieFile, 1,
8922 "(FSSpec fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, Handle targetDataRef, OSType targetDataRefType) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00008923 {"NewMovieFromScrap", (PyCFunction)Qt_NewMovieFromScrap, 1,
8924 "(long newMovieFlags) -> (Movie _rv)"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00008925 {"QTNewAlias", (PyCFunction)Qt_QTNewAlias, 1,
8926 "(FSSpec fss, Boolean minimal) -> (AliasHandle alias)"},
8927 {"EndFullScreen", (PyCFunction)Qt_EndFullScreen, 1,
8928 "(Ptr fullState, long flags) -> None"},
8929 {"AddSoundDescriptionExtension", (PyCFunction)Qt_AddSoundDescriptionExtension, 1,
8930 "(SoundDescriptionHandle desc, Handle extension, OSType idType) -> None"},
8931 {"GetSoundDescriptionExtension", (PyCFunction)Qt_GetSoundDescriptionExtension, 1,
8932 "(SoundDescriptionHandle desc, OSType idType) -> (Handle extension)"},
8933 {"RemoveSoundDescriptionExtension", (PyCFunction)Qt_RemoveSoundDescriptionExtension, 1,
8934 "(SoundDescriptionHandle desc, OSType idType) -> None"},
8935 {"QTIsStandardParameterDialogEvent", (PyCFunction)Qt_QTIsStandardParameterDialogEvent, 1,
8936 "(QTParameterDialog createdDialog) -> (EventRecord pEvent)"},
8937 {"QTDismissStandardParameterDialog", (PyCFunction)Qt_QTDismissStandardParameterDialog, 1,
8938 "(QTParameterDialog createdDialog) -> None"},
8939 {"QTStandardParameterDialogDoAction", (PyCFunction)Qt_QTStandardParameterDialogDoAction, 1,
8940 "(QTParameterDialog createdDialog, long action, void * params) -> None"},
8941 {"QTRegisterAccessKey", (PyCFunction)Qt_QTRegisterAccessKey, 1,
8942 "(Str255 accessKeyType, long flags, Handle accessKey) -> None"},
8943 {"QTUnregisterAccessKey", (PyCFunction)Qt_QTUnregisterAccessKey, 1,
8944 "(Str255 accessKeyType, long flags, Handle accessKey) -> None"},
8945 {"QTTextToNativeText", (PyCFunction)Qt_QTTextToNativeText, 1,
8946 "(Handle theText, long encoding, long flags) -> None"},
8947 {"VideoMediaResetStatistics", (PyCFunction)Qt_VideoMediaResetStatistics, 1,
8948 "(MediaHandler mh) -> (ComponentResult _rv)"},
8949 {"VideoMediaGetStatistics", (PyCFunction)Qt_VideoMediaGetStatistics, 1,
8950 "(MediaHandler mh) -> (ComponentResult _rv)"},
Jack Jansena05ac601999-12-12 21:41:51 +00008951 {"VideoMediaGetStallCount", (PyCFunction)Qt_VideoMediaGetStallCount, 1,
8952 "(MediaHandler mh) -> (ComponentResult _rv, unsigned long stalls)"},
Jack Jansen723ad8a2000-12-12 22:10:21 +00008953 {"VideoMediaSetCodecParameter", (PyCFunction)Qt_VideoMediaSetCodecParameter, 1,
8954 "(MediaHandler mh, CodecType cType, OSType parameterID, long parameterChangeSeed, void * dataPtr, long dataSize) -> (ComponentResult _rv)"},
8955 {"VideoMediaGetCodecParameter", (PyCFunction)Qt_VideoMediaGetCodecParameter, 1,
8956 "(MediaHandler mh, CodecType cType, OSType parameterID, Handle outParameterData) -> (ComponentResult _rv)"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00008957 {"TextMediaAddTextSample", (PyCFunction)Qt_TextMediaAddTextSample, 1,
8958 "(MediaHandler mh, Ptr text, unsigned long size, short fontNumber, short fontSize, Style textFace, short textJustification, long displayFlags, TimeValue scrollDelay, short hiliteStart, short hiliteEnd, TimeValue duration) -> (ComponentResult _rv, RGBColor textColor, RGBColor backColor, Rect textBox, RGBColor rgbHiliteColor, TimeValue sampleTime)"},
8959 {"TextMediaAddTESample", (PyCFunction)Qt_TextMediaAddTESample, 1,
8960 "(MediaHandler mh, TEHandle hTE, short textJustification, long displayFlags, TimeValue scrollDelay, short hiliteStart, short hiliteEnd, TimeValue duration) -> (ComponentResult _rv, RGBColor backColor, Rect textBox, RGBColor rgbHiliteColor, TimeValue sampleTime)"},
8961 {"TextMediaAddHiliteSample", (PyCFunction)Qt_TextMediaAddHiliteSample, 1,
8962 "(MediaHandler mh, short hiliteStart, short hiliteEnd, TimeValue duration) -> (ComponentResult _rv, RGBColor rgbHiliteColor, TimeValue sampleTime)"},
Jack Jansen723ad8a2000-12-12 22:10:21 +00008963 {"TextMediaDrawRaw", (PyCFunction)Qt_TextMediaDrawRaw, 1,
8964 "(MediaHandler mh, GWorldPtr gw, GDHandle gd, void * data, long dataSize, TextDescriptionHandle tdh) -> (ComponentResult _rv)"},
8965 {"TextMediaSetTextProperty", (PyCFunction)Qt_TextMediaSetTextProperty, 1,
8966 "(MediaHandler mh, TimeValue atMediaTime, long propertyType, void * data, long dataSize) -> (ComponentResult _rv)"},
8967 {"TextMediaRawSetup", (PyCFunction)Qt_TextMediaRawSetup, 1,
8968 "(MediaHandler mh, GWorldPtr gw, GDHandle gd, void * data, long dataSize, TextDescriptionHandle tdh, TimeValue sampleDuration) -> (ComponentResult _rv)"},
8969 {"TextMediaRawIdle", (PyCFunction)Qt_TextMediaRawIdle, 1,
8970 "(MediaHandler mh, GWorldPtr gw, GDHandle gd, TimeValue sampleTime, long flagsIn) -> (ComponentResult _rv, long flagsOut)"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00008971 {"TextMediaFindNextText", (PyCFunction)Qt_TextMediaFindNextText, 1,
8972 "(MediaHandler mh, Ptr text, long size, short findFlags, TimeValue startTime) -> (ComponentResult _rv, TimeValue foundTime, TimeValue foundDuration, long offset)"},
8973 {"TextMediaHiliteTextSample", (PyCFunction)Qt_TextMediaHiliteTextSample, 1,
8974 "(MediaHandler mh, TimeValue sampleTime, short hiliteStart, short hiliteEnd) -> (ComponentResult _rv, RGBColor rgbHiliteColor)"},
8975 {"TextMediaSetTextSampleData", (PyCFunction)Qt_TextMediaSetTextSampleData, 1,
8976 "(MediaHandler mh, void * data, OSType dataType) -> (ComponentResult _rv)"},
8977 {"SpriteMediaSetProperty", (PyCFunction)Qt_SpriteMediaSetProperty, 1,
8978 "(MediaHandler mh, short spriteIndex, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
8979 {"SpriteMediaGetProperty", (PyCFunction)Qt_SpriteMediaGetProperty, 1,
8980 "(MediaHandler mh, short spriteIndex, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
8981 {"SpriteMediaHitTestSprites", (PyCFunction)Qt_SpriteMediaHitTestSprites, 1,
8982 "(MediaHandler mh, long flags, Point loc) -> (ComponentResult _rv, short spriteHitIndex)"},
8983 {"SpriteMediaCountSprites", (PyCFunction)Qt_SpriteMediaCountSprites, 1,
8984 "(MediaHandler mh) -> (ComponentResult _rv, short numSprites)"},
8985 {"SpriteMediaCountImages", (PyCFunction)Qt_SpriteMediaCountImages, 1,
8986 "(MediaHandler mh) -> (ComponentResult _rv, short numImages)"},
8987 {"SpriteMediaGetIndImageDescription", (PyCFunction)Qt_SpriteMediaGetIndImageDescription, 1,
8988 "(MediaHandler mh, short imageIndex, ImageDescriptionHandle imageDescription) -> (ComponentResult _rv)"},
8989 {"SpriteMediaGetDisplayedSampleNumber", (PyCFunction)Qt_SpriteMediaGetDisplayedSampleNumber, 1,
8990 "(MediaHandler mh) -> (ComponentResult _rv, long sampleNum)"},
8991 {"SpriteMediaGetSpriteName", (PyCFunction)Qt_SpriteMediaGetSpriteName, 1,
8992 "(MediaHandler mh, QTAtomID spriteID, Str255 spriteName) -> (ComponentResult _rv)"},
8993 {"SpriteMediaGetImageName", (PyCFunction)Qt_SpriteMediaGetImageName, 1,
8994 "(MediaHandler mh, short imageIndex, Str255 imageName) -> (ComponentResult _rv)"},
8995 {"SpriteMediaSetSpriteProperty", (PyCFunction)Qt_SpriteMediaSetSpriteProperty, 1,
8996 "(MediaHandler mh, QTAtomID spriteID, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
8997 {"SpriteMediaGetSpriteProperty", (PyCFunction)Qt_SpriteMediaGetSpriteProperty, 1,
8998 "(MediaHandler mh, QTAtomID spriteID, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
8999 {"SpriteMediaHitTestAllSprites", (PyCFunction)Qt_SpriteMediaHitTestAllSprites, 1,
9000 "(MediaHandler mh, long flags, Point loc) -> (ComponentResult _rv, QTAtomID spriteHitID)"},
9001 {"SpriteMediaHitTestOneSprite", (PyCFunction)Qt_SpriteMediaHitTestOneSprite, 1,
9002 "(MediaHandler mh, QTAtomID spriteID, long flags, Point loc) -> (ComponentResult _rv, Boolean wasHit)"},
9003 {"SpriteMediaSpriteIndexToID", (PyCFunction)Qt_SpriteMediaSpriteIndexToID, 1,
9004 "(MediaHandler mh, short spriteIndex) -> (ComponentResult _rv, QTAtomID spriteID)"},
9005 {"SpriteMediaSpriteIDToIndex", (PyCFunction)Qt_SpriteMediaSpriteIDToIndex, 1,
9006 "(MediaHandler mh, QTAtomID spriteID) -> (ComponentResult _rv, short spriteIndex)"},
9007 {"SpriteMediaSetActionVariable", (PyCFunction)Qt_SpriteMediaSetActionVariable, 1,
9008 "(MediaHandler mh, QTAtomID variableID, float value) -> (ComponentResult _rv)"},
9009 {"SpriteMediaGetActionVariable", (PyCFunction)Qt_SpriteMediaGetActionVariable, 1,
9010 "(MediaHandler mh, QTAtomID variableID) -> (ComponentResult _rv, float value)"},
Jack Jansen8d929ae2000-06-21 22:07:06 +00009011
Jack Jansen74a1e632000-07-14 22:37:27 +00009012#if !TARGET_API_MAC_CARBON
Jack Jansen1c4e6141998-04-21 15:23:55 +00009013 {"SpriteMediaGetIndImageProperty", (PyCFunction)Qt_SpriteMediaGetIndImageProperty, 1,
9014 "(MediaHandler mh, short imageIndex, long imagePropertyType, void * imagePropertyValue) -> (ComponentResult _rv)"},
Jack Jansen8d929ae2000-06-21 22:07:06 +00009015#endif
Jack Jansen723ad8a2000-12-12 22:10:21 +00009016 {"SpriteMediaDisposeSprite", (PyCFunction)Qt_SpriteMediaDisposeSprite, 1,
9017 "(MediaHandler mh, QTAtomID spriteID) -> (ComponentResult _rv)"},
9018 {"SpriteMediaSetActionVariableToString", (PyCFunction)Qt_SpriteMediaSetActionVariableToString, 1,
9019 "(MediaHandler mh, QTAtomID variableID, Ptr theCString) -> (ComponentResult _rv)"},
9020 {"SpriteMediaGetActionVariableAsString", (PyCFunction)Qt_SpriteMediaGetActionVariableAsString, 1,
9021 "(MediaHandler mh, QTAtomID variableID) -> (ComponentResult _rv, Handle theCString)"},
9022 {"FlashMediaSetPan", (PyCFunction)Qt_FlashMediaSetPan, 1,
9023 "(MediaHandler mh, short xPercent, short yPercent) -> (ComponentResult _rv)"},
9024 {"FlashMediaSetZoom", (PyCFunction)Qt_FlashMediaSetZoom, 1,
9025 "(MediaHandler mh, short factor) -> (ComponentResult _rv)"},
9026 {"FlashMediaSetZoomRect", (PyCFunction)Qt_FlashMediaSetZoomRect, 1,
9027 "(MediaHandler mh, long left, long top, long right, long bottom) -> (ComponentResult _rv)"},
9028 {"FlashMediaGetRefConBounds", (PyCFunction)Qt_FlashMediaGetRefConBounds, 1,
9029 "(MediaHandler mh, long refCon) -> (ComponentResult _rv, long left, long top, long right, long bottom)"},
9030 {"FlashMediaGetRefConID", (PyCFunction)Qt_FlashMediaGetRefConID, 1,
9031 "(MediaHandler mh, long refCon) -> (ComponentResult _rv, long refConID)"},
9032 {"FlashMediaIDToRefCon", (PyCFunction)Qt_FlashMediaIDToRefCon, 1,
9033 "(MediaHandler mh, long refConID) -> (ComponentResult _rv, long refCon)"},
9034 {"FlashMediaGetDisplayedFrameNumber", (PyCFunction)Qt_FlashMediaGetDisplayedFrameNumber, 1,
9035 "(MediaHandler mh) -> (ComponentResult _rv, long flashFrameNumber)"},
9036 {"FlashMediaFrameNumberToMovieTime", (PyCFunction)Qt_FlashMediaFrameNumberToMovieTime, 1,
9037 "(MediaHandler mh, long flashFrameNumber) -> (ComponentResult _rv, TimeValue movieTime)"},
9038 {"FlashMediaFrameLabelToMovieTime", (PyCFunction)Qt_FlashMediaFrameLabelToMovieTime, 1,
9039 "(MediaHandler mh, Ptr theLabel) -> (ComponentResult _rv, TimeValue movieTime)"},
9040 {"MovieMediaGetCurrentMovieProperty", (PyCFunction)Qt_MovieMediaGetCurrentMovieProperty, 1,
9041 "(MediaHandler mh, OSType whichProperty, void * value) -> (ComponentResult _rv)"},
9042 {"MovieMediaGetCurrentTrackProperty", (PyCFunction)Qt_MovieMediaGetCurrentTrackProperty, 1,
9043 "(MediaHandler mh, long trackID, OSType whichProperty, void * value) -> (ComponentResult _rv)"},
9044 {"MovieMediaGetChildMovieDataReference", (PyCFunction)Qt_MovieMediaGetChildMovieDataReference, 1,
9045 "(MediaHandler mh, QTAtomID dataRefID, short dataRefIndex) -> (ComponentResult _rv, OSType dataRefType, Handle dataRef, QTAtomID dataRefIDOut, short dataRefIndexOut)"},
9046 {"MovieMediaSetChildMovieDataReference", (PyCFunction)Qt_MovieMediaSetChildMovieDataReference, 1,
9047 "(MediaHandler mh, QTAtomID dataRefID, OSType dataRefType, Handle dataRef) -> (ComponentResult _rv)"},
9048 {"MovieMediaLoadChildMovieFromDataReference", (PyCFunction)Qt_MovieMediaLoadChildMovieFromDataReference, 1,
9049 "(MediaHandler mh, QTAtomID dataRefID) -> (ComponentResult _rv)"},
9050 {"Media3DGetCurrentGroup", (PyCFunction)Qt_Media3DGetCurrentGroup, 1,
9051 "(MediaHandler mh, void * group) -> (ComponentResult _rv)"},
9052 {"Media3DTranslateNamedObjectTo", (PyCFunction)Qt_Media3DTranslateNamedObjectTo, 1,
9053 "(MediaHandler mh, Fixed x, Fixed y, Fixed z) -> (ComponentResult _rv, char objectName)"},
9054 {"Media3DScaleNamedObjectTo", (PyCFunction)Qt_Media3DScaleNamedObjectTo, 1,
9055 "(MediaHandler mh, Fixed xScale, Fixed yScale, Fixed zScale) -> (ComponentResult _rv, char objectName)"},
9056 {"Media3DRotateNamedObjectTo", (PyCFunction)Qt_Media3DRotateNamedObjectTo, 1,
9057 "(MediaHandler mh, Fixed xDegrees, Fixed yDegrees, Fixed zDegrees) -> (ComponentResult _rv, char objectName)"},
9058 {"Media3DSetCameraData", (PyCFunction)Qt_Media3DSetCameraData, 1,
9059 "(MediaHandler mh, void * cameraData) -> (ComponentResult _rv)"},
9060 {"Media3DGetCameraData", (PyCFunction)Qt_Media3DGetCameraData, 1,
9061 "(MediaHandler mh, void * cameraData) -> (ComponentResult _rv)"},
9062 {"Media3DSetCameraAngleAspect", (PyCFunction)Qt_Media3DSetCameraAngleAspect, 1,
9063 "(MediaHandler mh, QTFloatSingle fov, QTFloatSingle aspectRatioXToY) -> (ComponentResult _rv)"},
9064 {"Media3DGetCameraAngleAspect", (PyCFunction)Qt_Media3DGetCameraAngleAspect, 1,
9065 "(MediaHandler mh) -> (ComponentResult _rv, QTFloatSingle fov, QTFloatSingle aspectRatioXToY)"},
9066 {"Media3DSetCameraRange", (PyCFunction)Qt_Media3DSetCameraRange, 1,
9067 "(MediaHandler mh, void * tQ3CameraRange) -> (ComponentResult _rv)"},
9068 {"Media3DGetCameraRange", (PyCFunction)Qt_Media3DGetCameraRange, 1,
9069 "(MediaHandler mh, void * tQ3CameraRange) -> (ComponentResult _rv)"},
9070 {"Media3DGetViewObject", (PyCFunction)Qt_Media3DGetViewObject, 1,
9071 "(MediaHandler mh, void * tq3viewObject) -> (ComponentResult _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00009072 {"NewTimeBase", (PyCFunction)Qt_NewTimeBase, 1,
9073 "() -> (TimeBase _rv)"},
Jack Jansenb2006391998-04-23 13:22:44 +00009074 {"ConvertTime", (PyCFunction)Qt_ConvertTime, 1,
Jack Jansen1b7a70f2000-03-03 17:06:13 +00009075 "(TimeRecord inout, TimeBase newBase) -> (TimeRecord inout)"},
Jack Jansenb2006391998-04-23 13:22:44 +00009076 {"ConvertTimeScale", (PyCFunction)Qt_ConvertTimeScale, 1,
Jack Jansen1b7a70f2000-03-03 17:06:13 +00009077 "(TimeRecord inout, TimeScale newScale) -> (TimeRecord inout)"},
Jack Jansenb2006391998-04-23 13:22:44 +00009078 {"AddTime", (PyCFunction)Qt_AddTime, 1,
Jack Jansen1b7a70f2000-03-03 17:06:13 +00009079 "(TimeRecord dst, TimeRecord src) -> (TimeRecord dst)"},
Jack Jansenb2006391998-04-23 13:22:44 +00009080 {"SubtractTime", (PyCFunction)Qt_SubtractTime, 1,
Jack Jansen1b7a70f2000-03-03 17:06:13 +00009081 "(TimeRecord dst, TimeRecord src) -> (TimeRecord dst)"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00009082 {"MusicMediaGetIndexedTunePlayer", (PyCFunction)Qt_MusicMediaGetIndexedTunePlayer, 1,
9083 "(ComponentInstance ti, long sampleDescIndex) -> (ComponentResult _rv, ComponentInstance tp)"},
Jack Jansen9cfea101995-12-09 14:05:56 +00009084 {"AlignWindow", (PyCFunction)Qt_AlignWindow, 1,
9085 "(WindowPtr wp, Boolean front) -> None"},
9086 {"DragAlignedWindow", (PyCFunction)Qt_DragAlignedWindow, 1,
9087 "(WindowPtr wp, Point startPt, Rect boundsRect) -> None"},
Jack Jansend81fc3c1998-07-22 13:37:37 +00009088 {"MoviesTask", (PyCFunction)Qt_MoviesTask, 1,
9089 "(long maxMilliSecToUse) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00009090 {NULL, NULL, 0}
9091};
9092
9093
9094
9095
9096void initQt()
9097{
9098 PyObject *m;
9099 PyObject *d;
9100
9101
9102
9103
9104 m = Py_InitModule("Qt", Qt_methods);
9105 d = PyModule_GetDict(m);
9106 Qt_Error = PyMac_GetOSErrException();
9107 if (Qt_Error == NULL ||
9108 PyDict_SetItemString(d, "Error", Qt_Error) != 0)
Jack Jansen723ad8a2000-12-12 22:10:21 +00009109 return;
Jack Jansena755e681997-09-20 17:40:22 +00009110 MovieController_Type.ob_type = &PyType_Type;
9111 Py_INCREF(&MovieController_Type);
9112 if (PyDict_SetItemString(d, "MovieControllerType", (PyObject *)&MovieController_Type) != 0)
9113 Py_FatalError("can't initialize MovieControllerType");
9114 TimeBase_Type.ob_type = &PyType_Type;
9115 Py_INCREF(&TimeBase_Type);
9116 if (PyDict_SetItemString(d, "TimeBaseType", (PyObject *)&TimeBase_Type) != 0)
9117 Py_FatalError("can't initialize TimeBaseType");
9118 UserData_Type.ob_type = &PyType_Type;
9119 Py_INCREF(&UserData_Type);
9120 if (PyDict_SetItemString(d, "UserDataType", (PyObject *)&UserData_Type) != 0)
9121 Py_FatalError("can't initialize UserDataType");
9122 Media_Type.ob_type = &PyType_Type;
9123 Py_INCREF(&Media_Type);
9124 if (PyDict_SetItemString(d, "MediaType", (PyObject *)&Media_Type) != 0)
9125 Py_FatalError("can't initialize MediaType");
9126 Track_Type.ob_type = &PyType_Type;
9127 Py_INCREF(&Track_Type);
9128 if (PyDict_SetItemString(d, "TrackType", (PyObject *)&Track_Type) != 0)
9129 Py_FatalError("can't initialize TrackType");
9130 Movie_Type.ob_type = &PyType_Type;
9131 Py_INCREF(&Movie_Type);
9132 if (PyDict_SetItemString(d, "MovieType", (PyObject *)&Movie_Type) != 0)
9133 Py_FatalError("can't initialize MovieType");
Jack Jansen453ced51995-11-30 17:42:08 +00009134}
9135
9136/* ========================= End module Qt ========================== */
9137