Added 'list_only' option (and modified 'run()' to respect it).
[python/dscho.git] / Mac / Modules / qt / Qtmodule.c
blob540915eb23523c76c915ce913d62e0f9dc53e9ca
2 /* =========================== Module Qt ============================ */
4 #include "Python.h"
8 #define SystemSevenOrLater 1
10 #include "macglue.h"
11 #include <Memory.h>
12 #include <Dialogs.h>
13 #include <Menus.h>
14 #include <Controls.h>
16 extern PyObject *ResObj_New(Handle);
17 extern int ResObj_Convert(PyObject *, Handle *);
18 extern PyObject *OptResObj_New(Handle);
19 extern int OptResObj_Convert(PyObject *, Handle *);
21 extern PyObject *WinObj_New(WindowPtr);
22 extern int WinObj_Convert(PyObject *, WindowPtr *);
23 extern PyTypeObject Window_Type;
24 #define WinObj_Check(x) ((x)->ob_type == &Window_Type)
26 extern PyObject *DlgObj_New(DialogPtr);
27 extern int DlgObj_Convert(PyObject *, DialogPtr *);
28 extern PyTypeObject Dialog_Type;
29 #define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type)
31 extern PyObject *MenuObj_New(MenuHandle);
32 extern int MenuObj_Convert(PyObject *, MenuHandle *);
34 extern PyObject *CtlObj_New(ControlHandle);
35 extern int CtlObj_Convert(PyObject *, ControlHandle *);
37 extern PyObject *GrafObj_New(GrafPtr);
38 extern int GrafObj_Convert(PyObject *, GrafPtr *);
40 extern PyObject *BMObj_New(BitMapPtr);
41 extern int BMObj_Convert(PyObject *, BitMapPtr *);
43 extern PyObject *WinObj_WhichWindow(WindowPtr);
45 #include <Movies.h>
47 /* Exported by Cmmodule.c: */
48 extern PyObject *CmpObj_New(Component);
49 extern int CmpObj_Convert(PyObject *, Component *);
50 extern PyObject *CmpInstObj_New(ComponentInstance);
51 extern int CmpInstObj_Convert(PyObject *, ComponentInstance *);
53 /* Exported by Qdmodule.c: */
54 extern PyObject *QdRGB_New(RGBColor *);
55 extern int QdRGB_Convert(PyObject *, RGBColor *);
57 /* Our own, used before defined: */
58 staticforward PyObject *TrackObj_New(Track);
59 staticforward int TrackObj_Convert(PyObject *, Track *);
60 staticforward PyObject *MovieObj_New(Movie);
61 staticforward int MovieObj_Convert(PyObject *, Movie *);
62 staticforward PyObject *MovieCtlObj_New(MovieController);
63 staticforward int MovieCtlObj_Convert(PyObject *, TimeBase *);
64 staticforward PyObject *TimeBaseObj_New(TimeBase);
65 staticforward int TimeBaseObj_Convert(PyObject *, TimeBase *);
68 ** Parse/generate time records
70 static PyObject *
71 QtTimeRecord_New(itself)
72 TimeRecord *itself;
75 return Py_BuildValue("O&lO&", PyMac_Buildwide, &itself->value, itself->scale,
76 TimeBaseObj_New, itself->base);
79 static int
80 QtTimeRecord_Convert(v, p_itself)
81 PyObject *v;
82 TimeRecord *p_itself;
85 if( !PyArg_ParseTuple(v, "O&lO&", PyMac_Getwide, &p_itself->value, &p_itself->scale,
86 TimeBaseObj_Convert, &p_itself->base) )
87 return 0;
88 return 1;
94 static PyObject *Qt_Error;
96 /* ------------------ Object type MovieController ------------------- */
98 PyTypeObject MovieController_Type;
100 #define MovieCtlObj_Check(x) ((x)->ob_type == &MovieController_Type)
102 typedef struct MovieControllerObject {
103 PyObject_HEAD
104 MovieController ob_itself;
105 } MovieControllerObject;
107 PyObject *MovieCtlObj_New(itself)
108 MovieController itself;
110 MovieControllerObject *it;
111 if (itself == NULL) {
112 PyErr_SetString(Qt_Error,"Cannot create null MovieController");
113 return NULL;
115 it = PyObject_NEW(MovieControllerObject, &MovieController_Type);
116 if (it == NULL) return NULL;
117 it->ob_itself = itself;
118 return (PyObject *)it;
120 MovieCtlObj_Convert(v, p_itself)
121 PyObject *v;
122 MovieController *p_itself;
124 if (!MovieCtlObj_Check(v))
126 PyErr_SetString(PyExc_TypeError, "MovieController required");
127 return 0;
129 *p_itself = ((MovieControllerObject *)v)->ob_itself;
130 return 1;
133 static void MovieCtlObj_dealloc(self)
134 MovieControllerObject *self;
136 DisposeMovieController(self->ob_itself);
137 PyMem_DEL(self);
140 static PyObject *MovieCtlObj_MCSetMovie(_self, _args)
141 MovieControllerObject *_self;
142 PyObject *_args;
144 PyObject *_res = NULL;
145 ComponentResult _rv;
146 Movie theMovie;
147 WindowPtr movieWindow;
148 Point where;
149 if (!PyArg_ParseTuple(_args, "O&O&O&",
150 MovieObj_Convert, &theMovie,
151 WinObj_Convert, &movieWindow,
152 PyMac_GetPoint, &where))
153 return NULL;
154 _rv = MCSetMovie(_self->ob_itself,
155 theMovie,
156 movieWindow,
157 where);
158 _res = Py_BuildValue("l",
159 _rv);
160 return _res;
163 static PyObject *MovieCtlObj_MCGetIndMovie(_self, _args)
164 MovieControllerObject *_self;
165 PyObject *_args;
167 PyObject *_res = NULL;
168 Movie _rv;
169 short index;
170 if (!PyArg_ParseTuple(_args, "h",
171 &index))
172 return NULL;
173 _rv = MCGetIndMovie(_self->ob_itself,
174 index);
175 _res = Py_BuildValue("O&",
176 MovieObj_New, _rv);
177 return _res;
180 static PyObject *MovieCtlObj_MCRemoveAllMovies(_self, _args)
181 MovieControllerObject *_self;
182 PyObject *_args;
184 PyObject *_res = NULL;
185 ComponentResult _rv;
186 if (!PyArg_ParseTuple(_args, ""))
187 return NULL;
188 _rv = MCRemoveAllMovies(_self->ob_itself);
189 _res = Py_BuildValue("l",
190 _rv);
191 return _res;
194 static PyObject *MovieCtlObj_MCRemoveAMovie(_self, _args)
195 MovieControllerObject *_self;
196 PyObject *_args;
198 PyObject *_res = NULL;
199 ComponentResult _rv;
200 Movie m;
201 if (!PyArg_ParseTuple(_args, "O&",
202 MovieObj_Convert, &m))
203 return NULL;
204 _rv = MCRemoveAMovie(_self->ob_itself,
206 _res = Py_BuildValue("l",
207 _rv);
208 return _res;
211 static PyObject *MovieCtlObj_MCRemoveMovie(_self, _args)
212 MovieControllerObject *_self;
213 PyObject *_args;
215 PyObject *_res = NULL;
216 ComponentResult _rv;
217 if (!PyArg_ParseTuple(_args, ""))
218 return NULL;
219 _rv = MCRemoveMovie(_self->ob_itself);
220 _res = Py_BuildValue("l",
221 _rv);
222 return _res;
225 static PyObject *MovieCtlObj_MCIsPlayerEvent(_self, _args)
226 MovieControllerObject *_self;
227 PyObject *_args;
229 PyObject *_res = NULL;
230 ComponentResult _rv;
231 EventRecord e;
232 if (!PyArg_ParseTuple(_args, "O&",
233 PyMac_GetEventRecord, &e))
234 return NULL;
235 _rv = MCIsPlayerEvent(_self->ob_itself,
236 &e);
237 _res = Py_BuildValue("l",
238 _rv);
239 return _res;
242 static PyObject *MovieCtlObj_MCDoAction(_self, _args)
243 MovieControllerObject *_self;
244 PyObject *_args;
246 PyObject *_res = NULL;
247 ComponentResult _rv;
248 short action;
249 void * params;
250 if (!PyArg_ParseTuple(_args, "hs",
251 &action,
252 &params))
253 return NULL;
254 _rv = MCDoAction(_self->ob_itself,
255 action,
256 params);
257 _res = Py_BuildValue("l",
258 _rv);
259 return _res;
262 static PyObject *MovieCtlObj_MCSetControllerAttached(_self, _args)
263 MovieControllerObject *_self;
264 PyObject *_args;
266 PyObject *_res = NULL;
267 ComponentResult _rv;
268 Boolean attach;
269 if (!PyArg_ParseTuple(_args, "b",
270 &attach))
271 return NULL;
272 _rv = MCSetControllerAttached(_self->ob_itself,
273 attach);
274 _res = Py_BuildValue("l",
275 _rv);
276 return _res;
279 static PyObject *MovieCtlObj_MCIsControllerAttached(_self, _args)
280 MovieControllerObject *_self;
281 PyObject *_args;
283 PyObject *_res = NULL;
284 ComponentResult _rv;
285 if (!PyArg_ParseTuple(_args, ""))
286 return NULL;
287 _rv = MCIsControllerAttached(_self->ob_itself);
288 _res = Py_BuildValue("l",
289 _rv);
290 return _res;
293 static PyObject *MovieCtlObj_MCSetControllerPort(_self, _args)
294 MovieControllerObject *_self;
295 PyObject *_args;
297 PyObject *_res = NULL;
298 ComponentResult _rv;
299 CGrafPtr gp;
300 if (!PyArg_ParseTuple(_args, "O&",
301 GrafObj_Convert, &gp))
302 return NULL;
303 _rv = MCSetControllerPort(_self->ob_itself,
304 gp);
305 _res = Py_BuildValue("l",
306 _rv);
307 return _res;
310 static PyObject *MovieCtlObj_MCGetControllerPort(_self, _args)
311 MovieControllerObject *_self;
312 PyObject *_args;
314 PyObject *_res = NULL;
315 CGrafPtr _rv;
316 if (!PyArg_ParseTuple(_args, ""))
317 return NULL;
318 _rv = MCGetControllerPort(_self->ob_itself);
319 _res = Py_BuildValue("O&",
320 GrafObj_New, _rv);
321 return _res;
324 static PyObject *MovieCtlObj_MCSetVisible(_self, _args)
325 MovieControllerObject *_self;
326 PyObject *_args;
328 PyObject *_res = NULL;
329 ComponentResult _rv;
330 Boolean visible;
331 if (!PyArg_ParseTuple(_args, "b",
332 &visible))
333 return NULL;
334 _rv = MCSetVisible(_self->ob_itself,
335 visible);
336 _res = Py_BuildValue("l",
337 _rv);
338 return _res;
341 static PyObject *MovieCtlObj_MCGetVisible(_self, _args)
342 MovieControllerObject *_self;
343 PyObject *_args;
345 PyObject *_res = NULL;
346 ComponentResult _rv;
347 if (!PyArg_ParseTuple(_args, ""))
348 return NULL;
349 _rv = MCGetVisible(_self->ob_itself);
350 _res = Py_BuildValue("l",
351 _rv);
352 return _res;
355 static PyObject *MovieCtlObj_MCGetControllerBoundsRect(_self, _args)
356 MovieControllerObject *_self;
357 PyObject *_args;
359 PyObject *_res = NULL;
360 ComponentResult _rv;
361 Rect bounds;
362 if (!PyArg_ParseTuple(_args, ""))
363 return NULL;
364 _rv = MCGetControllerBoundsRect(_self->ob_itself,
365 &bounds);
366 _res = Py_BuildValue("lO&",
367 _rv,
368 PyMac_BuildRect, &bounds);
369 return _res;
372 static PyObject *MovieCtlObj_MCSetControllerBoundsRect(_self, _args)
373 MovieControllerObject *_self;
374 PyObject *_args;
376 PyObject *_res = NULL;
377 ComponentResult _rv;
378 Rect bounds;
379 if (!PyArg_ParseTuple(_args, "O&",
380 PyMac_GetRect, &bounds))
381 return NULL;
382 _rv = MCSetControllerBoundsRect(_self->ob_itself,
383 &bounds);
384 _res = Py_BuildValue("l",
385 _rv);
386 return _res;
389 static PyObject *MovieCtlObj_MCGetControllerBoundsRgn(_self, _args)
390 MovieControllerObject *_self;
391 PyObject *_args;
393 PyObject *_res = NULL;
394 RgnHandle _rv;
395 if (!PyArg_ParseTuple(_args, ""))
396 return NULL;
397 _rv = MCGetControllerBoundsRgn(_self->ob_itself);
398 _res = Py_BuildValue("O&",
399 ResObj_New, _rv);
400 return _res;
403 static PyObject *MovieCtlObj_MCGetWindowRgn(_self, _args)
404 MovieControllerObject *_self;
405 PyObject *_args;
407 PyObject *_res = NULL;
408 RgnHandle _rv;
409 WindowPtr w;
410 if (!PyArg_ParseTuple(_args, "O&",
411 WinObj_Convert, &w))
412 return NULL;
413 _rv = MCGetWindowRgn(_self->ob_itself,
415 _res = Py_BuildValue("O&",
416 ResObj_New, _rv);
417 return _res;
420 static PyObject *MovieCtlObj_MCMovieChanged(_self, _args)
421 MovieControllerObject *_self;
422 PyObject *_args;
424 PyObject *_res = NULL;
425 ComponentResult _rv;
426 Movie m;
427 if (!PyArg_ParseTuple(_args, "O&",
428 MovieObj_Convert, &m))
429 return NULL;
430 _rv = MCMovieChanged(_self->ob_itself,
432 _res = Py_BuildValue("l",
433 _rv);
434 return _res;
437 static PyObject *MovieCtlObj_MCSetDuration(_self, _args)
438 MovieControllerObject *_self;
439 PyObject *_args;
441 PyObject *_res = NULL;
442 ComponentResult _rv;
443 TimeValue duration;
444 if (!PyArg_ParseTuple(_args, "l",
445 &duration))
446 return NULL;
447 _rv = MCSetDuration(_self->ob_itself,
448 duration);
449 _res = Py_BuildValue("l",
450 _rv);
451 return _res;
454 static PyObject *MovieCtlObj_MCGetCurrentTime(_self, _args)
455 MovieControllerObject *_self;
456 PyObject *_args;
458 PyObject *_res = NULL;
459 TimeValue _rv;
460 TimeScale scale;
461 if (!PyArg_ParseTuple(_args, ""))
462 return NULL;
463 _rv = MCGetCurrentTime(_self->ob_itself,
464 &scale);
465 _res = Py_BuildValue("ll",
466 _rv,
467 scale);
468 return _res;
471 static PyObject *MovieCtlObj_MCNewAttachedController(_self, _args)
472 MovieControllerObject *_self;
473 PyObject *_args;
475 PyObject *_res = NULL;
476 ComponentResult _rv;
477 Movie theMovie;
478 WindowPtr w;
479 Point where;
480 if (!PyArg_ParseTuple(_args, "O&O&O&",
481 MovieObj_Convert, &theMovie,
482 WinObj_Convert, &w,
483 PyMac_GetPoint, &where))
484 return NULL;
485 _rv = MCNewAttachedController(_self->ob_itself,
486 theMovie,
488 where);
489 _res = Py_BuildValue("l",
490 _rv);
491 return _res;
494 static PyObject *MovieCtlObj_MCDraw(_self, _args)
495 MovieControllerObject *_self;
496 PyObject *_args;
498 PyObject *_res = NULL;
499 ComponentResult _rv;
500 WindowPtr w;
501 if (!PyArg_ParseTuple(_args, "O&",
502 WinObj_Convert, &w))
503 return NULL;
504 _rv = MCDraw(_self->ob_itself,
506 _res = Py_BuildValue("l",
507 _rv);
508 return _res;
511 static PyObject *MovieCtlObj_MCActivate(_self, _args)
512 MovieControllerObject *_self;
513 PyObject *_args;
515 PyObject *_res = NULL;
516 ComponentResult _rv;
517 WindowPtr w;
518 Boolean activate;
519 if (!PyArg_ParseTuple(_args, "O&b",
520 WinObj_Convert, &w,
521 &activate))
522 return NULL;
523 _rv = MCActivate(_self->ob_itself,
525 activate);
526 _res = Py_BuildValue("l",
527 _rv);
528 return _res;
531 static PyObject *MovieCtlObj_MCIdle(_self, _args)
532 MovieControllerObject *_self;
533 PyObject *_args;
535 PyObject *_res = NULL;
536 ComponentResult _rv;
537 if (!PyArg_ParseTuple(_args, ""))
538 return NULL;
539 _rv = MCIdle(_self->ob_itself);
540 _res = Py_BuildValue("l",
541 _rv);
542 return _res;
545 static PyObject *MovieCtlObj_MCKey(_self, _args)
546 MovieControllerObject *_self;
547 PyObject *_args;
549 PyObject *_res = NULL;
550 ComponentResult _rv;
551 SInt8 key;
552 long modifiers;
553 if (!PyArg_ParseTuple(_args, "bl",
554 &key,
555 &modifiers))
556 return NULL;
557 _rv = MCKey(_self->ob_itself,
558 key,
559 modifiers);
560 _res = Py_BuildValue("l",
561 _rv);
562 return _res;
565 static PyObject *MovieCtlObj_MCClick(_self, _args)
566 MovieControllerObject *_self;
567 PyObject *_args;
569 PyObject *_res = NULL;
570 ComponentResult _rv;
571 WindowPtr w;
572 Point where;
573 long when;
574 long modifiers;
575 if (!PyArg_ParseTuple(_args, "O&O&ll",
576 WinObj_Convert, &w,
577 PyMac_GetPoint, &where,
578 &when,
579 &modifiers))
580 return NULL;
581 _rv = MCClick(_self->ob_itself,
583 where,
584 when,
585 modifiers);
586 _res = Py_BuildValue("l",
587 _rv);
588 return _res;
591 static PyObject *MovieCtlObj_MCEnableEditing(_self, _args)
592 MovieControllerObject *_self;
593 PyObject *_args;
595 PyObject *_res = NULL;
596 ComponentResult _rv;
597 Boolean enabled;
598 if (!PyArg_ParseTuple(_args, "b",
599 &enabled))
600 return NULL;
601 _rv = MCEnableEditing(_self->ob_itself,
602 enabled);
603 _res = Py_BuildValue("l",
604 _rv);
605 return _res;
608 static PyObject *MovieCtlObj_MCIsEditingEnabled(_self, _args)
609 MovieControllerObject *_self;
610 PyObject *_args;
612 PyObject *_res = NULL;
613 long _rv;
614 if (!PyArg_ParseTuple(_args, ""))
615 return NULL;
616 _rv = MCIsEditingEnabled(_self->ob_itself);
617 _res = Py_BuildValue("l",
618 _rv);
619 return _res;
622 static PyObject *MovieCtlObj_MCCopy(_self, _args)
623 MovieControllerObject *_self;
624 PyObject *_args;
626 PyObject *_res = NULL;
627 Movie _rv;
628 if (!PyArg_ParseTuple(_args, ""))
629 return NULL;
630 _rv = MCCopy(_self->ob_itself);
631 _res = Py_BuildValue("O&",
632 MovieObj_New, _rv);
633 return _res;
636 static PyObject *MovieCtlObj_MCCut(_self, _args)
637 MovieControllerObject *_self;
638 PyObject *_args;
640 PyObject *_res = NULL;
641 Movie _rv;
642 if (!PyArg_ParseTuple(_args, ""))
643 return NULL;
644 _rv = MCCut(_self->ob_itself);
645 _res = Py_BuildValue("O&",
646 MovieObj_New, _rv);
647 return _res;
650 static PyObject *MovieCtlObj_MCPaste(_self, _args)
651 MovieControllerObject *_self;
652 PyObject *_args;
654 PyObject *_res = NULL;
655 ComponentResult _rv;
656 Movie srcMovie;
657 if (!PyArg_ParseTuple(_args, "O&",
658 MovieObj_Convert, &srcMovie))
659 return NULL;
660 _rv = MCPaste(_self->ob_itself,
661 srcMovie);
662 _res = Py_BuildValue("l",
663 _rv);
664 return _res;
667 static PyObject *MovieCtlObj_MCClear(_self, _args)
668 MovieControllerObject *_self;
669 PyObject *_args;
671 PyObject *_res = NULL;
672 ComponentResult _rv;
673 if (!PyArg_ParseTuple(_args, ""))
674 return NULL;
675 _rv = MCClear(_self->ob_itself);
676 _res = Py_BuildValue("l",
677 _rv);
678 return _res;
681 static PyObject *MovieCtlObj_MCUndo(_self, _args)
682 MovieControllerObject *_self;
683 PyObject *_args;
685 PyObject *_res = NULL;
686 ComponentResult _rv;
687 if (!PyArg_ParseTuple(_args, ""))
688 return NULL;
689 _rv = MCUndo(_self->ob_itself);
690 _res = Py_BuildValue("l",
691 _rv);
692 return _res;
695 static PyObject *MovieCtlObj_MCPositionController(_self, _args)
696 MovieControllerObject *_self;
697 PyObject *_args;
699 PyObject *_res = NULL;
700 ComponentResult _rv;
701 Rect movieRect;
702 Rect controllerRect;
703 long someFlags;
704 if (!PyArg_ParseTuple(_args, "O&O&l",
705 PyMac_GetRect, &movieRect,
706 PyMac_GetRect, &controllerRect,
707 &someFlags))
708 return NULL;
709 _rv = MCPositionController(_self->ob_itself,
710 &movieRect,
711 &controllerRect,
712 someFlags);
713 _res = Py_BuildValue("l",
714 _rv);
715 return _res;
718 static PyObject *MovieCtlObj_MCGetControllerInfo(_self, _args)
719 MovieControllerObject *_self;
720 PyObject *_args;
722 PyObject *_res = NULL;
723 ComponentResult _rv;
724 long someFlags;
725 if (!PyArg_ParseTuple(_args, ""))
726 return NULL;
727 _rv = MCGetControllerInfo(_self->ob_itself,
728 &someFlags);
729 _res = Py_BuildValue("ll",
730 _rv,
731 someFlags);
732 return _res;
735 static PyObject *MovieCtlObj_MCSetClip(_self, _args)
736 MovieControllerObject *_self;
737 PyObject *_args;
739 PyObject *_res = NULL;
740 ComponentResult _rv;
741 RgnHandle theClip;
742 RgnHandle movieClip;
743 if (!PyArg_ParseTuple(_args, "O&O&",
744 ResObj_Convert, &theClip,
745 ResObj_Convert, &movieClip))
746 return NULL;
747 _rv = MCSetClip(_self->ob_itself,
748 theClip,
749 movieClip);
750 _res = Py_BuildValue("l",
751 _rv);
752 return _res;
755 static PyObject *MovieCtlObj_MCGetClip(_self, _args)
756 MovieControllerObject *_self;
757 PyObject *_args;
759 PyObject *_res = NULL;
760 ComponentResult _rv;
761 RgnHandle theClip;
762 RgnHandle movieClip;
763 if (!PyArg_ParseTuple(_args, ""))
764 return NULL;
765 _rv = MCGetClip(_self->ob_itself,
766 &theClip,
767 &movieClip);
768 _res = Py_BuildValue("lO&O&",
769 _rv,
770 ResObj_New, theClip,
771 ResObj_New, movieClip);
772 return _res;
775 static PyObject *MovieCtlObj_MCDrawBadge(_self, _args)
776 MovieControllerObject *_self;
777 PyObject *_args;
779 PyObject *_res = NULL;
780 ComponentResult _rv;
781 RgnHandle movieRgn;
782 RgnHandle badgeRgn;
783 if (!PyArg_ParseTuple(_args, "O&",
784 ResObj_Convert, &movieRgn))
785 return NULL;
786 _rv = MCDrawBadge(_self->ob_itself,
787 movieRgn,
788 &badgeRgn);
789 _res = Py_BuildValue("lO&",
790 _rv,
791 ResObj_New, badgeRgn);
792 return _res;
795 static PyObject *MovieCtlObj_MCSetUpEditMenu(_self, _args)
796 MovieControllerObject *_self;
797 PyObject *_args;
799 PyObject *_res = NULL;
800 ComponentResult _rv;
801 long modifiers;
802 MenuHandle mh;
803 if (!PyArg_ParseTuple(_args, "lO&",
804 &modifiers,
805 MenuObj_Convert, &mh))
806 return NULL;
807 _rv = MCSetUpEditMenu(_self->ob_itself,
808 modifiers,
809 mh);
810 _res = Py_BuildValue("l",
811 _rv);
812 return _res;
815 static PyObject *MovieCtlObj_MCGetMenuString(_self, _args)
816 MovieControllerObject *_self;
817 PyObject *_args;
819 PyObject *_res = NULL;
820 ComponentResult _rv;
821 long modifiers;
822 short item;
823 Str255 aString;
824 if (!PyArg_ParseTuple(_args, "lhO&",
825 &modifiers,
826 &item,
827 PyMac_GetStr255, aString))
828 return NULL;
829 _rv = MCGetMenuString(_self->ob_itself,
830 modifiers,
831 item,
832 aString);
833 _res = Py_BuildValue("l",
834 _rv);
835 return _res;
838 static PyObject *MovieCtlObj_MCPtInController(_self, _args)
839 MovieControllerObject *_self;
840 PyObject *_args;
842 PyObject *_res = NULL;
843 ComponentResult _rv;
844 Point thePt;
845 Boolean inController;
846 if (!PyArg_ParseTuple(_args, "O&",
847 PyMac_GetPoint, &thePt))
848 return NULL;
849 _rv = MCPtInController(_self->ob_itself,
850 thePt,
851 &inController);
852 _res = Py_BuildValue("lb",
853 _rv,
854 inController);
855 return _res;
858 static PyObject *MovieCtlObj_MCInvalidate(_self, _args)
859 MovieControllerObject *_self;
860 PyObject *_args;
862 PyObject *_res = NULL;
863 ComponentResult _rv;
864 WindowPtr w;
865 RgnHandle invalidRgn;
866 if (!PyArg_ParseTuple(_args, "O&O&",
867 WinObj_Convert, &w,
868 ResObj_Convert, &invalidRgn))
869 return NULL;
870 _rv = MCInvalidate(_self->ob_itself,
872 invalidRgn);
873 _res = Py_BuildValue("l",
874 _rv);
875 return _res;
878 static PyObject *MovieCtlObj_MCAdjustCursor(_self, _args)
879 MovieControllerObject *_self;
880 PyObject *_args;
882 PyObject *_res = NULL;
883 ComponentResult _rv;
884 WindowPtr w;
885 Point where;
886 long modifiers;
887 if (!PyArg_ParseTuple(_args, "O&O&l",
888 WinObj_Convert, &w,
889 PyMac_GetPoint, &where,
890 &modifiers))
891 return NULL;
892 _rv = MCAdjustCursor(_self->ob_itself,
894 where,
895 modifiers);
896 _res = Py_BuildValue("l",
897 _rv);
898 return _res;
901 static PyObject *MovieCtlObj_MCGetInterfaceElement(_self, _args)
902 MovieControllerObject *_self;
903 PyObject *_args;
905 PyObject *_res = NULL;
906 ComponentResult _rv;
907 MCInterfaceElement whichElement;
908 void * element;
909 if (!PyArg_ParseTuple(_args, "ls",
910 &whichElement,
911 &element))
912 return NULL;
913 _rv = MCGetInterfaceElement(_self->ob_itself,
914 whichElement,
915 element);
916 _res = Py_BuildValue("l",
917 _rv);
918 return _res;
921 static PyMethodDef MovieCtlObj_methods[] = {
922 {"MCSetMovie", (PyCFunction)MovieCtlObj_MCSetMovie, 1,
923 "(Movie theMovie, WindowPtr movieWindow, Point where) -> (ComponentResult _rv)"},
924 {"MCGetIndMovie", (PyCFunction)MovieCtlObj_MCGetIndMovie, 1,
925 "(short index) -> (Movie _rv)"},
926 {"MCRemoveAllMovies", (PyCFunction)MovieCtlObj_MCRemoveAllMovies, 1,
927 "() -> (ComponentResult _rv)"},
928 {"MCRemoveAMovie", (PyCFunction)MovieCtlObj_MCRemoveAMovie, 1,
929 "(Movie m) -> (ComponentResult _rv)"},
930 {"MCRemoveMovie", (PyCFunction)MovieCtlObj_MCRemoveMovie, 1,
931 "() -> (ComponentResult _rv)"},
932 {"MCIsPlayerEvent", (PyCFunction)MovieCtlObj_MCIsPlayerEvent, 1,
933 "(EventRecord e) -> (ComponentResult _rv)"},
934 {"MCDoAction", (PyCFunction)MovieCtlObj_MCDoAction, 1,
935 "(short action, void * params) -> (ComponentResult _rv)"},
936 {"MCSetControllerAttached", (PyCFunction)MovieCtlObj_MCSetControllerAttached, 1,
937 "(Boolean attach) -> (ComponentResult _rv)"},
938 {"MCIsControllerAttached", (PyCFunction)MovieCtlObj_MCIsControllerAttached, 1,
939 "() -> (ComponentResult _rv)"},
940 {"MCSetControllerPort", (PyCFunction)MovieCtlObj_MCSetControllerPort, 1,
941 "(CGrafPtr gp) -> (ComponentResult _rv)"},
942 {"MCGetControllerPort", (PyCFunction)MovieCtlObj_MCGetControllerPort, 1,
943 "() -> (CGrafPtr _rv)"},
944 {"MCSetVisible", (PyCFunction)MovieCtlObj_MCSetVisible, 1,
945 "(Boolean visible) -> (ComponentResult _rv)"},
946 {"MCGetVisible", (PyCFunction)MovieCtlObj_MCGetVisible, 1,
947 "() -> (ComponentResult _rv)"},
948 {"MCGetControllerBoundsRect", (PyCFunction)MovieCtlObj_MCGetControllerBoundsRect, 1,
949 "() -> (ComponentResult _rv, Rect bounds)"},
950 {"MCSetControllerBoundsRect", (PyCFunction)MovieCtlObj_MCSetControllerBoundsRect, 1,
951 "(Rect bounds) -> (ComponentResult _rv)"},
952 {"MCGetControllerBoundsRgn", (PyCFunction)MovieCtlObj_MCGetControllerBoundsRgn, 1,
953 "() -> (RgnHandle _rv)"},
954 {"MCGetWindowRgn", (PyCFunction)MovieCtlObj_MCGetWindowRgn, 1,
955 "(WindowPtr w) -> (RgnHandle _rv)"},
956 {"MCMovieChanged", (PyCFunction)MovieCtlObj_MCMovieChanged, 1,
957 "(Movie m) -> (ComponentResult _rv)"},
958 {"MCSetDuration", (PyCFunction)MovieCtlObj_MCSetDuration, 1,
959 "(TimeValue duration) -> (ComponentResult _rv)"},
960 {"MCGetCurrentTime", (PyCFunction)MovieCtlObj_MCGetCurrentTime, 1,
961 "() -> (TimeValue _rv, TimeScale scale)"},
962 {"MCNewAttachedController", (PyCFunction)MovieCtlObj_MCNewAttachedController, 1,
963 "(Movie theMovie, WindowPtr w, Point where) -> (ComponentResult _rv)"},
964 {"MCDraw", (PyCFunction)MovieCtlObj_MCDraw, 1,
965 "(WindowPtr w) -> (ComponentResult _rv)"},
966 {"MCActivate", (PyCFunction)MovieCtlObj_MCActivate, 1,
967 "(WindowPtr w, Boolean activate) -> (ComponentResult _rv)"},
968 {"MCIdle", (PyCFunction)MovieCtlObj_MCIdle, 1,
969 "() -> (ComponentResult _rv)"},
970 {"MCKey", (PyCFunction)MovieCtlObj_MCKey, 1,
971 "(SInt8 key, long modifiers) -> (ComponentResult _rv)"},
972 {"MCClick", (PyCFunction)MovieCtlObj_MCClick, 1,
973 "(WindowPtr w, Point where, long when, long modifiers) -> (ComponentResult _rv)"},
974 {"MCEnableEditing", (PyCFunction)MovieCtlObj_MCEnableEditing, 1,
975 "(Boolean enabled) -> (ComponentResult _rv)"},
976 {"MCIsEditingEnabled", (PyCFunction)MovieCtlObj_MCIsEditingEnabled, 1,
977 "() -> (long _rv)"},
978 {"MCCopy", (PyCFunction)MovieCtlObj_MCCopy, 1,
979 "() -> (Movie _rv)"},
980 {"MCCut", (PyCFunction)MovieCtlObj_MCCut, 1,
981 "() -> (Movie _rv)"},
982 {"MCPaste", (PyCFunction)MovieCtlObj_MCPaste, 1,
983 "(Movie srcMovie) -> (ComponentResult _rv)"},
984 {"MCClear", (PyCFunction)MovieCtlObj_MCClear, 1,
985 "() -> (ComponentResult _rv)"},
986 {"MCUndo", (PyCFunction)MovieCtlObj_MCUndo, 1,
987 "() -> (ComponentResult _rv)"},
988 {"MCPositionController", (PyCFunction)MovieCtlObj_MCPositionController, 1,
989 "(Rect movieRect, Rect controllerRect, long someFlags) -> (ComponentResult _rv)"},
990 {"MCGetControllerInfo", (PyCFunction)MovieCtlObj_MCGetControllerInfo, 1,
991 "() -> (ComponentResult _rv, long someFlags)"},
992 {"MCSetClip", (PyCFunction)MovieCtlObj_MCSetClip, 1,
993 "(RgnHandle theClip, RgnHandle movieClip) -> (ComponentResult _rv)"},
994 {"MCGetClip", (PyCFunction)MovieCtlObj_MCGetClip, 1,
995 "() -> (ComponentResult _rv, RgnHandle theClip, RgnHandle movieClip)"},
996 {"MCDrawBadge", (PyCFunction)MovieCtlObj_MCDrawBadge, 1,
997 "(RgnHandle movieRgn) -> (ComponentResult _rv, RgnHandle badgeRgn)"},
998 {"MCSetUpEditMenu", (PyCFunction)MovieCtlObj_MCSetUpEditMenu, 1,
999 "(long modifiers, MenuHandle mh) -> (ComponentResult _rv)"},
1000 {"MCGetMenuString", (PyCFunction)MovieCtlObj_MCGetMenuString, 1,
1001 "(long modifiers, short item, Str255 aString) -> (ComponentResult _rv)"},
1002 {"MCPtInController", (PyCFunction)MovieCtlObj_MCPtInController, 1,
1003 "(Point thePt) -> (ComponentResult _rv, Boolean inController)"},
1004 {"MCInvalidate", (PyCFunction)MovieCtlObj_MCInvalidate, 1,
1005 "(WindowPtr w, RgnHandle invalidRgn) -> (ComponentResult _rv)"},
1006 {"MCAdjustCursor", (PyCFunction)MovieCtlObj_MCAdjustCursor, 1,
1007 "(WindowPtr w, Point where, long modifiers) -> (ComponentResult _rv)"},
1008 {"MCGetInterfaceElement", (PyCFunction)MovieCtlObj_MCGetInterfaceElement, 1,
1009 "(MCInterfaceElement whichElement, void * element) -> (ComponentResult _rv)"},
1010 {NULL, NULL, 0}
1013 PyMethodChain MovieCtlObj_chain = { MovieCtlObj_methods, NULL };
1015 static PyObject *MovieCtlObj_getattr(self, name)
1016 MovieControllerObject *self;
1017 char *name;
1019 return Py_FindMethodInChain(&MovieCtlObj_chain, (PyObject *)self, name);
1022 #define MovieCtlObj_setattr NULL
1024 PyTypeObject MovieController_Type = {
1025 PyObject_HEAD_INIT(&PyType_Type)
1026 0, /*ob_size*/
1027 "MovieController", /*tp_name*/
1028 sizeof(MovieControllerObject), /*tp_basicsize*/
1029 0, /*tp_itemsize*/
1030 /* methods */
1031 (destructor) MovieCtlObj_dealloc, /*tp_dealloc*/
1032 0, /*tp_print*/
1033 (getattrfunc) MovieCtlObj_getattr, /*tp_getattr*/
1034 (setattrfunc) MovieCtlObj_setattr, /*tp_setattr*/
1037 /* ---------------- End object type MovieController ----------------- */
1040 /* ---------------------- Object type TimeBase ---------------------- */
1042 PyTypeObject TimeBase_Type;
1044 #define TimeBaseObj_Check(x) ((x)->ob_type == &TimeBase_Type)
1046 typedef struct TimeBaseObject {
1047 PyObject_HEAD
1048 TimeBase ob_itself;
1049 } TimeBaseObject;
1051 PyObject *TimeBaseObj_New(itself)
1052 TimeBase itself;
1054 TimeBaseObject *it;
1055 if (itself == NULL) {
1056 PyErr_SetString(Qt_Error,"Cannot create null TimeBase");
1057 return NULL;
1059 it = PyObject_NEW(TimeBaseObject, &TimeBase_Type);
1060 if (it == NULL) return NULL;
1061 it->ob_itself = itself;
1062 return (PyObject *)it;
1064 TimeBaseObj_Convert(v, p_itself)
1065 PyObject *v;
1066 TimeBase *p_itself;
1068 if (!TimeBaseObj_Check(v))
1070 PyErr_SetString(PyExc_TypeError, "TimeBase required");
1071 return 0;
1073 *p_itself = ((TimeBaseObject *)v)->ob_itself;
1074 return 1;
1077 static void TimeBaseObj_dealloc(self)
1078 TimeBaseObject *self;
1080 /* Cleanup of self->ob_itself goes here */
1081 PyMem_DEL(self);
1084 static PyObject *TimeBaseObj_DisposeTimeBase(_self, _args)
1085 TimeBaseObject *_self;
1086 PyObject *_args;
1088 PyObject *_res = NULL;
1089 if (!PyArg_ParseTuple(_args, ""))
1090 return NULL;
1091 DisposeTimeBase(_self->ob_itself);
1092 Py_INCREF(Py_None);
1093 _res = Py_None;
1094 return _res;
1097 static PyObject *TimeBaseObj_GetTimeBaseTime(_self, _args)
1098 TimeBaseObject *_self;
1099 PyObject *_args;
1101 PyObject *_res = NULL;
1102 TimeValue _rv;
1103 TimeScale s;
1104 TimeRecord tr;
1105 if (!PyArg_ParseTuple(_args, "l",
1106 &s))
1107 return NULL;
1108 _rv = GetTimeBaseTime(_self->ob_itself,
1110 &tr);
1111 _res = Py_BuildValue("lO&",
1112 _rv,
1113 QtTimeRecord_New, &tr);
1114 return _res;
1117 static PyObject *TimeBaseObj_SetTimeBaseTime(_self, _args)
1118 TimeBaseObject *_self;
1119 PyObject *_args;
1121 PyObject *_res = NULL;
1122 TimeRecord tr;
1123 if (!PyArg_ParseTuple(_args, "O&",
1124 QtTimeRecord_Convert, &tr))
1125 return NULL;
1126 SetTimeBaseTime(_self->ob_itself,
1127 &tr);
1128 Py_INCREF(Py_None);
1129 _res = Py_None;
1130 return _res;
1133 static PyObject *TimeBaseObj_SetTimeBaseValue(_self, _args)
1134 TimeBaseObject *_self;
1135 PyObject *_args;
1137 PyObject *_res = NULL;
1138 TimeValue t;
1139 TimeScale s;
1140 if (!PyArg_ParseTuple(_args, "ll",
1142 &s))
1143 return NULL;
1144 SetTimeBaseValue(_self->ob_itself,
1147 Py_INCREF(Py_None);
1148 _res = Py_None;
1149 return _res;
1152 static PyObject *TimeBaseObj_GetTimeBaseRate(_self, _args)
1153 TimeBaseObject *_self;
1154 PyObject *_args;
1156 PyObject *_res = NULL;
1157 Fixed _rv;
1158 if (!PyArg_ParseTuple(_args, ""))
1159 return NULL;
1160 _rv = GetTimeBaseRate(_self->ob_itself);
1161 _res = Py_BuildValue("O&",
1162 PyMac_BuildFixed, _rv);
1163 return _res;
1166 static PyObject *TimeBaseObj_SetTimeBaseRate(_self, _args)
1167 TimeBaseObject *_self;
1168 PyObject *_args;
1170 PyObject *_res = NULL;
1171 Fixed r;
1172 if (!PyArg_ParseTuple(_args, "O&",
1173 PyMac_GetFixed, &r))
1174 return NULL;
1175 SetTimeBaseRate(_self->ob_itself,
1177 Py_INCREF(Py_None);
1178 _res = Py_None;
1179 return _res;
1182 static PyObject *TimeBaseObj_GetTimeBaseStartTime(_self, _args)
1183 TimeBaseObject *_self;
1184 PyObject *_args;
1186 PyObject *_res = NULL;
1187 TimeValue _rv;
1188 TimeScale s;
1189 TimeRecord tr;
1190 if (!PyArg_ParseTuple(_args, "l",
1191 &s))
1192 return NULL;
1193 _rv = GetTimeBaseStartTime(_self->ob_itself,
1195 &tr);
1196 _res = Py_BuildValue("lO&",
1197 _rv,
1198 QtTimeRecord_New, &tr);
1199 return _res;
1202 static PyObject *TimeBaseObj_SetTimeBaseStartTime(_self, _args)
1203 TimeBaseObject *_self;
1204 PyObject *_args;
1206 PyObject *_res = NULL;
1207 TimeRecord tr;
1208 if (!PyArg_ParseTuple(_args, "O&",
1209 QtTimeRecord_Convert, &tr))
1210 return NULL;
1211 SetTimeBaseStartTime(_self->ob_itself,
1212 &tr);
1213 Py_INCREF(Py_None);
1214 _res = Py_None;
1215 return _res;
1218 static PyObject *TimeBaseObj_GetTimeBaseStopTime(_self, _args)
1219 TimeBaseObject *_self;
1220 PyObject *_args;
1222 PyObject *_res = NULL;
1223 TimeValue _rv;
1224 TimeScale s;
1225 TimeRecord tr;
1226 if (!PyArg_ParseTuple(_args, "l",
1227 &s))
1228 return NULL;
1229 _rv = GetTimeBaseStopTime(_self->ob_itself,
1231 &tr);
1232 _res = Py_BuildValue("lO&",
1233 _rv,
1234 QtTimeRecord_New, &tr);
1235 return _res;
1238 static PyObject *TimeBaseObj_SetTimeBaseStopTime(_self, _args)
1239 TimeBaseObject *_self;
1240 PyObject *_args;
1242 PyObject *_res = NULL;
1243 TimeRecord tr;
1244 if (!PyArg_ParseTuple(_args, "O&",
1245 QtTimeRecord_Convert, &tr))
1246 return NULL;
1247 SetTimeBaseStopTime(_self->ob_itself,
1248 &tr);
1249 Py_INCREF(Py_None);
1250 _res = Py_None;
1251 return _res;
1254 static PyObject *TimeBaseObj_GetTimeBaseFlags(_self, _args)
1255 TimeBaseObject *_self;
1256 PyObject *_args;
1258 PyObject *_res = NULL;
1259 long _rv;
1260 if (!PyArg_ParseTuple(_args, ""))
1261 return NULL;
1262 _rv = GetTimeBaseFlags(_self->ob_itself);
1263 _res = Py_BuildValue("l",
1264 _rv);
1265 return _res;
1268 static PyObject *TimeBaseObj_SetTimeBaseFlags(_self, _args)
1269 TimeBaseObject *_self;
1270 PyObject *_args;
1272 PyObject *_res = NULL;
1273 long timeBaseFlags;
1274 if (!PyArg_ParseTuple(_args, "l",
1275 &timeBaseFlags))
1276 return NULL;
1277 SetTimeBaseFlags(_self->ob_itself,
1278 timeBaseFlags);
1279 Py_INCREF(Py_None);
1280 _res = Py_None;
1281 return _res;
1284 static PyObject *TimeBaseObj_SetTimeBaseMasterTimeBase(_self, _args)
1285 TimeBaseObject *_self;
1286 PyObject *_args;
1288 PyObject *_res = NULL;
1289 TimeBase master;
1290 TimeRecord slaveZero;
1291 if (!PyArg_ParseTuple(_args, "O&O&",
1292 TimeBaseObj_Convert, &master,
1293 QtTimeRecord_Convert, &slaveZero))
1294 return NULL;
1295 SetTimeBaseMasterTimeBase(_self->ob_itself,
1296 master,
1297 &slaveZero);
1298 Py_INCREF(Py_None);
1299 _res = Py_None;
1300 return _res;
1303 static PyObject *TimeBaseObj_GetTimeBaseMasterTimeBase(_self, _args)
1304 TimeBaseObject *_self;
1305 PyObject *_args;
1307 PyObject *_res = NULL;
1308 TimeBase _rv;
1309 if (!PyArg_ParseTuple(_args, ""))
1310 return NULL;
1311 _rv = GetTimeBaseMasterTimeBase(_self->ob_itself);
1312 _res = Py_BuildValue("O&",
1313 TimeBaseObj_New, _rv);
1314 return _res;
1317 static PyObject *TimeBaseObj_SetTimeBaseMasterClock(_self, _args)
1318 TimeBaseObject *_self;
1319 PyObject *_args;
1321 PyObject *_res = NULL;
1322 Component clockMeister;
1323 TimeRecord slaveZero;
1324 if (!PyArg_ParseTuple(_args, "O&O&",
1325 CmpObj_Convert, &clockMeister,
1326 QtTimeRecord_Convert, &slaveZero))
1327 return NULL;
1328 SetTimeBaseMasterClock(_self->ob_itself,
1329 clockMeister,
1330 &slaveZero);
1331 Py_INCREF(Py_None);
1332 _res = Py_None;
1333 return _res;
1336 static PyObject *TimeBaseObj_GetTimeBaseMasterClock(_self, _args)
1337 TimeBaseObject *_self;
1338 PyObject *_args;
1340 PyObject *_res = NULL;
1341 ComponentInstance _rv;
1342 if (!PyArg_ParseTuple(_args, ""))
1343 return NULL;
1344 _rv = GetTimeBaseMasterClock(_self->ob_itself);
1345 _res = Py_BuildValue("O&",
1346 CmpInstObj_New, _rv);
1347 return _res;
1350 static PyObject *TimeBaseObj_GetTimeBaseStatus(_self, _args)
1351 TimeBaseObject *_self;
1352 PyObject *_args;
1354 PyObject *_res = NULL;
1355 long _rv;
1356 TimeRecord unpinnedTime;
1357 if (!PyArg_ParseTuple(_args, ""))
1358 return NULL;
1359 _rv = GetTimeBaseStatus(_self->ob_itself,
1360 &unpinnedTime);
1361 _res = Py_BuildValue("lO&",
1362 _rv,
1363 QtTimeRecord_New, &unpinnedTime);
1364 return _res;
1367 static PyObject *TimeBaseObj_SetTimeBaseZero(_self, _args)
1368 TimeBaseObject *_self;
1369 PyObject *_args;
1371 PyObject *_res = NULL;
1372 TimeRecord zero;
1373 if (!PyArg_ParseTuple(_args, ""))
1374 return NULL;
1375 SetTimeBaseZero(_self->ob_itself,
1376 &zero);
1377 _res = Py_BuildValue("O&",
1378 QtTimeRecord_New, &zero);
1379 return _res;
1382 static PyObject *TimeBaseObj_GetTimeBaseEffectiveRate(_self, _args)
1383 TimeBaseObject *_self;
1384 PyObject *_args;
1386 PyObject *_res = NULL;
1387 Fixed _rv;
1388 if (!PyArg_ParseTuple(_args, ""))
1389 return NULL;
1390 _rv = GetTimeBaseEffectiveRate(_self->ob_itself);
1391 _res = Py_BuildValue("O&",
1392 PyMac_BuildFixed, _rv);
1393 return _res;
1396 static PyMethodDef TimeBaseObj_methods[] = {
1397 {"DisposeTimeBase", (PyCFunction)TimeBaseObj_DisposeTimeBase, 1,
1398 "() -> None"},
1399 {"GetTimeBaseTime", (PyCFunction)TimeBaseObj_GetTimeBaseTime, 1,
1400 "(TimeScale s) -> (TimeValue _rv, TimeRecord tr)"},
1401 {"SetTimeBaseTime", (PyCFunction)TimeBaseObj_SetTimeBaseTime, 1,
1402 "(TimeRecord tr) -> None"},
1403 {"SetTimeBaseValue", (PyCFunction)TimeBaseObj_SetTimeBaseValue, 1,
1404 "(TimeValue t, TimeScale s) -> None"},
1405 {"GetTimeBaseRate", (PyCFunction)TimeBaseObj_GetTimeBaseRate, 1,
1406 "() -> (Fixed _rv)"},
1407 {"SetTimeBaseRate", (PyCFunction)TimeBaseObj_SetTimeBaseRate, 1,
1408 "(Fixed r) -> None"},
1409 {"GetTimeBaseStartTime", (PyCFunction)TimeBaseObj_GetTimeBaseStartTime, 1,
1410 "(TimeScale s) -> (TimeValue _rv, TimeRecord tr)"},
1411 {"SetTimeBaseStartTime", (PyCFunction)TimeBaseObj_SetTimeBaseStartTime, 1,
1412 "(TimeRecord tr) -> None"},
1413 {"GetTimeBaseStopTime", (PyCFunction)TimeBaseObj_GetTimeBaseStopTime, 1,
1414 "(TimeScale s) -> (TimeValue _rv, TimeRecord tr)"},
1415 {"SetTimeBaseStopTime", (PyCFunction)TimeBaseObj_SetTimeBaseStopTime, 1,
1416 "(TimeRecord tr) -> None"},
1417 {"GetTimeBaseFlags", (PyCFunction)TimeBaseObj_GetTimeBaseFlags, 1,
1418 "() -> (long _rv)"},
1419 {"SetTimeBaseFlags", (PyCFunction)TimeBaseObj_SetTimeBaseFlags, 1,
1420 "(long timeBaseFlags) -> None"},
1421 {"SetTimeBaseMasterTimeBase", (PyCFunction)TimeBaseObj_SetTimeBaseMasterTimeBase, 1,
1422 "(TimeBase master, TimeRecord slaveZero) -> None"},
1423 {"GetTimeBaseMasterTimeBase", (PyCFunction)TimeBaseObj_GetTimeBaseMasterTimeBase, 1,
1424 "() -> (TimeBase _rv)"},
1425 {"SetTimeBaseMasterClock", (PyCFunction)TimeBaseObj_SetTimeBaseMasterClock, 1,
1426 "(Component clockMeister, TimeRecord slaveZero) -> None"},
1427 {"GetTimeBaseMasterClock", (PyCFunction)TimeBaseObj_GetTimeBaseMasterClock, 1,
1428 "() -> (ComponentInstance _rv)"},
1429 {"GetTimeBaseStatus", (PyCFunction)TimeBaseObj_GetTimeBaseStatus, 1,
1430 "() -> (long _rv, TimeRecord unpinnedTime)"},
1431 {"SetTimeBaseZero", (PyCFunction)TimeBaseObj_SetTimeBaseZero, 1,
1432 "() -> (TimeRecord zero)"},
1433 {"GetTimeBaseEffectiveRate", (PyCFunction)TimeBaseObj_GetTimeBaseEffectiveRate, 1,
1434 "() -> (Fixed _rv)"},
1435 {NULL, NULL, 0}
1438 PyMethodChain TimeBaseObj_chain = { TimeBaseObj_methods, NULL };
1440 static PyObject *TimeBaseObj_getattr(self, name)
1441 TimeBaseObject *self;
1442 char *name;
1444 return Py_FindMethodInChain(&TimeBaseObj_chain, (PyObject *)self, name);
1447 #define TimeBaseObj_setattr NULL
1449 PyTypeObject TimeBase_Type = {
1450 PyObject_HEAD_INIT(&PyType_Type)
1451 0, /*ob_size*/
1452 "TimeBase", /*tp_name*/
1453 sizeof(TimeBaseObject), /*tp_basicsize*/
1454 0, /*tp_itemsize*/
1455 /* methods */
1456 (destructor) TimeBaseObj_dealloc, /*tp_dealloc*/
1457 0, /*tp_print*/
1458 (getattrfunc) TimeBaseObj_getattr, /*tp_getattr*/
1459 (setattrfunc) TimeBaseObj_setattr, /*tp_setattr*/
1462 /* -------------------- End object type TimeBase -------------------- */
1465 /* ---------------------- Object type UserData ---------------------- */
1467 PyTypeObject UserData_Type;
1469 #define UserDataObj_Check(x) ((x)->ob_type == &UserData_Type)
1471 typedef struct UserDataObject {
1472 PyObject_HEAD
1473 UserData ob_itself;
1474 } UserDataObject;
1476 PyObject *UserDataObj_New(itself)
1477 UserData itself;
1479 UserDataObject *it;
1480 if (itself == NULL) {
1481 PyErr_SetString(Qt_Error,"Cannot create null UserData");
1482 return NULL;
1484 it = PyObject_NEW(UserDataObject, &UserData_Type);
1485 if (it == NULL) return NULL;
1486 it->ob_itself = itself;
1487 return (PyObject *)it;
1489 UserDataObj_Convert(v, p_itself)
1490 PyObject *v;
1491 UserData *p_itself;
1493 if (!UserDataObj_Check(v))
1495 PyErr_SetString(PyExc_TypeError, "UserData required");
1496 return 0;
1498 *p_itself = ((UserDataObject *)v)->ob_itself;
1499 return 1;
1502 static void UserDataObj_dealloc(self)
1503 UserDataObject *self;
1505 DisposeUserData(self->ob_itself);
1506 PyMem_DEL(self);
1509 static PyObject *UserDataObj_GetUserData(_self, _args)
1510 UserDataObject *_self;
1511 PyObject *_args;
1513 PyObject *_res = NULL;
1514 OSErr _err;
1515 Handle data;
1516 OSType udType;
1517 long index;
1518 if (!PyArg_ParseTuple(_args, "O&O&l",
1519 ResObj_Convert, &data,
1520 PyMac_GetOSType, &udType,
1521 &index))
1522 return NULL;
1523 _err = GetUserData(_self->ob_itself,
1524 data,
1525 udType,
1526 index);
1527 if (_err != noErr) return PyMac_Error(_err);
1528 Py_INCREF(Py_None);
1529 _res = Py_None;
1530 return _res;
1533 static PyObject *UserDataObj_AddUserData(_self, _args)
1534 UserDataObject *_self;
1535 PyObject *_args;
1537 PyObject *_res = NULL;
1538 OSErr _err;
1539 Handle data;
1540 OSType udType;
1541 if (!PyArg_ParseTuple(_args, "O&O&",
1542 ResObj_Convert, &data,
1543 PyMac_GetOSType, &udType))
1544 return NULL;
1545 _err = AddUserData(_self->ob_itself,
1546 data,
1547 udType);
1548 if (_err != noErr) return PyMac_Error(_err);
1549 Py_INCREF(Py_None);
1550 _res = Py_None;
1551 return _res;
1554 static PyObject *UserDataObj_RemoveUserData(_self, _args)
1555 UserDataObject *_self;
1556 PyObject *_args;
1558 PyObject *_res = NULL;
1559 OSErr _err;
1560 OSType udType;
1561 long index;
1562 if (!PyArg_ParseTuple(_args, "O&l",
1563 PyMac_GetOSType, &udType,
1564 &index))
1565 return NULL;
1566 _err = RemoveUserData(_self->ob_itself,
1567 udType,
1568 index);
1569 if (_err != noErr) return PyMac_Error(_err);
1570 Py_INCREF(Py_None);
1571 _res = Py_None;
1572 return _res;
1575 static PyObject *UserDataObj_CountUserDataType(_self, _args)
1576 UserDataObject *_self;
1577 PyObject *_args;
1579 PyObject *_res = NULL;
1580 short _rv;
1581 OSType udType;
1582 if (!PyArg_ParseTuple(_args, "O&",
1583 PyMac_GetOSType, &udType))
1584 return NULL;
1585 _rv = CountUserDataType(_self->ob_itself,
1586 udType);
1587 _res = Py_BuildValue("h",
1588 _rv);
1589 return _res;
1592 static PyObject *UserDataObj_GetNextUserDataType(_self, _args)
1593 UserDataObject *_self;
1594 PyObject *_args;
1596 PyObject *_res = NULL;
1597 long _rv;
1598 OSType udType;
1599 if (!PyArg_ParseTuple(_args, "O&",
1600 PyMac_GetOSType, &udType))
1601 return NULL;
1602 _rv = GetNextUserDataType(_self->ob_itself,
1603 udType);
1604 _res = Py_BuildValue("l",
1605 _rv);
1606 return _res;
1609 static PyObject *UserDataObj_AddUserDataText(_self, _args)
1610 UserDataObject *_self;
1611 PyObject *_args;
1613 PyObject *_res = NULL;
1614 OSErr _err;
1615 Handle data;
1616 OSType udType;
1617 long index;
1618 short itlRegionTag;
1619 if (!PyArg_ParseTuple(_args, "O&O&lh",
1620 ResObj_Convert, &data,
1621 PyMac_GetOSType, &udType,
1622 &index,
1623 &itlRegionTag))
1624 return NULL;
1625 _err = AddUserDataText(_self->ob_itself,
1626 data,
1627 udType,
1628 index,
1629 itlRegionTag);
1630 if (_err != noErr) return PyMac_Error(_err);
1631 Py_INCREF(Py_None);
1632 _res = Py_None;
1633 return _res;
1636 static PyObject *UserDataObj_GetUserDataText(_self, _args)
1637 UserDataObject *_self;
1638 PyObject *_args;
1640 PyObject *_res = NULL;
1641 OSErr _err;
1642 Handle data;
1643 OSType udType;
1644 long index;
1645 short itlRegionTag;
1646 if (!PyArg_ParseTuple(_args, "O&O&lh",
1647 ResObj_Convert, &data,
1648 PyMac_GetOSType, &udType,
1649 &index,
1650 &itlRegionTag))
1651 return NULL;
1652 _err = GetUserDataText(_self->ob_itself,
1653 data,
1654 udType,
1655 index,
1656 itlRegionTag);
1657 if (_err != noErr) return PyMac_Error(_err);
1658 Py_INCREF(Py_None);
1659 _res = Py_None;
1660 return _res;
1663 static PyObject *UserDataObj_RemoveUserDataText(_self, _args)
1664 UserDataObject *_self;
1665 PyObject *_args;
1667 PyObject *_res = NULL;
1668 OSErr _err;
1669 OSType udType;
1670 long index;
1671 short itlRegionTag;
1672 if (!PyArg_ParseTuple(_args, "O&lh",
1673 PyMac_GetOSType, &udType,
1674 &index,
1675 &itlRegionTag))
1676 return NULL;
1677 _err = RemoveUserDataText(_self->ob_itself,
1678 udType,
1679 index,
1680 itlRegionTag);
1681 if (_err != noErr) return PyMac_Error(_err);
1682 Py_INCREF(Py_None);
1683 _res = Py_None;
1684 return _res;
1687 static PyObject *UserDataObj_PutUserDataIntoHandle(_self, _args)
1688 UserDataObject *_self;
1689 PyObject *_args;
1691 PyObject *_res = NULL;
1692 OSErr _err;
1693 Handle h;
1694 if (!PyArg_ParseTuple(_args, "O&",
1695 ResObj_Convert, &h))
1696 return NULL;
1697 _err = PutUserDataIntoHandle(_self->ob_itself,
1699 if (_err != noErr) return PyMac_Error(_err);
1700 Py_INCREF(Py_None);
1701 _res = Py_None;
1702 return _res;
1705 static PyMethodDef UserDataObj_methods[] = {
1706 {"GetUserData", (PyCFunction)UserDataObj_GetUserData, 1,
1707 "(Handle data, OSType udType, long index) -> None"},
1708 {"AddUserData", (PyCFunction)UserDataObj_AddUserData, 1,
1709 "(Handle data, OSType udType) -> None"},
1710 {"RemoveUserData", (PyCFunction)UserDataObj_RemoveUserData, 1,
1711 "(OSType udType, long index) -> None"},
1712 {"CountUserDataType", (PyCFunction)UserDataObj_CountUserDataType, 1,
1713 "(OSType udType) -> (short _rv)"},
1714 {"GetNextUserDataType", (PyCFunction)UserDataObj_GetNextUserDataType, 1,
1715 "(OSType udType) -> (long _rv)"},
1716 {"AddUserDataText", (PyCFunction)UserDataObj_AddUserDataText, 1,
1717 "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
1718 {"GetUserDataText", (PyCFunction)UserDataObj_GetUserDataText, 1,
1719 "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
1720 {"RemoveUserDataText", (PyCFunction)UserDataObj_RemoveUserDataText, 1,
1721 "(OSType udType, long index, short itlRegionTag) -> None"},
1722 {"PutUserDataIntoHandle", (PyCFunction)UserDataObj_PutUserDataIntoHandle, 1,
1723 "(Handle h) -> None"},
1724 {NULL, NULL, 0}
1727 PyMethodChain UserDataObj_chain = { UserDataObj_methods, NULL };
1729 static PyObject *UserDataObj_getattr(self, name)
1730 UserDataObject *self;
1731 char *name;
1733 return Py_FindMethodInChain(&UserDataObj_chain, (PyObject *)self, name);
1736 #define UserDataObj_setattr NULL
1738 PyTypeObject UserData_Type = {
1739 PyObject_HEAD_INIT(&PyType_Type)
1740 0, /*ob_size*/
1741 "UserData", /*tp_name*/
1742 sizeof(UserDataObject), /*tp_basicsize*/
1743 0, /*tp_itemsize*/
1744 /* methods */
1745 (destructor) UserDataObj_dealloc, /*tp_dealloc*/
1746 0, /*tp_print*/
1747 (getattrfunc) UserDataObj_getattr, /*tp_getattr*/
1748 (setattrfunc) UserDataObj_setattr, /*tp_setattr*/
1751 /* -------------------- End object type UserData -------------------- */
1754 /* ----------------------- Object type Media ------------------------ */
1756 PyTypeObject Media_Type;
1758 #define MediaObj_Check(x) ((x)->ob_type == &Media_Type)
1760 typedef struct MediaObject {
1761 PyObject_HEAD
1762 Media ob_itself;
1763 } MediaObject;
1765 PyObject *MediaObj_New(itself)
1766 Media itself;
1768 MediaObject *it;
1769 if (itself == NULL) {
1770 PyErr_SetString(Qt_Error,"Cannot create null Media");
1771 return NULL;
1773 it = PyObject_NEW(MediaObject, &Media_Type);
1774 if (it == NULL) return NULL;
1775 it->ob_itself = itself;
1776 return (PyObject *)it;
1778 MediaObj_Convert(v, p_itself)
1779 PyObject *v;
1780 Media *p_itself;
1782 if (!MediaObj_Check(v))
1784 PyErr_SetString(PyExc_TypeError, "Media required");
1785 return 0;
1787 *p_itself = ((MediaObject *)v)->ob_itself;
1788 return 1;
1791 static void MediaObj_dealloc(self)
1792 MediaObject *self;
1794 DisposeTrackMedia(self->ob_itself);
1795 PyMem_DEL(self);
1798 static PyObject *MediaObj_LoadMediaIntoRam(_self, _args)
1799 MediaObject *_self;
1800 PyObject *_args;
1802 PyObject *_res = NULL;
1803 OSErr _err;
1804 TimeValue time;
1805 TimeValue duration;
1806 long flags;
1807 if (!PyArg_ParseTuple(_args, "lll",
1808 &time,
1809 &duration,
1810 &flags))
1811 return NULL;
1812 _err = LoadMediaIntoRam(_self->ob_itself,
1813 time,
1814 duration,
1815 flags);
1816 if (_err != noErr) return PyMac_Error(_err);
1817 Py_INCREF(Py_None);
1818 _res = Py_None;
1819 return _res;
1822 static PyObject *MediaObj_GetMediaTrack(_self, _args)
1823 MediaObject *_self;
1824 PyObject *_args;
1826 PyObject *_res = NULL;
1827 Track _rv;
1828 if (!PyArg_ParseTuple(_args, ""))
1829 return NULL;
1830 _rv = GetMediaTrack(_self->ob_itself);
1831 _res = Py_BuildValue("O&",
1832 TrackObj_New, _rv);
1833 return _res;
1836 static PyObject *MediaObj_GetMediaCreationTime(_self, _args)
1837 MediaObject *_self;
1838 PyObject *_args;
1840 PyObject *_res = NULL;
1841 unsigned long _rv;
1842 if (!PyArg_ParseTuple(_args, ""))
1843 return NULL;
1844 _rv = GetMediaCreationTime(_self->ob_itself);
1845 _res = Py_BuildValue("l",
1846 _rv);
1847 return _res;
1850 static PyObject *MediaObj_GetMediaModificationTime(_self, _args)
1851 MediaObject *_self;
1852 PyObject *_args;
1854 PyObject *_res = NULL;
1855 unsigned long _rv;
1856 if (!PyArg_ParseTuple(_args, ""))
1857 return NULL;
1858 _rv = GetMediaModificationTime(_self->ob_itself);
1859 _res = Py_BuildValue("l",
1860 _rv);
1861 return _res;
1864 static PyObject *MediaObj_GetMediaTimeScale(_self, _args)
1865 MediaObject *_self;
1866 PyObject *_args;
1868 PyObject *_res = NULL;
1869 TimeScale _rv;
1870 if (!PyArg_ParseTuple(_args, ""))
1871 return NULL;
1872 _rv = GetMediaTimeScale(_self->ob_itself);
1873 _res = Py_BuildValue("l",
1874 _rv);
1875 return _res;
1878 static PyObject *MediaObj_SetMediaTimeScale(_self, _args)
1879 MediaObject *_self;
1880 PyObject *_args;
1882 PyObject *_res = NULL;
1883 TimeScale timeScale;
1884 if (!PyArg_ParseTuple(_args, "l",
1885 &timeScale))
1886 return NULL;
1887 SetMediaTimeScale(_self->ob_itself,
1888 timeScale);
1889 Py_INCREF(Py_None);
1890 _res = Py_None;
1891 return _res;
1894 static PyObject *MediaObj_GetMediaDuration(_self, _args)
1895 MediaObject *_self;
1896 PyObject *_args;
1898 PyObject *_res = NULL;
1899 TimeValue _rv;
1900 if (!PyArg_ParseTuple(_args, ""))
1901 return NULL;
1902 _rv = GetMediaDuration(_self->ob_itself);
1903 _res = Py_BuildValue("l",
1904 _rv);
1905 return _res;
1908 static PyObject *MediaObj_GetMediaLanguage(_self, _args)
1909 MediaObject *_self;
1910 PyObject *_args;
1912 PyObject *_res = NULL;
1913 short _rv;
1914 if (!PyArg_ParseTuple(_args, ""))
1915 return NULL;
1916 _rv = GetMediaLanguage(_self->ob_itself);
1917 _res = Py_BuildValue("h",
1918 _rv);
1919 return _res;
1922 static PyObject *MediaObj_SetMediaLanguage(_self, _args)
1923 MediaObject *_self;
1924 PyObject *_args;
1926 PyObject *_res = NULL;
1927 short language;
1928 if (!PyArg_ParseTuple(_args, "h",
1929 &language))
1930 return NULL;
1931 SetMediaLanguage(_self->ob_itself,
1932 language);
1933 Py_INCREF(Py_None);
1934 _res = Py_None;
1935 return _res;
1938 static PyObject *MediaObj_GetMediaQuality(_self, _args)
1939 MediaObject *_self;
1940 PyObject *_args;
1942 PyObject *_res = NULL;
1943 short _rv;
1944 if (!PyArg_ParseTuple(_args, ""))
1945 return NULL;
1946 _rv = GetMediaQuality(_self->ob_itself);
1947 _res = Py_BuildValue("h",
1948 _rv);
1949 return _res;
1952 static PyObject *MediaObj_SetMediaQuality(_self, _args)
1953 MediaObject *_self;
1954 PyObject *_args;
1956 PyObject *_res = NULL;
1957 short quality;
1958 if (!PyArg_ParseTuple(_args, "h",
1959 &quality))
1960 return NULL;
1961 SetMediaQuality(_self->ob_itself,
1962 quality);
1963 Py_INCREF(Py_None);
1964 _res = Py_None;
1965 return _res;
1968 static PyObject *MediaObj_GetMediaHandlerDescription(_self, _args)
1969 MediaObject *_self;
1970 PyObject *_args;
1972 PyObject *_res = NULL;
1973 OSType mediaType;
1974 Str255 creatorName;
1975 OSType creatorManufacturer;
1976 if (!PyArg_ParseTuple(_args, "O&",
1977 PyMac_GetStr255, creatorName))
1978 return NULL;
1979 GetMediaHandlerDescription(_self->ob_itself,
1980 &mediaType,
1981 creatorName,
1982 &creatorManufacturer);
1983 _res = Py_BuildValue("O&O&",
1984 PyMac_BuildOSType, mediaType,
1985 PyMac_BuildOSType, creatorManufacturer);
1986 return _res;
1989 static PyObject *MediaObj_GetMediaUserData(_self, _args)
1990 MediaObject *_self;
1991 PyObject *_args;
1993 PyObject *_res = NULL;
1994 UserData _rv;
1995 if (!PyArg_ParseTuple(_args, ""))
1996 return NULL;
1997 _rv = GetMediaUserData(_self->ob_itself);
1998 _res = Py_BuildValue("O&",
1999 UserDataObj_New, _rv);
2000 return _res;
2003 static PyObject *MediaObj_GetMediaHandler(_self, _args)
2004 MediaObject *_self;
2005 PyObject *_args;
2007 PyObject *_res = NULL;
2008 MediaHandler _rv;
2009 if (!PyArg_ParseTuple(_args, ""))
2010 return NULL;
2011 _rv = GetMediaHandler(_self->ob_itself);
2012 _res = Py_BuildValue("O&",
2013 CmpInstObj_New, _rv);
2014 return _res;
2017 static PyObject *MediaObj_SetMediaHandler(_self, _args)
2018 MediaObject *_self;
2019 PyObject *_args;
2021 PyObject *_res = NULL;
2022 OSErr _err;
2023 MediaHandlerComponent mH;
2024 if (!PyArg_ParseTuple(_args, "O&",
2025 CmpObj_Convert, &mH))
2026 return NULL;
2027 _err = SetMediaHandler(_self->ob_itself,
2028 mH);
2029 if (_err != noErr) return PyMac_Error(_err);
2030 Py_INCREF(Py_None);
2031 _res = Py_None;
2032 return _res;
2035 static PyObject *MediaObj_BeginMediaEdits(_self, _args)
2036 MediaObject *_self;
2037 PyObject *_args;
2039 PyObject *_res = NULL;
2040 OSErr _err;
2041 if (!PyArg_ParseTuple(_args, ""))
2042 return NULL;
2043 _err = BeginMediaEdits(_self->ob_itself);
2044 if (_err != noErr) return PyMac_Error(_err);
2045 Py_INCREF(Py_None);
2046 _res = Py_None;
2047 return _res;
2050 static PyObject *MediaObj_EndMediaEdits(_self, _args)
2051 MediaObject *_self;
2052 PyObject *_args;
2054 PyObject *_res = NULL;
2055 OSErr _err;
2056 if (!PyArg_ParseTuple(_args, ""))
2057 return NULL;
2058 _err = EndMediaEdits(_self->ob_itself);
2059 if (_err != noErr) return PyMac_Error(_err);
2060 Py_INCREF(Py_None);
2061 _res = Py_None;
2062 return _res;
2065 static PyObject *MediaObj_SetMediaDefaultDataRefIndex(_self, _args)
2066 MediaObject *_self;
2067 PyObject *_args;
2069 PyObject *_res = NULL;
2070 OSErr _err;
2071 short index;
2072 if (!PyArg_ParseTuple(_args, "h",
2073 &index))
2074 return NULL;
2075 _err = SetMediaDefaultDataRefIndex(_self->ob_itself,
2076 index);
2077 if (_err != noErr) return PyMac_Error(_err);
2078 Py_INCREF(Py_None);
2079 _res = Py_None;
2080 return _res;
2083 static PyObject *MediaObj_GetMediaDataHandlerDescription(_self, _args)
2084 MediaObject *_self;
2085 PyObject *_args;
2087 PyObject *_res = NULL;
2088 short index;
2089 OSType dhType;
2090 Str255 creatorName;
2091 OSType creatorManufacturer;
2092 if (!PyArg_ParseTuple(_args, "hO&",
2093 &index,
2094 PyMac_GetStr255, creatorName))
2095 return NULL;
2096 GetMediaDataHandlerDescription(_self->ob_itself,
2097 index,
2098 &dhType,
2099 creatorName,
2100 &creatorManufacturer);
2101 _res = Py_BuildValue("O&O&",
2102 PyMac_BuildOSType, dhType,
2103 PyMac_BuildOSType, creatorManufacturer);
2104 return _res;
2107 static PyObject *MediaObj_GetMediaDataHandler(_self, _args)
2108 MediaObject *_self;
2109 PyObject *_args;
2111 PyObject *_res = NULL;
2112 DataHandler _rv;
2113 short index;
2114 if (!PyArg_ParseTuple(_args, "h",
2115 &index))
2116 return NULL;
2117 _rv = GetMediaDataHandler(_self->ob_itself,
2118 index);
2119 _res = Py_BuildValue("O&",
2120 CmpInstObj_New, _rv);
2121 return _res;
2124 static PyObject *MediaObj_SetMediaDataHandler(_self, _args)
2125 MediaObject *_self;
2126 PyObject *_args;
2128 PyObject *_res = NULL;
2129 OSErr _err;
2130 short index;
2131 DataHandlerComponent dataHandler;
2132 if (!PyArg_ParseTuple(_args, "hO&",
2133 &index,
2134 CmpObj_Convert, &dataHandler))
2135 return NULL;
2136 _err = SetMediaDataHandler(_self->ob_itself,
2137 index,
2138 dataHandler);
2139 if (_err != noErr) return PyMac_Error(_err);
2140 Py_INCREF(Py_None);
2141 _res = Py_None;
2142 return _res;
2145 static PyObject *MediaObj_GetMediaSampleDescriptionCount(_self, _args)
2146 MediaObject *_self;
2147 PyObject *_args;
2149 PyObject *_res = NULL;
2150 long _rv;
2151 if (!PyArg_ParseTuple(_args, ""))
2152 return NULL;
2153 _rv = GetMediaSampleDescriptionCount(_self->ob_itself);
2154 _res = Py_BuildValue("l",
2155 _rv);
2156 return _res;
2159 static PyObject *MediaObj_GetMediaSampleDescription(_self, _args)
2160 MediaObject *_self;
2161 PyObject *_args;
2163 PyObject *_res = NULL;
2164 long index;
2165 SampleDescriptionHandle descH;
2166 if (!PyArg_ParseTuple(_args, "lO&",
2167 &index,
2168 ResObj_Convert, &descH))
2169 return NULL;
2170 GetMediaSampleDescription(_self->ob_itself,
2171 index,
2172 descH);
2173 Py_INCREF(Py_None);
2174 _res = Py_None;
2175 return _res;
2178 static PyObject *MediaObj_SetMediaSampleDescription(_self, _args)
2179 MediaObject *_self;
2180 PyObject *_args;
2182 PyObject *_res = NULL;
2183 OSErr _err;
2184 long index;
2185 SampleDescriptionHandle descH;
2186 if (!PyArg_ParseTuple(_args, "lO&",
2187 &index,
2188 ResObj_Convert, &descH))
2189 return NULL;
2190 _err = SetMediaSampleDescription(_self->ob_itself,
2191 index,
2192 descH);
2193 if (_err != noErr) return PyMac_Error(_err);
2194 Py_INCREF(Py_None);
2195 _res = Py_None;
2196 return _res;
2199 static PyObject *MediaObj_GetMediaSampleCount(_self, _args)
2200 MediaObject *_self;
2201 PyObject *_args;
2203 PyObject *_res = NULL;
2204 long _rv;
2205 if (!PyArg_ParseTuple(_args, ""))
2206 return NULL;
2207 _rv = GetMediaSampleCount(_self->ob_itself);
2208 _res = Py_BuildValue("l",
2209 _rv);
2210 return _res;
2213 static PyObject *MediaObj_GetMediaSyncSampleCount(_self, _args)
2214 MediaObject *_self;
2215 PyObject *_args;
2217 PyObject *_res = NULL;
2218 long _rv;
2219 if (!PyArg_ParseTuple(_args, ""))
2220 return NULL;
2221 _rv = GetMediaSyncSampleCount(_self->ob_itself);
2222 _res = Py_BuildValue("l",
2223 _rv);
2224 return _res;
2227 static PyObject *MediaObj_SampleNumToMediaTime(_self, _args)
2228 MediaObject *_self;
2229 PyObject *_args;
2231 PyObject *_res = NULL;
2232 long logicalSampleNum;
2233 TimeValue sampleTime;
2234 TimeValue sampleDuration;
2235 if (!PyArg_ParseTuple(_args, "l",
2236 &logicalSampleNum))
2237 return NULL;
2238 SampleNumToMediaTime(_self->ob_itself,
2239 logicalSampleNum,
2240 &sampleTime,
2241 &sampleDuration);
2242 _res = Py_BuildValue("ll",
2243 sampleTime,
2244 sampleDuration);
2245 return _res;
2248 static PyObject *MediaObj_MediaTimeToSampleNum(_self, _args)
2249 MediaObject *_self;
2250 PyObject *_args;
2252 PyObject *_res = NULL;
2253 TimeValue time;
2254 long sampleNum;
2255 TimeValue sampleTime;
2256 TimeValue sampleDuration;
2257 if (!PyArg_ParseTuple(_args, "l",
2258 &time))
2259 return NULL;
2260 MediaTimeToSampleNum(_self->ob_itself,
2261 time,
2262 &sampleNum,
2263 &sampleTime,
2264 &sampleDuration);
2265 _res = Py_BuildValue("lll",
2266 sampleNum,
2267 sampleTime,
2268 sampleDuration);
2269 return _res;
2272 static PyObject *MediaObj_AddMediaSample(_self, _args)
2273 MediaObject *_self;
2274 PyObject *_args;
2276 PyObject *_res = NULL;
2277 OSErr _err;
2278 Handle dataIn;
2279 long inOffset;
2280 unsigned long size;
2281 TimeValue durationPerSample;
2282 SampleDescriptionHandle sampleDescriptionH;
2283 long numberOfSamples;
2284 short sampleFlags;
2285 TimeValue sampleTime;
2286 if (!PyArg_ParseTuple(_args, "O&lllO&lh",
2287 ResObj_Convert, &dataIn,
2288 &inOffset,
2289 &size,
2290 &durationPerSample,
2291 ResObj_Convert, &sampleDescriptionH,
2292 &numberOfSamples,
2293 &sampleFlags))
2294 return NULL;
2295 _err = AddMediaSample(_self->ob_itself,
2296 dataIn,
2297 inOffset,
2298 size,
2299 durationPerSample,
2300 sampleDescriptionH,
2301 numberOfSamples,
2302 sampleFlags,
2303 &sampleTime);
2304 if (_err != noErr) return PyMac_Error(_err);
2305 _res = Py_BuildValue("l",
2306 sampleTime);
2307 return _res;
2310 static PyObject *MediaObj_AddMediaSampleReference(_self, _args)
2311 MediaObject *_self;
2312 PyObject *_args;
2314 PyObject *_res = NULL;
2315 OSErr _err;
2316 long dataOffset;
2317 unsigned long size;
2318 TimeValue durationPerSample;
2319 SampleDescriptionHandle sampleDescriptionH;
2320 long numberOfSamples;
2321 short sampleFlags;
2322 TimeValue sampleTime;
2323 if (!PyArg_ParseTuple(_args, "lllO&lh",
2324 &dataOffset,
2325 &size,
2326 &durationPerSample,
2327 ResObj_Convert, &sampleDescriptionH,
2328 &numberOfSamples,
2329 &sampleFlags))
2330 return NULL;
2331 _err = AddMediaSampleReference(_self->ob_itself,
2332 dataOffset,
2333 size,
2334 durationPerSample,
2335 sampleDescriptionH,
2336 numberOfSamples,
2337 sampleFlags,
2338 &sampleTime);
2339 if (_err != noErr) return PyMac_Error(_err);
2340 _res = Py_BuildValue("l",
2341 sampleTime);
2342 return _res;
2345 static PyObject *MediaObj_GetMediaSample(_self, _args)
2346 MediaObject *_self;
2347 PyObject *_args;
2349 PyObject *_res = NULL;
2350 OSErr _err;
2351 Handle dataOut;
2352 long maxSizeToGrow;
2353 long size;
2354 TimeValue time;
2355 TimeValue sampleTime;
2356 TimeValue durationPerSample;
2357 SampleDescriptionHandle sampleDescriptionH;
2358 long sampleDescriptionIndex;
2359 long maxNumberOfSamples;
2360 long numberOfSamples;
2361 short sampleFlags;
2362 if (!PyArg_ParseTuple(_args, "O&llO&l",
2363 ResObj_Convert, &dataOut,
2364 &maxSizeToGrow,
2365 &time,
2366 ResObj_Convert, &sampleDescriptionH,
2367 &maxNumberOfSamples))
2368 return NULL;
2369 _err = GetMediaSample(_self->ob_itself,
2370 dataOut,
2371 maxSizeToGrow,
2372 &size,
2373 time,
2374 &sampleTime,
2375 &durationPerSample,
2376 sampleDescriptionH,
2377 &sampleDescriptionIndex,
2378 maxNumberOfSamples,
2379 &numberOfSamples,
2380 &sampleFlags);
2381 if (_err != noErr) return PyMac_Error(_err);
2382 _res = Py_BuildValue("lllllh",
2383 size,
2384 sampleTime,
2385 durationPerSample,
2386 sampleDescriptionIndex,
2387 numberOfSamples,
2388 sampleFlags);
2389 return _res;
2392 static PyObject *MediaObj_GetMediaSampleReference(_self, _args)
2393 MediaObject *_self;
2394 PyObject *_args;
2396 PyObject *_res = NULL;
2397 OSErr _err;
2398 long dataOffset;
2399 long size;
2400 TimeValue time;
2401 TimeValue sampleTime;
2402 TimeValue durationPerSample;
2403 SampleDescriptionHandle sampleDescriptionH;
2404 long sampleDescriptionIndex;
2405 long maxNumberOfSamples;
2406 long numberOfSamples;
2407 short sampleFlags;
2408 if (!PyArg_ParseTuple(_args, "lO&l",
2409 &time,
2410 ResObj_Convert, &sampleDescriptionH,
2411 &maxNumberOfSamples))
2412 return NULL;
2413 _err = GetMediaSampleReference(_self->ob_itself,
2414 &dataOffset,
2415 &size,
2416 time,
2417 &sampleTime,
2418 &durationPerSample,
2419 sampleDescriptionH,
2420 &sampleDescriptionIndex,
2421 maxNumberOfSamples,
2422 &numberOfSamples,
2423 &sampleFlags);
2424 if (_err != noErr) return PyMac_Error(_err);
2425 _res = Py_BuildValue("llllllh",
2426 dataOffset,
2427 size,
2428 sampleTime,
2429 durationPerSample,
2430 sampleDescriptionIndex,
2431 numberOfSamples,
2432 sampleFlags);
2433 return _res;
2436 static PyObject *MediaObj_SetMediaPreferredChunkSize(_self, _args)
2437 MediaObject *_self;
2438 PyObject *_args;
2440 PyObject *_res = NULL;
2441 OSErr _err;
2442 long maxChunkSize;
2443 if (!PyArg_ParseTuple(_args, "l",
2444 &maxChunkSize))
2445 return NULL;
2446 _err = SetMediaPreferredChunkSize(_self->ob_itself,
2447 maxChunkSize);
2448 if (_err != noErr) return PyMac_Error(_err);
2449 Py_INCREF(Py_None);
2450 _res = Py_None;
2451 return _res;
2454 static PyObject *MediaObj_GetMediaPreferredChunkSize(_self, _args)
2455 MediaObject *_self;
2456 PyObject *_args;
2458 PyObject *_res = NULL;
2459 OSErr _err;
2460 long maxChunkSize;
2461 if (!PyArg_ParseTuple(_args, ""))
2462 return NULL;
2463 _err = GetMediaPreferredChunkSize(_self->ob_itself,
2464 &maxChunkSize);
2465 if (_err != noErr) return PyMac_Error(_err);
2466 _res = Py_BuildValue("l",
2467 maxChunkSize);
2468 return _res;
2471 static PyObject *MediaObj_SetMediaShadowSync(_self, _args)
2472 MediaObject *_self;
2473 PyObject *_args;
2475 PyObject *_res = NULL;
2476 OSErr _err;
2477 long frameDiffSampleNum;
2478 long syncSampleNum;
2479 if (!PyArg_ParseTuple(_args, "ll",
2480 &frameDiffSampleNum,
2481 &syncSampleNum))
2482 return NULL;
2483 _err = SetMediaShadowSync(_self->ob_itself,
2484 frameDiffSampleNum,
2485 syncSampleNum);
2486 if (_err != noErr) return PyMac_Error(_err);
2487 Py_INCREF(Py_None);
2488 _res = Py_None;
2489 return _res;
2492 static PyObject *MediaObj_GetMediaShadowSync(_self, _args)
2493 MediaObject *_self;
2494 PyObject *_args;
2496 PyObject *_res = NULL;
2497 OSErr _err;
2498 long frameDiffSampleNum;
2499 long syncSampleNum;
2500 if (!PyArg_ParseTuple(_args, "l",
2501 &frameDiffSampleNum))
2502 return NULL;
2503 _err = GetMediaShadowSync(_self->ob_itself,
2504 frameDiffSampleNum,
2505 &syncSampleNum);
2506 if (_err != noErr) return PyMac_Error(_err);
2507 _res = Py_BuildValue("l",
2508 syncSampleNum);
2509 return _res;
2512 static PyObject *MediaObj_GetMediaDataSize(_self, _args)
2513 MediaObject *_self;
2514 PyObject *_args;
2516 PyObject *_res = NULL;
2517 long _rv;
2518 TimeValue startTime;
2519 TimeValue duration;
2520 if (!PyArg_ParseTuple(_args, "ll",
2521 &startTime,
2522 &duration))
2523 return NULL;
2524 _rv = GetMediaDataSize(_self->ob_itself,
2525 startTime,
2526 duration);
2527 _res = Py_BuildValue("l",
2528 _rv);
2529 return _res;
2532 static PyObject *MediaObj_GetMediaNextInterestingTime(_self, _args)
2533 MediaObject *_self;
2534 PyObject *_args;
2536 PyObject *_res = NULL;
2537 short interestingTimeFlags;
2538 TimeValue time;
2539 Fixed rate;
2540 TimeValue interestingTime;
2541 TimeValue interestingDuration;
2542 if (!PyArg_ParseTuple(_args, "hlO&",
2543 &interestingTimeFlags,
2544 &time,
2545 PyMac_GetFixed, &rate))
2546 return NULL;
2547 GetMediaNextInterestingTime(_self->ob_itself,
2548 interestingTimeFlags,
2549 time,
2550 rate,
2551 &interestingTime,
2552 &interestingDuration);
2553 _res = Py_BuildValue("ll",
2554 interestingTime,
2555 interestingDuration);
2556 return _res;
2559 static PyObject *MediaObj_GetMediaDataRef(_self, _args)
2560 MediaObject *_self;
2561 PyObject *_args;
2563 PyObject *_res = NULL;
2564 OSErr _err;
2565 short index;
2566 Handle dataRef;
2567 OSType dataRefType;
2568 long dataRefAttributes;
2569 if (!PyArg_ParseTuple(_args, "h",
2570 &index))
2571 return NULL;
2572 _err = GetMediaDataRef(_self->ob_itself,
2573 index,
2574 &dataRef,
2575 &dataRefType,
2576 &dataRefAttributes);
2577 if (_err != noErr) return PyMac_Error(_err);
2578 _res = Py_BuildValue("O&O&l",
2579 ResObj_New, dataRef,
2580 PyMac_BuildOSType, dataRefType,
2581 dataRefAttributes);
2582 return _res;
2585 static PyObject *MediaObj_SetMediaDataRef(_self, _args)
2586 MediaObject *_self;
2587 PyObject *_args;
2589 PyObject *_res = NULL;
2590 OSErr _err;
2591 short index;
2592 Handle dataRef;
2593 OSType dataRefType;
2594 if (!PyArg_ParseTuple(_args, "hO&O&",
2595 &index,
2596 ResObj_Convert, &dataRef,
2597 PyMac_GetOSType, &dataRefType))
2598 return NULL;
2599 _err = SetMediaDataRef(_self->ob_itself,
2600 index,
2601 dataRef,
2602 dataRefType);
2603 if (_err != noErr) return PyMac_Error(_err);
2604 Py_INCREF(Py_None);
2605 _res = Py_None;
2606 return _res;
2609 static PyObject *MediaObj_SetMediaDataRefAttributes(_self, _args)
2610 MediaObject *_self;
2611 PyObject *_args;
2613 PyObject *_res = NULL;
2614 OSErr _err;
2615 short index;
2616 long dataRefAttributes;
2617 if (!PyArg_ParseTuple(_args, "hl",
2618 &index,
2619 &dataRefAttributes))
2620 return NULL;
2621 _err = SetMediaDataRefAttributes(_self->ob_itself,
2622 index,
2623 dataRefAttributes);
2624 if (_err != noErr) return PyMac_Error(_err);
2625 Py_INCREF(Py_None);
2626 _res = Py_None;
2627 return _res;
2630 static PyObject *MediaObj_AddMediaDataRef(_self, _args)
2631 MediaObject *_self;
2632 PyObject *_args;
2634 PyObject *_res = NULL;
2635 OSErr _err;
2636 short index;
2637 Handle dataRef;
2638 OSType dataRefType;
2639 if (!PyArg_ParseTuple(_args, "O&O&",
2640 ResObj_Convert, &dataRef,
2641 PyMac_GetOSType, &dataRefType))
2642 return NULL;
2643 _err = AddMediaDataRef(_self->ob_itself,
2644 &index,
2645 dataRef,
2646 dataRefType);
2647 if (_err != noErr) return PyMac_Error(_err);
2648 _res = Py_BuildValue("h",
2649 index);
2650 return _res;
2653 static PyObject *MediaObj_GetMediaDataRefCount(_self, _args)
2654 MediaObject *_self;
2655 PyObject *_args;
2657 PyObject *_res = NULL;
2658 OSErr _err;
2659 short count;
2660 if (!PyArg_ParseTuple(_args, ""))
2661 return NULL;
2662 _err = GetMediaDataRefCount(_self->ob_itself,
2663 &count);
2664 if (_err != noErr) return PyMac_Error(_err);
2665 _res = Py_BuildValue("h",
2666 count);
2667 return _res;
2670 static PyObject *MediaObj_SetMediaPlayHints(_self, _args)
2671 MediaObject *_self;
2672 PyObject *_args;
2674 PyObject *_res = NULL;
2675 long flags;
2676 long flagsMask;
2677 if (!PyArg_ParseTuple(_args, "ll",
2678 &flags,
2679 &flagsMask))
2680 return NULL;
2681 SetMediaPlayHints(_self->ob_itself,
2682 flags,
2683 flagsMask);
2684 Py_INCREF(Py_None);
2685 _res = Py_None;
2686 return _res;
2689 static PyObject *MediaObj_GetMediaPlayHints(_self, _args)
2690 MediaObject *_self;
2691 PyObject *_args;
2693 PyObject *_res = NULL;
2694 long flags;
2695 if (!PyArg_ParseTuple(_args, ""))
2696 return NULL;
2697 GetMediaPlayHints(_self->ob_itself,
2698 &flags);
2699 _res = Py_BuildValue("l",
2700 flags);
2701 return _res;
2704 static PyMethodDef MediaObj_methods[] = {
2705 {"LoadMediaIntoRam", (PyCFunction)MediaObj_LoadMediaIntoRam, 1,
2706 "(TimeValue time, TimeValue duration, long flags) -> None"},
2707 {"GetMediaTrack", (PyCFunction)MediaObj_GetMediaTrack, 1,
2708 "() -> (Track _rv)"},
2709 {"GetMediaCreationTime", (PyCFunction)MediaObj_GetMediaCreationTime, 1,
2710 "() -> (unsigned long _rv)"},
2711 {"GetMediaModificationTime", (PyCFunction)MediaObj_GetMediaModificationTime, 1,
2712 "() -> (unsigned long _rv)"},
2713 {"GetMediaTimeScale", (PyCFunction)MediaObj_GetMediaTimeScale, 1,
2714 "() -> (TimeScale _rv)"},
2715 {"SetMediaTimeScale", (PyCFunction)MediaObj_SetMediaTimeScale, 1,
2716 "(TimeScale timeScale) -> None"},
2717 {"GetMediaDuration", (PyCFunction)MediaObj_GetMediaDuration, 1,
2718 "() -> (TimeValue _rv)"},
2719 {"GetMediaLanguage", (PyCFunction)MediaObj_GetMediaLanguage, 1,
2720 "() -> (short _rv)"},
2721 {"SetMediaLanguage", (PyCFunction)MediaObj_SetMediaLanguage, 1,
2722 "(short language) -> None"},
2723 {"GetMediaQuality", (PyCFunction)MediaObj_GetMediaQuality, 1,
2724 "() -> (short _rv)"},
2725 {"SetMediaQuality", (PyCFunction)MediaObj_SetMediaQuality, 1,
2726 "(short quality) -> None"},
2727 {"GetMediaHandlerDescription", (PyCFunction)MediaObj_GetMediaHandlerDescription, 1,
2728 "(Str255 creatorName) -> (OSType mediaType, OSType creatorManufacturer)"},
2729 {"GetMediaUserData", (PyCFunction)MediaObj_GetMediaUserData, 1,
2730 "() -> (UserData _rv)"},
2731 {"GetMediaHandler", (PyCFunction)MediaObj_GetMediaHandler, 1,
2732 "() -> (MediaHandler _rv)"},
2733 {"SetMediaHandler", (PyCFunction)MediaObj_SetMediaHandler, 1,
2734 "(MediaHandlerComponent mH) -> None"},
2735 {"BeginMediaEdits", (PyCFunction)MediaObj_BeginMediaEdits, 1,
2736 "() -> None"},
2737 {"EndMediaEdits", (PyCFunction)MediaObj_EndMediaEdits, 1,
2738 "() -> None"},
2739 {"SetMediaDefaultDataRefIndex", (PyCFunction)MediaObj_SetMediaDefaultDataRefIndex, 1,
2740 "(short index) -> None"},
2741 {"GetMediaDataHandlerDescription", (PyCFunction)MediaObj_GetMediaDataHandlerDescription, 1,
2742 "(short index, Str255 creatorName) -> (OSType dhType, OSType creatorManufacturer)"},
2743 {"GetMediaDataHandler", (PyCFunction)MediaObj_GetMediaDataHandler, 1,
2744 "(short index) -> (DataHandler _rv)"},
2745 {"SetMediaDataHandler", (PyCFunction)MediaObj_SetMediaDataHandler, 1,
2746 "(short index, DataHandlerComponent dataHandler) -> None"},
2747 {"GetMediaSampleDescriptionCount", (PyCFunction)MediaObj_GetMediaSampleDescriptionCount, 1,
2748 "() -> (long _rv)"},
2749 {"GetMediaSampleDescription", (PyCFunction)MediaObj_GetMediaSampleDescription, 1,
2750 "(long index, SampleDescriptionHandle descH) -> None"},
2751 {"SetMediaSampleDescription", (PyCFunction)MediaObj_SetMediaSampleDescription, 1,
2752 "(long index, SampleDescriptionHandle descH) -> None"},
2753 {"GetMediaSampleCount", (PyCFunction)MediaObj_GetMediaSampleCount, 1,
2754 "() -> (long _rv)"},
2755 {"GetMediaSyncSampleCount", (PyCFunction)MediaObj_GetMediaSyncSampleCount, 1,
2756 "() -> (long _rv)"},
2757 {"SampleNumToMediaTime", (PyCFunction)MediaObj_SampleNumToMediaTime, 1,
2758 "(long logicalSampleNum) -> (TimeValue sampleTime, TimeValue sampleDuration)"},
2759 {"MediaTimeToSampleNum", (PyCFunction)MediaObj_MediaTimeToSampleNum, 1,
2760 "(TimeValue time) -> (long sampleNum, TimeValue sampleTime, TimeValue sampleDuration)"},
2761 {"AddMediaSample", (PyCFunction)MediaObj_AddMediaSample, 1,
2762 "(Handle dataIn, long inOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
2763 {"AddMediaSampleReference", (PyCFunction)MediaObj_AddMediaSampleReference, 1,
2764 "(long dataOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
2765 {"GetMediaSample", (PyCFunction)MediaObj_GetMediaSample, 1,
2766 "(Handle dataOut, long maxSizeToGrow, TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
2767 {"GetMediaSampleReference", (PyCFunction)MediaObj_GetMediaSampleReference, 1,
2768 "(TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long dataOffset, long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
2769 {"SetMediaPreferredChunkSize", (PyCFunction)MediaObj_SetMediaPreferredChunkSize, 1,
2770 "(long maxChunkSize) -> None"},
2771 {"GetMediaPreferredChunkSize", (PyCFunction)MediaObj_GetMediaPreferredChunkSize, 1,
2772 "() -> (long maxChunkSize)"},
2773 {"SetMediaShadowSync", (PyCFunction)MediaObj_SetMediaShadowSync, 1,
2774 "(long frameDiffSampleNum, long syncSampleNum) -> None"},
2775 {"GetMediaShadowSync", (PyCFunction)MediaObj_GetMediaShadowSync, 1,
2776 "(long frameDiffSampleNum) -> (long syncSampleNum)"},
2777 {"GetMediaDataSize", (PyCFunction)MediaObj_GetMediaDataSize, 1,
2778 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
2779 {"GetMediaNextInterestingTime", (PyCFunction)MediaObj_GetMediaNextInterestingTime, 1,
2780 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
2781 {"GetMediaDataRef", (PyCFunction)MediaObj_GetMediaDataRef, 1,
2782 "(short index) -> (Handle dataRef, OSType dataRefType, long dataRefAttributes)"},
2783 {"SetMediaDataRef", (PyCFunction)MediaObj_SetMediaDataRef, 1,
2784 "(short index, Handle dataRef, OSType dataRefType) -> None"},
2785 {"SetMediaDataRefAttributes", (PyCFunction)MediaObj_SetMediaDataRefAttributes, 1,
2786 "(short index, long dataRefAttributes) -> None"},
2787 {"AddMediaDataRef", (PyCFunction)MediaObj_AddMediaDataRef, 1,
2788 "(Handle dataRef, OSType dataRefType) -> (short index)"},
2789 {"GetMediaDataRefCount", (PyCFunction)MediaObj_GetMediaDataRefCount, 1,
2790 "() -> (short count)"},
2791 {"SetMediaPlayHints", (PyCFunction)MediaObj_SetMediaPlayHints, 1,
2792 "(long flags, long flagsMask) -> None"},
2793 {"GetMediaPlayHints", (PyCFunction)MediaObj_GetMediaPlayHints, 1,
2794 "() -> (long flags)"},
2795 {NULL, NULL, 0}
2798 PyMethodChain MediaObj_chain = { MediaObj_methods, NULL };
2800 static PyObject *MediaObj_getattr(self, name)
2801 MediaObject *self;
2802 char *name;
2804 return Py_FindMethodInChain(&MediaObj_chain, (PyObject *)self, name);
2807 #define MediaObj_setattr NULL
2809 PyTypeObject Media_Type = {
2810 PyObject_HEAD_INIT(&PyType_Type)
2811 0, /*ob_size*/
2812 "Media", /*tp_name*/
2813 sizeof(MediaObject), /*tp_basicsize*/
2814 0, /*tp_itemsize*/
2815 /* methods */
2816 (destructor) MediaObj_dealloc, /*tp_dealloc*/
2817 0, /*tp_print*/
2818 (getattrfunc) MediaObj_getattr, /*tp_getattr*/
2819 (setattrfunc) MediaObj_setattr, /*tp_setattr*/
2822 /* --------------------- End object type Media ---------------------- */
2825 /* ----------------------- Object type Track ------------------------ */
2827 PyTypeObject Track_Type;
2829 #define TrackObj_Check(x) ((x)->ob_type == &Track_Type)
2831 typedef struct TrackObject {
2832 PyObject_HEAD
2833 Track ob_itself;
2834 } TrackObject;
2836 PyObject *TrackObj_New(itself)
2837 Track itself;
2839 TrackObject *it;
2840 if (itself == NULL) {
2841 PyErr_SetString(Qt_Error,"Cannot create null Track");
2842 return NULL;
2844 it = PyObject_NEW(TrackObject, &Track_Type);
2845 if (it == NULL) return NULL;
2846 it->ob_itself = itself;
2847 return (PyObject *)it;
2849 TrackObj_Convert(v, p_itself)
2850 PyObject *v;
2851 Track *p_itself;
2853 if (!TrackObj_Check(v))
2855 PyErr_SetString(PyExc_TypeError, "Track required");
2856 return 0;
2858 *p_itself = ((TrackObject *)v)->ob_itself;
2859 return 1;
2862 static void TrackObj_dealloc(self)
2863 TrackObject *self;
2865 DisposeMovieTrack(self->ob_itself);
2866 PyMem_DEL(self);
2869 static PyObject *TrackObj_LoadTrackIntoRam(_self, _args)
2870 TrackObject *_self;
2871 PyObject *_args;
2873 PyObject *_res = NULL;
2874 OSErr _err;
2875 TimeValue time;
2876 TimeValue duration;
2877 long flags;
2878 if (!PyArg_ParseTuple(_args, "lll",
2879 &time,
2880 &duration,
2881 &flags))
2882 return NULL;
2883 _err = LoadTrackIntoRam(_self->ob_itself,
2884 time,
2885 duration,
2886 flags);
2887 if (_err != noErr) return PyMac_Error(_err);
2888 Py_INCREF(Py_None);
2889 _res = Py_None;
2890 return _res;
2893 static PyObject *TrackObj_GetTrackPict(_self, _args)
2894 TrackObject *_self;
2895 PyObject *_args;
2897 PyObject *_res = NULL;
2898 PicHandle _rv;
2899 TimeValue time;
2900 if (!PyArg_ParseTuple(_args, "l",
2901 &time))
2902 return NULL;
2903 _rv = GetTrackPict(_self->ob_itself,
2904 time);
2905 _res = Py_BuildValue("O&",
2906 ResObj_New, _rv);
2907 return _res;
2910 static PyObject *TrackObj_GetTrackClipRgn(_self, _args)
2911 TrackObject *_self;
2912 PyObject *_args;
2914 PyObject *_res = NULL;
2915 RgnHandle _rv;
2916 if (!PyArg_ParseTuple(_args, ""))
2917 return NULL;
2918 _rv = GetTrackClipRgn(_self->ob_itself);
2919 _res = Py_BuildValue("O&",
2920 ResObj_New, _rv);
2921 return _res;
2924 static PyObject *TrackObj_SetTrackClipRgn(_self, _args)
2925 TrackObject *_self;
2926 PyObject *_args;
2928 PyObject *_res = NULL;
2929 RgnHandle theClip;
2930 if (!PyArg_ParseTuple(_args, "O&",
2931 ResObj_Convert, &theClip))
2932 return NULL;
2933 SetTrackClipRgn(_self->ob_itself,
2934 theClip);
2935 Py_INCREF(Py_None);
2936 _res = Py_None;
2937 return _res;
2940 static PyObject *TrackObj_GetTrackDisplayBoundsRgn(_self, _args)
2941 TrackObject *_self;
2942 PyObject *_args;
2944 PyObject *_res = NULL;
2945 RgnHandle _rv;
2946 if (!PyArg_ParseTuple(_args, ""))
2947 return NULL;
2948 _rv = GetTrackDisplayBoundsRgn(_self->ob_itself);
2949 _res = Py_BuildValue("O&",
2950 ResObj_New, _rv);
2951 return _res;
2954 static PyObject *TrackObj_GetTrackMovieBoundsRgn(_self, _args)
2955 TrackObject *_self;
2956 PyObject *_args;
2958 PyObject *_res = NULL;
2959 RgnHandle _rv;
2960 if (!PyArg_ParseTuple(_args, ""))
2961 return NULL;
2962 _rv = GetTrackMovieBoundsRgn(_self->ob_itself);
2963 _res = Py_BuildValue("O&",
2964 ResObj_New, _rv);
2965 return _res;
2968 static PyObject *TrackObj_GetTrackBoundsRgn(_self, _args)
2969 TrackObject *_self;
2970 PyObject *_args;
2972 PyObject *_res = NULL;
2973 RgnHandle _rv;
2974 if (!PyArg_ParseTuple(_args, ""))
2975 return NULL;
2976 _rv = GetTrackBoundsRgn(_self->ob_itself);
2977 _res = Py_BuildValue("O&",
2978 ResObj_New, _rv);
2979 return _res;
2982 static PyObject *TrackObj_GetTrackMatte(_self, _args)
2983 TrackObject *_self;
2984 PyObject *_args;
2986 PyObject *_res = NULL;
2987 PixMapHandle _rv;
2988 if (!PyArg_ParseTuple(_args, ""))
2989 return NULL;
2990 _rv = GetTrackMatte(_self->ob_itself);
2991 _res = Py_BuildValue("O&",
2992 ResObj_New, _rv);
2993 return _res;
2996 static PyObject *TrackObj_SetTrackMatte(_self, _args)
2997 TrackObject *_self;
2998 PyObject *_args;
3000 PyObject *_res = NULL;
3001 PixMapHandle theMatte;
3002 if (!PyArg_ParseTuple(_args, "O&",
3003 ResObj_Convert, &theMatte))
3004 return NULL;
3005 SetTrackMatte(_self->ob_itself,
3006 theMatte);
3007 Py_INCREF(Py_None);
3008 _res = Py_None;
3009 return _res;
3012 static PyObject *TrackObj_GetTrackID(_self, _args)
3013 TrackObject *_self;
3014 PyObject *_args;
3016 PyObject *_res = NULL;
3017 long _rv;
3018 if (!PyArg_ParseTuple(_args, ""))
3019 return NULL;
3020 _rv = GetTrackID(_self->ob_itself);
3021 _res = Py_BuildValue("l",
3022 _rv);
3023 return _res;
3026 static PyObject *TrackObj_GetTrackMovie(_self, _args)
3027 TrackObject *_self;
3028 PyObject *_args;
3030 PyObject *_res = NULL;
3031 Movie _rv;
3032 if (!PyArg_ParseTuple(_args, ""))
3033 return NULL;
3034 _rv = GetTrackMovie(_self->ob_itself);
3035 _res = Py_BuildValue("O&",
3036 MovieObj_New, _rv);
3037 return _res;
3040 static PyObject *TrackObj_GetTrackCreationTime(_self, _args)
3041 TrackObject *_self;
3042 PyObject *_args;
3044 PyObject *_res = NULL;
3045 unsigned long _rv;
3046 if (!PyArg_ParseTuple(_args, ""))
3047 return NULL;
3048 _rv = GetTrackCreationTime(_self->ob_itself);
3049 _res = Py_BuildValue("l",
3050 _rv);
3051 return _res;
3054 static PyObject *TrackObj_GetTrackModificationTime(_self, _args)
3055 TrackObject *_self;
3056 PyObject *_args;
3058 PyObject *_res = NULL;
3059 unsigned long _rv;
3060 if (!PyArg_ParseTuple(_args, ""))
3061 return NULL;
3062 _rv = GetTrackModificationTime(_self->ob_itself);
3063 _res = Py_BuildValue("l",
3064 _rv);
3065 return _res;
3068 static PyObject *TrackObj_GetTrackEnabled(_self, _args)
3069 TrackObject *_self;
3070 PyObject *_args;
3072 PyObject *_res = NULL;
3073 Boolean _rv;
3074 if (!PyArg_ParseTuple(_args, ""))
3075 return NULL;
3076 _rv = GetTrackEnabled(_self->ob_itself);
3077 _res = Py_BuildValue("b",
3078 _rv);
3079 return _res;
3082 static PyObject *TrackObj_SetTrackEnabled(_self, _args)
3083 TrackObject *_self;
3084 PyObject *_args;
3086 PyObject *_res = NULL;
3087 Boolean isEnabled;
3088 if (!PyArg_ParseTuple(_args, "b",
3089 &isEnabled))
3090 return NULL;
3091 SetTrackEnabled(_self->ob_itself,
3092 isEnabled);
3093 Py_INCREF(Py_None);
3094 _res = Py_None;
3095 return _res;
3098 static PyObject *TrackObj_GetTrackUsage(_self, _args)
3099 TrackObject *_self;
3100 PyObject *_args;
3102 PyObject *_res = NULL;
3103 long _rv;
3104 if (!PyArg_ParseTuple(_args, ""))
3105 return NULL;
3106 _rv = GetTrackUsage(_self->ob_itself);
3107 _res = Py_BuildValue("l",
3108 _rv);
3109 return _res;
3112 static PyObject *TrackObj_SetTrackUsage(_self, _args)
3113 TrackObject *_self;
3114 PyObject *_args;
3116 PyObject *_res = NULL;
3117 long usage;
3118 if (!PyArg_ParseTuple(_args, "l",
3119 &usage))
3120 return NULL;
3121 SetTrackUsage(_self->ob_itself,
3122 usage);
3123 Py_INCREF(Py_None);
3124 _res = Py_None;
3125 return _res;
3128 static PyObject *TrackObj_GetTrackDuration(_self, _args)
3129 TrackObject *_self;
3130 PyObject *_args;
3132 PyObject *_res = NULL;
3133 TimeValue _rv;
3134 if (!PyArg_ParseTuple(_args, ""))
3135 return NULL;
3136 _rv = GetTrackDuration(_self->ob_itself);
3137 _res = Py_BuildValue("l",
3138 _rv);
3139 return _res;
3142 static PyObject *TrackObj_GetTrackOffset(_self, _args)
3143 TrackObject *_self;
3144 PyObject *_args;
3146 PyObject *_res = NULL;
3147 TimeValue _rv;
3148 if (!PyArg_ParseTuple(_args, ""))
3149 return NULL;
3150 _rv = GetTrackOffset(_self->ob_itself);
3151 _res = Py_BuildValue("l",
3152 _rv);
3153 return _res;
3156 static PyObject *TrackObj_SetTrackOffset(_self, _args)
3157 TrackObject *_self;
3158 PyObject *_args;
3160 PyObject *_res = NULL;
3161 TimeValue movieOffsetTime;
3162 if (!PyArg_ParseTuple(_args, "l",
3163 &movieOffsetTime))
3164 return NULL;
3165 SetTrackOffset(_self->ob_itself,
3166 movieOffsetTime);
3167 Py_INCREF(Py_None);
3168 _res = Py_None;
3169 return _res;
3172 static PyObject *TrackObj_GetTrackLayer(_self, _args)
3173 TrackObject *_self;
3174 PyObject *_args;
3176 PyObject *_res = NULL;
3177 short _rv;
3178 if (!PyArg_ParseTuple(_args, ""))
3179 return NULL;
3180 _rv = GetTrackLayer(_self->ob_itself);
3181 _res = Py_BuildValue("h",
3182 _rv);
3183 return _res;
3186 static PyObject *TrackObj_SetTrackLayer(_self, _args)
3187 TrackObject *_self;
3188 PyObject *_args;
3190 PyObject *_res = NULL;
3191 short layer;
3192 if (!PyArg_ParseTuple(_args, "h",
3193 &layer))
3194 return NULL;
3195 SetTrackLayer(_self->ob_itself,
3196 layer);
3197 Py_INCREF(Py_None);
3198 _res = Py_None;
3199 return _res;
3202 static PyObject *TrackObj_GetTrackAlternate(_self, _args)
3203 TrackObject *_self;
3204 PyObject *_args;
3206 PyObject *_res = NULL;
3207 Track _rv;
3208 if (!PyArg_ParseTuple(_args, ""))
3209 return NULL;
3210 _rv = GetTrackAlternate(_self->ob_itself);
3211 _res = Py_BuildValue("O&",
3212 TrackObj_New, _rv);
3213 return _res;
3216 static PyObject *TrackObj_SetTrackAlternate(_self, _args)
3217 TrackObject *_self;
3218 PyObject *_args;
3220 PyObject *_res = NULL;
3221 Track alternateT;
3222 if (!PyArg_ParseTuple(_args, "O&",
3223 TrackObj_Convert, &alternateT))
3224 return NULL;
3225 SetTrackAlternate(_self->ob_itself,
3226 alternateT);
3227 Py_INCREF(Py_None);
3228 _res = Py_None;
3229 return _res;
3232 static PyObject *TrackObj_GetTrackVolume(_self, _args)
3233 TrackObject *_self;
3234 PyObject *_args;
3236 PyObject *_res = NULL;
3237 short _rv;
3238 if (!PyArg_ParseTuple(_args, ""))
3239 return NULL;
3240 _rv = GetTrackVolume(_self->ob_itself);
3241 _res = Py_BuildValue("h",
3242 _rv);
3243 return _res;
3246 static PyObject *TrackObj_SetTrackVolume(_self, _args)
3247 TrackObject *_self;
3248 PyObject *_args;
3250 PyObject *_res = NULL;
3251 short volume;
3252 if (!PyArg_ParseTuple(_args, "h",
3253 &volume))
3254 return NULL;
3255 SetTrackVolume(_self->ob_itself,
3256 volume);
3257 Py_INCREF(Py_None);
3258 _res = Py_None;
3259 return _res;
3262 static PyObject *TrackObj_GetTrackDimensions(_self, _args)
3263 TrackObject *_self;
3264 PyObject *_args;
3266 PyObject *_res = NULL;
3267 Fixed width;
3268 Fixed height;
3269 if (!PyArg_ParseTuple(_args, ""))
3270 return NULL;
3271 GetTrackDimensions(_self->ob_itself,
3272 &width,
3273 &height);
3274 _res = Py_BuildValue("O&O&",
3275 PyMac_BuildFixed, width,
3276 PyMac_BuildFixed, height);
3277 return _res;
3280 static PyObject *TrackObj_SetTrackDimensions(_self, _args)
3281 TrackObject *_self;
3282 PyObject *_args;
3284 PyObject *_res = NULL;
3285 Fixed width;
3286 Fixed height;
3287 if (!PyArg_ParseTuple(_args, "O&O&",
3288 PyMac_GetFixed, &width,
3289 PyMac_GetFixed, &height))
3290 return NULL;
3291 SetTrackDimensions(_self->ob_itself,
3292 width,
3293 height);
3294 Py_INCREF(Py_None);
3295 _res = Py_None;
3296 return _res;
3299 static PyObject *TrackObj_GetTrackUserData(_self, _args)
3300 TrackObject *_self;
3301 PyObject *_args;
3303 PyObject *_res = NULL;
3304 UserData _rv;
3305 if (!PyArg_ParseTuple(_args, ""))
3306 return NULL;
3307 _rv = GetTrackUserData(_self->ob_itself);
3308 _res = Py_BuildValue("O&",
3309 UserDataObj_New, _rv);
3310 return _res;
3313 static PyObject *TrackObj_GetTrackSoundLocalizationSettings(_self, _args)
3314 TrackObject *_self;
3315 PyObject *_args;
3317 PyObject *_res = NULL;
3318 OSErr _err;
3319 Handle settings;
3320 if (!PyArg_ParseTuple(_args, ""))
3321 return NULL;
3322 _err = GetTrackSoundLocalizationSettings(_self->ob_itself,
3323 &settings);
3324 if (_err != noErr) return PyMac_Error(_err);
3325 _res = Py_BuildValue("O&",
3326 ResObj_New, settings);
3327 return _res;
3330 static PyObject *TrackObj_SetTrackSoundLocalizationSettings(_self, _args)
3331 TrackObject *_self;
3332 PyObject *_args;
3334 PyObject *_res = NULL;
3335 OSErr _err;
3336 Handle settings;
3337 if (!PyArg_ParseTuple(_args, "O&",
3338 ResObj_Convert, &settings))
3339 return NULL;
3340 _err = SetTrackSoundLocalizationSettings(_self->ob_itself,
3341 settings);
3342 if (_err != noErr) return PyMac_Error(_err);
3343 Py_INCREF(Py_None);
3344 _res = Py_None;
3345 return _res;
3348 static PyObject *TrackObj_NewTrackMedia(_self, _args)
3349 TrackObject *_self;
3350 PyObject *_args;
3352 PyObject *_res = NULL;
3353 Media _rv;
3354 OSType mediaType;
3355 TimeScale timeScale;
3356 Handle dataRef;
3357 OSType dataRefType;
3358 if (!PyArg_ParseTuple(_args, "O&lO&O&",
3359 PyMac_GetOSType, &mediaType,
3360 &timeScale,
3361 ResObj_Convert, &dataRef,
3362 PyMac_GetOSType, &dataRefType))
3363 return NULL;
3364 _rv = NewTrackMedia(_self->ob_itself,
3365 mediaType,
3366 timeScale,
3367 dataRef,
3368 dataRefType);
3369 _res = Py_BuildValue("O&",
3370 MediaObj_New, _rv);
3371 return _res;
3374 static PyObject *TrackObj_GetTrackMedia(_self, _args)
3375 TrackObject *_self;
3376 PyObject *_args;
3378 PyObject *_res = NULL;
3379 Media _rv;
3380 if (!PyArg_ParseTuple(_args, ""))
3381 return NULL;
3382 _rv = GetTrackMedia(_self->ob_itself);
3383 _res = Py_BuildValue("O&",
3384 MediaObj_New, _rv);
3385 return _res;
3388 static PyObject *TrackObj_InsertMediaIntoTrack(_self, _args)
3389 TrackObject *_self;
3390 PyObject *_args;
3392 PyObject *_res = NULL;
3393 OSErr _err;
3394 TimeValue trackStart;
3395 TimeValue mediaTime;
3396 TimeValue mediaDuration;
3397 Fixed mediaRate;
3398 if (!PyArg_ParseTuple(_args, "lllO&",
3399 &trackStart,
3400 &mediaTime,
3401 &mediaDuration,
3402 PyMac_GetFixed, &mediaRate))
3403 return NULL;
3404 _err = InsertMediaIntoTrack(_self->ob_itself,
3405 trackStart,
3406 mediaTime,
3407 mediaDuration,
3408 mediaRate);
3409 if (_err != noErr) return PyMac_Error(_err);
3410 Py_INCREF(Py_None);
3411 _res = Py_None;
3412 return _res;
3415 static PyObject *TrackObj_InsertTrackSegment(_self, _args)
3416 TrackObject *_self;
3417 PyObject *_args;
3419 PyObject *_res = NULL;
3420 OSErr _err;
3421 Track dstTrack;
3422 TimeValue srcIn;
3423 TimeValue srcDuration;
3424 TimeValue dstIn;
3425 if (!PyArg_ParseTuple(_args, "O&lll",
3426 TrackObj_Convert, &dstTrack,
3427 &srcIn,
3428 &srcDuration,
3429 &dstIn))
3430 return NULL;
3431 _err = InsertTrackSegment(_self->ob_itself,
3432 dstTrack,
3433 srcIn,
3434 srcDuration,
3435 dstIn);
3436 if (_err != noErr) return PyMac_Error(_err);
3437 Py_INCREF(Py_None);
3438 _res = Py_None;
3439 return _res;
3442 static PyObject *TrackObj_InsertEmptyTrackSegment(_self, _args)
3443 TrackObject *_self;
3444 PyObject *_args;
3446 PyObject *_res = NULL;
3447 OSErr _err;
3448 TimeValue dstIn;
3449 TimeValue dstDuration;
3450 if (!PyArg_ParseTuple(_args, "ll",
3451 &dstIn,
3452 &dstDuration))
3453 return NULL;
3454 _err = InsertEmptyTrackSegment(_self->ob_itself,
3455 dstIn,
3456 dstDuration);
3457 if (_err != noErr) return PyMac_Error(_err);
3458 Py_INCREF(Py_None);
3459 _res = Py_None;
3460 return _res;
3463 static PyObject *TrackObj_DeleteTrackSegment(_self, _args)
3464 TrackObject *_self;
3465 PyObject *_args;
3467 PyObject *_res = NULL;
3468 OSErr _err;
3469 TimeValue startTime;
3470 TimeValue duration;
3471 if (!PyArg_ParseTuple(_args, "ll",
3472 &startTime,
3473 &duration))
3474 return NULL;
3475 _err = DeleteTrackSegment(_self->ob_itself,
3476 startTime,
3477 duration);
3478 if (_err != noErr) return PyMac_Error(_err);
3479 Py_INCREF(Py_None);
3480 _res = Py_None;
3481 return _res;
3484 static PyObject *TrackObj_ScaleTrackSegment(_self, _args)
3485 TrackObject *_self;
3486 PyObject *_args;
3488 PyObject *_res = NULL;
3489 OSErr _err;
3490 TimeValue startTime;
3491 TimeValue oldDuration;
3492 TimeValue newDuration;
3493 if (!PyArg_ParseTuple(_args, "lll",
3494 &startTime,
3495 &oldDuration,
3496 &newDuration))
3497 return NULL;
3498 _err = ScaleTrackSegment(_self->ob_itself,
3499 startTime,
3500 oldDuration,
3501 newDuration);
3502 if (_err != noErr) return PyMac_Error(_err);
3503 Py_INCREF(Py_None);
3504 _res = Py_None;
3505 return _res;
3508 static PyObject *TrackObj_IsScrapMovie(_self, _args)
3509 TrackObject *_self;
3510 PyObject *_args;
3512 PyObject *_res = NULL;
3513 Component _rv;
3514 if (!PyArg_ParseTuple(_args, ""))
3515 return NULL;
3516 _rv = IsScrapMovie(_self->ob_itself);
3517 _res = Py_BuildValue("O&",
3518 CmpObj_New, _rv);
3519 return _res;
3522 static PyObject *TrackObj_CopyTrackSettings(_self, _args)
3523 TrackObject *_self;
3524 PyObject *_args;
3526 PyObject *_res = NULL;
3527 OSErr _err;
3528 Track dstTrack;
3529 if (!PyArg_ParseTuple(_args, "O&",
3530 TrackObj_Convert, &dstTrack))
3531 return NULL;
3532 _err = CopyTrackSettings(_self->ob_itself,
3533 dstTrack);
3534 if (_err != noErr) return PyMac_Error(_err);
3535 Py_INCREF(Py_None);
3536 _res = Py_None;
3537 return _res;
3540 static PyObject *TrackObj_AddEmptyTrackToMovie(_self, _args)
3541 TrackObject *_self;
3542 PyObject *_args;
3544 PyObject *_res = NULL;
3545 OSErr _err;
3546 Movie dstMovie;
3547 Handle dataRef;
3548 OSType dataRefType;
3549 Track dstTrack;
3550 if (!PyArg_ParseTuple(_args, "O&O&O&",
3551 MovieObj_Convert, &dstMovie,
3552 ResObj_Convert, &dataRef,
3553 PyMac_GetOSType, &dataRefType))
3554 return NULL;
3555 _err = AddEmptyTrackToMovie(_self->ob_itself,
3556 dstMovie,
3557 dataRef,
3558 dataRefType,
3559 &dstTrack);
3560 if (_err != noErr) return PyMac_Error(_err);
3561 _res = Py_BuildValue("O&",
3562 TrackObj_New, dstTrack);
3563 return _res;
3566 static PyObject *TrackObj_AddTrackReference(_self, _args)
3567 TrackObject *_self;
3568 PyObject *_args;
3570 PyObject *_res = NULL;
3571 OSErr _err;
3572 Track refTrack;
3573 OSType refType;
3574 long addedIndex;
3575 if (!PyArg_ParseTuple(_args, "O&O&",
3576 TrackObj_Convert, &refTrack,
3577 PyMac_GetOSType, &refType))
3578 return NULL;
3579 _err = AddTrackReference(_self->ob_itself,
3580 refTrack,
3581 refType,
3582 &addedIndex);
3583 if (_err != noErr) return PyMac_Error(_err);
3584 _res = Py_BuildValue("l",
3585 addedIndex);
3586 return _res;
3589 static PyObject *TrackObj_DeleteTrackReference(_self, _args)
3590 TrackObject *_self;
3591 PyObject *_args;
3593 PyObject *_res = NULL;
3594 OSErr _err;
3595 OSType refType;
3596 long index;
3597 if (!PyArg_ParseTuple(_args, "O&l",
3598 PyMac_GetOSType, &refType,
3599 &index))
3600 return NULL;
3601 _err = DeleteTrackReference(_self->ob_itself,
3602 refType,
3603 index);
3604 if (_err != noErr) return PyMac_Error(_err);
3605 Py_INCREF(Py_None);
3606 _res = Py_None;
3607 return _res;
3610 static PyObject *TrackObj_SetTrackReference(_self, _args)
3611 TrackObject *_self;
3612 PyObject *_args;
3614 PyObject *_res = NULL;
3615 OSErr _err;
3616 Track refTrack;
3617 OSType refType;
3618 long index;
3619 if (!PyArg_ParseTuple(_args, "O&O&l",
3620 TrackObj_Convert, &refTrack,
3621 PyMac_GetOSType, &refType,
3622 &index))
3623 return NULL;
3624 _err = SetTrackReference(_self->ob_itself,
3625 refTrack,
3626 refType,
3627 index);
3628 if (_err != noErr) return PyMac_Error(_err);
3629 Py_INCREF(Py_None);
3630 _res = Py_None;
3631 return _res;
3634 static PyObject *TrackObj_GetTrackReference(_self, _args)
3635 TrackObject *_self;
3636 PyObject *_args;
3638 PyObject *_res = NULL;
3639 Track _rv;
3640 OSType refType;
3641 long index;
3642 if (!PyArg_ParseTuple(_args, "O&l",
3643 PyMac_GetOSType, &refType,
3644 &index))
3645 return NULL;
3646 _rv = GetTrackReference(_self->ob_itself,
3647 refType,
3648 index);
3649 _res = Py_BuildValue("O&",
3650 TrackObj_New, _rv);
3651 return _res;
3654 static PyObject *TrackObj_GetNextTrackReferenceType(_self, _args)
3655 TrackObject *_self;
3656 PyObject *_args;
3658 PyObject *_res = NULL;
3659 OSType _rv;
3660 OSType refType;
3661 if (!PyArg_ParseTuple(_args, "O&",
3662 PyMac_GetOSType, &refType))
3663 return NULL;
3664 _rv = GetNextTrackReferenceType(_self->ob_itself,
3665 refType);
3666 _res = Py_BuildValue("O&",
3667 PyMac_BuildOSType, _rv);
3668 return _res;
3671 static PyObject *TrackObj_GetTrackReferenceCount(_self, _args)
3672 TrackObject *_self;
3673 PyObject *_args;
3675 PyObject *_res = NULL;
3676 long _rv;
3677 OSType refType;
3678 if (!PyArg_ParseTuple(_args, "O&",
3679 PyMac_GetOSType, &refType))
3680 return NULL;
3681 _rv = GetTrackReferenceCount(_self->ob_itself,
3682 refType);
3683 _res = Py_BuildValue("l",
3684 _rv);
3685 return _res;
3688 static PyObject *TrackObj_GetTrackEditRate(_self, _args)
3689 TrackObject *_self;
3690 PyObject *_args;
3692 PyObject *_res = NULL;
3693 Fixed _rv;
3694 TimeValue atTime;
3695 if (!PyArg_ParseTuple(_args, "l",
3696 &atTime))
3697 return NULL;
3698 _rv = GetTrackEditRate(_self->ob_itself,
3699 atTime);
3700 _res = Py_BuildValue("O&",
3701 PyMac_BuildFixed, _rv);
3702 return _res;
3705 static PyObject *TrackObj_GetTrackDataSize(_self, _args)
3706 TrackObject *_self;
3707 PyObject *_args;
3709 PyObject *_res = NULL;
3710 long _rv;
3711 TimeValue startTime;
3712 TimeValue duration;
3713 if (!PyArg_ParseTuple(_args, "ll",
3714 &startTime,
3715 &duration))
3716 return NULL;
3717 _rv = GetTrackDataSize(_self->ob_itself,
3718 startTime,
3719 duration);
3720 _res = Py_BuildValue("l",
3721 _rv);
3722 return _res;
3725 static PyObject *TrackObj_PtInTrack(_self, _args)
3726 TrackObject *_self;
3727 PyObject *_args;
3729 PyObject *_res = NULL;
3730 Boolean _rv;
3731 Point pt;
3732 if (!PyArg_ParseTuple(_args, "O&",
3733 PyMac_GetPoint, &pt))
3734 return NULL;
3735 _rv = PtInTrack(_self->ob_itself,
3736 pt);
3737 _res = Py_BuildValue("b",
3738 _rv);
3739 return _res;
3742 static PyObject *TrackObj_GetTrackNextInterestingTime(_self, _args)
3743 TrackObject *_self;
3744 PyObject *_args;
3746 PyObject *_res = NULL;
3747 short interestingTimeFlags;
3748 TimeValue time;
3749 Fixed rate;
3750 TimeValue interestingTime;
3751 TimeValue interestingDuration;
3752 if (!PyArg_ParseTuple(_args, "hlO&",
3753 &interestingTimeFlags,
3754 &time,
3755 PyMac_GetFixed, &rate))
3756 return NULL;
3757 GetTrackNextInterestingTime(_self->ob_itself,
3758 interestingTimeFlags,
3759 time,
3760 rate,
3761 &interestingTime,
3762 &interestingDuration);
3763 _res = Py_BuildValue("ll",
3764 interestingTime,
3765 interestingDuration);
3766 return _res;
3769 static PyObject *TrackObj_GetTrackSegmentDisplayBoundsRgn(_self, _args)
3770 TrackObject *_self;
3771 PyObject *_args;
3773 PyObject *_res = NULL;
3774 RgnHandle _rv;
3775 TimeValue time;
3776 TimeValue duration;
3777 if (!PyArg_ParseTuple(_args, "ll",
3778 &time,
3779 &duration))
3780 return NULL;
3781 _rv = GetTrackSegmentDisplayBoundsRgn(_self->ob_itself,
3782 time,
3783 duration);
3784 _res = Py_BuildValue("O&",
3785 ResObj_New, _rv);
3786 return _res;
3789 static PyObject *TrackObj_GetTrackStatus(_self, _args)
3790 TrackObject *_self;
3791 PyObject *_args;
3793 PyObject *_res = NULL;
3794 ComponentResult _rv;
3795 if (!PyArg_ParseTuple(_args, ""))
3796 return NULL;
3797 _rv = GetTrackStatus(_self->ob_itself);
3798 _res = Py_BuildValue("l",
3799 _rv);
3800 return _res;
3803 static PyObject *TrackObj_SetTrackLoadSettings(_self, _args)
3804 TrackObject *_self;
3805 PyObject *_args;
3807 PyObject *_res = NULL;
3808 TimeValue preloadTime;
3809 TimeValue preloadDuration;
3810 long preloadFlags;
3811 long defaultHints;
3812 if (!PyArg_ParseTuple(_args, "llll",
3813 &preloadTime,
3814 &preloadDuration,
3815 &preloadFlags,
3816 &defaultHints))
3817 return NULL;
3818 SetTrackLoadSettings(_self->ob_itself,
3819 preloadTime,
3820 preloadDuration,
3821 preloadFlags,
3822 defaultHints);
3823 Py_INCREF(Py_None);
3824 _res = Py_None;
3825 return _res;
3828 static PyObject *TrackObj_GetTrackLoadSettings(_self, _args)
3829 TrackObject *_self;
3830 PyObject *_args;
3832 PyObject *_res = NULL;
3833 TimeValue preloadTime;
3834 TimeValue preloadDuration;
3835 long preloadFlags;
3836 long defaultHints;
3837 if (!PyArg_ParseTuple(_args, ""))
3838 return NULL;
3839 GetTrackLoadSettings(_self->ob_itself,
3840 &preloadTime,
3841 &preloadDuration,
3842 &preloadFlags,
3843 &defaultHints);
3844 _res = Py_BuildValue("llll",
3845 preloadTime,
3846 preloadDuration,
3847 preloadFlags,
3848 defaultHints);
3849 return _res;
3852 static PyMethodDef TrackObj_methods[] = {
3853 {"LoadTrackIntoRam", (PyCFunction)TrackObj_LoadTrackIntoRam, 1,
3854 "(TimeValue time, TimeValue duration, long flags) -> None"},
3855 {"GetTrackPict", (PyCFunction)TrackObj_GetTrackPict, 1,
3856 "(TimeValue time) -> (PicHandle _rv)"},
3857 {"GetTrackClipRgn", (PyCFunction)TrackObj_GetTrackClipRgn, 1,
3858 "() -> (RgnHandle _rv)"},
3859 {"SetTrackClipRgn", (PyCFunction)TrackObj_SetTrackClipRgn, 1,
3860 "(RgnHandle theClip) -> None"},
3861 {"GetTrackDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackDisplayBoundsRgn, 1,
3862 "() -> (RgnHandle _rv)"},
3863 {"GetTrackMovieBoundsRgn", (PyCFunction)TrackObj_GetTrackMovieBoundsRgn, 1,
3864 "() -> (RgnHandle _rv)"},
3865 {"GetTrackBoundsRgn", (PyCFunction)TrackObj_GetTrackBoundsRgn, 1,
3866 "() -> (RgnHandle _rv)"},
3867 {"GetTrackMatte", (PyCFunction)TrackObj_GetTrackMatte, 1,
3868 "() -> (PixMapHandle _rv)"},
3869 {"SetTrackMatte", (PyCFunction)TrackObj_SetTrackMatte, 1,
3870 "(PixMapHandle theMatte) -> None"},
3871 {"GetTrackID", (PyCFunction)TrackObj_GetTrackID, 1,
3872 "() -> (long _rv)"},
3873 {"GetTrackMovie", (PyCFunction)TrackObj_GetTrackMovie, 1,
3874 "() -> (Movie _rv)"},
3875 {"GetTrackCreationTime", (PyCFunction)TrackObj_GetTrackCreationTime, 1,
3876 "() -> (unsigned long _rv)"},
3877 {"GetTrackModificationTime", (PyCFunction)TrackObj_GetTrackModificationTime, 1,
3878 "() -> (unsigned long _rv)"},
3879 {"GetTrackEnabled", (PyCFunction)TrackObj_GetTrackEnabled, 1,
3880 "() -> (Boolean _rv)"},
3881 {"SetTrackEnabled", (PyCFunction)TrackObj_SetTrackEnabled, 1,
3882 "(Boolean isEnabled) -> None"},
3883 {"GetTrackUsage", (PyCFunction)TrackObj_GetTrackUsage, 1,
3884 "() -> (long _rv)"},
3885 {"SetTrackUsage", (PyCFunction)TrackObj_SetTrackUsage, 1,
3886 "(long usage) -> None"},
3887 {"GetTrackDuration", (PyCFunction)TrackObj_GetTrackDuration, 1,
3888 "() -> (TimeValue _rv)"},
3889 {"GetTrackOffset", (PyCFunction)TrackObj_GetTrackOffset, 1,
3890 "() -> (TimeValue _rv)"},
3891 {"SetTrackOffset", (PyCFunction)TrackObj_SetTrackOffset, 1,
3892 "(TimeValue movieOffsetTime) -> None"},
3893 {"GetTrackLayer", (PyCFunction)TrackObj_GetTrackLayer, 1,
3894 "() -> (short _rv)"},
3895 {"SetTrackLayer", (PyCFunction)TrackObj_SetTrackLayer, 1,
3896 "(short layer) -> None"},
3897 {"GetTrackAlternate", (PyCFunction)TrackObj_GetTrackAlternate, 1,
3898 "() -> (Track _rv)"},
3899 {"SetTrackAlternate", (PyCFunction)TrackObj_SetTrackAlternate, 1,
3900 "(Track alternateT) -> None"},
3901 {"GetTrackVolume", (PyCFunction)TrackObj_GetTrackVolume, 1,
3902 "() -> (short _rv)"},
3903 {"SetTrackVolume", (PyCFunction)TrackObj_SetTrackVolume, 1,
3904 "(short volume) -> None"},
3905 {"GetTrackDimensions", (PyCFunction)TrackObj_GetTrackDimensions, 1,
3906 "() -> (Fixed width, Fixed height)"},
3907 {"SetTrackDimensions", (PyCFunction)TrackObj_SetTrackDimensions, 1,
3908 "(Fixed width, Fixed height) -> None"},
3909 {"GetTrackUserData", (PyCFunction)TrackObj_GetTrackUserData, 1,
3910 "() -> (UserData _rv)"},
3911 {"GetTrackSoundLocalizationSettings", (PyCFunction)TrackObj_GetTrackSoundLocalizationSettings, 1,
3912 "() -> (Handle settings)"},
3913 {"SetTrackSoundLocalizationSettings", (PyCFunction)TrackObj_SetTrackSoundLocalizationSettings, 1,
3914 "(Handle settings) -> None"},
3915 {"NewTrackMedia", (PyCFunction)TrackObj_NewTrackMedia, 1,
3916 "(OSType mediaType, TimeScale timeScale, Handle dataRef, OSType dataRefType) -> (Media _rv)"},
3917 {"GetTrackMedia", (PyCFunction)TrackObj_GetTrackMedia, 1,
3918 "() -> (Media _rv)"},
3919 {"InsertMediaIntoTrack", (PyCFunction)TrackObj_InsertMediaIntoTrack, 1,
3920 "(TimeValue trackStart, TimeValue mediaTime, TimeValue mediaDuration, Fixed mediaRate) -> None"},
3921 {"InsertTrackSegment", (PyCFunction)TrackObj_InsertTrackSegment, 1,
3922 "(Track dstTrack, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
3923 {"InsertEmptyTrackSegment", (PyCFunction)TrackObj_InsertEmptyTrackSegment, 1,
3924 "(TimeValue dstIn, TimeValue dstDuration) -> None"},
3925 {"DeleteTrackSegment", (PyCFunction)TrackObj_DeleteTrackSegment, 1,
3926 "(TimeValue startTime, TimeValue duration) -> None"},
3927 {"ScaleTrackSegment", (PyCFunction)TrackObj_ScaleTrackSegment, 1,
3928 "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
3929 {"IsScrapMovie", (PyCFunction)TrackObj_IsScrapMovie, 1,
3930 "() -> (Component _rv)"},
3931 {"CopyTrackSettings", (PyCFunction)TrackObj_CopyTrackSettings, 1,
3932 "(Track dstTrack) -> None"},
3933 {"AddEmptyTrackToMovie", (PyCFunction)TrackObj_AddEmptyTrackToMovie, 1,
3934 "(Movie dstMovie, Handle dataRef, OSType dataRefType) -> (Track dstTrack)"},
3935 {"AddTrackReference", (PyCFunction)TrackObj_AddTrackReference, 1,
3936 "(Track refTrack, OSType refType) -> (long addedIndex)"},
3937 {"DeleteTrackReference", (PyCFunction)TrackObj_DeleteTrackReference, 1,
3938 "(OSType refType, long index) -> None"},
3939 {"SetTrackReference", (PyCFunction)TrackObj_SetTrackReference, 1,
3940 "(Track refTrack, OSType refType, long index) -> None"},
3941 {"GetTrackReference", (PyCFunction)TrackObj_GetTrackReference, 1,
3942 "(OSType refType, long index) -> (Track _rv)"},
3943 {"GetNextTrackReferenceType", (PyCFunction)TrackObj_GetNextTrackReferenceType, 1,
3944 "(OSType refType) -> (OSType _rv)"},
3945 {"GetTrackReferenceCount", (PyCFunction)TrackObj_GetTrackReferenceCount, 1,
3946 "(OSType refType) -> (long _rv)"},
3947 {"GetTrackEditRate", (PyCFunction)TrackObj_GetTrackEditRate, 1,
3948 "(TimeValue atTime) -> (Fixed _rv)"},
3949 {"GetTrackDataSize", (PyCFunction)TrackObj_GetTrackDataSize, 1,
3950 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
3951 {"PtInTrack", (PyCFunction)TrackObj_PtInTrack, 1,
3952 "(Point pt) -> (Boolean _rv)"},
3953 {"GetTrackNextInterestingTime", (PyCFunction)TrackObj_GetTrackNextInterestingTime, 1,
3954 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
3955 {"GetTrackSegmentDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackSegmentDisplayBoundsRgn, 1,
3956 "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
3957 {"GetTrackStatus", (PyCFunction)TrackObj_GetTrackStatus, 1,
3958 "() -> (ComponentResult _rv)"},
3959 {"SetTrackLoadSettings", (PyCFunction)TrackObj_SetTrackLoadSettings, 1,
3960 "(TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints) -> None"},
3961 {"GetTrackLoadSettings", (PyCFunction)TrackObj_GetTrackLoadSettings, 1,
3962 "() -> (TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints)"},
3963 {NULL, NULL, 0}
3966 PyMethodChain TrackObj_chain = { TrackObj_methods, NULL };
3968 static PyObject *TrackObj_getattr(self, name)
3969 TrackObject *self;
3970 char *name;
3972 return Py_FindMethodInChain(&TrackObj_chain, (PyObject *)self, name);
3975 #define TrackObj_setattr NULL
3977 PyTypeObject Track_Type = {
3978 PyObject_HEAD_INIT(&PyType_Type)
3979 0, /*ob_size*/
3980 "Track", /*tp_name*/
3981 sizeof(TrackObject), /*tp_basicsize*/
3982 0, /*tp_itemsize*/
3983 /* methods */
3984 (destructor) TrackObj_dealloc, /*tp_dealloc*/
3985 0, /*tp_print*/
3986 (getattrfunc) TrackObj_getattr, /*tp_getattr*/
3987 (setattrfunc) TrackObj_setattr, /*tp_setattr*/
3990 /* --------------------- End object type Track ---------------------- */
3993 /* ----------------------- Object type Movie ------------------------ */
3995 PyTypeObject Movie_Type;
3997 #define MovieObj_Check(x) ((x)->ob_type == &Movie_Type)
3999 typedef struct MovieObject {
4000 PyObject_HEAD
4001 Movie ob_itself;
4002 } MovieObject;
4004 PyObject *MovieObj_New(itself)
4005 Movie itself;
4007 MovieObject *it;
4008 if (itself == NULL) {
4009 PyErr_SetString(Qt_Error,"Cannot create null Movie");
4010 return NULL;
4012 it = PyObject_NEW(MovieObject, &Movie_Type);
4013 if (it == NULL) return NULL;
4014 it->ob_itself = itself;
4015 return (PyObject *)it;
4017 MovieObj_Convert(v, p_itself)
4018 PyObject *v;
4019 Movie *p_itself;
4021 if (!MovieObj_Check(v))
4023 PyErr_SetString(PyExc_TypeError, "Movie required");
4024 return 0;
4026 *p_itself = ((MovieObject *)v)->ob_itself;
4027 return 1;
4030 static void MovieObj_dealloc(self)
4031 MovieObject *self;
4033 DisposeMovie(self->ob_itself);
4034 PyMem_DEL(self);
4037 static PyObject *MovieObj_MoviesTask(_self, _args)
4038 MovieObject *_self;
4039 PyObject *_args;
4041 PyObject *_res = NULL;
4042 long maxMilliSecToUse;
4043 if (!PyArg_ParseTuple(_args, "l",
4044 &maxMilliSecToUse))
4045 return NULL;
4046 MoviesTask(_self->ob_itself,
4047 maxMilliSecToUse);
4048 Py_INCREF(Py_None);
4049 _res = Py_None;
4050 return _res;
4053 static PyObject *MovieObj_PrerollMovie(_self, _args)
4054 MovieObject *_self;
4055 PyObject *_args;
4057 PyObject *_res = NULL;
4058 OSErr _err;
4059 TimeValue time;
4060 Fixed Rate;
4061 if (!PyArg_ParseTuple(_args, "lO&",
4062 &time,
4063 PyMac_GetFixed, &Rate))
4064 return NULL;
4065 _err = PrerollMovie(_self->ob_itself,
4066 time,
4067 Rate);
4068 if (_err != noErr) return PyMac_Error(_err);
4069 Py_INCREF(Py_None);
4070 _res = Py_None;
4071 return _res;
4074 static PyObject *MovieObj_LoadMovieIntoRam(_self, _args)
4075 MovieObject *_self;
4076 PyObject *_args;
4078 PyObject *_res = NULL;
4079 OSErr _err;
4080 TimeValue time;
4081 TimeValue duration;
4082 long flags;
4083 if (!PyArg_ParseTuple(_args, "lll",
4084 &time,
4085 &duration,
4086 &flags))
4087 return NULL;
4088 _err = LoadMovieIntoRam(_self->ob_itself,
4089 time,
4090 duration,
4091 flags);
4092 if (_err != noErr) return PyMac_Error(_err);
4093 Py_INCREF(Py_None);
4094 _res = Py_None;
4095 return _res;
4098 static PyObject *MovieObj_SetMovieActive(_self, _args)
4099 MovieObject *_self;
4100 PyObject *_args;
4102 PyObject *_res = NULL;
4103 Boolean active;
4104 if (!PyArg_ParseTuple(_args, "b",
4105 &active))
4106 return NULL;
4107 SetMovieActive(_self->ob_itself,
4108 active);
4109 Py_INCREF(Py_None);
4110 _res = Py_None;
4111 return _res;
4114 static PyObject *MovieObj_GetMovieActive(_self, _args)
4115 MovieObject *_self;
4116 PyObject *_args;
4118 PyObject *_res = NULL;
4119 Boolean _rv;
4120 if (!PyArg_ParseTuple(_args, ""))
4121 return NULL;
4122 _rv = GetMovieActive(_self->ob_itself);
4123 _res = Py_BuildValue("b",
4124 _rv);
4125 return _res;
4128 static PyObject *MovieObj_StartMovie(_self, _args)
4129 MovieObject *_self;
4130 PyObject *_args;
4132 PyObject *_res = NULL;
4133 if (!PyArg_ParseTuple(_args, ""))
4134 return NULL;
4135 StartMovie(_self->ob_itself);
4136 Py_INCREF(Py_None);
4137 _res = Py_None;
4138 return _res;
4141 static PyObject *MovieObj_StopMovie(_self, _args)
4142 MovieObject *_self;
4143 PyObject *_args;
4145 PyObject *_res = NULL;
4146 if (!PyArg_ParseTuple(_args, ""))
4147 return NULL;
4148 StopMovie(_self->ob_itself);
4149 Py_INCREF(Py_None);
4150 _res = Py_None;
4151 return _res;
4154 static PyObject *MovieObj_GoToBeginningOfMovie(_self, _args)
4155 MovieObject *_self;
4156 PyObject *_args;
4158 PyObject *_res = NULL;
4159 if (!PyArg_ParseTuple(_args, ""))
4160 return NULL;
4161 GoToBeginningOfMovie(_self->ob_itself);
4162 Py_INCREF(Py_None);
4163 _res = Py_None;
4164 return _res;
4167 static PyObject *MovieObj_GoToEndOfMovie(_self, _args)
4168 MovieObject *_self;
4169 PyObject *_args;
4171 PyObject *_res = NULL;
4172 if (!PyArg_ParseTuple(_args, ""))
4173 return NULL;
4174 GoToEndOfMovie(_self->ob_itself);
4175 Py_INCREF(Py_None);
4176 _res = Py_None;
4177 return _res;
4180 static PyObject *MovieObj_IsMovieDone(_self, _args)
4181 MovieObject *_self;
4182 PyObject *_args;
4184 PyObject *_res = NULL;
4185 Boolean _rv;
4186 if (!PyArg_ParseTuple(_args, ""))
4187 return NULL;
4188 _rv = IsMovieDone(_self->ob_itself);
4189 _res = Py_BuildValue("b",
4190 _rv);
4191 return _res;
4194 static PyObject *MovieObj_GetMoviePreviewMode(_self, _args)
4195 MovieObject *_self;
4196 PyObject *_args;
4198 PyObject *_res = NULL;
4199 Boolean _rv;
4200 if (!PyArg_ParseTuple(_args, ""))
4201 return NULL;
4202 _rv = GetMoviePreviewMode(_self->ob_itself);
4203 _res = Py_BuildValue("b",
4204 _rv);
4205 return _res;
4208 static PyObject *MovieObj_SetMoviePreviewMode(_self, _args)
4209 MovieObject *_self;
4210 PyObject *_args;
4212 PyObject *_res = NULL;
4213 Boolean usePreview;
4214 if (!PyArg_ParseTuple(_args, "b",
4215 &usePreview))
4216 return NULL;
4217 SetMoviePreviewMode(_self->ob_itself,
4218 usePreview);
4219 Py_INCREF(Py_None);
4220 _res = Py_None;
4221 return _res;
4224 static PyObject *MovieObj_ShowMoviePoster(_self, _args)
4225 MovieObject *_self;
4226 PyObject *_args;
4228 PyObject *_res = NULL;
4229 if (!PyArg_ParseTuple(_args, ""))
4230 return NULL;
4231 ShowMoviePoster(_self->ob_itself);
4232 Py_INCREF(Py_None);
4233 _res = Py_None;
4234 return _res;
4237 static PyObject *MovieObj_GetMovieTimeBase(_self, _args)
4238 MovieObject *_self;
4239 PyObject *_args;
4241 PyObject *_res = NULL;
4242 TimeBase _rv;
4243 if (!PyArg_ParseTuple(_args, ""))
4244 return NULL;
4245 _rv = GetMovieTimeBase(_self->ob_itself);
4246 _res = Py_BuildValue("O&",
4247 TimeBaseObj_New, _rv);
4248 return _res;
4251 static PyObject *MovieObj_SetMovieMasterTimeBase(_self, _args)
4252 MovieObject *_self;
4253 PyObject *_args;
4255 PyObject *_res = NULL;
4256 TimeBase tb;
4257 TimeRecord slaveZero;
4258 if (!PyArg_ParseTuple(_args, "O&O&",
4259 TimeBaseObj_Convert, &tb,
4260 QtTimeRecord_Convert, &slaveZero))
4261 return NULL;
4262 SetMovieMasterTimeBase(_self->ob_itself,
4264 &slaveZero);
4265 Py_INCREF(Py_None);
4266 _res = Py_None;
4267 return _res;
4270 static PyObject *MovieObj_SetMovieMasterClock(_self, _args)
4271 MovieObject *_self;
4272 PyObject *_args;
4274 PyObject *_res = NULL;
4275 Component clockMeister;
4276 TimeRecord slaveZero;
4277 if (!PyArg_ParseTuple(_args, "O&O&",
4278 CmpObj_Convert, &clockMeister,
4279 QtTimeRecord_Convert, &slaveZero))
4280 return NULL;
4281 SetMovieMasterClock(_self->ob_itself,
4282 clockMeister,
4283 &slaveZero);
4284 Py_INCREF(Py_None);
4285 _res = Py_None;
4286 return _res;
4289 static PyObject *MovieObj_GetMovieGWorld(_self, _args)
4290 MovieObject *_self;
4291 PyObject *_args;
4293 PyObject *_res = NULL;
4294 CGrafPtr port;
4295 GDHandle gdh;
4296 if (!PyArg_ParseTuple(_args, ""))
4297 return NULL;
4298 GetMovieGWorld(_self->ob_itself,
4299 &port,
4300 &gdh);
4301 _res = Py_BuildValue("O&O&",
4302 GrafObj_New, port,
4303 OptResObj_New, gdh);
4304 return _res;
4307 static PyObject *MovieObj_SetMovieGWorld(_self, _args)
4308 MovieObject *_self;
4309 PyObject *_args;
4311 PyObject *_res = NULL;
4312 CGrafPtr port;
4313 GDHandle gdh;
4314 if (!PyArg_ParseTuple(_args, "O&O&",
4315 GrafObj_Convert, &port,
4316 OptResObj_Convert, &gdh))
4317 return NULL;
4318 SetMovieGWorld(_self->ob_itself,
4319 port,
4320 gdh);
4321 Py_INCREF(Py_None);
4322 _res = Py_None;
4323 return _res;
4326 static PyObject *MovieObj_GetMovieNaturalBoundsRect(_self, _args)
4327 MovieObject *_self;
4328 PyObject *_args;
4330 PyObject *_res = NULL;
4331 Rect naturalBounds;
4332 if (!PyArg_ParseTuple(_args, ""))
4333 return NULL;
4334 GetMovieNaturalBoundsRect(_self->ob_itself,
4335 &naturalBounds);
4336 _res = Py_BuildValue("O&",
4337 PyMac_BuildRect, &naturalBounds);
4338 return _res;
4341 static PyObject *MovieObj_GetNextTrackForCompositing(_self, _args)
4342 MovieObject *_self;
4343 PyObject *_args;
4345 PyObject *_res = NULL;
4346 Track _rv;
4347 Track theTrack;
4348 if (!PyArg_ParseTuple(_args, "O&",
4349 TrackObj_Convert, &theTrack))
4350 return NULL;
4351 _rv = GetNextTrackForCompositing(_self->ob_itself,
4352 theTrack);
4353 _res = Py_BuildValue("O&",
4354 TrackObj_New, _rv);
4355 return _res;
4358 static PyObject *MovieObj_GetPrevTrackForCompositing(_self, _args)
4359 MovieObject *_self;
4360 PyObject *_args;
4362 PyObject *_res = NULL;
4363 Track _rv;
4364 Track theTrack;
4365 if (!PyArg_ParseTuple(_args, "O&",
4366 TrackObj_Convert, &theTrack))
4367 return NULL;
4368 _rv = GetPrevTrackForCompositing(_self->ob_itself,
4369 theTrack);
4370 _res = Py_BuildValue("O&",
4371 TrackObj_New, _rv);
4372 return _res;
4375 static PyObject *MovieObj_GetMoviePict(_self, _args)
4376 MovieObject *_self;
4377 PyObject *_args;
4379 PyObject *_res = NULL;
4380 PicHandle _rv;
4381 TimeValue time;
4382 if (!PyArg_ParseTuple(_args, "l",
4383 &time))
4384 return NULL;
4385 _rv = GetMoviePict(_self->ob_itself,
4386 time);
4387 _res = Py_BuildValue("O&",
4388 ResObj_New, _rv);
4389 return _res;
4392 static PyObject *MovieObj_GetMoviePosterPict(_self, _args)
4393 MovieObject *_self;
4394 PyObject *_args;
4396 PyObject *_res = NULL;
4397 PicHandle _rv;
4398 if (!PyArg_ParseTuple(_args, ""))
4399 return NULL;
4400 _rv = GetMoviePosterPict(_self->ob_itself);
4401 _res = Py_BuildValue("O&",
4402 ResObj_New, _rv);
4403 return _res;
4406 static PyObject *MovieObj_UpdateMovie(_self, _args)
4407 MovieObject *_self;
4408 PyObject *_args;
4410 PyObject *_res = NULL;
4411 OSErr _err;
4412 if (!PyArg_ParseTuple(_args, ""))
4413 return NULL;
4414 _err = UpdateMovie(_self->ob_itself);
4415 if (_err != noErr) return PyMac_Error(_err);
4416 Py_INCREF(Py_None);
4417 _res = Py_None;
4418 return _res;
4421 static PyObject *MovieObj_InvalidateMovieRegion(_self, _args)
4422 MovieObject *_self;
4423 PyObject *_args;
4425 PyObject *_res = NULL;
4426 OSErr _err;
4427 RgnHandle invalidRgn;
4428 if (!PyArg_ParseTuple(_args, "O&",
4429 ResObj_Convert, &invalidRgn))
4430 return NULL;
4431 _err = InvalidateMovieRegion(_self->ob_itself,
4432 invalidRgn);
4433 if (_err != noErr) return PyMac_Error(_err);
4434 Py_INCREF(Py_None);
4435 _res = Py_None;
4436 return _res;
4439 static PyObject *MovieObj_GetMovieBox(_self, _args)
4440 MovieObject *_self;
4441 PyObject *_args;
4443 PyObject *_res = NULL;
4444 Rect boxRect;
4445 if (!PyArg_ParseTuple(_args, ""))
4446 return NULL;
4447 GetMovieBox(_self->ob_itself,
4448 &boxRect);
4449 _res = Py_BuildValue("O&",
4450 PyMac_BuildRect, &boxRect);
4451 return _res;
4454 static PyObject *MovieObj_SetMovieBox(_self, _args)
4455 MovieObject *_self;
4456 PyObject *_args;
4458 PyObject *_res = NULL;
4459 Rect boxRect;
4460 if (!PyArg_ParseTuple(_args, "O&",
4461 PyMac_GetRect, &boxRect))
4462 return NULL;
4463 SetMovieBox(_self->ob_itself,
4464 &boxRect);
4465 Py_INCREF(Py_None);
4466 _res = Py_None;
4467 return _res;
4470 static PyObject *MovieObj_GetMovieDisplayClipRgn(_self, _args)
4471 MovieObject *_self;
4472 PyObject *_args;
4474 PyObject *_res = NULL;
4475 RgnHandle _rv;
4476 if (!PyArg_ParseTuple(_args, ""))
4477 return NULL;
4478 _rv = GetMovieDisplayClipRgn(_self->ob_itself);
4479 _res = Py_BuildValue("O&",
4480 ResObj_New, _rv);
4481 return _res;
4484 static PyObject *MovieObj_SetMovieDisplayClipRgn(_self, _args)
4485 MovieObject *_self;
4486 PyObject *_args;
4488 PyObject *_res = NULL;
4489 RgnHandle theClip;
4490 if (!PyArg_ParseTuple(_args, "O&",
4491 ResObj_Convert, &theClip))
4492 return NULL;
4493 SetMovieDisplayClipRgn(_self->ob_itself,
4494 theClip);
4495 Py_INCREF(Py_None);
4496 _res = Py_None;
4497 return _res;
4500 static PyObject *MovieObj_GetMovieClipRgn(_self, _args)
4501 MovieObject *_self;
4502 PyObject *_args;
4504 PyObject *_res = NULL;
4505 RgnHandle _rv;
4506 if (!PyArg_ParseTuple(_args, ""))
4507 return NULL;
4508 _rv = GetMovieClipRgn(_self->ob_itself);
4509 _res = Py_BuildValue("O&",
4510 ResObj_New, _rv);
4511 return _res;
4514 static PyObject *MovieObj_SetMovieClipRgn(_self, _args)
4515 MovieObject *_self;
4516 PyObject *_args;
4518 PyObject *_res = NULL;
4519 RgnHandle theClip;
4520 if (!PyArg_ParseTuple(_args, "O&",
4521 ResObj_Convert, &theClip))
4522 return NULL;
4523 SetMovieClipRgn(_self->ob_itself,
4524 theClip);
4525 Py_INCREF(Py_None);
4526 _res = Py_None;
4527 return _res;
4530 static PyObject *MovieObj_GetMovieDisplayBoundsRgn(_self, _args)
4531 MovieObject *_self;
4532 PyObject *_args;
4534 PyObject *_res = NULL;
4535 RgnHandle _rv;
4536 if (!PyArg_ParseTuple(_args, ""))
4537 return NULL;
4538 _rv = GetMovieDisplayBoundsRgn(_self->ob_itself);
4539 _res = Py_BuildValue("O&",
4540 ResObj_New, _rv);
4541 return _res;
4544 static PyObject *MovieObj_GetMovieBoundsRgn(_self, _args)
4545 MovieObject *_self;
4546 PyObject *_args;
4548 PyObject *_res = NULL;
4549 RgnHandle _rv;
4550 if (!PyArg_ParseTuple(_args, ""))
4551 return NULL;
4552 _rv = GetMovieBoundsRgn(_self->ob_itself);
4553 _res = Py_BuildValue("O&",
4554 ResObj_New, _rv);
4555 return _res;
4558 static PyObject *MovieObj_PutMovieIntoHandle(_self, _args)
4559 MovieObject *_self;
4560 PyObject *_args;
4562 PyObject *_res = NULL;
4563 OSErr _err;
4564 Handle publicMovie;
4565 if (!PyArg_ParseTuple(_args, "O&",
4566 ResObj_Convert, &publicMovie))
4567 return NULL;
4568 _err = PutMovieIntoHandle(_self->ob_itself,
4569 publicMovie);
4570 if (_err != noErr) return PyMac_Error(_err);
4571 Py_INCREF(Py_None);
4572 _res = Py_None;
4573 return _res;
4576 static PyObject *MovieObj_PutMovieIntoDataFork(_self, _args)
4577 MovieObject *_self;
4578 PyObject *_args;
4580 PyObject *_res = NULL;
4581 OSErr _err;
4582 short fRefNum;
4583 long offset;
4584 long maxSize;
4585 if (!PyArg_ParseTuple(_args, "hll",
4586 &fRefNum,
4587 &offset,
4588 &maxSize))
4589 return NULL;
4590 _err = PutMovieIntoDataFork(_self->ob_itself,
4591 fRefNum,
4592 offset,
4593 maxSize);
4594 if (_err != noErr) return PyMac_Error(_err);
4595 Py_INCREF(Py_None);
4596 _res = Py_None;
4597 return _res;
4600 static PyObject *MovieObj_GetMovieCreationTime(_self, _args)
4601 MovieObject *_self;
4602 PyObject *_args;
4604 PyObject *_res = NULL;
4605 unsigned long _rv;
4606 if (!PyArg_ParseTuple(_args, ""))
4607 return NULL;
4608 _rv = GetMovieCreationTime(_self->ob_itself);
4609 _res = Py_BuildValue("l",
4610 _rv);
4611 return _res;
4614 static PyObject *MovieObj_GetMovieModificationTime(_self, _args)
4615 MovieObject *_self;
4616 PyObject *_args;
4618 PyObject *_res = NULL;
4619 unsigned long _rv;
4620 if (!PyArg_ParseTuple(_args, ""))
4621 return NULL;
4622 _rv = GetMovieModificationTime(_self->ob_itself);
4623 _res = Py_BuildValue("l",
4624 _rv);
4625 return _res;
4628 static PyObject *MovieObj_GetMovieTimeScale(_self, _args)
4629 MovieObject *_self;
4630 PyObject *_args;
4632 PyObject *_res = NULL;
4633 TimeScale _rv;
4634 if (!PyArg_ParseTuple(_args, ""))
4635 return NULL;
4636 _rv = GetMovieTimeScale(_self->ob_itself);
4637 _res = Py_BuildValue("l",
4638 _rv);
4639 return _res;
4642 static PyObject *MovieObj_SetMovieTimeScale(_self, _args)
4643 MovieObject *_self;
4644 PyObject *_args;
4646 PyObject *_res = NULL;
4647 TimeScale timeScale;
4648 if (!PyArg_ParseTuple(_args, "l",
4649 &timeScale))
4650 return NULL;
4651 SetMovieTimeScale(_self->ob_itself,
4652 timeScale);
4653 Py_INCREF(Py_None);
4654 _res = Py_None;
4655 return _res;
4658 static PyObject *MovieObj_GetMovieDuration(_self, _args)
4659 MovieObject *_self;
4660 PyObject *_args;
4662 PyObject *_res = NULL;
4663 TimeValue _rv;
4664 if (!PyArg_ParseTuple(_args, ""))
4665 return NULL;
4666 _rv = GetMovieDuration(_self->ob_itself);
4667 _res = Py_BuildValue("l",
4668 _rv);
4669 return _res;
4672 static PyObject *MovieObj_GetMovieRate(_self, _args)
4673 MovieObject *_self;
4674 PyObject *_args;
4676 PyObject *_res = NULL;
4677 Fixed _rv;
4678 if (!PyArg_ParseTuple(_args, ""))
4679 return NULL;
4680 _rv = GetMovieRate(_self->ob_itself);
4681 _res = Py_BuildValue("O&",
4682 PyMac_BuildFixed, _rv);
4683 return _res;
4686 static PyObject *MovieObj_SetMovieRate(_self, _args)
4687 MovieObject *_self;
4688 PyObject *_args;
4690 PyObject *_res = NULL;
4691 Fixed rate;
4692 if (!PyArg_ParseTuple(_args, "O&",
4693 PyMac_GetFixed, &rate))
4694 return NULL;
4695 SetMovieRate(_self->ob_itself,
4696 rate);
4697 Py_INCREF(Py_None);
4698 _res = Py_None;
4699 return _res;
4702 static PyObject *MovieObj_GetMoviePreferredRate(_self, _args)
4703 MovieObject *_self;
4704 PyObject *_args;
4706 PyObject *_res = NULL;
4707 Fixed _rv;
4708 if (!PyArg_ParseTuple(_args, ""))
4709 return NULL;
4710 _rv = GetMoviePreferredRate(_self->ob_itself);
4711 _res = Py_BuildValue("O&",
4712 PyMac_BuildFixed, _rv);
4713 return _res;
4716 static PyObject *MovieObj_SetMoviePreferredRate(_self, _args)
4717 MovieObject *_self;
4718 PyObject *_args;
4720 PyObject *_res = NULL;
4721 Fixed rate;
4722 if (!PyArg_ParseTuple(_args, "O&",
4723 PyMac_GetFixed, &rate))
4724 return NULL;
4725 SetMoviePreferredRate(_self->ob_itself,
4726 rate);
4727 Py_INCREF(Py_None);
4728 _res = Py_None;
4729 return _res;
4732 static PyObject *MovieObj_GetMoviePreferredVolume(_self, _args)
4733 MovieObject *_self;
4734 PyObject *_args;
4736 PyObject *_res = NULL;
4737 short _rv;
4738 if (!PyArg_ParseTuple(_args, ""))
4739 return NULL;
4740 _rv = GetMoviePreferredVolume(_self->ob_itself);
4741 _res = Py_BuildValue("h",
4742 _rv);
4743 return _res;
4746 static PyObject *MovieObj_SetMoviePreferredVolume(_self, _args)
4747 MovieObject *_self;
4748 PyObject *_args;
4750 PyObject *_res = NULL;
4751 short volume;
4752 if (!PyArg_ParseTuple(_args, "h",
4753 &volume))
4754 return NULL;
4755 SetMoviePreferredVolume(_self->ob_itself,
4756 volume);
4757 Py_INCREF(Py_None);
4758 _res = Py_None;
4759 return _res;
4762 static PyObject *MovieObj_GetMovieVolume(_self, _args)
4763 MovieObject *_self;
4764 PyObject *_args;
4766 PyObject *_res = NULL;
4767 short _rv;
4768 if (!PyArg_ParseTuple(_args, ""))
4769 return NULL;
4770 _rv = GetMovieVolume(_self->ob_itself);
4771 _res = Py_BuildValue("h",
4772 _rv);
4773 return _res;
4776 static PyObject *MovieObj_SetMovieVolume(_self, _args)
4777 MovieObject *_self;
4778 PyObject *_args;
4780 PyObject *_res = NULL;
4781 short volume;
4782 if (!PyArg_ParseTuple(_args, "h",
4783 &volume))
4784 return NULL;
4785 SetMovieVolume(_self->ob_itself,
4786 volume);
4787 Py_INCREF(Py_None);
4788 _res = Py_None;
4789 return _res;
4792 static PyObject *MovieObj_GetMoviePreviewTime(_self, _args)
4793 MovieObject *_self;
4794 PyObject *_args;
4796 PyObject *_res = NULL;
4797 TimeValue previewTime;
4798 TimeValue previewDuration;
4799 if (!PyArg_ParseTuple(_args, ""))
4800 return NULL;
4801 GetMoviePreviewTime(_self->ob_itself,
4802 &previewTime,
4803 &previewDuration);
4804 _res = Py_BuildValue("ll",
4805 previewTime,
4806 previewDuration);
4807 return _res;
4810 static PyObject *MovieObj_SetMoviePreviewTime(_self, _args)
4811 MovieObject *_self;
4812 PyObject *_args;
4814 PyObject *_res = NULL;
4815 TimeValue previewTime;
4816 TimeValue previewDuration;
4817 if (!PyArg_ParseTuple(_args, "ll",
4818 &previewTime,
4819 &previewDuration))
4820 return NULL;
4821 SetMoviePreviewTime(_self->ob_itself,
4822 previewTime,
4823 previewDuration);
4824 Py_INCREF(Py_None);
4825 _res = Py_None;
4826 return _res;
4829 static PyObject *MovieObj_GetMoviePosterTime(_self, _args)
4830 MovieObject *_self;
4831 PyObject *_args;
4833 PyObject *_res = NULL;
4834 TimeValue _rv;
4835 if (!PyArg_ParseTuple(_args, ""))
4836 return NULL;
4837 _rv = GetMoviePosterTime(_self->ob_itself);
4838 _res = Py_BuildValue("l",
4839 _rv);
4840 return _res;
4843 static PyObject *MovieObj_SetMoviePosterTime(_self, _args)
4844 MovieObject *_self;
4845 PyObject *_args;
4847 PyObject *_res = NULL;
4848 TimeValue posterTime;
4849 if (!PyArg_ParseTuple(_args, "l",
4850 &posterTime))
4851 return NULL;
4852 SetMoviePosterTime(_self->ob_itself,
4853 posterTime);
4854 Py_INCREF(Py_None);
4855 _res = Py_None;
4856 return _res;
4859 static PyObject *MovieObj_GetMovieSelection(_self, _args)
4860 MovieObject *_self;
4861 PyObject *_args;
4863 PyObject *_res = NULL;
4864 TimeValue selectionTime;
4865 TimeValue selectionDuration;
4866 if (!PyArg_ParseTuple(_args, ""))
4867 return NULL;
4868 GetMovieSelection(_self->ob_itself,
4869 &selectionTime,
4870 &selectionDuration);
4871 _res = Py_BuildValue("ll",
4872 selectionTime,
4873 selectionDuration);
4874 return _res;
4877 static PyObject *MovieObj_SetMovieSelection(_self, _args)
4878 MovieObject *_self;
4879 PyObject *_args;
4881 PyObject *_res = NULL;
4882 TimeValue selectionTime;
4883 TimeValue selectionDuration;
4884 if (!PyArg_ParseTuple(_args, "ll",
4885 &selectionTime,
4886 &selectionDuration))
4887 return NULL;
4888 SetMovieSelection(_self->ob_itself,
4889 selectionTime,
4890 selectionDuration);
4891 Py_INCREF(Py_None);
4892 _res = Py_None;
4893 return _res;
4896 static PyObject *MovieObj_SetMovieActiveSegment(_self, _args)
4897 MovieObject *_self;
4898 PyObject *_args;
4900 PyObject *_res = NULL;
4901 TimeValue startTime;
4902 TimeValue duration;
4903 if (!PyArg_ParseTuple(_args, "ll",
4904 &startTime,
4905 &duration))
4906 return NULL;
4907 SetMovieActiveSegment(_self->ob_itself,
4908 startTime,
4909 duration);
4910 Py_INCREF(Py_None);
4911 _res = Py_None;
4912 return _res;
4915 static PyObject *MovieObj_GetMovieActiveSegment(_self, _args)
4916 MovieObject *_self;
4917 PyObject *_args;
4919 PyObject *_res = NULL;
4920 TimeValue startTime;
4921 TimeValue duration;
4922 if (!PyArg_ParseTuple(_args, ""))
4923 return NULL;
4924 GetMovieActiveSegment(_self->ob_itself,
4925 &startTime,
4926 &duration);
4927 _res = Py_BuildValue("ll",
4928 startTime,
4929 duration);
4930 return _res;
4933 static PyObject *MovieObj_GetMovieTime(_self, _args)
4934 MovieObject *_self;
4935 PyObject *_args;
4937 PyObject *_res = NULL;
4938 TimeValue _rv;
4939 TimeRecord currentTime;
4940 if (!PyArg_ParseTuple(_args, ""))
4941 return NULL;
4942 _rv = GetMovieTime(_self->ob_itself,
4943 &currentTime);
4944 _res = Py_BuildValue("lO&",
4945 _rv,
4946 QtTimeRecord_New, &currentTime);
4947 return _res;
4950 static PyObject *MovieObj_SetMovieTime(_self, _args)
4951 MovieObject *_self;
4952 PyObject *_args;
4954 PyObject *_res = NULL;
4955 TimeRecord newtime;
4956 if (!PyArg_ParseTuple(_args, "O&",
4957 QtTimeRecord_Convert, &newtime))
4958 return NULL;
4959 SetMovieTime(_self->ob_itself,
4960 &newtime);
4961 Py_INCREF(Py_None);
4962 _res = Py_None;
4963 return _res;
4966 static PyObject *MovieObj_SetMovieTimeValue(_self, _args)
4967 MovieObject *_self;
4968 PyObject *_args;
4970 PyObject *_res = NULL;
4971 TimeValue newtime;
4972 if (!PyArg_ParseTuple(_args, "l",
4973 &newtime))
4974 return NULL;
4975 SetMovieTimeValue(_self->ob_itself,
4976 newtime);
4977 Py_INCREF(Py_None);
4978 _res = Py_None;
4979 return _res;
4982 static PyObject *MovieObj_GetMovieUserData(_self, _args)
4983 MovieObject *_self;
4984 PyObject *_args;
4986 PyObject *_res = NULL;
4987 UserData _rv;
4988 if (!PyArg_ParseTuple(_args, ""))
4989 return NULL;
4990 _rv = GetMovieUserData(_self->ob_itself);
4991 _res = Py_BuildValue("O&",
4992 UserDataObj_New, _rv);
4993 return _res;
4996 static PyObject *MovieObj_GetMovieTrackCount(_self, _args)
4997 MovieObject *_self;
4998 PyObject *_args;
5000 PyObject *_res = NULL;
5001 long _rv;
5002 if (!PyArg_ParseTuple(_args, ""))
5003 return NULL;
5004 _rv = GetMovieTrackCount(_self->ob_itself);
5005 _res = Py_BuildValue("l",
5006 _rv);
5007 return _res;
5010 static PyObject *MovieObj_GetMovieTrack(_self, _args)
5011 MovieObject *_self;
5012 PyObject *_args;
5014 PyObject *_res = NULL;
5015 Track _rv;
5016 long trackID;
5017 if (!PyArg_ParseTuple(_args, "l",
5018 &trackID))
5019 return NULL;
5020 _rv = GetMovieTrack(_self->ob_itself,
5021 trackID);
5022 _res = Py_BuildValue("O&",
5023 TrackObj_New, _rv);
5024 return _res;
5027 static PyObject *MovieObj_GetMovieIndTrack(_self, _args)
5028 MovieObject *_self;
5029 PyObject *_args;
5031 PyObject *_res = NULL;
5032 Track _rv;
5033 long index;
5034 if (!PyArg_ParseTuple(_args, "l",
5035 &index))
5036 return NULL;
5037 _rv = GetMovieIndTrack(_self->ob_itself,
5038 index);
5039 _res = Py_BuildValue("O&",
5040 TrackObj_New, _rv);
5041 return _res;
5044 static PyObject *MovieObj_GetMovieIndTrackType(_self, _args)
5045 MovieObject *_self;
5046 PyObject *_args;
5048 PyObject *_res = NULL;
5049 Track _rv;
5050 long index;
5051 OSType trackType;
5052 long flags;
5053 if (!PyArg_ParseTuple(_args, "lO&l",
5054 &index,
5055 PyMac_GetOSType, &trackType,
5056 &flags))
5057 return NULL;
5058 _rv = GetMovieIndTrackType(_self->ob_itself,
5059 index,
5060 trackType,
5061 flags);
5062 _res = Py_BuildValue("O&",
5063 TrackObj_New, _rv);
5064 return _res;
5067 static PyObject *MovieObj_NewMovieTrack(_self, _args)
5068 MovieObject *_self;
5069 PyObject *_args;
5071 PyObject *_res = NULL;
5072 Track _rv;
5073 Fixed width;
5074 Fixed height;
5075 short trackVolume;
5076 if (!PyArg_ParseTuple(_args, "O&O&h",
5077 PyMac_GetFixed, &width,
5078 PyMac_GetFixed, &height,
5079 &trackVolume))
5080 return NULL;
5081 _rv = NewMovieTrack(_self->ob_itself,
5082 width,
5083 height,
5084 trackVolume);
5085 _res = Py_BuildValue("O&",
5086 TrackObj_New, _rv);
5087 return _res;
5090 static PyObject *MovieObj_SetAutoTrackAlternatesEnabled(_self, _args)
5091 MovieObject *_self;
5092 PyObject *_args;
5094 PyObject *_res = NULL;
5095 Boolean enable;
5096 if (!PyArg_ParseTuple(_args, "b",
5097 &enable))
5098 return NULL;
5099 SetAutoTrackAlternatesEnabled(_self->ob_itself,
5100 enable);
5101 Py_INCREF(Py_None);
5102 _res = Py_None;
5103 return _res;
5106 static PyObject *MovieObj_SelectMovieAlternates(_self, _args)
5107 MovieObject *_self;
5108 PyObject *_args;
5110 PyObject *_res = NULL;
5111 if (!PyArg_ParseTuple(_args, ""))
5112 return NULL;
5113 SelectMovieAlternates(_self->ob_itself);
5114 Py_INCREF(Py_None);
5115 _res = Py_None;
5116 return _res;
5119 static PyObject *MovieObj_InsertMovieSegment(_self, _args)
5120 MovieObject *_self;
5121 PyObject *_args;
5123 PyObject *_res = NULL;
5124 OSErr _err;
5125 Movie dstMovie;
5126 TimeValue srcIn;
5127 TimeValue srcDuration;
5128 TimeValue dstIn;
5129 if (!PyArg_ParseTuple(_args, "O&lll",
5130 MovieObj_Convert, &dstMovie,
5131 &srcIn,
5132 &srcDuration,
5133 &dstIn))
5134 return NULL;
5135 _err = InsertMovieSegment(_self->ob_itself,
5136 dstMovie,
5137 srcIn,
5138 srcDuration,
5139 dstIn);
5140 if (_err != noErr) return PyMac_Error(_err);
5141 Py_INCREF(Py_None);
5142 _res = Py_None;
5143 return _res;
5146 static PyObject *MovieObj_InsertEmptyMovieSegment(_self, _args)
5147 MovieObject *_self;
5148 PyObject *_args;
5150 PyObject *_res = NULL;
5151 OSErr _err;
5152 TimeValue dstIn;
5153 TimeValue dstDuration;
5154 if (!PyArg_ParseTuple(_args, "ll",
5155 &dstIn,
5156 &dstDuration))
5157 return NULL;
5158 _err = InsertEmptyMovieSegment(_self->ob_itself,
5159 dstIn,
5160 dstDuration);
5161 if (_err != noErr) return PyMac_Error(_err);
5162 Py_INCREF(Py_None);
5163 _res = Py_None;
5164 return _res;
5167 static PyObject *MovieObj_DeleteMovieSegment(_self, _args)
5168 MovieObject *_self;
5169 PyObject *_args;
5171 PyObject *_res = NULL;
5172 OSErr _err;
5173 TimeValue startTime;
5174 TimeValue duration;
5175 if (!PyArg_ParseTuple(_args, "ll",
5176 &startTime,
5177 &duration))
5178 return NULL;
5179 _err = DeleteMovieSegment(_self->ob_itself,
5180 startTime,
5181 duration);
5182 if (_err != noErr) return PyMac_Error(_err);
5183 Py_INCREF(Py_None);
5184 _res = Py_None;
5185 return _res;
5188 static PyObject *MovieObj_ScaleMovieSegment(_self, _args)
5189 MovieObject *_self;
5190 PyObject *_args;
5192 PyObject *_res = NULL;
5193 OSErr _err;
5194 TimeValue startTime;
5195 TimeValue oldDuration;
5196 TimeValue newDuration;
5197 if (!PyArg_ParseTuple(_args, "lll",
5198 &startTime,
5199 &oldDuration,
5200 &newDuration))
5201 return NULL;
5202 _err = ScaleMovieSegment(_self->ob_itself,
5203 startTime,
5204 oldDuration,
5205 newDuration);
5206 if (_err != noErr) return PyMac_Error(_err);
5207 Py_INCREF(Py_None);
5208 _res = Py_None;
5209 return _res;
5212 static PyObject *MovieObj_CutMovieSelection(_self, _args)
5213 MovieObject *_self;
5214 PyObject *_args;
5216 PyObject *_res = NULL;
5217 Movie _rv;
5218 if (!PyArg_ParseTuple(_args, ""))
5219 return NULL;
5220 _rv = CutMovieSelection(_self->ob_itself);
5221 _res = Py_BuildValue("O&",
5222 MovieObj_New, _rv);
5223 return _res;
5226 static PyObject *MovieObj_CopyMovieSelection(_self, _args)
5227 MovieObject *_self;
5228 PyObject *_args;
5230 PyObject *_res = NULL;
5231 Movie _rv;
5232 if (!PyArg_ParseTuple(_args, ""))
5233 return NULL;
5234 _rv = CopyMovieSelection(_self->ob_itself);
5235 _res = Py_BuildValue("O&",
5236 MovieObj_New, _rv);
5237 return _res;
5240 static PyObject *MovieObj_PasteMovieSelection(_self, _args)
5241 MovieObject *_self;
5242 PyObject *_args;
5244 PyObject *_res = NULL;
5245 Movie src;
5246 if (!PyArg_ParseTuple(_args, "O&",
5247 MovieObj_Convert, &src))
5248 return NULL;
5249 PasteMovieSelection(_self->ob_itself,
5250 src);
5251 Py_INCREF(Py_None);
5252 _res = Py_None;
5253 return _res;
5256 static PyObject *MovieObj_AddMovieSelection(_self, _args)
5257 MovieObject *_self;
5258 PyObject *_args;
5260 PyObject *_res = NULL;
5261 Movie src;
5262 if (!PyArg_ParseTuple(_args, "O&",
5263 MovieObj_Convert, &src))
5264 return NULL;
5265 AddMovieSelection(_self->ob_itself,
5266 src);
5267 Py_INCREF(Py_None);
5268 _res = Py_None;
5269 return _res;
5272 static PyObject *MovieObj_ClearMovieSelection(_self, _args)
5273 MovieObject *_self;
5274 PyObject *_args;
5276 PyObject *_res = NULL;
5277 if (!PyArg_ParseTuple(_args, ""))
5278 return NULL;
5279 ClearMovieSelection(_self->ob_itself);
5280 Py_INCREF(Py_None);
5281 _res = Py_None;
5282 return _res;
5285 static PyObject *MovieObj_PutMovieIntoTypedHandle(_self, _args)
5286 MovieObject *_self;
5287 PyObject *_args;
5289 PyObject *_res = NULL;
5290 OSErr _err;
5291 Track targetTrack;
5292 OSType handleType;
5293 Handle publicMovie;
5294 TimeValue start;
5295 TimeValue dur;
5296 long flags;
5297 ComponentInstance userComp;
5298 if (!PyArg_ParseTuple(_args, "O&O&O&lllO&",
5299 TrackObj_Convert, &targetTrack,
5300 PyMac_GetOSType, &handleType,
5301 ResObj_Convert, &publicMovie,
5302 &start,
5303 &dur,
5304 &flags,
5305 CmpInstObj_Convert, &userComp))
5306 return NULL;
5307 _err = PutMovieIntoTypedHandle(_self->ob_itself,
5308 targetTrack,
5309 handleType,
5310 publicMovie,
5311 start,
5312 dur,
5313 flags,
5314 userComp);
5315 if (_err != noErr) return PyMac_Error(_err);
5316 Py_INCREF(Py_None);
5317 _res = Py_None;
5318 return _res;
5321 static PyObject *MovieObj_CopyMovieSettings(_self, _args)
5322 MovieObject *_self;
5323 PyObject *_args;
5325 PyObject *_res = NULL;
5326 OSErr _err;
5327 Movie dstMovie;
5328 if (!PyArg_ParseTuple(_args, "O&",
5329 MovieObj_Convert, &dstMovie))
5330 return NULL;
5331 _err = CopyMovieSettings(_self->ob_itself,
5332 dstMovie);
5333 if (_err != noErr) return PyMac_Error(_err);
5334 Py_INCREF(Py_None);
5335 _res = Py_None;
5336 return _res;
5339 static PyObject *MovieObj_ConvertMovieToFile(_self, _args)
5340 MovieObject *_self;
5341 PyObject *_args;
5343 PyObject *_res = NULL;
5344 OSErr _err;
5345 Track onlyTrack;
5346 FSSpec outputFile;
5347 OSType fileType;
5348 OSType creator;
5349 ScriptCode scriptTag;
5350 short resID;
5351 long flags;
5352 ComponentInstance userComp;
5353 if (!PyArg_ParseTuple(_args, "O&O&O&O&hlO&",
5354 TrackObj_Convert, &onlyTrack,
5355 PyMac_GetFSSpec, &outputFile,
5356 PyMac_GetOSType, &fileType,
5357 PyMac_GetOSType, &creator,
5358 &scriptTag,
5359 &flags,
5360 CmpInstObj_Convert, &userComp))
5361 return NULL;
5362 _err = ConvertMovieToFile(_self->ob_itself,
5363 onlyTrack,
5364 &outputFile,
5365 fileType,
5366 creator,
5367 scriptTag,
5368 &resID,
5369 flags,
5370 userComp);
5371 if (_err != noErr) return PyMac_Error(_err);
5372 _res = Py_BuildValue("h",
5373 resID);
5374 return _res;
5377 static PyObject *MovieObj_GetMovieDataSize(_self, _args)
5378 MovieObject *_self;
5379 PyObject *_args;
5381 PyObject *_res = NULL;
5382 long _rv;
5383 TimeValue startTime;
5384 TimeValue duration;
5385 if (!PyArg_ParseTuple(_args, "ll",
5386 &startTime,
5387 &duration))
5388 return NULL;
5389 _rv = GetMovieDataSize(_self->ob_itself,
5390 startTime,
5391 duration);
5392 _res = Py_BuildValue("l",
5393 _rv);
5394 return _res;
5397 static PyObject *MovieObj_PtInMovie(_self, _args)
5398 MovieObject *_self;
5399 PyObject *_args;
5401 PyObject *_res = NULL;
5402 Boolean _rv;
5403 Point pt;
5404 if (!PyArg_ParseTuple(_args, "O&",
5405 PyMac_GetPoint, &pt))
5406 return NULL;
5407 _rv = PtInMovie(_self->ob_itself,
5408 pt);
5409 _res = Py_BuildValue("b",
5410 _rv);
5411 return _res;
5414 static PyObject *MovieObj_SetMovieLanguage(_self, _args)
5415 MovieObject *_self;
5416 PyObject *_args;
5418 PyObject *_res = NULL;
5419 long language;
5420 if (!PyArg_ParseTuple(_args, "l",
5421 &language))
5422 return NULL;
5423 SetMovieLanguage(_self->ob_itself,
5424 language);
5425 Py_INCREF(Py_None);
5426 _res = Py_None;
5427 return _res;
5430 static PyObject *MovieObj_GetMovieNextInterestingTime(_self, _args)
5431 MovieObject *_self;
5432 PyObject *_args;
5434 PyObject *_res = NULL;
5435 short interestingTimeFlags;
5436 short numMediaTypes;
5437 OSType whichMediaTypes;
5438 TimeValue time;
5439 Fixed rate;
5440 TimeValue interestingTime;
5441 TimeValue interestingDuration;
5442 if (!PyArg_ParseTuple(_args, "hhO&lO&",
5443 &interestingTimeFlags,
5444 &numMediaTypes,
5445 PyMac_GetOSType, &whichMediaTypes,
5446 &time,
5447 PyMac_GetFixed, &rate))
5448 return NULL;
5449 GetMovieNextInterestingTime(_self->ob_itself,
5450 interestingTimeFlags,
5451 numMediaTypes,
5452 &whichMediaTypes,
5453 time,
5454 rate,
5455 &interestingTime,
5456 &interestingDuration);
5457 _res = Py_BuildValue("ll",
5458 interestingTime,
5459 interestingDuration);
5460 return _res;
5463 static PyObject *MovieObj_AddMovieResource(_self, _args)
5464 MovieObject *_self;
5465 PyObject *_args;
5467 PyObject *_res = NULL;
5468 OSErr _err;
5469 short resRefNum;
5470 short resId;
5471 Str255 resName;
5472 if (!PyArg_ParseTuple(_args, "hO&",
5473 &resRefNum,
5474 PyMac_GetStr255, resName))
5475 return NULL;
5476 _err = AddMovieResource(_self->ob_itself,
5477 resRefNum,
5478 &resId,
5479 resName);
5480 if (_err != noErr) return PyMac_Error(_err);
5481 _res = Py_BuildValue("h",
5482 resId);
5483 return _res;
5486 static PyObject *MovieObj_UpdateMovieResource(_self, _args)
5487 MovieObject *_self;
5488 PyObject *_args;
5490 PyObject *_res = NULL;
5491 OSErr _err;
5492 short resRefNum;
5493 short resId;
5494 Str255 resName;
5495 if (!PyArg_ParseTuple(_args, "hhO&",
5496 &resRefNum,
5497 &resId,
5498 PyMac_GetStr255, resName))
5499 return NULL;
5500 _err = UpdateMovieResource(_self->ob_itself,
5501 resRefNum,
5502 resId,
5503 resName);
5504 if (_err != noErr) return PyMac_Error(_err);
5505 Py_INCREF(Py_None);
5506 _res = Py_None;
5507 return _res;
5510 static PyObject *MovieObj_HasMovieChanged(_self, _args)
5511 MovieObject *_self;
5512 PyObject *_args;
5514 PyObject *_res = NULL;
5515 Boolean _rv;
5516 if (!PyArg_ParseTuple(_args, ""))
5517 return NULL;
5518 _rv = HasMovieChanged(_self->ob_itself);
5519 _res = Py_BuildValue("b",
5520 _rv);
5521 return _res;
5524 static PyObject *MovieObj_ClearMovieChanged(_self, _args)
5525 MovieObject *_self;
5526 PyObject *_args;
5528 PyObject *_res = NULL;
5529 if (!PyArg_ParseTuple(_args, ""))
5530 return NULL;
5531 ClearMovieChanged(_self->ob_itself);
5532 Py_INCREF(Py_None);
5533 _res = Py_None;
5534 return _res;
5537 static PyObject *MovieObj_SetMovieDefaultDataRef(_self, _args)
5538 MovieObject *_self;
5539 PyObject *_args;
5541 PyObject *_res = NULL;
5542 OSErr _err;
5543 Handle dataRef;
5544 OSType dataRefType;
5545 if (!PyArg_ParseTuple(_args, "O&O&",
5546 ResObj_Convert, &dataRef,
5547 PyMac_GetOSType, &dataRefType))
5548 return NULL;
5549 _err = SetMovieDefaultDataRef(_self->ob_itself,
5550 dataRef,
5551 dataRefType);
5552 if (_err != noErr) return PyMac_Error(_err);
5553 Py_INCREF(Py_None);
5554 _res = Py_None;
5555 return _res;
5558 static PyObject *MovieObj_GetMovieDefaultDataRef(_self, _args)
5559 MovieObject *_self;
5560 PyObject *_args;
5562 PyObject *_res = NULL;
5563 OSErr _err;
5564 Handle dataRef;
5565 OSType dataRefType;
5566 if (!PyArg_ParseTuple(_args, ""))
5567 return NULL;
5568 _err = GetMovieDefaultDataRef(_self->ob_itself,
5569 &dataRef,
5570 &dataRefType);
5571 if (_err != noErr) return PyMac_Error(_err);
5572 _res = Py_BuildValue("O&O&",
5573 ResObj_New, dataRef,
5574 PyMac_BuildOSType, dataRefType);
5575 return _res;
5578 static PyObject *MovieObj_SetMovieColorTable(_self, _args)
5579 MovieObject *_self;
5580 PyObject *_args;
5582 PyObject *_res = NULL;
5583 OSErr _err;
5584 CTabHandle ctab;
5585 if (!PyArg_ParseTuple(_args, "O&",
5586 ResObj_Convert, &ctab))
5587 return NULL;
5588 _err = SetMovieColorTable(_self->ob_itself,
5589 ctab);
5590 if (_err != noErr) return PyMac_Error(_err);
5591 Py_INCREF(Py_None);
5592 _res = Py_None;
5593 return _res;
5596 static PyObject *MovieObj_GetMovieColorTable(_self, _args)
5597 MovieObject *_self;
5598 PyObject *_args;
5600 PyObject *_res = NULL;
5601 OSErr _err;
5602 CTabHandle ctab;
5603 if (!PyArg_ParseTuple(_args, ""))
5604 return NULL;
5605 _err = GetMovieColorTable(_self->ob_itself,
5606 &ctab);
5607 if (_err != noErr) return PyMac_Error(_err);
5608 _res = Py_BuildValue("O&",
5609 ResObj_New, ctab);
5610 return _res;
5613 static PyObject *MovieObj_FlattenMovie(_self, _args)
5614 MovieObject *_self;
5615 PyObject *_args;
5617 PyObject *_res = NULL;
5618 long movieFlattenFlags;
5619 FSSpec theFile;
5620 OSType creator;
5621 ScriptCode scriptTag;
5622 long createMovieFileFlags;
5623 short resId;
5624 Str255 resName;
5625 if (!PyArg_ParseTuple(_args, "lO&O&hlO&",
5626 &movieFlattenFlags,
5627 PyMac_GetFSSpec, &theFile,
5628 PyMac_GetOSType, &creator,
5629 &scriptTag,
5630 &createMovieFileFlags,
5631 PyMac_GetStr255, resName))
5632 return NULL;
5633 FlattenMovie(_self->ob_itself,
5634 movieFlattenFlags,
5635 &theFile,
5636 creator,
5637 scriptTag,
5638 createMovieFileFlags,
5639 &resId,
5640 resName);
5641 _res = Py_BuildValue("h",
5642 resId);
5643 return _res;
5646 static PyObject *MovieObj_FlattenMovieData(_self, _args)
5647 MovieObject *_self;
5648 PyObject *_args;
5650 PyObject *_res = NULL;
5651 Movie _rv;
5652 long movieFlattenFlags;
5653 FSSpec theFile;
5654 OSType creator;
5655 ScriptCode scriptTag;
5656 long createMovieFileFlags;
5657 if (!PyArg_ParseTuple(_args, "lO&O&hl",
5658 &movieFlattenFlags,
5659 PyMac_GetFSSpec, &theFile,
5660 PyMac_GetOSType, &creator,
5661 &scriptTag,
5662 &createMovieFileFlags))
5663 return NULL;
5664 _rv = FlattenMovieData(_self->ob_itself,
5665 movieFlattenFlags,
5666 &theFile,
5667 creator,
5668 scriptTag,
5669 createMovieFileFlags);
5670 _res = Py_BuildValue("O&",
5671 MovieObj_New, _rv);
5672 return _res;
5675 static PyObject *MovieObj_MovieSearchText(_self, _args)
5676 MovieObject *_self;
5677 PyObject *_args;
5679 PyObject *_res = NULL;
5680 OSErr _err;
5681 Ptr text;
5682 long size;
5683 long searchFlags;
5684 Track searchTrack;
5685 TimeValue searchTime;
5686 long searchOffset;
5687 if (!PyArg_ParseTuple(_args, "sll",
5688 &text,
5689 &size,
5690 &searchFlags))
5691 return NULL;
5692 _err = MovieSearchText(_self->ob_itself,
5693 text,
5694 size,
5695 searchFlags,
5696 &searchTrack,
5697 &searchTime,
5698 &searchOffset);
5699 if (_err != noErr) return PyMac_Error(_err);
5700 _res = Py_BuildValue("O&ll",
5701 TrackObj_New, searchTrack,
5702 searchTime,
5703 searchOffset);
5704 return _res;
5707 static PyObject *MovieObj_GetPosterBox(_self, _args)
5708 MovieObject *_self;
5709 PyObject *_args;
5711 PyObject *_res = NULL;
5712 Rect boxRect;
5713 if (!PyArg_ParseTuple(_args, ""))
5714 return NULL;
5715 GetPosterBox(_self->ob_itself,
5716 &boxRect);
5717 _res = Py_BuildValue("O&",
5718 PyMac_BuildRect, &boxRect);
5719 return _res;
5722 static PyObject *MovieObj_SetPosterBox(_self, _args)
5723 MovieObject *_self;
5724 PyObject *_args;
5726 PyObject *_res = NULL;
5727 Rect boxRect;
5728 if (!PyArg_ParseTuple(_args, "O&",
5729 PyMac_GetRect, &boxRect))
5730 return NULL;
5731 SetPosterBox(_self->ob_itself,
5732 &boxRect);
5733 Py_INCREF(Py_None);
5734 _res = Py_None;
5735 return _res;
5738 static PyObject *MovieObj_GetMovieSegmentDisplayBoundsRgn(_self, _args)
5739 MovieObject *_self;
5740 PyObject *_args;
5742 PyObject *_res = NULL;
5743 RgnHandle _rv;
5744 TimeValue time;
5745 TimeValue duration;
5746 if (!PyArg_ParseTuple(_args, "ll",
5747 &time,
5748 &duration))
5749 return NULL;
5750 _rv = GetMovieSegmentDisplayBoundsRgn(_self->ob_itself,
5751 time,
5752 duration);
5753 _res = Py_BuildValue("O&",
5754 ResObj_New, _rv);
5755 return _res;
5758 static PyObject *MovieObj_GetMovieStatus(_self, _args)
5759 MovieObject *_self;
5760 PyObject *_args;
5762 PyObject *_res = NULL;
5763 ComponentResult _rv;
5764 Track firstProblemTrack;
5765 if (!PyArg_ParseTuple(_args, ""))
5766 return NULL;
5767 _rv = GetMovieStatus(_self->ob_itself,
5768 &firstProblemTrack);
5769 _res = Py_BuildValue("lO&",
5770 _rv,
5771 TrackObj_New, firstProblemTrack);
5772 return _res;
5775 static PyObject *MovieObj_NewMovieController(_self, _args)
5776 MovieObject *_self;
5777 PyObject *_args;
5779 PyObject *_res = NULL;
5780 MovieController _rv;
5781 Rect movieRect;
5782 long someFlags;
5783 if (!PyArg_ParseTuple(_args, "O&l",
5784 PyMac_GetRect, &movieRect,
5785 &someFlags))
5786 return NULL;
5787 _rv = NewMovieController(_self->ob_itself,
5788 &movieRect,
5789 someFlags);
5790 _res = Py_BuildValue("O&",
5791 MovieCtlObj_New, _rv);
5792 return _res;
5795 static PyObject *MovieObj_PutMovieOnScrap(_self, _args)
5796 MovieObject *_self;
5797 PyObject *_args;
5799 PyObject *_res = NULL;
5800 OSErr _err;
5801 long movieScrapFlags;
5802 if (!PyArg_ParseTuple(_args, "l",
5803 &movieScrapFlags))
5804 return NULL;
5805 _err = PutMovieOnScrap(_self->ob_itself,
5806 movieScrapFlags);
5807 if (_err != noErr) return PyMac_Error(_err);
5808 Py_INCREF(Py_None);
5809 _res = Py_None;
5810 return _res;
5813 static PyObject *MovieObj_SetMoviePlayHints(_self, _args)
5814 MovieObject *_self;
5815 PyObject *_args;
5817 PyObject *_res = NULL;
5818 long flags;
5819 long flagsMask;
5820 if (!PyArg_ParseTuple(_args, "ll",
5821 &flags,
5822 &flagsMask))
5823 return NULL;
5824 SetMoviePlayHints(_self->ob_itself,
5825 flags,
5826 flagsMask);
5827 Py_INCREF(Py_None);
5828 _res = Py_None;
5829 return _res;
5832 static PyObject *MovieObj_GetMaxLoadedTimeInMovie(_self, _args)
5833 MovieObject *_self;
5834 PyObject *_args;
5836 PyObject *_res = NULL;
5837 OSErr _err;
5838 TimeValue time;
5839 if (!PyArg_ParseTuple(_args, ""))
5840 return NULL;
5841 _err = GetMaxLoadedTimeInMovie(_self->ob_itself,
5842 &time);
5843 if (_err != noErr) return PyMac_Error(_err);
5844 _res = Py_BuildValue("l",
5845 time);
5846 return _res;
5849 static PyObject *MovieObj_QTMovieNeedsTimeTable(_self, _args)
5850 MovieObject *_self;
5851 PyObject *_args;
5853 PyObject *_res = NULL;
5854 OSErr _err;
5855 Boolean needsTimeTable;
5856 if (!PyArg_ParseTuple(_args, ""))
5857 return NULL;
5858 _err = QTMovieNeedsTimeTable(_self->ob_itself,
5859 &needsTimeTable);
5860 if (_err != noErr) return PyMac_Error(_err);
5861 _res = Py_BuildValue("b",
5862 needsTimeTable);
5863 return _res;
5866 static PyObject *MovieObj_QTGetDataRefMaxFileOffset(_self, _args)
5867 MovieObject *_self;
5868 PyObject *_args;
5870 PyObject *_res = NULL;
5871 OSErr _err;
5872 OSType dataRefType;
5873 Handle dataRef;
5874 long offset;
5875 if (!PyArg_ParseTuple(_args, "O&O&",
5876 PyMac_GetOSType, &dataRefType,
5877 ResObj_Convert, &dataRef))
5878 return NULL;
5879 _err = QTGetDataRefMaxFileOffset(_self->ob_itself,
5880 dataRefType,
5881 dataRef,
5882 &offset);
5883 if (_err != noErr) return PyMac_Error(_err);
5884 _res = Py_BuildValue("l",
5885 offset);
5886 return _res;
5889 static PyMethodDef MovieObj_methods[] = {
5890 {"MoviesTask", (PyCFunction)MovieObj_MoviesTask, 1,
5891 "(long maxMilliSecToUse) -> None"},
5892 {"PrerollMovie", (PyCFunction)MovieObj_PrerollMovie, 1,
5893 "(TimeValue time, Fixed Rate) -> None"},
5894 {"LoadMovieIntoRam", (PyCFunction)MovieObj_LoadMovieIntoRam, 1,
5895 "(TimeValue time, TimeValue duration, long flags) -> None"},
5896 {"SetMovieActive", (PyCFunction)MovieObj_SetMovieActive, 1,
5897 "(Boolean active) -> None"},
5898 {"GetMovieActive", (PyCFunction)MovieObj_GetMovieActive, 1,
5899 "() -> (Boolean _rv)"},
5900 {"StartMovie", (PyCFunction)MovieObj_StartMovie, 1,
5901 "() -> None"},
5902 {"StopMovie", (PyCFunction)MovieObj_StopMovie, 1,
5903 "() -> None"},
5904 {"GoToBeginningOfMovie", (PyCFunction)MovieObj_GoToBeginningOfMovie, 1,
5905 "() -> None"},
5906 {"GoToEndOfMovie", (PyCFunction)MovieObj_GoToEndOfMovie, 1,
5907 "() -> None"},
5908 {"IsMovieDone", (PyCFunction)MovieObj_IsMovieDone, 1,
5909 "() -> (Boolean _rv)"},
5910 {"GetMoviePreviewMode", (PyCFunction)MovieObj_GetMoviePreviewMode, 1,
5911 "() -> (Boolean _rv)"},
5912 {"SetMoviePreviewMode", (PyCFunction)MovieObj_SetMoviePreviewMode, 1,
5913 "(Boolean usePreview) -> None"},
5914 {"ShowMoviePoster", (PyCFunction)MovieObj_ShowMoviePoster, 1,
5915 "() -> None"},
5916 {"GetMovieTimeBase", (PyCFunction)MovieObj_GetMovieTimeBase, 1,
5917 "() -> (TimeBase _rv)"},
5918 {"SetMovieMasterTimeBase", (PyCFunction)MovieObj_SetMovieMasterTimeBase, 1,
5919 "(TimeBase tb, TimeRecord slaveZero) -> None"},
5920 {"SetMovieMasterClock", (PyCFunction)MovieObj_SetMovieMasterClock, 1,
5921 "(Component clockMeister, TimeRecord slaveZero) -> None"},
5922 {"GetMovieGWorld", (PyCFunction)MovieObj_GetMovieGWorld, 1,
5923 "() -> (CGrafPtr port, GDHandle gdh)"},
5924 {"SetMovieGWorld", (PyCFunction)MovieObj_SetMovieGWorld, 1,
5925 "(CGrafPtr port, GDHandle gdh) -> None"},
5926 {"GetMovieNaturalBoundsRect", (PyCFunction)MovieObj_GetMovieNaturalBoundsRect, 1,
5927 "() -> (Rect naturalBounds)"},
5928 {"GetNextTrackForCompositing", (PyCFunction)MovieObj_GetNextTrackForCompositing, 1,
5929 "(Track theTrack) -> (Track _rv)"},
5930 {"GetPrevTrackForCompositing", (PyCFunction)MovieObj_GetPrevTrackForCompositing, 1,
5931 "(Track theTrack) -> (Track _rv)"},
5932 {"GetMoviePict", (PyCFunction)MovieObj_GetMoviePict, 1,
5933 "(TimeValue time) -> (PicHandle _rv)"},
5934 {"GetMoviePosterPict", (PyCFunction)MovieObj_GetMoviePosterPict, 1,
5935 "() -> (PicHandle _rv)"},
5936 {"UpdateMovie", (PyCFunction)MovieObj_UpdateMovie, 1,
5937 "() -> None"},
5938 {"InvalidateMovieRegion", (PyCFunction)MovieObj_InvalidateMovieRegion, 1,
5939 "(RgnHandle invalidRgn) -> None"},
5940 {"GetMovieBox", (PyCFunction)MovieObj_GetMovieBox, 1,
5941 "() -> (Rect boxRect)"},
5942 {"SetMovieBox", (PyCFunction)MovieObj_SetMovieBox, 1,
5943 "(Rect boxRect) -> None"},
5944 {"GetMovieDisplayClipRgn", (PyCFunction)MovieObj_GetMovieDisplayClipRgn, 1,
5945 "() -> (RgnHandle _rv)"},
5946 {"SetMovieDisplayClipRgn", (PyCFunction)MovieObj_SetMovieDisplayClipRgn, 1,
5947 "(RgnHandle theClip) -> None"},
5948 {"GetMovieClipRgn", (PyCFunction)MovieObj_GetMovieClipRgn, 1,
5949 "() -> (RgnHandle _rv)"},
5950 {"SetMovieClipRgn", (PyCFunction)MovieObj_SetMovieClipRgn, 1,
5951 "(RgnHandle theClip) -> None"},
5952 {"GetMovieDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieDisplayBoundsRgn, 1,
5953 "() -> (RgnHandle _rv)"},
5954 {"GetMovieBoundsRgn", (PyCFunction)MovieObj_GetMovieBoundsRgn, 1,
5955 "() -> (RgnHandle _rv)"},
5956 {"PutMovieIntoHandle", (PyCFunction)MovieObj_PutMovieIntoHandle, 1,
5957 "(Handle publicMovie) -> None"},
5958 {"PutMovieIntoDataFork", (PyCFunction)MovieObj_PutMovieIntoDataFork, 1,
5959 "(short fRefNum, long offset, long maxSize) -> None"},
5960 {"GetMovieCreationTime", (PyCFunction)MovieObj_GetMovieCreationTime, 1,
5961 "() -> (unsigned long _rv)"},
5962 {"GetMovieModificationTime", (PyCFunction)MovieObj_GetMovieModificationTime, 1,
5963 "() -> (unsigned long _rv)"},
5964 {"GetMovieTimeScale", (PyCFunction)MovieObj_GetMovieTimeScale, 1,
5965 "() -> (TimeScale _rv)"},
5966 {"SetMovieTimeScale", (PyCFunction)MovieObj_SetMovieTimeScale, 1,
5967 "(TimeScale timeScale) -> None"},
5968 {"GetMovieDuration", (PyCFunction)MovieObj_GetMovieDuration, 1,
5969 "() -> (TimeValue _rv)"},
5970 {"GetMovieRate", (PyCFunction)MovieObj_GetMovieRate, 1,
5971 "() -> (Fixed _rv)"},
5972 {"SetMovieRate", (PyCFunction)MovieObj_SetMovieRate, 1,
5973 "(Fixed rate) -> None"},
5974 {"GetMoviePreferredRate", (PyCFunction)MovieObj_GetMoviePreferredRate, 1,
5975 "() -> (Fixed _rv)"},
5976 {"SetMoviePreferredRate", (PyCFunction)MovieObj_SetMoviePreferredRate, 1,
5977 "(Fixed rate) -> None"},
5978 {"GetMoviePreferredVolume", (PyCFunction)MovieObj_GetMoviePreferredVolume, 1,
5979 "() -> (short _rv)"},
5980 {"SetMoviePreferredVolume", (PyCFunction)MovieObj_SetMoviePreferredVolume, 1,
5981 "(short volume) -> None"},
5982 {"GetMovieVolume", (PyCFunction)MovieObj_GetMovieVolume, 1,
5983 "() -> (short _rv)"},
5984 {"SetMovieVolume", (PyCFunction)MovieObj_SetMovieVolume, 1,
5985 "(short volume) -> None"},
5986 {"GetMoviePreviewTime", (PyCFunction)MovieObj_GetMoviePreviewTime, 1,
5987 "() -> (TimeValue previewTime, TimeValue previewDuration)"},
5988 {"SetMoviePreviewTime", (PyCFunction)MovieObj_SetMoviePreviewTime, 1,
5989 "(TimeValue previewTime, TimeValue previewDuration) -> None"},
5990 {"GetMoviePosterTime", (PyCFunction)MovieObj_GetMoviePosterTime, 1,
5991 "() -> (TimeValue _rv)"},
5992 {"SetMoviePosterTime", (PyCFunction)MovieObj_SetMoviePosterTime, 1,
5993 "(TimeValue posterTime) -> None"},
5994 {"GetMovieSelection", (PyCFunction)MovieObj_GetMovieSelection, 1,
5995 "() -> (TimeValue selectionTime, TimeValue selectionDuration)"},
5996 {"SetMovieSelection", (PyCFunction)MovieObj_SetMovieSelection, 1,
5997 "(TimeValue selectionTime, TimeValue selectionDuration) -> None"},
5998 {"SetMovieActiveSegment", (PyCFunction)MovieObj_SetMovieActiveSegment, 1,
5999 "(TimeValue startTime, TimeValue duration) -> None"},
6000 {"GetMovieActiveSegment", (PyCFunction)MovieObj_GetMovieActiveSegment, 1,
6001 "() -> (TimeValue startTime, TimeValue duration)"},
6002 {"GetMovieTime", (PyCFunction)MovieObj_GetMovieTime, 1,
6003 "() -> (TimeValue _rv, TimeRecord currentTime)"},
6004 {"SetMovieTime", (PyCFunction)MovieObj_SetMovieTime, 1,
6005 "(TimeRecord newtime) -> None"},
6006 {"SetMovieTimeValue", (PyCFunction)MovieObj_SetMovieTimeValue, 1,
6007 "(TimeValue newtime) -> None"},
6008 {"GetMovieUserData", (PyCFunction)MovieObj_GetMovieUserData, 1,
6009 "() -> (UserData _rv)"},
6010 {"GetMovieTrackCount", (PyCFunction)MovieObj_GetMovieTrackCount, 1,
6011 "() -> (long _rv)"},
6012 {"GetMovieTrack", (PyCFunction)MovieObj_GetMovieTrack, 1,
6013 "(long trackID) -> (Track _rv)"},
6014 {"GetMovieIndTrack", (PyCFunction)MovieObj_GetMovieIndTrack, 1,
6015 "(long index) -> (Track _rv)"},
6016 {"GetMovieIndTrackType", (PyCFunction)MovieObj_GetMovieIndTrackType, 1,
6017 "(long index, OSType trackType, long flags) -> (Track _rv)"},
6018 {"NewMovieTrack", (PyCFunction)MovieObj_NewMovieTrack, 1,
6019 "(Fixed width, Fixed height, short trackVolume) -> (Track _rv)"},
6020 {"SetAutoTrackAlternatesEnabled", (PyCFunction)MovieObj_SetAutoTrackAlternatesEnabled, 1,
6021 "(Boolean enable) -> None"},
6022 {"SelectMovieAlternates", (PyCFunction)MovieObj_SelectMovieAlternates, 1,
6023 "() -> None"},
6024 {"InsertMovieSegment", (PyCFunction)MovieObj_InsertMovieSegment, 1,
6025 "(Movie dstMovie, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
6026 {"InsertEmptyMovieSegment", (PyCFunction)MovieObj_InsertEmptyMovieSegment, 1,
6027 "(TimeValue dstIn, TimeValue dstDuration) -> None"},
6028 {"DeleteMovieSegment", (PyCFunction)MovieObj_DeleteMovieSegment, 1,
6029 "(TimeValue startTime, TimeValue duration) -> None"},
6030 {"ScaleMovieSegment", (PyCFunction)MovieObj_ScaleMovieSegment, 1,
6031 "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
6032 {"CutMovieSelection", (PyCFunction)MovieObj_CutMovieSelection, 1,
6033 "() -> (Movie _rv)"},
6034 {"CopyMovieSelection", (PyCFunction)MovieObj_CopyMovieSelection, 1,
6035 "() -> (Movie _rv)"},
6036 {"PasteMovieSelection", (PyCFunction)MovieObj_PasteMovieSelection, 1,
6037 "(Movie src) -> None"},
6038 {"AddMovieSelection", (PyCFunction)MovieObj_AddMovieSelection, 1,
6039 "(Movie src) -> None"},
6040 {"ClearMovieSelection", (PyCFunction)MovieObj_ClearMovieSelection, 1,
6041 "() -> None"},
6042 {"PutMovieIntoTypedHandle", (PyCFunction)MovieObj_PutMovieIntoTypedHandle, 1,
6043 "(Track targetTrack, OSType handleType, Handle publicMovie, TimeValue start, TimeValue dur, long flags, ComponentInstance userComp) -> None"},
6044 {"CopyMovieSettings", (PyCFunction)MovieObj_CopyMovieSettings, 1,
6045 "(Movie dstMovie) -> None"},
6046 {"ConvertMovieToFile", (PyCFunction)MovieObj_ConvertMovieToFile, 1,
6047 "(Track onlyTrack, FSSpec outputFile, OSType fileType, OSType creator, ScriptCode scriptTag, long flags, ComponentInstance userComp) -> (short resID)"},
6048 {"GetMovieDataSize", (PyCFunction)MovieObj_GetMovieDataSize, 1,
6049 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
6050 {"PtInMovie", (PyCFunction)MovieObj_PtInMovie, 1,
6051 "(Point pt) -> (Boolean _rv)"},
6052 {"SetMovieLanguage", (PyCFunction)MovieObj_SetMovieLanguage, 1,
6053 "(long language) -> None"},
6054 {"GetMovieNextInterestingTime", (PyCFunction)MovieObj_GetMovieNextInterestingTime, 1,
6055 "(short interestingTimeFlags, short numMediaTypes, OSType whichMediaTypes, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
6056 {"AddMovieResource", (PyCFunction)MovieObj_AddMovieResource, 1,
6057 "(short resRefNum, Str255 resName) -> (short resId)"},
6058 {"UpdateMovieResource", (PyCFunction)MovieObj_UpdateMovieResource, 1,
6059 "(short resRefNum, short resId, Str255 resName) -> None"},
6060 {"HasMovieChanged", (PyCFunction)MovieObj_HasMovieChanged, 1,
6061 "() -> (Boolean _rv)"},
6062 {"ClearMovieChanged", (PyCFunction)MovieObj_ClearMovieChanged, 1,
6063 "() -> None"},
6064 {"SetMovieDefaultDataRef", (PyCFunction)MovieObj_SetMovieDefaultDataRef, 1,
6065 "(Handle dataRef, OSType dataRefType) -> None"},
6066 {"GetMovieDefaultDataRef", (PyCFunction)MovieObj_GetMovieDefaultDataRef, 1,
6067 "() -> (Handle dataRef, OSType dataRefType)"},
6068 {"SetMovieColorTable", (PyCFunction)MovieObj_SetMovieColorTable, 1,
6069 "(CTabHandle ctab) -> None"},
6070 {"GetMovieColorTable", (PyCFunction)MovieObj_GetMovieColorTable, 1,
6071 "() -> (CTabHandle ctab)"},
6072 {"FlattenMovie", (PyCFunction)MovieObj_FlattenMovie, 1,
6073 "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, Str255 resName) -> (short resId)"},
6074 {"FlattenMovieData", (PyCFunction)MovieObj_FlattenMovieData, 1,
6075 "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (Movie _rv)"},
6076 {"MovieSearchText", (PyCFunction)MovieObj_MovieSearchText, 1,
6077 "(Ptr text, long size, long searchFlags) -> (Track searchTrack, TimeValue searchTime, long searchOffset)"},
6078 {"GetPosterBox", (PyCFunction)MovieObj_GetPosterBox, 1,
6079 "() -> (Rect boxRect)"},
6080 {"SetPosterBox", (PyCFunction)MovieObj_SetPosterBox, 1,
6081 "(Rect boxRect) -> None"},
6082 {"GetMovieSegmentDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieSegmentDisplayBoundsRgn, 1,
6083 "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
6084 {"GetMovieStatus", (PyCFunction)MovieObj_GetMovieStatus, 1,
6085 "() -> (ComponentResult _rv, Track firstProblemTrack)"},
6086 {"NewMovieController", (PyCFunction)MovieObj_NewMovieController, 1,
6087 "(Rect movieRect, long someFlags) -> (MovieController _rv)"},
6088 {"PutMovieOnScrap", (PyCFunction)MovieObj_PutMovieOnScrap, 1,
6089 "(long movieScrapFlags) -> None"},
6090 {"SetMoviePlayHints", (PyCFunction)MovieObj_SetMoviePlayHints, 1,
6091 "(long flags, long flagsMask) -> None"},
6092 {"GetMaxLoadedTimeInMovie", (PyCFunction)MovieObj_GetMaxLoadedTimeInMovie, 1,
6093 "() -> (TimeValue time)"},
6094 {"QTMovieNeedsTimeTable", (PyCFunction)MovieObj_QTMovieNeedsTimeTable, 1,
6095 "() -> (Boolean needsTimeTable)"},
6096 {"QTGetDataRefMaxFileOffset", (PyCFunction)MovieObj_QTGetDataRefMaxFileOffset, 1,
6097 "(OSType dataRefType, Handle dataRef) -> (long offset)"},
6098 {NULL, NULL, 0}
6101 PyMethodChain MovieObj_chain = { MovieObj_methods, NULL };
6103 static PyObject *MovieObj_getattr(self, name)
6104 MovieObject *self;
6105 char *name;
6107 return Py_FindMethodInChain(&MovieObj_chain, (PyObject *)self, name);
6110 #define MovieObj_setattr NULL
6112 PyTypeObject Movie_Type = {
6113 PyObject_HEAD_INIT(&PyType_Type)
6114 0, /*ob_size*/
6115 "Movie", /*tp_name*/
6116 sizeof(MovieObject), /*tp_basicsize*/
6117 0, /*tp_itemsize*/
6118 /* methods */
6119 (destructor) MovieObj_dealloc, /*tp_dealloc*/
6120 0, /*tp_print*/
6121 (getattrfunc) MovieObj_getattr, /*tp_getattr*/
6122 (setattrfunc) MovieObj_setattr, /*tp_setattr*/
6125 /* --------------------- End object type Movie ---------------------- */
6128 static PyObject *Qt_EnterMovies(_self, _args)
6129 PyObject *_self;
6130 PyObject *_args;
6132 PyObject *_res = NULL;
6133 OSErr _err;
6134 if (!PyArg_ParseTuple(_args, ""))
6135 return NULL;
6136 _err = EnterMovies();
6137 if (_err != noErr) return PyMac_Error(_err);
6138 Py_INCREF(Py_None);
6139 _res = Py_None;
6140 return _res;
6143 static PyObject *Qt_ExitMovies(_self, _args)
6144 PyObject *_self;
6145 PyObject *_args;
6147 PyObject *_res = NULL;
6148 if (!PyArg_ParseTuple(_args, ""))
6149 return NULL;
6150 ExitMovies();
6151 Py_INCREF(Py_None);
6152 _res = Py_None;
6153 return _res;
6156 static PyObject *Qt_GetMoviesError(_self, _args)
6157 PyObject *_self;
6158 PyObject *_args;
6160 PyObject *_res = NULL;
6161 OSErr _err;
6162 if (!PyArg_ParseTuple(_args, ""))
6163 return NULL;
6164 _err = GetMoviesError();
6165 if (_err != noErr) return PyMac_Error(_err);
6166 Py_INCREF(Py_None);
6167 _res = Py_None;
6168 return _res;
6171 static PyObject *Qt_ClearMoviesStickyError(_self, _args)
6172 PyObject *_self;
6173 PyObject *_args;
6175 PyObject *_res = NULL;
6176 if (!PyArg_ParseTuple(_args, ""))
6177 return NULL;
6178 ClearMoviesStickyError();
6179 Py_INCREF(Py_None);
6180 _res = Py_None;
6181 return _res;
6184 static PyObject *Qt_GetMoviesStickyError(_self, _args)
6185 PyObject *_self;
6186 PyObject *_args;
6188 PyObject *_res = NULL;
6189 OSErr _err;
6190 if (!PyArg_ParseTuple(_args, ""))
6191 return NULL;
6192 _err = GetMoviesStickyError();
6193 if (_err != noErr) return PyMac_Error(_err);
6194 Py_INCREF(Py_None);
6195 _res = Py_None;
6196 return _res;
6199 static PyObject *Qt_DisposeMatte(_self, _args)
6200 PyObject *_self;
6201 PyObject *_args;
6203 PyObject *_res = NULL;
6204 PixMapHandle theMatte;
6205 if (!PyArg_ParseTuple(_args, "O&",
6206 ResObj_Convert, &theMatte))
6207 return NULL;
6208 DisposeMatte(theMatte);
6209 Py_INCREF(Py_None);
6210 _res = Py_None;
6211 return _res;
6214 static PyObject *Qt_NewMovie(_self, _args)
6215 PyObject *_self;
6216 PyObject *_args;
6218 PyObject *_res = NULL;
6219 Movie _rv;
6220 long flags;
6221 if (!PyArg_ParseTuple(_args, "l",
6222 &flags))
6223 return NULL;
6224 _rv = NewMovie(flags);
6225 _res = Py_BuildValue("O&",
6226 MovieObj_New, _rv);
6227 return _res;
6230 static PyObject *Qt_GetDataHandler(_self, _args)
6231 PyObject *_self;
6232 PyObject *_args;
6234 PyObject *_res = NULL;
6235 Component _rv;
6236 Handle dataRef;
6237 OSType dataHandlerSubType;
6238 long flags;
6239 if (!PyArg_ParseTuple(_args, "O&O&l",
6240 ResObj_Convert, &dataRef,
6241 PyMac_GetOSType, &dataHandlerSubType,
6242 &flags))
6243 return NULL;
6244 _rv = GetDataHandler(dataRef,
6245 dataHandlerSubType,
6246 flags);
6247 _res = Py_BuildValue("O&",
6248 CmpObj_New, _rv);
6249 return _res;
6252 static PyObject *Qt_PasteHandleIntoMovie(_self, _args)
6253 PyObject *_self;
6254 PyObject *_args;
6256 PyObject *_res = NULL;
6257 OSErr _err;
6258 Handle h;
6259 OSType handleType;
6260 Movie theMovie;
6261 long flags;
6262 ComponentInstance userComp;
6263 if (!PyArg_ParseTuple(_args, "O&O&O&lO&",
6264 ResObj_Convert, &h,
6265 PyMac_GetOSType, &handleType,
6266 MovieObj_Convert, &theMovie,
6267 &flags,
6268 CmpInstObj_Convert, &userComp))
6269 return NULL;
6270 _err = PasteHandleIntoMovie(h,
6271 handleType,
6272 theMovie,
6273 flags,
6274 userComp);
6275 if (_err != noErr) return PyMac_Error(_err);
6276 Py_INCREF(Py_None);
6277 _res = Py_None;
6278 return _res;
6281 static PyObject *Qt_GetMovieImporterForDataRef(_self, _args)
6282 PyObject *_self;
6283 PyObject *_args;
6285 PyObject *_res = NULL;
6286 OSErr _err;
6287 OSType dataRefType;
6288 Handle dataRef;
6289 long flags;
6290 Component importer;
6291 if (!PyArg_ParseTuple(_args, "O&O&l",
6292 PyMac_GetOSType, &dataRefType,
6293 ResObj_Convert, &dataRef,
6294 &flags))
6295 return NULL;
6296 _err = GetMovieImporterForDataRef(dataRefType,
6297 dataRef,
6298 flags,
6299 &importer);
6300 if (_err != noErr) return PyMac_Error(_err);
6301 _res = Py_BuildValue("O&",
6302 CmpObj_New, importer);
6303 return _res;
6306 static PyObject *Qt_TrackTimeToMediaTime(_self, _args)
6307 PyObject *_self;
6308 PyObject *_args;
6310 PyObject *_res = NULL;
6311 TimeValue _rv;
6312 TimeValue value;
6313 Track theTrack;
6314 if (!PyArg_ParseTuple(_args, "lO&",
6315 &value,
6316 TrackObj_Convert, &theTrack))
6317 return NULL;
6318 _rv = TrackTimeToMediaTime(value,
6319 theTrack);
6320 _res = Py_BuildValue("l",
6321 _rv);
6322 return _res;
6325 static PyObject *Qt_NewUserData(_self, _args)
6326 PyObject *_self;
6327 PyObject *_args;
6329 PyObject *_res = NULL;
6330 OSErr _err;
6331 UserData theUserData;
6332 if (!PyArg_ParseTuple(_args, ""))
6333 return NULL;
6334 _err = NewUserData(&theUserData);
6335 if (_err != noErr) return PyMac_Error(_err);
6336 _res = Py_BuildValue("O&",
6337 UserDataObj_New, theUserData);
6338 return _res;
6341 static PyObject *Qt_NewUserDataFromHandle(_self, _args)
6342 PyObject *_self;
6343 PyObject *_args;
6345 PyObject *_res = NULL;
6346 OSErr _err;
6347 Handle h;
6348 UserData theUserData;
6349 if (!PyArg_ParseTuple(_args, "O&",
6350 ResObj_Convert, &h))
6351 return NULL;
6352 _err = NewUserDataFromHandle(h,
6353 &theUserData);
6354 if (_err != noErr) return PyMac_Error(_err);
6355 _res = Py_BuildValue("O&",
6356 UserDataObj_New, theUserData);
6357 return _res;
6360 static PyObject *Qt_CreateMovieFile(_self, _args)
6361 PyObject *_self;
6362 PyObject *_args;
6364 PyObject *_res = NULL;
6365 OSErr _err;
6366 FSSpec fileSpec;
6367 OSType creator;
6368 ScriptCode scriptTag;
6369 long createMovieFileFlags;
6370 short resRefNum;
6371 Movie newmovie;
6372 if (!PyArg_ParseTuple(_args, "O&O&hl",
6373 PyMac_GetFSSpec, &fileSpec,
6374 PyMac_GetOSType, &creator,
6375 &scriptTag,
6376 &createMovieFileFlags))
6377 return NULL;
6378 _err = CreateMovieFile(&fileSpec,
6379 creator,
6380 scriptTag,
6381 createMovieFileFlags,
6382 &resRefNum,
6383 &newmovie);
6384 if (_err != noErr) return PyMac_Error(_err);
6385 _res = Py_BuildValue("hO&",
6386 resRefNum,
6387 MovieObj_New, newmovie);
6388 return _res;
6391 static PyObject *Qt_OpenMovieFile(_self, _args)
6392 PyObject *_self;
6393 PyObject *_args;
6395 PyObject *_res = NULL;
6396 OSErr _err;
6397 FSSpec fileSpec;
6398 short resRefNum;
6399 SInt8 permission;
6400 if (!PyArg_ParseTuple(_args, "O&b",
6401 PyMac_GetFSSpec, &fileSpec,
6402 &permission))
6403 return NULL;
6404 _err = OpenMovieFile(&fileSpec,
6405 &resRefNum,
6406 permission);
6407 if (_err != noErr) return PyMac_Error(_err);
6408 _res = Py_BuildValue("h",
6409 resRefNum);
6410 return _res;
6413 static PyObject *Qt_CloseMovieFile(_self, _args)
6414 PyObject *_self;
6415 PyObject *_args;
6417 PyObject *_res = NULL;
6418 OSErr _err;
6419 short resRefNum;
6420 if (!PyArg_ParseTuple(_args, "h",
6421 &resRefNum))
6422 return NULL;
6423 _err = CloseMovieFile(resRefNum);
6424 if (_err != noErr) return PyMac_Error(_err);
6425 Py_INCREF(Py_None);
6426 _res = Py_None;
6427 return _res;
6430 static PyObject *Qt_DeleteMovieFile(_self, _args)
6431 PyObject *_self;
6432 PyObject *_args;
6434 PyObject *_res = NULL;
6435 OSErr _err;
6436 FSSpec fileSpec;
6437 if (!PyArg_ParseTuple(_args, "O&",
6438 PyMac_GetFSSpec, &fileSpec))
6439 return NULL;
6440 _err = DeleteMovieFile(&fileSpec);
6441 if (_err != noErr) return PyMac_Error(_err);
6442 Py_INCREF(Py_None);
6443 _res = Py_None;
6444 return _res;
6447 static PyObject *Qt_NewMovieFromFile(_self, _args)
6448 PyObject *_self;
6449 PyObject *_args;
6451 PyObject *_res = NULL;
6452 OSErr _err;
6453 Movie theMovie;
6454 short resRefNum;
6455 short resId;
6456 short newMovieFlags;
6457 Boolean dataRefWasChanged;
6458 if (!PyArg_ParseTuple(_args, "hhh",
6459 &resRefNum,
6460 &resId,
6461 &newMovieFlags))
6462 return NULL;
6463 _err = NewMovieFromFile(&theMovie,
6464 resRefNum,
6465 &resId,
6466 (StringPtr)0,
6467 newMovieFlags,
6468 &dataRefWasChanged);
6469 if (_err != noErr) return PyMac_Error(_err);
6470 _res = Py_BuildValue("O&hb",
6471 MovieObj_New, theMovie,
6472 resId,
6473 dataRefWasChanged);
6474 return _res;
6477 static PyObject *Qt_NewMovieFromHandle(_self, _args)
6478 PyObject *_self;
6479 PyObject *_args;
6481 PyObject *_res = NULL;
6482 OSErr _err;
6483 Movie theMovie;
6484 Handle h;
6485 short newMovieFlags;
6486 Boolean dataRefWasChanged;
6487 if (!PyArg_ParseTuple(_args, "O&h",
6488 ResObj_Convert, &h,
6489 &newMovieFlags))
6490 return NULL;
6491 _err = NewMovieFromHandle(&theMovie,
6493 newMovieFlags,
6494 &dataRefWasChanged);
6495 if (_err != noErr) return PyMac_Error(_err);
6496 _res = Py_BuildValue("O&b",
6497 MovieObj_New, theMovie,
6498 dataRefWasChanged);
6499 return _res;
6502 static PyObject *Qt_NewMovieFromDataFork(_self, _args)
6503 PyObject *_self;
6504 PyObject *_args;
6506 PyObject *_res = NULL;
6507 OSErr _err;
6508 Movie theMovie;
6509 short fRefNum;
6510 long fileOffset;
6511 short newMovieFlags;
6512 Boolean dataRefWasChanged;
6513 if (!PyArg_ParseTuple(_args, "hlh",
6514 &fRefNum,
6515 &fileOffset,
6516 &newMovieFlags))
6517 return NULL;
6518 _err = NewMovieFromDataFork(&theMovie,
6519 fRefNum,
6520 fileOffset,
6521 newMovieFlags,
6522 &dataRefWasChanged);
6523 if (_err != noErr) return PyMac_Error(_err);
6524 _res = Py_BuildValue("O&b",
6525 MovieObj_New, theMovie,
6526 dataRefWasChanged);
6527 return _res;
6530 static PyObject *Qt_NewMovieFromDataRef(_self, _args)
6531 PyObject *_self;
6532 PyObject *_args;
6534 PyObject *_res = NULL;
6535 OSErr _err;
6536 Movie m;
6537 short flags;
6538 short id;
6539 Handle dataRef;
6540 OSType dataRefType;
6541 if (!PyArg_ParseTuple(_args, "hO&O&",
6542 &flags,
6543 ResObj_Convert, &dataRef,
6544 PyMac_GetOSType, &dataRefType))
6545 return NULL;
6546 _err = NewMovieFromDataRef(&m,
6547 flags,
6548 &id,
6549 dataRef,
6550 dataRefType);
6551 if (_err != noErr) return PyMac_Error(_err);
6552 _res = Py_BuildValue("O&h",
6553 MovieObj_New, m,
6554 id);
6555 return _res;
6558 static PyObject *Qt_RemoveMovieResource(_self, _args)
6559 PyObject *_self;
6560 PyObject *_args;
6562 PyObject *_res = NULL;
6563 OSErr _err;
6564 short resRefNum;
6565 short resId;
6566 if (!PyArg_ParseTuple(_args, "hh",
6567 &resRefNum,
6568 &resId))
6569 return NULL;
6570 _err = RemoveMovieResource(resRefNum,
6571 resId);
6572 if (_err != noErr) return PyMac_Error(_err);
6573 Py_INCREF(Py_None);
6574 _res = Py_None;
6575 return _res;
6578 static PyObject *Qt_NewMovieFromScrap(_self, _args)
6579 PyObject *_self;
6580 PyObject *_args;
6582 PyObject *_res = NULL;
6583 Movie _rv;
6584 long newMovieFlags;
6585 if (!PyArg_ParseTuple(_args, "l",
6586 &newMovieFlags))
6587 return NULL;
6588 _rv = NewMovieFromScrap(newMovieFlags);
6589 _res = Py_BuildValue("O&",
6590 MovieObj_New, _rv);
6591 return _res;
6594 static PyObject *Qt_QTNewAlias(_self, _args)
6595 PyObject *_self;
6596 PyObject *_args;
6598 PyObject *_res = NULL;
6599 OSErr _err;
6600 FSSpec fss;
6601 AliasHandle alias;
6602 Boolean minimal;
6603 if (!PyArg_ParseTuple(_args, "O&b",
6604 PyMac_GetFSSpec, &fss,
6605 &minimal))
6606 return NULL;
6607 _err = QTNewAlias(&fss,
6608 &alias,
6609 minimal);
6610 if (_err != noErr) return PyMac_Error(_err);
6611 _res = Py_BuildValue("O&",
6612 ResObj_New, alias);
6613 return _res;
6616 static PyObject *Qt_EndFullScreen(_self, _args)
6617 PyObject *_self;
6618 PyObject *_args;
6620 PyObject *_res = NULL;
6621 OSErr _err;
6622 Ptr fullState;
6623 long flags;
6624 if (!PyArg_ParseTuple(_args, "sl",
6625 &fullState,
6626 &flags))
6627 return NULL;
6628 _err = EndFullScreen(fullState,
6629 flags);
6630 if (_err != noErr) return PyMac_Error(_err);
6631 Py_INCREF(Py_None);
6632 _res = Py_None;
6633 return _res;
6636 static PyObject *Qt_AddSoundDescriptionExtension(_self, _args)
6637 PyObject *_self;
6638 PyObject *_args;
6640 PyObject *_res = NULL;
6641 OSErr _err;
6642 SoundDescriptionHandle desc;
6643 Handle extension;
6644 OSType idType;
6645 if (!PyArg_ParseTuple(_args, "O&O&O&",
6646 ResObj_Convert, &desc,
6647 ResObj_Convert, &extension,
6648 PyMac_GetOSType, &idType))
6649 return NULL;
6650 _err = AddSoundDescriptionExtension(desc,
6651 extension,
6652 idType);
6653 if (_err != noErr) return PyMac_Error(_err);
6654 Py_INCREF(Py_None);
6655 _res = Py_None;
6656 return _res;
6659 static PyObject *Qt_GetSoundDescriptionExtension(_self, _args)
6660 PyObject *_self;
6661 PyObject *_args;
6663 PyObject *_res = NULL;
6664 OSErr _err;
6665 SoundDescriptionHandle desc;
6666 Handle extension;
6667 OSType idType;
6668 if (!PyArg_ParseTuple(_args, "O&O&",
6669 ResObj_Convert, &desc,
6670 PyMac_GetOSType, &idType))
6671 return NULL;
6672 _err = GetSoundDescriptionExtension(desc,
6673 &extension,
6674 idType);
6675 if (_err != noErr) return PyMac_Error(_err);
6676 _res = Py_BuildValue("O&",
6677 ResObj_New, extension);
6678 return _res;
6681 static PyObject *Qt_RemoveSoundDescriptionExtension(_self, _args)
6682 PyObject *_self;
6683 PyObject *_args;
6685 PyObject *_res = NULL;
6686 OSErr _err;
6687 SoundDescriptionHandle desc;
6688 OSType idType;
6689 if (!PyArg_ParseTuple(_args, "O&O&",
6690 ResObj_Convert, &desc,
6691 PyMac_GetOSType, &idType))
6692 return NULL;
6693 _err = RemoveSoundDescriptionExtension(desc,
6694 idType);
6695 if (_err != noErr) return PyMac_Error(_err);
6696 Py_INCREF(Py_None);
6697 _res = Py_None;
6698 return _res;
6701 static PyObject *Qt_QTIsStandardParameterDialogEvent(_self, _args)
6702 PyObject *_self;
6703 PyObject *_args;
6705 PyObject *_res = NULL;
6706 OSErr _err;
6707 EventRecord pEvent;
6708 QTParameterDialog createdDialog;
6709 if (!PyArg_ParseTuple(_args, "l",
6710 &createdDialog))
6711 return NULL;
6712 _err = QTIsStandardParameterDialogEvent(&pEvent,
6713 createdDialog);
6714 if (_err != noErr) return PyMac_Error(_err);
6715 _res = Py_BuildValue("O&",
6716 PyMac_BuildEventRecord, &pEvent);
6717 return _res;
6720 static PyObject *Qt_QTDismissStandardParameterDialog(_self, _args)
6721 PyObject *_self;
6722 PyObject *_args;
6724 PyObject *_res = NULL;
6725 OSErr _err;
6726 QTParameterDialog createdDialog;
6727 if (!PyArg_ParseTuple(_args, "l",
6728 &createdDialog))
6729 return NULL;
6730 _err = QTDismissStandardParameterDialog(createdDialog);
6731 if (_err != noErr) return PyMac_Error(_err);
6732 Py_INCREF(Py_None);
6733 _res = Py_None;
6734 return _res;
6737 static PyObject *Qt_QTStandardParameterDialogDoAction(_self, _args)
6738 PyObject *_self;
6739 PyObject *_args;
6741 PyObject *_res = NULL;
6742 OSErr _err;
6743 QTParameterDialog createdDialog;
6744 long action;
6745 void * params;
6746 if (!PyArg_ParseTuple(_args, "lls",
6747 &createdDialog,
6748 &action,
6749 &params))
6750 return NULL;
6751 _err = QTStandardParameterDialogDoAction(createdDialog,
6752 action,
6753 params);
6754 if (_err != noErr) return PyMac_Error(_err);
6755 Py_INCREF(Py_None);
6756 _res = Py_None;
6757 return _res;
6760 static PyObject *Qt_QTRegisterAccessKey(_self, _args)
6761 PyObject *_self;
6762 PyObject *_args;
6764 PyObject *_res = NULL;
6765 OSErr _err;
6766 Str255 accessKeyType;
6767 long flags;
6768 Handle accessKey;
6769 if (!PyArg_ParseTuple(_args, "O&lO&",
6770 PyMac_GetStr255, accessKeyType,
6771 &flags,
6772 ResObj_Convert, &accessKey))
6773 return NULL;
6774 _err = QTRegisterAccessKey(accessKeyType,
6775 flags,
6776 accessKey);
6777 if (_err != noErr) return PyMac_Error(_err);
6778 Py_INCREF(Py_None);
6779 _res = Py_None;
6780 return _res;
6783 static PyObject *Qt_QTUnregisterAccessKey(_self, _args)
6784 PyObject *_self;
6785 PyObject *_args;
6787 PyObject *_res = NULL;
6788 OSErr _err;
6789 Str255 accessKeyType;
6790 long flags;
6791 Handle accessKey;
6792 if (!PyArg_ParseTuple(_args, "O&lO&",
6793 PyMac_GetStr255, accessKeyType,
6794 &flags,
6795 ResObj_Convert, &accessKey))
6796 return NULL;
6797 _err = QTUnregisterAccessKey(accessKeyType,
6798 flags,
6799 accessKey);
6800 if (_err != noErr) return PyMac_Error(_err);
6801 Py_INCREF(Py_None);
6802 _res = Py_None;
6803 return _res;
6806 static PyObject *Qt_QTTextToNativeText(_self, _args)
6807 PyObject *_self;
6808 PyObject *_args;
6810 PyObject *_res = NULL;
6811 OSErr _err;
6812 Handle theText;
6813 long encoding;
6814 long flags;
6815 if (!PyArg_ParseTuple(_args, "O&ll",
6816 ResObj_Convert, &theText,
6817 &encoding,
6818 &flags))
6819 return NULL;
6820 _err = QTTextToNativeText(theText,
6821 encoding,
6822 flags);
6823 if (_err != noErr) return PyMac_Error(_err);
6824 Py_INCREF(Py_None);
6825 _res = Py_None;
6826 return _res;
6829 static PyObject *Qt_VideoMediaResetStatistics(_self, _args)
6830 PyObject *_self;
6831 PyObject *_args;
6833 PyObject *_res = NULL;
6834 ComponentResult _rv;
6835 MediaHandler mh;
6836 if (!PyArg_ParseTuple(_args, "O&",
6837 CmpInstObj_Convert, &mh))
6838 return NULL;
6839 _rv = VideoMediaResetStatistics(mh);
6840 _res = Py_BuildValue("l",
6841 _rv);
6842 return _res;
6845 static PyObject *Qt_VideoMediaGetStatistics(_self, _args)
6846 PyObject *_self;
6847 PyObject *_args;
6849 PyObject *_res = NULL;
6850 ComponentResult _rv;
6851 MediaHandler mh;
6852 if (!PyArg_ParseTuple(_args, "O&",
6853 CmpInstObj_Convert, &mh))
6854 return NULL;
6855 _rv = VideoMediaGetStatistics(mh);
6856 _res = Py_BuildValue("l",
6857 _rv);
6858 return _res;
6861 static PyObject *Qt_TextMediaAddTextSample(_self, _args)
6862 PyObject *_self;
6863 PyObject *_args;
6865 PyObject *_res = NULL;
6866 ComponentResult _rv;
6867 MediaHandler mh;
6868 Ptr text;
6869 unsigned long size;
6870 short fontNumber;
6871 short fontSize;
6872 Style textFace;
6873 RGBColor textColor;
6874 RGBColor backColor;
6875 short textJustification;
6876 Rect textBox;
6877 long displayFlags;
6878 TimeValue scrollDelay;
6879 short hiliteStart;
6880 short hiliteEnd;
6881 RGBColor rgbHiliteColor;
6882 TimeValue duration;
6883 TimeValue sampleTime;
6884 if (!PyArg_ParseTuple(_args, "O&slhhbhllhhl",
6885 CmpInstObj_Convert, &mh,
6886 &text,
6887 &size,
6888 &fontNumber,
6889 &fontSize,
6890 &textFace,
6891 &textJustification,
6892 &displayFlags,
6893 &scrollDelay,
6894 &hiliteStart,
6895 &hiliteEnd,
6896 &duration))
6897 return NULL;
6898 _rv = TextMediaAddTextSample(mh,
6899 text,
6900 size,
6901 fontNumber,
6902 fontSize,
6903 textFace,
6904 &textColor,
6905 &backColor,
6906 textJustification,
6907 &textBox,
6908 displayFlags,
6909 scrollDelay,
6910 hiliteStart,
6911 hiliteEnd,
6912 &rgbHiliteColor,
6913 duration,
6914 &sampleTime);
6915 _res = Py_BuildValue("lO&O&O&O&l",
6916 _rv,
6917 QdRGB_New, &textColor,
6918 QdRGB_New, &backColor,
6919 PyMac_BuildRect, &textBox,
6920 QdRGB_New, &rgbHiliteColor,
6921 sampleTime);
6922 return _res;
6925 static PyObject *Qt_TextMediaAddTESample(_self, _args)
6926 PyObject *_self;
6927 PyObject *_args;
6929 PyObject *_res = NULL;
6930 ComponentResult _rv;
6931 MediaHandler mh;
6932 TEHandle hTE;
6933 RGBColor backColor;
6934 short textJustification;
6935 Rect textBox;
6936 long displayFlags;
6937 TimeValue scrollDelay;
6938 short hiliteStart;
6939 short hiliteEnd;
6940 RGBColor rgbHiliteColor;
6941 TimeValue duration;
6942 TimeValue sampleTime;
6943 if (!PyArg_ParseTuple(_args, "O&O&hllhhl",
6944 CmpInstObj_Convert, &mh,
6945 ResObj_Convert, &hTE,
6946 &textJustification,
6947 &displayFlags,
6948 &scrollDelay,
6949 &hiliteStart,
6950 &hiliteEnd,
6951 &duration))
6952 return NULL;
6953 _rv = TextMediaAddTESample(mh,
6954 hTE,
6955 &backColor,
6956 textJustification,
6957 &textBox,
6958 displayFlags,
6959 scrollDelay,
6960 hiliteStart,
6961 hiliteEnd,
6962 &rgbHiliteColor,
6963 duration,
6964 &sampleTime);
6965 _res = Py_BuildValue("lO&O&O&l",
6966 _rv,
6967 QdRGB_New, &backColor,
6968 PyMac_BuildRect, &textBox,
6969 QdRGB_New, &rgbHiliteColor,
6970 sampleTime);
6971 return _res;
6974 static PyObject *Qt_TextMediaAddHiliteSample(_self, _args)
6975 PyObject *_self;
6976 PyObject *_args;
6978 PyObject *_res = NULL;
6979 ComponentResult _rv;
6980 MediaHandler mh;
6981 short hiliteStart;
6982 short hiliteEnd;
6983 RGBColor rgbHiliteColor;
6984 TimeValue duration;
6985 TimeValue sampleTime;
6986 if (!PyArg_ParseTuple(_args, "O&hhl",
6987 CmpInstObj_Convert, &mh,
6988 &hiliteStart,
6989 &hiliteEnd,
6990 &duration))
6991 return NULL;
6992 _rv = TextMediaAddHiliteSample(mh,
6993 hiliteStart,
6994 hiliteEnd,
6995 &rgbHiliteColor,
6996 duration,
6997 &sampleTime);
6998 _res = Py_BuildValue("lO&l",
6999 _rv,
7000 QdRGB_New, &rgbHiliteColor,
7001 sampleTime);
7002 return _res;
7005 static PyObject *Qt_TextMediaFindNextText(_self, _args)
7006 PyObject *_self;
7007 PyObject *_args;
7009 PyObject *_res = NULL;
7010 ComponentResult _rv;
7011 MediaHandler mh;
7012 Ptr text;
7013 long size;
7014 short findFlags;
7015 TimeValue startTime;
7016 TimeValue foundTime;
7017 TimeValue foundDuration;
7018 long offset;
7019 if (!PyArg_ParseTuple(_args, "O&slhl",
7020 CmpInstObj_Convert, &mh,
7021 &text,
7022 &size,
7023 &findFlags,
7024 &startTime))
7025 return NULL;
7026 _rv = TextMediaFindNextText(mh,
7027 text,
7028 size,
7029 findFlags,
7030 startTime,
7031 &foundTime,
7032 &foundDuration,
7033 &offset);
7034 _res = Py_BuildValue("llll",
7035 _rv,
7036 foundTime,
7037 foundDuration,
7038 offset);
7039 return _res;
7042 static PyObject *Qt_TextMediaHiliteTextSample(_self, _args)
7043 PyObject *_self;
7044 PyObject *_args;
7046 PyObject *_res = NULL;
7047 ComponentResult _rv;
7048 MediaHandler mh;
7049 TimeValue sampleTime;
7050 short hiliteStart;
7051 short hiliteEnd;
7052 RGBColor rgbHiliteColor;
7053 if (!PyArg_ParseTuple(_args, "O&lhh",
7054 CmpInstObj_Convert, &mh,
7055 &sampleTime,
7056 &hiliteStart,
7057 &hiliteEnd))
7058 return NULL;
7059 _rv = TextMediaHiliteTextSample(mh,
7060 sampleTime,
7061 hiliteStart,
7062 hiliteEnd,
7063 &rgbHiliteColor);
7064 _res = Py_BuildValue("lO&",
7065 _rv,
7066 QdRGB_New, &rgbHiliteColor);
7067 return _res;
7070 static PyObject *Qt_TextMediaSetTextSampleData(_self, _args)
7071 PyObject *_self;
7072 PyObject *_args;
7074 PyObject *_res = NULL;
7075 ComponentResult _rv;
7076 MediaHandler mh;
7077 void * data;
7078 OSType dataType;
7079 if (!PyArg_ParseTuple(_args, "O&sO&",
7080 CmpInstObj_Convert, &mh,
7081 &data,
7082 PyMac_GetOSType, &dataType))
7083 return NULL;
7084 _rv = TextMediaSetTextSampleData(mh,
7085 data,
7086 dataType);
7087 _res = Py_BuildValue("l",
7088 _rv);
7089 return _res;
7092 static PyObject *Qt_SpriteMediaSetProperty(_self, _args)
7093 PyObject *_self;
7094 PyObject *_args;
7096 PyObject *_res = NULL;
7097 ComponentResult _rv;
7098 MediaHandler mh;
7099 short spriteIndex;
7100 long propertyType;
7101 void * propertyValue;
7102 if (!PyArg_ParseTuple(_args, "O&hls",
7103 CmpInstObj_Convert, &mh,
7104 &spriteIndex,
7105 &propertyType,
7106 &propertyValue))
7107 return NULL;
7108 _rv = SpriteMediaSetProperty(mh,
7109 spriteIndex,
7110 propertyType,
7111 propertyValue);
7112 _res = Py_BuildValue("l",
7113 _rv);
7114 return _res;
7117 static PyObject *Qt_SpriteMediaGetProperty(_self, _args)
7118 PyObject *_self;
7119 PyObject *_args;
7121 PyObject *_res = NULL;
7122 ComponentResult _rv;
7123 MediaHandler mh;
7124 short spriteIndex;
7125 long propertyType;
7126 void * propertyValue;
7127 if (!PyArg_ParseTuple(_args, "O&hls",
7128 CmpInstObj_Convert, &mh,
7129 &spriteIndex,
7130 &propertyType,
7131 &propertyValue))
7132 return NULL;
7133 _rv = SpriteMediaGetProperty(mh,
7134 spriteIndex,
7135 propertyType,
7136 propertyValue);
7137 _res = Py_BuildValue("l",
7138 _rv);
7139 return _res;
7142 static PyObject *Qt_SpriteMediaHitTestSprites(_self, _args)
7143 PyObject *_self;
7144 PyObject *_args;
7146 PyObject *_res = NULL;
7147 ComponentResult _rv;
7148 MediaHandler mh;
7149 long flags;
7150 Point loc;
7151 short spriteHitIndex;
7152 if (!PyArg_ParseTuple(_args, "O&lO&",
7153 CmpInstObj_Convert, &mh,
7154 &flags,
7155 PyMac_GetPoint, &loc))
7156 return NULL;
7157 _rv = SpriteMediaHitTestSprites(mh,
7158 flags,
7159 loc,
7160 &spriteHitIndex);
7161 _res = Py_BuildValue("lh",
7162 _rv,
7163 spriteHitIndex);
7164 return _res;
7167 static PyObject *Qt_SpriteMediaCountSprites(_self, _args)
7168 PyObject *_self;
7169 PyObject *_args;
7171 PyObject *_res = NULL;
7172 ComponentResult _rv;
7173 MediaHandler mh;
7174 short numSprites;
7175 if (!PyArg_ParseTuple(_args, "O&",
7176 CmpInstObj_Convert, &mh))
7177 return NULL;
7178 _rv = SpriteMediaCountSprites(mh,
7179 &numSprites);
7180 _res = Py_BuildValue("lh",
7181 _rv,
7182 numSprites);
7183 return _res;
7186 static PyObject *Qt_SpriteMediaCountImages(_self, _args)
7187 PyObject *_self;
7188 PyObject *_args;
7190 PyObject *_res = NULL;
7191 ComponentResult _rv;
7192 MediaHandler mh;
7193 short numImages;
7194 if (!PyArg_ParseTuple(_args, "O&",
7195 CmpInstObj_Convert, &mh))
7196 return NULL;
7197 _rv = SpriteMediaCountImages(mh,
7198 &numImages);
7199 _res = Py_BuildValue("lh",
7200 _rv,
7201 numImages);
7202 return _res;
7205 static PyObject *Qt_SpriteMediaGetIndImageDescription(_self, _args)
7206 PyObject *_self;
7207 PyObject *_args;
7209 PyObject *_res = NULL;
7210 ComponentResult _rv;
7211 MediaHandler mh;
7212 short imageIndex;
7213 ImageDescriptionHandle imageDescription;
7214 if (!PyArg_ParseTuple(_args, "O&hO&",
7215 CmpInstObj_Convert, &mh,
7216 &imageIndex,
7217 ResObj_Convert, &imageDescription))
7218 return NULL;
7219 _rv = SpriteMediaGetIndImageDescription(mh,
7220 imageIndex,
7221 imageDescription);
7222 _res = Py_BuildValue("l",
7223 _rv);
7224 return _res;
7227 static PyObject *Qt_SpriteMediaGetDisplayedSampleNumber(_self, _args)
7228 PyObject *_self;
7229 PyObject *_args;
7231 PyObject *_res = NULL;
7232 ComponentResult _rv;
7233 MediaHandler mh;
7234 long sampleNum;
7235 if (!PyArg_ParseTuple(_args, "O&",
7236 CmpInstObj_Convert, &mh))
7237 return NULL;
7238 _rv = SpriteMediaGetDisplayedSampleNumber(mh,
7239 &sampleNum);
7240 _res = Py_BuildValue("ll",
7241 _rv,
7242 sampleNum);
7243 return _res;
7246 static PyObject *Qt_SpriteMediaGetSpriteName(_self, _args)
7247 PyObject *_self;
7248 PyObject *_args;
7250 PyObject *_res = NULL;
7251 ComponentResult _rv;
7252 MediaHandler mh;
7253 QTAtomID spriteID;
7254 Str255 spriteName;
7255 if (!PyArg_ParseTuple(_args, "O&lO&",
7256 CmpInstObj_Convert, &mh,
7257 &spriteID,
7258 PyMac_GetStr255, spriteName))
7259 return NULL;
7260 _rv = SpriteMediaGetSpriteName(mh,
7261 spriteID,
7262 spriteName);
7263 _res = Py_BuildValue("l",
7264 _rv);
7265 return _res;
7268 static PyObject *Qt_SpriteMediaGetImageName(_self, _args)
7269 PyObject *_self;
7270 PyObject *_args;
7272 PyObject *_res = NULL;
7273 ComponentResult _rv;
7274 MediaHandler mh;
7275 short imageIndex;
7276 Str255 imageName;
7277 if (!PyArg_ParseTuple(_args, "O&hO&",
7278 CmpInstObj_Convert, &mh,
7279 &imageIndex,
7280 PyMac_GetStr255, imageName))
7281 return NULL;
7282 _rv = SpriteMediaGetImageName(mh,
7283 imageIndex,
7284 imageName);
7285 _res = Py_BuildValue("l",
7286 _rv);
7287 return _res;
7290 static PyObject *Qt_SpriteMediaSetSpriteProperty(_self, _args)
7291 PyObject *_self;
7292 PyObject *_args;
7294 PyObject *_res = NULL;
7295 ComponentResult _rv;
7296 MediaHandler mh;
7297 QTAtomID spriteID;
7298 long propertyType;
7299 void * propertyValue;
7300 if (!PyArg_ParseTuple(_args, "O&lls",
7301 CmpInstObj_Convert, &mh,
7302 &spriteID,
7303 &propertyType,
7304 &propertyValue))
7305 return NULL;
7306 _rv = SpriteMediaSetSpriteProperty(mh,
7307 spriteID,
7308 propertyType,
7309 propertyValue);
7310 _res = Py_BuildValue("l",
7311 _rv);
7312 return _res;
7315 static PyObject *Qt_SpriteMediaGetSpriteProperty(_self, _args)
7316 PyObject *_self;
7317 PyObject *_args;
7319 PyObject *_res = NULL;
7320 ComponentResult _rv;
7321 MediaHandler mh;
7322 QTAtomID spriteID;
7323 long propertyType;
7324 void * propertyValue;
7325 if (!PyArg_ParseTuple(_args, "O&lls",
7326 CmpInstObj_Convert, &mh,
7327 &spriteID,
7328 &propertyType,
7329 &propertyValue))
7330 return NULL;
7331 _rv = SpriteMediaGetSpriteProperty(mh,
7332 spriteID,
7333 propertyType,
7334 propertyValue);
7335 _res = Py_BuildValue("l",
7336 _rv);
7337 return _res;
7340 static PyObject *Qt_SpriteMediaHitTestAllSprites(_self, _args)
7341 PyObject *_self;
7342 PyObject *_args;
7344 PyObject *_res = NULL;
7345 ComponentResult _rv;
7346 MediaHandler mh;
7347 long flags;
7348 Point loc;
7349 QTAtomID spriteHitID;
7350 if (!PyArg_ParseTuple(_args, "O&lO&",
7351 CmpInstObj_Convert, &mh,
7352 &flags,
7353 PyMac_GetPoint, &loc))
7354 return NULL;
7355 _rv = SpriteMediaHitTestAllSprites(mh,
7356 flags,
7357 loc,
7358 &spriteHitID);
7359 _res = Py_BuildValue("ll",
7360 _rv,
7361 spriteHitID);
7362 return _res;
7365 static PyObject *Qt_SpriteMediaHitTestOneSprite(_self, _args)
7366 PyObject *_self;
7367 PyObject *_args;
7369 PyObject *_res = NULL;
7370 ComponentResult _rv;
7371 MediaHandler mh;
7372 QTAtomID spriteID;
7373 long flags;
7374 Point loc;
7375 Boolean wasHit;
7376 if (!PyArg_ParseTuple(_args, "O&llO&",
7377 CmpInstObj_Convert, &mh,
7378 &spriteID,
7379 &flags,
7380 PyMac_GetPoint, &loc))
7381 return NULL;
7382 _rv = SpriteMediaHitTestOneSprite(mh,
7383 spriteID,
7384 flags,
7385 loc,
7386 &wasHit);
7387 _res = Py_BuildValue("lb",
7388 _rv,
7389 wasHit);
7390 return _res;
7393 static PyObject *Qt_SpriteMediaSpriteIndexToID(_self, _args)
7394 PyObject *_self;
7395 PyObject *_args;
7397 PyObject *_res = NULL;
7398 ComponentResult _rv;
7399 MediaHandler mh;
7400 short spriteIndex;
7401 QTAtomID spriteID;
7402 if (!PyArg_ParseTuple(_args, "O&h",
7403 CmpInstObj_Convert, &mh,
7404 &spriteIndex))
7405 return NULL;
7406 _rv = SpriteMediaSpriteIndexToID(mh,
7407 spriteIndex,
7408 &spriteID);
7409 _res = Py_BuildValue("ll",
7410 _rv,
7411 spriteID);
7412 return _res;
7415 static PyObject *Qt_SpriteMediaSpriteIDToIndex(_self, _args)
7416 PyObject *_self;
7417 PyObject *_args;
7419 PyObject *_res = NULL;
7420 ComponentResult _rv;
7421 MediaHandler mh;
7422 QTAtomID spriteID;
7423 short spriteIndex;
7424 if (!PyArg_ParseTuple(_args, "O&l",
7425 CmpInstObj_Convert, &mh,
7426 &spriteID))
7427 return NULL;
7428 _rv = SpriteMediaSpriteIDToIndex(mh,
7429 spriteID,
7430 &spriteIndex);
7431 _res = Py_BuildValue("lh",
7432 _rv,
7433 spriteIndex);
7434 return _res;
7437 static PyObject *Qt_SpriteMediaSetActionVariable(_self, _args)
7438 PyObject *_self;
7439 PyObject *_args;
7441 PyObject *_res = NULL;
7442 ComponentResult _rv;
7443 MediaHandler mh;
7444 QTAtomID variableID;
7445 float value;
7446 if (!PyArg_ParseTuple(_args, "O&lf",
7447 CmpInstObj_Convert, &mh,
7448 &variableID,
7449 &value))
7450 return NULL;
7451 _rv = SpriteMediaSetActionVariable(mh,
7452 variableID,
7453 &value);
7454 _res = Py_BuildValue("l",
7455 _rv);
7456 return _res;
7459 static PyObject *Qt_SpriteMediaGetActionVariable(_self, _args)
7460 PyObject *_self;
7461 PyObject *_args;
7463 PyObject *_res = NULL;
7464 ComponentResult _rv;
7465 MediaHandler mh;
7466 QTAtomID variableID;
7467 float value;
7468 if (!PyArg_ParseTuple(_args, "O&l",
7469 CmpInstObj_Convert, &mh,
7470 &variableID))
7471 return NULL;
7472 _rv = SpriteMediaGetActionVariable(mh,
7473 variableID,
7474 &value);
7475 _res = Py_BuildValue("lf",
7476 _rv,
7477 value);
7478 return _res;
7481 static PyObject *Qt_SpriteMediaGetIndImageProperty(_self, _args)
7482 PyObject *_self;
7483 PyObject *_args;
7485 PyObject *_res = NULL;
7486 ComponentResult _rv;
7487 MediaHandler mh;
7488 short imageIndex;
7489 long imagePropertyType;
7490 void * imagePropertyValue;
7491 if (!PyArg_ParseTuple(_args, "O&hls",
7492 CmpInstObj_Convert, &mh,
7493 &imageIndex,
7494 &imagePropertyType,
7495 &imagePropertyValue))
7496 return NULL;
7497 _rv = SpriteMediaGetIndImageProperty(mh,
7498 imageIndex,
7499 imagePropertyType,
7500 imagePropertyValue);
7501 _res = Py_BuildValue("l",
7502 _rv);
7503 return _res;
7506 static PyObject *Qt_NewTimeBase(_self, _args)
7507 PyObject *_self;
7508 PyObject *_args;
7510 PyObject *_res = NULL;
7511 TimeBase _rv;
7512 if (!PyArg_ParseTuple(_args, ""))
7513 return NULL;
7514 _rv = NewTimeBase();
7515 _res = Py_BuildValue("O&",
7516 TimeBaseObj_New, _rv);
7517 return _res;
7520 static PyObject *Qt_ConvertTime(_self, _args)
7521 PyObject *_self;
7522 PyObject *_args;
7524 PyObject *_res = NULL;
7525 TimeRecord inout;
7526 TimeBase newBase;
7527 if (!PyArg_ParseTuple(_args, "O&",
7528 TimeBaseObj_Convert, &newBase))
7529 return NULL;
7530 ConvertTime(&inout,
7531 newBase);
7532 _res = Py_BuildValue("O&",
7533 QtTimeRecord_New, &inout);
7534 return _res;
7537 static PyObject *Qt_ConvertTimeScale(_self, _args)
7538 PyObject *_self;
7539 PyObject *_args;
7541 PyObject *_res = NULL;
7542 TimeRecord inout;
7543 TimeScale newScale;
7544 if (!PyArg_ParseTuple(_args, "l",
7545 &newScale))
7546 return NULL;
7547 ConvertTimeScale(&inout,
7548 newScale);
7549 _res = Py_BuildValue("O&",
7550 QtTimeRecord_New, &inout);
7551 return _res;
7554 static PyObject *Qt_AddTime(_self, _args)
7555 PyObject *_self;
7556 PyObject *_args;
7558 PyObject *_res = NULL;
7559 TimeRecord dst;
7560 TimeRecord src;
7561 if (!PyArg_ParseTuple(_args, "O&",
7562 QtTimeRecord_Convert, &src))
7563 return NULL;
7564 AddTime(&dst,
7565 &src);
7566 _res = Py_BuildValue("O&",
7567 QtTimeRecord_New, &dst);
7568 return _res;
7571 static PyObject *Qt_SubtractTime(_self, _args)
7572 PyObject *_self;
7573 PyObject *_args;
7575 PyObject *_res = NULL;
7576 TimeRecord dst;
7577 TimeRecord src;
7578 if (!PyArg_ParseTuple(_args, "O&",
7579 QtTimeRecord_Convert, &src))
7580 return NULL;
7581 SubtractTime(&dst,
7582 &src);
7583 _res = Py_BuildValue("O&",
7584 QtTimeRecord_New, &dst);
7585 return _res;
7588 static PyObject *Qt_MusicMediaGetIndexedTunePlayer(_self, _args)
7589 PyObject *_self;
7590 PyObject *_args;
7592 PyObject *_res = NULL;
7593 ComponentResult _rv;
7594 ComponentInstance ti;
7595 long sampleDescIndex;
7596 ComponentInstance tp;
7597 if (!PyArg_ParseTuple(_args, "O&l",
7598 CmpInstObj_Convert, &ti,
7599 &sampleDescIndex))
7600 return NULL;
7601 _rv = MusicMediaGetIndexedTunePlayer(ti,
7602 sampleDescIndex,
7603 &tp);
7604 _res = Py_BuildValue("lO&",
7605 _rv,
7606 CmpInstObj_New, tp);
7607 return _res;
7610 static PyObject *Qt_AlignWindow(_self, _args)
7611 PyObject *_self;
7612 PyObject *_args;
7614 PyObject *_res = NULL;
7615 WindowPtr wp;
7616 Boolean front;
7617 if (!PyArg_ParseTuple(_args, "O&b",
7618 WinObj_Convert, &wp,
7619 &front))
7620 return NULL;
7621 AlignWindow(wp,
7622 front,
7623 (Rect *)0,
7624 (ICMAlignmentProcRecordPtr)0);
7625 Py_INCREF(Py_None);
7626 _res = Py_None;
7627 return _res;
7630 static PyObject *Qt_DragAlignedWindow(_self, _args)
7631 PyObject *_self;
7632 PyObject *_args;
7634 PyObject *_res = NULL;
7635 WindowPtr wp;
7636 Point startPt;
7637 Rect boundsRect;
7638 if (!PyArg_ParseTuple(_args, "O&O&O&",
7639 WinObj_Convert, &wp,
7640 PyMac_GetPoint, &startPt,
7641 PyMac_GetRect, &boundsRect))
7642 return NULL;
7643 DragAlignedWindow(wp,
7644 startPt,
7645 &boundsRect,
7646 (Rect *)0,
7647 (ICMAlignmentProcRecordPtr)0);
7648 Py_INCREF(Py_None);
7649 _res = Py_None;
7650 return _res;
7653 static PyObject *Qt_MoviesTask(_self, _args)
7654 PyObject *_self;
7655 PyObject *_args;
7657 PyObject *_res = NULL;
7658 long maxMilliSecToUse;
7659 if (!PyArg_ParseTuple(_args, "l",
7660 &maxMilliSecToUse))
7661 return NULL;
7662 MoviesTask((Movie)0,
7663 maxMilliSecToUse);
7664 Py_INCREF(Py_None);
7665 _res = Py_None;
7666 return _res;
7669 static PyMethodDef Qt_methods[] = {
7670 {"EnterMovies", (PyCFunction)Qt_EnterMovies, 1,
7671 "() -> None"},
7672 {"ExitMovies", (PyCFunction)Qt_ExitMovies, 1,
7673 "() -> None"},
7674 {"GetMoviesError", (PyCFunction)Qt_GetMoviesError, 1,
7675 "() -> None"},
7676 {"ClearMoviesStickyError", (PyCFunction)Qt_ClearMoviesStickyError, 1,
7677 "() -> None"},
7678 {"GetMoviesStickyError", (PyCFunction)Qt_GetMoviesStickyError, 1,
7679 "() -> None"},
7680 {"DisposeMatte", (PyCFunction)Qt_DisposeMatte, 1,
7681 "(PixMapHandle theMatte) -> None"},
7682 {"NewMovie", (PyCFunction)Qt_NewMovie, 1,
7683 "(long flags) -> (Movie _rv)"},
7684 {"GetDataHandler", (PyCFunction)Qt_GetDataHandler, 1,
7685 "(Handle dataRef, OSType dataHandlerSubType, long flags) -> (Component _rv)"},
7686 {"PasteHandleIntoMovie", (PyCFunction)Qt_PasteHandleIntoMovie, 1,
7687 "(Handle h, OSType handleType, Movie theMovie, long flags, ComponentInstance userComp) -> None"},
7688 {"GetMovieImporterForDataRef", (PyCFunction)Qt_GetMovieImporterForDataRef, 1,
7689 "(OSType dataRefType, Handle dataRef, long flags) -> (Component importer)"},
7690 {"TrackTimeToMediaTime", (PyCFunction)Qt_TrackTimeToMediaTime, 1,
7691 "(TimeValue value, Track theTrack) -> (TimeValue _rv)"},
7692 {"NewUserData", (PyCFunction)Qt_NewUserData, 1,
7693 "() -> (UserData theUserData)"},
7694 {"NewUserDataFromHandle", (PyCFunction)Qt_NewUserDataFromHandle, 1,
7695 "(Handle h) -> (UserData theUserData)"},
7696 {"CreateMovieFile", (PyCFunction)Qt_CreateMovieFile, 1,
7697 "(FSSpec fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (short resRefNum, Movie newmovie)"},
7698 {"OpenMovieFile", (PyCFunction)Qt_OpenMovieFile, 1,
7699 "(FSSpec fileSpec, SInt8 permission) -> (short resRefNum)"},
7700 {"CloseMovieFile", (PyCFunction)Qt_CloseMovieFile, 1,
7701 "(short resRefNum) -> None"},
7702 {"DeleteMovieFile", (PyCFunction)Qt_DeleteMovieFile, 1,
7703 "(FSSpec fileSpec) -> None"},
7704 {"NewMovieFromFile", (PyCFunction)Qt_NewMovieFromFile, 1,
7705 "(short resRefNum, short resId, short newMovieFlags) -> (Movie theMovie, short resId, Boolean dataRefWasChanged)"},
7706 {"NewMovieFromHandle", (PyCFunction)Qt_NewMovieFromHandle, 1,
7707 "(Handle h, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
7708 {"NewMovieFromDataFork", (PyCFunction)Qt_NewMovieFromDataFork, 1,
7709 "(short fRefNum, long fileOffset, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
7710 {"NewMovieFromDataRef", (PyCFunction)Qt_NewMovieFromDataRef, 1,
7711 "(short flags, Handle dataRef, OSType dataRefType) -> (Movie m, short id)"},
7712 {"RemoveMovieResource", (PyCFunction)Qt_RemoveMovieResource, 1,
7713 "(short resRefNum, short resId) -> None"},
7714 {"NewMovieFromScrap", (PyCFunction)Qt_NewMovieFromScrap, 1,
7715 "(long newMovieFlags) -> (Movie _rv)"},
7716 {"QTNewAlias", (PyCFunction)Qt_QTNewAlias, 1,
7717 "(FSSpec fss, Boolean minimal) -> (AliasHandle alias)"},
7718 {"EndFullScreen", (PyCFunction)Qt_EndFullScreen, 1,
7719 "(Ptr fullState, long flags) -> None"},
7720 {"AddSoundDescriptionExtension", (PyCFunction)Qt_AddSoundDescriptionExtension, 1,
7721 "(SoundDescriptionHandle desc, Handle extension, OSType idType) -> None"},
7722 {"GetSoundDescriptionExtension", (PyCFunction)Qt_GetSoundDescriptionExtension, 1,
7723 "(SoundDescriptionHandle desc, OSType idType) -> (Handle extension)"},
7724 {"RemoveSoundDescriptionExtension", (PyCFunction)Qt_RemoveSoundDescriptionExtension, 1,
7725 "(SoundDescriptionHandle desc, OSType idType) -> None"},
7726 {"QTIsStandardParameterDialogEvent", (PyCFunction)Qt_QTIsStandardParameterDialogEvent, 1,
7727 "(QTParameterDialog createdDialog) -> (EventRecord pEvent)"},
7728 {"QTDismissStandardParameterDialog", (PyCFunction)Qt_QTDismissStandardParameterDialog, 1,
7729 "(QTParameterDialog createdDialog) -> None"},
7730 {"QTStandardParameterDialogDoAction", (PyCFunction)Qt_QTStandardParameterDialogDoAction, 1,
7731 "(QTParameterDialog createdDialog, long action, void * params) -> None"},
7732 {"QTRegisterAccessKey", (PyCFunction)Qt_QTRegisterAccessKey, 1,
7733 "(Str255 accessKeyType, long flags, Handle accessKey) -> None"},
7734 {"QTUnregisterAccessKey", (PyCFunction)Qt_QTUnregisterAccessKey, 1,
7735 "(Str255 accessKeyType, long flags, Handle accessKey) -> None"},
7736 {"QTTextToNativeText", (PyCFunction)Qt_QTTextToNativeText, 1,
7737 "(Handle theText, long encoding, long flags) -> None"},
7738 {"VideoMediaResetStatistics", (PyCFunction)Qt_VideoMediaResetStatistics, 1,
7739 "(MediaHandler mh) -> (ComponentResult _rv)"},
7740 {"VideoMediaGetStatistics", (PyCFunction)Qt_VideoMediaGetStatistics, 1,
7741 "(MediaHandler mh) -> (ComponentResult _rv)"},
7742 {"TextMediaAddTextSample", (PyCFunction)Qt_TextMediaAddTextSample, 1,
7743 "(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)"},
7744 {"TextMediaAddTESample", (PyCFunction)Qt_TextMediaAddTESample, 1,
7745 "(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)"},
7746 {"TextMediaAddHiliteSample", (PyCFunction)Qt_TextMediaAddHiliteSample, 1,
7747 "(MediaHandler mh, short hiliteStart, short hiliteEnd, TimeValue duration) -> (ComponentResult _rv, RGBColor rgbHiliteColor, TimeValue sampleTime)"},
7748 {"TextMediaFindNextText", (PyCFunction)Qt_TextMediaFindNextText, 1,
7749 "(MediaHandler mh, Ptr text, long size, short findFlags, TimeValue startTime) -> (ComponentResult _rv, TimeValue foundTime, TimeValue foundDuration, long offset)"},
7750 {"TextMediaHiliteTextSample", (PyCFunction)Qt_TextMediaHiliteTextSample, 1,
7751 "(MediaHandler mh, TimeValue sampleTime, short hiliteStart, short hiliteEnd) -> (ComponentResult _rv, RGBColor rgbHiliteColor)"},
7752 {"TextMediaSetTextSampleData", (PyCFunction)Qt_TextMediaSetTextSampleData, 1,
7753 "(MediaHandler mh, void * data, OSType dataType) -> (ComponentResult _rv)"},
7754 {"SpriteMediaSetProperty", (PyCFunction)Qt_SpriteMediaSetProperty, 1,
7755 "(MediaHandler mh, short spriteIndex, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
7756 {"SpriteMediaGetProperty", (PyCFunction)Qt_SpriteMediaGetProperty, 1,
7757 "(MediaHandler mh, short spriteIndex, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
7758 {"SpriteMediaHitTestSprites", (PyCFunction)Qt_SpriteMediaHitTestSprites, 1,
7759 "(MediaHandler mh, long flags, Point loc) -> (ComponentResult _rv, short spriteHitIndex)"},
7760 {"SpriteMediaCountSprites", (PyCFunction)Qt_SpriteMediaCountSprites, 1,
7761 "(MediaHandler mh) -> (ComponentResult _rv, short numSprites)"},
7762 {"SpriteMediaCountImages", (PyCFunction)Qt_SpriteMediaCountImages, 1,
7763 "(MediaHandler mh) -> (ComponentResult _rv, short numImages)"},
7764 {"SpriteMediaGetIndImageDescription", (PyCFunction)Qt_SpriteMediaGetIndImageDescription, 1,
7765 "(MediaHandler mh, short imageIndex, ImageDescriptionHandle imageDescription) -> (ComponentResult _rv)"},
7766 {"SpriteMediaGetDisplayedSampleNumber", (PyCFunction)Qt_SpriteMediaGetDisplayedSampleNumber, 1,
7767 "(MediaHandler mh) -> (ComponentResult _rv, long sampleNum)"},
7768 {"SpriteMediaGetSpriteName", (PyCFunction)Qt_SpriteMediaGetSpriteName, 1,
7769 "(MediaHandler mh, QTAtomID spriteID, Str255 spriteName) -> (ComponentResult _rv)"},
7770 {"SpriteMediaGetImageName", (PyCFunction)Qt_SpriteMediaGetImageName, 1,
7771 "(MediaHandler mh, short imageIndex, Str255 imageName) -> (ComponentResult _rv)"},
7772 {"SpriteMediaSetSpriteProperty", (PyCFunction)Qt_SpriteMediaSetSpriteProperty, 1,
7773 "(MediaHandler mh, QTAtomID spriteID, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
7774 {"SpriteMediaGetSpriteProperty", (PyCFunction)Qt_SpriteMediaGetSpriteProperty, 1,
7775 "(MediaHandler mh, QTAtomID spriteID, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
7776 {"SpriteMediaHitTestAllSprites", (PyCFunction)Qt_SpriteMediaHitTestAllSprites, 1,
7777 "(MediaHandler mh, long flags, Point loc) -> (ComponentResult _rv, QTAtomID spriteHitID)"},
7778 {"SpriteMediaHitTestOneSprite", (PyCFunction)Qt_SpriteMediaHitTestOneSprite, 1,
7779 "(MediaHandler mh, QTAtomID spriteID, long flags, Point loc) -> (ComponentResult _rv, Boolean wasHit)"},
7780 {"SpriteMediaSpriteIndexToID", (PyCFunction)Qt_SpriteMediaSpriteIndexToID, 1,
7781 "(MediaHandler mh, short spriteIndex) -> (ComponentResult _rv, QTAtomID spriteID)"},
7782 {"SpriteMediaSpriteIDToIndex", (PyCFunction)Qt_SpriteMediaSpriteIDToIndex, 1,
7783 "(MediaHandler mh, QTAtomID spriteID) -> (ComponentResult _rv, short spriteIndex)"},
7784 {"SpriteMediaSetActionVariable", (PyCFunction)Qt_SpriteMediaSetActionVariable, 1,
7785 "(MediaHandler mh, QTAtomID variableID, float value) -> (ComponentResult _rv)"},
7786 {"SpriteMediaGetActionVariable", (PyCFunction)Qt_SpriteMediaGetActionVariable, 1,
7787 "(MediaHandler mh, QTAtomID variableID) -> (ComponentResult _rv, float value)"},
7788 {"SpriteMediaGetIndImageProperty", (PyCFunction)Qt_SpriteMediaGetIndImageProperty, 1,
7789 "(MediaHandler mh, short imageIndex, long imagePropertyType, void * imagePropertyValue) -> (ComponentResult _rv)"},
7790 {"NewTimeBase", (PyCFunction)Qt_NewTimeBase, 1,
7791 "() -> (TimeBase _rv)"},
7792 {"ConvertTime", (PyCFunction)Qt_ConvertTime, 1,
7793 "(TimeBase newBase) -> (TimeRecord inout)"},
7794 {"ConvertTimeScale", (PyCFunction)Qt_ConvertTimeScale, 1,
7795 "(TimeScale newScale) -> (TimeRecord inout)"},
7796 {"AddTime", (PyCFunction)Qt_AddTime, 1,
7797 "(TimeRecord src) -> (TimeRecord dst)"},
7798 {"SubtractTime", (PyCFunction)Qt_SubtractTime, 1,
7799 "(TimeRecord src) -> (TimeRecord dst)"},
7800 {"MusicMediaGetIndexedTunePlayer", (PyCFunction)Qt_MusicMediaGetIndexedTunePlayer, 1,
7801 "(ComponentInstance ti, long sampleDescIndex) -> (ComponentResult _rv, ComponentInstance tp)"},
7802 {"AlignWindow", (PyCFunction)Qt_AlignWindow, 1,
7803 "(WindowPtr wp, Boolean front) -> None"},
7804 {"DragAlignedWindow", (PyCFunction)Qt_DragAlignedWindow, 1,
7805 "(WindowPtr wp, Point startPt, Rect boundsRect) -> None"},
7806 {"MoviesTask", (PyCFunction)Qt_MoviesTask, 1,
7807 "(long maxMilliSecToUse) -> None"},
7808 {NULL, NULL, 0}
7814 void initQt()
7816 PyObject *m;
7817 PyObject *d;
7822 m = Py_InitModule("Qt", Qt_methods);
7823 d = PyModule_GetDict(m);
7824 Qt_Error = PyMac_GetOSErrException();
7825 if (Qt_Error == NULL ||
7826 PyDict_SetItemString(d, "Error", Qt_Error) != 0)
7827 Py_FatalError("can't initialize Qt.Error");
7828 MovieController_Type.ob_type = &PyType_Type;
7829 Py_INCREF(&MovieController_Type);
7830 if (PyDict_SetItemString(d, "MovieControllerType", (PyObject *)&MovieController_Type) != 0)
7831 Py_FatalError("can't initialize MovieControllerType");
7832 TimeBase_Type.ob_type = &PyType_Type;
7833 Py_INCREF(&TimeBase_Type);
7834 if (PyDict_SetItemString(d, "TimeBaseType", (PyObject *)&TimeBase_Type) != 0)
7835 Py_FatalError("can't initialize TimeBaseType");
7836 UserData_Type.ob_type = &PyType_Type;
7837 Py_INCREF(&UserData_Type);
7838 if (PyDict_SetItemString(d, "UserDataType", (PyObject *)&UserData_Type) != 0)
7839 Py_FatalError("can't initialize UserDataType");
7840 Media_Type.ob_type = &PyType_Type;
7841 Py_INCREF(&Media_Type);
7842 if (PyDict_SetItemString(d, "MediaType", (PyObject *)&Media_Type) != 0)
7843 Py_FatalError("can't initialize MediaType");
7844 Track_Type.ob_type = &PyType_Type;
7845 Py_INCREF(&Track_Type);
7846 if (PyDict_SetItemString(d, "TrackType", (PyObject *)&Track_Type) != 0)
7847 Py_FatalError("can't initialize TrackType");
7848 Movie_Type.ob_type = &PyType_Type;
7849 Py_INCREF(&Movie_Type);
7850 if (PyDict_SetItemString(d, "MovieType", (PyObject *)&Movie_Type) != 0)
7851 Py_FatalError("can't initialize MovieType");
7854 /* ========================= End module Qt ========================== */