Allow comment characters (#) to be escaped:
[python/dscho.git] / Mac / Modules / qt / Qtmodule.c
blob628a72c5f0c759bb149fc8be391f2ebe7f87d01d
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 #define MovieCtlObj_compare NULL
1026 #define MovieCtlObj_repr NULL
1028 #define MovieCtlObj_hash NULL
1030 PyTypeObject MovieController_Type = {
1031 PyObject_HEAD_INIT(&PyType_Type)
1032 0, /*ob_size*/
1033 "MovieController", /*tp_name*/
1034 sizeof(MovieControllerObject), /*tp_basicsize*/
1035 0, /*tp_itemsize*/
1036 /* methods */
1037 (destructor) MovieCtlObj_dealloc, /*tp_dealloc*/
1038 0, /*tp_print*/
1039 (getattrfunc) MovieCtlObj_getattr, /*tp_getattr*/
1040 (setattrfunc) MovieCtlObj_setattr, /*tp_setattr*/
1041 (cmpfunc) MovieCtlObj_compare, /*tp_compare*/
1042 (reprfunc) MovieCtlObj_repr, /*tp_repr*/
1043 (PyNumberMethods *)0, /* tp_as_number */
1044 (PySequenceMethods *)0, /* tp_as_sequence */
1045 (PyMappingMethods *)0, /* tp_as_mapping */
1046 (hashfunc) MovieCtlObj_hash, /*tp_hash*/
1049 /* ---------------- End object type MovieController ----------------- */
1052 /* ---------------------- Object type TimeBase ---------------------- */
1054 PyTypeObject TimeBase_Type;
1056 #define TimeBaseObj_Check(x) ((x)->ob_type == &TimeBase_Type)
1058 typedef struct TimeBaseObject {
1059 PyObject_HEAD
1060 TimeBase ob_itself;
1061 } TimeBaseObject;
1063 PyObject *TimeBaseObj_New(itself)
1064 TimeBase itself;
1066 TimeBaseObject *it;
1067 if (itself == NULL) {
1068 PyErr_SetString(Qt_Error,"Cannot create null TimeBase");
1069 return NULL;
1071 it = PyObject_NEW(TimeBaseObject, &TimeBase_Type);
1072 if (it == NULL) return NULL;
1073 it->ob_itself = itself;
1074 return (PyObject *)it;
1076 TimeBaseObj_Convert(v, p_itself)
1077 PyObject *v;
1078 TimeBase *p_itself;
1080 if (!TimeBaseObj_Check(v))
1082 PyErr_SetString(PyExc_TypeError, "TimeBase required");
1083 return 0;
1085 *p_itself = ((TimeBaseObject *)v)->ob_itself;
1086 return 1;
1089 static void TimeBaseObj_dealloc(self)
1090 TimeBaseObject *self;
1092 /* Cleanup of self->ob_itself goes here */
1093 PyMem_DEL(self);
1096 static PyObject *TimeBaseObj_DisposeTimeBase(_self, _args)
1097 TimeBaseObject *_self;
1098 PyObject *_args;
1100 PyObject *_res = NULL;
1101 if (!PyArg_ParseTuple(_args, ""))
1102 return NULL;
1103 DisposeTimeBase(_self->ob_itself);
1104 Py_INCREF(Py_None);
1105 _res = Py_None;
1106 return _res;
1109 static PyObject *TimeBaseObj_GetTimeBaseTime(_self, _args)
1110 TimeBaseObject *_self;
1111 PyObject *_args;
1113 PyObject *_res = NULL;
1114 TimeValue _rv;
1115 TimeScale s;
1116 TimeRecord tr;
1117 if (!PyArg_ParseTuple(_args, "l",
1118 &s))
1119 return NULL;
1120 _rv = GetTimeBaseTime(_self->ob_itself,
1122 &tr);
1123 _res = Py_BuildValue("lO&",
1124 _rv,
1125 QtTimeRecord_New, &tr);
1126 return _res;
1129 static PyObject *TimeBaseObj_SetTimeBaseTime(_self, _args)
1130 TimeBaseObject *_self;
1131 PyObject *_args;
1133 PyObject *_res = NULL;
1134 TimeRecord tr;
1135 if (!PyArg_ParseTuple(_args, "O&",
1136 QtTimeRecord_Convert, &tr))
1137 return NULL;
1138 SetTimeBaseTime(_self->ob_itself,
1139 &tr);
1140 Py_INCREF(Py_None);
1141 _res = Py_None;
1142 return _res;
1145 static PyObject *TimeBaseObj_SetTimeBaseValue(_self, _args)
1146 TimeBaseObject *_self;
1147 PyObject *_args;
1149 PyObject *_res = NULL;
1150 TimeValue t;
1151 TimeScale s;
1152 if (!PyArg_ParseTuple(_args, "ll",
1154 &s))
1155 return NULL;
1156 SetTimeBaseValue(_self->ob_itself,
1159 Py_INCREF(Py_None);
1160 _res = Py_None;
1161 return _res;
1164 static PyObject *TimeBaseObj_GetTimeBaseRate(_self, _args)
1165 TimeBaseObject *_self;
1166 PyObject *_args;
1168 PyObject *_res = NULL;
1169 Fixed _rv;
1170 if (!PyArg_ParseTuple(_args, ""))
1171 return NULL;
1172 _rv = GetTimeBaseRate(_self->ob_itself);
1173 _res = Py_BuildValue("O&",
1174 PyMac_BuildFixed, _rv);
1175 return _res;
1178 static PyObject *TimeBaseObj_SetTimeBaseRate(_self, _args)
1179 TimeBaseObject *_self;
1180 PyObject *_args;
1182 PyObject *_res = NULL;
1183 Fixed r;
1184 if (!PyArg_ParseTuple(_args, "O&",
1185 PyMac_GetFixed, &r))
1186 return NULL;
1187 SetTimeBaseRate(_self->ob_itself,
1189 Py_INCREF(Py_None);
1190 _res = Py_None;
1191 return _res;
1194 static PyObject *TimeBaseObj_GetTimeBaseStartTime(_self, _args)
1195 TimeBaseObject *_self;
1196 PyObject *_args;
1198 PyObject *_res = NULL;
1199 TimeValue _rv;
1200 TimeScale s;
1201 TimeRecord tr;
1202 if (!PyArg_ParseTuple(_args, "l",
1203 &s))
1204 return NULL;
1205 _rv = GetTimeBaseStartTime(_self->ob_itself,
1207 &tr);
1208 _res = Py_BuildValue("lO&",
1209 _rv,
1210 QtTimeRecord_New, &tr);
1211 return _res;
1214 static PyObject *TimeBaseObj_SetTimeBaseStartTime(_self, _args)
1215 TimeBaseObject *_self;
1216 PyObject *_args;
1218 PyObject *_res = NULL;
1219 TimeRecord tr;
1220 if (!PyArg_ParseTuple(_args, "O&",
1221 QtTimeRecord_Convert, &tr))
1222 return NULL;
1223 SetTimeBaseStartTime(_self->ob_itself,
1224 &tr);
1225 Py_INCREF(Py_None);
1226 _res = Py_None;
1227 return _res;
1230 static PyObject *TimeBaseObj_GetTimeBaseStopTime(_self, _args)
1231 TimeBaseObject *_self;
1232 PyObject *_args;
1234 PyObject *_res = NULL;
1235 TimeValue _rv;
1236 TimeScale s;
1237 TimeRecord tr;
1238 if (!PyArg_ParseTuple(_args, "l",
1239 &s))
1240 return NULL;
1241 _rv = GetTimeBaseStopTime(_self->ob_itself,
1243 &tr);
1244 _res = Py_BuildValue("lO&",
1245 _rv,
1246 QtTimeRecord_New, &tr);
1247 return _res;
1250 static PyObject *TimeBaseObj_SetTimeBaseStopTime(_self, _args)
1251 TimeBaseObject *_self;
1252 PyObject *_args;
1254 PyObject *_res = NULL;
1255 TimeRecord tr;
1256 if (!PyArg_ParseTuple(_args, "O&",
1257 QtTimeRecord_Convert, &tr))
1258 return NULL;
1259 SetTimeBaseStopTime(_self->ob_itself,
1260 &tr);
1261 Py_INCREF(Py_None);
1262 _res = Py_None;
1263 return _res;
1266 static PyObject *TimeBaseObj_GetTimeBaseFlags(_self, _args)
1267 TimeBaseObject *_self;
1268 PyObject *_args;
1270 PyObject *_res = NULL;
1271 long _rv;
1272 if (!PyArg_ParseTuple(_args, ""))
1273 return NULL;
1274 _rv = GetTimeBaseFlags(_self->ob_itself);
1275 _res = Py_BuildValue("l",
1276 _rv);
1277 return _res;
1280 static PyObject *TimeBaseObj_SetTimeBaseFlags(_self, _args)
1281 TimeBaseObject *_self;
1282 PyObject *_args;
1284 PyObject *_res = NULL;
1285 long timeBaseFlags;
1286 if (!PyArg_ParseTuple(_args, "l",
1287 &timeBaseFlags))
1288 return NULL;
1289 SetTimeBaseFlags(_self->ob_itself,
1290 timeBaseFlags);
1291 Py_INCREF(Py_None);
1292 _res = Py_None;
1293 return _res;
1296 static PyObject *TimeBaseObj_SetTimeBaseMasterTimeBase(_self, _args)
1297 TimeBaseObject *_self;
1298 PyObject *_args;
1300 PyObject *_res = NULL;
1301 TimeBase master;
1302 TimeRecord slaveZero;
1303 if (!PyArg_ParseTuple(_args, "O&O&",
1304 TimeBaseObj_Convert, &master,
1305 QtTimeRecord_Convert, &slaveZero))
1306 return NULL;
1307 SetTimeBaseMasterTimeBase(_self->ob_itself,
1308 master,
1309 &slaveZero);
1310 Py_INCREF(Py_None);
1311 _res = Py_None;
1312 return _res;
1315 static PyObject *TimeBaseObj_GetTimeBaseMasterTimeBase(_self, _args)
1316 TimeBaseObject *_self;
1317 PyObject *_args;
1319 PyObject *_res = NULL;
1320 TimeBase _rv;
1321 if (!PyArg_ParseTuple(_args, ""))
1322 return NULL;
1323 _rv = GetTimeBaseMasterTimeBase(_self->ob_itself);
1324 _res = Py_BuildValue("O&",
1325 TimeBaseObj_New, _rv);
1326 return _res;
1329 static PyObject *TimeBaseObj_SetTimeBaseMasterClock(_self, _args)
1330 TimeBaseObject *_self;
1331 PyObject *_args;
1333 PyObject *_res = NULL;
1334 Component clockMeister;
1335 TimeRecord slaveZero;
1336 if (!PyArg_ParseTuple(_args, "O&O&",
1337 CmpObj_Convert, &clockMeister,
1338 QtTimeRecord_Convert, &slaveZero))
1339 return NULL;
1340 SetTimeBaseMasterClock(_self->ob_itself,
1341 clockMeister,
1342 &slaveZero);
1343 Py_INCREF(Py_None);
1344 _res = Py_None;
1345 return _res;
1348 static PyObject *TimeBaseObj_GetTimeBaseMasterClock(_self, _args)
1349 TimeBaseObject *_self;
1350 PyObject *_args;
1352 PyObject *_res = NULL;
1353 ComponentInstance _rv;
1354 if (!PyArg_ParseTuple(_args, ""))
1355 return NULL;
1356 _rv = GetTimeBaseMasterClock(_self->ob_itself);
1357 _res = Py_BuildValue("O&",
1358 CmpInstObj_New, _rv);
1359 return _res;
1362 static PyObject *TimeBaseObj_GetTimeBaseStatus(_self, _args)
1363 TimeBaseObject *_self;
1364 PyObject *_args;
1366 PyObject *_res = NULL;
1367 long _rv;
1368 TimeRecord unpinnedTime;
1369 if (!PyArg_ParseTuple(_args, ""))
1370 return NULL;
1371 _rv = GetTimeBaseStatus(_self->ob_itself,
1372 &unpinnedTime);
1373 _res = Py_BuildValue("lO&",
1374 _rv,
1375 QtTimeRecord_New, &unpinnedTime);
1376 return _res;
1379 static PyObject *TimeBaseObj_SetTimeBaseZero(_self, _args)
1380 TimeBaseObject *_self;
1381 PyObject *_args;
1383 PyObject *_res = NULL;
1384 TimeRecord zero;
1385 if (!PyArg_ParseTuple(_args, ""))
1386 return NULL;
1387 SetTimeBaseZero(_self->ob_itself,
1388 &zero);
1389 _res = Py_BuildValue("O&",
1390 QtTimeRecord_New, &zero);
1391 return _res;
1394 static PyObject *TimeBaseObj_GetTimeBaseEffectiveRate(_self, _args)
1395 TimeBaseObject *_self;
1396 PyObject *_args;
1398 PyObject *_res = NULL;
1399 Fixed _rv;
1400 if (!PyArg_ParseTuple(_args, ""))
1401 return NULL;
1402 _rv = GetTimeBaseEffectiveRate(_self->ob_itself);
1403 _res = Py_BuildValue("O&",
1404 PyMac_BuildFixed, _rv);
1405 return _res;
1408 static PyMethodDef TimeBaseObj_methods[] = {
1409 {"DisposeTimeBase", (PyCFunction)TimeBaseObj_DisposeTimeBase, 1,
1410 "() -> None"},
1411 {"GetTimeBaseTime", (PyCFunction)TimeBaseObj_GetTimeBaseTime, 1,
1412 "(TimeScale s) -> (TimeValue _rv, TimeRecord tr)"},
1413 {"SetTimeBaseTime", (PyCFunction)TimeBaseObj_SetTimeBaseTime, 1,
1414 "(TimeRecord tr) -> None"},
1415 {"SetTimeBaseValue", (PyCFunction)TimeBaseObj_SetTimeBaseValue, 1,
1416 "(TimeValue t, TimeScale s) -> None"},
1417 {"GetTimeBaseRate", (PyCFunction)TimeBaseObj_GetTimeBaseRate, 1,
1418 "() -> (Fixed _rv)"},
1419 {"SetTimeBaseRate", (PyCFunction)TimeBaseObj_SetTimeBaseRate, 1,
1420 "(Fixed r) -> None"},
1421 {"GetTimeBaseStartTime", (PyCFunction)TimeBaseObj_GetTimeBaseStartTime, 1,
1422 "(TimeScale s) -> (TimeValue _rv, TimeRecord tr)"},
1423 {"SetTimeBaseStartTime", (PyCFunction)TimeBaseObj_SetTimeBaseStartTime, 1,
1424 "(TimeRecord tr) -> None"},
1425 {"GetTimeBaseStopTime", (PyCFunction)TimeBaseObj_GetTimeBaseStopTime, 1,
1426 "(TimeScale s) -> (TimeValue _rv, TimeRecord tr)"},
1427 {"SetTimeBaseStopTime", (PyCFunction)TimeBaseObj_SetTimeBaseStopTime, 1,
1428 "(TimeRecord tr) -> None"},
1429 {"GetTimeBaseFlags", (PyCFunction)TimeBaseObj_GetTimeBaseFlags, 1,
1430 "() -> (long _rv)"},
1431 {"SetTimeBaseFlags", (PyCFunction)TimeBaseObj_SetTimeBaseFlags, 1,
1432 "(long timeBaseFlags) -> None"},
1433 {"SetTimeBaseMasterTimeBase", (PyCFunction)TimeBaseObj_SetTimeBaseMasterTimeBase, 1,
1434 "(TimeBase master, TimeRecord slaveZero) -> None"},
1435 {"GetTimeBaseMasterTimeBase", (PyCFunction)TimeBaseObj_GetTimeBaseMasterTimeBase, 1,
1436 "() -> (TimeBase _rv)"},
1437 {"SetTimeBaseMasterClock", (PyCFunction)TimeBaseObj_SetTimeBaseMasterClock, 1,
1438 "(Component clockMeister, TimeRecord slaveZero) -> None"},
1439 {"GetTimeBaseMasterClock", (PyCFunction)TimeBaseObj_GetTimeBaseMasterClock, 1,
1440 "() -> (ComponentInstance _rv)"},
1441 {"GetTimeBaseStatus", (PyCFunction)TimeBaseObj_GetTimeBaseStatus, 1,
1442 "() -> (long _rv, TimeRecord unpinnedTime)"},
1443 {"SetTimeBaseZero", (PyCFunction)TimeBaseObj_SetTimeBaseZero, 1,
1444 "() -> (TimeRecord zero)"},
1445 {"GetTimeBaseEffectiveRate", (PyCFunction)TimeBaseObj_GetTimeBaseEffectiveRate, 1,
1446 "() -> (Fixed _rv)"},
1447 {NULL, NULL, 0}
1450 PyMethodChain TimeBaseObj_chain = { TimeBaseObj_methods, NULL };
1452 static PyObject *TimeBaseObj_getattr(self, name)
1453 TimeBaseObject *self;
1454 char *name;
1456 return Py_FindMethodInChain(&TimeBaseObj_chain, (PyObject *)self, name);
1459 #define TimeBaseObj_setattr NULL
1461 #define TimeBaseObj_compare NULL
1463 #define TimeBaseObj_repr NULL
1465 #define TimeBaseObj_hash NULL
1467 PyTypeObject TimeBase_Type = {
1468 PyObject_HEAD_INIT(&PyType_Type)
1469 0, /*ob_size*/
1470 "TimeBase", /*tp_name*/
1471 sizeof(TimeBaseObject), /*tp_basicsize*/
1472 0, /*tp_itemsize*/
1473 /* methods */
1474 (destructor) TimeBaseObj_dealloc, /*tp_dealloc*/
1475 0, /*tp_print*/
1476 (getattrfunc) TimeBaseObj_getattr, /*tp_getattr*/
1477 (setattrfunc) TimeBaseObj_setattr, /*tp_setattr*/
1478 (cmpfunc) TimeBaseObj_compare, /*tp_compare*/
1479 (reprfunc) TimeBaseObj_repr, /*tp_repr*/
1480 (PyNumberMethods *)0, /* tp_as_number */
1481 (PySequenceMethods *)0, /* tp_as_sequence */
1482 (PyMappingMethods *)0, /* tp_as_mapping */
1483 (hashfunc) TimeBaseObj_hash, /*tp_hash*/
1486 /* -------------------- End object type TimeBase -------------------- */
1489 /* ---------------------- Object type UserData ---------------------- */
1491 PyTypeObject UserData_Type;
1493 #define UserDataObj_Check(x) ((x)->ob_type == &UserData_Type)
1495 typedef struct UserDataObject {
1496 PyObject_HEAD
1497 UserData ob_itself;
1498 } UserDataObject;
1500 PyObject *UserDataObj_New(itself)
1501 UserData itself;
1503 UserDataObject *it;
1504 if (itself == NULL) {
1505 PyErr_SetString(Qt_Error,"Cannot create null UserData");
1506 return NULL;
1508 it = PyObject_NEW(UserDataObject, &UserData_Type);
1509 if (it == NULL) return NULL;
1510 it->ob_itself = itself;
1511 return (PyObject *)it;
1513 UserDataObj_Convert(v, p_itself)
1514 PyObject *v;
1515 UserData *p_itself;
1517 if (!UserDataObj_Check(v))
1519 PyErr_SetString(PyExc_TypeError, "UserData required");
1520 return 0;
1522 *p_itself = ((UserDataObject *)v)->ob_itself;
1523 return 1;
1526 static void UserDataObj_dealloc(self)
1527 UserDataObject *self;
1529 DisposeUserData(self->ob_itself);
1530 PyMem_DEL(self);
1533 static PyObject *UserDataObj_GetUserData(_self, _args)
1534 UserDataObject *_self;
1535 PyObject *_args;
1537 PyObject *_res = NULL;
1538 OSErr _err;
1539 Handle data;
1540 OSType udType;
1541 long index;
1542 if (!PyArg_ParseTuple(_args, "O&O&l",
1543 ResObj_Convert, &data,
1544 PyMac_GetOSType, &udType,
1545 &index))
1546 return NULL;
1547 _err = GetUserData(_self->ob_itself,
1548 data,
1549 udType,
1550 index);
1551 if (_err != noErr) return PyMac_Error(_err);
1552 Py_INCREF(Py_None);
1553 _res = Py_None;
1554 return _res;
1557 static PyObject *UserDataObj_AddUserData(_self, _args)
1558 UserDataObject *_self;
1559 PyObject *_args;
1561 PyObject *_res = NULL;
1562 OSErr _err;
1563 Handle data;
1564 OSType udType;
1565 if (!PyArg_ParseTuple(_args, "O&O&",
1566 ResObj_Convert, &data,
1567 PyMac_GetOSType, &udType))
1568 return NULL;
1569 _err = AddUserData(_self->ob_itself,
1570 data,
1571 udType);
1572 if (_err != noErr) return PyMac_Error(_err);
1573 Py_INCREF(Py_None);
1574 _res = Py_None;
1575 return _res;
1578 static PyObject *UserDataObj_RemoveUserData(_self, _args)
1579 UserDataObject *_self;
1580 PyObject *_args;
1582 PyObject *_res = NULL;
1583 OSErr _err;
1584 OSType udType;
1585 long index;
1586 if (!PyArg_ParseTuple(_args, "O&l",
1587 PyMac_GetOSType, &udType,
1588 &index))
1589 return NULL;
1590 _err = RemoveUserData(_self->ob_itself,
1591 udType,
1592 index);
1593 if (_err != noErr) return PyMac_Error(_err);
1594 Py_INCREF(Py_None);
1595 _res = Py_None;
1596 return _res;
1599 static PyObject *UserDataObj_CountUserDataType(_self, _args)
1600 UserDataObject *_self;
1601 PyObject *_args;
1603 PyObject *_res = NULL;
1604 short _rv;
1605 OSType udType;
1606 if (!PyArg_ParseTuple(_args, "O&",
1607 PyMac_GetOSType, &udType))
1608 return NULL;
1609 _rv = CountUserDataType(_self->ob_itself,
1610 udType);
1611 _res = Py_BuildValue("h",
1612 _rv);
1613 return _res;
1616 static PyObject *UserDataObj_GetNextUserDataType(_self, _args)
1617 UserDataObject *_self;
1618 PyObject *_args;
1620 PyObject *_res = NULL;
1621 long _rv;
1622 OSType udType;
1623 if (!PyArg_ParseTuple(_args, "O&",
1624 PyMac_GetOSType, &udType))
1625 return NULL;
1626 _rv = GetNextUserDataType(_self->ob_itself,
1627 udType);
1628 _res = Py_BuildValue("l",
1629 _rv);
1630 return _res;
1633 static PyObject *UserDataObj_AddUserDataText(_self, _args)
1634 UserDataObject *_self;
1635 PyObject *_args;
1637 PyObject *_res = NULL;
1638 OSErr _err;
1639 Handle data;
1640 OSType udType;
1641 long index;
1642 short itlRegionTag;
1643 if (!PyArg_ParseTuple(_args, "O&O&lh",
1644 ResObj_Convert, &data,
1645 PyMac_GetOSType, &udType,
1646 &index,
1647 &itlRegionTag))
1648 return NULL;
1649 _err = AddUserDataText(_self->ob_itself,
1650 data,
1651 udType,
1652 index,
1653 itlRegionTag);
1654 if (_err != noErr) return PyMac_Error(_err);
1655 Py_INCREF(Py_None);
1656 _res = Py_None;
1657 return _res;
1660 static PyObject *UserDataObj_GetUserDataText(_self, _args)
1661 UserDataObject *_self;
1662 PyObject *_args;
1664 PyObject *_res = NULL;
1665 OSErr _err;
1666 Handle data;
1667 OSType udType;
1668 long index;
1669 short itlRegionTag;
1670 if (!PyArg_ParseTuple(_args, "O&O&lh",
1671 ResObj_Convert, &data,
1672 PyMac_GetOSType, &udType,
1673 &index,
1674 &itlRegionTag))
1675 return NULL;
1676 _err = GetUserDataText(_self->ob_itself,
1677 data,
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_RemoveUserDataText(_self, _args)
1688 UserDataObject *_self;
1689 PyObject *_args;
1691 PyObject *_res = NULL;
1692 OSErr _err;
1693 OSType udType;
1694 long index;
1695 short itlRegionTag;
1696 if (!PyArg_ParseTuple(_args, "O&lh",
1697 PyMac_GetOSType, &udType,
1698 &index,
1699 &itlRegionTag))
1700 return NULL;
1701 _err = RemoveUserDataText(_self->ob_itself,
1702 udType,
1703 index,
1704 itlRegionTag);
1705 if (_err != noErr) return PyMac_Error(_err);
1706 Py_INCREF(Py_None);
1707 _res = Py_None;
1708 return _res;
1711 static PyObject *UserDataObj_PutUserDataIntoHandle(_self, _args)
1712 UserDataObject *_self;
1713 PyObject *_args;
1715 PyObject *_res = NULL;
1716 OSErr _err;
1717 Handle h;
1718 if (!PyArg_ParseTuple(_args, "O&",
1719 ResObj_Convert, &h))
1720 return NULL;
1721 _err = PutUserDataIntoHandle(_self->ob_itself,
1723 if (_err != noErr) return PyMac_Error(_err);
1724 Py_INCREF(Py_None);
1725 _res = Py_None;
1726 return _res;
1729 static PyMethodDef UserDataObj_methods[] = {
1730 {"GetUserData", (PyCFunction)UserDataObj_GetUserData, 1,
1731 "(Handle data, OSType udType, long index) -> None"},
1732 {"AddUserData", (PyCFunction)UserDataObj_AddUserData, 1,
1733 "(Handle data, OSType udType) -> None"},
1734 {"RemoveUserData", (PyCFunction)UserDataObj_RemoveUserData, 1,
1735 "(OSType udType, long index) -> None"},
1736 {"CountUserDataType", (PyCFunction)UserDataObj_CountUserDataType, 1,
1737 "(OSType udType) -> (short _rv)"},
1738 {"GetNextUserDataType", (PyCFunction)UserDataObj_GetNextUserDataType, 1,
1739 "(OSType udType) -> (long _rv)"},
1740 {"AddUserDataText", (PyCFunction)UserDataObj_AddUserDataText, 1,
1741 "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
1742 {"GetUserDataText", (PyCFunction)UserDataObj_GetUserDataText, 1,
1743 "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
1744 {"RemoveUserDataText", (PyCFunction)UserDataObj_RemoveUserDataText, 1,
1745 "(OSType udType, long index, short itlRegionTag) -> None"},
1746 {"PutUserDataIntoHandle", (PyCFunction)UserDataObj_PutUserDataIntoHandle, 1,
1747 "(Handle h) -> None"},
1748 {NULL, NULL, 0}
1751 PyMethodChain UserDataObj_chain = { UserDataObj_methods, NULL };
1753 static PyObject *UserDataObj_getattr(self, name)
1754 UserDataObject *self;
1755 char *name;
1757 return Py_FindMethodInChain(&UserDataObj_chain, (PyObject *)self, name);
1760 #define UserDataObj_setattr NULL
1762 #define UserDataObj_compare NULL
1764 #define UserDataObj_repr NULL
1766 #define UserDataObj_hash NULL
1768 PyTypeObject UserData_Type = {
1769 PyObject_HEAD_INIT(&PyType_Type)
1770 0, /*ob_size*/
1771 "UserData", /*tp_name*/
1772 sizeof(UserDataObject), /*tp_basicsize*/
1773 0, /*tp_itemsize*/
1774 /* methods */
1775 (destructor) UserDataObj_dealloc, /*tp_dealloc*/
1776 0, /*tp_print*/
1777 (getattrfunc) UserDataObj_getattr, /*tp_getattr*/
1778 (setattrfunc) UserDataObj_setattr, /*tp_setattr*/
1779 (cmpfunc) UserDataObj_compare, /*tp_compare*/
1780 (reprfunc) UserDataObj_repr, /*tp_repr*/
1781 (PyNumberMethods *)0, /* tp_as_number */
1782 (PySequenceMethods *)0, /* tp_as_sequence */
1783 (PyMappingMethods *)0, /* tp_as_mapping */
1784 (hashfunc) UserDataObj_hash, /*tp_hash*/
1787 /* -------------------- End object type UserData -------------------- */
1790 /* ----------------------- Object type Media ------------------------ */
1792 PyTypeObject Media_Type;
1794 #define MediaObj_Check(x) ((x)->ob_type == &Media_Type)
1796 typedef struct MediaObject {
1797 PyObject_HEAD
1798 Media ob_itself;
1799 } MediaObject;
1801 PyObject *MediaObj_New(itself)
1802 Media itself;
1804 MediaObject *it;
1805 if (itself == NULL) {
1806 PyErr_SetString(Qt_Error,"Cannot create null Media");
1807 return NULL;
1809 it = PyObject_NEW(MediaObject, &Media_Type);
1810 if (it == NULL) return NULL;
1811 it->ob_itself = itself;
1812 return (PyObject *)it;
1814 MediaObj_Convert(v, p_itself)
1815 PyObject *v;
1816 Media *p_itself;
1818 if (!MediaObj_Check(v))
1820 PyErr_SetString(PyExc_TypeError, "Media required");
1821 return 0;
1823 *p_itself = ((MediaObject *)v)->ob_itself;
1824 return 1;
1827 static void MediaObj_dealloc(self)
1828 MediaObject *self;
1830 DisposeTrackMedia(self->ob_itself);
1831 PyMem_DEL(self);
1834 static PyObject *MediaObj_LoadMediaIntoRam(_self, _args)
1835 MediaObject *_self;
1836 PyObject *_args;
1838 PyObject *_res = NULL;
1839 OSErr _err;
1840 TimeValue time;
1841 TimeValue duration;
1842 long flags;
1843 if (!PyArg_ParseTuple(_args, "lll",
1844 &time,
1845 &duration,
1846 &flags))
1847 return NULL;
1848 _err = LoadMediaIntoRam(_self->ob_itself,
1849 time,
1850 duration,
1851 flags);
1852 if (_err != noErr) return PyMac_Error(_err);
1853 Py_INCREF(Py_None);
1854 _res = Py_None;
1855 return _res;
1858 static PyObject *MediaObj_GetMediaTrack(_self, _args)
1859 MediaObject *_self;
1860 PyObject *_args;
1862 PyObject *_res = NULL;
1863 Track _rv;
1864 if (!PyArg_ParseTuple(_args, ""))
1865 return NULL;
1866 _rv = GetMediaTrack(_self->ob_itself);
1867 _res = Py_BuildValue("O&",
1868 TrackObj_New, _rv);
1869 return _res;
1872 static PyObject *MediaObj_GetMediaCreationTime(_self, _args)
1873 MediaObject *_self;
1874 PyObject *_args;
1876 PyObject *_res = NULL;
1877 unsigned long _rv;
1878 if (!PyArg_ParseTuple(_args, ""))
1879 return NULL;
1880 _rv = GetMediaCreationTime(_self->ob_itself);
1881 _res = Py_BuildValue("l",
1882 _rv);
1883 return _res;
1886 static PyObject *MediaObj_GetMediaModificationTime(_self, _args)
1887 MediaObject *_self;
1888 PyObject *_args;
1890 PyObject *_res = NULL;
1891 unsigned long _rv;
1892 if (!PyArg_ParseTuple(_args, ""))
1893 return NULL;
1894 _rv = GetMediaModificationTime(_self->ob_itself);
1895 _res = Py_BuildValue("l",
1896 _rv);
1897 return _res;
1900 static PyObject *MediaObj_GetMediaTimeScale(_self, _args)
1901 MediaObject *_self;
1902 PyObject *_args;
1904 PyObject *_res = NULL;
1905 TimeScale _rv;
1906 if (!PyArg_ParseTuple(_args, ""))
1907 return NULL;
1908 _rv = GetMediaTimeScale(_self->ob_itself);
1909 _res = Py_BuildValue("l",
1910 _rv);
1911 return _res;
1914 static PyObject *MediaObj_SetMediaTimeScale(_self, _args)
1915 MediaObject *_self;
1916 PyObject *_args;
1918 PyObject *_res = NULL;
1919 TimeScale timeScale;
1920 if (!PyArg_ParseTuple(_args, "l",
1921 &timeScale))
1922 return NULL;
1923 SetMediaTimeScale(_self->ob_itself,
1924 timeScale);
1925 Py_INCREF(Py_None);
1926 _res = Py_None;
1927 return _res;
1930 static PyObject *MediaObj_GetMediaDuration(_self, _args)
1931 MediaObject *_self;
1932 PyObject *_args;
1934 PyObject *_res = NULL;
1935 TimeValue _rv;
1936 if (!PyArg_ParseTuple(_args, ""))
1937 return NULL;
1938 _rv = GetMediaDuration(_self->ob_itself);
1939 _res = Py_BuildValue("l",
1940 _rv);
1941 return _res;
1944 static PyObject *MediaObj_GetMediaLanguage(_self, _args)
1945 MediaObject *_self;
1946 PyObject *_args;
1948 PyObject *_res = NULL;
1949 short _rv;
1950 if (!PyArg_ParseTuple(_args, ""))
1951 return NULL;
1952 _rv = GetMediaLanguage(_self->ob_itself);
1953 _res = Py_BuildValue("h",
1954 _rv);
1955 return _res;
1958 static PyObject *MediaObj_SetMediaLanguage(_self, _args)
1959 MediaObject *_self;
1960 PyObject *_args;
1962 PyObject *_res = NULL;
1963 short language;
1964 if (!PyArg_ParseTuple(_args, "h",
1965 &language))
1966 return NULL;
1967 SetMediaLanguage(_self->ob_itself,
1968 language);
1969 Py_INCREF(Py_None);
1970 _res = Py_None;
1971 return _res;
1974 static PyObject *MediaObj_GetMediaQuality(_self, _args)
1975 MediaObject *_self;
1976 PyObject *_args;
1978 PyObject *_res = NULL;
1979 short _rv;
1980 if (!PyArg_ParseTuple(_args, ""))
1981 return NULL;
1982 _rv = GetMediaQuality(_self->ob_itself);
1983 _res = Py_BuildValue("h",
1984 _rv);
1985 return _res;
1988 static PyObject *MediaObj_SetMediaQuality(_self, _args)
1989 MediaObject *_self;
1990 PyObject *_args;
1992 PyObject *_res = NULL;
1993 short quality;
1994 if (!PyArg_ParseTuple(_args, "h",
1995 &quality))
1996 return NULL;
1997 SetMediaQuality(_self->ob_itself,
1998 quality);
1999 Py_INCREF(Py_None);
2000 _res = Py_None;
2001 return _res;
2004 static PyObject *MediaObj_GetMediaHandlerDescription(_self, _args)
2005 MediaObject *_self;
2006 PyObject *_args;
2008 PyObject *_res = NULL;
2009 OSType mediaType;
2010 Str255 creatorName;
2011 OSType creatorManufacturer;
2012 if (!PyArg_ParseTuple(_args, "O&",
2013 PyMac_GetStr255, creatorName))
2014 return NULL;
2015 GetMediaHandlerDescription(_self->ob_itself,
2016 &mediaType,
2017 creatorName,
2018 &creatorManufacturer);
2019 _res = Py_BuildValue("O&O&",
2020 PyMac_BuildOSType, mediaType,
2021 PyMac_BuildOSType, creatorManufacturer);
2022 return _res;
2025 static PyObject *MediaObj_GetMediaUserData(_self, _args)
2026 MediaObject *_self;
2027 PyObject *_args;
2029 PyObject *_res = NULL;
2030 UserData _rv;
2031 if (!PyArg_ParseTuple(_args, ""))
2032 return NULL;
2033 _rv = GetMediaUserData(_self->ob_itself);
2034 _res = Py_BuildValue("O&",
2035 UserDataObj_New, _rv);
2036 return _res;
2039 static PyObject *MediaObj_GetMediaHandler(_self, _args)
2040 MediaObject *_self;
2041 PyObject *_args;
2043 PyObject *_res = NULL;
2044 MediaHandler _rv;
2045 if (!PyArg_ParseTuple(_args, ""))
2046 return NULL;
2047 _rv = GetMediaHandler(_self->ob_itself);
2048 _res = Py_BuildValue("O&",
2049 CmpInstObj_New, _rv);
2050 return _res;
2053 static PyObject *MediaObj_SetMediaHandler(_self, _args)
2054 MediaObject *_self;
2055 PyObject *_args;
2057 PyObject *_res = NULL;
2058 OSErr _err;
2059 MediaHandlerComponent mH;
2060 if (!PyArg_ParseTuple(_args, "O&",
2061 CmpObj_Convert, &mH))
2062 return NULL;
2063 _err = SetMediaHandler(_self->ob_itself,
2064 mH);
2065 if (_err != noErr) return PyMac_Error(_err);
2066 Py_INCREF(Py_None);
2067 _res = Py_None;
2068 return _res;
2071 static PyObject *MediaObj_BeginMediaEdits(_self, _args)
2072 MediaObject *_self;
2073 PyObject *_args;
2075 PyObject *_res = NULL;
2076 OSErr _err;
2077 if (!PyArg_ParseTuple(_args, ""))
2078 return NULL;
2079 _err = BeginMediaEdits(_self->ob_itself);
2080 if (_err != noErr) return PyMac_Error(_err);
2081 Py_INCREF(Py_None);
2082 _res = Py_None;
2083 return _res;
2086 static PyObject *MediaObj_EndMediaEdits(_self, _args)
2087 MediaObject *_self;
2088 PyObject *_args;
2090 PyObject *_res = NULL;
2091 OSErr _err;
2092 if (!PyArg_ParseTuple(_args, ""))
2093 return NULL;
2094 _err = EndMediaEdits(_self->ob_itself);
2095 if (_err != noErr) return PyMac_Error(_err);
2096 Py_INCREF(Py_None);
2097 _res = Py_None;
2098 return _res;
2101 static PyObject *MediaObj_SetMediaDefaultDataRefIndex(_self, _args)
2102 MediaObject *_self;
2103 PyObject *_args;
2105 PyObject *_res = NULL;
2106 OSErr _err;
2107 short index;
2108 if (!PyArg_ParseTuple(_args, "h",
2109 &index))
2110 return NULL;
2111 _err = SetMediaDefaultDataRefIndex(_self->ob_itself,
2112 index);
2113 if (_err != noErr) return PyMac_Error(_err);
2114 Py_INCREF(Py_None);
2115 _res = Py_None;
2116 return _res;
2119 static PyObject *MediaObj_GetMediaDataHandlerDescription(_self, _args)
2120 MediaObject *_self;
2121 PyObject *_args;
2123 PyObject *_res = NULL;
2124 short index;
2125 OSType dhType;
2126 Str255 creatorName;
2127 OSType creatorManufacturer;
2128 if (!PyArg_ParseTuple(_args, "hO&",
2129 &index,
2130 PyMac_GetStr255, creatorName))
2131 return NULL;
2132 GetMediaDataHandlerDescription(_self->ob_itself,
2133 index,
2134 &dhType,
2135 creatorName,
2136 &creatorManufacturer);
2137 _res = Py_BuildValue("O&O&",
2138 PyMac_BuildOSType, dhType,
2139 PyMac_BuildOSType, creatorManufacturer);
2140 return _res;
2143 static PyObject *MediaObj_GetMediaDataHandler(_self, _args)
2144 MediaObject *_self;
2145 PyObject *_args;
2147 PyObject *_res = NULL;
2148 DataHandler _rv;
2149 short index;
2150 if (!PyArg_ParseTuple(_args, "h",
2151 &index))
2152 return NULL;
2153 _rv = GetMediaDataHandler(_self->ob_itself,
2154 index);
2155 _res = Py_BuildValue("O&",
2156 CmpInstObj_New, _rv);
2157 return _res;
2160 static PyObject *MediaObj_SetMediaDataHandler(_self, _args)
2161 MediaObject *_self;
2162 PyObject *_args;
2164 PyObject *_res = NULL;
2165 OSErr _err;
2166 short index;
2167 DataHandlerComponent dataHandler;
2168 if (!PyArg_ParseTuple(_args, "hO&",
2169 &index,
2170 CmpObj_Convert, &dataHandler))
2171 return NULL;
2172 _err = SetMediaDataHandler(_self->ob_itself,
2173 index,
2174 dataHandler);
2175 if (_err != noErr) return PyMac_Error(_err);
2176 Py_INCREF(Py_None);
2177 _res = Py_None;
2178 return _res;
2181 static PyObject *MediaObj_GetMediaSampleDescriptionCount(_self, _args)
2182 MediaObject *_self;
2183 PyObject *_args;
2185 PyObject *_res = NULL;
2186 long _rv;
2187 if (!PyArg_ParseTuple(_args, ""))
2188 return NULL;
2189 _rv = GetMediaSampleDescriptionCount(_self->ob_itself);
2190 _res = Py_BuildValue("l",
2191 _rv);
2192 return _res;
2195 static PyObject *MediaObj_GetMediaSampleDescription(_self, _args)
2196 MediaObject *_self;
2197 PyObject *_args;
2199 PyObject *_res = NULL;
2200 long index;
2201 SampleDescriptionHandle descH;
2202 if (!PyArg_ParseTuple(_args, "lO&",
2203 &index,
2204 ResObj_Convert, &descH))
2205 return NULL;
2206 GetMediaSampleDescription(_self->ob_itself,
2207 index,
2208 descH);
2209 Py_INCREF(Py_None);
2210 _res = Py_None;
2211 return _res;
2214 static PyObject *MediaObj_SetMediaSampleDescription(_self, _args)
2215 MediaObject *_self;
2216 PyObject *_args;
2218 PyObject *_res = NULL;
2219 OSErr _err;
2220 long index;
2221 SampleDescriptionHandle descH;
2222 if (!PyArg_ParseTuple(_args, "lO&",
2223 &index,
2224 ResObj_Convert, &descH))
2225 return NULL;
2226 _err = SetMediaSampleDescription(_self->ob_itself,
2227 index,
2228 descH);
2229 if (_err != noErr) return PyMac_Error(_err);
2230 Py_INCREF(Py_None);
2231 _res = Py_None;
2232 return _res;
2235 static PyObject *MediaObj_GetMediaSampleCount(_self, _args)
2236 MediaObject *_self;
2237 PyObject *_args;
2239 PyObject *_res = NULL;
2240 long _rv;
2241 if (!PyArg_ParseTuple(_args, ""))
2242 return NULL;
2243 _rv = GetMediaSampleCount(_self->ob_itself);
2244 _res = Py_BuildValue("l",
2245 _rv);
2246 return _res;
2249 static PyObject *MediaObj_GetMediaSyncSampleCount(_self, _args)
2250 MediaObject *_self;
2251 PyObject *_args;
2253 PyObject *_res = NULL;
2254 long _rv;
2255 if (!PyArg_ParseTuple(_args, ""))
2256 return NULL;
2257 _rv = GetMediaSyncSampleCount(_self->ob_itself);
2258 _res = Py_BuildValue("l",
2259 _rv);
2260 return _res;
2263 static PyObject *MediaObj_SampleNumToMediaTime(_self, _args)
2264 MediaObject *_self;
2265 PyObject *_args;
2267 PyObject *_res = NULL;
2268 long logicalSampleNum;
2269 TimeValue sampleTime;
2270 TimeValue sampleDuration;
2271 if (!PyArg_ParseTuple(_args, "l",
2272 &logicalSampleNum))
2273 return NULL;
2274 SampleNumToMediaTime(_self->ob_itself,
2275 logicalSampleNum,
2276 &sampleTime,
2277 &sampleDuration);
2278 _res = Py_BuildValue("ll",
2279 sampleTime,
2280 sampleDuration);
2281 return _res;
2284 static PyObject *MediaObj_MediaTimeToSampleNum(_self, _args)
2285 MediaObject *_self;
2286 PyObject *_args;
2288 PyObject *_res = NULL;
2289 TimeValue time;
2290 long sampleNum;
2291 TimeValue sampleTime;
2292 TimeValue sampleDuration;
2293 if (!PyArg_ParseTuple(_args, "l",
2294 &time))
2295 return NULL;
2296 MediaTimeToSampleNum(_self->ob_itself,
2297 time,
2298 &sampleNum,
2299 &sampleTime,
2300 &sampleDuration);
2301 _res = Py_BuildValue("lll",
2302 sampleNum,
2303 sampleTime,
2304 sampleDuration);
2305 return _res;
2308 static PyObject *MediaObj_AddMediaSample(_self, _args)
2309 MediaObject *_self;
2310 PyObject *_args;
2312 PyObject *_res = NULL;
2313 OSErr _err;
2314 Handle dataIn;
2315 long inOffset;
2316 unsigned long size;
2317 TimeValue durationPerSample;
2318 SampleDescriptionHandle sampleDescriptionH;
2319 long numberOfSamples;
2320 short sampleFlags;
2321 TimeValue sampleTime;
2322 if (!PyArg_ParseTuple(_args, "O&lllO&lh",
2323 ResObj_Convert, &dataIn,
2324 &inOffset,
2325 &size,
2326 &durationPerSample,
2327 ResObj_Convert, &sampleDescriptionH,
2328 &numberOfSamples,
2329 &sampleFlags))
2330 return NULL;
2331 _err = AddMediaSample(_self->ob_itself,
2332 dataIn,
2333 inOffset,
2334 size,
2335 durationPerSample,
2336 sampleDescriptionH,
2337 numberOfSamples,
2338 sampleFlags,
2339 &sampleTime);
2340 if (_err != noErr) return PyMac_Error(_err);
2341 _res = Py_BuildValue("l",
2342 sampleTime);
2343 return _res;
2346 static PyObject *MediaObj_AddMediaSampleReference(_self, _args)
2347 MediaObject *_self;
2348 PyObject *_args;
2350 PyObject *_res = NULL;
2351 OSErr _err;
2352 long dataOffset;
2353 unsigned long size;
2354 TimeValue durationPerSample;
2355 SampleDescriptionHandle sampleDescriptionH;
2356 long numberOfSamples;
2357 short sampleFlags;
2358 TimeValue sampleTime;
2359 if (!PyArg_ParseTuple(_args, "lllO&lh",
2360 &dataOffset,
2361 &size,
2362 &durationPerSample,
2363 ResObj_Convert, &sampleDescriptionH,
2364 &numberOfSamples,
2365 &sampleFlags))
2366 return NULL;
2367 _err = AddMediaSampleReference(_self->ob_itself,
2368 dataOffset,
2369 size,
2370 durationPerSample,
2371 sampleDescriptionH,
2372 numberOfSamples,
2373 sampleFlags,
2374 &sampleTime);
2375 if (_err != noErr) return PyMac_Error(_err);
2376 _res = Py_BuildValue("l",
2377 sampleTime);
2378 return _res;
2381 static PyObject *MediaObj_GetMediaSample(_self, _args)
2382 MediaObject *_self;
2383 PyObject *_args;
2385 PyObject *_res = NULL;
2386 OSErr _err;
2387 Handle dataOut;
2388 long maxSizeToGrow;
2389 long size;
2390 TimeValue time;
2391 TimeValue sampleTime;
2392 TimeValue durationPerSample;
2393 SampleDescriptionHandle sampleDescriptionH;
2394 long sampleDescriptionIndex;
2395 long maxNumberOfSamples;
2396 long numberOfSamples;
2397 short sampleFlags;
2398 if (!PyArg_ParseTuple(_args, "O&llO&l",
2399 ResObj_Convert, &dataOut,
2400 &maxSizeToGrow,
2401 &time,
2402 ResObj_Convert, &sampleDescriptionH,
2403 &maxNumberOfSamples))
2404 return NULL;
2405 _err = GetMediaSample(_self->ob_itself,
2406 dataOut,
2407 maxSizeToGrow,
2408 &size,
2409 time,
2410 &sampleTime,
2411 &durationPerSample,
2412 sampleDescriptionH,
2413 &sampleDescriptionIndex,
2414 maxNumberOfSamples,
2415 &numberOfSamples,
2416 &sampleFlags);
2417 if (_err != noErr) return PyMac_Error(_err);
2418 _res = Py_BuildValue("lllllh",
2419 size,
2420 sampleTime,
2421 durationPerSample,
2422 sampleDescriptionIndex,
2423 numberOfSamples,
2424 sampleFlags);
2425 return _res;
2428 static PyObject *MediaObj_GetMediaSampleReference(_self, _args)
2429 MediaObject *_self;
2430 PyObject *_args;
2432 PyObject *_res = NULL;
2433 OSErr _err;
2434 long dataOffset;
2435 long size;
2436 TimeValue time;
2437 TimeValue sampleTime;
2438 TimeValue durationPerSample;
2439 SampleDescriptionHandle sampleDescriptionH;
2440 long sampleDescriptionIndex;
2441 long maxNumberOfSamples;
2442 long numberOfSamples;
2443 short sampleFlags;
2444 if (!PyArg_ParseTuple(_args, "lO&l",
2445 &time,
2446 ResObj_Convert, &sampleDescriptionH,
2447 &maxNumberOfSamples))
2448 return NULL;
2449 _err = GetMediaSampleReference(_self->ob_itself,
2450 &dataOffset,
2451 &size,
2452 time,
2453 &sampleTime,
2454 &durationPerSample,
2455 sampleDescriptionH,
2456 &sampleDescriptionIndex,
2457 maxNumberOfSamples,
2458 &numberOfSamples,
2459 &sampleFlags);
2460 if (_err != noErr) return PyMac_Error(_err);
2461 _res = Py_BuildValue("llllllh",
2462 dataOffset,
2463 size,
2464 sampleTime,
2465 durationPerSample,
2466 sampleDescriptionIndex,
2467 numberOfSamples,
2468 sampleFlags);
2469 return _res;
2472 static PyObject *MediaObj_SetMediaPreferredChunkSize(_self, _args)
2473 MediaObject *_self;
2474 PyObject *_args;
2476 PyObject *_res = NULL;
2477 OSErr _err;
2478 long maxChunkSize;
2479 if (!PyArg_ParseTuple(_args, "l",
2480 &maxChunkSize))
2481 return NULL;
2482 _err = SetMediaPreferredChunkSize(_self->ob_itself,
2483 maxChunkSize);
2484 if (_err != noErr) return PyMac_Error(_err);
2485 Py_INCREF(Py_None);
2486 _res = Py_None;
2487 return _res;
2490 static PyObject *MediaObj_GetMediaPreferredChunkSize(_self, _args)
2491 MediaObject *_self;
2492 PyObject *_args;
2494 PyObject *_res = NULL;
2495 OSErr _err;
2496 long maxChunkSize;
2497 if (!PyArg_ParseTuple(_args, ""))
2498 return NULL;
2499 _err = GetMediaPreferredChunkSize(_self->ob_itself,
2500 &maxChunkSize);
2501 if (_err != noErr) return PyMac_Error(_err);
2502 _res = Py_BuildValue("l",
2503 maxChunkSize);
2504 return _res;
2507 static PyObject *MediaObj_SetMediaShadowSync(_self, _args)
2508 MediaObject *_self;
2509 PyObject *_args;
2511 PyObject *_res = NULL;
2512 OSErr _err;
2513 long frameDiffSampleNum;
2514 long syncSampleNum;
2515 if (!PyArg_ParseTuple(_args, "ll",
2516 &frameDiffSampleNum,
2517 &syncSampleNum))
2518 return NULL;
2519 _err = SetMediaShadowSync(_self->ob_itself,
2520 frameDiffSampleNum,
2521 syncSampleNum);
2522 if (_err != noErr) return PyMac_Error(_err);
2523 Py_INCREF(Py_None);
2524 _res = Py_None;
2525 return _res;
2528 static PyObject *MediaObj_GetMediaShadowSync(_self, _args)
2529 MediaObject *_self;
2530 PyObject *_args;
2532 PyObject *_res = NULL;
2533 OSErr _err;
2534 long frameDiffSampleNum;
2535 long syncSampleNum;
2536 if (!PyArg_ParseTuple(_args, "l",
2537 &frameDiffSampleNum))
2538 return NULL;
2539 _err = GetMediaShadowSync(_self->ob_itself,
2540 frameDiffSampleNum,
2541 &syncSampleNum);
2542 if (_err != noErr) return PyMac_Error(_err);
2543 _res = Py_BuildValue("l",
2544 syncSampleNum);
2545 return _res;
2548 static PyObject *MediaObj_GetMediaDataSize(_self, _args)
2549 MediaObject *_self;
2550 PyObject *_args;
2552 PyObject *_res = NULL;
2553 long _rv;
2554 TimeValue startTime;
2555 TimeValue duration;
2556 if (!PyArg_ParseTuple(_args, "ll",
2557 &startTime,
2558 &duration))
2559 return NULL;
2560 _rv = GetMediaDataSize(_self->ob_itself,
2561 startTime,
2562 duration);
2563 _res = Py_BuildValue("l",
2564 _rv);
2565 return _res;
2568 static PyObject *MediaObj_GetMediaNextInterestingTime(_self, _args)
2569 MediaObject *_self;
2570 PyObject *_args;
2572 PyObject *_res = NULL;
2573 short interestingTimeFlags;
2574 TimeValue time;
2575 Fixed rate;
2576 TimeValue interestingTime;
2577 TimeValue interestingDuration;
2578 if (!PyArg_ParseTuple(_args, "hlO&",
2579 &interestingTimeFlags,
2580 &time,
2581 PyMac_GetFixed, &rate))
2582 return NULL;
2583 GetMediaNextInterestingTime(_self->ob_itself,
2584 interestingTimeFlags,
2585 time,
2586 rate,
2587 &interestingTime,
2588 &interestingDuration);
2589 _res = Py_BuildValue("ll",
2590 interestingTime,
2591 interestingDuration);
2592 return _res;
2595 static PyObject *MediaObj_GetMediaDataRef(_self, _args)
2596 MediaObject *_self;
2597 PyObject *_args;
2599 PyObject *_res = NULL;
2600 OSErr _err;
2601 short index;
2602 Handle dataRef;
2603 OSType dataRefType;
2604 long dataRefAttributes;
2605 if (!PyArg_ParseTuple(_args, "h",
2606 &index))
2607 return NULL;
2608 _err = GetMediaDataRef(_self->ob_itself,
2609 index,
2610 &dataRef,
2611 &dataRefType,
2612 &dataRefAttributes);
2613 if (_err != noErr) return PyMac_Error(_err);
2614 _res = Py_BuildValue("O&O&l",
2615 ResObj_New, dataRef,
2616 PyMac_BuildOSType, dataRefType,
2617 dataRefAttributes);
2618 return _res;
2621 static PyObject *MediaObj_SetMediaDataRef(_self, _args)
2622 MediaObject *_self;
2623 PyObject *_args;
2625 PyObject *_res = NULL;
2626 OSErr _err;
2627 short index;
2628 Handle dataRef;
2629 OSType dataRefType;
2630 if (!PyArg_ParseTuple(_args, "hO&O&",
2631 &index,
2632 ResObj_Convert, &dataRef,
2633 PyMac_GetOSType, &dataRefType))
2634 return NULL;
2635 _err = SetMediaDataRef(_self->ob_itself,
2636 index,
2637 dataRef,
2638 dataRefType);
2639 if (_err != noErr) return PyMac_Error(_err);
2640 Py_INCREF(Py_None);
2641 _res = Py_None;
2642 return _res;
2645 static PyObject *MediaObj_SetMediaDataRefAttributes(_self, _args)
2646 MediaObject *_self;
2647 PyObject *_args;
2649 PyObject *_res = NULL;
2650 OSErr _err;
2651 short index;
2652 long dataRefAttributes;
2653 if (!PyArg_ParseTuple(_args, "hl",
2654 &index,
2655 &dataRefAttributes))
2656 return NULL;
2657 _err = SetMediaDataRefAttributes(_self->ob_itself,
2658 index,
2659 dataRefAttributes);
2660 if (_err != noErr) return PyMac_Error(_err);
2661 Py_INCREF(Py_None);
2662 _res = Py_None;
2663 return _res;
2666 static PyObject *MediaObj_AddMediaDataRef(_self, _args)
2667 MediaObject *_self;
2668 PyObject *_args;
2670 PyObject *_res = NULL;
2671 OSErr _err;
2672 short index;
2673 Handle dataRef;
2674 OSType dataRefType;
2675 if (!PyArg_ParseTuple(_args, "O&O&",
2676 ResObj_Convert, &dataRef,
2677 PyMac_GetOSType, &dataRefType))
2678 return NULL;
2679 _err = AddMediaDataRef(_self->ob_itself,
2680 &index,
2681 dataRef,
2682 dataRefType);
2683 if (_err != noErr) return PyMac_Error(_err);
2684 _res = Py_BuildValue("h",
2685 index);
2686 return _res;
2689 static PyObject *MediaObj_GetMediaDataRefCount(_self, _args)
2690 MediaObject *_self;
2691 PyObject *_args;
2693 PyObject *_res = NULL;
2694 OSErr _err;
2695 short count;
2696 if (!PyArg_ParseTuple(_args, ""))
2697 return NULL;
2698 _err = GetMediaDataRefCount(_self->ob_itself,
2699 &count);
2700 if (_err != noErr) return PyMac_Error(_err);
2701 _res = Py_BuildValue("h",
2702 count);
2703 return _res;
2706 static PyObject *MediaObj_SetMediaPlayHints(_self, _args)
2707 MediaObject *_self;
2708 PyObject *_args;
2710 PyObject *_res = NULL;
2711 long flags;
2712 long flagsMask;
2713 if (!PyArg_ParseTuple(_args, "ll",
2714 &flags,
2715 &flagsMask))
2716 return NULL;
2717 SetMediaPlayHints(_self->ob_itself,
2718 flags,
2719 flagsMask);
2720 Py_INCREF(Py_None);
2721 _res = Py_None;
2722 return _res;
2725 static PyObject *MediaObj_GetMediaPlayHints(_self, _args)
2726 MediaObject *_self;
2727 PyObject *_args;
2729 PyObject *_res = NULL;
2730 long flags;
2731 if (!PyArg_ParseTuple(_args, ""))
2732 return NULL;
2733 GetMediaPlayHints(_self->ob_itself,
2734 &flags);
2735 _res = Py_BuildValue("l",
2736 flags);
2737 return _res;
2740 static PyMethodDef MediaObj_methods[] = {
2741 {"LoadMediaIntoRam", (PyCFunction)MediaObj_LoadMediaIntoRam, 1,
2742 "(TimeValue time, TimeValue duration, long flags) -> None"},
2743 {"GetMediaTrack", (PyCFunction)MediaObj_GetMediaTrack, 1,
2744 "() -> (Track _rv)"},
2745 {"GetMediaCreationTime", (PyCFunction)MediaObj_GetMediaCreationTime, 1,
2746 "() -> (unsigned long _rv)"},
2747 {"GetMediaModificationTime", (PyCFunction)MediaObj_GetMediaModificationTime, 1,
2748 "() -> (unsigned long _rv)"},
2749 {"GetMediaTimeScale", (PyCFunction)MediaObj_GetMediaTimeScale, 1,
2750 "() -> (TimeScale _rv)"},
2751 {"SetMediaTimeScale", (PyCFunction)MediaObj_SetMediaTimeScale, 1,
2752 "(TimeScale timeScale) -> None"},
2753 {"GetMediaDuration", (PyCFunction)MediaObj_GetMediaDuration, 1,
2754 "() -> (TimeValue _rv)"},
2755 {"GetMediaLanguage", (PyCFunction)MediaObj_GetMediaLanguage, 1,
2756 "() -> (short _rv)"},
2757 {"SetMediaLanguage", (PyCFunction)MediaObj_SetMediaLanguage, 1,
2758 "(short language) -> None"},
2759 {"GetMediaQuality", (PyCFunction)MediaObj_GetMediaQuality, 1,
2760 "() -> (short _rv)"},
2761 {"SetMediaQuality", (PyCFunction)MediaObj_SetMediaQuality, 1,
2762 "(short quality) -> None"},
2763 {"GetMediaHandlerDescription", (PyCFunction)MediaObj_GetMediaHandlerDescription, 1,
2764 "(Str255 creatorName) -> (OSType mediaType, OSType creatorManufacturer)"},
2765 {"GetMediaUserData", (PyCFunction)MediaObj_GetMediaUserData, 1,
2766 "() -> (UserData _rv)"},
2767 {"GetMediaHandler", (PyCFunction)MediaObj_GetMediaHandler, 1,
2768 "() -> (MediaHandler _rv)"},
2769 {"SetMediaHandler", (PyCFunction)MediaObj_SetMediaHandler, 1,
2770 "(MediaHandlerComponent mH) -> None"},
2771 {"BeginMediaEdits", (PyCFunction)MediaObj_BeginMediaEdits, 1,
2772 "() -> None"},
2773 {"EndMediaEdits", (PyCFunction)MediaObj_EndMediaEdits, 1,
2774 "() -> None"},
2775 {"SetMediaDefaultDataRefIndex", (PyCFunction)MediaObj_SetMediaDefaultDataRefIndex, 1,
2776 "(short index) -> None"},
2777 {"GetMediaDataHandlerDescription", (PyCFunction)MediaObj_GetMediaDataHandlerDescription, 1,
2778 "(short index, Str255 creatorName) -> (OSType dhType, OSType creatorManufacturer)"},
2779 {"GetMediaDataHandler", (PyCFunction)MediaObj_GetMediaDataHandler, 1,
2780 "(short index) -> (DataHandler _rv)"},
2781 {"SetMediaDataHandler", (PyCFunction)MediaObj_SetMediaDataHandler, 1,
2782 "(short index, DataHandlerComponent dataHandler) -> None"},
2783 {"GetMediaSampleDescriptionCount", (PyCFunction)MediaObj_GetMediaSampleDescriptionCount, 1,
2784 "() -> (long _rv)"},
2785 {"GetMediaSampleDescription", (PyCFunction)MediaObj_GetMediaSampleDescription, 1,
2786 "(long index, SampleDescriptionHandle descH) -> None"},
2787 {"SetMediaSampleDescription", (PyCFunction)MediaObj_SetMediaSampleDescription, 1,
2788 "(long index, SampleDescriptionHandle descH) -> None"},
2789 {"GetMediaSampleCount", (PyCFunction)MediaObj_GetMediaSampleCount, 1,
2790 "() -> (long _rv)"},
2791 {"GetMediaSyncSampleCount", (PyCFunction)MediaObj_GetMediaSyncSampleCount, 1,
2792 "() -> (long _rv)"},
2793 {"SampleNumToMediaTime", (PyCFunction)MediaObj_SampleNumToMediaTime, 1,
2794 "(long logicalSampleNum) -> (TimeValue sampleTime, TimeValue sampleDuration)"},
2795 {"MediaTimeToSampleNum", (PyCFunction)MediaObj_MediaTimeToSampleNum, 1,
2796 "(TimeValue time) -> (long sampleNum, TimeValue sampleTime, TimeValue sampleDuration)"},
2797 {"AddMediaSample", (PyCFunction)MediaObj_AddMediaSample, 1,
2798 "(Handle dataIn, long inOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
2799 {"AddMediaSampleReference", (PyCFunction)MediaObj_AddMediaSampleReference, 1,
2800 "(long dataOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
2801 {"GetMediaSample", (PyCFunction)MediaObj_GetMediaSample, 1,
2802 "(Handle dataOut, long maxSizeToGrow, TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
2803 {"GetMediaSampleReference", (PyCFunction)MediaObj_GetMediaSampleReference, 1,
2804 "(TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long dataOffset, long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
2805 {"SetMediaPreferredChunkSize", (PyCFunction)MediaObj_SetMediaPreferredChunkSize, 1,
2806 "(long maxChunkSize) -> None"},
2807 {"GetMediaPreferredChunkSize", (PyCFunction)MediaObj_GetMediaPreferredChunkSize, 1,
2808 "() -> (long maxChunkSize)"},
2809 {"SetMediaShadowSync", (PyCFunction)MediaObj_SetMediaShadowSync, 1,
2810 "(long frameDiffSampleNum, long syncSampleNum) -> None"},
2811 {"GetMediaShadowSync", (PyCFunction)MediaObj_GetMediaShadowSync, 1,
2812 "(long frameDiffSampleNum) -> (long syncSampleNum)"},
2813 {"GetMediaDataSize", (PyCFunction)MediaObj_GetMediaDataSize, 1,
2814 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
2815 {"GetMediaNextInterestingTime", (PyCFunction)MediaObj_GetMediaNextInterestingTime, 1,
2816 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
2817 {"GetMediaDataRef", (PyCFunction)MediaObj_GetMediaDataRef, 1,
2818 "(short index) -> (Handle dataRef, OSType dataRefType, long dataRefAttributes)"},
2819 {"SetMediaDataRef", (PyCFunction)MediaObj_SetMediaDataRef, 1,
2820 "(short index, Handle dataRef, OSType dataRefType) -> None"},
2821 {"SetMediaDataRefAttributes", (PyCFunction)MediaObj_SetMediaDataRefAttributes, 1,
2822 "(short index, long dataRefAttributes) -> None"},
2823 {"AddMediaDataRef", (PyCFunction)MediaObj_AddMediaDataRef, 1,
2824 "(Handle dataRef, OSType dataRefType) -> (short index)"},
2825 {"GetMediaDataRefCount", (PyCFunction)MediaObj_GetMediaDataRefCount, 1,
2826 "() -> (short count)"},
2827 {"SetMediaPlayHints", (PyCFunction)MediaObj_SetMediaPlayHints, 1,
2828 "(long flags, long flagsMask) -> None"},
2829 {"GetMediaPlayHints", (PyCFunction)MediaObj_GetMediaPlayHints, 1,
2830 "() -> (long flags)"},
2831 {NULL, NULL, 0}
2834 PyMethodChain MediaObj_chain = { MediaObj_methods, NULL };
2836 static PyObject *MediaObj_getattr(self, name)
2837 MediaObject *self;
2838 char *name;
2840 return Py_FindMethodInChain(&MediaObj_chain, (PyObject *)self, name);
2843 #define MediaObj_setattr NULL
2845 #define MediaObj_compare NULL
2847 #define MediaObj_repr NULL
2849 #define MediaObj_hash NULL
2851 PyTypeObject Media_Type = {
2852 PyObject_HEAD_INIT(&PyType_Type)
2853 0, /*ob_size*/
2854 "Media", /*tp_name*/
2855 sizeof(MediaObject), /*tp_basicsize*/
2856 0, /*tp_itemsize*/
2857 /* methods */
2858 (destructor) MediaObj_dealloc, /*tp_dealloc*/
2859 0, /*tp_print*/
2860 (getattrfunc) MediaObj_getattr, /*tp_getattr*/
2861 (setattrfunc) MediaObj_setattr, /*tp_setattr*/
2862 (cmpfunc) MediaObj_compare, /*tp_compare*/
2863 (reprfunc) MediaObj_repr, /*tp_repr*/
2864 (PyNumberMethods *)0, /* tp_as_number */
2865 (PySequenceMethods *)0, /* tp_as_sequence */
2866 (PyMappingMethods *)0, /* tp_as_mapping */
2867 (hashfunc) MediaObj_hash, /*tp_hash*/
2870 /* --------------------- End object type Media ---------------------- */
2873 /* ----------------------- Object type Track ------------------------ */
2875 PyTypeObject Track_Type;
2877 #define TrackObj_Check(x) ((x)->ob_type == &Track_Type)
2879 typedef struct TrackObject {
2880 PyObject_HEAD
2881 Track ob_itself;
2882 } TrackObject;
2884 PyObject *TrackObj_New(itself)
2885 Track itself;
2887 TrackObject *it;
2888 if (itself == NULL) {
2889 PyErr_SetString(Qt_Error,"Cannot create null Track");
2890 return NULL;
2892 it = PyObject_NEW(TrackObject, &Track_Type);
2893 if (it == NULL) return NULL;
2894 it->ob_itself = itself;
2895 return (PyObject *)it;
2897 TrackObj_Convert(v, p_itself)
2898 PyObject *v;
2899 Track *p_itself;
2901 if (!TrackObj_Check(v))
2903 PyErr_SetString(PyExc_TypeError, "Track required");
2904 return 0;
2906 *p_itself = ((TrackObject *)v)->ob_itself;
2907 return 1;
2910 static void TrackObj_dealloc(self)
2911 TrackObject *self;
2913 DisposeMovieTrack(self->ob_itself);
2914 PyMem_DEL(self);
2917 static PyObject *TrackObj_LoadTrackIntoRam(_self, _args)
2918 TrackObject *_self;
2919 PyObject *_args;
2921 PyObject *_res = NULL;
2922 OSErr _err;
2923 TimeValue time;
2924 TimeValue duration;
2925 long flags;
2926 if (!PyArg_ParseTuple(_args, "lll",
2927 &time,
2928 &duration,
2929 &flags))
2930 return NULL;
2931 _err = LoadTrackIntoRam(_self->ob_itself,
2932 time,
2933 duration,
2934 flags);
2935 if (_err != noErr) return PyMac_Error(_err);
2936 Py_INCREF(Py_None);
2937 _res = Py_None;
2938 return _res;
2941 static PyObject *TrackObj_GetTrackPict(_self, _args)
2942 TrackObject *_self;
2943 PyObject *_args;
2945 PyObject *_res = NULL;
2946 PicHandle _rv;
2947 TimeValue time;
2948 if (!PyArg_ParseTuple(_args, "l",
2949 &time))
2950 return NULL;
2951 _rv = GetTrackPict(_self->ob_itself,
2952 time);
2953 _res = Py_BuildValue("O&",
2954 ResObj_New, _rv);
2955 return _res;
2958 static PyObject *TrackObj_GetTrackClipRgn(_self, _args)
2959 TrackObject *_self;
2960 PyObject *_args;
2962 PyObject *_res = NULL;
2963 RgnHandle _rv;
2964 if (!PyArg_ParseTuple(_args, ""))
2965 return NULL;
2966 _rv = GetTrackClipRgn(_self->ob_itself);
2967 _res = Py_BuildValue("O&",
2968 ResObj_New, _rv);
2969 return _res;
2972 static PyObject *TrackObj_SetTrackClipRgn(_self, _args)
2973 TrackObject *_self;
2974 PyObject *_args;
2976 PyObject *_res = NULL;
2977 RgnHandle theClip;
2978 if (!PyArg_ParseTuple(_args, "O&",
2979 ResObj_Convert, &theClip))
2980 return NULL;
2981 SetTrackClipRgn(_self->ob_itself,
2982 theClip);
2983 Py_INCREF(Py_None);
2984 _res = Py_None;
2985 return _res;
2988 static PyObject *TrackObj_GetTrackDisplayBoundsRgn(_self, _args)
2989 TrackObject *_self;
2990 PyObject *_args;
2992 PyObject *_res = NULL;
2993 RgnHandle _rv;
2994 if (!PyArg_ParseTuple(_args, ""))
2995 return NULL;
2996 _rv = GetTrackDisplayBoundsRgn(_self->ob_itself);
2997 _res = Py_BuildValue("O&",
2998 ResObj_New, _rv);
2999 return _res;
3002 static PyObject *TrackObj_GetTrackMovieBoundsRgn(_self, _args)
3003 TrackObject *_self;
3004 PyObject *_args;
3006 PyObject *_res = NULL;
3007 RgnHandle _rv;
3008 if (!PyArg_ParseTuple(_args, ""))
3009 return NULL;
3010 _rv = GetTrackMovieBoundsRgn(_self->ob_itself);
3011 _res = Py_BuildValue("O&",
3012 ResObj_New, _rv);
3013 return _res;
3016 static PyObject *TrackObj_GetTrackBoundsRgn(_self, _args)
3017 TrackObject *_self;
3018 PyObject *_args;
3020 PyObject *_res = NULL;
3021 RgnHandle _rv;
3022 if (!PyArg_ParseTuple(_args, ""))
3023 return NULL;
3024 _rv = GetTrackBoundsRgn(_self->ob_itself);
3025 _res = Py_BuildValue("O&",
3026 ResObj_New, _rv);
3027 return _res;
3030 static PyObject *TrackObj_GetTrackMatte(_self, _args)
3031 TrackObject *_self;
3032 PyObject *_args;
3034 PyObject *_res = NULL;
3035 PixMapHandle _rv;
3036 if (!PyArg_ParseTuple(_args, ""))
3037 return NULL;
3038 _rv = GetTrackMatte(_self->ob_itself);
3039 _res = Py_BuildValue("O&",
3040 ResObj_New, _rv);
3041 return _res;
3044 static PyObject *TrackObj_SetTrackMatte(_self, _args)
3045 TrackObject *_self;
3046 PyObject *_args;
3048 PyObject *_res = NULL;
3049 PixMapHandle theMatte;
3050 if (!PyArg_ParseTuple(_args, "O&",
3051 ResObj_Convert, &theMatte))
3052 return NULL;
3053 SetTrackMatte(_self->ob_itself,
3054 theMatte);
3055 Py_INCREF(Py_None);
3056 _res = Py_None;
3057 return _res;
3060 static PyObject *TrackObj_GetTrackID(_self, _args)
3061 TrackObject *_self;
3062 PyObject *_args;
3064 PyObject *_res = NULL;
3065 long _rv;
3066 if (!PyArg_ParseTuple(_args, ""))
3067 return NULL;
3068 _rv = GetTrackID(_self->ob_itself);
3069 _res = Py_BuildValue("l",
3070 _rv);
3071 return _res;
3074 static PyObject *TrackObj_GetTrackMovie(_self, _args)
3075 TrackObject *_self;
3076 PyObject *_args;
3078 PyObject *_res = NULL;
3079 Movie _rv;
3080 if (!PyArg_ParseTuple(_args, ""))
3081 return NULL;
3082 _rv = GetTrackMovie(_self->ob_itself);
3083 _res = Py_BuildValue("O&",
3084 MovieObj_New, _rv);
3085 return _res;
3088 static PyObject *TrackObj_GetTrackCreationTime(_self, _args)
3089 TrackObject *_self;
3090 PyObject *_args;
3092 PyObject *_res = NULL;
3093 unsigned long _rv;
3094 if (!PyArg_ParseTuple(_args, ""))
3095 return NULL;
3096 _rv = GetTrackCreationTime(_self->ob_itself);
3097 _res = Py_BuildValue("l",
3098 _rv);
3099 return _res;
3102 static PyObject *TrackObj_GetTrackModificationTime(_self, _args)
3103 TrackObject *_self;
3104 PyObject *_args;
3106 PyObject *_res = NULL;
3107 unsigned long _rv;
3108 if (!PyArg_ParseTuple(_args, ""))
3109 return NULL;
3110 _rv = GetTrackModificationTime(_self->ob_itself);
3111 _res = Py_BuildValue("l",
3112 _rv);
3113 return _res;
3116 static PyObject *TrackObj_GetTrackEnabled(_self, _args)
3117 TrackObject *_self;
3118 PyObject *_args;
3120 PyObject *_res = NULL;
3121 Boolean _rv;
3122 if (!PyArg_ParseTuple(_args, ""))
3123 return NULL;
3124 _rv = GetTrackEnabled(_self->ob_itself);
3125 _res = Py_BuildValue("b",
3126 _rv);
3127 return _res;
3130 static PyObject *TrackObj_SetTrackEnabled(_self, _args)
3131 TrackObject *_self;
3132 PyObject *_args;
3134 PyObject *_res = NULL;
3135 Boolean isEnabled;
3136 if (!PyArg_ParseTuple(_args, "b",
3137 &isEnabled))
3138 return NULL;
3139 SetTrackEnabled(_self->ob_itself,
3140 isEnabled);
3141 Py_INCREF(Py_None);
3142 _res = Py_None;
3143 return _res;
3146 static PyObject *TrackObj_GetTrackUsage(_self, _args)
3147 TrackObject *_self;
3148 PyObject *_args;
3150 PyObject *_res = NULL;
3151 long _rv;
3152 if (!PyArg_ParseTuple(_args, ""))
3153 return NULL;
3154 _rv = GetTrackUsage(_self->ob_itself);
3155 _res = Py_BuildValue("l",
3156 _rv);
3157 return _res;
3160 static PyObject *TrackObj_SetTrackUsage(_self, _args)
3161 TrackObject *_self;
3162 PyObject *_args;
3164 PyObject *_res = NULL;
3165 long usage;
3166 if (!PyArg_ParseTuple(_args, "l",
3167 &usage))
3168 return NULL;
3169 SetTrackUsage(_self->ob_itself,
3170 usage);
3171 Py_INCREF(Py_None);
3172 _res = Py_None;
3173 return _res;
3176 static PyObject *TrackObj_GetTrackDuration(_self, _args)
3177 TrackObject *_self;
3178 PyObject *_args;
3180 PyObject *_res = NULL;
3181 TimeValue _rv;
3182 if (!PyArg_ParseTuple(_args, ""))
3183 return NULL;
3184 _rv = GetTrackDuration(_self->ob_itself);
3185 _res = Py_BuildValue("l",
3186 _rv);
3187 return _res;
3190 static PyObject *TrackObj_GetTrackOffset(_self, _args)
3191 TrackObject *_self;
3192 PyObject *_args;
3194 PyObject *_res = NULL;
3195 TimeValue _rv;
3196 if (!PyArg_ParseTuple(_args, ""))
3197 return NULL;
3198 _rv = GetTrackOffset(_self->ob_itself);
3199 _res = Py_BuildValue("l",
3200 _rv);
3201 return _res;
3204 static PyObject *TrackObj_SetTrackOffset(_self, _args)
3205 TrackObject *_self;
3206 PyObject *_args;
3208 PyObject *_res = NULL;
3209 TimeValue movieOffsetTime;
3210 if (!PyArg_ParseTuple(_args, "l",
3211 &movieOffsetTime))
3212 return NULL;
3213 SetTrackOffset(_self->ob_itself,
3214 movieOffsetTime);
3215 Py_INCREF(Py_None);
3216 _res = Py_None;
3217 return _res;
3220 static PyObject *TrackObj_GetTrackLayer(_self, _args)
3221 TrackObject *_self;
3222 PyObject *_args;
3224 PyObject *_res = NULL;
3225 short _rv;
3226 if (!PyArg_ParseTuple(_args, ""))
3227 return NULL;
3228 _rv = GetTrackLayer(_self->ob_itself);
3229 _res = Py_BuildValue("h",
3230 _rv);
3231 return _res;
3234 static PyObject *TrackObj_SetTrackLayer(_self, _args)
3235 TrackObject *_self;
3236 PyObject *_args;
3238 PyObject *_res = NULL;
3239 short layer;
3240 if (!PyArg_ParseTuple(_args, "h",
3241 &layer))
3242 return NULL;
3243 SetTrackLayer(_self->ob_itself,
3244 layer);
3245 Py_INCREF(Py_None);
3246 _res = Py_None;
3247 return _res;
3250 static PyObject *TrackObj_GetTrackAlternate(_self, _args)
3251 TrackObject *_self;
3252 PyObject *_args;
3254 PyObject *_res = NULL;
3255 Track _rv;
3256 if (!PyArg_ParseTuple(_args, ""))
3257 return NULL;
3258 _rv = GetTrackAlternate(_self->ob_itself);
3259 _res = Py_BuildValue("O&",
3260 TrackObj_New, _rv);
3261 return _res;
3264 static PyObject *TrackObj_SetTrackAlternate(_self, _args)
3265 TrackObject *_self;
3266 PyObject *_args;
3268 PyObject *_res = NULL;
3269 Track alternateT;
3270 if (!PyArg_ParseTuple(_args, "O&",
3271 TrackObj_Convert, &alternateT))
3272 return NULL;
3273 SetTrackAlternate(_self->ob_itself,
3274 alternateT);
3275 Py_INCREF(Py_None);
3276 _res = Py_None;
3277 return _res;
3280 static PyObject *TrackObj_GetTrackVolume(_self, _args)
3281 TrackObject *_self;
3282 PyObject *_args;
3284 PyObject *_res = NULL;
3285 short _rv;
3286 if (!PyArg_ParseTuple(_args, ""))
3287 return NULL;
3288 _rv = GetTrackVolume(_self->ob_itself);
3289 _res = Py_BuildValue("h",
3290 _rv);
3291 return _res;
3294 static PyObject *TrackObj_SetTrackVolume(_self, _args)
3295 TrackObject *_self;
3296 PyObject *_args;
3298 PyObject *_res = NULL;
3299 short volume;
3300 if (!PyArg_ParseTuple(_args, "h",
3301 &volume))
3302 return NULL;
3303 SetTrackVolume(_self->ob_itself,
3304 volume);
3305 Py_INCREF(Py_None);
3306 _res = Py_None;
3307 return _res;
3310 static PyObject *TrackObj_GetTrackDimensions(_self, _args)
3311 TrackObject *_self;
3312 PyObject *_args;
3314 PyObject *_res = NULL;
3315 Fixed width;
3316 Fixed height;
3317 if (!PyArg_ParseTuple(_args, ""))
3318 return NULL;
3319 GetTrackDimensions(_self->ob_itself,
3320 &width,
3321 &height);
3322 _res = Py_BuildValue("O&O&",
3323 PyMac_BuildFixed, width,
3324 PyMac_BuildFixed, height);
3325 return _res;
3328 static PyObject *TrackObj_SetTrackDimensions(_self, _args)
3329 TrackObject *_self;
3330 PyObject *_args;
3332 PyObject *_res = NULL;
3333 Fixed width;
3334 Fixed height;
3335 if (!PyArg_ParseTuple(_args, "O&O&",
3336 PyMac_GetFixed, &width,
3337 PyMac_GetFixed, &height))
3338 return NULL;
3339 SetTrackDimensions(_self->ob_itself,
3340 width,
3341 height);
3342 Py_INCREF(Py_None);
3343 _res = Py_None;
3344 return _res;
3347 static PyObject *TrackObj_GetTrackUserData(_self, _args)
3348 TrackObject *_self;
3349 PyObject *_args;
3351 PyObject *_res = NULL;
3352 UserData _rv;
3353 if (!PyArg_ParseTuple(_args, ""))
3354 return NULL;
3355 _rv = GetTrackUserData(_self->ob_itself);
3356 _res = Py_BuildValue("O&",
3357 UserDataObj_New, _rv);
3358 return _res;
3361 static PyObject *TrackObj_GetTrackSoundLocalizationSettings(_self, _args)
3362 TrackObject *_self;
3363 PyObject *_args;
3365 PyObject *_res = NULL;
3366 OSErr _err;
3367 Handle settings;
3368 if (!PyArg_ParseTuple(_args, ""))
3369 return NULL;
3370 _err = GetTrackSoundLocalizationSettings(_self->ob_itself,
3371 &settings);
3372 if (_err != noErr) return PyMac_Error(_err);
3373 _res = Py_BuildValue("O&",
3374 ResObj_New, settings);
3375 return _res;
3378 static PyObject *TrackObj_SetTrackSoundLocalizationSettings(_self, _args)
3379 TrackObject *_self;
3380 PyObject *_args;
3382 PyObject *_res = NULL;
3383 OSErr _err;
3384 Handle settings;
3385 if (!PyArg_ParseTuple(_args, "O&",
3386 ResObj_Convert, &settings))
3387 return NULL;
3388 _err = SetTrackSoundLocalizationSettings(_self->ob_itself,
3389 settings);
3390 if (_err != noErr) return PyMac_Error(_err);
3391 Py_INCREF(Py_None);
3392 _res = Py_None;
3393 return _res;
3396 static PyObject *TrackObj_NewTrackMedia(_self, _args)
3397 TrackObject *_self;
3398 PyObject *_args;
3400 PyObject *_res = NULL;
3401 Media _rv;
3402 OSType mediaType;
3403 TimeScale timeScale;
3404 Handle dataRef;
3405 OSType dataRefType;
3406 if (!PyArg_ParseTuple(_args, "O&lO&O&",
3407 PyMac_GetOSType, &mediaType,
3408 &timeScale,
3409 ResObj_Convert, &dataRef,
3410 PyMac_GetOSType, &dataRefType))
3411 return NULL;
3412 _rv = NewTrackMedia(_self->ob_itself,
3413 mediaType,
3414 timeScale,
3415 dataRef,
3416 dataRefType);
3417 _res = Py_BuildValue("O&",
3418 MediaObj_New, _rv);
3419 return _res;
3422 static PyObject *TrackObj_GetTrackMedia(_self, _args)
3423 TrackObject *_self;
3424 PyObject *_args;
3426 PyObject *_res = NULL;
3427 Media _rv;
3428 if (!PyArg_ParseTuple(_args, ""))
3429 return NULL;
3430 _rv = GetTrackMedia(_self->ob_itself);
3431 _res = Py_BuildValue("O&",
3432 MediaObj_New, _rv);
3433 return _res;
3436 static PyObject *TrackObj_InsertMediaIntoTrack(_self, _args)
3437 TrackObject *_self;
3438 PyObject *_args;
3440 PyObject *_res = NULL;
3441 OSErr _err;
3442 TimeValue trackStart;
3443 TimeValue mediaTime;
3444 TimeValue mediaDuration;
3445 Fixed mediaRate;
3446 if (!PyArg_ParseTuple(_args, "lllO&",
3447 &trackStart,
3448 &mediaTime,
3449 &mediaDuration,
3450 PyMac_GetFixed, &mediaRate))
3451 return NULL;
3452 _err = InsertMediaIntoTrack(_self->ob_itself,
3453 trackStart,
3454 mediaTime,
3455 mediaDuration,
3456 mediaRate);
3457 if (_err != noErr) return PyMac_Error(_err);
3458 Py_INCREF(Py_None);
3459 _res = Py_None;
3460 return _res;
3463 static PyObject *TrackObj_InsertTrackSegment(_self, _args)
3464 TrackObject *_self;
3465 PyObject *_args;
3467 PyObject *_res = NULL;
3468 OSErr _err;
3469 Track dstTrack;
3470 TimeValue srcIn;
3471 TimeValue srcDuration;
3472 TimeValue dstIn;
3473 if (!PyArg_ParseTuple(_args, "O&lll",
3474 TrackObj_Convert, &dstTrack,
3475 &srcIn,
3476 &srcDuration,
3477 &dstIn))
3478 return NULL;
3479 _err = InsertTrackSegment(_self->ob_itself,
3480 dstTrack,
3481 srcIn,
3482 srcDuration,
3483 dstIn);
3484 if (_err != noErr) return PyMac_Error(_err);
3485 Py_INCREF(Py_None);
3486 _res = Py_None;
3487 return _res;
3490 static PyObject *TrackObj_InsertEmptyTrackSegment(_self, _args)
3491 TrackObject *_self;
3492 PyObject *_args;
3494 PyObject *_res = NULL;
3495 OSErr _err;
3496 TimeValue dstIn;
3497 TimeValue dstDuration;
3498 if (!PyArg_ParseTuple(_args, "ll",
3499 &dstIn,
3500 &dstDuration))
3501 return NULL;
3502 _err = InsertEmptyTrackSegment(_self->ob_itself,
3503 dstIn,
3504 dstDuration);
3505 if (_err != noErr) return PyMac_Error(_err);
3506 Py_INCREF(Py_None);
3507 _res = Py_None;
3508 return _res;
3511 static PyObject *TrackObj_DeleteTrackSegment(_self, _args)
3512 TrackObject *_self;
3513 PyObject *_args;
3515 PyObject *_res = NULL;
3516 OSErr _err;
3517 TimeValue startTime;
3518 TimeValue duration;
3519 if (!PyArg_ParseTuple(_args, "ll",
3520 &startTime,
3521 &duration))
3522 return NULL;
3523 _err = DeleteTrackSegment(_self->ob_itself,
3524 startTime,
3525 duration);
3526 if (_err != noErr) return PyMac_Error(_err);
3527 Py_INCREF(Py_None);
3528 _res = Py_None;
3529 return _res;
3532 static PyObject *TrackObj_ScaleTrackSegment(_self, _args)
3533 TrackObject *_self;
3534 PyObject *_args;
3536 PyObject *_res = NULL;
3537 OSErr _err;
3538 TimeValue startTime;
3539 TimeValue oldDuration;
3540 TimeValue newDuration;
3541 if (!PyArg_ParseTuple(_args, "lll",
3542 &startTime,
3543 &oldDuration,
3544 &newDuration))
3545 return NULL;
3546 _err = ScaleTrackSegment(_self->ob_itself,
3547 startTime,
3548 oldDuration,
3549 newDuration);
3550 if (_err != noErr) return PyMac_Error(_err);
3551 Py_INCREF(Py_None);
3552 _res = Py_None;
3553 return _res;
3556 static PyObject *TrackObj_IsScrapMovie(_self, _args)
3557 TrackObject *_self;
3558 PyObject *_args;
3560 PyObject *_res = NULL;
3561 Component _rv;
3562 if (!PyArg_ParseTuple(_args, ""))
3563 return NULL;
3564 _rv = IsScrapMovie(_self->ob_itself);
3565 _res = Py_BuildValue("O&",
3566 CmpObj_New, _rv);
3567 return _res;
3570 static PyObject *TrackObj_CopyTrackSettings(_self, _args)
3571 TrackObject *_self;
3572 PyObject *_args;
3574 PyObject *_res = NULL;
3575 OSErr _err;
3576 Track dstTrack;
3577 if (!PyArg_ParseTuple(_args, "O&",
3578 TrackObj_Convert, &dstTrack))
3579 return NULL;
3580 _err = CopyTrackSettings(_self->ob_itself,
3581 dstTrack);
3582 if (_err != noErr) return PyMac_Error(_err);
3583 Py_INCREF(Py_None);
3584 _res = Py_None;
3585 return _res;
3588 static PyObject *TrackObj_AddEmptyTrackToMovie(_self, _args)
3589 TrackObject *_self;
3590 PyObject *_args;
3592 PyObject *_res = NULL;
3593 OSErr _err;
3594 Movie dstMovie;
3595 Handle dataRef;
3596 OSType dataRefType;
3597 Track dstTrack;
3598 if (!PyArg_ParseTuple(_args, "O&O&O&",
3599 MovieObj_Convert, &dstMovie,
3600 ResObj_Convert, &dataRef,
3601 PyMac_GetOSType, &dataRefType))
3602 return NULL;
3603 _err = AddEmptyTrackToMovie(_self->ob_itself,
3604 dstMovie,
3605 dataRef,
3606 dataRefType,
3607 &dstTrack);
3608 if (_err != noErr) return PyMac_Error(_err);
3609 _res = Py_BuildValue("O&",
3610 TrackObj_New, dstTrack);
3611 return _res;
3614 static PyObject *TrackObj_AddTrackReference(_self, _args)
3615 TrackObject *_self;
3616 PyObject *_args;
3618 PyObject *_res = NULL;
3619 OSErr _err;
3620 Track refTrack;
3621 OSType refType;
3622 long addedIndex;
3623 if (!PyArg_ParseTuple(_args, "O&O&",
3624 TrackObj_Convert, &refTrack,
3625 PyMac_GetOSType, &refType))
3626 return NULL;
3627 _err = AddTrackReference(_self->ob_itself,
3628 refTrack,
3629 refType,
3630 &addedIndex);
3631 if (_err != noErr) return PyMac_Error(_err);
3632 _res = Py_BuildValue("l",
3633 addedIndex);
3634 return _res;
3637 static PyObject *TrackObj_DeleteTrackReference(_self, _args)
3638 TrackObject *_self;
3639 PyObject *_args;
3641 PyObject *_res = NULL;
3642 OSErr _err;
3643 OSType refType;
3644 long index;
3645 if (!PyArg_ParseTuple(_args, "O&l",
3646 PyMac_GetOSType, &refType,
3647 &index))
3648 return NULL;
3649 _err = DeleteTrackReference(_self->ob_itself,
3650 refType,
3651 index);
3652 if (_err != noErr) return PyMac_Error(_err);
3653 Py_INCREF(Py_None);
3654 _res = Py_None;
3655 return _res;
3658 static PyObject *TrackObj_SetTrackReference(_self, _args)
3659 TrackObject *_self;
3660 PyObject *_args;
3662 PyObject *_res = NULL;
3663 OSErr _err;
3664 Track refTrack;
3665 OSType refType;
3666 long index;
3667 if (!PyArg_ParseTuple(_args, "O&O&l",
3668 TrackObj_Convert, &refTrack,
3669 PyMac_GetOSType, &refType,
3670 &index))
3671 return NULL;
3672 _err = SetTrackReference(_self->ob_itself,
3673 refTrack,
3674 refType,
3675 index);
3676 if (_err != noErr) return PyMac_Error(_err);
3677 Py_INCREF(Py_None);
3678 _res = Py_None;
3679 return _res;
3682 static PyObject *TrackObj_GetTrackReference(_self, _args)
3683 TrackObject *_self;
3684 PyObject *_args;
3686 PyObject *_res = NULL;
3687 Track _rv;
3688 OSType refType;
3689 long index;
3690 if (!PyArg_ParseTuple(_args, "O&l",
3691 PyMac_GetOSType, &refType,
3692 &index))
3693 return NULL;
3694 _rv = GetTrackReference(_self->ob_itself,
3695 refType,
3696 index);
3697 _res = Py_BuildValue("O&",
3698 TrackObj_New, _rv);
3699 return _res;
3702 static PyObject *TrackObj_GetNextTrackReferenceType(_self, _args)
3703 TrackObject *_self;
3704 PyObject *_args;
3706 PyObject *_res = NULL;
3707 OSType _rv;
3708 OSType refType;
3709 if (!PyArg_ParseTuple(_args, "O&",
3710 PyMac_GetOSType, &refType))
3711 return NULL;
3712 _rv = GetNextTrackReferenceType(_self->ob_itself,
3713 refType);
3714 _res = Py_BuildValue("O&",
3715 PyMac_BuildOSType, _rv);
3716 return _res;
3719 static PyObject *TrackObj_GetTrackReferenceCount(_self, _args)
3720 TrackObject *_self;
3721 PyObject *_args;
3723 PyObject *_res = NULL;
3724 long _rv;
3725 OSType refType;
3726 if (!PyArg_ParseTuple(_args, "O&",
3727 PyMac_GetOSType, &refType))
3728 return NULL;
3729 _rv = GetTrackReferenceCount(_self->ob_itself,
3730 refType);
3731 _res = Py_BuildValue("l",
3732 _rv);
3733 return _res;
3736 static PyObject *TrackObj_GetTrackEditRate(_self, _args)
3737 TrackObject *_self;
3738 PyObject *_args;
3740 PyObject *_res = NULL;
3741 Fixed _rv;
3742 TimeValue atTime;
3743 if (!PyArg_ParseTuple(_args, "l",
3744 &atTime))
3745 return NULL;
3746 _rv = GetTrackEditRate(_self->ob_itself,
3747 atTime);
3748 _res = Py_BuildValue("O&",
3749 PyMac_BuildFixed, _rv);
3750 return _res;
3753 static PyObject *TrackObj_GetTrackDataSize(_self, _args)
3754 TrackObject *_self;
3755 PyObject *_args;
3757 PyObject *_res = NULL;
3758 long _rv;
3759 TimeValue startTime;
3760 TimeValue duration;
3761 if (!PyArg_ParseTuple(_args, "ll",
3762 &startTime,
3763 &duration))
3764 return NULL;
3765 _rv = GetTrackDataSize(_self->ob_itself,
3766 startTime,
3767 duration);
3768 _res = Py_BuildValue("l",
3769 _rv);
3770 return _res;
3773 static PyObject *TrackObj_PtInTrack(_self, _args)
3774 TrackObject *_self;
3775 PyObject *_args;
3777 PyObject *_res = NULL;
3778 Boolean _rv;
3779 Point pt;
3780 if (!PyArg_ParseTuple(_args, "O&",
3781 PyMac_GetPoint, &pt))
3782 return NULL;
3783 _rv = PtInTrack(_self->ob_itself,
3784 pt);
3785 _res = Py_BuildValue("b",
3786 _rv);
3787 return _res;
3790 static PyObject *TrackObj_GetTrackNextInterestingTime(_self, _args)
3791 TrackObject *_self;
3792 PyObject *_args;
3794 PyObject *_res = NULL;
3795 short interestingTimeFlags;
3796 TimeValue time;
3797 Fixed rate;
3798 TimeValue interestingTime;
3799 TimeValue interestingDuration;
3800 if (!PyArg_ParseTuple(_args, "hlO&",
3801 &interestingTimeFlags,
3802 &time,
3803 PyMac_GetFixed, &rate))
3804 return NULL;
3805 GetTrackNextInterestingTime(_self->ob_itself,
3806 interestingTimeFlags,
3807 time,
3808 rate,
3809 &interestingTime,
3810 &interestingDuration);
3811 _res = Py_BuildValue("ll",
3812 interestingTime,
3813 interestingDuration);
3814 return _res;
3817 static PyObject *TrackObj_GetTrackSegmentDisplayBoundsRgn(_self, _args)
3818 TrackObject *_self;
3819 PyObject *_args;
3821 PyObject *_res = NULL;
3822 RgnHandle _rv;
3823 TimeValue time;
3824 TimeValue duration;
3825 if (!PyArg_ParseTuple(_args, "ll",
3826 &time,
3827 &duration))
3828 return NULL;
3829 _rv = GetTrackSegmentDisplayBoundsRgn(_self->ob_itself,
3830 time,
3831 duration);
3832 _res = Py_BuildValue("O&",
3833 ResObj_New, _rv);
3834 return _res;
3837 static PyObject *TrackObj_GetTrackStatus(_self, _args)
3838 TrackObject *_self;
3839 PyObject *_args;
3841 PyObject *_res = NULL;
3842 ComponentResult _rv;
3843 if (!PyArg_ParseTuple(_args, ""))
3844 return NULL;
3845 _rv = GetTrackStatus(_self->ob_itself);
3846 _res = Py_BuildValue("l",
3847 _rv);
3848 return _res;
3851 static PyObject *TrackObj_SetTrackLoadSettings(_self, _args)
3852 TrackObject *_self;
3853 PyObject *_args;
3855 PyObject *_res = NULL;
3856 TimeValue preloadTime;
3857 TimeValue preloadDuration;
3858 long preloadFlags;
3859 long defaultHints;
3860 if (!PyArg_ParseTuple(_args, "llll",
3861 &preloadTime,
3862 &preloadDuration,
3863 &preloadFlags,
3864 &defaultHints))
3865 return NULL;
3866 SetTrackLoadSettings(_self->ob_itself,
3867 preloadTime,
3868 preloadDuration,
3869 preloadFlags,
3870 defaultHints);
3871 Py_INCREF(Py_None);
3872 _res = Py_None;
3873 return _res;
3876 static PyObject *TrackObj_GetTrackLoadSettings(_self, _args)
3877 TrackObject *_self;
3878 PyObject *_args;
3880 PyObject *_res = NULL;
3881 TimeValue preloadTime;
3882 TimeValue preloadDuration;
3883 long preloadFlags;
3884 long defaultHints;
3885 if (!PyArg_ParseTuple(_args, ""))
3886 return NULL;
3887 GetTrackLoadSettings(_self->ob_itself,
3888 &preloadTime,
3889 &preloadDuration,
3890 &preloadFlags,
3891 &defaultHints);
3892 _res = Py_BuildValue("llll",
3893 preloadTime,
3894 preloadDuration,
3895 preloadFlags,
3896 defaultHints);
3897 return _res;
3900 static PyMethodDef TrackObj_methods[] = {
3901 {"LoadTrackIntoRam", (PyCFunction)TrackObj_LoadTrackIntoRam, 1,
3902 "(TimeValue time, TimeValue duration, long flags) -> None"},
3903 {"GetTrackPict", (PyCFunction)TrackObj_GetTrackPict, 1,
3904 "(TimeValue time) -> (PicHandle _rv)"},
3905 {"GetTrackClipRgn", (PyCFunction)TrackObj_GetTrackClipRgn, 1,
3906 "() -> (RgnHandle _rv)"},
3907 {"SetTrackClipRgn", (PyCFunction)TrackObj_SetTrackClipRgn, 1,
3908 "(RgnHandle theClip) -> None"},
3909 {"GetTrackDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackDisplayBoundsRgn, 1,
3910 "() -> (RgnHandle _rv)"},
3911 {"GetTrackMovieBoundsRgn", (PyCFunction)TrackObj_GetTrackMovieBoundsRgn, 1,
3912 "() -> (RgnHandle _rv)"},
3913 {"GetTrackBoundsRgn", (PyCFunction)TrackObj_GetTrackBoundsRgn, 1,
3914 "() -> (RgnHandle _rv)"},
3915 {"GetTrackMatte", (PyCFunction)TrackObj_GetTrackMatte, 1,
3916 "() -> (PixMapHandle _rv)"},
3917 {"SetTrackMatte", (PyCFunction)TrackObj_SetTrackMatte, 1,
3918 "(PixMapHandle theMatte) -> None"},
3919 {"GetTrackID", (PyCFunction)TrackObj_GetTrackID, 1,
3920 "() -> (long _rv)"},
3921 {"GetTrackMovie", (PyCFunction)TrackObj_GetTrackMovie, 1,
3922 "() -> (Movie _rv)"},
3923 {"GetTrackCreationTime", (PyCFunction)TrackObj_GetTrackCreationTime, 1,
3924 "() -> (unsigned long _rv)"},
3925 {"GetTrackModificationTime", (PyCFunction)TrackObj_GetTrackModificationTime, 1,
3926 "() -> (unsigned long _rv)"},
3927 {"GetTrackEnabled", (PyCFunction)TrackObj_GetTrackEnabled, 1,
3928 "() -> (Boolean _rv)"},
3929 {"SetTrackEnabled", (PyCFunction)TrackObj_SetTrackEnabled, 1,
3930 "(Boolean isEnabled) -> None"},
3931 {"GetTrackUsage", (PyCFunction)TrackObj_GetTrackUsage, 1,
3932 "() -> (long _rv)"},
3933 {"SetTrackUsage", (PyCFunction)TrackObj_SetTrackUsage, 1,
3934 "(long usage) -> None"},
3935 {"GetTrackDuration", (PyCFunction)TrackObj_GetTrackDuration, 1,
3936 "() -> (TimeValue _rv)"},
3937 {"GetTrackOffset", (PyCFunction)TrackObj_GetTrackOffset, 1,
3938 "() -> (TimeValue _rv)"},
3939 {"SetTrackOffset", (PyCFunction)TrackObj_SetTrackOffset, 1,
3940 "(TimeValue movieOffsetTime) -> None"},
3941 {"GetTrackLayer", (PyCFunction)TrackObj_GetTrackLayer, 1,
3942 "() -> (short _rv)"},
3943 {"SetTrackLayer", (PyCFunction)TrackObj_SetTrackLayer, 1,
3944 "(short layer) -> None"},
3945 {"GetTrackAlternate", (PyCFunction)TrackObj_GetTrackAlternate, 1,
3946 "() -> (Track _rv)"},
3947 {"SetTrackAlternate", (PyCFunction)TrackObj_SetTrackAlternate, 1,
3948 "(Track alternateT) -> None"},
3949 {"GetTrackVolume", (PyCFunction)TrackObj_GetTrackVolume, 1,
3950 "() -> (short _rv)"},
3951 {"SetTrackVolume", (PyCFunction)TrackObj_SetTrackVolume, 1,
3952 "(short volume) -> None"},
3953 {"GetTrackDimensions", (PyCFunction)TrackObj_GetTrackDimensions, 1,
3954 "() -> (Fixed width, Fixed height)"},
3955 {"SetTrackDimensions", (PyCFunction)TrackObj_SetTrackDimensions, 1,
3956 "(Fixed width, Fixed height) -> None"},
3957 {"GetTrackUserData", (PyCFunction)TrackObj_GetTrackUserData, 1,
3958 "() -> (UserData _rv)"},
3959 {"GetTrackSoundLocalizationSettings", (PyCFunction)TrackObj_GetTrackSoundLocalizationSettings, 1,
3960 "() -> (Handle settings)"},
3961 {"SetTrackSoundLocalizationSettings", (PyCFunction)TrackObj_SetTrackSoundLocalizationSettings, 1,
3962 "(Handle settings) -> None"},
3963 {"NewTrackMedia", (PyCFunction)TrackObj_NewTrackMedia, 1,
3964 "(OSType mediaType, TimeScale timeScale, Handle dataRef, OSType dataRefType) -> (Media _rv)"},
3965 {"GetTrackMedia", (PyCFunction)TrackObj_GetTrackMedia, 1,
3966 "() -> (Media _rv)"},
3967 {"InsertMediaIntoTrack", (PyCFunction)TrackObj_InsertMediaIntoTrack, 1,
3968 "(TimeValue trackStart, TimeValue mediaTime, TimeValue mediaDuration, Fixed mediaRate) -> None"},
3969 {"InsertTrackSegment", (PyCFunction)TrackObj_InsertTrackSegment, 1,
3970 "(Track dstTrack, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
3971 {"InsertEmptyTrackSegment", (PyCFunction)TrackObj_InsertEmptyTrackSegment, 1,
3972 "(TimeValue dstIn, TimeValue dstDuration) -> None"},
3973 {"DeleteTrackSegment", (PyCFunction)TrackObj_DeleteTrackSegment, 1,
3974 "(TimeValue startTime, TimeValue duration) -> None"},
3975 {"ScaleTrackSegment", (PyCFunction)TrackObj_ScaleTrackSegment, 1,
3976 "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
3977 {"IsScrapMovie", (PyCFunction)TrackObj_IsScrapMovie, 1,
3978 "() -> (Component _rv)"},
3979 {"CopyTrackSettings", (PyCFunction)TrackObj_CopyTrackSettings, 1,
3980 "(Track dstTrack) -> None"},
3981 {"AddEmptyTrackToMovie", (PyCFunction)TrackObj_AddEmptyTrackToMovie, 1,
3982 "(Movie dstMovie, Handle dataRef, OSType dataRefType) -> (Track dstTrack)"},
3983 {"AddTrackReference", (PyCFunction)TrackObj_AddTrackReference, 1,
3984 "(Track refTrack, OSType refType) -> (long addedIndex)"},
3985 {"DeleteTrackReference", (PyCFunction)TrackObj_DeleteTrackReference, 1,
3986 "(OSType refType, long index) -> None"},
3987 {"SetTrackReference", (PyCFunction)TrackObj_SetTrackReference, 1,
3988 "(Track refTrack, OSType refType, long index) -> None"},
3989 {"GetTrackReference", (PyCFunction)TrackObj_GetTrackReference, 1,
3990 "(OSType refType, long index) -> (Track _rv)"},
3991 {"GetNextTrackReferenceType", (PyCFunction)TrackObj_GetNextTrackReferenceType, 1,
3992 "(OSType refType) -> (OSType _rv)"},
3993 {"GetTrackReferenceCount", (PyCFunction)TrackObj_GetTrackReferenceCount, 1,
3994 "(OSType refType) -> (long _rv)"},
3995 {"GetTrackEditRate", (PyCFunction)TrackObj_GetTrackEditRate, 1,
3996 "(TimeValue atTime) -> (Fixed _rv)"},
3997 {"GetTrackDataSize", (PyCFunction)TrackObj_GetTrackDataSize, 1,
3998 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
3999 {"PtInTrack", (PyCFunction)TrackObj_PtInTrack, 1,
4000 "(Point pt) -> (Boolean _rv)"},
4001 {"GetTrackNextInterestingTime", (PyCFunction)TrackObj_GetTrackNextInterestingTime, 1,
4002 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
4003 {"GetTrackSegmentDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackSegmentDisplayBoundsRgn, 1,
4004 "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
4005 {"GetTrackStatus", (PyCFunction)TrackObj_GetTrackStatus, 1,
4006 "() -> (ComponentResult _rv)"},
4007 {"SetTrackLoadSettings", (PyCFunction)TrackObj_SetTrackLoadSettings, 1,
4008 "(TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints) -> None"},
4009 {"GetTrackLoadSettings", (PyCFunction)TrackObj_GetTrackLoadSettings, 1,
4010 "() -> (TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints)"},
4011 {NULL, NULL, 0}
4014 PyMethodChain TrackObj_chain = { TrackObj_methods, NULL };
4016 static PyObject *TrackObj_getattr(self, name)
4017 TrackObject *self;
4018 char *name;
4020 return Py_FindMethodInChain(&TrackObj_chain, (PyObject *)self, name);
4023 #define TrackObj_setattr NULL
4025 #define TrackObj_compare NULL
4027 #define TrackObj_repr NULL
4029 #define TrackObj_hash NULL
4031 PyTypeObject Track_Type = {
4032 PyObject_HEAD_INIT(&PyType_Type)
4033 0, /*ob_size*/
4034 "Track", /*tp_name*/
4035 sizeof(TrackObject), /*tp_basicsize*/
4036 0, /*tp_itemsize*/
4037 /* methods */
4038 (destructor) TrackObj_dealloc, /*tp_dealloc*/
4039 0, /*tp_print*/
4040 (getattrfunc) TrackObj_getattr, /*tp_getattr*/
4041 (setattrfunc) TrackObj_setattr, /*tp_setattr*/
4042 (cmpfunc) TrackObj_compare, /*tp_compare*/
4043 (reprfunc) TrackObj_repr, /*tp_repr*/
4044 (PyNumberMethods *)0, /* tp_as_number */
4045 (PySequenceMethods *)0, /* tp_as_sequence */
4046 (PyMappingMethods *)0, /* tp_as_mapping */
4047 (hashfunc) TrackObj_hash, /*tp_hash*/
4050 /* --------------------- End object type Track ---------------------- */
4053 /* ----------------------- Object type Movie ------------------------ */
4055 PyTypeObject Movie_Type;
4057 #define MovieObj_Check(x) ((x)->ob_type == &Movie_Type)
4059 typedef struct MovieObject {
4060 PyObject_HEAD
4061 Movie ob_itself;
4062 } MovieObject;
4064 PyObject *MovieObj_New(itself)
4065 Movie itself;
4067 MovieObject *it;
4068 if (itself == NULL) {
4069 PyErr_SetString(Qt_Error,"Cannot create null Movie");
4070 return NULL;
4072 it = PyObject_NEW(MovieObject, &Movie_Type);
4073 if (it == NULL) return NULL;
4074 it->ob_itself = itself;
4075 return (PyObject *)it;
4077 MovieObj_Convert(v, p_itself)
4078 PyObject *v;
4079 Movie *p_itself;
4081 if (!MovieObj_Check(v))
4083 PyErr_SetString(PyExc_TypeError, "Movie required");
4084 return 0;
4086 *p_itself = ((MovieObject *)v)->ob_itself;
4087 return 1;
4090 static void MovieObj_dealloc(self)
4091 MovieObject *self;
4093 DisposeMovie(self->ob_itself);
4094 PyMem_DEL(self);
4097 static PyObject *MovieObj_MoviesTask(_self, _args)
4098 MovieObject *_self;
4099 PyObject *_args;
4101 PyObject *_res = NULL;
4102 long maxMilliSecToUse;
4103 if (!PyArg_ParseTuple(_args, "l",
4104 &maxMilliSecToUse))
4105 return NULL;
4106 MoviesTask(_self->ob_itself,
4107 maxMilliSecToUse);
4108 Py_INCREF(Py_None);
4109 _res = Py_None;
4110 return _res;
4113 static PyObject *MovieObj_PrerollMovie(_self, _args)
4114 MovieObject *_self;
4115 PyObject *_args;
4117 PyObject *_res = NULL;
4118 OSErr _err;
4119 TimeValue time;
4120 Fixed Rate;
4121 if (!PyArg_ParseTuple(_args, "lO&",
4122 &time,
4123 PyMac_GetFixed, &Rate))
4124 return NULL;
4125 _err = PrerollMovie(_self->ob_itself,
4126 time,
4127 Rate);
4128 if (_err != noErr) return PyMac_Error(_err);
4129 Py_INCREF(Py_None);
4130 _res = Py_None;
4131 return _res;
4134 static PyObject *MovieObj_LoadMovieIntoRam(_self, _args)
4135 MovieObject *_self;
4136 PyObject *_args;
4138 PyObject *_res = NULL;
4139 OSErr _err;
4140 TimeValue time;
4141 TimeValue duration;
4142 long flags;
4143 if (!PyArg_ParseTuple(_args, "lll",
4144 &time,
4145 &duration,
4146 &flags))
4147 return NULL;
4148 _err = LoadMovieIntoRam(_self->ob_itself,
4149 time,
4150 duration,
4151 flags);
4152 if (_err != noErr) return PyMac_Error(_err);
4153 Py_INCREF(Py_None);
4154 _res = Py_None;
4155 return _res;
4158 static PyObject *MovieObj_SetMovieActive(_self, _args)
4159 MovieObject *_self;
4160 PyObject *_args;
4162 PyObject *_res = NULL;
4163 Boolean active;
4164 if (!PyArg_ParseTuple(_args, "b",
4165 &active))
4166 return NULL;
4167 SetMovieActive(_self->ob_itself,
4168 active);
4169 Py_INCREF(Py_None);
4170 _res = Py_None;
4171 return _res;
4174 static PyObject *MovieObj_GetMovieActive(_self, _args)
4175 MovieObject *_self;
4176 PyObject *_args;
4178 PyObject *_res = NULL;
4179 Boolean _rv;
4180 if (!PyArg_ParseTuple(_args, ""))
4181 return NULL;
4182 _rv = GetMovieActive(_self->ob_itself);
4183 _res = Py_BuildValue("b",
4184 _rv);
4185 return _res;
4188 static PyObject *MovieObj_StartMovie(_self, _args)
4189 MovieObject *_self;
4190 PyObject *_args;
4192 PyObject *_res = NULL;
4193 if (!PyArg_ParseTuple(_args, ""))
4194 return NULL;
4195 StartMovie(_self->ob_itself);
4196 Py_INCREF(Py_None);
4197 _res = Py_None;
4198 return _res;
4201 static PyObject *MovieObj_StopMovie(_self, _args)
4202 MovieObject *_self;
4203 PyObject *_args;
4205 PyObject *_res = NULL;
4206 if (!PyArg_ParseTuple(_args, ""))
4207 return NULL;
4208 StopMovie(_self->ob_itself);
4209 Py_INCREF(Py_None);
4210 _res = Py_None;
4211 return _res;
4214 static PyObject *MovieObj_GoToBeginningOfMovie(_self, _args)
4215 MovieObject *_self;
4216 PyObject *_args;
4218 PyObject *_res = NULL;
4219 if (!PyArg_ParseTuple(_args, ""))
4220 return NULL;
4221 GoToBeginningOfMovie(_self->ob_itself);
4222 Py_INCREF(Py_None);
4223 _res = Py_None;
4224 return _res;
4227 static PyObject *MovieObj_GoToEndOfMovie(_self, _args)
4228 MovieObject *_self;
4229 PyObject *_args;
4231 PyObject *_res = NULL;
4232 if (!PyArg_ParseTuple(_args, ""))
4233 return NULL;
4234 GoToEndOfMovie(_self->ob_itself);
4235 Py_INCREF(Py_None);
4236 _res = Py_None;
4237 return _res;
4240 static PyObject *MovieObj_IsMovieDone(_self, _args)
4241 MovieObject *_self;
4242 PyObject *_args;
4244 PyObject *_res = NULL;
4245 Boolean _rv;
4246 if (!PyArg_ParseTuple(_args, ""))
4247 return NULL;
4248 _rv = IsMovieDone(_self->ob_itself);
4249 _res = Py_BuildValue("b",
4250 _rv);
4251 return _res;
4254 static PyObject *MovieObj_GetMoviePreviewMode(_self, _args)
4255 MovieObject *_self;
4256 PyObject *_args;
4258 PyObject *_res = NULL;
4259 Boolean _rv;
4260 if (!PyArg_ParseTuple(_args, ""))
4261 return NULL;
4262 _rv = GetMoviePreviewMode(_self->ob_itself);
4263 _res = Py_BuildValue("b",
4264 _rv);
4265 return _res;
4268 static PyObject *MovieObj_SetMoviePreviewMode(_self, _args)
4269 MovieObject *_self;
4270 PyObject *_args;
4272 PyObject *_res = NULL;
4273 Boolean usePreview;
4274 if (!PyArg_ParseTuple(_args, "b",
4275 &usePreview))
4276 return NULL;
4277 SetMoviePreviewMode(_self->ob_itself,
4278 usePreview);
4279 Py_INCREF(Py_None);
4280 _res = Py_None;
4281 return _res;
4284 static PyObject *MovieObj_ShowMoviePoster(_self, _args)
4285 MovieObject *_self;
4286 PyObject *_args;
4288 PyObject *_res = NULL;
4289 if (!PyArg_ParseTuple(_args, ""))
4290 return NULL;
4291 ShowMoviePoster(_self->ob_itself);
4292 Py_INCREF(Py_None);
4293 _res = Py_None;
4294 return _res;
4297 static PyObject *MovieObj_GetMovieTimeBase(_self, _args)
4298 MovieObject *_self;
4299 PyObject *_args;
4301 PyObject *_res = NULL;
4302 TimeBase _rv;
4303 if (!PyArg_ParseTuple(_args, ""))
4304 return NULL;
4305 _rv = GetMovieTimeBase(_self->ob_itself);
4306 _res = Py_BuildValue("O&",
4307 TimeBaseObj_New, _rv);
4308 return _res;
4311 static PyObject *MovieObj_SetMovieMasterTimeBase(_self, _args)
4312 MovieObject *_self;
4313 PyObject *_args;
4315 PyObject *_res = NULL;
4316 TimeBase tb;
4317 TimeRecord slaveZero;
4318 if (!PyArg_ParseTuple(_args, "O&O&",
4319 TimeBaseObj_Convert, &tb,
4320 QtTimeRecord_Convert, &slaveZero))
4321 return NULL;
4322 SetMovieMasterTimeBase(_self->ob_itself,
4324 &slaveZero);
4325 Py_INCREF(Py_None);
4326 _res = Py_None;
4327 return _res;
4330 static PyObject *MovieObj_SetMovieMasterClock(_self, _args)
4331 MovieObject *_self;
4332 PyObject *_args;
4334 PyObject *_res = NULL;
4335 Component clockMeister;
4336 TimeRecord slaveZero;
4337 if (!PyArg_ParseTuple(_args, "O&O&",
4338 CmpObj_Convert, &clockMeister,
4339 QtTimeRecord_Convert, &slaveZero))
4340 return NULL;
4341 SetMovieMasterClock(_self->ob_itself,
4342 clockMeister,
4343 &slaveZero);
4344 Py_INCREF(Py_None);
4345 _res = Py_None;
4346 return _res;
4349 static PyObject *MovieObj_GetMovieGWorld(_self, _args)
4350 MovieObject *_self;
4351 PyObject *_args;
4353 PyObject *_res = NULL;
4354 CGrafPtr port;
4355 GDHandle gdh;
4356 if (!PyArg_ParseTuple(_args, ""))
4357 return NULL;
4358 GetMovieGWorld(_self->ob_itself,
4359 &port,
4360 &gdh);
4361 _res = Py_BuildValue("O&O&",
4362 GrafObj_New, port,
4363 OptResObj_New, gdh);
4364 return _res;
4367 static PyObject *MovieObj_SetMovieGWorld(_self, _args)
4368 MovieObject *_self;
4369 PyObject *_args;
4371 PyObject *_res = NULL;
4372 CGrafPtr port;
4373 GDHandle gdh;
4374 if (!PyArg_ParseTuple(_args, "O&O&",
4375 GrafObj_Convert, &port,
4376 OptResObj_Convert, &gdh))
4377 return NULL;
4378 SetMovieGWorld(_self->ob_itself,
4379 port,
4380 gdh);
4381 Py_INCREF(Py_None);
4382 _res = Py_None;
4383 return _res;
4386 static PyObject *MovieObj_GetMovieNaturalBoundsRect(_self, _args)
4387 MovieObject *_self;
4388 PyObject *_args;
4390 PyObject *_res = NULL;
4391 Rect naturalBounds;
4392 if (!PyArg_ParseTuple(_args, ""))
4393 return NULL;
4394 GetMovieNaturalBoundsRect(_self->ob_itself,
4395 &naturalBounds);
4396 _res = Py_BuildValue("O&",
4397 PyMac_BuildRect, &naturalBounds);
4398 return _res;
4401 static PyObject *MovieObj_GetNextTrackForCompositing(_self, _args)
4402 MovieObject *_self;
4403 PyObject *_args;
4405 PyObject *_res = NULL;
4406 Track _rv;
4407 Track theTrack;
4408 if (!PyArg_ParseTuple(_args, "O&",
4409 TrackObj_Convert, &theTrack))
4410 return NULL;
4411 _rv = GetNextTrackForCompositing(_self->ob_itself,
4412 theTrack);
4413 _res = Py_BuildValue("O&",
4414 TrackObj_New, _rv);
4415 return _res;
4418 static PyObject *MovieObj_GetPrevTrackForCompositing(_self, _args)
4419 MovieObject *_self;
4420 PyObject *_args;
4422 PyObject *_res = NULL;
4423 Track _rv;
4424 Track theTrack;
4425 if (!PyArg_ParseTuple(_args, "O&",
4426 TrackObj_Convert, &theTrack))
4427 return NULL;
4428 _rv = GetPrevTrackForCompositing(_self->ob_itself,
4429 theTrack);
4430 _res = Py_BuildValue("O&",
4431 TrackObj_New, _rv);
4432 return _res;
4435 static PyObject *MovieObj_GetMoviePict(_self, _args)
4436 MovieObject *_self;
4437 PyObject *_args;
4439 PyObject *_res = NULL;
4440 PicHandle _rv;
4441 TimeValue time;
4442 if (!PyArg_ParseTuple(_args, "l",
4443 &time))
4444 return NULL;
4445 _rv = GetMoviePict(_self->ob_itself,
4446 time);
4447 _res = Py_BuildValue("O&",
4448 ResObj_New, _rv);
4449 return _res;
4452 static PyObject *MovieObj_GetMoviePosterPict(_self, _args)
4453 MovieObject *_self;
4454 PyObject *_args;
4456 PyObject *_res = NULL;
4457 PicHandle _rv;
4458 if (!PyArg_ParseTuple(_args, ""))
4459 return NULL;
4460 _rv = GetMoviePosterPict(_self->ob_itself);
4461 _res = Py_BuildValue("O&",
4462 ResObj_New, _rv);
4463 return _res;
4466 static PyObject *MovieObj_UpdateMovie(_self, _args)
4467 MovieObject *_self;
4468 PyObject *_args;
4470 PyObject *_res = NULL;
4471 OSErr _err;
4472 if (!PyArg_ParseTuple(_args, ""))
4473 return NULL;
4474 _err = UpdateMovie(_self->ob_itself);
4475 if (_err != noErr) return PyMac_Error(_err);
4476 Py_INCREF(Py_None);
4477 _res = Py_None;
4478 return _res;
4481 static PyObject *MovieObj_InvalidateMovieRegion(_self, _args)
4482 MovieObject *_self;
4483 PyObject *_args;
4485 PyObject *_res = NULL;
4486 OSErr _err;
4487 RgnHandle invalidRgn;
4488 if (!PyArg_ParseTuple(_args, "O&",
4489 ResObj_Convert, &invalidRgn))
4490 return NULL;
4491 _err = InvalidateMovieRegion(_self->ob_itself,
4492 invalidRgn);
4493 if (_err != noErr) return PyMac_Error(_err);
4494 Py_INCREF(Py_None);
4495 _res = Py_None;
4496 return _res;
4499 static PyObject *MovieObj_GetMovieBox(_self, _args)
4500 MovieObject *_self;
4501 PyObject *_args;
4503 PyObject *_res = NULL;
4504 Rect boxRect;
4505 if (!PyArg_ParseTuple(_args, ""))
4506 return NULL;
4507 GetMovieBox(_self->ob_itself,
4508 &boxRect);
4509 _res = Py_BuildValue("O&",
4510 PyMac_BuildRect, &boxRect);
4511 return _res;
4514 static PyObject *MovieObj_SetMovieBox(_self, _args)
4515 MovieObject *_self;
4516 PyObject *_args;
4518 PyObject *_res = NULL;
4519 Rect boxRect;
4520 if (!PyArg_ParseTuple(_args, "O&",
4521 PyMac_GetRect, &boxRect))
4522 return NULL;
4523 SetMovieBox(_self->ob_itself,
4524 &boxRect);
4525 Py_INCREF(Py_None);
4526 _res = Py_None;
4527 return _res;
4530 static PyObject *MovieObj_GetMovieDisplayClipRgn(_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 = GetMovieDisplayClipRgn(_self->ob_itself);
4539 _res = Py_BuildValue("O&",
4540 ResObj_New, _rv);
4541 return _res;
4544 static PyObject *MovieObj_SetMovieDisplayClipRgn(_self, _args)
4545 MovieObject *_self;
4546 PyObject *_args;
4548 PyObject *_res = NULL;
4549 RgnHandle theClip;
4550 if (!PyArg_ParseTuple(_args, "O&",
4551 ResObj_Convert, &theClip))
4552 return NULL;
4553 SetMovieDisplayClipRgn(_self->ob_itself,
4554 theClip);
4555 Py_INCREF(Py_None);
4556 _res = Py_None;
4557 return _res;
4560 static PyObject *MovieObj_GetMovieClipRgn(_self, _args)
4561 MovieObject *_self;
4562 PyObject *_args;
4564 PyObject *_res = NULL;
4565 RgnHandle _rv;
4566 if (!PyArg_ParseTuple(_args, ""))
4567 return NULL;
4568 _rv = GetMovieClipRgn(_self->ob_itself);
4569 _res = Py_BuildValue("O&",
4570 ResObj_New, _rv);
4571 return _res;
4574 static PyObject *MovieObj_SetMovieClipRgn(_self, _args)
4575 MovieObject *_self;
4576 PyObject *_args;
4578 PyObject *_res = NULL;
4579 RgnHandle theClip;
4580 if (!PyArg_ParseTuple(_args, "O&",
4581 ResObj_Convert, &theClip))
4582 return NULL;
4583 SetMovieClipRgn(_self->ob_itself,
4584 theClip);
4585 Py_INCREF(Py_None);
4586 _res = Py_None;
4587 return _res;
4590 static PyObject *MovieObj_GetMovieDisplayBoundsRgn(_self, _args)
4591 MovieObject *_self;
4592 PyObject *_args;
4594 PyObject *_res = NULL;
4595 RgnHandle _rv;
4596 if (!PyArg_ParseTuple(_args, ""))
4597 return NULL;
4598 _rv = GetMovieDisplayBoundsRgn(_self->ob_itself);
4599 _res = Py_BuildValue("O&",
4600 ResObj_New, _rv);
4601 return _res;
4604 static PyObject *MovieObj_GetMovieBoundsRgn(_self, _args)
4605 MovieObject *_self;
4606 PyObject *_args;
4608 PyObject *_res = NULL;
4609 RgnHandle _rv;
4610 if (!PyArg_ParseTuple(_args, ""))
4611 return NULL;
4612 _rv = GetMovieBoundsRgn(_self->ob_itself);
4613 _res = Py_BuildValue("O&",
4614 ResObj_New, _rv);
4615 return _res;
4618 static PyObject *MovieObj_PutMovieIntoHandle(_self, _args)
4619 MovieObject *_self;
4620 PyObject *_args;
4622 PyObject *_res = NULL;
4623 OSErr _err;
4624 Handle publicMovie;
4625 if (!PyArg_ParseTuple(_args, "O&",
4626 ResObj_Convert, &publicMovie))
4627 return NULL;
4628 _err = PutMovieIntoHandle(_self->ob_itself,
4629 publicMovie);
4630 if (_err != noErr) return PyMac_Error(_err);
4631 Py_INCREF(Py_None);
4632 _res = Py_None;
4633 return _res;
4636 static PyObject *MovieObj_PutMovieIntoDataFork(_self, _args)
4637 MovieObject *_self;
4638 PyObject *_args;
4640 PyObject *_res = NULL;
4641 OSErr _err;
4642 short fRefNum;
4643 long offset;
4644 long maxSize;
4645 if (!PyArg_ParseTuple(_args, "hll",
4646 &fRefNum,
4647 &offset,
4648 &maxSize))
4649 return NULL;
4650 _err = PutMovieIntoDataFork(_self->ob_itself,
4651 fRefNum,
4652 offset,
4653 maxSize);
4654 if (_err != noErr) return PyMac_Error(_err);
4655 Py_INCREF(Py_None);
4656 _res = Py_None;
4657 return _res;
4660 static PyObject *MovieObj_GetMovieCreationTime(_self, _args)
4661 MovieObject *_self;
4662 PyObject *_args;
4664 PyObject *_res = NULL;
4665 unsigned long _rv;
4666 if (!PyArg_ParseTuple(_args, ""))
4667 return NULL;
4668 _rv = GetMovieCreationTime(_self->ob_itself);
4669 _res = Py_BuildValue("l",
4670 _rv);
4671 return _res;
4674 static PyObject *MovieObj_GetMovieModificationTime(_self, _args)
4675 MovieObject *_self;
4676 PyObject *_args;
4678 PyObject *_res = NULL;
4679 unsigned long _rv;
4680 if (!PyArg_ParseTuple(_args, ""))
4681 return NULL;
4682 _rv = GetMovieModificationTime(_self->ob_itself);
4683 _res = Py_BuildValue("l",
4684 _rv);
4685 return _res;
4688 static PyObject *MovieObj_GetMovieTimeScale(_self, _args)
4689 MovieObject *_self;
4690 PyObject *_args;
4692 PyObject *_res = NULL;
4693 TimeScale _rv;
4694 if (!PyArg_ParseTuple(_args, ""))
4695 return NULL;
4696 _rv = GetMovieTimeScale(_self->ob_itself);
4697 _res = Py_BuildValue("l",
4698 _rv);
4699 return _res;
4702 static PyObject *MovieObj_SetMovieTimeScale(_self, _args)
4703 MovieObject *_self;
4704 PyObject *_args;
4706 PyObject *_res = NULL;
4707 TimeScale timeScale;
4708 if (!PyArg_ParseTuple(_args, "l",
4709 &timeScale))
4710 return NULL;
4711 SetMovieTimeScale(_self->ob_itself,
4712 timeScale);
4713 Py_INCREF(Py_None);
4714 _res = Py_None;
4715 return _res;
4718 static PyObject *MovieObj_GetMovieDuration(_self, _args)
4719 MovieObject *_self;
4720 PyObject *_args;
4722 PyObject *_res = NULL;
4723 TimeValue _rv;
4724 if (!PyArg_ParseTuple(_args, ""))
4725 return NULL;
4726 _rv = GetMovieDuration(_self->ob_itself);
4727 _res = Py_BuildValue("l",
4728 _rv);
4729 return _res;
4732 static PyObject *MovieObj_GetMovieRate(_self, _args)
4733 MovieObject *_self;
4734 PyObject *_args;
4736 PyObject *_res = NULL;
4737 Fixed _rv;
4738 if (!PyArg_ParseTuple(_args, ""))
4739 return NULL;
4740 _rv = GetMovieRate(_self->ob_itself);
4741 _res = Py_BuildValue("O&",
4742 PyMac_BuildFixed, _rv);
4743 return _res;
4746 static PyObject *MovieObj_SetMovieRate(_self, _args)
4747 MovieObject *_self;
4748 PyObject *_args;
4750 PyObject *_res = NULL;
4751 Fixed rate;
4752 if (!PyArg_ParseTuple(_args, "O&",
4753 PyMac_GetFixed, &rate))
4754 return NULL;
4755 SetMovieRate(_self->ob_itself,
4756 rate);
4757 Py_INCREF(Py_None);
4758 _res = Py_None;
4759 return _res;
4762 static PyObject *MovieObj_GetMoviePreferredRate(_self, _args)
4763 MovieObject *_self;
4764 PyObject *_args;
4766 PyObject *_res = NULL;
4767 Fixed _rv;
4768 if (!PyArg_ParseTuple(_args, ""))
4769 return NULL;
4770 _rv = GetMoviePreferredRate(_self->ob_itself);
4771 _res = Py_BuildValue("O&",
4772 PyMac_BuildFixed, _rv);
4773 return _res;
4776 static PyObject *MovieObj_SetMoviePreferredRate(_self, _args)
4777 MovieObject *_self;
4778 PyObject *_args;
4780 PyObject *_res = NULL;
4781 Fixed rate;
4782 if (!PyArg_ParseTuple(_args, "O&",
4783 PyMac_GetFixed, &rate))
4784 return NULL;
4785 SetMoviePreferredRate(_self->ob_itself,
4786 rate);
4787 Py_INCREF(Py_None);
4788 _res = Py_None;
4789 return _res;
4792 static PyObject *MovieObj_GetMoviePreferredVolume(_self, _args)
4793 MovieObject *_self;
4794 PyObject *_args;
4796 PyObject *_res = NULL;
4797 short _rv;
4798 if (!PyArg_ParseTuple(_args, ""))
4799 return NULL;
4800 _rv = GetMoviePreferredVolume(_self->ob_itself);
4801 _res = Py_BuildValue("h",
4802 _rv);
4803 return _res;
4806 static PyObject *MovieObj_SetMoviePreferredVolume(_self, _args)
4807 MovieObject *_self;
4808 PyObject *_args;
4810 PyObject *_res = NULL;
4811 short volume;
4812 if (!PyArg_ParseTuple(_args, "h",
4813 &volume))
4814 return NULL;
4815 SetMoviePreferredVolume(_self->ob_itself,
4816 volume);
4817 Py_INCREF(Py_None);
4818 _res = Py_None;
4819 return _res;
4822 static PyObject *MovieObj_GetMovieVolume(_self, _args)
4823 MovieObject *_self;
4824 PyObject *_args;
4826 PyObject *_res = NULL;
4827 short _rv;
4828 if (!PyArg_ParseTuple(_args, ""))
4829 return NULL;
4830 _rv = GetMovieVolume(_self->ob_itself);
4831 _res = Py_BuildValue("h",
4832 _rv);
4833 return _res;
4836 static PyObject *MovieObj_SetMovieVolume(_self, _args)
4837 MovieObject *_self;
4838 PyObject *_args;
4840 PyObject *_res = NULL;
4841 short volume;
4842 if (!PyArg_ParseTuple(_args, "h",
4843 &volume))
4844 return NULL;
4845 SetMovieVolume(_self->ob_itself,
4846 volume);
4847 Py_INCREF(Py_None);
4848 _res = Py_None;
4849 return _res;
4852 static PyObject *MovieObj_GetMoviePreviewTime(_self, _args)
4853 MovieObject *_self;
4854 PyObject *_args;
4856 PyObject *_res = NULL;
4857 TimeValue previewTime;
4858 TimeValue previewDuration;
4859 if (!PyArg_ParseTuple(_args, ""))
4860 return NULL;
4861 GetMoviePreviewTime(_self->ob_itself,
4862 &previewTime,
4863 &previewDuration);
4864 _res = Py_BuildValue("ll",
4865 previewTime,
4866 previewDuration);
4867 return _res;
4870 static PyObject *MovieObj_SetMoviePreviewTime(_self, _args)
4871 MovieObject *_self;
4872 PyObject *_args;
4874 PyObject *_res = NULL;
4875 TimeValue previewTime;
4876 TimeValue previewDuration;
4877 if (!PyArg_ParseTuple(_args, "ll",
4878 &previewTime,
4879 &previewDuration))
4880 return NULL;
4881 SetMoviePreviewTime(_self->ob_itself,
4882 previewTime,
4883 previewDuration);
4884 Py_INCREF(Py_None);
4885 _res = Py_None;
4886 return _res;
4889 static PyObject *MovieObj_GetMoviePosterTime(_self, _args)
4890 MovieObject *_self;
4891 PyObject *_args;
4893 PyObject *_res = NULL;
4894 TimeValue _rv;
4895 if (!PyArg_ParseTuple(_args, ""))
4896 return NULL;
4897 _rv = GetMoviePosterTime(_self->ob_itself);
4898 _res = Py_BuildValue("l",
4899 _rv);
4900 return _res;
4903 static PyObject *MovieObj_SetMoviePosterTime(_self, _args)
4904 MovieObject *_self;
4905 PyObject *_args;
4907 PyObject *_res = NULL;
4908 TimeValue posterTime;
4909 if (!PyArg_ParseTuple(_args, "l",
4910 &posterTime))
4911 return NULL;
4912 SetMoviePosterTime(_self->ob_itself,
4913 posterTime);
4914 Py_INCREF(Py_None);
4915 _res = Py_None;
4916 return _res;
4919 static PyObject *MovieObj_GetMovieSelection(_self, _args)
4920 MovieObject *_self;
4921 PyObject *_args;
4923 PyObject *_res = NULL;
4924 TimeValue selectionTime;
4925 TimeValue selectionDuration;
4926 if (!PyArg_ParseTuple(_args, ""))
4927 return NULL;
4928 GetMovieSelection(_self->ob_itself,
4929 &selectionTime,
4930 &selectionDuration);
4931 _res = Py_BuildValue("ll",
4932 selectionTime,
4933 selectionDuration);
4934 return _res;
4937 static PyObject *MovieObj_SetMovieSelection(_self, _args)
4938 MovieObject *_self;
4939 PyObject *_args;
4941 PyObject *_res = NULL;
4942 TimeValue selectionTime;
4943 TimeValue selectionDuration;
4944 if (!PyArg_ParseTuple(_args, "ll",
4945 &selectionTime,
4946 &selectionDuration))
4947 return NULL;
4948 SetMovieSelection(_self->ob_itself,
4949 selectionTime,
4950 selectionDuration);
4951 Py_INCREF(Py_None);
4952 _res = Py_None;
4953 return _res;
4956 static PyObject *MovieObj_SetMovieActiveSegment(_self, _args)
4957 MovieObject *_self;
4958 PyObject *_args;
4960 PyObject *_res = NULL;
4961 TimeValue startTime;
4962 TimeValue duration;
4963 if (!PyArg_ParseTuple(_args, "ll",
4964 &startTime,
4965 &duration))
4966 return NULL;
4967 SetMovieActiveSegment(_self->ob_itself,
4968 startTime,
4969 duration);
4970 Py_INCREF(Py_None);
4971 _res = Py_None;
4972 return _res;
4975 static PyObject *MovieObj_GetMovieActiveSegment(_self, _args)
4976 MovieObject *_self;
4977 PyObject *_args;
4979 PyObject *_res = NULL;
4980 TimeValue startTime;
4981 TimeValue duration;
4982 if (!PyArg_ParseTuple(_args, ""))
4983 return NULL;
4984 GetMovieActiveSegment(_self->ob_itself,
4985 &startTime,
4986 &duration);
4987 _res = Py_BuildValue("ll",
4988 startTime,
4989 duration);
4990 return _res;
4993 static PyObject *MovieObj_GetMovieTime(_self, _args)
4994 MovieObject *_self;
4995 PyObject *_args;
4997 PyObject *_res = NULL;
4998 TimeValue _rv;
4999 TimeRecord currentTime;
5000 if (!PyArg_ParseTuple(_args, ""))
5001 return NULL;
5002 _rv = GetMovieTime(_self->ob_itself,
5003 &currentTime);
5004 _res = Py_BuildValue("lO&",
5005 _rv,
5006 QtTimeRecord_New, &currentTime);
5007 return _res;
5010 static PyObject *MovieObj_SetMovieTime(_self, _args)
5011 MovieObject *_self;
5012 PyObject *_args;
5014 PyObject *_res = NULL;
5015 TimeRecord newtime;
5016 if (!PyArg_ParseTuple(_args, "O&",
5017 QtTimeRecord_Convert, &newtime))
5018 return NULL;
5019 SetMovieTime(_self->ob_itself,
5020 &newtime);
5021 Py_INCREF(Py_None);
5022 _res = Py_None;
5023 return _res;
5026 static PyObject *MovieObj_SetMovieTimeValue(_self, _args)
5027 MovieObject *_self;
5028 PyObject *_args;
5030 PyObject *_res = NULL;
5031 TimeValue newtime;
5032 if (!PyArg_ParseTuple(_args, "l",
5033 &newtime))
5034 return NULL;
5035 SetMovieTimeValue(_self->ob_itself,
5036 newtime);
5037 Py_INCREF(Py_None);
5038 _res = Py_None;
5039 return _res;
5042 static PyObject *MovieObj_GetMovieUserData(_self, _args)
5043 MovieObject *_self;
5044 PyObject *_args;
5046 PyObject *_res = NULL;
5047 UserData _rv;
5048 if (!PyArg_ParseTuple(_args, ""))
5049 return NULL;
5050 _rv = GetMovieUserData(_self->ob_itself);
5051 _res = Py_BuildValue("O&",
5052 UserDataObj_New, _rv);
5053 return _res;
5056 static PyObject *MovieObj_GetMovieTrackCount(_self, _args)
5057 MovieObject *_self;
5058 PyObject *_args;
5060 PyObject *_res = NULL;
5061 long _rv;
5062 if (!PyArg_ParseTuple(_args, ""))
5063 return NULL;
5064 _rv = GetMovieTrackCount(_self->ob_itself);
5065 _res = Py_BuildValue("l",
5066 _rv);
5067 return _res;
5070 static PyObject *MovieObj_GetMovieTrack(_self, _args)
5071 MovieObject *_self;
5072 PyObject *_args;
5074 PyObject *_res = NULL;
5075 Track _rv;
5076 long trackID;
5077 if (!PyArg_ParseTuple(_args, "l",
5078 &trackID))
5079 return NULL;
5080 _rv = GetMovieTrack(_self->ob_itself,
5081 trackID);
5082 _res = Py_BuildValue("O&",
5083 TrackObj_New, _rv);
5084 return _res;
5087 static PyObject *MovieObj_GetMovieIndTrack(_self, _args)
5088 MovieObject *_self;
5089 PyObject *_args;
5091 PyObject *_res = NULL;
5092 Track _rv;
5093 long index;
5094 if (!PyArg_ParseTuple(_args, "l",
5095 &index))
5096 return NULL;
5097 _rv = GetMovieIndTrack(_self->ob_itself,
5098 index);
5099 _res = Py_BuildValue("O&",
5100 TrackObj_New, _rv);
5101 return _res;
5104 static PyObject *MovieObj_GetMovieIndTrackType(_self, _args)
5105 MovieObject *_self;
5106 PyObject *_args;
5108 PyObject *_res = NULL;
5109 Track _rv;
5110 long index;
5111 OSType trackType;
5112 long flags;
5113 if (!PyArg_ParseTuple(_args, "lO&l",
5114 &index,
5115 PyMac_GetOSType, &trackType,
5116 &flags))
5117 return NULL;
5118 _rv = GetMovieIndTrackType(_self->ob_itself,
5119 index,
5120 trackType,
5121 flags);
5122 _res = Py_BuildValue("O&",
5123 TrackObj_New, _rv);
5124 return _res;
5127 static PyObject *MovieObj_NewMovieTrack(_self, _args)
5128 MovieObject *_self;
5129 PyObject *_args;
5131 PyObject *_res = NULL;
5132 Track _rv;
5133 Fixed width;
5134 Fixed height;
5135 short trackVolume;
5136 if (!PyArg_ParseTuple(_args, "O&O&h",
5137 PyMac_GetFixed, &width,
5138 PyMac_GetFixed, &height,
5139 &trackVolume))
5140 return NULL;
5141 _rv = NewMovieTrack(_self->ob_itself,
5142 width,
5143 height,
5144 trackVolume);
5145 _res = Py_BuildValue("O&",
5146 TrackObj_New, _rv);
5147 return _res;
5150 static PyObject *MovieObj_SetAutoTrackAlternatesEnabled(_self, _args)
5151 MovieObject *_self;
5152 PyObject *_args;
5154 PyObject *_res = NULL;
5155 Boolean enable;
5156 if (!PyArg_ParseTuple(_args, "b",
5157 &enable))
5158 return NULL;
5159 SetAutoTrackAlternatesEnabled(_self->ob_itself,
5160 enable);
5161 Py_INCREF(Py_None);
5162 _res = Py_None;
5163 return _res;
5166 static PyObject *MovieObj_SelectMovieAlternates(_self, _args)
5167 MovieObject *_self;
5168 PyObject *_args;
5170 PyObject *_res = NULL;
5171 if (!PyArg_ParseTuple(_args, ""))
5172 return NULL;
5173 SelectMovieAlternates(_self->ob_itself);
5174 Py_INCREF(Py_None);
5175 _res = Py_None;
5176 return _res;
5179 static PyObject *MovieObj_InsertMovieSegment(_self, _args)
5180 MovieObject *_self;
5181 PyObject *_args;
5183 PyObject *_res = NULL;
5184 OSErr _err;
5185 Movie dstMovie;
5186 TimeValue srcIn;
5187 TimeValue srcDuration;
5188 TimeValue dstIn;
5189 if (!PyArg_ParseTuple(_args, "O&lll",
5190 MovieObj_Convert, &dstMovie,
5191 &srcIn,
5192 &srcDuration,
5193 &dstIn))
5194 return NULL;
5195 _err = InsertMovieSegment(_self->ob_itself,
5196 dstMovie,
5197 srcIn,
5198 srcDuration,
5199 dstIn);
5200 if (_err != noErr) return PyMac_Error(_err);
5201 Py_INCREF(Py_None);
5202 _res = Py_None;
5203 return _res;
5206 static PyObject *MovieObj_InsertEmptyMovieSegment(_self, _args)
5207 MovieObject *_self;
5208 PyObject *_args;
5210 PyObject *_res = NULL;
5211 OSErr _err;
5212 TimeValue dstIn;
5213 TimeValue dstDuration;
5214 if (!PyArg_ParseTuple(_args, "ll",
5215 &dstIn,
5216 &dstDuration))
5217 return NULL;
5218 _err = InsertEmptyMovieSegment(_self->ob_itself,
5219 dstIn,
5220 dstDuration);
5221 if (_err != noErr) return PyMac_Error(_err);
5222 Py_INCREF(Py_None);
5223 _res = Py_None;
5224 return _res;
5227 static PyObject *MovieObj_DeleteMovieSegment(_self, _args)
5228 MovieObject *_self;
5229 PyObject *_args;
5231 PyObject *_res = NULL;
5232 OSErr _err;
5233 TimeValue startTime;
5234 TimeValue duration;
5235 if (!PyArg_ParseTuple(_args, "ll",
5236 &startTime,
5237 &duration))
5238 return NULL;
5239 _err = DeleteMovieSegment(_self->ob_itself,
5240 startTime,
5241 duration);
5242 if (_err != noErr) return PyMac_Error(_err);
5243 Py_INCREF(Py_None);
5244 _res = Py_None;
5245 return _res;
5248 static PyObject *MovieObj_ScaleMovieSegment(_self, _args)
5249 MovieObject *_self;
5250 PyObject *_args;
5252 PyObject *_res = NULL;
5253 OSErr _err;
5254 TimeValue startTime;
5255 TimeValue oldDuration;
5256 TimeValue newDuration;
5257 if (!PyArg_ParseTuple(_args, "lll",
5258 &startTime,
5259 &oldDuration,
5260 &newDuration))
5261 return NULL;
5262 _err = ScaleMovieSegment(_self->ob_itself,
5263 startTime,
5264 oldDuration,
5265 newDuration);
5266 if (_err != noErr) return PyMac_Error(_err);
5267 Py_INCREF(Py_None);
5268 _res = Py_None;
5269 return _res;
5272 static PyObject *MovieObj_CutMovieSelection(_self, _args)
5273 MovieObject *_self;
5274 PyObject *_args;
5276 PyObject *_res = NULL;
5277 Movie _rv;
5278 if (!PyArg_ParseTuple(_args, ""))
5279 return NULL;
5280 _rv = CutMovieSelection(_self->ob_itself);
5281 _res = Py_BuildValue("O&",
5282 MovieObj_New, _rv);
5283 return _res;
5286 static PyObject *MovieObj_CopyMovieSelection(_self, _args)
5287 MovieObject *_self;
5288 PyObject *_args;
5290 PyObject *_res = NULL;
5291 Movie _rv;
5292 if (!PyArg_ParseTuple(_args, ""))
5293 return NULL;
5294 _rv = CopyMovieSelection(_self->ob_itself);
5295 _res = Py_BuildValue("O&",
5296 MovieObj_New, _rv);
5297 return _res;
5300 static PyObject *MovieObj_PasteMovieSelection(_self, _args)
5301 MovieObject *_self;
5302 PyObject *_args;
5304 PyObject *_res = NULL;
5305 Movie src;
5306 if (!PyArg_ParseTuple(_args, "O&",
5307 MovieObj_Convert, &src))
5308 return NULL;
5309 PasteMovieSelection(_self->ob_itself,
5310 src);
5311 Py_INCREF(Py_None);
5312 _res = Py_None;
5313 return _res;
5316 static PyObject *MovieObj_AddMovieSelection(_self, _args)
5317 MovieObject *_self;
5318 PyObject *_args;
5320 PyObject *_res = NULL;
5321 Movie src;
5322 if (!PyArg_ParseTuple(_args, "O&",
5323 MovieObj_Convert, &src))
5324 return NULL;
5325 AddMovieSelection(_self->ob_itself,
5326 src);
5327 Py_INCREF(Py_None);
5328 _res = Py_None;
5329 return _res;
5332 static PyObject *MovieObj_ClearMovieSelection(_self, _args)
5333 MovieObject *_self;
5334 PyObject *_args;
5336 PyObject *_res = NULL;
5337 if (!PyArg_ParseTuple(_args, ""))
5338 return NULL;
5339 ClearMovieSelection(_self->ob_itself);
5340 Py_INCREF(Py_None);
5341 _res = Py_None;
5342 return _res;
5345 static PyObject *MovieObj_PutMovieIntoTypedHandle(_self, _args)
5346 MovieObject *_self;
5347 PyObject *_args;
5349 PyObject *_res = NULL;
5350 OSErr _err;
5351 Track targetTrack;
5352 OSType handleType;
5353 Handle publicMovie;
5354 TimeValue start;
5355 TimeValue dur;
5356 long flags;
5357 ComponentInstance userComp;
5358 if (!PyArg_ParseTuple(_args, "O&O&O&lllO&",
5359 TrackObj_Convert, &targetTrack,
5360 PyMac_GetOSType, &handleType,
5361 ResObj_Convert, &publicMovie,
5362 &start,
5363 &dur,
5364 &flags,
5365 CmpInstObj_Convert, &userComp))
5366 return NULL;
5367 _err = PutMovieIntoTypedHandle(_self->ob_itself,
5368 targetTrack,
5369 handleType,
5370 publicMovie,
5371 start,
5372 dur,
5373 flags,
5374 userComp);
5375 if (_err != noErr) return PyMac_Error(_err);
5376 Py_INCREF(Py_None);
5377 _res = Py_None;
5378 return _res;
5381 static PyObject *MovieObj_CopyMovieSettings(_self, _args)
5382 MovieObject *_self;
5383 PyObject *_args;
5385 PyObject *_res = NULL;
5386 OSErr _err;
5387 Movie dstMovie;
5388 if (!PyArg_ParseTuple(_args, "O&",
5389 MovieObj_Convert, &dstMovie))
5390 return NULL;
5391 _err = CopyMovieSettings(_self->ob_itself,
5392 dstMovie);
5393 if (_err != noErr) return PyMac_Error(_err);
5394 Py_INCREF(Py_None);
5395 _res = Py_None;
5396 return _res;
5399 static PyObject *MovieObj_ConvertMovieToFile(_self, _args)
5400 MovieObject *_self;
5401 PyObject *_args;
5403 PyObject *_res = NULL;
5404 OSErr _err;
5405 Track onlyTrack;
5406 FSSpec outputFile;
5407 OSType fileType;
5408 OSType creator;
5409 ScriptCode scriptTag;
5410 short resID;
5411 long flags;
5412 ComponentInstance userComp;
5413 if (!PyArg_ParseTuple(_args, "O&O&O&O&hlO&",
5414 TrackObj_Convert, &onlyTrack,
5415 PyMac_GetFSSpec, &outputFile,
5416 PyMac_GetOSType, &fileType,
5417 PyMac_GetOSType, &creator,
5418 &scriptTag,
5419 &flags,
5420 CmpInstObj_Convert, &userComp))
5421 return NULL;
5422 _err = ConvertMovieToFile(_self->ob_itself,
5423 onlyTrack,
5424 &outputFile,
5425 fileType,
5426 creator,
5427 scriptTag,
5428 &resID,
5429 flags,
5430 userComp);
5431 if (_err != noErr) return PyMac_Error(_err);
5432 _res = Py_BuildValue("h",
5433 resID);
5434 return _res;
5437 static PyObject *MovieObj_GetMovieDataSize(_self, _args)
5438 MovieObject *_self;
5439 PyObject *_args;
5441 PyObject *_res = NULL;
5442 long _rv;
5443 TimeValue startTime;
5444 TimeValue duration;
5445 if (!PyArg_ParseTuple(_args, "ll",
5446 &startTime,
5447 &duration))
5448 return NULL;
5449 _rv = GetMovieDataSize(_self->ob_itself,
5450 startTime,
5451 duration);
5452 _res = Py_BuildValue("l",
5453 _rv);
5454 return _res;
5457 static PyObject *MovieObj_PtInMovie(_self, _args)
5458 MovieObject *_self;
5459 PyObject *_args;
5461 PyObject *_res = NULL;
5462 Boolean _rv;
5463 Point pt;
5464 if (!PyArg_ParseTuple(_args, "O&",
5465 PyMac_GetPoint, &pt))
5466 return NULL;
5467 _rv = PtInMovie(_self->ob_itself,
5468 pt);
5469 _res = Py_BuildValue("b",
5470 _rv);
5471 return _res;
5474 static PyObject *MovieObj_SetMovieLanguage(_self, _args)
5475 MovieObject *_self;
5476 PyObject *_args;
5478 PyObject *_res = NULL;
5479 long language;
5480 if (!PyArg_ParseTuple(_args, "l",
5481 &language))
5482 return NULL;
5483 SetMovieLanguage(_self->ob_itself,
5484 language);
5485 Py_INCREF(Py_None);
5486 _res = Py_None;
5487 return _res;
5490 static PyObject *MovieObj_GetMovieNextInterestingTime(_self, _args)
5491 MovieObject *_self;
5492 PyObject *_args;
5494 PyObject *_res = NULL;
5495 short interestingTimeFlags;
5496 short numMediaTypes;
5497 OSType whichMediaTypes;
5498 TimeValue time;
5499 Fixed rate;
5500 TimeValue interestingTime;
5501 TimeValue interestingDuration;
5502 if (!PyArg_ParseTuple(_args, "hhO&lO&",
5503 &interestingTimeFlags,
5504 &numMediaTypes,
5505 PyMac_GetOSType, &whichMediaTypes,
5506 &time,
5507 PyMac_GetFixed, &rate))
5508 return NULL;
5509 GetMovieNextInterestingTime(_self->ob_itself,
5510 interestingTimeFlags,
5511 numMediaTypes,
5512 &whichMediaTypes,
5513 time,
5514 rate,
5515 &interestingTime,
5516 &interestingDuration);
5517 _res = Py_BuildValue("ll",
5518 interestingTime,
5519 interestingDuration);
5520 return _res;
5523 static PyObject *MovieObj_AddMovieResource(_self, _args)
5524 MovieObject *_self;
5525 PyObject *_args;
5527 PyObject *_res = NULL;
5528 OSErr _err;
5529 short resRefNum;
5530 short resId;
5531 Str255 resName;
5532 if (!PyArg_ParseTuple(_args, "hO&",
5533 &resRefNum,
5534 PyMac_GetStr255, resName))
5535 return NULL;
5536 _err = AddMovieResource(_self->ob_itself,
5537 resRefNum,
5538 &resId,
5539 resName);
5540 if (_err != noErr) return PyMac_Error(_err);
5541 _res = Py_BuildValue("h",
5542 resId);
5543 return _res;
5546 static PyObject *MovieObj_UpdateMovieResource(_self, _args)
5547 MovieObject *_self;
5548 PyObject *_args;
5550 PyObject *_res = NULL;
5551 OSErr _err;
5552 short resRefNum;
5553 short resId;
5554 Str255 resName;
5555 if (!PyArg_ParseTuple(_args, "hhO&",
5556 &resRefNum,
5557 &resId,
5558 PyMac_GetStr255, resName))
5559 return NULL;
5560 _err = UpdateMovieResource(_self->ob_itself,
5561 resRefNum,
5562 resId,
5563 resName);
5564 if (_err != noErr) return PyMac_Error(_err);
5565 Py_INCREF(Py_None);
5566 _res = Py_None;
5567 return _res;
5570 static PyObject *MovieObj_HasMovieChanged(_self, _args)
5571 MovieObject *_self;
5572 PyObject *_args;
5574 PyObject *_res = NULL;
5575 Boolean _rv;
5576 if (!PyArg_ParseTuple(_args, ""))
5577 return NULL;
5578 _rv = HasMovieChanged(_self->ob_itself);
5579 _res = Py_BuildValue("b",
5580 _rv);
5581 return _res;
5584 static PyObject *MovieObj_ClearMovieChanged(_self, _args)
5585 MovieObject *_self;
5586 PyObject *_args;
5588 PyObject *_res = NULL;
5589 if (!PyArg_ParseTuple(_args, ""))
5590 return NULL;
5591 ClearMovieChanged(_self->ob_itself);
5592 Py_INCREF(Py_None);
5593 _res = Py_None;
5594 return _res;
5597 static PyObject *MovieObj_SetMovieDefaultDataRef(_self, _args)
5598 MovieObject *_self;
5599 PyObject *_args;
5601 PyObject *_res = NULL;
5602 OSErr _err;
5603 Handle dataRef;
5604 OSType dataRefType;
5605 if (!PyArg_ParseTuple(_args, "O&O&",
5606 ResObj_Convert, &dataRef,
5607 PyMac_GetOSType, &dataRefType))
5608 return NULL;
5609 _err = SetMovieDefaultDataRef(_self->ob_itself,
5610 dataRef,
5611 dataRefType);
5612 if (_err != noErr) return PyMac_Error(_err);
5613 Py_INCREF(Py_None);
5614 _res = Py_None;
5615 return _res;
5618 static PyObject *MovieObj_GetMovieDefaultDataRef(_self, _args)
5619 MovieObject *_self;
5620 PyObject *_args;
5622 PyObject *_res = NULL;
5623 OSErr _err;
5624 Handle dataRef;
5625 OSType dataRefType;
5626 if (!PyArg_ParseTuple(_args, ""))
5627 return NULL;
5628 _err = GetMovieDefaultDataRef(_self->ob_itself,
5629 &dataRef,
5630 &dataRefType);
5631 if (_err != noErr) return PyMac_Error(_err);
5632 _res = Py_BuildValue("O&O&",
5633 ResObj_New, dataRef,
5634 PyMac_BuildOSType, dataRefType);
5635 return _res;
5638 static PyObject *MovieObj_SetMovieColorTable(_self, _args)
5639 MovieObject *_self;
5640 PyObject *_args;
5642 PyObject *_res = NULL;
5643 OSErr _err;
5644 CTabHandle ctab;
5645 if (!PyArg_ParseTuple(_args, "O&",
5646 ResObj_Convert, &ctab))
5647 return NULL;
5648 _err = SetMovieColorTable(_self->ob_itself,
5649 ctab);
5650 if (_err != noErr) return PyMac_Error(_err);
5651 Py_INCREF(Py_None);
5652 _res = Py_None;
5653 return _res;
5656 static PyObject *MovieObj_GetMovieColorTable(_self, _args)
5657 MovieObject *_self;
5658 PyObject *_args;
5660 PyObject *_res = NULL;
5661 OSErr _err;
5662 CTabHandle ctab;
5663 if (!PyArg_ParseTuple(_args, ""))
5664 return NULL;
5665 _err = GetMovieColorTable(_self->ob_itself,
5666 &ctab);
5667 if (_err != noErr) return PyMac_Error(_err);
5668 _res = Py_BuildValue("O&",
5669 ResObj_New, ctab);
5670 return _res;
5673 static PyObject *MovieObj_FlattenMovie(_self, _args)
5674 MovieObject *_self;
5675 PyObject *_args;
5677 PyObject *_res = NULL;
5678 long movieFlattenFlags;
5679 FSSpec theFile;
5680 OSType creator;
5681 ScriptCode scriptTag;
5682 long createMovieFileFlags;
5683 short resId;
5684 Str255 resName;
5685 if (!PyArg_ParseTuple(_args, "lO&O&hlO&",
5686 &movieFlattenFlags,
5687 PyMac_GetFSSpec, &theFile,
5688 PyMac_GetOSType, &creator,
5689 &scriptTag,
5690 &createMovieFileFlags,
5691 PyMac_GetStr255, resName))
5692 return NULL;
5693 FlattenMovie(_self->ob_itself,
5694 movieFlattenFlags,
5695 &theFile,
5696 creator,
5697 scriptTag,
5698 createMovieFileFlags,
5699 &resId,
5700 resName);
5701 _res = Py_BuildValue("h",
5702 resId);
5703 return _res;
5706 static PyObject *MovieObj_FlattenMovieData(_self, _args)
5707 MovieObject *_self;
5708 PyObject *_args;
5710 PyObject *_res = NULL;
5711 Movie _rv;
5712 long movieFlattenFlags;
5713 FSSpec theFile;
5714 OSType creator;
5715 ScriptCode scriptTag;
5716 long createMovieFileFlags;
5717 if (!PyArg_ParseTuple(_args, "lO&O&hl",
5718 &movieFlattenFlags,
5719 PyMac_GetFSSpec, &theFile,
5720 PyMac_GetOSType, &creator,
5721 &scriptTag,
5722 &createMovieFileFlags))
5723 return NULL;
5724 _rv = FlattenMovieData(_self->ob_itself,
5725 movieFlattenFlags,
5726 &theFile,
5727 creator,
5728 scriptTag,
5729 createMovieFileFlags);
5730 _res = Py_BuildValue("O&",
5731 MovieObj_New, _rv);
5732 return _res;
5735 static PyObject *MovieObj_MovieSearchText(_self, _args)
5736 MovieObject *_self;
5737 PyObject *_args;
5739 PyObject *_res = NULL;
5740 OSErr _err;
5741 Ptr text;
5742 long size;
5743 long searchFlags;
5744 Track searchTrack;
5745 TimeValue searchTime;
5746 long searchOffset;
5747 if (!PyArg_ParseTuple(_args, "sll",
5748 &text,
5749 &size,
5750 &searchFlags))
5751 return NULL;
5752 _err = MovieSearchText(_self->ob_itself,
5753 text,
5754 size,
5755 searchFlags,
5756 &searchTrack,
5757 &searchTime,
5758 &searchOffset);
5759 if (_err != noErr) return PyMac_Error(_err);
5760 _res = Py_BuildValue("O&ll",
5761 TrackObj_New, searchTrack,
5762 searchTime,
5763 searchOffset);
5764 return _res;
5767 static PyObject *MovieObj_GetPosterBox(_self, _args)
5768 MovieObject *_self;
5769 PyObject *_args;
5771 PyObject *_res = NULL;
5772 Rect boxRect;
5773 if (!PyArg_ParseTuple(_args, ""))
5774 return NULL;
5775 GetPosterBox(_self->ob_itself,
5776 &boxRect);
5777 _res = Py_BuildValue("O&",
5778 PyMac_BuildRect, &boxRect);
5779 return _res;
5782 static PyObject *MovieObj_SetPosterBox(_self, _args)
5783 MovieObject *_self;
5784 PyObject *_args;
5786 PyObject *_res = NULL;
5787 Rect boxRect;
5788 if (!PyArg_ParseTuple(_args, "O&",
5789 PyMac_GetRect, &boxRect))
5790 return NULL;
5791 SetPosterBox(_self->ob_itself,
5792 &boxRect);
5793 Py_INCREF(Py_None);
5794 _res = Py_None;
5795 return _res;
5798 static PyObject *MovieObj_GetMovieSegmentDisplayBoundsRgn(_self, _args)
5799 MovieObject *_self;
5800 PyObject *_args;
5802 PyObject *_res = NULL;
5803 RgnHandle _rv;
5804 TimeValue time;
5805 TimeValue duration;
5806 if (!PyArg_ParseTuple(_args, "ll",
5807 &time,
5808 &duration))
5809 return NULL;
5810 _rv = GetMovieSegmentDisplayBoundsRgn(_self->ob_itself,
5811 time,
5812 duration);
5813 _res = Py_BuildValue("O&",
5814 ResObj_New, _rv);
5815 return _res;
5818 static PyObject *MovieObj_GetMovieStatus(_self, _args)
5819 MovieObject *_self;
5820 PyObject *_args;
5822 PyObject *_res = NULL;
5823 ComponentResult _rv;
5824 Track firstProblemTrack;
5825 if (!PyArg_ParseTuple(_args, ""))
5826 return NULL;
5827 _rv = GetMovieStatus(_self->ob_itself,
5828 &firstProblemTrack);
5829 _res = Py_BuildValue("lO&",
5830 _rv,
5831 TrackObj_New, firstProblemTrack);
5832 return _res;
5835 static PyObject *MovieObj_NewMovieController(_self, _args)
5836 MovieObject *_self;
5837 PyObject *_args;
5839 PyObject *_res = NULL;
5840 MovieController _rv;
5841 Rect movieRect;
5842 long someFlags;
5843 if (!PyArg_ParseTuple(_args, "O&l",
5844 PyMac_GetRect, &movieRect,
5845 &someFlags))
5846 return NULL;
5847 _rv = NewMovieController(_self->ob_itself,
5848 &movieRect,
5849 someFlags);
5850 _res = Py_BuildValue("O&",
5851 MovieCtlObj_New, _rv);
5852 return _res;
5855 static PyObject *MovieObj_PutMovieOnScrap(_self, _args)
5856 MovieObject *_self;
5857 PyObject *_args;
5859 PyObject *_res = NULL;
5860 OSErr _err;
5861 long movieScrapFlags;
5862 if (!PyArg_ParseTuple(_args, "l",
5863 &movieScrapFlags))
5864 return NULL;
5865 _err = PutMovieOnScrap(_self->ob_itself,
5866 movieScrapFlags);
5867 if (_err != noErr) return PyMac_Error(_err);
5868 Py_INCREF(Py_None);
5869 _res = Py_None;
5870 return _res;
5873 static PyObject *MovieObj_SetMoviePlayHints(_self, _args)
5874 MovieObject *_self;
5875 PyObject *_args;
5877 PyObject *_res = NULL;
5878 long flags;
5879 long flagsMask;
5880 if (!PyArg_ParseTuple(_args, "ll",
5881 &flags,
5882 &flagsMask))
5883 return NULL;
5884 SetMoviePlayHints(_self->ob_itself,
5885 flags,
5886 flagsMask);
5887 Py_INCREF(Py_None);
5888 _res = Py_None;
5889 return _res;
5892 static PyObject *MovieObj_GetMaxLoadedTimeInMovie(_self, _args)
5893 MovieObject *_self;
5894 PyObject *_args;
5896 PyObject *_res = NULL;
5897 OSErr _err;
5898 TimeValue time;
5899 if (!PyArg_ParseTuple(_args, ""))
5900 return NULL;
5901 _err = GetMaxLoadedTimeInMovie(_self->ob_itself,
5902 &time);
5903 if (_err != noErr) return PyMac_Error(_err);
5904 _res = Py_BuildValue("l",
5905 time);
5906 return _res;
5909 static PyObject *MovieObj_QTMovieNeedsTimeTable(_self, _args)
5910 MovieObject *_self;
5911 PyObject *_args;
5913 PyObject *_res = NULL;
5914 OSErr _err;
5915 Boolean needsTimeTable;
5916 if (!PyArg_ParseTuple(_args, ""))
5917 return NULL;
5918 _err = QTMovieNeedsTimeTable(_self->ob_itself,
5919 &needsTimeTable);
5920 if (_err != noErr) return PyMac_Error(_err);
5921 _res = Py_BuildValue("b",
5922 needsTimeTable);
5923 return _res;
5926 static PyObject *MovieObj_QTGetDataRefMaxFileOffset(_self, _args)
5927 MovieObject *_self;
5928 PyObject *_args;
5930 PyObject *_res = NULL;
5931 OSErr _err;
5932 OSType dataRefType;
5933 Handle dataRef;
5934 long offset;
5935 if (!PyArg_ParseTuple(_args, "O&O&",
5936 PyMac_GetOSType, &dataRefType,
5937 ResObj_Convert, &dataRef))
5938 return NULL;
5939 _err = QTGetDataRefMaxFileOffset(_self->ob_itself,
5940 dataRefType,
5941 dataRef,
5942 &offset);
5943 if (_err != noErr) return PyMac_Error(_err);
5944 _res = Py_BuildValue("l",
5945 offset);
5946 return _res;
5949 static PyMethodDef MovieObj_methods[] = {
5950 {"MoviesTask", (PyCFunction)MovieObj_MoviesTask, 1,
5951 "(long maxMilliSecToUse) -> None"},
5952 {"PrerollMovie", (PyCFunction)MovieObj_PrerollMovie, 1,
5953 "(TimeValue time, Fixed Rate) -> None"},
5954 {"LoadMovieIntoRam", (PyCFunction)MovieObj_LoadMovieIntoRam, 1,
5955 "(TimeValue time, TimeValue duration, long flags) -> None"},
5956 {"SetMovieActive", (PyCFunction)MovieObj_SetMovieActive, 1,
5957 "(Boolean active) -> None"},
5958 {"GetMovieActive", (PyCFunction)MovieObj_GetMovieActive, 1,
5959 "() -> (Boolean _rv)"},
5960 {"StartMovie", (PyCFunction)MovieObj_StartMovie, 1,
5961 "() -> None"},
5962 {"StopMovie", (PyCFunction)MovieObj_StopMovie, 1,
5963 "() -> None"},
5964 {"GoToBeginningOfMovie", (PyCFunction)MovieObj_GoToBeginningOfMovie, 1,
5965 "() -> None"},
5966 {"GoToEndOfMovie", (PyCFunction)MovieObj_GoToEndOfMovie, 1,
5967 "() -> None"},
5968 {"IsMovieDone", (PyCFunction)MovieObj_IsMovieDone, 1,
5969 "() -> (Boolean _rv)"},
5970 {"GetMoviePreviewMode", (PyCFunction)MovieObj_GetMoviePreviewMode, 1,
5971 "() -> (Boolean _rv)"},
5972 {"SetMoviePreviewMode", (PyCFunction)MovieObj_SetMoviePreviewMode, 1,
5973 "(Boolean usePreview) -> None"},
5974 {"ShowMoviePoster", (PyCFunction)MovieObj_ShowMoviePoster, 1,
5975 "() -> None"},
5976 {"GetMovieTimeBase", (PyCFunction)MovieObj_GetMovieTimeBase, 1,
5977 "() -> (TimeBase _rv)"},
5978 {"SetMovieMasterTimeBase", (PyCFunction)MovieObj_SetMovieMasterTimeBase, 1,
5979 "(TimeBase tb, TimeRecord slaveZero) -> None"},
5980 {"SetMovieMasterClock", (PyCFunction)MovieObj_SetMovieMasterClock, 1,
5981 "(Component clockMeister, TimeRecord slaveZero) -> None"},
5982 {"GetMovieGWorld", (PyCFunction)MovieObj_GetMovieGWorld, 1,
5983 "() -> (CGrafPtr port, GDHandle gdh)"},
5984 {"SetMovieGWorld", (PyCFunction)MovieObj_SetMovieGWorld, 1,
5985 "(CGrafPtr port, GDHandle gdh) -> None"},
5986 {"GetMovieNaturalBoundsRect", (PyCFunction)MovieObj_GetMovieNaturalBoundsRect, 1,
5987 "() -> (Rect naturalBounds)"},
5988 {"GetNextTrackForCompositing", (PyCFunction)MovieObj_GetNextTrackForCompositing, 1,
5989 "(Track theTrack) -> (Track _rv)"},
5990 {"GetPrevTrackForCompositing", (PyCFunction)MovieObj_GetPrevTrackForCompositing, 1,
5991 "(Track theTrack) -> (Track _rv)"},
5992 {"GetMoviePict", (PyCFunction)MovieObj_GetMoviePict, 1,
5993 "(TimeValue time) -> (PicHandle _rv)"},
5994 {"GetMoviePosterPict", (PyCFunction)MovieObj_GetMoviePosterPict, 1,
5995 "() -> (PicHandle _rv)"},
5996 {"UpdateMovie", (PyCFunction)MovieObj_UpdateMovie, 1,
5997 "() -> None"},
5998 {"InvalidateMovieRegion", (PyCFunction)MovieObj_InvalidateMovieRegion, 1,
5999 "(RgnHandle invalidRgn) -> None"},
6000 {"GetMovieBox", (PyCFunction)MovieObj_GetMovieBox, 1,
6001 "() -> (Rect boxRect)"},
6002 {"SetMovieBox", (PyCFunction)MovieObj_SetMovieBox, 1,
6003 "(Rect boxRect) -> None"},
6004 {"GetMovieDisplayClipRgn", (PyCFunction)MovieObj_GetMovieDisplayClipRgn, 1,
6005 "() -> (RgnHandle _rv)"},
6006 {"SetMovieDisplayClipRgn", (PyCFunction)MovieObj_SetMovieDisplayClipRgn, 1,
6007 "(RgnHandle theClip) -> None"},
6008 {"GetMovieClipRgn", (PyCFunction)MovieObj_GetMovieClipRgn, 1,
6009 "() -> (RgnHandle _rv)"},
6010 {"SetMovieClipRgn", (PyCFunction)MovieObj_SetMovieClipRgn, 1,
6011 "(RgnHandle theClip) -> None"},
6012 {"GetMovieDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieDisplayBoundsRgn, 1,
6013 "() -> (RgnHandle _rv)"},
6014 {"GetMovieBoundsRgn", (PyCFunction)MovieObj_GetMovieBoundsRgn, 1,
6015 "() -> (RgnHandle _rv)"},
6016 {"PutMovieIntoHandle", (PyCFunction)MovieObj_PutMovieIntoHandle, 1,
6017 "(Handle publicMovie) -> None"},
6018 {"PutMovieIntoDataFork", (PyCFunction)MovieObj_PutMovieIntoDataFork, 1,
6019 "(short fRefNum, long offset, long maxSize) -> None"},
6020 {"GetMovieCreationTime", (PyCFunction)MovieObj_GetMovieCreationTime, 1,
6021 "() -> (unsigned long _rv)"},
6022 {"GetMovieModificationTime", (PyCFunction)MovieObj_GetMovieModificationTime, 1,
6023 "() -> (unsigned long _rv)"},
6024 {"GetMovieTimeScale", (PyCFunction)MovieObj_GetMovieTimeScale, 1,
6025 "() -> (TimeScale _rv)"},
6026 {"SetMovieTimeScale", (PyCFunction)MovieObj_SetMovieTimeScale, 1,
6027 "(TimeScale timeScale) -> None"},
6028 {"GetMovieDuration", (PyCFunction)MovieObj_GetMovieDuration, 1,
6029 "() -> (TimeValue _rv)"},
6030 {"GetMovieRate", (PyCFunction)MovieObj_GetMovieRate, 1,
6031 "() -> (Fixed _rv)"},
6032 {"SetMovieRate", (PyCFunction)MovieObj_SetMovieRate, 1,
6033 "(Fixed rate) -> None"},
6034 {"GetMoviePreferredRate", (PyCFunction)MovieObj_GetMoviePreferredRate, 1,
6035 "() -> (Fixed _rv)"},
6036 {"SetMoviePreferredRate", (PyCFunction)MovieObj_SetMoviePreferredRate, 1,
6037 "(Fixed rate) -> None"},
6038 {"GetMoviePreferredVolume", (PyCFunction)MovieObj_GetMoviePreferredVolume, 1,
6039 "() -> (short _rv)"},
6040 {"SetMoviePreferredVolume", (PyCFunction)MovieObj_SetMoviePreferredVolume, 1,
6041 "(short volume) -> None"},
6042 {"GetMovieVolume", (PyCFunction)MovieObj_GetMovieVolume, 1,
6043 "() -> (short _rv)"},
6044 {"SetMovieVolume", (PyCFunction)MovieObj_SetMovieVolume, 1,
6045 "(short volume) -> None"},
6046 {"GetMoviePreviewTime", (PyCFunction)MovieObj_GetMoviePreviewTime, 1,
6047 "() -> (TimeValue previewTime, TimeValue previewDuration)"},
6048 {"SetMoviePreviewTime", (PyCFunction)MovieObj_SetMoviePreviewTime, 1,
6049 "(TimeValue previewTime, TimeValue previewDuration) -> None"},
6050 {"GetMoviePosterTime", (PyCFunction)MovieObj_GetMoviePosterTime, 1,
6051 "() -> (TimeValue _rv)"},
6052 {"SetMoviePosterTime", (PyCFunction)MovieObj_SetMoviePosterTime, 1,
6053 "(TimeValue posterTime) -> None"},
6054 {"GetMovieSelection", (PyCFunction)MovieObj_GetMovieSelection, 1,
6055 "() -> (TimeValue selectionTime, TimeValue selectionDuration)"},
6056 {"SetMovieSelection", (PyCFunction)MovieObj_SetMovieSelection, 1,
6057 "(TimeValue selectionTime, TimeValue selectionDuration) -> None"},
6058 {"SetMovieActiveSegment", (PyCFunction)MovieObj_SetMovieActiveSegment, 1,
6059 "(TimeValue startTime, TimeValue duration) -> None"},
6060 {"GetMovieActiveSegment", (PyCFunction)MovieObj_GetMovieActiveSegment, 1,
6061 "() -> (TimeValue startTime, TimeValue duration)"},
6062 {"GetMovieTime", (PyCFunction)MovieObj_GetMovieTime, 1,
6063 "() -> (TimeValue _rv, TimeRecord currentTime)"},
6064 {"SetMovieTime", (PyCFunction)MovieObj_SetMovieTime, 1,
6065 "(TimeRecord newtime) -> None"},
6066 {"SetMovieTimeValue", (PyCFunction)MovieObj_SetMovieTimeValue, 1,
6067 "(TimeValue newtime) -> None"},
6068 {"GetMovieUserData", (PyCFunction)MovieObj_GetMovieUserData, 1,
6069 "() -> (UserData _rv)"},
6070 {"GetMovieTrackCount", (PyCFunction)MovieObj_GetMovieTrackCount, 1,
6071 "() -> (long _rv)"},
6072 {"GetMovieTrack", (PyCFunction)MovieObj_GetMovieTrack, 1,
6073 "(long trackID) -> (Track _rv)"},
6074 {"GetMovieIndTrack", (PyCFunction)MovieObj_GetMovieIndTrack, 1,
6075 "(long index) -> (Track _rv)"},
6076 {"GetMovieIndTrackType", (PyCFunction)MovieObj_GetMovieIndTrackType, 1,
6077 "(long index, OSType trackType, long flags) -> (Track _rv)"},
6078 {"NewMovieTrack", (PyCFunction)MovieObj_NewMovieTrack, 1,
6079 "(Fixed width, Fixed height, short trackVolume) -> (Track _rv)"},
6080 {"SetAutoTrackAlternatesEnabled", (PyCFunction)MovieObj_SetAutoTrackAlternatesEnabled, 1,
6081 "(Boolean enable) -> None"},
6082 {"SelectMovieAlternates", (PyCFunction)MovieObj_SelectMovieAlternates, 1,
6083 "() -> None"},
6084 {"InsertMovieSegment", (PyCFunction)MovieObj_InsertMovieSegment, 1,
6085 "(Movie dstMovie, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
6086 {"InsertEmptyMovieSegment", (PyCFunction)MovieObj_InsertEmptyMovieSegment, 1,
6087 "(TimeValue dstIn, TimeValue dstDuration) -> None"},
6088 {"DeleteMovieSegment", (PyCFunction)MovieObj_DeleteMovieSegment, 1,
6089 "(TimeValue startTime, TimeValue duration) -> None"},
6090 {"ScaleMovieSegment", (PyCFunction)MovieObj_ScaleMovieSegment, 1,
6091 "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
6092 {"CutMovieSelection", (PyCFunction)MovieObj_CutMovieSelection, 1,
6093 "() -> (Movie _rv)"},
6094 {"CopyMovieSelection", (PyCFunction)MovieObj_CopyMovieSelection, 1,
6095 "() -> (Movie _rv)"},
6096 {"PasteMovieSelection", (PyCFunction)MovieObj_PasteMovieSelection, 1,
6097 "(Movie src) -> None"},
6098 {"AddMovieSelection", (PyCFunction)MovieObj_AddMovieSelection, 1,
6099 "(Movie src) -> None"},
6100 {"ClearMovieSelection", (PyCFunction)MovieObj_ClearMovieSelection, 1,
6101 "() -> None"},
6102 {"PutMovieIntoTypedHandle", (PyCFunction)MovieObj_PutMovieIntoTypedHandle, 1,
6103 "(Track targetTrack, OSType handleType, Handle publicMovie, TimeValue start, TimeValue dur, long flags, ComponentInstance userComp) -> None"},
6104 {"CopyMovieSettings", (PyCFunction)MovieObj_CopyMovieSettings, 1,
6105 "(Movie dstMovie) -> None"},
6106 {"ConvertMovieToFile", (PyCFunction)MovieObj_ConvertMovieToFile, 1,
6107 "(Track onlyTrack, FSSpec outputFile, OSType fileType, OSType creator, ScriptCode scriptTag, long flags, ComponentInstance userComp) -> (short resID)"},
6108 {"GetMovieDataSize", (PyCFunction)MovieObj_GetMovieDataSize, 1,
6109 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
6110 {"PtInMovie", (PyCFunction)MovieObj_PtInMovie, 1,
6111 "(Point pt) -> (Boolean _rv)"},
6112 {"SetMovieLanguage", (PyCFunction)MovieObj_SetMovieLanguage, 1,
6113 "(long language) -> None"},
6114 {"GetMovieNextInterestingTime", (PyCFunction)MovieObj_GetMovieNextInterestingTime, 1,
6115 "(short interestingTimeFlags, short numMediaTypes, OSType whichMediaTypes, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
6116 {"AddMovieResource", (PyCFunction)MovieObj_AddMovieResource, 1,
6117 "(short resRefNum, Str255 resName) -> (short resId)"},
6118 {"UpdateMovieResource", (PyCFunction)MovieObj_UpdateMovieResource, 1,
6119 "(short resRefNum, short resId, Str255 resName) -> None"},
6120 {"HasMovieChanged", (PyCFunction)MovieObj_HasMovieChanged, 1,
6121 "() -> (Boolean _rv)"},
6122 {"ClearMovieChanged", (PyCFunction)MovieObj_ClearMovieChanged, 1,
6123 "() -> None"},
6124 {"SetMovieDefaultDataRef", (PyCFunction)MovieObj_SetMovieDefaultDataRef, 1,
6125 "(Handle dataRef, OSType dataRefType) -> None"},
6126 {"GetMovieDefaultDataRef", (PyCFunction)MovieObj_GetMovieDefaultDataRef, 1,
6127 "() -> (Handle dataRef, OSType dataRefType)"},
6128 {"SetMovieColorTable", (PyCFunction)MovieObj_SetMovieColorTable, 1,
6129 "(CTabHandle ctab) -> None"},
6130 {"GetMovieColorTable", (PyCFunction)MovieObj_GetMovieColorTable, 1,
6131 "() -> (CTabHandle ctab)"},
6132 {"FlattenMovie", (PyCFunction)MovieObj_FlattenMovie, 1,
6133 "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, Str255 resName) -> (short resId)"},
6134 {"FlattenMovieData", (PyCFunction)MovieObj_FlattenMovieData, 1,
6135 "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (Movie _rv)"},
6136 {"MovieSearchText", (PyCFunction)MovieObj_MovieSearchText, 1,
6137 "(Ptr text, long size, long searchFlags) -> (Track searchTrack, TimeValue searchTime, long searchOffset)"},
6138 {"GetPosterBox", (PyCFunction)MovieObj_GetPosterBox, 1,
6139 "() -> (Rect boxRect)"},
6140 {"SetPosterBox", (PyCFunction)MovieObj_SetPosterBox, 1,
6141 "(Rect boxRect) -> None"},
6142 {"GetMovieSegmentDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieSegmentDisplayBoundsRgn, 1,
6143 "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
6144 {"GetMovieStatus", (PyCFunction)MovieObj_GetMovieStatus, 1,
6145 "() -> (ComponentResult _rv, Track firstProblemTrack)"},
6146 {"NewMovieController", (PyCFunction)MovieObj_NewMovieController, 1,
6147 "(Rect movieRect, long someFlags) -> (MovieController _rv)"},
6148 {"PutMovieOnScrap", (PyCFunction)MovieObj_PutMovieOnScrap, 1,
6149 "(long movieScrapFlags) -> None"},
6150 {"SetMoviePlayHints", (PyCFunction)MovieObj_SetMoviePlayHints, 1,
6151 "(long flags, long flagsMask) -> None"},
6152 {"GetMaxLoadedTimeInMovie", (PyCFunction)MovieObj_GetMaxLoadedTimeInMovie, 1,
6153 "() -> (TimeValue time)"},
6154 {"QTMovieNeedsTimeTable", (PyCFunction)MovieObj_QTMovieNeedsTimeTable, 1,
6155 "() -> (Boolean needsTimeTable)"},
6156 {"QTGetDataRefMaxFileOffset", (PyCFunction)MovieObj_QTGetDataRefMaxFileOffset, 1,
6157 "(OSType dataRefType, Handle dataRef) -> (long offset)"},
6158 {NULL, NULL, 0}
6161 PyMethodChain MovieObj_chain = { MovieObj_methods, NULL };
6163 static PyObject *MovieObj_getattr(self, name)
6164 MovieObject *self;
6165 char *name;
6167 return Py_FindMethodInChain(&MovieObj_chain, (PyObject *)self, name);
6170 #define MovieObj_setattr NULL
6172 #define MovieObj_compare NULL
6174 #define MovieObj_repr NULL
6176 #define MovieObj_hash NULL
6178 PyTypeObject Movie_Type = {
6179 PyObject_HEAD_INIT(&PyType_Type)
6180 0, /*ob_size*/
6181 "Movie", /*tp_name*/
6182 sizeof(MovieObject), /*tp_basicsize*/
6183 0, /*tp_itemsize*/
6184 /* methods */
6185 (destructor) MovieObj_dealloc, /*tp_dealloc*/
6186 0, /*tp_print*/
6187 (getattrfunc) MovieObj_getattr, /*tp_getattr*/
6188 (setattrfunc) MovieObj_setattr, /*tp_setattr*/
6189 (cmpfunc) MovieObj_compare, /*tp_compare*/
6190 (reprfunc) MovieObj_repr, /*tp_repr*/
6191 (PyNumberMethods *)0, /* tp_as_number */
6192 (PySequenceMethods *)0, /* tp_as_sequence */
6193 (PyMappingMethods *)0, /* tp_as_mapping */
6194 (hashfunc) MovieObj_hash, /*tp_hash*/
6197 /* --------------------- End object type Movie ---------------------- */
6200 static PyObject *Qt_EnterMovies(_self, _args)
6201 PyObject *_self;
6202 PyObject *_args;
6204 PyObject *_res = NULL;
6205 OSErr _err;
6206 if (!PyArg_ParseTuple(_args, ""))
6207 return NULL;
6208 _err = EnterMovies();
6209 if (_err != noErr) return PyMac_Error(_err);
6210 Py_INCREF(Py_None);
6211 _res = Py_None;
6212 return _res;
6215 static PyObject *Qt_ExitMovies(_self, _args)
6216 PyObject *_self;
6217 PyObject *_args;
6219 PyObject *_res = NULL;
6220 if (!PyArg_ParseTuple(_args, ""))
6221 return NULL;
6222 ExitMovies();
6223 Py_INCREF(Py_None);
6224 _res = Py_None;
6225 return _res;
6228 static PyObject *Qt_GetMoviesError(_self, _args)
6229 PyObject *_self;
6230 PyObject *_args;
6232 PyObject *_res = NULL;
6233 OSErr _err;
6234 if (!PyArg_ParseTuple(_args, ""))
6235 return NULL;
6236 _err = GetMoviesError();
6237 if (_err != noErr) return PyMac_Error(_err);
6238 Py_INCREF(Py_None);
6239 _res = Py_None;
6240 return _res;
6243 static PyObject *Qt_ClearMoviesStickyError(_self, _args)
6244 PyObject *_self;
6245 PyObject *_args;
6247 PyObject *_res = NULL;
6248 if (!PyArg_ParseTuple(_args, ""))
6249 return NULL;
6250 ClearMoviesStickyError();
6251 Py_INCREF(Py_None);
6252 _res = Py_None;
6253 return _res;
6256 static PyObject *Qt_GetMoviesStickyError(_self, _args)
6257 PyObject *_self;
6258 PyObject *_args;
6260 PyObject *_res = NULL;
6261 OSErr _err;
6262 if (!PyArg_ParseTuple(_args, ""))
6263 return NULL;
6264 _err = GetMoviesStickyError();
6265 if (_err != noErr) return PyMac_Error(_err);
6266 Py_INCREF(Py_None);
6267 _res = Py_None;
6268 return _res;
6271 static PyObject *Qt_DisposeMatte(_self, _args)
6272 PyObject *_self;
6273 PyObject *_args;
6275 PyObject *_res = NULL;
6276 PixMapHandle theMatte;
6277 if (!PyArg_ParseTuple(_args, "O&",
6278 ResObj_Convert, &theMatte))
6279 return NULL;
6280 DisposeMatte(theMatte);
6281 Py_INCREF(Py_None);
6282 _res = Py_None;
6283 return _res;
6286 static PyObject *Qt_NewMovie(_self, _args)
6287 PyObject *_self;
6288 PyObject *_args;
6290 PyObject *_res = NULL;
6291 Movie _rv;
6292 long flags;
6293 if (!PyArg_ParseTuple(_args, "l",
6294 &flags))
6295 return NULL;
6296 _rv = NewMovie(flags);
6297 _res = Py_BuildValue("O&",
6298 MovieObj_New, _rv);
6299 return _res;
6302 static PyObject *Qt_GetDataHandler(_self, _args)
6303 PyObject *_self;
6304 PyObject *_args;
6306 PyObject *_res = NULL;
6307 Component _rv;
6308 Handle dataRef;
6309 OSType dataHandlerSubType;
6310 long flags;
6311 if (!PyArg_ParseTuple(_args, "O&O&l",
6312 ResObj_Convert, &dataRef,
6313 PyMac_GetOSType, &dataHandlerSubType,
6314 &flags))
6315 return NULL;
6316 _rv = GetDataHandler(dataRef,
6317 dataHandlerSubType,
6318 flags);
6319 _res = Py_BuildValue("O&",
6320 CmpObj_New, _rv);
6321 return _res;
6324 static PyObject *Qt_PasteHandleIntoMovie(_self, _args)
6325 PyObject *_self;
6326 PyObject *_args;
6328 PyObject *_res = NULL;
6329 OSErr _err;
6330 Handle h;
6331 OSType handleType;
6332 Movie theMovie;
6333 long flags;
6334 ComponentInstance userComp;
6335 if (!PyArg_ParseTuple(_args, "O&O&O&lO&",
6336 ResObj_Convert, &h,
6337 PyMac_GetOSType, &handleType,
6338 MovieObj_Convert, &theMovie,
6339 &flags,
6340 CmpInstObj_Convert, &userComp))
6341 return NULL;
6342 _err = PasteHandleIntoMovie(h,
6343 handleType,
6344 theMovie,
6345 flags,
6346 userComp);
6347 if (_err != noErr) return PyMac_Error(_err);
6348 Py_INCREF(Py_None);
6349 _res = Py_None;
6350 return _res;
6353 static PyObject *Qt_GetMovieImporterForDataRef(_self, _args)
6354 PyObject *_self;
6355 PyObject *_args;
6357 PyObject *_res = NULL;
6358 OSErr _err;
6359 OSType dataRefType;
6360 Handle dataRef;
6361 long flags;
6362 Component importer;
6363 if (!PyArg_ParseTuple(_args, "O&O&l",
6364 PyMac_GetOSType, &dataRefType,
6365 ResObj_Convert, &dataRef,
6366 &flags))
6367 return NULL;
6368 _err = GetMovieImporterForDataRef(dataRefType,
6369 dataRef,
6370 flags,
6371 &importer);
6372 if (_err != noErr) return PyMac_Error(_err);
6373 _res = Py_BuildValue("O&",
6374 CmpObj_New, importer);
6375 return _res;
6378 static PyObject *Qt_TrackTimeToMediaTime(_self, _args)
6379 PyObject *_self;
6380 PyObject *_args;
6382 PyObject *_res = NULL;
6383 TimeValue _rv;
6384 TimeValue value;
6385 Track theTrack;
6386 if (!PyArg_ParseTuple(_args, "lO&",
6387 &value,
6388 TrackObj_Convert, &theTrack))
6389 return NULL;
6390 _rv = TrackTimeToMediaTime(value,
6391 theTrack);
6392 _res = Py_BuildValue("l",
6393 _rv);
6394 return _res;
6397 static PyObject *Qt_NewUserData(_self, _args)
6398 PyObject *_self;
6399 PyObject *_args;
6401 PyObject *_res = NULL;
6402 OSErr _err;
6403 UserData theUserData;
6404 if (!PyArg_ParseTuple(_args, ""))
6405 return NULL;
6406 _err = NewUserData(&theUserData);
6407 if (_err != noErr) return PyMac_Error(_err);
6408 _res = Py_BuildValue("O&",
6409 UserDataObj_New, theUserData);
6410 return _res;
6413 static PyObject *Qt_NewUserDataFromHandle(_self, _args)
6414 PyObject *_self;
6415 PyObject *_args;
6417 PyObject *_res = NULL;
6418 OSErr _err;
6419 Handle h;
6420 UserData theUserData;
6421 if (!PyArg_ParseTuple(_args, "O&",
6422 ResObj_Convert, &h))
6423 return NULL;
6424 _err = NewUserDataFromHandle(h,
6425 &theUserData);
6426 if (_err != noErr) return PyMac_Error(_err);
6427 _res = Py_BuildValue("O&",
6428 UserDataObj_New, theUserData);
6429 return _res;
6432 static PyObject *Qt_CreateMovieFile(_self, _args)
6433 PyObject *_self;
6434 PyObject *_args;
6436 PyObject *_res = NULL;
6437 OSErr _err;
6438 FSSpec fileSpec;
6439 OSType creator;
6440 ScriptCode scriptTag;
6441 long createMovieFileFlags;
6442 short resRefNum;
6443 Movie newmovie;
6444 if (!PyArg_ParseTuple(_args, "O&O&hl",
6445 PyMac_GetFSSpec, &fileSpec,
6446 PyMac_GetOSType, &creator,
6447 &scriptTag,
6448 &createMovieFileFlags))
6449 return NULL;
6450 _err = CreateMovieFile(&fileSpec,
6451 creator,
6452 scriptTag,
6453 createMovieFileFlags,
6454 &resRefNum,
6455 &newmovie);
6456 if (_err != noErr) return PyMac_Error(_err);
6457 _res = Py_BuildValue("hO&",
6458 resRefNum,
6459 MovieObj_New, newmovie);
6460 return _res;
6463 static PyObject *Qt_OpenMovieFile(_self, _args)
6464 PyObject *_self;
6465 PyObject *_args;
6467 PyObject *_res = NULL;
6468 OSErr _err;
6469 FSSpec fileSpec;
6470 short resRefNum;
6471 SInt8 permission;
6472 if (!PyArg_ParseTuple(_args, "O&b",
6473 PyMac_GetFSSpec, &fileSpec,
6474 &permission))
6475 return NULL;
6476 _err = OpenMovieFile(&fileSpec,
6477 &resRefNum,
6478 permission);
6479 if (_err != noErr) return PyMac_Error(_err);
6480 _res = Py_BuildValue("h",
6481 resRefNum);
6482 return _res;
6485 static PyObject *Qt_CloseMovieFile(_self, _args)
6486 PyObject *_self;
6487 PyObject *_args;
6489 PyObject *_res = NULL;
6490 OSErr _err;
6491 short resRefNum;
6492 if (!PyArg_ParseTuple(_args, "h",
6493 &resRefNum))
6494 return NULL;
6495 _err = CloseMovieFile(resRefNum);
6496 if (_err != noErr) return PyMac_Error(_err);
6497 Py_INCREF(Py_None);
6498 _res = Py_None;
6499 return _res;
6502 static PyObject *Qt_DeleteMovieFile(_self, _args)
6503 PyObject *_self;
6504 PyObject *_args;
6506 PyObject *_res = NULL;
6507 OSErr _err;
6508 FSSpec fileSpec;
6509 if (!PyArg_ParseTuple(_args, "O&",
6510 PyMac_GetFSSpec, &fileSpec))
6511 return NULL;
6512 _err = DeleteMovieFile(&fileSpec);
6513 if (_err != noErr) return PyMac_Error(_err);
6514 Py_INCREF(Py_None);
6515 _res = Py_None;
6516 return _res;
6519 static PyObject *Qt_NewMovieFromFile(_self, _args)
6520 PyObject *_self;
6521 PyObject *_args;
6523 PyObject *_res = NULL;
6524 OSErr _err;
6525 Movie theMovie;
6526 short resRefNum;
6527 short resId;
6528 short newMovieFlags;
6529 Boolean dataRefWasChanged;
6530 if (!PyArg_ParseTuple(_args, "hhh",
6531 &resRefNum,
6532 &resId,
6533 &newMovieFlags))
6534 return NULL;
6535 _err = NewMovieFromFile(&theMovie,
6536 resRefNum,
6537 &resId,
6538 (StringPtr)0,
6539 newMovieFlags,
6540 &dataRefWasChanged);
6541 if (_err != noErr) return PyMac_Error(_err);
6542 _res = Py_BuildValue("O&hb",
6543 MovieObj_New, theMovie,
6544 resId,
6545 dataRefWasChanged);
6546 return _res;
6549 static PyObject *Qt_NewMovieFromHandle(_self, _args)
6550 PyObject *_self;
6551 PyObject *_args;
6553 PyObject *_res = NULL;
6554 OSErr _err;
6555 Movie theMovie;
6556 Handle h;
6557 short newMovieFlags;
6558 Boolean dataRefWasChanged;
6559 if (!PyArg_ParseTuple(_args, "O&h",
6560 ResObj_Convert, &h,
6561 &newMovieFlags))
6562 return NULL;
6563 _err = NewMovieFromHandle(&theMovie,
6565 newMovieFlags,
6566 &dataRefWasChanged);
6567 if (_err != noErr) return PyMac_Error(_err);
6568 _res = Py_BuildValue("O&b",
6569 MovieObj_New, theMovie,
6570 dataRefWasChanged);
6571 return _res;
6574 static PyObject *Qt_NewMovieFromDataFork(_self, _args)
6575 PyObject *_self;
6576 PyObject *_args;
6578 PyObject *_res = NULL;
6579 OSErr _err;
6580 Movie theMovie;
6581 short fRefNum;
6582 long fileOffset;
6583 short newMovieFlags;
6584 Boolean dataRefWasChanged;
6585 if (!PyArg_ParseTuple(_args, "hlh",
6586 &fRefNum,
6587 &fileOffset,
6588 &newMovieFlags))
6589 return NULL;
6590 _err = NewMovieFromDataFork(&theMovie,
6591 fRefNum,
6592 fileOffset,
6593 newMovieFlags,
6594 &dataRefWasChanged);
6595 if (_err != noErr) return PyMac_Error(_err);
6596 _res = Py_BuildValue("O&b",
6597 MovieObj_New, theMovie,
6598 dataRefWasChanged);
6599 return _res;
6602 static PyObject *Qt_NewMovieFromDataRef(_self, _args)
6603 PyObject *_self;
6604 PyObject *_args;
6606 PyObject *_res = NULL;
6607 OSErr _err;
6608 Movie m;
6609 short flags;
6610 short id;
6611 Handle dataRef;
6612 OSType dataRefType;
6613 if (!PyArg_ParseTuple(_args, "hO&O&",
6614 &flags,
6615 ResObj_Convert, &dataRef,
6616 PyMac_GetOSType, &dataRefType))
6617 return NULL;
6618 _err = NewMovieFromDataRef(&m,
6619 flags,
6620 &id,
6621 dataRef,
6622 dataRefType);
6623 if (_err != noErr) return PyMac_Error(_err);
6624 _res = Py_BuildValue("O&h",
6625 MovieObj_New, m,
6626 id);
6627 return _res;
6630 static PyObject *Qt_RemoveMovieResource(_self, _args)
6631 PyObject *_self;
6632 PyObject *_args;
6634 PyObject *_res = NULL;
6635 OSErr _err;
6636 short resRefNum;
6637 short resId;
6638 if (!PyArg_ParseTuple(_args, "hh",
6639 &resRefNum,
6640 &resId))
6641 return NULL;
6642 _err = RemoveMovieResource(resRefNum,
6643 resId);
6644 if (_err != noErr) return PyMac_Error(_err);
6645 Py_INCREF(Py_None);
6646 _res = Py_None;
6647 return _res;
6650 static PyObject *Qt_NewMovieFromScrap(_self, _args)
6651 PyObject *_self;
6652 PyObject *_args;
6654 PyObject *_res = NULL;
6655 Movie _rv;
6656 long newMovieFlags;
6657 if (!PyArg_ParseTuple(_args, "l",
6658 &newMovieFlags))
6659 return NULL;
6660 _rv = NewMovieFromScrap(newMovieFlags);
6661 _res = Py_BuildValue("O&",
6662 MovieObj_New, _rv);
6663 return _res;
6666 static PyObject *Qt_QTNewAlias(_self, _args)
6667 PyObject *_self;
6668 PyObject *_args;
6670 PyObject *_res = NULL;
6671 OSErr _err;
6672 FSSpec fss;
6673 AliasHandle alias;
6674 Boolean minimal;
6675 if (!PyArg_ParseTuple(_args, "O&b",
6676 PyMac_GetFSSpec, &fss,
6677 &minimal))
6678 return NULL;
6679 _err = QTNewAlias(&fss,
6680 &alias,
6681 minimal);
6682 if (_err != noErr) return PyMac_Error(_err);
6683 _res = Py_BuildValue("O&",
6684 ResObj_New, alias);
6685 return _res;
6688 static PyObject *Qt_EndFullScreen(_self, _args)
6689 PyObject *_self;
6690 PyObject *_args;
6692 PyObject *_res = NULL;
6693 OSErr _err;
6694 Ptr fullState;
6695 long flags;
6696 if (!PyArg_ParseTuple(_args, "sl",
6697 &fullState,
6698 &flags))
6699 return NULL;
6700 _err = EndFullScreen(fullState,
6701 flags);
6702 if (_err != noErr) return PyMac_Error(_err);
6703 Py_INCREF(Py_None);
6704 _res = Py_None;
6705 return _res;
6708 static PyObject *Qt_AddSoundDescriptionExtension(_self, _args)
6709 PyObject *_self;
6710 PyObject *_args;
6712 PyObject *_res = NULL;
6713 OSErr _err;
6714 SoundDescriptionHandle desc;
6715 Handle extension;
6716 OSType idType;
6717 if (!PyArg_ParseTuple(_args, "O&O&O&",
6718 ResObj_Convert, &desc,
6719 ResObj_Convert, &extension,
6720 PyMac_GetOSType, &idType))
6721 return NULL;
6722 _err = AddSoundDescriptionExtension(desc,
6723 extension,
6724 idType);
6725 if (_err != noErr) return PyMac_Error(_err);
6726 Py_INCREF(Py_None);
6727 _res = Py_None;
6728 return _res;
6731 static PyObject *Qt_GetSoundDescriptionExtension(_self, _args)
6732 PyObject *_self;
6733 PyObject *_args;
6735 PyObject *_res = NULL;
6736 OSErr _err;
6737 SoundDescriptionHandle desc;
6738 Handle extension;
6739 OSType idType;
6740 if (!PyArg_ParseTuple(_args, "O&O&",
6741 ResObj_Convert, &desc,
6742 PyMac_GetOSType, &idType))
6743 return NULL;
6744 _err = GetSoundDescriptionExtension(desc,
6745 &extension,
6746 idType);
6747 if (_err != noErr) return PyMac_Error(_err);
6748 _res = Py_BuildValue("O&",
6749 ResObj_New, extension);
6750 return _res;
6753 static PyObject *Qt_RemoveSoundDescriptionExtension(_self, _args)
6754 PyObject *_self;
6755 PyObject *_args;
6757 PyObject *_res = NULL;
6758 OSErr _err;
6759 SoundDescriptionHandle desc;
6760 OSType idType;
6761 if (!PyArg_ParseTuple(_args, "O&O&",
6762 ResObj_Convert, &desc,
6763 PyMac_GetOSType, &idType))
6764 return NULL;
6765 _err = RemoveSoundDescriptionExtension(desc,
6766 idType);
6767 if (_err != noErr) return PyMac_Error(_err);
6768 Py_INCREF(Py_None);
6769 _res = Py_None;
6770 return _res;
6773 static PyObject *Qt_QTIsStandardParameterDialogEvent(_self, _args)
6774 PyObject *_self;
6775 PyObject *_args;
6777 PyObject *_res = NULL;
6778 OSErr _err;
6779 EventRecord pEvent;
6780 QTParameterDialog createdDialog;
6781 if (!PyArg_ParseTuple(_args, "l",
6782 &createdDialog))
6783 return NULL;
6784 _err = QTIsStandardParameterDialogEvent(&pEvent,
6785 createdDialog);
6786 if (_err != noErr) return PyMac_Error(_err);
6787 _res = Py_BuildValue("O&",
6788 PyMac_BuildEventRecord, &pEvent);
6789 return _res;
6792 static PyObject *Qt_QTDismissStandardParameterDialog(_self, _args)
6793 PyObject *_self;
6794 PyObject *_args;
6796 PyObject *_res = NULL;
6797 OSErr _err;
6798 QTParameterDialog createdDialog;
6799 if (!PyArg_ParseTuple(_args, "l",
6800 &createdDialog))
6801 return NULL;
6802 _err = QTDismissStandardParameterDialog(createdDialog);
6803 if (_err != noErr) return PyMac_Error(_err);
6804 Py_INCREF(Py_None);
6805 _res = Py_None;
6806 return _res;
6809 static PyObject *Qt_QTStandardParameterDialogDoAction(_self, _args)
6810 PyObject *_self;
6811 PyObject *_args;
6813 PyObject *_res = NULL;
6814 OSErr _err;
6815 QTParameterDialog createdDialog;
6816 long action;
6817 void * params;
6818 if (!PyArg_ParseTuple(_args, "lls",
6819 &createdDialog,
6820 &action,
6821 &params))
6822 return NULL;
6823 _err = QTStandardParameterDialogDoAction(createdDialog,
6824 action,
6825 params);
6826 if (_err != noErr) return PyMac_Error(_err);
6827 Py_INCREF(Py_None);
6828 _res = Py_None;
6829 return _res;
6832 static PyObject *Qt_QTRegisterAccessKey(_self, _args)
6833 PyObject *_self;
6834 PyObject *_args;
6836 PyObject *_res = NULL;
6837 OSErr _err;
6838 Str255 accessKeyType;
6839 long flags;
6840 Handle accessKey;
6841 if (!PyArg_ParseTuple(_args, "O&lO&",
6842 PyMac_GetStr255, accessKeyType,
6843 &flags,
6844 ResObj_Convert, &accessKey))
6845 return NULL;
6846 _err = QTRegisterAccessKey(accessKeyType,
6847 flags,
6848 accessKey);
6849 if (_err != noErr) return PyMac_Error(_err);
6850 Py_INCREF(Py_None);
6851 _res = Py_None;
6852 return _res;
6855 static PyObject *Qt_QTUnregisterAccessKey(_self, _args)
6856 PyObject *_self;
6857 PyObject *_args;
6859 PyObject *_res = NULL;
6860 OSErr _err;
6861 Str255 accessKeyType;
6862 long flags;
6863 Handle accessKey;
6864 if (!PyArg_ParseTuple(_args, "O&lO&",
6865 PyMac_GetStr255, accessKeyType,
6866 &flags,
6867 ResObj_Convert, &accessKey))
6868 return NULL;
6869 _err = QTUnregisterAccessKey(accessKeyType,
6870 flags,
6871 accessKey);
6872 if (_err != noErr) return PyMac_Error(_err);
6873 Py_INCREF(Py_None);
6874 _res = Py_None;
6875 return _res;
6878 static PyObject *Qt_QTTextToNativeText(_self, _args)
6879 PyObject *_self;
6880 PyObject *_args;
6882 PyObject *_res = NULL;
6883 OSErr _err;
6884 Handle theText;
6885 long encoding;
6886 long flags;
6887 if (!PyArg_ParseTuple(_args, "O&ll",
6888 ResObj_Convert, &theText,
6889 &encoding,
6890 &flags))
6891 return NULL;
6892 _err = QTTextToNativeText(theText,
6893 encoding,
6894 flags);
6895 if (_err != noErr) return PyMac_Error(_err);
6896 Py_INCREF(Py_None);
6897 _res = Py_None;
6898 return _res;
6901 static PyObject *Qt_VideoMediaResetStatistics(_self, _args)
6902 PyObject *_self;
6903 PyObject *_args;
6905 PyObject *_res = NULL;
6906 ComponentResult _rv;
6907 MediaHandler mh;
6908 if (!PyArg_ParseTuple(_args, "O&",
6909 CmpInstObj_Convert, &mh))
6910 return NULL;
6911 _rv = VideoMediaResetStatistics(mh);
6912 _res = Py_BuildValue("l",
6913 _rv);
6914 return _res;
6917 static PyObject *Qt_VideoMediaGetStatistics(_self, _args)
6918 PyObject *_self;
6919 PyObject *_args;
6921 PyObject *_res = NULL;
6922 ComponentResult _rv;
6923 MediaHandler mh;
6924 if (!PyArg_ParseTuple(_args, "O&",
6925 CmpInstObj_Convert, &mh))
6926 return NULL;
6927 _rv = VideoMediaGetStatistics(mh);
6928 _res = Py_BuildValue("l",
6929 _rv);
6930 return _res;
6933 static PyObject *Qt_TextMediaAddTextSample(_self, _args)
6934 PyObject *_self;
6935 PyObject *_args;
6937 PyObject *_res = NULL;
6938 ComponentResult _rv;
6939 MediaHandler mh;
6940 Ptr text;
6941 unsigned long size;
6942 short fontNumber;
6943 short fontSize;
6944 Style textFace;
6945 RGBColor textColor;
6946 RGBColor backColor;
6947 short textJustification;
6948 Rect textBox;
6949 long displayFlags;
6950 TimeValue scrollDelay;
6951 short hiliteStart;
6952 short hiliteEnd;
6953 RGBColor rgbHiliteColor;
6954 TimeValue duration;
6955 TimeValue sampleTime;
6956 if (!PyArg_ParseTuple(_args, "O&slhhbhllhhl",
6957 CmpInstObj_Convert, &mh,
6958 &text,
6959 &size,
6960 &fontNumber,
6961 &fontSize,
6962 &textFace,
6963 &textJustification,
6964 &displayFlags,
6965 &scrollDelay,
6966 &hiliteStart,
6967 &hiliteEnd,
6968 &duration))
6969 return NULL;
6970 _rv = TextMediaAddTextSample(mh,
6971 text,
6972 size,
6973 fontNumber,
6974 fontSize,
6975 textFace,
6976 &textColor,
6977 &backColor,
6978 textJustification,
6979 &textBox,
6980 displayFlags,
6981 scrollDelay,
6982 hiliteStart,
6983 hiliteEnd,
6984 &rgbHiliteColor,
6985 duration,
6986 &sampleTime);
6987 _res = Py_BuildValue("lO&O&O&O&l",
6988 _rv,
6989 QdRGB_New, &textColor,
6990 QdRGB_New, &backColor,
6991 PyMac_BuildRect, &textBox,
6992 QdRGB_New, &rgbHiliteColor,
6993 sampleTime);
6994 return _res;
6997 static PyObject *Qt_TextMediaAddTESample(_self, _args)
6998 PyObject *_self;
6999 PyObject *_args;
7001 PyObject *_res = NULL;
7002 ComponentResult _rv;
7003 MediaHandler mh;
7004 TEHandle hTE;
7005 RGBColor backColor;
7006 short textJustification;
7007 Rect textBox;
7008 long displayFlags;
7009 TimeValue scrollDelay;
7010 short hiliteStart;
7011 short hiliteEnd;
7012 RGBColor rgbHiliteColor;
7013 TimeValue duration;
7014 TimeValue sampleTime;
7015 if (!PyArg_ParseTuple(_args, "O&O&hllhhl",
7016 CmpInstObj_Convert, &mh,
7017 ResObj_Convert, &hTE,
7018 &textJustification,
7019 &displayFlags,
7020 &scrollDelay,
7021 &hiliteStart,
7022 &hiliteEnd,
7023 &duration))
7024 return NULL;
7025 _rv = TextMediaAddTESample(mh,
7026 hTE,
7027 &backColor,
7028 textJustification,
7029 &textBox,
7030 displayFlags,
7031 scrollDelay,
7032 hiliteStart,
7033 hiliteEnd,
7034 &rgbHiliteColor,
7035 duration,
7036 &sampleTime);
7037 _res = Py_BuildValue("lO&O&O&l",
7038 _rv,
7039 QdRGB_New, &backColor,
7040 PyMac_BuildRect, &textBox,
7041 QdRGB_New, &rgbHiliteColor,
7042 sampleTime);
7043 return _res;
7046 static PyObject *Qt_TextMediaAddHiliteSample(_self, _args)
7047 PyObject *_self;
7048 PyObject *_args;
7050 PyObject *_res = NULL;
7051 ComponentResult _rv;
7052 MediaHandler mh;
7053 short hiliteStart;
7054 short hiliteEnd;
7055 RGBColor rgbHiliteColor;
7056 TimeValue duration;
7057 TimeValue sampleTime;
7058 if (!PyArg_ParseTuple(_args, "O&hhl",
7059 CmpInstObj_Convert, &mh,
7060 &hiliteStart,
7061 &hiliteEnd,
7062 &duration))
7063 return NULL;
7064 _rv = TextMediaAddHiliteSample(mh,
7065 hiliteStart,
7066 hiliteEnd,
7067 &rgbHiliteColor,
7068 duration,
7069 &sampleTime);
7070 _res = Py_BuildValue("lO&l",
7071 _rv,
7072 QdRGB_New, &rgbHiliteColor,
7073 sampleTime);
7074 return _res;
7077 static PyObject *Qt_TextMediaFindNextText(_self, _args)
7078 PyObject *_self;
7079 PyObject *_args;
7081 PyObject *_res = NULL;
7082 ComponentResult _rv;
7083 MediaHandler mh;
7084 Ptr text;
7085 long size;
7086 short findFlags;
7087 TimeValue startTime;
7088 TimeValue foundTime;
7089 TimeValue foundDuration;
7090 long offset;
7091 if (!PyArg_ParseTuple(_args, "O&slhl",
7092 CmpInstObj_Convert, &mh,
7093 &text,
7094 &size,
7095 &findFlags,
7096 &startTime))
7097 return NULL;
7098 _rv = TextMediaFindNextText(mh,
7099 text,
7100 size,
7101 findFlags,
7102 startTime,
7103 &foundTime,
7104 &foundDuration,
7105 &offset);
7106 _res = Py_BuildValue("llll",
7107 _rv,
7108 foundTime,
7109 foundDuration,
7110 offset);
7111 return _res;
7114 static PyObject *Qt_TextMediaHiliteTextSample(_self, _args)
7115 PyObject *_self;
7116 PyObject *_args;
7118 PyObject *_res = NULL;
7119 ComponentResult _rv;
7120 MediaHandler mh;
7121 TimeValue sampleTime;
7122 short hiliteStart;
7123 short hiliteEnd;
7124 RGBColor rgbHiliteColor;
7125 if (!PyArg_ParseTuple(_args, "O&lhh",
7126 CmpInstObj_Convert, &mh,
7127 &sampleTime,
7128 &hiliteStart,
7129 &hiliteEnd))
7130 return NULL;
7131 _rv = TextMediaHiliteTextSample(mh,
7132 sampleTime,
7133 hiliteStart,
7134 hiliteEnd,
7135 &rgbHiliteColor);
7136 _res = Py_BuildValue("lO&",
7137 _rv,
7138 QdRGB_New, &rgbHiliteColor);
7139 return _res;
7142 static PyObject *Qt_TextMediaSetTextSampleData(_self, _args)
7143 PyObject *_self;
7144 PyObject *_args;
7146 PyObject *_res = NULL;
7147 ComponentResult _rv;
7148 MediaHandler mh;
7149 void * data;
7150 OSType dataType;
7151 if (!PyArg_ParseTuple(_args, "O&sO&",
7152 CmpInstObj_Convert, &mh,
7153 &data,
7154 PyMac_GetOSType, &dataType))
7155 return NULL;
7156 _rv = TextMediaSetTextSampleData(mh,
7157 data,
7158 dataType);
7159 _res = Py_BuildValue("l",
7160 _rv);
7161 return _res;
7164 static PyObject *Qt_SpriteMediaSetProperty(_self, _args)
7165 PyObject *_self;
7166 PyObject *_args;
7168 PyObject *_res = NULL;
7169 ComponentResult _rv;
7170 MediaHandler mh;
7171 short spriteIndex;
7172 long propertyType;
7173 void * propertyValue;
7174 if (!PyArg_ParseTuple(_args, "O&hls",
7175 CmpInstObj_Convert, &mh,
7176 &spriteIndex,
7177 &propertyType,
7178 &propertyValue))
7179 return NULL;
7180 _rv = SpriteMediaSetProperty(mh,
7181 spriteIndex,
7182 propertyType,
7183 propertyValue);
7184 _res = Py_BuildValue("l",
7185 _rv);
7186 return _res;
7189 static PyObject *Qt_SpriteMediaGetProperty(_self, _args)
7190 PyObject *_self;
7191 PyObject *_args;
7193 PyObject *_res = NULL;
7194 ComponentResult _rv;
7195 MediaHandler mh;
7196 short spriteIndex;
7197 long propertyType;
7198 void * propertyValue;
7199 if (!PyArg_ParseTuple(_args, "O&hls",
7200 CmpInstObj_Convert, &mh,
7201 &spriteIndex,
7202 &propertyType,
7203 &propertyValue))
7204 return NULL;
7205 _rv = SpriteMediaGetProperty(mh,
7206 spriteIndex,
7207 propertyType,
7208 propertyValue);
7209 _res = Py_BuildValue("l",
7210 _rv);
7211 return _res;
7214 static PyObject *Qt_SpriteMediaHitTestSprites(_self, _args)
7215 PyObject *_self;
7216 PyObject *_args;
7218 PyObject *_res = NULL;
7219 ComponentResult _rv;
7220 MediaHandler mh;
7221 long flags;
7222 Point loc;
7223 short spriteHitIndex;
7224 if (!PyArg_ParseTuple(_args, "O&lO&",
7225 CmpInstObj_Convert, &mh,
7226 &flags,
7227 PyMac_GetPoint, &loc))
7228 return NULL;
7229 _rv = SpriteMediaHitTestSprites(mh,
7230 flags,
7231 loc,
7232 &spriteHitIndex);
7233 _res = Py_BuildValue("lh",
7234 _rv,
7235 spriteHitIndex);
7236 return _res;
7239 static PyObject *Qt_SpriteMediaCountSprites(_self, _args)
7240 PyObject *_self;
7241 PyObject *_args;
7243 PyObject *_res = NULL;
7244 ComponentResult _rv;
7245 MediaHandler mh;
7246 short numSprites;
7247 if (!PyArg_ParseTuple(_args, "O&",
7248 CmpInstObj_Convert, &mh))
7249 return NULL;
7250 _rv = SpriteMediaCountSprites(mh,
7251 &numSprites);
7252 _res = Py_BuildValue("lh",
7253 _rv,
7254 numSprites);
7255 return _res;
7258 static PyObject *Qt_SpriteMediaCountImages(_self, _args)
7259 PyObject *_self;
7260 PyObject *_args;
7262 PyObject *_res = NULL;
7263 ComponentResult _rv;
7264 MediaHandler mh;
7265 short numImages;
7266 if (!PyArg_ParseTuple(_args, "O&",
7267 CmpInstObj_Convert, &mh))
7268 return NULL;
7269 _rv = SpriteMediaCountImages(mh,
7270 &numImages);
7271 _res = Py_BuildValue("lh",
7272 _rv,
7273 numImages);
7274 return _res;
7277 static PyObject *Qt_SpriteMediaGetIndImageDescription(_self, _args)
7278 PyObject *_self;
7279 PyObject *_args;
7281 PyObject *_res = NULL;
7282 ComponentResult _rv;
7283 MediaHandler mh;
7284 short imageIndex;
7285 ImageDescriptionHandle imageDescription;
7286 if (!PyArg_ParseTuple(_args, "O&hO&",
7287 CmpInstObj_Convert, &mh,
7288 &imageIndex,
7289 ResObj_Convert, &imageDescription))
7290 return NULL;
7291 _rv = SpriteMediaGetIndImageDescription(mh,
7292 imageIndex,
7293 imageDescription);
7294 _res = Py_BuildValue("l",
7295 _rv);
7296 return _res;
7299 static PyObject *Qt_SpriteMediaGetDisplayedSampleNumber(_self, _args)
7300 PyObject *_self;
7301 PyObject *_args;
7303 PyObject *_res = NULL;
7304 ComponentResult _rv;
7305 MediaHandler mh;
7306 long sampleNum;
7307 if (!PyArg_ParseTuple(_args, "O&",
7308 CmpInstObj_Convert, &mh))
7309 return NULL;
7310 _rv = SpriteMediaGetDisplayedSampleNumber(mh,
7311 &sampleNum);
7312 _res = Py_BuildValue("ll",
7313 _rv,
7314 sampleNum);
7315 return _res;
7318 static PyObject *Qt_SpriteMediaGetSpriteName(_self, _args)
7319 PyObject *_self;
7320 PyObject *_args;
7322 PyObject *_res = NULL;
7323 ComponentResult _rv;
7324 MediaHandler mh;
7325 QTAtomID spriteID;
7326 Str255 spriteName;
7327 if (!PyArg_ParseTuple(_args, "O&lO&",
7328 CmpInstObj_Convert, &mh,
7329 &spriteID,
7330 PyMac_GetStr255, spriteName))
7331 return NULL;
7332 _rv = SpriteMediaGetSpriteName(mh,
7333 spriteID,
7334 spriteName);
7335 _res = Py_BuildValue("l",
7336 _rv);
7337 return _res;
7340 static PyObject *Qt_SpriteMediaGetImageName(_self, _args)
7341 PyObject *_self;
7342 PyObject *_args;
7344 PyObject *_res = NULL;
7345 ComponentResult _rv;
7346 MediaHandler mh;
7347 short imageIndex;
7348 Str255 imageName;
7349 if (!PyArg_ParseTuple(_args, "O&hO&",
7350 CmpInstObj_Convert, &mh,
7351 &imageIndex,
7352 PyMac_GetStr255, imageName))
7353 return NULL;
7354 _rv = SpriteMediaGetImageName(mh,
7355 imageIndex,
7356 imageName);
7357 _res = Py_BuildValue("l",
7358 _rv);
7359 return _res;
7362 static PyObject *Qt_SpriteMediaSetSpriteProperty(_self, _args)
7363 PyObject *_self;
7364 PyObject *_args;
7366 PyObject *_res = NULL;
7367 ComponentResult _rv;
7368 MediaHandler mh;
7369 QTAtomID spriteID;
7370 long propertyType;
7371 void * propertyValue;
7372 if (!PyArg_ParseTuple(_args, "O&lls",
7373 CmpInstObj_Convert, &mh,
7374 &spriteID,
7375 &propertyType,
7376 &propertyValue))
7377 return NULL;
7378 _rv = SpriteMediaSetSpriteProperty(mh,
7379 spriteID,
7380 propertyType,
7381 propertyValue);
7382 _res = Py_BuildValue("l",
7383 _rv);
7384 return _res;
7387 static PyObject *Qt_SpriteMediaGetSpriteProperty(_self, _args)
7388 PyObject *_self;
7389 PyObject *_args;
7391 PyObject *_res = NULL;
7392 ComponentResult _rv;
7393 MediaHandler mh;
7394 QTAtomID spriteID;
7395 long propertyType;
7396 void * propertyValue;
7397 if (!PyArg_ParseTuple(_args, "O&lls",
7398 CmpInstObj_Convert, &mh,
7399 &spriteID,
7400 &propertyType,
7401 &propertyValue))
7402 return NULL;
7403 _rv = SpriteMediaGetSpriteProperty(mh,
7404 spriteID,
7405 propertyType,
7406 propertyValue);
7407 _res = Py_BuildValue("l",
7408 _rv);
7409 return _res;
7412 static PyObject *Qt_SpriteMediaHitTestAllSprites(_self, _args)
7413 PyObject *_self;
7414 PyObject *_args;
7416 PyObject *_res = NULL;
7417 ComponentResult _rv;
7418 MediaHandler mh;
7419 long flags;
7420 Point loc;
7421 QTAtomID spriteHitID;
7422 if (!PyArg_ParseTuple(_args, "O&lO&",
7423 CmpInstObj_Convert, &mh,
7424 &flags,
7425 PyMac_GetPoint, &loc))
7426 return NULL;
7427 _rv = SpriteMediaHitTestAllSprites(mh,
7428 flags,
7429 loc,
7430 &spriteHitID);
7431 _res = Py_BuildValue("ll",
7432 _rv,
7433 spriteHitID);
7434 return _res;
7437 static PyObject *Qt_SpriteMediaHitTestOneSprite(_self, _args)
7438 PyObject *_self;
7439 PyObject *_args;
7441 PyObject *_res = NULL;
7442 ComponentResult _rv;
7443 MediaHandler mh;
7444 QTAtomID spriteID;
7445 long flags;
7446 Point loc;
7447 Boolean wasHit;
7448 if (!PyArg_ParseTuple(_args, "O&llO&",
7449 CmpInstObj_Convert, &mh,
7450 &spriteID,
7451 &flags,
7452 PyMac_GetPoint, &loc))
7453 return NULL;
7454 _rv = SpriteMediaHitTestOneSprite(mh,
7455 spriteID,
7456 flags,
7457 loc,
7458 &wasHit);
7459 _res = Py_BuildValue("lb",
7460 _rv,
7461 wasHit);
7462 return _res;
7465 static PyObject *Qt_SpriteMediaSpriteIndexToID(_self, _args)
7466 PyObject *_self;
7467 PyObject *_args;
7469 PyObject *_res = NULL;
7470 ComponentResult _rv;
7471 MediaHandler mh;
7472 short spriteIndex;
7473 QTAtomID spriteID;
7474 if (!PyArg_ParseTuple(_args, "O&h",
7475 CmpInstObj_Convert, &mh,
7476 &spriteIndex))
7477 return NULL;
7478 _rv = SpriteMediaSpriteIndexToID(mh,
7479 spriteIndex,
7480 &spriteID);
7481 _res = Py_BuildValue("ll",
7482 _rv,
7483 spriteID);
7484 return _res;
7487 static PyObject *Qt_SpriteMediaSpriteIDToIndex(_self, _args)
7488 PyObject *_self;
7489 PyObject *_args;
7491 PyObject *_res = NULL;
7492 ComponentResult _rv;
7493 MediaHandler mh;
7494 QTAtomID spriteID;
7495 short spriteIndex;
7496 if (!PyArg_ParseTuple(_args, "O&l",
7497 CmpInstObj_Convert, &mh,
7498 &spriteID))
7499 return NULL;
7500 _rv = SpriteMediaSpriteIDToIndex(mh,
7501 spriteID,
7502 &spriteIndex);
7503 _res = Py_BuildValue("lh",
7504 _rv,
7505 spriteIndex);
7506 return _res;
7509 static PyObject *Qt_SpriteMediaSetActionVariable(_self, _args)
7510 PyObject *_self;
7511 PyObject *_args;
7513 PyObject *_res = NULL;
7514 ComponentResult _rv;
7515 MediaHandler mh;
7516 QTAtomID variableID;
7517 float value;
7518 if (!PyArg_ParseTuple(_args, "O&lf",
7519 CmpInstObj_Convert, &mh,
7520 &variableID,
7521 &value))
7522 return NULL;
7523 _rv = SpriteMediaSetActionVariable(mh,
7524 variableID,
7525 &value);
7526 _res = Py_BuildValue("l",
7527 _rv);
7528 return _res;
7531 static PyObject *Qt_SpriteMediaGetActionVariable(_self, _args)
7532 PyObject *_self;
7533 PyObject *_args;
7535 PyObject *_res = NULL;
7536 ComponentResult _rv;
7537 MediaHandler mh;
7538 QTAtomID variableID;
7539 float value;
7540 if (!PyArg_ParseTuple(_args, "O&l",
7541 CmpInstObj_Convert, &mh,
7542 &variableID))
7543 return NULL;
7544 _rv = SpriteMediaGetActionVariable(mh,
7545 variableID,
7546 &value);
7547 _res = Py_BuildValue("lf",
7548 _rv,
7549 value);
7550 return _res;
7553 static PyObject *Qt_SpriteMediaGetIndImageProperty(_self, _args)
7554 PyObject *_self;
7555 PyObject *_args;
7557 PyObject *_res = NULL;
7558 ComponentResult _rv;
7559 MediaHandler mh;
7560 short imageIndex;
7561 long imagePropertyType;
7562 void * imagePropertyValue;
7563 if (!PyArg_ParseTuple(_args, "O&hls",
7564 CmpInstObj_Convert, &mh,
7565 &imageIndex,
7566 &imagePropertyType,
7567 &imagePropertyValue))
7568 return NULL;
7569 _rv = SpriteMediaGetIndImageProperty(mh,
7570 imageIndex,
7571 imagePropertyType,
7572 imagePropertyValue);
7573 _res = Py_BuildValue("l",
7574 _rv);
7575 return _res;
7578 static PyObject *Qt_NewTimeBase(_self, _args)
7579 PyObject *_self;
7580 PyObject *_args;
7582 PyObject *_res = NULL;
7583 TimeBase _rv;
7584 if (!PyArg_ParseTuple(_args, ""))
7585 return NULL;
7586 _rv = NewTimeBase();
7587 _res = Py_BuildValue("O&",
7588 TimeBaseObj_New, _rv);
7589 return _res;
7592 static PyObject *Qt_ConvertTime(_self, _args)
7593 PyObject *_self;
7594 PyObject *_args;
7596 PyObject *_res = NULL;
7597 TimeRecord inout;
7598 TimeBase newBase;
7599 if (!PyArg_ParseTuple(_args, "O&",
7600 TimeBaseObj_Convert, &newBase))
7601 return NULL;
7602 ConvertTime(&inout,
7603 newBase);
7604 _res = Py_BuildValue("O&",
7605 QtTimeRecord_New, &inout);
7606 return _res;
7609 static PyObject *Qt_ConvertTimeScale(_self, _args)
7610 PyObject *_self;
7611 PyObject *_args;
7613 PyObject *_res = NULL;
7614 TimeRecord inout;
7615 TimeScale newScale;
7616 if (!PyArg_ParseTuple(_args, "l",
7617 &newScale))
7618 return NULL;
7619 ConvertTimeScale(&inout,
7620 newScale);
7621 _res = Py_BuildValue("O&",
7622 QtTimeRecord_New, &inout);
7623 return _res;
7626 static PyObject *Qt_AddTime(_self, _args)
7627 PyObject *_self;
7628 PyObject *_args;
7630 PyObject *_res = NULL;
7631 TimeRecord dst;
7632 TimeRecord src;
7633 if (!PyArg_ParseTuple(_args, "O&",
7634 QtTimeRecord_Convert, &src))
7635 return NULL;
7636 AddTime(&dst,
7637 &src);
7638 _res = Py_BuildValue("O&",
7639 QtTimeRecord_New, &dst);
7640 return _res;
7643 static PyObject *Qt_SubtractTime(_self, _args)
7644 PyObject *_self;
7645 PyObject *_args;
7647 PyObject *_res = NULL;
7648 TimeRecord dst;
7649 TimeRecord src;
7650 if (!PyArg_ParseTuple(_args, "O&",
7651 QtTimeRecord_Convert, &src))
7652 return NULL;
7653 SubtractTime(&dst,
7654 &src);
7655 _res = Py_BuildValue("O&",
7656 QtTimeRecord_New, &dst);
7657 return _res;
7660 static PyObject *Qt_MusicMediaGetIndexedTunePlayer(_self, _args)
7661 PyObject *_self;
7662 PyObject *_args;
7664 PyObject *_res = NULL;
7665 ComponentResult _rv;
7666 ComponentInstance ti;
7667 long sampleDescIndex;
7668 ComponentInstance tp;
7669 if (!PyArg_ParseTuple(_args, "O&l",
7670 CmpInstObj_Convert, &ti,
7671 &sampleDescIndex))
7672 return NULL;
7673 _rv = MusicMediaGetIndexedTunePlayer(ti,
7674 sampleDescIndex,
7675 &tp);
7676 _res = Py_BuildValue("lO&",
7677 _rv,
7678 CmpInstObj_New, tp);
7679 return _res;
7682 static PyObject *Qt_AlignWindow(_self, _args)
7683 PyObject *_self;
7684 PyObject *_args;
7686 PyObject *_res = NULL;
7687 WindowPtr wp;
7688 Boolean front;
7689 if (!PyArg_ParseTuple(_args, "O&b",
7690 WinObj_Convert, &wp,
7691 &front))
7692 return NULL;
7693 AlignWindow(wp,
7694 front,
7695 (Rect *)0,
7696 (ICMAlignmentProcRecordPtr)0);
7697 Py_INCREF(Py_None);
7698 _res = Py_None;
7699 return _res;
7702 static PyObject *Qt_DragAlignedWindow(_self, _args)
7703 PyObject *_self;
7704 PyObject *_args;
7706 PyObject *_res = NULL;
7707 WindowPtr wp;
7708 Point startPt;
7709 Rect boundsRect;
7710 if (!PyArg_ParseTuple(_args, "O&O&O&",
7711 WinObj_Convert, &wp,
7712 PyMac_GetPoint, &startPt,
7713 PyMac_GetRect, &boundsRect))
7714 return NULL;
7715 DragAlignedWindow(wp,
7716 startPt,
7717 &boundsRect,
7718 (Rect *)0,
7719 (ICMAlignmentProcRecordPtr)0);
7720 Py_INCREF(Py_None);
7721 _res = Py_None;
7722 return _res;
7725 static PyObject *Qt_MoviesTask(_self, _args)
7726 PyObject *_self;
7727 PyObject *_args;
7729 PyObject *_res = NULL;
7730 long maxMilliSecToUse;
7731 if (!PyArg_ParseTuple(_args, "l",
7732 &maxMilliSecToUse))
7733 return NULL;
7734 MoviesTask((Movie)0,
7735 maxMilliSecToUse);
7736 Py_INCREF(Py_None);
7737 _res = Py_None;
7738 return _res;
7741 static PyObject *Qt_available(_self, _args)
7742 PyObject *_self;
7743 PyObject *_args;
7745 PyObject *_res = NULL;
7747 void *ptr;
7749 if ( !PyArg_ParseTuple(_args, "") )
7750 return NULL;
7751 ptr = (void *)&EnterMovies;
7752 return Py_BuildValue("i", ((long)ptr != 0));
7756 static PyMethodDef Qt_methods[] = {
7757 {"EnterMovies", (PyCFunction)Qt_EnterMovies, 1,
7758 "() -> None"},
7759 {"ExitMovies", (PyCFunction)Qt_ExitMovies, 1,
7760 "() -> None"},
7761 {"GetMoviesError", (PyCFunction)Qt_GetMoviesError, 1,
7762 "() -> None"},
7763 {"ClearMoviesStickyError", (PyCFunction)Qt_ClearMoviesStickyError, 1,
7764 "() -> None"},
7765 {"GetMoviesStickyError", (PyCFunction)Qt_GetMoviesStickyError, 1,
7766 "() -> None"},
7767 {"DisposeMatte", (PyCFunction)Qt_DisposeMatte, 1,
7768 "(PixMapHandle theMatte) -> None"},
7769 {"NewMovie", (PyCFunction)Qt_NewMovie, 1,
7770 "(long flags) -> (Movie _rv)"},
7771 {"GetDataHandler", (PyCFunction)Qt_GetDataHandler, 1,
7772 "(Handle dataRef, OSType dataHandlerSubType, long flags) -> (Component _rv)"},
7773 {"PasteHandleIntoMovie", (PyCFunction)Qt_PasteHandleIntoMovie, 1,
7774 "(Handle h, OSType handleType, Movie theMovie, long flags, ComponentInstance userComp) -> None"},
7775 {"GetMovieImporterForDataRef", (PyCFunction)Qt_GetMovieImporterForDataRef, 1,
7776 "(OSType dataRefType, Handle dataRef, long flags) -> (Component importer)"},
7777 {"TrackTimeToMediaTime", (PyCFunction)Qt_TrackTimeToMediaTime, 1,
7778 "(TimeValue value, Track theTrack) -> (TimeValue _rv)"},
7779 {"NewUserData", (PyCFunction)Qt_NewUserData, 1,
7780 "() -> (UserData theUserData)"},
7781 {"NewUserDataFromHandle", (PyCFunction)Qt_NewUserDataFromHandle, 1,
7782 "(Handle h) -> (UserData theUserData)"},
7783 {"CreateMovieFile", (PyCFunction)Qt_CreateMovieFile, 1,
7784 "(FSSpec fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (short resRefNum, Movie newmovie)"},
7785 {"OpenMovieFile", (PyCFunction)Qt_OpenMovieFile, 1,
7786 "(FSSpec fileSpec, SInt8 permission) -> (short resRefNum)"},
7787 {"CloseMovieFile", (PyCFunction)Qt_CloseMovieFile, 1,
7788 "(short resRefNum) -> None"},
7789 {"DeleteMovieFile", (PyCFunction)Qt_DeleteMovieFile, 1,
7790 "(FSSpec fileSpec) -> None"},
7791 {"NewMovieFromFile", (PyCFunction)Qt_NewMovieFromFile, 1,
7792 "(short resRefNum, short resId, short newMovieFlags) -> (Movie theMovie, short resId, Boolean dataRefWasChanged)"},
7793 {"NewMovieFromHandle", (PyCFunction)Qt_NewMovieFromHandle, 1,
7794 "(Handle h, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
7795 {"NewMovieFromDataFork", (PyCFunction)Qt_NewMovieFromDataFork, 1,
7796 "(short fRefNum, long fileOffset, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
7797 {"NewMovieFromDataRef", (PyCFunction)Qt_NewMovieFromDataRef, 1,
7798 "(short flags, Handle dataRef, OSType dataRefType) -> (Movie m, short id)"},
7799 {"RemoveMovieResource", (PyCFunction)Qt_RemoveMovieResource, 1,
7800 "(short resRefNum, short resId) -> None"},
7801 {"NewMovieFromScrap", (PyCFunction)Qt_NewMovieFromScrap, 1,
7802 "(long newMovieFlags) -> (Movie _rv)"},
7803 {"QTNewAlias", (PyCFunction)Qt_QTNewAlias, 1,
7804 "(FSSpec fss, Boolean minimal) -> (AliasHandle alias)"},
7805 {"EndFullScreen", (PyCFunction)Qt_EndFullScreen, 1,
7806 "(Ptr fullState, long flags) -> None"},
7807 {"AddSoundDescriptionExtension", (PyCFunction)Qt_AddSoundDescriptionExtension, 1,
7808 "(SoundDescriptionHandle desc, Handle extension, OSType idType) -> None"},
7809 {"GetSoundDescriptionExtension", (PyCFunction)Qt_GetSoundDescriptionExtension, 1,
7810 "(SoundDescriptionHandle desc, OSType idType) -> (Handle extension)"},
7811 {"RemoveSoundDescriptionExtension", (PyCFunction)Qt_RemoveSoundDescriptionExtension, 1,
7812 "(SoundDescriptionHandle desc, OSType idType) -> None"},
7813 {"QTIsStandardParameterDialogEvent", (PyCFunction)Qt_QTIsStandardParameterDialogEvent, 1,
7814 "(QTParameterDialog createdDialog) -> (EventRecord pEvent)"},
7815 {"QTDismissStandardParameterDialog", (PyCFunction)Qt_QTDismissStandardParameterDialog, 1,
7816 "(QTParameterDialog createdDialog) -> None"},
7817 {"QTStandardParameterDialogDoAction", (PyCFunction)Qt_QTStandardParameterDialogDoAction, 1,
7818 "(QTParameterDialog createdDialog, long action, void * params) -> None"},
7819 {"QTRegisterAccessKey", (PyCFunction)Qt_QTRegisterAccessKey, 1,
7820 "(Str255 accessKeyType, long flags, Handle accessKey) -> None"},
7821 {"QTUnregisterAccessKey", (PyCFunction)Qt_QTUnregisterAccessKey, 1,
7822 "(Str255 accessKeyType, long flags, Handle accessKey) -> None"},
7823 {"QTTextToNativeText", (PyCFunction)Qt_QTTextToNativeText, 1,
7824 "(Handle theText, long encoding, long flags) -> None"},
7825 {"VideoMediaResetStatistics", (PyCFunction)Qt_VideoMediaResetStatistics, 1,
7826 "(MediaHandler mh) -> (ComponentResult _rv)"},
7827 {"VideoMediaGetStatistics", (PyCFunction)Qt_VideoMediaGetStatistics, 1,
7828 "(MediaHandler mh) -> (ComponentResult _rv)"},
7829 {"TextMediaAddTextSample", (PyCFunction)Qt_TextMediaAddTextSample, 1,
7830 "(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)"},
7831 {"TextMediaAddTESample", (PyCFunction)Qt_TextMediaAddTESample, 1,
7832 "(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)"},
7833 {"TextMediaAddHiliteSample", (PyCFunction)Qt_TextMediaAddHiliteSample, 1,
7834 "(MediaHandler mh, short hiliteStart, short hiliteEnd, TimeValue duration) -> (ComponentResult _rv, RGBColor rgbHiliteColor, TimeValue sampleTime)"},
7835 {"TextMediaFindNextText", (PyCFunction)Qt_TextMediaFindNextText, 1,
7836 "(MediaHandler mh, Ptr text, long size, short findFlags, TimeValue startTime) -> (ComponentResult _rv, TimeValue foundTime, TimeValue foundDuration, long offset)"},
7837 {"TextMediaHiliteTextSample", (PyCFunction)Qt_TextMediaHiliteTextSample, 1,
7838 "(MediaHandler mh, TimeValue sampleTime, short hiliteStart, short hiliteEnd) -> (ComponentResult _rv, RGBColor rgbHiliteColor)"},
7839 {"TextMediaSetTextSampleData", (PyCFunction)Qt_TextMediaSetTextSampleData, 1,
7840 "(MediaHandler mh, void * data, OSType dataType) -> (ComponentResult _rv)"},
7841 {"SpriteMediaSetProperty", (PyCFunction)Qt_SpriteMediaSetProperty, 1,
7842 "(MediaHandler mh, short spriteIndex, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
7843 {"SpriteMediaGetProperty", (PyCFunction)Qt_SpriteMediaGetProperty, 1,
7844 "(MediaHandler mh, short spriteIndex, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
7845 {"SpriteMediaHitTestSprites", (PyCFunction)Qt_SpriteMediaHitTestSprites, 1,
7846 "(MediaHandler mh, long flags, Point loc) -> (ComponentResult _rv, short spriteHitIndex)"},
7847 {"SpriteMediaCountSprites", (PyCFunction)Qt_SpriteMediaCountSprites, 1,
7848 "(MediaHandler mh) -> (ComponentResult _rv, short numSprites)"},
7849 {"SpriteMediaCountImages", (PyCFunction)Qt_SpriteMediaCountImages, 1,
7850 "(MediaHandler mh) -> (ComponentResult _rv, short numImages)"},
7851 {"SpriteMediaGetIndImageDescription", (PyCFunction)Qt_SpriteMediaGetIndImageDescription, 1,
7852 "(MediaHandler mh, short imageIndex, ImageDescriptionHandle imageDescription) -> (ComponentResult _rv)"},
7853 {"SpriteMediaGetDisplayedSampleNumber", (PyCFunction)Qt_SpriteMediaGetDisplayedSampleNumber, 1,
7854 "(MediaHandler mh) -> (ComponentResult _rv, long sampleNum)"},
7855 {"SpriteMediaGetSpriteName", (PyCFunction)Qt_SpriteMediaGetSpriteName, 1,
7856 "(MediaHandler mh, QTAtomID spriteID, Str255 spriteName) -> (ComponentResult _rv)"},
7857 {"SpriteMediaGetImageName", (PyCFunction)Qt_SpriteMediaGetImageName, 1,
7858 "(MediaHandler mh, short imageIndex, Str255 imageName) -> (ComponentResult _rv)"},
7859 {"SpriteMediaSetSpriteProperty", (PyCFunction)Qt_SpriteMediaSetSpriteProperty, 1,
7860 "(MediaHandler mh, QTAtomID spriteID, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
7861 {"SpriteMediaGetSpriteProperty", (PyCFunction)Qt_SpriteMediaGetSpriteProperty, 1,
7862 "(MediaHandler mh, QTAtomID spriteID, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
7863 {"SpriteMediaHitTestAllSprites", (PyCFunction)Qt_SpriteMediaHitTestAllSprites, 1,
7864 "(MediaHandler mh, long flags, Point loc) -> (ComponentResult _rv, QTAtomID spriteHitID)"},
7865 {"SpriteMediaHitTestOneSprite", (PyCFunction)Qt_SpriteMediaHitTestOneSprite, 1,
7866 "(MediaHandler mh, QTAtomID spriteID, long flags, Point loc) -> (ComponentResult _rv, Boolean wasHit)"},
7867 {"SpriteMediaSpriteIndexToID", (PyCFunction)Qt_SpriteMediaSpriteIndexToID, 1,
7868 "(MediaHandler mh, short spriteIndex) -> (ComponentResult _rv, QTAtomID spriteID)"},
7869 {"SpriteMediaSpriteIDToIndex", (PyCFunction)Qt_SpriteMediaSpriteIDToIndex, 1,
7870 "(MediaHandler mh, QTAtomID spriteID) -> (ComponentResult _rv, short spriteIndex)"},
7871 {"SpriteMediaSetActionVariable", (PyCFunction)Qt_SpriteMediaSetActionVariable, 1,
7872 "(MediaHandler mh, QTAtomID variableID, float value) -> (ComponentResult _rv)"},
7873 {"SpriteMediaGetActionVariable", (PyCFunction)Qt_SpriteMediaGetActionVariable, 1,
7874 "(MediaHandler mh, QTAtomID variableID) -> (ComponentResult _rv, float value)"},
7875 {"SpriteMediaGetIndImageProperty", (PyCFunction)Qt_SpriteMediaGetIndImageProperty, 1,
7876 "(MediaHandler mh, short imageIndex, long imagePropertyType, void * imagePropertyValue) -> (ComponentResult _rv)"},
7877 {"NewTimeBase", (PyCFunction)Qt_NewTimeBase, 1,
7878 "() -> (TimeBase _rv)"},
7879 {"ConvertTime", (PyCFunction)Qt_ConvertTime, 1,
7880 "(TimeBase newBase) -> (TimeRecord inout)"},
7881 {"ConvertTimeScale", (PyCFunction)Qt_ConvertTimeScale, 1,
7882 "(TimeScale newScale) -> (TimeRecord inout)"},
7883 {"AddTime", (PyCFunction)Qt_AddTime, 1,
7884 "(TimeRecord src) -> (TimeRecord dst)"},
7885 {"SubtractTime", (PyCFunction)Qt_SubtractTime, 1,
7886 "(TimeRecord src) -> (TimeRecord dst)"},
7887 {"MusicMediaGetIndexedTunePlayer", (PyCFunction)Qt_MusicMediaGetIndexedTunePlayer, 1,
7888 "(ComponentInstance ti, long sampleDescIndex) -> (ComponentResult _rv, ComponentInstance tp)"},
7889 {"AlignWindow", (PyCFunction)Qt_AlignWindow, 1,
7890 "(WindowPtr wp, Boolean front) -> None"},
7891 {"DragAlignedWindow", (PyCFunction)Qt_DragAlignedWindow, 1,
7892 "(WindowPtr wp, Point startPt, Rect boundsRect) -> None"},
7893 {"MoviesTask", (PyCFunction)Qt_MoviesTask, 1,
7894 "(long maxMilliSecToUse) -> None"},
7895 {"available", (PyCFunction)Qt_available, 1,
7896 "Return true if Quicktime is available"},
7897 {NULL, NULL, 0}
7903 void initQt()
7905 PyObject *m;
7906 PyObject *d;
7911 m = Py_InitModule("Qt", Qt_methods);
7912 d = PyModule_GetDict(m);
7913 Qt_Error = PyMac_GetOSErrException();
7914 if (Qt_Error == NULL ||
7915 PyDict_SetItemString(d, "Error", Qt_Error) != 0)
7916 Py_FatalError("can't initialize Qt.Error");
7917 MovieController_Type.ob_type = &PyType_Type;
7918 Py_INCREF(&MovieController_Type);
7919 if (PyDict_SetItemString(d, "MovieControllerType", (PyObject *)&MovieController_Type) != 0)
7920 Py_FatalError("can't initialize MovieControllerType");
7921 TimeBase_Type.ob_type = &PyType_Type;
7922 Py_INCREF(&TimeBase_Type);
7923 if (PyDict_SetItemString(d, "TimeBaseType", (PyObject *)&TimeBase_Type) != 0)
7924 Py_FatalError("can't initialize TimeBaseType");
7925 UserData_Type.ob_type = &PyType_Type;
7926 Py_INCREF(&UserData_Type);
7927 if (PyDict_SetItemString(d, "UserDataType", (PyObject *)&UserData_Type) != 0)
7928 Py_FatalError("can't initialize UserDataType");
7929 Media_Type.ob_type = &PyType_Type;
7930 Py_INCREF(&Media_Type);
7931 if (PyDict_SetItemString(d, "MediaType", (PyObject *)&Media_Type) != 0)
7932 Py_FatalError("can't initialize MediaType");
7933 Track_Type.ob_type = &PyType_Type;
7934 Py_INCREF(&Track_Type);
7935 if (PyDict_SetItemString(d, "TrackType", (PyObject *)&Track_Type) != 0)
7936 Py_FatalError("can't initialize TrackType");
7937 Movie_Type.ob_type = &PyType_Type;
7938 Py_INCREF(&Movie_Type);
7939 if (PyDict_SetItemString(d, "MovieType", (PyObject *)&Movie_Type) != 0)
7940 Py_FatalError("can't initialize MovieType");
7943 /* ========================= End module Qt ========================== */