2 /* =========================== Module Qt ============================ */
8 #define SystemSevenOrLater 1
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
);
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
*, MovieController
*);
67 static PyObject
*Qt_Error
;
69 /* ------------------ Object type MovieController ------------------- */
71 PyTypeObject MovieController_Type
;
73 #define MovieCtlObj_Check(x) ((x)->ob_type == &MovieController_Type)
75 typedef struct MovieControllerObject
{
77 MovieController ob_itself
;
78 } MovieControllerObject
;
80 PyObject
*MovieCtlObj_New(itself
)
81 MovieController itself
;
83 MovieControllerObject
*it
;
85 PyErr_SetString(Qt_Error
,"Cannot create null MovieController");
88 it
= PyObject_NEW(MovieControllerObject
, &MovieController_Type
);
89 if (it
== NULL
) return NULL
;
90 it
->ob_itself
= itself
;
91 return (PyObject
*)it
;
93 MovieCtlObj_Convert(v
, p_itself
)
95 MovieController
*p_itself
;
97 if (!MovieCtlObj_Check(v
))
99 PyErr_SetString(PyExc_TypeError
, "MovieController required");
102 *p_itself
= ((MovieControllerObject
*)v
)->ob_itself
;
106 static void MovieCtlObj_dealloc(self
)
107 MovieControllerObject
*self
;
109 DisposeMovieController(self
->ob_itself
);
113 static PyObject
*MovieCtlObj_MCSetMovie(_self
, _args
)
114 MovieControllerObject
*_self
;
117 PyObject
*_res
= NULL
;
120 WindowPtr movieWindow
;
122 if (!PyArg_ParseTuple(_args
, "O&O&O&",
123 MovieObj_Convert
, &theMovie
,
124 WinObj_Convert
, &movieWindow
,
125 PyMac_GetPoint
, &where
))
127 _rv
= MCSetMovie(_self
->ob_itself
,
131 _res
= Py_BuildValue("l",
136 static PyObject
*MovieCtlObj_MCGetIndMovie(_self
, _args
)
137 MovieControllerObject
*_self
;
140 PyObject
*_res
= NULL
;
143 if (!PyArg_ParseTuple(_args
, "h",
146 _rv
= MCGetIndMovie(_self
->ob_itself
,
148 _res
= Py_BuildValue("O&",
153 static PyObject
*MovieCtlObj_MCRemoveMovie(_self
, _args
)
154 MovieControllerObject
*_self
;
157 PyObject
*_res
= NULL
;
159 if (!PyArg_ParseTuple(_args
, ""))
161 _rv
= MCRemoveMovie(_self
->ob_itself
);
162 _res
= Py_BuildValue("l",
167 static PyObject
*MovieCtlObj_MCIsPlayerEvent(_self
, _args
)
168 MovieControllerObject
*_self
;
171 PyObject
*_res
= NULL
;
174 if (!PyArg_ParseTuple(_args
, "O&",
175 PyMac_GetEventRecord
, &e
))
177 _rv
= MCIsPlayerEvent(_self
->ob_itself
,
179 _res
= Py_BuildValue("l",
184 static PyObject
*MovieCtlObj_MCDoAction(_self
, _args
)
185 MovieControllerObject
*_self
;
188 PyObject
*_res
= NULL
;
192 if (!PyArg_ParseTuple(_args
, "hs",
196 _rv
= MCDoAction(_self
->ob_itself
,
199 _res
= Py_BuildValue("l",
204 static PyObject
*MovieCtlObj_MCSetControllerAttached(_self
, _args
)
205 MovieControllerObject
*_self
;
208 PyObject
*_res
= NULL
;
211 if (!PyArg_ParseTuple(_args
, "b",
214 _rv
= MCSetControllerAttached(_self
->ob_itself
,
216 _res
= Py_BuildValue("l",
221 static PyObject
*MovieCtlObj_MCIsControllerAttached(_self
, _args
)
222 MovieControllerObject
*_self
;
225 PyObject
*_res
= NULL
;
227 if (!PyArg_ParseTuple(_args
, ""))
229 _rv
= MCIsControllerAttached(_self
->ob_itself
);
230 _res
= Py_BuildValue("l",
235 static PyObject
*MovieCtlObj_MCSetVisible(_self
, _args
)
236 MovieControllerObject
*_self
;
239 PyObject
*_res
= NULL
;
242 if (!PyArg_ParseTuple(_args
, "b",
245 _rv
= MCSetVisible(_self
->ob_itself
,
247 _res
= Py_BuildValue("l",
252 static PyObject
*MovieCtlObj_MCGetVisible(_self
, _args
)
253 MovieControllerObject
*_self
;
256 PyObject
*_res
= NULL
;
258 if (!PyArg_ParseTuple(_args
, ""))
260 _rv
= MCGetVisible(_self
->ob_itself
);
261 _res
= Py_BuildValue("l",
266 static PyObject
*MovieCtlObj_MCGetControllerBoundsRect(_self
, _args
)
267 MovieControllerObject
*_self
;
270 PyObject
*_res
= NULL
;
273 if (!PyArg_ParseTuple(_args
, ""))
275 _rv
= MCGetControllerBoundsRect(_self
->ob_itself
,
277 _res
= Py_BuildValue("lO&",
279 PyMac_BuildRect
, &bounds
);
283 static PyObject
*MovieCtlObj_MCSetControllerBoundsRect(_self
, _args
)
284 MovieControllerObject
*_self
;
287 PyObject
*_res
= NULL
;
290 if (!PyArg_ParseTuple(_args
, "O&",
291 PyMac_GetRect
, &bounds
))
293 _rv
= MCSetControllerBoundsRect(_self
->ob_itself
,
295 _res
= Py_BuildValue("l",
300 static PyObject
*MovieCtlObj_MCGetControllerBoundsRgn(_self
, _args
)
301 MovieControllerObject
*_self
;
304 PyObject
*_res
= NULL
;
306 if (!PyArg_ParseTuple(_args
, ""))
308 _rv
= MCGetControllerBoundsRgn(_self
->ob_itself
);
309 _res
= Py_BuildValue("O&",
314 static PyObject
*MovieCtlObj_MCGetWindowRgn(_self
, _args
)
315 MovieControllerObject
*_self
;
318 PyObject
*_res
= NULL
;
321 if (!PyArg_ParseTuple(_args
, "O&",
324 _rv
= MCGetWindowRgn(_self
->ob_itself
,
326 _res
= Py_BuildValue("O&",
331 static PyObject
*MovieCtlObj_MCMovieChanged(_self
, _args
)
332 MovieControllerObject
*_self
;
335 PyObject
*_res
= NULL
;
338 if (!PyArg_ParseTuple(_args
, "O&",
339 MovieObj_Convert
, &m
))
341 _rv
= MCMovieChanged(_self
->ob_itself
,
343 _res
= Py_BuildValue("l",
348 static PyObject
*MovieCtlObj_MCSetDuration(_self
, _args
)
349 MovieControllerObject
*_self
;
352 PyObject
*_res
= NULL
;
355 if (!PyArg_ParseTuple(_args
, "l",
358 _rv
= MCSetDuration(_self
->ob_itself
,
360 _res
= Py_BuildValue("l",
365 static PyObject
*MovieCtlObj_MCGetCurrentTime(_self
, _args
)
366 MovieControllerObject
*_self
;
369 PyObject
*_res
= NULL
;
372 if (!PyArg_ParseTuple(_args
, ""))
374 _rv
= MCGetCurrentTime(_self
->ob_itself
,
376 _res
= Py_BuildValue("ll",
382 static PyObject
*MovieCtlObj_MCNewAttachedController(_self
, _args
)
383 MovieControllerObject
*_self
;
386 PyObject
*_res
= NULL
;
391 if (!PyArg_ParseTuple(_args
, "O&O&O&",
392 MovieObj_Convert
, &theMovie
,
394 PyMac_GetPoint
, &where
))
396 _rv
= MCNewAttachedController(_self
->ob_itself
,
400 _res
= Py_BuildValue("l",
405 static PyObject
*MovieCtlObj_MCDraw(_self
, _args
)
406 MovieControllerObject
*_self
;
409 PyObject
*_res
= NULL
;
412 if (!PyArg_ParseTuple(_args
, "O&",
415 _rv
= MCDraw(_self
->ob_itself
,
417 _res
= Py_BuildValue("l",
422 static PyObject
*MovieCtlObj_MCActivate(_self
, _args
)
423 MovieControllerObject
*_self
;
426 PyObject
*_res
= NULL
;
430 if (!PyArg_ParseTuple(_args
, "O&b",
434 _rv
= MCActivate(_self
->ob_itself
,
437 _res
= Py_BuildValue("l",
442 static PyObject
*MovieCtlObj_MCIdle(_self
, _args
)
443 MovieControllerObject
*_self
;
446 PyObject
*_res
= NULL
;
448 if (!PyArg_ParseTuple(_args
, ""))
450 _rv
= MCIdle(_self
->ob_itself
);
451 _res
= Py_BuildValue("l",
456 static PyObject
*MovieCtlObj_MCKey(_self
, _args
)
457 MovieControllerObject
*_self
;
460 PyObject
*_res
= NULL
;
464 if (!PyArg_ParseTuple(_args
, "bl",
468 _rv
= MCKey(_self
->ob_itself
,
471 _res
= Py_BuildValue("l",
476 static PyObject
*MovieCtlObj_MCClick(_self
, _args
)
477 MovieControllerObject
*_self
;
480 PyObject
*_res
= NULL
;
486 if (!PyArg_ParseTuple(_args
, "O&O&ll",
488 PyMac_GetPoint
, &where
,
492 _rv
= MCClick(_self
->ob_itself
,
497 _res
= Py_BuildValue("l",
502 static PyObject
*MovieCtlObj_MCEnableEditing(_self
, _args
)
503 MovieControllerObject
*_self
;
506 PyObject
*_res
= NULL
;
509 if (!PyArg_ParseTuple(_args
, "b",
512 _rv
= MCEnableEditing(_self
->ob_itself
,
514 _res
= Py_BuildValue("l",
519 static PyObject
*MovieCtlObj_MCIsEditingEnabled(_self
, _args
)
520 MovieControllerObject
*_self
;
523 PyObject
*_res
= NULL
;
525 if (!PyArg_ParseTuple(_args
, ""))
527 _rv
= MCIsEditingEnabled(_self
->ob_itself
);
528 _res
= Py_BuildValue("l",
533 static PyObject
*MovieCtlObj_MCCopy(_self
, _args
)
534 MovieControllerObject
*_self
;
537 PyObject
*_res
= NULL
;
539 if (!PyArg_ParseTuple(_args
, ""))
541 _rv
= MCCopy(_self
->ob_itself
);
542 _res
= Py_BuildValue("O&",
547 static PyObject
*MovieCtlObj_MCCut(_self
, _args
)
548 MovieControllerObject
*_self
;
551 PyObject
*_res
= NULL
;
553 if (!PyArg_ParseTuple(_args
, ""))
555 _rv
= MCCut(_self
->ob_itself
);
556 _res
= Py_BuildValue("O&",
561 static PyObject
*MovieCtlObj_MCPaste(_self
, _args
)
562 MovieControllerObject
*_self
;
565 PyObject
*_res
= NULL
;
568 if (!PyArg_ParseTuple(_args
, "O&",
569 MovieObj_Convert
, &srcMovie
))
571 _rv
= MCPaste(_self
->ob_itself
,
573 _res
= Py_BuildValue("l",
578 static PyObject
*MovieCtlObj_MCClear(_self
, _args
)
579 MovieControllerObject
*_self
;
582 PyObject
*_res
= NULL
;
584 if (!PyArg_ParseTuple(_args
, ""))
586 _rv
= MCClear(_self
->ob_itself
);
587 _res
= Py_BuildValue("l",
592 static PyObject
*MovieCtlObj_MCUndo(_self
, _args
)
593 MovieControllerObject
*_self
;
596 PyObject
*_res
= NULL
;
598 if (!PyArg_ParseTuple(_args
, ""))
600 _rv
= MCUndo(_self
->ob_itself
);
601 _res
= Py_BuildValue("l",
606 static PyObject
*MovieCtlObj_MCPositionController(_self
, _args
)
607 MovieControllerObject
*_self
;
610 PyObject
*_res
= NULL
;
615 if (!PyArg_ParseTuple(_args
, "O&O&l",
616 PyMac_GetRect
, &movieRect
,
617 PyMac_GetRect
, &controllerRect
,
620 _rv
= MCPositionController(_self
->ob_itself
,
624 _res
= Py_BuildValue("l",
629 static PyObject
*MovieCtlObj_MCGetControllerInfo(_self
, _args
)
630 MovieControllerObject
*_self
;
633 PyObject
*_res
= NULL
;
636 if (!PyArg_ParseTuple(_args
, ""))
638 _rv
= MCGetControllerInfo(_self
->ob_itself
,
640 _res
= Py_BuildValue("ll",
646 static PyObject
*MovieCtlObj_MCSetClip(_self
, _args
)
647 MovieControllerObject
*_self
;
650 PyObject
*_res
= NULL
;
654 if (!PyArg_ParseTuple(_args
, "O&O&",
655 ResObj_Convert
, &theClip
,
656 ResObj_Convert
, &movieClip
))
658 _rv
= MCSetClip(_self
->ob_itself
,
661 _res
= Py_BuildValue("l",
666 static PyObject
*MovieCtlObj_MCGetClip(_self
, _args
)
667 MovieControllerObject
*_self
;
670 PyObject
*_res
= NULL
;
674 if (!PyArg_ParseTuple(_args
, ""))
676 _rv
= MCGetClip(_self
->ob_itself
,
679 _res
= Py_BuildValue("lO&O&",
682 ResObj_New
, movieClip
);
686 static PyObject
*MovieCtlObj_MCDrawBadge(_self
, _args
)
687 MovieControllerObject
*_self
;
690 PyObject
*_res
= NULL
;
694 if (!PyArg_ParseTuple(_args
, "O&",
695 ResObj_Convert
, &movieRgn
))
697 _rv
= MCDrawBadge(_self
->ob_itself
,
700 _res
= Py_BuildValue("lO&",
702 ResObj_New
, badgeRgn
);
706 static PyObject
*MovieCtlObj_MCSetUpEditMenu(_self
, _args
)
707 MovieControllerObject
*_self
;
710 PyObject
*_res
= NULL
;
714 if (!PyArg_ParseTuple(_args
, "lO&",
716 MenuObj_Convert
, &mh
))
718 _rv
= MCSetUpEditMenu(_self
->ob_itself
,
721 _res
= Py_BuildValue("l",
726 static PyObject
*MovieCtlObj_MCGetMenuString(_self
, _args
)
727 MovieControllerObject
*_self
;
730 PyObject
*_res
= NULL
;
735 if (!PyArg_ParseTuple(_args
, "lhO&",
738 PyMac_GetStr255
, aString
))
740 _rv
= MCGetMenuString(_self
->ob_itself
,
744 _res
= Py_BuildValue("l",
749 static PyMethodDef MovieCtlObj_methods
[] = {
750 {"MCSetMovie", (PyCFunction
)MovieCtlObj_MCSetMovie
, 1,
751 "(Movie theMovie, WindowPtr movieWindow, Point where) -> (ComponentResult _rv)"},
752 {"MCGetIndMovie", (PyCFunction
)MovieCtlObj_MCGetIndMovie
, 1,
753 "(short index) -> (Movie _rv)"},
754 {"MCRemoveMovie", (PyCFunction
)MovieCtlObj_MCRemoveMovie
, 1,
755 "() -> (ComponentResult _rv)"},
756 {"MCIsPlayerEvent", (PyCFunction
)MovieCtlObj_MCIsPlayerEvent
, 1,
757 "(EventRecord e) -> (ComponentResult _rv)"},
758 {"MCDoAction", (PyCFunction
)MovieCtlObj_MCDoAction
, 1,
759 "(short action, void * params) -> (ComponentResult _rv)"},
760 {"MCSetControllerAttached", (PyCFunction
)MovieCtlObj_MCSetControllerAttached
, 1,
761 "(Boolean attach) -> (ComponentResult _rv)"},
762 {"MCIsControllerAttached", (PyCFunction
)MovieCtlObj_MCIsControllerAttached
, 1,
763 "() -> (ComponentResult _rv)"},
764 {"MCSetVisible", (PyCFunction
)MovieCtlObj_MCSetVisible
, 1,
765 "(Boolean visible) -> (ComponentResult _rv)"},
766 {"MCGetVisible", (PyCFunction
)MovieCtlObj_MCGetVisible
, 1,
767 "() -> (ComponentResult _rv)"},
768 {"MCGetControllerBoundsRect", (PyCFunction
)MovieCtlObj_MCGetControllerBoundsRect
, 1,
769 "() -> (ComponentResult _rv, Rect bounds)"},
770 {"MCSetControllerBoundsRect", (PyCFunction
)MovieCtlObj_MCSetControllerBoundsRect
, 1,
771 "(Rect bounds) -> (ComponentResult _rv)"},
772 {"MCGetControllerBoundsRgn", (PyCFunction
)MovieCtlObj_MCGetControllerBoundsRgn
, 1,
773 "() -> (RgnHandle _rv)"},
774 {"MCGetWindowRgn", (PyCFunction
)MovieCtlObj_MCGetWindowRgn
, 1,
775 "(WindowPtr w) -> (RgnHandle _rv)"},
776 {"MCMovieChanged", (PyCFunction
)MovieCtlObj_MCMovieChanged
, 1,
777 "(Movie m) -> (ComponentResult _rv)"},
778 {"MCSetDuration", (PyCFunction
)MovieCtlObj_MCSetDuration
, 1,
779 "(TimeValue duration) -> (ComponentResult _rv)"},
780 {"MCGetCurrentTime", (PyCFunction
)MovieCtlObj_MCGetCurrentTime
, 1,
781 "() -> (TimeValue _rv, TimeScale scale)"},
782 {"MCNewAttachedController", (PyCFunction
)MovieCtlObj_MCNewAttachedController
, 1,
783 "(Movie theMovie, WindowPtr w, Point where) -> (ComponentResult _rv)"},
784 {"MCDraw", (PyCFunction
)MovieCtlObj_MCDraw
, 1,
785 "(WindowPtr w) -> (ComponentResult _rv)"},
786 {"MCActivate", (PyCFunction
)MovieCtlObj_MCActivate
, 1,
787 "(WindowPtr w, Boolean activate) -> (ComponentResult _rv)"},
788 {"MCIdle", (PyCFunction
)MovieCtlObj_MCIdle
, 1,
789 "() -> (ComponentResult _rv)"},
790 {"MCKey", (PyCFunction
)MovieCtlObj_MCKey
, 1,
791 "(SInt8 key, long modifiers) -> (ComponentResult _rv)"},
792 {"MCClick", (PyCFunction
)MovieCtlObj_MCClick
, 1,
793 "(WindowPtr w, Point where, long when, long modifiers) -> (ComponentResult _rv)"},
794 {"MCEnableEditing", (PyCFunction
)MovieCtlObj_MCEnableEditing
, 1,
795 "(Boolean enabled) -> (ComponentResult _rv)"},
796 {"MCIsEditingEnabled", (PyCFunction
)MovieCtlObj_MCIsEditingEnabled
, 1,
798 {"MCCopy", (PyCFunction
)MovieCtlObj_MCCopy
, 1,
799 "() -> (Movie _rv)"},
800 {"MCCut", (PyCFunction
)MovieCtlObj_MCCut
, 1,
801 "() -> (Movie _rv)"},
802 {"MCPaste", (PyCFunction
)MovieCtlObj_MCPaste
, 1,
803 "(Movie srcMovie) -> (ComponentResult _rv)"},
804 {"MCClear", (PyCFunction
)MovieCtlObj_MCClear
, 1,
805 "() -> (ComponentResult _rv)"},
806 {"MCUndo", (PyCFunction
)MovieCtlObj_MCUndo
, 1,
807 "() -> (ComponentResult _rv)"},
808 {"MCPositionController", (PyCFunction
)MovieCtlObj_MCPositionController
, 1,
809 "(Rect movieRect, Rect controllerRect, long someFlags) -> (ComponentResult _rv)"},
810 {"MCGetControllerInfo", (PyCFunction
)MovieCtlObj_MCGetControllerInfo
, 1,
811 "() -> (ComponentResult _rv, long someFlags)"},
812 {"MCSetClip", (PyCFunction
)MovieCtlObj_MCSetClip
, 1,
813 "(RgnHandle theClip, RgnHandle movieClip) -> (ComponentResult _rv)"},
814 {"MCGetClip", (PyCFunction
)MovieCtlObj_MCGetClip
, 1,
815 "() -> (ComponentResult _rv, RgnHandle theClip, RgnHandle movieClip)"},
816 {"MCDrawBadge", (PyCFunction
)MovieCtlObj_MCDrawBadge
, 1,
817 "(RgnHandle movieRgn) -> (ComponentResult _rv, RgnHandle badgeRgn)"},
818 {"MCSetUpEditMenu", (PyCFunction
)MovieCtlObj_MCSetUpEditMenu
, 1,
819 "(long modifiers, MenuHandle mh) -> (ComponentResult _rv)"},
820 {"MCGetMenuString", (PyCFunction
)MovieCtlObj_MCGetMenuString
, 1,
821 "(long modifiers, short item, Str255 aString) -> (ComponentResult _rv)"},
825 PyMethodChain MovieCtlObj_chain
= { MovieCtlObj_methods
, NULL
};
827 static PyObject
*MovieCtlObj_getattr(self
, name
)
828 MovieControllerObject
*self
;
831 return Py_FindMethodInChain(&MovieCtlObj_chain
, (PyObject
*)self
, name
);
834 #define MovieCtlObj_setattr NULL
836 PyTypeObject MovieController_Type
= {
837 PyObject_HEAD_INIT(&PyType_Type
)
839 "MovieController", /*tp_name*/
840 sizeof(MovieControllerObject
), /*tp_basicsize*/
843 (destructor
) MovieCtlObj_dealloc
, /*tp_dealloc*/
845 (getattrfunc
) MovieCtlObj_getattr
, /*tp_getattr*/
846 (setattrfunc
) MovieCtlObj_setattr
, /*tp_setattr*/
849 /* ---------------- End object type MovieController ----------------- */
852 /* ---------------------- Object type TimeBase ---------------------- */
854 PyTypeObject TimeBase_Type
;
856 #define TimeBaseObj_Check(x) ((x)->ob_type == &TimeBase_Type)
858 typedef struct TimeBaseObject
{
863 PyObject
*TimeBaseObj_New(itself
)
867 if (itself
== NULL
) {
868 PyErr_SetString(Qt_Error
,"Cannot create null TimeBase");
871 it
= PyObject_NEW(TimeBaseObject
, &TimeBase_Type
);
872 if (it
== NULL
) return NULL
;
873 it
->ob_itself
= itself
;
874 return (PyObject
*)it
;
876 TimeBaseObj_Convert(v
, p_itself
)
880 if (!TimeBaseObj_Check(v
))
882 PyErr_SetString(PyExc_TypeError
, "TimeBase required");
885 *p_itself
= ((TimeBaseObject
*)v
)->ob_itself
;
889 static void TimeBaseObj_dealloc(self
)
890 TimeBaseObject
*self
;
892 DisposeTimeBase(self
->ob_itself
);
896 static PyObject
*TimeBaseObj_SetTimeBaseValue(_self
, _args
)
897 TimeBaseObject
*_self
;
900 PyObject
*_res
= NULL
;
903 if (!PyArg_ParseTuple(_args
, "ll",
907 SetTimeBaseValue(_self
->ob_itself
,
915 static PyObject
*TimeBaseObj_GetTimeBaseRate(_self
, _args
)
916 TimeBaseObject
*_self
;
919 PyObject
*_res
= NULL
;
921 if (!PyArg_ParseTuple(_args
, ""))
923 _rv
= GetTimeBaseRate(_self
->ob_itself
);
924 _res
= Py_BuildValue("O&",
925 PyMac_BuildFixed
, _rv
);
929 static PyObject
*TimeBaseObj_SetTimeBaseRate(_self
, _args
)
930 TimeBaseObject
*_self
;
933 PyObject
*_res
= NULL
;
935 if (!PyArg_ParseTuple(_args
, "O&",
938 SetTimeBaseRate(_self
->ob_itself
,
945 static PyObject
*TimeBaseObj_GetTimeBaseFlags(_self
, _args
)
946 TimeBaseObject
*_self
;
949 PyObject
*_res
= NULL
;
951 if (!PyArg_ParseTuple(_args
, ""))
953 _rv
= GetTimeBaseFlags(_self
->ob_itself
);
954 _res
= Py_BuildValue("l",
959 static PyObject
*TimeBaseObj_SetTimeBaseFlags(_self
, _args
)
960 TimeBaseObject
*_self
;
963 PyObject
*_res
= NULL
;
965 if (!PyArg_ParseTuple(_args
, "l",
968 SetTimeBaseFlags(_self
->ob_itself
,
975 static PyObject
*TimeBaseObj_GetTimeBaseMasterTimeBase(_self
, _args
)
976 TimeBaseObject
*_self
;
979 PyObject
*_res
= NULL
;
981 if (!PyArg_ParseTuple(_args
, ""))
983 _rv
= GetTimeBaseMasterTimeBase(_self
->ob_itself
);
984 _res
= Py_BuildValue("O&",
985 TimeBaseObj_New
, _rv
);
989 static PyObject
*TimeBaseObj_GetTimeBaseMasterClock(_self
, _args
)
990 TimeBaseObject
*_self
;
993 PyObject
*_res
= NULL
;
994 ComponentInstance _rv
;
995 if (!PyArg_ParseTuple(_args
, ""))
997 _rv
= GetTimeBaseMasterClock(_self
->ob_itself
);
998 _res
= Py_BuildValue("O&",
999 CmpInstObj_New
, _rv
);
1003 static PyObject
*TimeBaseObj_GetTimeBaseEffectiveRate(_self
, _args
)
1004 TimeBaseObject
*_self
;
1007 PyObject
*_res
= NULL
;
1009 if (!PyArg_ParseTuple(_args
, ""))
1011 _rv
= GetTimeBaseEffectiveRate(_self
->ob_itself
);
1012 _res
= Py_BuildValue("O&",
1013 PyMac_BuildFixed
, _rv
);
1017 static PyMethodDef TimeBaseObj_methods
[] = {
1018 {"SetTimeBaseValue", (PyCFunction
)TimeBaseObj_SetTimeBaseValue
, 1,
1019 "(TimeValue t, TimeScale s) -> None"},
1020 {"GetTimeBaseRate", (PyCFunction
)TimeBaseObj_GetTimeBaseRate
, 1,
1021 "() -> (Fixed _rv)"},
1022 {"SetTimeBaseRate", (PyCFunction
)TimeBaseObj_SetTimeBaseRate
, 1,
1023 "(Fixed r) -> None"},
1024 {"GetTimeBaseFlags", (PyCFunction
)TimeBaseObj_GetTimeBaseFlags
, 1,
1025 "() -> (long _rv)"},
1026 {"SetTimeBaseFlags", (PyCFunction
)TimeBaseObj_SetTimeBaseFlags
, 1,
1027 "(long timeBaseFlags) -> None"},
1028 {"GetTimeBaseMasterTimeBase", (PyCFunction
)TimeBaseObj_GetTimeBaseMasterTimeBase
, 1,
1029 "() -> (TimeBase _rv)"},
1030 {"GetTimeBaseMasterClock", (PyCFunction
)TimeBaseObj_GetTimeBaseMasterClock
, 1,
1031 "() -> (ComponentInstance _rv)"},
1032 {"GetTimeBaseEffectiveRate", (PyCFunction
)TimeBaseObj_GetTimeBaseEffectiveRate
, 1,
1033 "() -> (Fixed _rv)"},
1037 PyMethodChain TimeBaseObj_chain
= { TimeBaseObj_methods
, NULL
};
1039 static PyObject
*TimeBaseObj_getattr(self
, name
)
1040 TimeBaseObject
*self
;
1043 return Py_FindMethodInChain(&TimeBaseObj_chain
, (PyObject
*)self
, name
);
1046 #define TimeBaseObj_setattr NULL
1048 PyTypeObject TimeBase_Type
= {
1049 PyObject_HEAD_INIT(&PyType_Type
)
1051 "TimeBase", /*tp_name*/
1052 sizeof(TimeBaseObject
), /*tp_basicsize*/
1055 (destructor
) TimeBaseObj_dealloc
, /*tp_dealloc*/
1057 (getattrfunc
) TimeBaseObj_getattr
, /*tp_getattr*/
1058 (setattrfunc
) TimeBaseObj_setattr
, /*tp_setattr*/
1061 /* -------------------- End object type TimeBase -------------------- */
1064 /* ---------------------- Object type UserData ---------------------- */
1066 PyTypeObject UserData_Type
;
1068 #define UserDataObj_Check(x) ((x)->ob_type == &UserData_Type)
1070 typedef struct UserDataObject
{
1075 PyObject
*UserDataObj_New(itself
)
1079 if (itself
== NULL
) {
1080 PyErr_SetString(Qt_Error
,"Cannot create null UserData");
1083 it
= PyObject_NEW(UserDataObject
, &UserData_Type
);
1084 if (it
== NULL
) return NULL
;
1085 it
->ob_itself
= itself
;
1086 return (PyObject
*)it
;
1088 UserDataObj_Convert(v
, p_itself
)
1092 if (!UserDataObj_Check(v
))
1094 PyErr_SetString(PyExc_TypeError
, "UserData required");
1097 *p_itself
= ((UserDataObject
*)v
)->ob_itself
;
1101 static void UserDataObj_dealloc(self
)
1102 UserDataObject
*self
;
1104 DisposeUserData(self
->ob_itself
);
1108 static PyObject
*UserDataObj_GetUserData(_self
, _args
)
1109 UserDataObject
*_self
;
1112 PyObject
*_res
= NULL
;
1117 if (!PyArg_ParseTuple(_args
, "O&O&l",
1118 ResObj_Convert
, &data
,
1119 PyMac_GetOSType
, &udType
,
1122 _err
= GetUserData(_self
->ob_itself
,
1126 if (_err
!= noErr
) return PyMac_Error(_err
);
1132 static PyObject
*UserDataObj_AddUserData(_self
, _args
)
1133 UserDataObject
*_self
;
1136 PyObject
*_res
= NULL
;
1140 if (!PyArg_ParseTuple(_args
, "O&O&",
1141 ResObj_Convert
, &data
,
1142 PyMac_GetOSType
, &udType
))
1144 _err
= AddUserData(_self
->ob_itself
,
1147 if (_err
!= noErr
) return PyMac_Error(_err
);
1153 static PyObject
*UserDataObj_RemoveUserData(_self
, _args
)
1154 UserDataObject
*_self
;
1157 PyObject
*_res
= NULL
;
1161 if (!PyArg_ParseTuple(_args
, "O&l",
1162 PyMac_GetOSType
, &udType
,
1165 _err
= RemoveUserData(_self
->ob_itself
,
1168 if (_err
!= noErr
) return PyMac_Error(_err
);
1174 static PyObject
*UserDataObj_CountUserDataType(_self
, _args
)
1175 UserDataObject
*_self
;
1178 PyObject
*_res
= NULL
;
1181 if (!PyArg_ParseTuple(_args
, "O&",
1182 PyMac_GetOSType
, &udType
))
1184 _rv
= CountUserDataType(_self
->ob_itself
,
1186 _res
= Py_BuildValue("h",
1191 static PyObject
*UserDataObj_GetNextUserDataType(_self
, _args
)
1192 UserDataObject
*_self
;
1195 PyObject
*_res
= NULL
;
1198 if (!PyArg_ParseTuple(_args
, "O&",
1199 PyMac_GetOSType
, &udType
))
1201 _rv
= GetNextUserDataType(_self
->ob_itself
,
1203 _res
= Py_BuildValue("l",
1208 static PyObject
*UserDataObj_AddUserDataText(_self
, _args
)
1209 UserDataObject
*_self
;
1212 PyObject
*_res
= NULL
;
1218 if (!PyArg_ParseTuple(_args
, "O&O&lh",
1219 ResObj_Convert
, &data
,
1220 PyMac_GetOSType
, &udType
,
1224 _err
= AddUserDataText(_self
->ob_itself
,
1229 if (_err
!= noErr
) return PyMac_Error(_err
);
1235 static PyObject
*UserDataObj_GetUserDataText(_self
, _args
)
1236 UserDataObject
*_self
;
1239 PyObject
*_res
= NULL
;
1245 if (!PyArg_ParseTuple(_args
, "O&O&lh",
1246 ResObj_Convert
, &data
,
1247 PyMac_GetOSType
, &udType
,
1251 _err
= GetUserDataText(_self
->ob_itself
,
1256 if (_err
!= noErr
) return PyMac_Error(_err
);
1262 static PyObject
*UserDataObj_RemoveUserDataText(_self
, _args
)
1263 UserDataObject
*_self
;
1266 PyObject
*_res
= NULL
;
1271 if (!PyArg_ParseTuple(_args
, "O&lh",
1272 PyMac_GetOSType
, &udType
,
1276 _err
= RemoveUserDataText(_self
->ob_itself
,
1280 if (_err
!= noErr
) return PyMac_Error(_err
);
1286 static PyObject
*UserDataObj_PutUserDataIntoHandle(_self
, _args
)
1287 UserDataObject
*_self
;
1290 PyObject
*_res
= NULL
;
1293 if (!PyArg_ParseTuple(_args
, "O&",
1294 ResObj_Convert
, &h
))
1296 _err
= PutUserDataIntoHandle(_self
->ob_itself
,
1298 if (_err
!= noErr
) return PyMac_Error(_err
);
1304 static PyMethodDef UserDataObj_methods
[] = {
1305 {"GetUserData", (PyCFunction
)UserDataObj_GetUserData
, 1,
1306 "(Handle data, OSType udType, long index) -> None"},
1307 {"AddUserData", (PyCFunction
)UserDataObj_AddUserData
, 1,
1308 "(Handle data, OSType udType) -> None"},
1309 {"RemoveUserData", (PyCFunction
)UserDataObj_RemoveUserData
, 1,
1310 "(OSType udType, long index) -> None"},
1311 {"CountUserDataType", (PyCFunction
)UserDataObj_CountUserDataType
, 1,
1312 "(OSType udType) -> (short _rv)"},
1313 {"GetNextUserDataType", (PyCFunction
)UserDataObj_GetNextUserDataType
, 1,
1314 "(OSType udType) -> (long _rv)"},
1315 {"AddUserDataText", (PyCFunction
)UserDataObj_AddUserDataText
, 1,
1316 "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
1317 {"GetUserDataText", (PyCFunction
)UserDataObj_GetUserDataText
, 1,
1318 "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
1319 {"RemoveUserDataText", (PyCFunction
)UserDataObj_RemoveUserDataText
, 1,
1320 "(OSType udType, long index, short itlRegionTag) -> None"},
1321 {"PutUserDataIntoHandle", (PyCFunction
)UserDataObj_PutUserDataIntoHandle
, 1,
1322 "(Handle h) -> None"},
1326 PyMethodChain UserDataObj_chain
= { UserDataObj_methods
, NULL
};
1328 static PyObject
*UserDataObj_getattr(self
, name
)
1329 UserDataObject
*self
;
1332 return Py_FindMethodInChain(&UserDataObj_chain
, (PyObject
*)self
, name
);
1335 #define UserDataObj_setattr NULL
1337 PyTypeObject UserData_Type
= {
1338 PyObject_HEAD_INIT(&PyType_Type
)
1340 "UserData", /*tp_name*/
1341 sizeof(UserDataObject
), /*tp_basicsize*/
1344 (destructor
) UserDataObj_dealloc
, /*tp_dealloc*/
1346 (getattrfunc
) UserDataObj_getattr
, /*tp_getattr*/
1347 (setattrfunc
) UserDataObj_setattr
, /*tp_setattr*/
1350 /* -------------------- End object type UserData -------------------- */
1353 /* ----------------------- Object type Media ------------------------ */
1355 PyTypeObject Media_Type
;
1357 #define MediaObj_Check(x) ((x)->ob_type == &Media_Type)
1359 typedef struct MediaObject
{
1364 PyObject
*MediaObj_New(itself
)
1368 if (itself
== NULL
) {
1369 PyErr_SetString(Qt_Error
,"Cannot create null Media");
1372 it
= PyObject_NEW(MediaObject
, &Media_Type
);
1373 if (it
== NULL
) return NULL
;
1374 it
->ob_itself
= itself
;
1375 return (PyObject
*)it
;
1377 MediaObj_Convert(v
, p_itself
)
1381 if (!MediaObj_Check(v
))
1383 PyErr_SetString(PyExc_TypeError
, "Media required");
1386 *p_itself
= ((MediaObject
*)v
)->ob_itself
;
1390 static void MediaObj_dealloc(self
)
1393 DisposeTrackMedia(self
->ob_itself
);
1397 static PyObject
*MediaObj_LoadMediaIntoRam(_self
, _args
)
1401 PyObject
*_res
= NULL
;
1406 if (!PyArg_ParseTuple(_args
, "lll",
1411 _err
= LoadMediaIntoRam(_self
->ob_itself
,
1415 if (_err
!= noErr
) return PyMac_Error(_err
);
1421 static PyObject
*MediaObj_GetMediaTrack(_self
, _args
)
1425 PyObject
*_res
= NULL
;
1427 if (!PyArg_ParseTuple(_args
, ""))
1429 _rv
= GetMediaTrack(_self
->ob_itself
);
1430 _res
= Py_BuildValue("O&",
1435 static PyObject
*MediaObj_GetMediaTimeScale(_self
, _args
)
1439 PyObject
*_res
= NULL
;
1441 if (!PyArg_ParseTuple(_args
, ""))
1443 _rv
= GetMediaTimeScale(_self
->ob_itself
);
1444 _res
= Py_BuildValue("l",
1449 static PyObject
*MediaObj_SetMediaTimeScale(_self
, _args
)
1453 PyObject
*_res
= NULL
;
1454 TimeScale timeScale
;
1455 if (!PyArg_ParseTuple(_args
, "l",
1458 SetMediaTimeScale(_self
->ob_itself
,
1465 static PyObject
*MediaObj_GetMediaDuration(_self
, _args
)
1469 PyObject
*_res
= NULL
;
1471 if (!PyArg_ParseTuple(_args
, ""))
1473 _rv
= GetMediaDuration(_self
->ob_itself
);
1474 _res
= Py_BuildValue("l",
1479 static PyObject
*MediaObj_GetMediaLanguage(_self
, _args
)
1483 PyObject
*_res
= NULL
;
1485 if (!PyArg_ParseTuple(_args
, ""))
1487 _rv
= GetMediaLanguage(_self
->ob_itself
);
1488 _res
= Py_BuildValue("h",
1493 static PyObject
*MediaObj_SetMediaLanguage(_self
, _args
)
1497 PyObject
*_res
= NULL
;
1499 if (!PyArg_ParseTuple(_args
, "h",
1502 SetMediaLanguage(_self
->ob_itself
,
1509 static PyObject
*MediaObj_GetMediaQuality(_self
, _args
)
1513 PyObject
*_res
= NULL
;
1515 if (!PyArg_ParseTuple(_args
, ""))
1517 _rv
= GetMediaQuality(_self
->ob_itself
);
1518 _res
= Py_BuildValue("h",
1523 static PyObject
*MediaObj_SetMediaQuality(_self
, _args
)
1527 PyObject
*_res
= NULL
;
1529 if (!PyArg_ParseTuple(_args
, "h",
1532 SetMediaQuality(_self
->ob_itself
,
1539 static PyObject
*MediaObj_GetMediaHandlerDescription(_self
, _args
)
1543 PyObject
*_res
= NULL
;
1546 OSType creatorManufacturer
;
1547 if (!PyArg_ParseTuple(_args
, "O&",
1548 PyMac_GetStr255
, creatorName
))
1550 GetMediaHandlerDescription(_self
->ob_itself
,
1553 &creatorManufacturer
);
1554 _res
= Py_BuildValue("O&O&",
1555 PyMac_BuildOSType
, mediaType
,
1556 PyMac_BuildOSType
, creatorManufacturer
);
1560 static PyObject
*MediaObj_GetMediaUserData(_self
, _args
)
1564 PyObject
*_res
= NULL
;
1566 if (!PyArg_ParseTuple(_args
, ""))
1568 _rv
= GetMediaUserData(_self
->ob_itself
);
1569 _res
= Py_BuildValue("O&",
1570 UserDataObj_New
, _rv
);
1574 static PyObject
*MediaObj_GetMediaHandler(_self
, _args
)
1578 PyObject
*_res
= NULL
;
1580 if (!PyArg_ParseTuple(_args
, ""))
1582 _rv
= GetMediaHandler(_self
->ob_itself
);
1583 _res
= Py_BuildValue("O&",
1584 CmpInstObj_New
, _rv
);
1588 static PyObject
*MediaObj_SetMediaHandler(_self
, _args
)
1592 PyObject
*_res
= NULL
;
1594 MediaHandlerComponent mH
;
1595 if (!PyArg_ParseTuple(_args
, "O&",
1596 CmpObj_Convert
, &mH
))
1598 _err
= SetMediaHandler(_self
->ob_itself
,
1600 if (_err
!= noErr
) return PyMac_Error(_err
);
1606 static PyObject
*MediaObj_BeginMediaEdits(_self
, _args
)
1610 PyObject
*_res
= NULL
;
1612 if (!PyArg_ParseTuple(_args
, ""))
1614 _err
= BeginMediaEdits(_self
->ob_itself
);
1615 if (_err
!= noErr
) return PyMac_Error(_err
);
1621 static PyObject
*MediaObj_EndMediaEdits(_self
, _args
)
1625 PyObject
*_res
= NULL
;
1627 if (!PyArg_ParseTuple(_args
, ""))
1629 _err
= EndMediaEdits(_self
->ob_itself
);
1630 if (_err
!= noErr
) return PyMac_Error(_err
);
1636 static PyObject
*MediaObj_SetMediaDefaultDataRefIndex(_self
, _args
)
1640 PyObject
*_res
= NULL
;
1643 if (!PyArg_ParseTuple(_args
, "h",
1646 _err
= SetMediaDefaultDataRefIndex(_self
->ob_itself
,
1648 if (_err
!= noErr
) return PyMac_Error(_err
);
1654 static PyObject
*MediaObj_GetMediaDataHandlerDescription(_self
, _args
)
1658 PyObject
*_res
= NULL
;
1662 OSType creatorManufacturer
;
1663 if (!PyArg_ParseTuple(_args
, "hO&",
1665 PyMac_GetStr255
, creatorName
))
1667 GetMediaDataHandlerDescription(_self
->ob_itself
,
1671 &creatorManufacturer
);
1672 _res
= Py_BuildValue("O&O&",
1673 PyMac_BuildOSType
, dhType
,
1674 PyMac_BuildOSType
, creatorManufacturer
);
1678 static PyObject
*MediaObj_GetMediaDataHandler(_self
, _args
)
1682 PyObject
*_res
= NULL
;
1685 if (!PyArg_ParseTuple(_args
, "h",
1688 _rv
= GetMediaDataHandler(_self
->ob_itself
,
1690 _res
= Py_BuildValue("O&",
1691 CmpInstObj_New
, _rv
);
1695 static PyObject
*MediaObj_SetMediaDataHandler(_self
, _args
)
1699 PyObject
*_res
= NULL
;
1702 DataHandlerComponent dataHandler
;
1703 if (!PyArg_ParseTuple(_args
, "hO&",
1705 CmpObj_Convert
, &dataHandler
))
1707 _err
= SetMediaDataHandler(_self
->ob_itself
,
1710 if (_err
!= noErr
) return PyMac_Error(_err
);
1716 static PyObject
*MediaObj_GetMediaSampleDescriptionCount(_self
, _args
)
1720 PyObject
*_res
= NULL
;
1722 if (!PyArg_ParseTuple(_args
, ""))
1724 _rv
= GetMediaSampleDescriptionCount(_self
->ob_itself
);
1725 _res
= Py_BuildValue("l",
1730 static PyObject
*MediaObj_GetMediaSampleDescription(_self
, _args
)
1734 PyObject
*_res
= NULL
;
1736 SampleDescriptionHandle descH
;
1737 if (!PyArg_ParseTuple(_args
, "lO&",
1739 ResObj_Convert
, &descH
))
1741 GetMediaSampleDescription(_self
->ob_itself
,
1749 static PyObject
*MediaObj_SetMediaSampleDescription(_self
, _args
)
1753 PyObject
*_res
= NULL
;
1756 SampleDescriptionHandle descH
;
1757 if (!PyArg_ParseTuple(_args
, "lO&",
1759 ResObj_Convert
, &descH
))
1761 _err
= SetMediaSampleDescription(_self
->ob_itself
,
1764 if (_err
!= noErr
) return PyMac_Error(_err
);
1770 static PyObject
*MediaObj_GetMediaSampleCount(_self
, _args
)
1774 PyObject
*_res
= NULL
;
1776 if (!PyArg_ParseTuple(_args
, ""))
1778 _rv
= GetMediaSampleCount(_self
->ob_itself
);
1779 _res
= Py_BuildValue("l",
1784 static PyObject
*MediaObj_SampleNumToMediaTime(_self
, _args
)
1788 PyObject
*_res
= NULL
;
1789 long logicalSampleNum
;
1790 TimeValue sampleTime
;
1791 TimeValue sampleDuration
;
1792 if (!PyArg_ParseTuple(_args
, "l",
1795 SampleNumToMediaTime(_self
->ob_itself
,
1799 _res
= Py_BuildValue("ll",
1805 static PyObject
*MediaObj_MediaTimeToSampleNum(_self
, _args
)
1809 PyObject
*_res
= NULL
;
1812 TimeValue sampleTime
;
1813 TimeValue sampleDuration
;
1814 if (!PyArg_ParseTuple(_args
, "l",
1817 MediaTimeToSampleNum(_self
->ob_itself
,
1822 _res
= Py_BuildValue("lll",
1829 static PyObject
*MediaObj_AddMediaSample(_self
, _args
)
1833 PyObject
*_res
= NULL
;
1838 TimeValue durationPerSample
;
1839 SampleDescriptionHandle sampleDescriptionH
;
1840 long numberOfSamples
;
1842 TimeValue sampleTime
;
1843 if (!PyArg_ParseTuple(_args
, "O&lllO&lh",
1844 ResObj_Convert
, &dataIn
,
1848 ResObj_Convert
, &sampleDescriptionH
,
1852 _err
= AddMediaSample(_self
->ob_itself
,
1861 if (_err
!= noErr
) return PyMac_Error(_err
);
1862 _res
= Py_BuildValue("l",
1867 static PyObject
*MediaObj_AddMediaSampleReference(_self
, _args
)
1871 PyObject
*_res
= NULL
;
1875 TimeValue durationPerSample
;
1876 SampleDescriptionHandle sampleDescriptionH
;
1877 long numberOfSamples
;
1879 TimeValue sampleTime
;
1880 if (!PyArg_ParseTuple(_args
, "lllO&lh",
1884 ResObj_Convert
, &sampleDescriptionH
,
1888 _err
= AddMediaSampleReference(_self
->ob_itself
,
1896 if (_err
!= noErr
) return PyMac_Error(_err
);
1897 _res
= Py_BuildValue("l",
1902 static PyObject
*MediaObj_GetMediaSample(_self
, _args
)
1906 PyObject
*_res
= NULL
;
1912 TimeValue sampleTime
;
1913 TimeValue durationPerSample
;
1914 SampleDescriptionHandle sampleDescriptionH
;
1915 long sampleDescriptionIndex
;
1916 long maxNumberOfSamples
;
1917 long numberOfSamples
;
1919 if (!PyArg_ParseTuple(_args
, "O&llO&l",
1920 ResObj_Convert
, &dataOut
,
1923 ResObj_Convert
, &sampleDescriptionH
,
1924 &maxNumberOfSamples
))
1926 _err
= GetMediaSample(_self
->ob_itself
,
1934 &sampleDescriptionIndex
,
1938 if (_err
!= noErr
) return PyMac_Error(_err
);
1939 _res
= Py_BuildValue("lllllh",
1943 sampleDescriptionIndex
,
1949 static PyObject
*MediaObj_GetMediaSampleReference(_self
, _args
)
1953 PyObject
*_res
= NULL
;
1958 TimeValue sampleTime
;
1959 TimeValue durationPerSample
;
1960 SampleDescriptionHandle sampleDescriptionH
;
1961 long sampleDescriptionIndex
;
1962 long maxNumberOfSamples
;
1963 long numberOfSamples
;
1965 if (!PyArg_ParseTuple(_args
, "lO&l",
1967 ResObj_Convert
, &sampleDescriptionH
,
1968 &maxNumberOfSamples
))
1970 _err
= GetMediaSampleReference(_self
->ob_itself
,
1977 &sampleDescriptionIndex
,
1981 if (_err
!= noErr
) return PyMac_Error(_err
);
1982 _res
= Py_BuildValue("llllllh",
1987 sampleDescriptionIndex
,
1993 static PyObject
*MediaObj_SetMediaPreferredChunkSize(_self
, _args
)
1997 PyObject
*_res
= NULL
;
2000 if (!PyArg_ParseTuple(_args
, "l",
2003 _err
= SetMediaPreferredChunkSize(_self
->ob_itself
,
2005 if (_err
!= noErr
) return PyMac_Error(_err
);
2011 static PyObject
*MediaObj_GetMediaPreferredChunkSize(_self
, _args
)
2015 PyObject
*_res
= NULL
;
2018 if (!PyArg_ParseTuple(_args
, ""))
2020 _err
= GetMediaPreferredChunkSize(_self
->ob_itself
,
2022 if (_err
!= noErr
) return PyMac_Error(_err
);
2023 _res
= Py_BuildValue("l",
2028 static PyObject
*MediaObj_SetMediaShadowSync(_self
, _args
)
2032 PyObject
*_res
= NULL
;
2034 long frameDiffSampleNum
;
2036 if (!PyArg_ParseTuple(_args
, "ll",
2037 &frameDiffSampleNum
,
2040 _err
= SetMediaShadowSync(_self
->ob_itself
,
2043 if (_err
!= noErr
) return PyMac_Error(_err
);
2049 static PyObject
*MediaObj_GetMediaShadowSync(_self
, _args
)
2053 PyObject
*_res
= NULL
;
2055 long frameDiffSampleNum
;
2057 if (!PyArg_ParseTuple(_args
, "l",
2058 &frameDiffSampleNum
))
2060 _err
= GetMediaShadowSync(_self
->ob_itself
,
2063 if (_err
!= noErr
) return PyMac_Error(_err
);
2064 _res
= Py_BuildValue("l",
2069 static PyObject
*MediaObj_GetMediaDataSize(_self
, _args
)
2073 PyObject
*_res
= NULL
;
2075 TimeValue startTime
;
2077 if (!PyArg_ParseTuple(_args
, "ll",
2081 _rv
= GetMediaDataSize(_self
->ob_itself
,
2084 _res
= Py_BuildValue("l",
2089 static PyObject
*MediaObj_GetMediaNextInterestingTime(_self
, _args
)
2093 PyObject
*_res
= NULL
;
2094 short interestingTimeFlags
;
2097 TimeValue interestingTime
;
2098 TimeValue interestingDuration
;
2099 if (!PyArg_ParseTuple(_args
, "hlO&",
2100 &interestingTimeFlags
,
2102 PyMac_GetFixed
, &rate
))
2104 GetMediaNextInterestingTime(_self
->ob_itself
,
2105 interestingTimeFlags
,
2109 &interestingDuration
);
2110 _res
= Py_BuildValue("ll",
2112 interestingDuration
);
2116 static PyObject
*MediaObj_GetMediaDataRef(_self
, _args
)
2120 PyObject
*_res
= NULL
;
2125 long dataRefAttributes
;
2126 if (!PyArg_ParseTuple(_args
, "h",
2129 _err
= GetMediaDataRef(_self
->ob_itself
,
2133 &dataRefAttributes
);
2134 if (_err
!= noErr
) return PyMac_Error(_err
);
2135 _res
= Py_BuildValue("O&O&l",
2136 ResObj_New
, dataRef
,
2137 PyMac_BuildOSType
, dataRefType
,
2142 static PyObject
*MediaObj_SetMediaDataRef(_self
, _args
)
2146 PyObject
*_res
= NULL
;
2151 if (!PyArg_ParseTuple(_args
, "hO&O&",
2153 ResObj_Convert
, &dataRef
,
2154 PyMac_GetOSType
, &dataRefType
))
2156 _err
= SetMediaDataRef(_self
->ob_itself
,
2160 if (_err
!= noErr
) return PyMac_Error(_err
);
2166 static PyObject
*MediaObj_SetMediaDataRefAttributes(_self
, _args
)
2170 PyObject
*_res
= NULL
;
2173 long dataRefAttributes
;
2174 if (!PyArg_ParseTuple(_args
, "hl",
2176 &dataRefAttributes
))
2178 _err
= SetMediaDataRefAttributes(_self
->ob_itself
,
2181 if (_err
!= noErr
) return PyMac_Error(_err
);
2187 static PyObject
*MediaObj_AddMediaDataRef(_self
, _args
)
2191 PyObject
*_res
= NULL
;
2196 if (!PyArg_ParseTuple(_args
, "O&O&",
2197 ResObj_Convert
, &dataRef
,
2198 PyMac_GetOSType
, &dataRefType
))
2200 _err
= AddMediaDataRef(_self
->ob_itself
,
2204 if (_err
!= noErr
) return PyMac_Error(_err
);
2205 _res
= Py_BuildValue("h",
2210 static PyObject
*MediaObj_GetMediaDataRefCount(_self
, _args
)
2214 PyObject
*_res
= NULL
;
2217 if (!PyArg_ParseTuple(_args
, ""))
2219 _err
= GetMediaDataRefCount(_self
->ob_itself
,
2221 if (_err
!= noErr
) return PyMac_Error(_err
);
2222 _res
= Py_BuildValue("h",
2227 static PyObject
*MediaObj_SetMediaPlayHints(_self
, _args
)
2231 PyObject
*_res
= NULL
;
2234 if (!PyArg_ParseTuple(_args
, "ll",
2238 SetMediaPlayHints(_self
->ob_itself
,
2246 static PyMethodDef MediaObj_methods
[] = {
2247 {"LoadMediaIntoRam", (PyCFunction
)MediaObj_LoadMediaIntoRam
, 1,
2248 "(TimeValue time, TimeValue duration, long flags) -> None"},
2249 {"GetMediaTrack", (PyCFunction
)MediaObj_GetMediaTrack
, 1,
2250 "() -> (Track _rv)"},
2251 {"GetMediaTimeScale", (PyCFunction
)MediaObj_GetMediaTimeScale
, 1,
2252 "() -> (TimeScale _rv)"},
2253 {"SetMediaTimeScale", (PyCFunction
)MediaObj_SetMediaTimeScale
, 1,
2254 "(TimeScale timeScale) -> None"},
2255 {"GetMediaDuration", (PyCFunction
)MediaObj_GetMediaDuration
, 1,
2256 "() -> (TimeValue _rv)"},
2257 {"GetMediaLanguage", (PyCFunction
)MediaObj_GetMediaLanguage
, 1,
2258 "() -> (short _rv)"},
2259 {"SetMediaLanguage", (PyCFunction
)MediaObj_SetMediaLanguage
, 1,
2260 "(short language) -> None"},
2261 {"GetMediaQuality", (PyCFunction
)MediaObj_GetMediaQuality
, 1,
2262 "() -> (short _rv)"},
2263 {"SetMediaQuality", (PyCFunction
)MediaObj_SetMediaQuality
, 1,
2264 "(short quality) -> None"},
2265 {"GetMediaHandlerDescription", (PyCFunction
)MediaObj_GetMediaHandlerDescription
, 1,
2266 "(Str255 creatorName) -> (OSType mediaType, OSType creatorManufacturer)"},
2267 {"GetMediaUserData", (PyCFunction
)MediaObj_GetMediaUserData
, 1,
2268 "() -> (UserData _rv)"},
2269 {"GetMediaHandler", (PyCFunction
)MediaObj_GetMediaHandler
, 1,
2270 "() -> (MediaHandler _rv)"},
2271 {"SetMediaHandler", (PyCFunction
)MediaObj_SetMediaHandler
, 1,
2272 "(MediaHandlerComponent mH) -> None"},
2273 {"BeginMediaEdits", (PyCFunction
)MediaObj_BeginMediaEdits
, 1,
2275 {"EndMediaEdits", (PyCFunction
)MediaObj_EndMediaEdits
, 1,
2277 {"SetMediaDefaultDataRefIndex", (PyCFunction
)MediaObj_SetMediaDefaultDataRefIndex
, 1,
2278 "(short index) -> None"},
2279 {"GetMediaDataHandlerDescription", (PyCFunction
)MediaObj_GetMediaDataHandlerDescription
, 1,
2280 "(short index, Str255 creatorName) -> (OSType dhType, OSType creatorManufacturer)"},
2281 {"GetMediaDataHandler", (PyCFunction
)MediaObj_GetMediaDataHandler
, 1,
2282 "(short index) -> (DataHandler _rv)"},
2283 {"SetMediaDataHandler", (PyCFunction
)MediaObj_SetMediaDataHandler
, 1,
2284 "(short index, DataHandlerComponent dataHandler) -> None"},
2285 {"GetMediaSampleDescriptionCount", (PyCFunction
)MediaObj_GetMediaSampleDescriptionCount
, 1,
2286 "() -> (long _rv)"},
2287 {"GetMediaSampleDescription", (PyCFunction
)MediaObj_GetMediaSampleDescription
, 1,
2288 "(long index, SampleDescriptionHandle descH) -> None"},
2289 {"SetMediaSampleDescription", (PyCFunction
)MediaObj_SetMediaSampleDescription
, 1,
2290 "(long index, SampleDescriptionHandle descH) -> None"},
2291 {"GetMediaSampleCount", (PyCFunction
)MediaObj_GetMediaSampleCount
, 1,
2292 "() -> (long _rv)"},
2293 {"SampleNumToMediaTime", (PyCFunction
)MediaObj_SampleNumToMediaTime
, 1,
2294 "(long logicalSampleNum) -> (TimeValue sampleTime, TimeValue sampleDuration)"},
2295 {"MediaTimeToSampleNum", (PyCFunction
)MediaObj_MediaTimeToSampleNum
, 1,
2296 "(TimeValue time) -> (long sampleNum, TimeValue sampleTime, TimeValue sampleDuration)"},
2297 {"AddMediaSample", (PyCFunction
)MediaObj_AddMediaSample
, 1,
2298 "(Handle dataIn, long inOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
2299 {"AddMediaSampleReference", (PyCFunction
)MediaObj_AddMediaSampleReference
, 1,
2300 "(long dataOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
2301 {"GetMediaSample", (PyCFunction
)MediaObj_GetMediaSample
, 1,
2302 "(Handle dataOut, long maxSizeToGrow, TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
2303 {"GetMediaSampleReference", (PyCFunction
)MediaObj_GetMediaSampleReference
, 1,
2304 "(TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long dataOffset, long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
2305 {"SetMediaPreferredChunkSize", (PyCFunction
)MediaObj_SetMediaPreferredChunkSize
, 1,
2306 "(long maxChunkSize) -> None"},
2307 {"GetMediaPreferredChunkSize", (PyCFunction
)MediaObj_GetMediaPreferredChunkSize
, 1,
2308 "() -> (long maxChunkSize)"},
2309 {"SetMediaShadowSync", (PyCFunction
)MediaObj_SetMediaShadowSync
, 1,
2310 "(long frameDiffSampleNum, long syncSampleNum) -> None"},
2311 {"GetMediaShadowSync", (PyCFunction
)MediaObj_GetMediaShadowSync
, 1,
2312 "(long frameDiffSampleNum) -> (long syncSampleNum)"},
2313 {"GetMediaDataSize", (PyCFunction
)MediaObj_GetMediaDataSize
, 1,
2314 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
2315 {"GetMediaNextInterestingTime", (PyCFunction
)MediaObj_GetMediaNextInterestingTime
, 1,
2316 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
2317 {"GetMediaDataRef", (PyCFunction
)MediaObj_GetMediaDataRef
, 1,
2318 "(short index) -> (Handle dataRef, OSType dataRefType, long dataRefAttributes)"},
2319 {"SetMediaDataRef", (PyCFunction
)MediaObj_SetMediaDataRef
, 1,
2320 "(short index, Handle dataRef, OSType dataRefType) -> None"},
2321 {"SetMediaDataRefAttributes", (PyCFunction
)MediaObj_SetMediaDataRefAttributes
, 1,
2322 "(short index, long dataRefAttributes) -> None"},
2323 {"AddMediaDataRef", (PyCFunction
)MediaObj_AddMediaDataRef
, 1,
2324 "(Handle dataRef, OSType dataRefType) -> (short index)"},
2325 {"GetMediaDataRefCount", (PyCFunction
)MediaObj_GetMediaDataRefCount
, 1,
2326 "() -> (short count)"},
2327 {"SetMediaPlayHints", (PyCFunction
)MediaObj_SetMediaPlayHints
, 1,
2328 "(long flags, long flagsMask) -> None"},
2332 PyMethodChain MediaObj_chain
= { MediaObj_methods
, NULL
};
2334 static PyObject
*MediaObj_getattr(self
, name
)
2338 return Py_FindMethodInChain(&MediaObj_chain
, (PyObject
*)self
, name
);
2341 #define MediaObj_setattr NULL
2343 PyTypeObject Media_Type
= {
2344 PyObject_HEAD_INIT(&PyType_Type
)
2346 "Media", /*tp_name*/
2347 sizeof(MediaObject
), /*tp_basicsize*/
2350 (destructor
) MediaObj_dealloc
, /*tp_dealloc*/
2352 (getattrfunc
) MediaObj_getattr
, /*tp_getattr*/
2353 (setattrfunc
) MediaObj_setattr
, /*tp_setattr*/
2356 /* --------------------- End object type Media ---------------------- */
2359 /* ----------------------- Object type Track ------------------------ */
2361 PyTypeObject Track_Type
;
2363 #define TrackObj_Check(x) ((x)->ob_type == &Track_Type)
2365 typedef struct TrackObject
{
2370 PyObject
*TrackObj_New(itself
)
2374 if (itself
== NULL
) {
2375 PyErr_SetString(Qt_Error
,"Cannot create null Track");
2378 it
= PyObject_NEW(TrackObject
, &Track_Type
);
2379 if (it
== NULL
) return NULL
;
2380 it
->ob_itself
= itself
;
2381 return (PyObject
*)it
;
2383 TrackObj_Convert(v
, p_itself
)
2387 if (!TrackObj_Check(v
))
2389 PyErr_SetString(PyExc_TypeError
, "Track required");
2392 *p_itself
= ((TrackObject
*)v
)->ob_itself
;
2396 static void TrackObj_dealloc(self
)
2399 DisposeMovieTrack(self
->ob_itself
);
2403 static PyObject
*TrackObj_LoadTrackIntoRam(_self
, _args
)
2407 PyObject
*_res
= NULL
;
2412 if (!PyArg_ParseTuple(_args
, "lll",
2417 _err
= LoadTrackIntoRam(_self
->ob_itself
,
2421 if (_err
!= noErr
) return PyMac_Error(_err
);
2427 static PyObject
*TrackObj_GetTrackPict(_self
, _args
)
2431 PyObject
*_res
= NULL
;
2434 if (!PyArg_ParseTuple(_args
, "l",
2437 _rv
= GetTrackPict(_self
->ob_itself
,
2439 _res
= Py_BuildValue("O&",
2444 static PyObject
*TrackObj_GetTrackClipRgn(_self
, _args
)
2448 PyObject
*_res
= NULL
;
2450 if (!PyArg_ParseTuple(_args
, ""))
2452 _rv
= GetTrackClipRgn(_self
->ob_itself
);
2453 _res
= Py_BuildValue("O&",
2458 static PyObject
*TrackObj_SetTrackClipRgn(_self
, _args
)
2462 PyObject
*_res
= NULL
;
2464 if (!PyArg_ParseTuple(_args
, "O&",
2465 ResObj_Convert
, &theClip
))
2467 SetTrackClipRgn(_self
->ob_itself
,
2474 static PyObject
*TrackObj_GetTrackDisplayBoundsRgn(_self
, _args
)
2478 PyObject
*_res
= NULL
;
2480 if (!PyArg_ParseTuple(_args
, ""))
2482 _rv
= GetTrackDisplayBoundsRgn(_self
->ob_itself
);
2483 _res
= Py_BuildValue("O&",
2488 static PyObject
*TrackObj_GetTrackMovieBoundsRgn(_self
, _args
)
2492 PyObject
*_res
= NULL
;
2494 if (!PyArg_ParseTuple(_args
, ""))
2496 _rv
= GetTrackMovieBoundsRgn(_self
->ob_itself
);
2497 _res
= Py_BuildValue("O&",
2502 static PyObject
*TrackObj_GetTrackBoundsRgn(_self
, _args
)
2506 PyObject
*_res
= NULL
;
2508 if (!PyArg_ParseTuple(_args
, ""))
2510 _rv
= GetTrackBoundsRgn(_self
->ob_itself
);
2511 _res
= Py_BuildValue("O&",
2516 static PyObject
*TrackObj_GetTrackMatte(_self
, _args
)
2520 PyObject
*_res
= NULL
;
2522 if (!PyArg_ParseTuple(_args
, ""))
2524 _rv
= GetTrackMatte(_self
->ob_itself
);
2525 _res
= Py_BuildValue("O&",
2530 static PyObject
*TrackObj_SetTrackMatte(_self
, _args
)
2534 PyObject
*_res
= NULL
;
2535 PixMapHandle theMatte
;
2536 if (!PyArg_ParseTuple(_args
, "O&",
2537 ResObj_Convert
, &theMatte
))
2539 SetTrackMatte(_self
->ob_itself
,
2546 static PyObject
*TrackObj_GetTrackID(_self
, _args
)
2550 PyObject
*_res
= NULL
;
2552 if (!PyArg_ParseTuple(_args
, ""))
2554 _rv
= GetTrackID(_self
->ob_itself
);
2555 _res
= Py_BuildValue("l",
2560 static PyObject
*TrackObj_GetTrackMovie(_self
, _args
)
2564 PyObject
*_res
= NULL
;
2566 if (!PyArg_ParseTuple(_args
, ""))
2568 _rv
= GetTrackMovie(_self
->ob_itself
);
2569 _res
= Py_BuildValue("O&",
2574 static PyObject
*TrackObj_GetTrackEnabled(_self
, _args
)
2578 PyObject
*_res
= NULL
;
2580 if (!PyArg_ParseTuple(_args
, ""))
2582 _rv
= GetTrackEnabled(_self
->ob_itself
);
2583 _res
= Py_BuildValue("b",
2588 static PyObject
*TrackObj_SetTrackEnabled(_self
, _args
)
2592 PyObject
*_res
= NULL
;
2594 if (!PyArg_ParseTuple(_args
, "b",
2597 SetTrackEnabled(_self
->ob_itself
,
2604 static PyObject
*TrackObj_GetTrackUsage(_self
, _args
)
2608 PyObject
*_res
= NULL
;
2610 if (!PyArg_ParseTuple(_args
, ""))
2612 _rv
= GetTrackUsage(_self
->ob_itself
);
2613 _res
= Py_BuildValue("l",
2618 static PyObject
*TrackObj_SetTrackUsage(_self
, _args
)
2622 PyObject
*_res
= NULL
;
2624 if (!PyArg_ParseTuple(_args
, "l",
2627 SetTrackUsage(_self
->ob_itself
,
2634 static PyObject
*TrackObj_GetTrackDuration(_self
, _args
)
2638 PyObject
*_res
= NULL
;
2640 if (!PyArg_ParseTuple(_args
, ""))
2642 _rv
= GetTrackDuration(_self
->ob_itself
);
2643 _res
= Py_BuildValue("l",
2648 static PyObject
*TrackObj_GetTrackOffset(_self
, _args
)
2652 PyObject
*_res
= NULL
;
2654 if (!PyArg_ParseTuple(_args
, ""))
2656 _rv
= GetTrackOffset(_self
->ob_itself
);
2657 _res
= Py_BuildValue("l",
2662 static PyObject
*TrackObj_SetTrackOffset(_self
, _args
)
2666 PyObject
*_res
= NULL
;
2667 TimeValue movieOffsetTime
;
2668 if (!PyArg_ParseTuple(_args
, "l",
2671 SetTrackOffset(_self
->ob_itself
,
2678 static PyObject
*TrackObj_GetTrackLayer(_self
, _args
)
2682 PyObject
*_res
= NULL
;
2684 if (!PyArg_ParseTuple(_args
, ""))
2686 _rv
= GetTrackLayer(_self
->ob_itself
);
2687 _res
= Py_BuildValue("h",
2692 static PyObject
*TrackObj_SetTrackLayer(_self
, _args
)
2696 PyObject
*_res
= NULL
;
2698 if (!PyArg_ParseTuple(_args
, "h",
2701 SetTrackLayer(_self
->ob_itself
,
2708 static PyObject
*TrackObj_GetTrackAlternate(_self
, _args
)
2712 PyObject
*_res
= NULL
;
2714 if (!PyArg_ParseTuple(_args
, ""))
2716 _rv
= GetTrackAlternate(_self
->ob_itself
);
2717 _res
= Py_BuildValue("O&",
2722 static PyObject
*TrackObj_SetTrackAlternate(_self
, _args
)
2726 PyObject
*_res
= NULL
;
2728 if (!PyArg_ParseTuple(_args
, "O&",
2729 TrackObj_Convert
, &alternateT
))
2731 SetTrackAlternate(_self
->ob_itself
,
2738 static PyObject
*TrackObj_GetTrackVolume(_self
, _args
)
2742 PyObject
*_res
= NULL
;
2744 if (!PyArg_ParseTuple(_args
, ""))
2746 _rv
= GetTrackVolume(_self
->ob_itself
);
2747 _res
= Py_BuildValue("h",
2752 static PyObject
*TrackObj_SetTrackVolume(_self
, _args
)
2756 PyObject
*_res
= NULL
;
2758 if (!PyArg_ParseTuple(_args
, "h",
2761 SetTrackVolume(_self
->ob_itself
,
2768 static PyObject
*TrackObj_GetTrackDimensions(_self
, _args
)
2772 PyObject
*_res
= NULL
;
2775 if (!PyArg_ParseTuple(_args
, ""))
2777 GetTrackDimensions(_self
->ob_itself
,
2780 _res
= Py_BuildValue("O&O&",
2781 PyMac_BuildFixed
, width
,
2782 PyMac_BuildFixed
, height
);
2786 static PyObject
*TrackObj_SetTrackDimensions(_self
, _args
)
2790 PyObject
*_res
= NULL
;
2793 if (!PyArg_ParseTuple(_args
, "O&O&",
2794 PyMac_GetFixed
, &width
,
2795 PyMac_GetFixed
, &height
))
2797 SetTrackDimensions(_self
->ob_itself
,
2805 static PyObject
*TrackObj_GetTrackUserData(_self
, _args
)
2809 PyObject
*_res
= NULL
;
2811 if (!PyArg_ParseTuple(_args
, ""))
2813 _rv
= GetTrackUserData(_self
->ob_itself
);
2814 _res
= Py_BuildValue("O&",
2815 UserDataObj_New
, _rv
);
2819 static PyObject
*TrackObj_NewTrackMedia(_self
, _args
)
2823 PyObject
*_res
= NULL
;
2826 TimeScale timeScale
;
2829 if (!PyArg_ParseTuple(_args
, "O&lO&O&",
2830 PyMac_GetOSType
, &mediaType
,
2832 ResObj_Convert
, &dataRef
,
2833 PyMac_GetOSType
, &dataRefType
))
2835 _rv
= NewTrackMedia(_self
->ob_itself
,
2840 _res
= Py_BuildValue("O&",
2845 static PyObject
*TrackObj_GetTrackMedia(_self
, _args
)
2849 PyObject
*_res
= NULL
;
2851 if (!PyArg_ParseTuple(_args
, ""))
2853 _rv
= GetTrackMedia(_self
->ob_itself
);
2854 _res
= Py_BuildValue("O&",
2859 static PyObject
*TrackObj_InsertMediaIntoTrack(_self
, _args
)
2863 PyObject
*_res
= NULL
;
2865 TimeValue trackStart
;
2866 TimeValue mediaTime
;
2867 TimeValue mediaDuration
;
2869 if (!PyArg_ParseTuple(_args
, "lllO&",
2873 PyMac_GetFixed
, &mediaRate
))
2875 _err
= InsertMediaIntoTrack(_self
->ob_itself
,
2880 if (_err
!= noErr
) return PyMac_Error(_err
);
2886 static PyObject
*TrackObj_InsertTrackSegment(_self
, _args
)
2890 PyObject
*_res
= NULL
;
2894 TimeValue srcDuration
;
2896 if (!PyArg_ParseTuple(_args
, "O&lll",
2897 TrackObj_Convert
, &dstTrack
,
2902 _err
= InsertTrackSegment(_self
->ob_itself
,
2907 if (_err
!= noErr
) return PyMac_Error(_err
);
2913 static PyObject
*TrackObj_InsertEmptyTrackSegment(_self
, _args
)
2917 PyObject
*_res
= NULL
;
2920 TimeValue dstDuration
;
2921 if (!PyArg_ParseTuple(_args
, "ll",
2925 _err
= InsertEmptyTrackSegment(_self
->ob_itself
,
2928 if (_err
!= noErr
) return PyMac_Error(_err
);
2934 static PyObject
*TrackObj_DeleteTrackSegment(_self
, _args
)
2938 PyObject
*_res
= NULL
;
2940 TimeValue startTime
;
2942 if (!PyArg_ParseTuple(_args
, "ll",
2946 _err
= DeleteTrackSegment(_self
->ob_itself
,
2949 if (_err
!= noErr
) return PyMac_Error(_err
);
2955 static PyObject
*TrackObj_ScaleTrackSegment(_self
, _args
)
2959 PyObject
*_res
= NULL
;
2961 TimeValue startTime
;
2962 TimeValue oldDuration
;
2963 TimeValue newDuration
;
2964 if (!PyArg_ParseTuple(_args
, "lll",
2969 _err
= ScaleTrackSegment(_self
->ob_itself
,
2973 if (_err
!= noErr
) return PyMac_Error(_err
);
2979 static PyObject
*TrackObj_IsScrapMovie(_self
, _args
)
2983 PyObject
*_res
= NULL
;
2985 if (!PyArg_ParseTuple(_args
, ""))
2987 _rv
= IsScrapMovie(_self
->ob_itself
);
2988 _res
= Py_BuildValue("O&",
2993 static PyObject
*TrackObj_CopyTrackSettings(_self
, _args
)
2997 PyObject
*_res
= NULL
;
3000 if (!PyArg_ParseTuple(_args
, "O&",
3001 TrackObj_Convert
, &dstTrack
))
3003 _err
= CopyTrackSettings(_self
->ob_itself
,
3005 if (_err
!= noErr
) return PyMac_Error(_err
);
3011 static PyObject
*TrackObj_AddEmptyTrackToMovie(_self
, _args
)
3015 PyObject
*_res
= NULL
;
3021 if (!PyArg_ParseTuple(_args
, "O&O&O&",
3022 MovieObj_Convert
, &dstMovie
,
3023 ResObj_Convert
, &dataRef
,
3024 PyMac_GetOSType
, &dataRefType
))
3026 _err
= AddEmptyTrackToMovie(_self
->ob_itself
,
3031 if (_err
!= noErr
) return PyMac_Error(_err
);
3032 _res
= Py_BuildValue("O&",
3033 TrackObj_New
, dstTrack
);
3037 static PyObject
*TrackObj_AddTrackReference(_self
, _args
)
3041 PyObject
*_res
= NULL
;
3046 if (!PyArg_ParseTuple(_args
, "O&O&",
3047 TrackObj_Convert
, &refTrack
,
3048 PyMac_GetOSType
, &refType
))
3050 _err
= AddTrackReference(_self
->ob_itself
,
3054 if (_err
!= noErr
) return PyMac_Error(_err
);
3055 _res
= Py_BuildValue("l",
3060 static PyObject
*TrackObj_DeleteTrackReference(_self
, _args
)
3064 PyObject
*_res
= NULL
;
3068 if (!PyArg_ParseTuple(_args
, "O&l",
3069 PyMac_GetOSType
, &refType
,
3072 _err
= DeleteTrackReference(_self
->ob_itself
,
3075 if (_err
!= noErr
) return PyMac_Error(_err
);
3081 static PyObject
*TrackObj_SetTrackReference(_self
, _args
)
3085 PyObject
*_res
= NULL
;
3090 if (!PyArg_ParseTuple(_args
, "O&O&l",
3091 TrackObj_Convert
, &refTrack
,
3092 PyMac_GetOSType
, &refType
,
3095 _err
= SetTrackReference(_self
->ob_itself
,
3099 if (_err
!= noErr
) return PyMac_Error(_err
);
3105 static PyObject
*TrackObj_GetTrackReference(_self
, _args
)
3109 PyObject
*_res
= NULL
;
3113 if (!PyArg_ParseTuple(_args
, "O&l",
3114 PyMac_GetOSType
, &refType
,
3117 _rv
= GetTrackReference(_self
->ob_itself
,
3120 _res
= Py_BuildValue("O&",
3125 static PyObject
*TrackObj_GetNextTrackReferenceType(_self
, _args
)
3129 PyObject
*_res
= NULL
;
3132 if (!PyArg_ParseTuple(_args
, "O&",
3133 PyMac_GetOSType
, &refType
))
3135 _rv
= GetNextTrackReferenceType(_self
->ob_itself
,
3137 _res
= Py_BuildValue("O&",
3138 PyMac_BuildOSType
, _rv
);
3142 static PyObject
*TrackObj_GetTrackReferenceCount(_self
, _args
)
3146 PyObject
*_res
= NULL
;
3149 if (!PyArg_ParseTuple(_args
, "O&",
3150 PyMac_GetOSType
, &refType
))
3152 _rv
= GetTrackReferenceCount(_self
->ob_itself
,
3154 _res
= Py_BuildValue("l",
3159 static PyObject
*TrackObj_GetTrackEditRate(_self
, _args
)
3163 PyObject
*_res
= NULL
;
3166 if (!PyArg_ParseTuple(_args
, "l",
3169 _rv
= GetTrackEditRate(_self
->ob_itself
,
3171 _res
= Py_BuildValue("O&",
3172 PyMac_BuildFixed
, _rv
);
3176 static PyObject
*TrackObj_GetTrackDataSize(_self
, _args
)
3180 PyObject
*_res
= NULL
;
3182 TimeValue startTime
;
3184 if (!PyArg_ParseTuple(_args
, "ll",
3188 _rv
= GetTrackDataSize(_self
->ob_itself
,
3191 _res
= Py_BuildValue("l",
3196 static PyObject
*TrackObj_PtInTrack(_self
, _args
)
3200 PyObject
*_res
= NULL
;
3203 if (!PyArg_ParseTuple(_args
, "O&",
3204 PyMac_GetPoint
, &pt
))
3206 _rv
= PtInTrack(_self
->ob_itself
,
3208 _res
= Py_BuildValue("b",
3213 static PyObject
*TrackObj_GetTrackNextInterestingTime(_self
, _args
)
3217 PyObject
*_res
= NULL
;
3218 short interestingTimeFlags
;
3221 TimeValue interestingTime
;
3222 TimeValue interestingDuration
;
3223 if (!PyArg_ParseTuple(_args
, "hlO&",
3224 &interestingTimeFlags
,
3226 PyMac_GetFixed
, &rate
))
3228 GetTrackNextInterestingTime(_self
->ob_itself
,
3229 interestingTimeFlags
,
3233 &interestingDuration
);
3234 _res
= Py_BuildValue("ll",
3236 interestingDuration
);
3240 static PyObject
*TrackObj_GetTrackSegmentDisplayBoundsRgn(_self
, _args
)
3244 PyObject
*_res
= NULL
;
3248 if (!PyArg_ParseTuple(_args
, "ll",
3252 _rv
= GetTrackSegmentDisplayBoundsRgn(_self
->ob_itself
,
3255 _res
= Py_BuildValue("O&",
3260 static PyObject
*TrackObj_GetTrackStatus(_self
, _args
)
3264 PyObject
*_res
= NULL
;
3265 ComponentResult _rv
;
3266 if (!PyArg_ParseTuple(_args
, ""))
3268 _rv
= GetTrackStatus(_self
->ob_itself
);
3269 _res
= Py_BuildValue("l",
3274 static PyObject
*TrackObj_SetTrackLoadSettings(_self
, _args
)
3278 PyObject
*_res
= NULL
;
3279 TimeValue preloadTime
;
3280 TimeValue preloadDuration
;
3283 if (!PyArg_ParseTuple(_args
, "llll",
3289 SetTrackLoadSettings(_self
->ob_itself
,
3299 static PyObject
*TrackObj_GetTrackLoadSettings(_self
, _args
)
3303 PyObject
*_res
= NULL
;
3304 TimeValue preloadTime
;
3305 TimeValue preloadDuration
;
3308 if (!PyArg_ParseTuple(_args
, ""))
3310 GetTrackLoadSettings(_self
->ob_itself
,
3315 _res
= Py_BuildValue("llll",
3323 static PyMethodDef TrackObj_methods
[] = {
3324 {"LoadTrackIntoRam", (PyCFunction
)TrackObj_LoadTrackIntoRam
, 1,
3325 "(TimeValue time, TimeValue duration, long flags) -> None"},
3326 {"GetTrackPict", (PyCFunction
)TrackObj_GetTrackPict
, 1,
3327 "(TimeValue time) -> (PicHandle _rv)"},
3328 {"GetTrackClipRgn", (PyCFunction
)TrackObj_GetTrackClipRgn
, 1,
3329 "() -> (RgnHandle _rv)"},
3330 {"SetTrackClipRgn", (PyCFunction
)TrackObj_SetTrackClipRgn
, 1,
3331 "(RgnHandle theClip) -> None"},
3332 {"GetTrackDisplayBoundsRgn", (PyCFunction
)TrackObj_GetTrackDisplayBoundsRgn
, 1,
3333 "() -> (RgnHandle _rv)"},
3334 {"GetTrackMovieBoundsRgn", (PyCFunction
)TrackObj_GetTrackMovieBoundsRgn
, 1,
3335 "() -> (RgnHandle _rv)"},
3336 {"GetTrackBoundsRgn", (PyCFunction
)TrackObj_GetTrackBoundsRgn
, 1,
3337 "() -> (RgnHandle _rv)"},
3338 {"GetTrackMatte", (PyCFunction
)TrackObj_GetTrackMatte
, 1,
3339 "() -> (PixMapHandle _rv)"},
3340 {"SetTrackMatte", (PyCFunction
)TrackObj_SetTrackMatte
, 1,
3341 "(PixMapHandle theMatte) -> None"},
3342 {"GetTrackID", (PyCFunction
)TrackObj_GetTrackID
, 1,
3343 "() -> (long _rv)"},
3344 {"GetTrackMovie", (PyCFunction
)TrackObj_GetTrackMovie
, 1,
3345 "() -> (Movie _rv)"},
3346 {"GetTrackEnabled", (PyCFunction
)TrackObj_GetTrackEnabled
, 1,
3347 "() -> (Boolean _rv)"},
3348 {"SetTrackEnabled", (PyCFunction
)TrackObj_SetTrackEnabled
, 1,
3349 "(Boolean isEnabled) -> None"},
3350 {"GetTrackUsage", (PyCFunction
)TrackObj_GetTrackUsage
, 1,
3351 "() -> (long _rv)"},
3352 {"SetTrackUsage", (PyCFunction
)TrackObj_SetTrackUsage
, 1,
3353 "(long usage) -> None"},
3354 {"GetTrackDuration", (PyCFunction
)TrackObj_GetTrackDuration
, 1,
3355 "() -> (TimeValue _rv)"},
3356 {"GetTrackOffset", (PyCFunction
)TrackObj_GetTrackOffset
, 1,
3357 "() -> (TimeValue _rv)"},
3358 {"SetTrackOffset", (PyCFunction
)TrackObj_SetTrackOffset
, 1,
3359 "(TimeValue movieOffsetTime) -> None"},
3360 {"GetTrackLayer", (PyCFunction
)TrackObj_GetTrackLayer
, 1,
3361 "() -> (short _rv)"},
3362 {"SetTrackLayer", (PyCFunction
)TrackObj_SetTrackLayer
, 1,
3363 "(short layer) -> None"},
3364 {"GetTrackAlternate", (PyCFunction
)TrackObj_GetTrackAlternate
, 1,
3365 "() -> (Track _rv)"},
3366 {"SetTrackAlternate", (PyCFunction
)TrackObj_SetTrackAlternate
, 1,
3367 "(Track alternateT) -> None"},
3368 {"GetTrackVolume", (PyCFunction
)TrackObj_GetTrackVolume
, 1,
3369 "() -> (short _rv)"},
3370 {"SetTrackVolume", (PyCFunction
)TrackObj_SetTrackVolume
, 1,
3371 "(short volume) -> None"},
3372 {"GetTrackDimensions", (PyCFunction
)TrackObj_GetTrackDimensions
, 1,
3373 "() -> (Fixed width, Fixed height)"},
3374 {"SetTrackDimensions", (PyCFunction
)TrackObj_SetTrackDimensions
, 1,
3375 "(Fixed width, Fixed height) -> None"},
3376 {"GetTrackUserData", (PyCFunction
)TrackObj_GetTrackUserData
, 1,
3377 "() -> (UserData _rv)"},
3378 {"NewTrackMedia", (PyCFunction
)TrackObj_NewTrackMedia
, 1,
3379 "(OSType mediaType, TimeScale timeScale, Handle dataRef, OSType dataRefType) -> (Media _rv)"},
3380 {"GetTrackMedia", (PyCFunction
)TrackObj_GetTrackMedia
, 1,
3381 "() -> (Media _rv)"},
3382 {"InsertMediaIntoTrack", (PyCFunction
)TrackObj_InsertMediaIntoTrack
, 1,
3383 "(TimeValue trackStart, TimeValue mediaTime, TimeValue mediaDuration, Fixed mediaRate) -> None"},
3384 {"InsertTrackSegment", (PyCFunction
)TrackObj_InsertTrackSegment
, 1,
3385 "(Track dstTrack, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
3386 {"InsertEmptyTrackSegment", (PyCFunction
)TrackObj_InsertEmptyTrackSegment
, 1,
3387 "(TimeValue dstIn, TimeValue dstDuration) -> None"},
3388 {"DeleteTrackSegment", (PyCFunction
)TrackObj_DeleteTrackSegment
, 1,
3389 "(TimeValue startTime, TimeValue duration) -> None"},
3390 {"ScaleTrackSegment", (PyCFunction
)TrackObj_ScaleTrackSegment
, 1,
3391 "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
3392 {"IsScrapMovie", (PyCFunction
)TrackObj_IsScrapMovie
, 1,
3393 "() -> (Component _rv)"},
3394 {"CopyTrackSettings", (PyCFunction
)TrackObj_CopyTrackSettings
, 1,
3395 "(Track dstTrack) -> None"},
3396 {"AddEmptyTrackToMovie", (PyCFunction
)TrackObj_AddEmptyTrackToMovie
, 1,
3397 "(Movie dstMovie, Handle dataRef, OSType dataRefType) -> (Track dstTrack)"},
3398 {"AddTrackReference", (PyCFunction
)TrackObj_AddTrackReference
, 1,
3399 "(Track refTrack, OSType refType) -> (long addedIndex)"},
3400 {"DeleteTrackReference", (PyCFunction
)TrackObj_DeleteTrackReference
, 1,
3401 "(OSType refType, long index) -> None"},
3402 {"SetTrackReference", (PyCFunction
)TrackObj_SetTrackReference
, 1,
3403 "(Track refTrack, OSType refType, long index) -> None"},
3404 {"GetTrackReference", (PyCFunction
)TrackObj_GetTrackReference
, 1,
3405 "(OSType refType, long index) -> (Track _rv)"},
3406 {"GetNextTrackReferenceType", (PyCFunction
)TrackObj_GetNextTrackReferenceType
, 1,
3407 "(OSType refType) -> (OSType _rv)"},
3408 {"GetTrackReferenceCount", (PyCFunction
)TrackObj_GetTrackReferenceCount
, 1,
3409 "(OSType refType) -> (long _rv)"},
3410 {"GetTrackEditRate", (PyCFunction
)TrackObj_GetTrackEditRate
, 1,
3411 "(TimeValue atTime) -> (Fixed _rv)"},
3412 {"GetTrackDataSize", (PyCFunction
)TrackObj_GetTrackDataSize
, 1,
3413 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
3414 {"PtInTrack", (PyCFunction
)TrackObj_PtInTrack
, 1,
3415 "(Point pt) -> (Boolean _rv)"},
3416 {"GetTrackNextInterestingTime", (PyCFunction
)TrackObj_GetTrackNextInterestingTime
, 1,
3417 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
3418 {"GetTrackSegmentDisplayBoundsRgn", (PyCFunction
)TrackObj_GetTrackSegmentDisplayBoundsRgn
, 1,
3419 "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
3420 {"GetTrackStatus", (PyCFunction
)TrackObj_GetTrackStatus
, 1,
3421 "() -> (ComponentResult _rv)"},
3422 {"SetTrackLoadSettings", (PyCFunction
)TrackObj_SetTrackLoadSettings
, 1,
3423 "(TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints) -> None"},
3424 {"GetTrackLoadSettings", (PyCFunction
)TrackObj_GetTrackLoadSettings
, 1,
3425 "() -> (TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints)"},
3429 PyMethodChain TrackObj_chain
= { TrackObj_methods
, NULL
};
3431 static PyObject
*TrackObj_getattr(self
, name
)
3435 return Py_FindMethodInChain(&TrackObj_chain
, (PyObject
*)self
, name
);
3438 #define TrackObj_setattr NULL
3440 PyTypeObject Track_Type
= {
3441 PyObject_HEAD_INIT(&PyType_Type
)
3443 "Track", /*tp_name*/
3444 sizeof(TrackObject
), /*tp_basicsize*/
3447 (destructor
) TrackObj_dealloc
, /*tp_dealloc*/
3449 (getattrfunc
) TrackObj_getattr
, /*tp_getattr*/
3450 (setattrfunc
) TrackObj_setattr
, /*tp_setattr*/
3453 /* --------------------- End object type Track ---------------------- */
3456 /* ----------------------- Object type Movie ------------------------ */
3458 PyTypeObject Movie_Type
;
3460 #define MovieObj_Check(x) ((x)->ob_type == &Movie_Type)
3462 typedef struct MovieObject
{
3467 PyObject
*MovieObj_New(itself
)
3471 if (itself
== NULL
) {
3472 PyErr_SetString(Qt_Error
,"Cannot create null Movie");
3475 it
= PyObject_NEW(MovieObject
, &Movie_Type
);
3476 if (it
== NULL
) return NULL
;
3477 it
->ob_itself
= itself
;
3478 return (PyObject
*)it
;
3480 MovieObj_Convert(v
, p_itself
)
3484 if (!MovieObj_Check(v
))
3486 PyErr_SetString(PyExc_TypeError
, "Movie required");
3489 *p_itself
= ((MovieObject
*)v
)->ob_itself
;
3493 static void MovieObj_dealloc(self
)
3496 DisposeMovie(self
->ob_itself
);
3500 static PyObject
*MovieObj_MoviesTask(_self
, _args
)
3504 PyObject
*_res
= NULL
;
3505 long maxMilliSecToUse
;
3506 if (!PyArg_ParseTuple(_args
, "l",
3509 MoviesTask(_self
->ob_itself
,
3516 static PyObject
*MovieObj_PrerollMovie(_self
, _args
)
3520 PyObject
*_res
= NULL
;
3524 if (!PyArg_ParseTuple(_args
, "lO&",
3526 PyMac_GetFixed
, &Rate
))
3528 _err
= PrerollMovie(_self
->ob_itself
,
3531 if (_err
!= noErr
) return PyMac_Error(_err
);
3537 static PyObject
*MovieObj_LoadMovieIntoRam(_self
, _args
)
3541 PyObject
*_res
= NULL
;
3546 if (!PyArg_ParseTuple(_args
, "lll",
3551 _err
= LoadMovieIntoRam(_self
->ob_itself
,
3555 if (_err
!= noErr
) return PyMac_Error(_err
);
3561 static PyObject
*MovieObj_SetMovieActive(_self
, _args
)
3565 PyObject
*_res
= NULL
;
3567 if (!PyArg_ParseTuple(_args
, "b",
3570 SetMovieActive(_self
->ob_itself
,
3577 static PyObject
*MovieObj_GetMovieActive(_self
, _args
)
3581 PyObject
*_res
= NULL
;
3583 if (!PyArg_ParseTuple(_args
, ""))
3585 _rv
= GetMovieActive(_self
->ob_itself
);
3586 _res
= Py_BuildValue("b",
3591 static PyObject
*MovieObj_StartMovie(_self
, _args
)
3595 PyObject
*_res
= NULL
;
3596 if (!PyArg_ParseTuple(_args
, ""))
3598 StartMovie(_self
->ob_itself
);
3604 static PyObject
*MovieObj_StopMovie(_self
, _args
)
3608 PyObject
*_res
= NULL
;
3609 if (!PyArg_ParseTuple(_args
, ""))
3611 StopMovie(_self
->ob_itself
);
3617 static PyObject
*MovieObj_GoToBeginningOfMovie(_self
, _args
)
3621 PyObject
*_res
= NULL
;
3622 if (!PyArg_ParseTuple(_args
, ""))
3624 GoToBeginningOfMovie(_self
->ob_itself
);
3630 static PyObject
*MovieObj_GoToEndOfMovie(_self
, _args
)
3634 PyObject
*_res
= NULL
;
3635 if (!PyArg_ParseTuple(_args
, ""))
3637 GoToEndOfMovie(_self
->ob_itself
);
3643 static PyObject
*MovieObj_IsMovieDone(_self
, _args
)
3647 PyObject
*_res
= NULL
;
3649 if (!PyArg_ParseTuple(_args
, ""))
3651 _rv
= IsMovieDone(_self
->ob_itself
);
3652 _res
= Py_BuildValue("b",
3657 static PyObject
*MovieObj_GetMoviePreviewMode(_self
, _args
)
3661 PyObject
*_res
= NULL
;
3663 if (!PyArg_ParseTuple(_args
, ""))
3665 _rv
= GetMoviePreviewMode(_self
->ob_itself
);
3666 _res
= Py_BuildValue("b",
3671 static PyObject
*MovieObj_SetMoviePreviewMode(_self
, _args
)
3675 PyObject
*_res
= NULL
;
3677 if (!PyArg_ParseTuple(_args
, "b",
3680 SetMoviePreviewMode(_self
->ob_itself
,
3687 static PyObject
*MovieObj_ShowMoviePoster(_self
, _args
)
3691 PyObject
*_res
= NULL
;
3692 if (!PyArg_ParseTuple(_args
, ""))
3694 ShowMoviePoster(_self
->ob_itself
);
3700 static PyObject
*MovieObj_GetMovieTimeBase(_self
, _args
)
3704 PyObject
*_res
= NULL
;
3706 if (!PyArg_ParseTuple(_args
, ""))
3708 _rv
= GetMovieTimeBase(_self
->ob_itself
);
3709 _res
= Py_BuildValue("O&",
3710 TimeBaseObj_New
, _rv
);
3714 static PyObject
*MovieObj_GetNextTrackForCompositing(_self
, _args
)
3718 PyObject
*_res
= NULL
;
3721 if (!PyArg_ParseTuple(_args
, "O&",
3722 TrackObj_Convert
, &theTrack
))
3724 _rv
= GetNextTrackForCompositing(_self
->ob_itself
,
3726 _res
= Py_BuildValue("O&",
3731 static PyObject
*MovieObj_GetPrevTrackForCompositing(_self
, _args
)
3735 PyObject
*_res
= NULL
;
3738 if (!PyArg_ParseTuple(_args
, "O&",
3739 TrackObj_Convert
, &theTrack
))
3741 _rv
= GetPrevTrackForCompositing(_self
->ob_itself
,
3743 _res
= Py_BuildValue("O&",
3748 static PyObject
*MovieObj_GetMoviePict(_self
, _args
)
3752 PyObject
*_res
= NULL
;
3755 if (!PyArg_ParseTuple(_args
, "l",
3758 _rv
= GetMoviePict(_self
->ob_itself
,
3760 _res
= Py_BuildValue("O&",
3765 static PyObject
*MovieObj_GetMoviePosterPict(_self
, _args
)
3769 PyObject
*_res
= NULL
;
3771 if (!PyArg_ParseTuple(_args
, ""))
3773 _rv
= GetMoviePosterPict(_self
->ob_itself
);
3774 _res
= Py_BuildValue("O&",
3779 static PyObject
*MovieObj_UpdateMovie(_self
, _args
)
3783 PyObject
*_res
= NULL
;
3785 if (!PyArg_ParseTuple(_args
, ""))
3787 _err
= UpdateMovie(_self
->ob_itself
);
3788 if (_err
!= noErr
) return PyMac_Error(_err
);
3794 static PyObject
*MovieObj_GetMovieBox(_self
, _args
)
3798 PyObject
*_res
= NULL
;
3800 if (!PyArg_ParseTuple(_args
, ""))
3802 GetMovieBox(_self
->ob_itself
,
3804 _res
= Py_BuildValue("O&",
3805 PyMac_BuildRect
, &boxRect
);
3809 static PyObject
*MovieObj_SetMovieBox(_self
, _args
)
3813 PyObject
*_res
= NULL
;
3815 if (!PyArg_ParseTuple(_args
, "O&",
3816 PyMac_GetRect
, &boxRect
))
3818 SetMovieBox(_self
->ob_itself
,
3825 static PyObject
*MovieObj_GetMovieDisplayClipRgn(_self
, _args
)
3829 PyObject
*_res
= NULL
;
3831 if (!PyArg_ParseTuple(_args
, ""))
3833 _rv
= GetMovieDisplayClipRgn(_self
->ob_itself
);
3834 _res
= Py_BuildValue("O&",
3839 static PyObject
*MovieObj_SetMovieDisplayClipRgn(_self
, _args
)
3843 PyObject
*_res
= NULL
;
3845 if (!PyArg_ParseTuple(_args
, "O&",
3846 ResObj_Convert
, &theClip
))
3848 SetMovieDisplayClipRgn(_self
->ob_itself
,
3855 static PyObject
*MovieObj_GetMovieClipRgn(_self
, _args
)
3859 PyObject
*_res
= NULL
;
3861 if (!PyArg_ParseTuple(_args
, ""))
3863 _rv
= GetMovieClipRgn(_self
->ob_itself
);
3864 _res
= Py_BuildValue("O&",
3869 static PyObject
*MovieObj_SetMovieClipRgn(_self
, _args
)
3873 PyObject
*_res
= NULL
;
3875 if (!PyArg_ParseTuple(_args
, "O&",
3876 ResObj_Convert
, &theClip
))
3878 SetMovieClipRgn(_self
->ob_itself
,
3885 static PyObject
*MovieObj_GetMovieDisplayBoundsRgn(_self
, _args
)
3889 PyObject
*_res
= NULL
;
3891 if (!PyArg_ParseTuple(_args
, ""))
3893 _rv
= GetMovieDisplayBoundsRgn(_self
->ob_itself
);
3894 _res
= Py_BuildValue("O&",
3899 static PyObject
*MovieObj_GetMovieBoundsRgn(_self
, _args
)
3903 PyObject
*_res
= NULL
;
3905 if (!PyArg_ParseTuple(_args
, ""))
3907 _rv
= GetMovieBoundsRgn(_self
->ob_itself
);
3908 _res
= Py_BuildValue("O&",
3913 static PyObject
*MovieObj_PutMovieIntoHandle(_self
, _args
)
3917 PyObject
*_res
= NULL
;
3920 if (!PyArg_ParseTuple(_args
, "O&",
3921 ResObj_Convert
, &publicMovie
))
3923 _err
= PutMovieIntoHandle(_self
->ob_itself
,
3925 if (_err
!= noErr
) return PyMac_Error(_err
);
3931 static PyObject
*MovieObj_PutMovieIntoDataFork(_self
, _args
)
3935 PyObject
*_res
= NULL
;
3940 if (!PyArg_ParseTuple(_args
, "hll",
3945 _err
= PutMovieIntoDataFork(_self
->ob_itself
,
3949 if (_err
!= noErr
) return PyMac_Error(_err
);
3955 static PyObject
*MovieObj_GetMovieTimeScale(_self
, _args
)
3959 PyObject
*_res
= NULL
;
3961 if (!PyArg_ParseTuple(_args
, ""))
3963 _rv
= GetMovieTimeScale(_self
->ob_itself
);
3964 _res
= Py_BuildValue("l",
3969 static PyObject
*MovieObj_SetMovieTimeScale(_self
, _args
)
3973 PyObject
*_res
= NULL
;
3974 TimeScale timeScale
;
3975 if (!PyArg_ParseTuple(_args
, "l",
3978 SetMovieTimeScale(_self
->ob_itself
,
3985 static PyObject
*MovieObj_GetMovieDuration(_self
, _args
)
3989 PyObject
*_res
= NULL
;
3991 if (!PyArg_ParseTuple(_args
, ""))
3993 _rv
= GetMovieDuration(_self
->ob_itself
);
3994 _res
= Py_BuildValue("l",
3999 static PyObject
*MovieObj_GetMovieRate(_self
, _args
)
4003 PyObject
*_res
= NULL
;
4005 if (!PyArg_ParseTuple(_args
, ""))
4007 _rv
= GetMovieRate(_self
->ob_itself
);
4008 _res
= Py_BuildValue("O&",
4009 PyMac_BuildFixed
, _rv
);
4013 static PyObject
*MovieObj_SetMovieRate(_self
, _args
)
4017 PyObject
*_res
= NULL
;
4019 if (!PyArg_ParseTuple(_args
, "O&",
4020 PyMac_GetFixed
, &rate
))
4022 SetMovieRate(_self
->ob_itself
,
4029 static PyObject
*MovieObj_GetMoviePreferredRate(_self
, _args
)
4033 PyObject
*_res
= NULL
;
4035 if (!PyArg_ParseTuple(_args
, ""))
4037 _rv
= GetMoviePreferredRate(_self
->ob_itself
);
4038 _res
= Py_BuildValue("O&",
4039 PyMac_BuildFixed
, _rv
);
4043 static PyObject
*MovieObj_SetMoviePreferredRate(_self
, _args
)
4047 PyObject
*_res
= NULL
;
4049 if (!PyArg_ParseTuple(_args
, "O&",
4050 PyMac_GetFixed
, &rate
))
4052 SetMoviePreferredRate(_self
->ob_itself
,
4059 static PyObject
*MovieObj_GetMoviePreferredVolume(_self
, _args
)
4063 PyObject
*_res
= NULL
;
4065 if (!PyArg_ParseTuple(_args
, ""))
4067 _rv
= GetMoviePreferredVolume(_self
->ob_itself
);
4068 _res
= Py_BuildValue("h",
4073 static PyObject
*MovieObj_SetMoviePreferredVolume(_self
, _args
)
4077 PyObject
*_res
= NULL
;
4079 if (!PyArg_ParseTuple(_args
, "h",
4082 SetMoviePreferredVolume(_self
->ob_itself
,
4089 static PyObject
*MovieObj_GetMovieVolume(_self
, _args
)
4093 PyObject
*_res
= NULL
;
4095 if (!PyArg_ParseTuple(_args
, ""))
4097 _rv
= GetMovieVolume(_self
->ob_itself
);
4098 _res
= Py_BuildValue("h",
4103 static PyObject
*MovieObj_SetMovieVolume(_self
, _args
)
4107 PyObject
*_res
= NULL
;
4109 if (!PyArg_ParseTuple(_args
, "h",
4112 SetMovieVolume(_self
->ob_itself
,
4119 static PyObject
*MovieObj_GetMoviePreviewTime(_self
, _args
)
4123 PyObject
*_res
= NULL
;
4124 TimeValue previewTime
;
4125 TimeValue previewDuration
;
4126 if (!PyArg_ParseTuple(_args
, ""))
4128 GetMoviePreviewTime(_self
->ob_itself
,
4131 _res
= Py_BuildValue("ll",
4137 static PyObject
*MovieObj_SetMoviePreviewTime(_self
, _args
)
4141 PyObject
*_res
= NULL
;
4142 TimeValue previewTime
;
4143 TimeValue previewDuration
;
4144 if (!PyArg_ParseTuple(_args
, "ll",
4148 SetMoviePreviewTime(_self
->ob_itself
,
4156 static PyObject
*MovieObj_GetMoviePosterTime(_self
, _args
)
4160 PyObject
*_res
= NULL
;
4162 if (!PyArg_ParseTuple(_args
, ""))
4164 _rv
= GetMoviePosterTime(_self
->ob_itself
);
4165 _res
= Py_BuildValue("l",
4170 static PyObject
*MovieObj_SetMoviePosterTime(_self
, _args
)
4174 PyObject
*_res
= NULL
;
4175 TimeValue posterTime
;
4176 if (!PyArg_ParseTuple(_args
, "l",
4179 SetMoviePosterTime(_self
->ob_itself
,
4186 static PyObject
*MovieObj_GetMovieSelection(_self
, _args
)
4190 PyObject
*_res
= NULL
;
4191 TimeValue selectionTime
;
4192 TimeValue selectionDuration
;
4193 if (!PyArg_ParseTuple(_args
, ""))
4195 GetMovieSelection(_self
->ob_itself
,
4197 &selectionDuration
);
4198 _res
= Py_BuildValue("ll",
4204 static PyObject
*MovieObj_SetMovieSelection(_self
, _args
)
4208 PyObject
*_res
= NULL
;
4209 TimeValue selectionTime
;
4210 TimeValue selectionDuration
;
4211 if (!PyArg_ParseTuple(_args
, "ll",
4213 &selectionDuration
))
4215 SetMovieSelection(_self
->ob_itself
,
4223 static PyObject
*MovieObj_SetMovieActiveSegment(_self
, _args
)
4227 PyObject
*_res
= NULL
;
4228 TimeValue startTime
;
4230 if (!PyArg_ParseTuple(_args
, "ll",
4234 SetMovieActiveSegment(_self
->ob_itself
,
4242 static PyObject
*MovieObj_GetMovieActiveSegment(_self
, _args
)
4246 PyObject
*_res
= NULL
;
4247 TimeValue startTime
;
4249 if (!PyArg_ParseTuple(_args
, ""))
4251 GetMovieActiveSegment(_self
->ob_itself
,
4254 _res
= Py_BuildValue("ll",
4260 static PyObject
*MovieObj_SetMovieTimeValue(_self
, _args
)
4264 PyObject
*_res
= NULL
;
4266 if (!PyArg_ParseTuple(_args
, "l",
4269 SetMovieTimeValue(_self
->ob_itself
,
4276 static PyObject
*MovieObj_GetMovieUserData(_self
, _args
)
4280 PyObject
*_res
= NULL
;
4282 if (!PyArg_ParseTuple(_args
, ""))
4284 _rv
= GetMovieUserData(_self
->ob_itself
);
4285 _res
= Py_BuildValue("O&",
4286 UserDataObj_New
, _rv
);
4290 static PyObject
*MovieObj_GetMovieTrackCount(_self
, _args
)
4294 PyObject
*_res
= NULL
;
4296 if (!PyArg_ParseTuple(_args
, ""))
4298 _rv
= GetMovieTrackCount(_self
->ob_itself
);
4299 _res
= Py_BuildValue("l",
4304 static PyObject
*MovieObj_GetMovieTrack(_self
, _args
)
4308 PyObject
*_res
= NULL
;
4311 if (!PyArg_ParseTuple(_args
, "l",
4314 _rv
= GetMovieTrack(_self
->ob_itself
,
4316 _res
= Py_BuildValue("O&",
4321 static PyObject
*MovieObj_GetMovieIndTrack(_self
, _args
)
4325 PyObject
*_res
= NULL
;
4328 if (!PyArg_ParseTuple(_args
, "l",
4331 _rv
= GetMovieIndTrack(_self
->ob_itself
,
4333 _res
= Py_BuildValue("O&",
4338 static PyObject
*MovieObj_GetMovieIndTrackType(_self
, _args
)
4342 PyObject
*_res
= NULL
;
4347 if (!PyArg_ParseTuple(_args
, "lO&l",
4349 PyMac_GetOSType
, &trackType
,
4352 _rv
= GetMovieIndTrackType(_self
->ob_itself
,
4356 _res
= Py_BuildValue("O&",
4361 static PyObject
*MovieObj_NewMovieTrack(_self
, _args
)
4365 PyObject
*_res
= NULL
;
4370 if (!PyArg_ParseTuple(_args
, "O&O&h",
4371 PyMac_GetFixed
, &width
,
4372 PyMac_GetFixed
, &height
,
4375 _rv
= NewMovieTrack(_self
->ob_itself
,
4379 _res
= Py_BuildValue("O&",
4384 static PyObject
*MovieObj_SetAutoTrackAlternatesEnabled(_self
, _args
)
4388 PyObject
*_res
= NULL
;
4390 if (!PyArg_ParseTuple(_args
, "b",
4393 SetAutoTrackAlternatesEnabled(_self
->ob_itself
,
4400 static PyObject
*MovieObj_SelectMovieAlternates(_self
, _args
)
4404 PyObject
*_res
= NULL
;
4405 if (!PyArg_ParseTuple(_args
, ""))
4407 SelectMovieAlternates(_self
->ob_itself
);
4413 static PyObject
*MovieObj_InsertMovieSegment(_self
, _args
)
4417 PyObject
*_res
= NULL
;
4421 TimeValue srcDuration
;
4423 if (!PyArg_ParseTuple(_args
, "O&lll",
4424 MovieObj_Convert
, &dstMovie
,
4429 _err
= InsertMovieSegment(_self
->ob_itself
,
4434 if (_err
!= noErr
) return PyMac_Error(_err
);
4440 static PyObject
*MovieObj_InsertEmptyMovieSegment(_self
, _args
)
4444 PyObject
*_res
= NULL
;
4447 TimeValue dstDuration
;
4448 if (!PyArg_ParseTuple(_args
, "ll",
4452 _err
= InsertEmptyMovieSegment(_self
->ob_itself
,
4455 if (_err
!= noErr
) return PyMac_Error(_err
);
4461 static PyObject
*MovieObj_DeleteMovieSegment(_self
, _args
)
4465 PyObject
*_res
= NULL
;
4467 TimeValue startTime
;
4469 if (!PyArg_ParseTuple(_args
, "ll",
4473 _err
= DeleteMovieSegment(_self
->ob_itself
,
4476 if (_err
!= noErr
) return PyMac_Error(_err
);
4482 static PyObject
*MovieObj_ScaleMovieSegment(_self
, _args
)
4486 PyObject
*_res
= NULL
;
4488 TimeValue startTime
;
4489 TimeValue oldDuration
;
4490 TimeValue newDuration
;
4491 if (!PyArg_ParseTuple(_args
, "lll",
4496 _err
= ScaleMovieSegment(_self
->ob_itself
,
4500 if (_err
!= noErr
) return PyMac_Error(_err
);
4506 static PyObject
*MovieObj_CutMovieSelection(_self
, _args
)
4510 PyObject
*_res
= NULL
;
4512 if (!PyArg_ParseTuple(_args
, ""))
4514 _rv
= CutMovieSelection(_self
->ob_itself
);
4515 _res
= Py_BuildValue("O&",
4520 static PyObject
*MovieObj_CopyMovieSelection(_self
, _args
)
4524 PyObject
*_res
= NULL
;
4526 if (!PyArg_ParseTuple(_args
, ""))
4528 _rv
= CopyMovieSelection(_self
->ob_itself
);
4529 _res
= Py_BuildValue("O&",
4534 static PyObject
*MovieObj_PasteMovieSelection(_self
, _args
)
4538 PyObject
*_res
= NULL
;
4540 if (!PyArg_ParseTuple(_args
, "O&",
4541 MovieObj_Convert
, &src
))
4543 PasteMovieSelection(_self
->ob_itself
,
4550 static PyObject
*MovieObj_AddMovieSelection(_self
, _args
)
4554 PyObject
*_res
= NULL
;
4556 if (!PyArg_ParseTuple(_args
, "O&",
4557 MovieObj_Convert
, &src
))
4559 AddMovieSelection(_self
->ob_itself
,
4566 static PyObject
*MovieObj_ClearMovieSelection(_self
, _args
)
4570 PyObject
*_res
= NULL
;
4571 if (!PyArg_ParseTuple(_args
, ""))
4573 ClearMovieSelection(_self
->ob_itself
);
4579 static PyObject
*MovieObj_PutMovieIntoTypedHandle(_self
, _args
)
4583 PyObject
*_res
= NULL
;
4591 ComponentInstance userComp
;
4592 if (!PyArg_ParseTuple(_args
, "O&O&O&lllO&",
4593 TrackObj_Convert
, &targetTrack
,
4594 PyMac_GetOSType
, &handleType
,
4595 ResObj_Convert
, &publicMovie
,
4599 CmpInstObj_Convert
, &userComp
))
4601 _err
= PutMovieIntoTypedHandle(_self
->ob_itself
,
4609 if (_err
!= noErr
) return PyMac_Error(_err
);
4615 static PyObject
*MovieObj_CopyMovieSettings(_self
, _args
)
4619 PyObject
*_res
= NULL
;
4622 if (!PyArg_ParseTuple(_args
, "O&",
4623 MovieObj_Convert
, &dstMovie
))
4625 _err
= CopyMovieSettings(_self
->ob_itself
,
4627 if (_err
!= noErr
) return PyMac_Error(_err
);
4633 static PyObject
*MovieObj_ConvertMovieToFile(_self
, _args
)
4637 PyObject
*_res
= NULL
;
4643 ScriptCode scriptTag
;
4646 ComponentInstance userComp
;
4647 if (!PyArg_ParseTuple(_args
, "O&O&O&O&hlO&",
4648 TrackObj_Convert
, &onlyTrack
,
4649 PyMac_GetFSSpec
, &outputFile
,
4650 PyMac_GetOSType
, &fileType
,
4651 PyMac_GetOSType
, &creator
,
4654 CmpInstObj_Convert
, &userComp
))
4656 _err
= ConvertMovieToFile(_self
->ob_itself
,
4665 if (_err
!= noErr
) return PyMac_Error(_err
);
4666 _res
= Py_BuildValue("h",
4671 static PyObject
*MovieObj_GetMovieDataSize(_self
, _args
)
4675 PyObject
*_res
= NULL
;
4677 TimeValue startTime
;
4679 if (!PyArg_ParseTuple(_args
, "ll",
4683 _rv
= GetMovieDataSize(_self
->ob_itself
,
4686 _res
= Py_BuildValue("l",
4691 static PyObject
*MovieObj_PtInMovie(_self
, _args
)
4695 PyObject
*_res
= NULL
;
4698 if (!PyArg_ParseTuple(_args
, "O&",
4699 PyMac_GetPoint
, &pt
))
4701 _rv
= PtInMovie(_self
->ob_itself
,
4703 _res
= Py_BuildValue("b",
4708 static PyObject
*MovieObj_SetMovieLanguage(_self
, _args
)
4712 PyObject
*_res
= NULL
;
4714 if (!PyArg_ParseTuple(_args
, "l",
4717 SetMovieLanguage(_self
->ob_itself
,
4724 static PyObject
*MovieObj_GetMovieNextInterestingTime(_self
, _args
)
4728 PyObject
*_res
= NULL
;
4729 short interestingTimeFlags
;
4730 short numMediaTypes
;
4731 OSType whichMediaTypes
;
4734 TimeValue interestingTime
;
4735 TimeValue interestingDuration
;
4736 if (!PyArg_ParseTuple(_args
, "hhO&lO&",
4737 &interestingTimeFlags
,
4739 PyMac_GetOSType
, &whichMediaTypes
,
4741 PyMac_GetFixed
, &rate
))
4743 GetMovieNextInterestingTime(_self
->ob_itself
,
4744 interestingTimeFlags
,
4750 &interestingDuration
);
4751 _res
= Py_BuildValue("ll",
4753 interestingDuration
);
4757 static PyObject
*MovieObj_AddMovieResource(_self
, _args
)
4761 PyObject
*_res
= NULL
;
4766 if (!PyArg_ParseTuple(_args
, "hO&",
4768 PyMac_GetStr255
, resName
))
4770 _err
= AddMovieResource(_self
->ob_itself
,
4774 if (_err
!= noErr
) return PyMac_Error(_err
);
4775 _res
= Py_BuildValue("h",
4780 static PyObject
*MovieObj_UpdateMovieResource(_self
, _args
)
4784 PyObject
*_res
= NULL
;
4789 if (!PyArg_ParseTuple(_args
, "hhO&",
4792 PyMac_GetStr255
, resName
))
4794 _err
= UpdateMovieResource(_self
->ob_itself
,
4798 if (_err
!= noErr
) return PyMac_Error(_err
);
4804 static PyObject
*MovieObj_HasMovieChanged(_self
, _args
)
4808 PyObject
*_res
= NULL
;
4810 if (!PyArg_ParseTuple(_args
, ""))
4812 _rv
= HasMovieChanged(_self
->ob_itself
);
4813 _res
= Py_BuildValue("b",
4818 static PyObject
*MovieObj_ClearMovieChanged(_self
, _args
)
4822 PyObject
*_res
= NULL
;
4823 if (!PyArg_ParseTuple(_args
, ""))
4825 ClearMovieChanged(_self
->ob_itself
);
4831 static PyObject
*MovieObj_SetMovieDefaultDataRef(_self
, _args
)
4835 PyObject
*_res
= NULL
;
4839 if (!PyArg_ParseTuple(_args
, "O&O&",
4840 ResObj_Convert
, &dataRef
,
4841 PyMac_GetOSType
, &dataRefType
))
4843 _err
= SetMovieDefaultDataRef(_self
->ob_itself
,
4846 if (_err
!= noErr
) return PyMac_Error(_err
);
4852 static PyObject
*MovieObj_GetMovieDefaultDataRef(_self
, _args
)
4856 PyObject
*_res
= NULL
;
4860 if (!PyArg_ParseTuple(_args
, ""))
4862 _err
= GetMovieDefaultDataRef(_self
->ob_itself
,
4865 if (_err
!= noErr
) return PyMac_Error(_err
);
4866 _res
= Py_BuildValue("O&O&",
4867 ResObj_New
, dataRef
,
4868 PyMac_BuildOSType
, dataRefType
);
4872 static PyObject
*MovieObj_SetMovieColorTable(_self
, _args
)
4876 PyObject
*_res
= NULL
;
4879 if (!PyArg_ParseTuple(_args
, "O&",
4880 ResObj_Convert
, &ctab
))
4882 _err
= SetMovieColorTable(_self
->ob_itself
,
4884 if (_err
!= noErr
) return PyMac_Error(_err
);
4890 static PyObject
*MovieObj_GetMovieColorTable(_self
, _args
)
4894 PyObject
*_res
= NULL
;
4897 if (!PyArg_ParseTuple(_args
, ""))
4899 _err
= GetMovieColorTable(_self
->ob_itself
,
4901 if (_err
!= noErr
) return PyMac_Error(_err
);
4902 _res
= Py_BuildValue("O&",
4907 static PyObject
*MovieObj_FlattenMovie(_self
, _args
)
4911 PyObject
*_res
= NULL
;
4912 long movieFlattenFlags
;
4915 ScriptCode scriptTag
;
4916 long createMovieFileFlags
;
4919 if (!PyArg_ParseTuple(_args
, "lO&O&hlO&",
4921 PyMac_GetFSSpec
, &theFile
,
4922 PyMac_GetOSType
, &creator
,
4924 &createMovieFileFlags
,
4925 PyMac_GetStr255
, resName
))
4927 FlattenMovie(_self
->ob_itself
,
4932 createMovieFileFlags
,
4935 _res
= Py_BuildValue("h",
4940 static PyObject
*MovieObj_FlattenMovieData(_self
, _args
)
4944 PyObject
*_res
= NULL
;
4946 long movieFlattenFlags
;
4949 ScriptCode scriptTag
;
4950 long createMovieFileFlags
;
4951 if (!PyArg_ParseTuple(_args
, "lO&O&hl",
4953 PyMac_GetFSSpec
, &theFile
,
4954 PyMac_GetOSType
, &creator
,
4956 &createMovieFileFlags
))
4958 _rv
= FlattenMovieData(_self
->ob_itself
,
4963 createMovieFileFlags
);
4964 _res
= Py_BuildValue("O&",
4969 static PyObject
*MovieObj_MovieSearchText(_self
, _args
)
4973 PyObject
*_res
= NULL
;
4979 TimeValue searchTime
;
4981 if (!PyArg_ParseTuple(_args
, "sll",
4986 _err
= MovieSearchText(_self
->ob_itself
,
4993 if (_err
!= noErr
) return PyMac_Error(_err
);
4994 _res
= Py_BuildValue("O&ll",
4995 TrackObj_New
, searchTrack
,
5001 static PyObject
*MovieObj_GetPosterBox(_self
, _args
)
5005 PyObject
*_res
= NULL
;
5007 if (!PyArg_ParseTuple(_args
, ""))
5009 GetPosterBox(_self
->ob_itself
,
5011 _res
= Py_BuildValue("O&",
5012 PyMac_BuildRect
, &boxRect
);
5016 static PyObject
*MovieObj_SetPosterBox(_self
, _args
)
5020 PyObject
*_res
= NULL
;
5022 if (!PyArg_ParseTuple(_args
, "O&",
5023 PyMac_GetRect
, &boxRect
))
5025 SetPosterBox(_self
->ob_itself
,
5032 static PyObject
*MovieObj_GetMovieSegmentDisplayBoundsRgn(_self
, _args
)
5036 PyObject
*_res
= NULL
;
5040 if (!PyArg_ParseTuple(_args
, "ll",
5044 _rv
= GetMovieSegmentDisplayBoundsRgn(_self
->ob_itself
,
5047 _res
= Py_BuildValue("O&",
5052 static PyObject
*MovieObj_GetMovieStatus(_self
, _args
)
5056 PyObject
*_res
= NULL
;
5057 ComponentResult _rv
;
5058 Track firstProblemTrack
;
5059 if (!PyArg_ParseTuple(_args
, ""))
5061 _rv
= GetMovieStatus(_self
->ob_itself
,
5062 &firstProblemTrack
);
5063 _res
= Py_BuildValue("lO&",
5065 TrackObj_New
, firstProblemTrack
);
5069 static PyObject
*MovieObj_NewMovieController(_self
, _args
)
5073 PyObject
*_res
= NULL
;
5074 MovieController _rv
;
5077 if (!PyArg_ParseTuple(_args
, "O&l",
5078 PyMac_GetRect
, &movieRect
,
5081 _rv
= NewMovieController(_self
->ob_itself
,
5084 _res
= Py_BuildValue("O&",
5085 MovieCtlObj_New
, _rv
);
5089 static PyObject
*MovieObj_PutMovieOnScrap(_self
, _args
)
5093 PyObject
*_res
= NULL
;
5095 long movieScrapFlags
;
5096 if (!PyArg_ParseTuple(_args
, "l",
5099 _err
= PutMovieOnScrap(_self
->ob_itself
,
5101 if (_err
!= noErr
) return PyMac_Error(_err
);
5107 static PyObject
*MovieObj_SetMoviePlayHints(_self
, _args
)
5111 PyObject
*_res
= NULL
;
5114 if (!PyArg_ParseTuple(_args
, "ll",
5118 SetMoviePlayHints(_self
->ob_itself
,
5126 static PyMethodDef MovieObj_methods
[] = {
5127 {"MoviesTask", (PyCFunction
)MovieObj_MoviesTask
, 1,
5128 "(long maxMilliSecToUse) -> None"},
5129 {"PrerollMovie", (PyCFunction
)MovieObj_PrerollMovie
, 1,
5130 "(TimeValue time, Fixed Rate) -> None"},
5131 {"LoadMovieIntoRam", (PyCFunction
)MovieObj_LoadMovieIntoRam
, 1,
5132 "(TimeValue time, TimeValue duration, long flags) -> None"},
5133 {"SetMovieActive", (PyCFunction
)MovieObj_SetMovieActive
, 1,
5134 "(Boolean active) -> None"},
5135 {"GetMovieActive", (PyCFunction
)MovieObj_GetMovieActive
, 1,
5136 "() -> (Boolean _rv)"},
5137 {"StartMovie", (PyCFunction
)MovieObj_StartMovie
, 1,
5139 {"StopMovie", (PyCFunction
)MovieObj_StopMovie
, 1,
5141 {"GoToBeginningOfMovie", (PyCFunction
)MovieObj_GoToBeginningOfMovie
, 1,
5143 {"GoToEndOfMovie", (PyCFunction
)MovieObj_GoToEndOfMovie
, 1,
5145 {"IsMovieDone", (PyCFunction
)MovieObj_IsMovieDone
, 1,
5146 "() -> (Boolean _rv)"},
5147 {"GetMoviePreviewMode", (PyCFunction
)MovieObj_GetMoviePreviewMode
, 1,
5148 "() -> (Boolean _rv)"},
5149 {"SetMoviePreviewMode", (PyCFunction
)MovieObj_SetMoviePreviewMode
, 1,
5150 "(Boolean usePreview) -> None"},
5151 {"ShowMoviePoster", (PyCFunction
)MovieObj_ShowMoviePoster
, 1,
5153 {"GetMovieTimeBase", (PyCFunction
)MovieObj_GetMovieTimeBase
, 1,
5154 "() -> (TimeBase _rv)"},
5155 {"GetNextTrackForCompositing", (PyCFunction
)MovieObj_GetNextTrackForCompositing
, 1,
5156 "(Track theTrack) -> (Track _rv)"},
5157 {"GetPrevTrackForCompositing", (PyCFunction
)MovieObj_GetPrevTrackForCompositing
, 1,
5158 "(Track theTrack) -> (Track _rv)"},
5159 {"GetMoviePict", (PyCFunction
)MovieObj_GetMoviePict
, 1,
5160 "(TimeValue time) -> (PicHandle _rv)"},
5161 {"GetMoviePosterPict", (PyCFunction
)MovieObj_GetMoviePosterPict
, 1,
5162 "() -> (PicHandle _rv)"},
5163 {"UpdateMovie", (PyCFunction
)MovieObj_UpdateMovie
, 1,
5165 {"GetMovieBox", (PyCFunction
)MovieObj_GetMovieBox
, 1,
5166 "() -> (Rect boxRect)"},
5167 {"SetMovieBox", (PyCFunction
)MovieObj_SetMovieBox
, 1,
5168 "(Rect boxRect) -> None"},
5169 {"GetMovieDisplayClipRgn", (PyCFunction
)MovieObj_GetMovieDisplayClipRgn
, 1,
5170 "() -> (RgnHandle _rv)"},
5171 {"SetMovieDisplayClipRgn", (PyCFunction
)MovieObj_SetMovieDisplayClipRgn
, 1,
5172 "(RgnHandle theClip) -> None"},
5173 {"GetMovieClipRgn", (PyCFunction
)MovieObj_GetMovieClipRgn
, 1,
5174 "() -> (RgnHandle _rv)"},
5175 {"SetMovieClipRgn", (PyCFunction
)MovieObj_SetMovieClipRgn
, 1,
5176 "(RgnHandle theClip) -> None"},
5177 {"GetMovieDisplayBoundsRgn", (PyCFunction
)MovieObj_GetMovieDisplayBoundsRgn
, 1,
5178 "() -> (RgnHandle _rv)"},
5179 {"GetMovieBoundsRgn", (PyCFunction
)MovieObj_GetMovieBoundsRgn
, 1,
5180 "() -> (RgnHandle _rv)"},
5181 {"PutMovieIntoHandle", (PyCFunction
)MovieObj_PutMovieIntoHandle
, 1,
5182 "(Handle publicMovie) -> None"},
5183 {"PutMovieIntoDataFork", (PyCFunction
)MovieObj_PutMovieIntoDataFork
, 1,
5184 "(short fRefNum, long offset, long maxSize) -> None"},
5185 {"GetMovieTimeScale", (PyCFunction
)MovieObj_GetMovieTimeScale
, 1,
5186 "() -> (TimeScale _rv)"},
5187 {"SetMovieTimeScale", (PyCFunction
)MovieObj_SetMovieTimeScale
, 1,
5188 "(TimeScale timeScale) -> None"},
5189 {"GetMovieDuration", (PyCFunction
)MovieObj_GetMovieDuration
, 1,
5190 "() -> (TimeValue _rv)"},
5191 {"GetMovieRate", (PyCFunction
)MovieObj_GetMovieRate
, 1,
5192 "() -> (Fixed _rv)"},
5193 {"SetMovieRate", (PyCFunction
)MovieObj_SetMovieRate
, 1,
5194 "(Fixed rate) -> None"},
5195 {"GetMoviePreferredRate", (PyCFunction
)MovieObj_GetMoviePreferredRate
, 1,
5196 "() -> (Fixed _rv)"},
5197 {"SetMoviePreferredRate", (PyCFunction
)MovieObj_SetMoviePreferredRate
, 1,
5198 "(Fixed rate) -> None"},
5199 {"GetMoviePreferredVolume", (PyCFunction
)MovieObj_GetMoviePreferredVolume
, 1,
5200 "() -> (short _rv)"},
5201 {"SetMoviePreferredVolume", (PyCFunction
)MovieObj_SetMoviePreferredVolume
, 1,
5202 "(short volume) -> None"},
5203 {"GetMovieVolume", (PyCFunction
)MovieObj_GetMovieVolume
, 1,
5204 "() -> (short _rv)"},
5205 {"SetMovieVolume", (PyCFunction
)MovieObj_SetMovieVolume
, 1,
5206 "(short volume) -> None"},
5207 {"GetMoviePreviewTime", (PyCFunction
)MovieObj_GetMoviePreviewTime
, 1,
5208 "() -> (TimeValue previewTime, TimeValue previewDuration)"},
5209 {"SetMoviePreviewTime", (PyCFunction
)MovieObj_SetMoviePreviewTime
, 1,
5210 "(TimeValue previewTime, TimeValue previewDuration) -> None"},
5211 {"GetMoviePosterTime", (PyCFunction
)MovieObj_GetMoviePosterTime
, 1,
5212 "() -> (TimeValue _rv)"},
5213 {"SetMoviePosterTime", (PyCFunction
)MovieObj_SetMoviePosterTime
, 1,
5214 "(TimeValue posterTime) -> None"},
5215 {"GetMovieSelection", (PyCFunction
)MovieObj_GetMovieSelection
, 1,
5216 "() -> (TimeValue selectionTime, TimeValue selectionDuration)"},
5217 {"SetMovieSelection", (PyCFunction
)MovieObj_SetMovieSelection
, 1,
5218 "(TimeValue selectionTime, TimeValue selectionDuration) -> None"},
5219 {"SetMovieActiveSegment", (PyCFunction
)MovieObj_SetMovieActiveSegment
, 1,
5220 "(TimeValue startTime, TimeValue duration) -> None"},
5221 {"GetMovieActiveSegment", (PyCFunction
)MovieObj_GetMovieActiveSegment
, 1,
5222 "() -> (TimeValue startTime, TimeValue duration)"},
5223 {"SetMovieTimeValue", (PyCFunction
)MovieObj_SetMovieTimeValue
, 1,
5224 "(TimeValue newtime) -> None"},
5225 {"GetMovieUserData", (PyCFunction
)MovieObj_GetMovieUserData
, 1,
5226 "() -> (UserData _rv)"},
5227 {"GetMovieTrackCount", (PyCFunction
)MovieObj_GetMovieTrackCount
, 1,
5228 "() -> (long _rv)"},
5229 {"GetMovieTrack", (PyCFunction
)MovieObj_GetMovieTrack
, 1,
5230 "(long trackID) -> (Track _rv)"},
5231 {"GetMovieIndTrack", (PyCFunction
)MovieObj_GetMovieIndTrack
, 1,
5232 "(long index) -> (Track _rv)"},
5233 {"GetMovieIndTrackType", (PyCFunction
)MovieObj_GetMovieIndTrackType
, 1,
5234 "(long index, OSType trackType, long flags) -> (Track _rv)"},
5235 {"NewMovieTrack", (PyCFunction
)MovieObj_NewMovieTrack
, 1,
5236 "(Fixed width, Fixed height, short trackVolume) -> (Track _rv)"},
5237 {"SetAutoTrackAlternatesEnabled", (PyCFunction
)MovieObj_SetAutoTrackAlternatesEnabled
, 1,
5238 "(Boolean enable) -> None"},
5239 {"SelectMovieAlternates", (PyCFunction
)MovieObj_SelectMovieAlternates
, 1,
5241 {"InsertMovieSegment", (PyCFunction
)MovieObj_InsertMovieSegment
, 1,
5242 "(Movie dstMovie, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
5243 {"InsertEmptyMovieSegment", (PyCFunction
)MovieObj_InsertEmptyMovieSegment
, 1,
5244 "(TimeValue dstIn, TimeValue dstDuration) -> None"},
5245 {"DeleteMovieSegment", (PyCFunction
)MovieObj_DeleteMovieSegment
, 1,
5246 "(TimeValue startTime, TimeValue duration) -> None"},
5247 {"ScaleMovieSegment", (PyCFunction
)MovieObj_ScaleMovieSegment
, 1,
5248 "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
5249 {"CutMovieSelection", (PyCFunction
)MovieObj_CutMovieSelection
, 1,
5250 "() -> (Movie _rv)"},
5251 {"CopyMovieSelection", (PyCFunction
)MovieObj_CopyMovieSelection
, 1,
5252 "() -> (Movie _rv)"},
5253 {"PasteMovieSelection", (PyCFunction
)MovieObj_PasteMovieSelection
, 1,
5254 "(Movie src) -> None"},
5255 {"AddMovieSelection", (PyCFunction
)MovieObj_AddMovieSelection
, 1,
5256 "(Movie src) -> None"},
5257 {"ClearMovieSelection", (PyCFunction
)MovieObj_ClearMovieSelection
, 1,
5259 {"PutMovieIntoTypedHandle", (PyCFunction
)MovieObj_PutMovieIntoTypedHandle
, 1,
5260 "(Track targetTrack, OSType handleType, Handle publicMovie, TimeValue start, TimeValue dur, long flags, ComponentInstance userComp) -> None"},
5261 {"CopyMovieSettings", (PyCFunction
)MovieObj_CopyMovieSettings
, 1,
5262 "(Movie dstMovie) -> None"},
5263 {"ConvertMovieToFile", (PyCFunction
)MovieObj_ConvertMovieToFile
, 1,
5264 "(Track onlyTrack, FSSpec outputFile, OSType fileType, OSType creator, ScriptCode scriptTag, long flags, ComponentInstance userComp) -> (short resID)"},
5265 {"GetMovieDataSize", (PyCFunction
)MovieObj_GetMovieDataSize
, 1,
5266 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
5267 {"PtInMovie", (PyCFunction
)MovieObj_PtInMovie
, 1,
5268 "(Point pt) -> (Boolean _rv)"},
5269 {"SetMovieLanguage", (PyCFunction
)MovieObj_SetMovieLanguage
, 1,
5270 "(long language) -> None"},
5271 {"GetMovieNextInterestingTime", (PyCFunction
)MovieObj_GetMovieNextInterestingTime
, 1,
5272 "(short interestingTimeFlags, short numMediaTypes, OSType whichMediaTypes, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
5273 {"AddMovieResource", (PyCFunction
)MovieObj_AddMovieResource
, 1,
5274 "(short resRefNum, Str255 resName) -> (short resId)"},
5275 {"UpdateMovieResource", (PyCFunction
)MovieObj_UpdateMovieResource
, 1,
5276 "(short resRefNum, short resId, Str255 resName) -> None"},
5277 {"HasMovieChanged", (PyCFunction
)MovieObj_HasMovieChanged
, 1,
5278 "() -> (Boolean _rv)"},
5279 {"ClearMovieChanged", (PyCFunction
)MovieObj_ClearMovieChanged
, 1,
5281 {"SetMovieDefaultDataRef", (PyCFunction
)MovieObj_SetMovieDefaultDataRef
, 1,
5282 "(Handle dataRef, OSType dataRefType) -> None"},
5283 {"GetMovieDefaultDataRef", (PyCFunction
)MovieObj_GetMovieDefaultDataRef
, 1,
5284 "() -> (Handle dataRef, OSType dataRefType)"},
5285 {"SetMovieColorTable", (PyCFunction
)MovieObj_SetMovieColorTable
, 1,
5286 "(CTabHandle ctab) -> None"},
5287 {"GetMovieColorTable", (PyCFunction
)MovieObj_GetMovieColorTable
, 1,
5288 "() -> (CTabHandle ctab)"},
5289 {"FlattenMovie", (PyCFunction
)MovieObj_FlattenMovie
, 1,
5290 "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, Str255 resName) -> (short resId)"},
5291 {"FlattenMovieData", (PyCFunction
)MovieObj_FlattenMovieData
, 1,
5292 "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (Movie _rv)"},
5293 {"MovieSearchText", (PyCFunction
)MovieObj_MovieSearchText
, 1,
5294 "(Ptr text, long size, long searchFlags) -> (Track searchTrack, TimeValue searchTime, long searchOffset)"},
5295 {"GetPosterBox", (PyCFunction
)MovieObj_GetPosterBox
, 1,
5296 "() -> (Rect boxRect)"},
5297 {"SetPosterBox", (PyCFunction
)MovieObj_SetPosterBox
, 1,
5298 "(Rect boxRect) -> None"},
5299 {"GetMovieSegmentDisplayBoundsRgn", (PyCFunction
)MovieObj_GetMovieSegmentDisplayBoundsRgn
, 1,
5300 "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
5301 {"GetMovieStatus", (PyCFunction
)MovieObj_GetMovieStatus
, 1,
5302 "() -> (ComponentResult _rv, Track firstProblemTrack)"},
5303 {"NewMovieController", (PyCFunction
)MovieObj_NewMovieController
, 1,
5304 "(Rect movieRect, long someFlags) -> (MovieController _rv)"},
5305 {"PutMovieOnScrap", (PyCFunction
)MovieObj_PutMovieOnScrap
, 1,
5306 "(long movieScrapFlags) -> None"},
5307 {"SetMoviePlayHints", (PyCFunction
)MovieObj_SetMoviePlayHints
, 1,
5308 "(long flags, long flagsMask) -> None"},
5312 PyMethodChain MovieObj_chain
= { MovieObj_methods
, NULL
};
5314 static PyObject
*MovieObj_getattr(self
, name
)
5318 return Py_FindMethodInChain(&MovieObj_chain
, (PyObject
*)self
, name
);
5321 #define MovieObj_setattr NULL
5323 PyTypeObject Movie_Type
= {
5324 PyObject_HEAD_INIT(&PyType_Type
)
5326 "Movie", /*tp_name*/
5327 sizeof(MovieObject
), /*tp_basicsize*/
5330 (destructor
) MovieObj_dealloc
, /*tp_dealloc*/
5332 (getattrfunc
) MovieObj_getattr
, /*tp_getattr*/
5333 (setattrfunc
) MovieObj_setattr
, /*tp_setattr*/
5336 /* --------------------- End object type Movie ---------------------- */
5339 static PyObject
*Qt_EnterMovies(_self
, _args
)
5343 PyObject
*_res
= NULL
;
5345 if (!PyArg_ParseTuple(_args
, ""))
5347 _err
= EnterMovies();
5348 if (_err
!= noErr
) return PyMac_Error(_err
);
5354 static PyObject
*Qt_ExitMovies(_self
, _args
)
5358 PyObject
*_res
= NULL
;
5359 if (!PyArg_ParseTuple(_args
, ""))
5367 static PyObject
*Qt_GetMoviesError(_self
, _args
)
5371 PyObject
*_res
= NULL
;
5373 if (!PyArg_ParseTuple(_args
, ""))
5375 _err
= GetMoviesError();
5376 if (_err
!= noErr
) return PyMac_Error(_err
);
5382 static PyObject
*Qt_ClearMoviesStickyError(_self
, _args
)
5386 PyObject
*_res
= NULL
;
5387 if (!PyArg_ParseTuple(_args
, ""))
5389 ClearMoviesStickyError();
5395 static PyObject
*Qt_GetMoviesStickyError(_self
, _args
)
5399 PyObject
*_res
= NULL
;
5401 if (!PyArg_ParseTuple(_args
, ""))
5403 _err
= GetMoviesStickyError();
5404 if (_err
!= noErr
) return PyMac_Error(_err
);
5410 static PyObject
*Qt_DisposeMatte(_self
, _args
)
5414 PyObject
*_res
= NULL
;
5415 PixMapHandle theMatte
;
5416 if (!PyArg_ParseTuple(_args
, "O&",
5417 ResObj_Convert
, &theMatte
))
5419 DisposeMatte(theMatte
);
5425 static PyObject
*Qt_NewMovie(_self
, _args
)
5429 PyObject
*_res
= NULL
;
5432 if (!PyArg_ParseTuple(_args
, "l",
5435 _rv
= NewMovie(flags
);
5436 _res
= Py_BuildValue("O&",
5441 static PyObject
*Qt_GetDataHandler(_self
, _args
)
5445 PyObject
*_res
= NULL
;
5448 OSType dataHandlerSubType
;
5450 if (!PyArg_ParseTuple(_args
, "O&O&l",
5451 ResObj_Convert
, &dataRef
,
5452 PyMac_GetOSType
, &dataHandlerSubType
,
5455 _rv
= GetDataHandler(dataRef
,
5458 _res
= Py_BuildValue("O&",
5463 static PyObject
*Qt_PasteHandleIntoMovie(_self
, _args
)
5467 PyObject
*_res
= NULL
;
5473 ComponentInstance userComp
;
5474 if (!PyArg_ParseTuple(_args
, "O&O&O&lO&",
5476 PyMac_GetOSType
, &handleType
,
5477 MovieObj_Convert
, &theMovie
,
5479 CmpInstObj_Convert
, &userComp
))
5481 _err
= PasteHandleIntoMovie(h
,
5486 if (_err
!= noErr
) return PyMac_Error(_err
);
5492 static PyObject
*Qt_TrackTimeToMediaTime(_self
, _args
)
5496 PyObject
*_res
= NULL
;
5500 if (!PyArg_ParseTuple(_args
, "lO&",
5502 TrackObj_Convert
, &theTrack
))
5504 _rv
= TrackTimeToMediaTime(value
,
5506 _res
= Py_BuildValue("l",
5511 static PyObject
*Qt_NewUserData(_self
, _args
)
5515 PyObject
*_res
= NULL
;
5517 UserData theUserData
;
5518 if (!PyArg_ParseTuple(_args
, ""))
5520 _err
= NewUserData(&theUserData
);
5521 if (_err
!= noErr
) return PyMac_Error(_err
);
5522 _res
= Py_BuildValue("O&",
5523 UserDataObj_New
, theUserData
);
5527 static PyObject
*Qt_NewUserDataFromHandle(_self
, _args
)
5531 PyObject
*_res
= NULL
;
5534 UserData theUserData
;
5535 if (!PyArg_ParseTuple(_args
, "O&",
5536 ResObj_Convert
, &h
))
5538 _err
= NewUserDataFromHandle(h
,
5540 if (_err
!= noErr
) return PyMac_Error(_err
);
5541 _res
= Py_BuildValue("O&",
5542 UserDataObj_New
, theUserData
);
5546 static PyObject
*Qt_CreateMovieFile(_self
, _args
)
5550 PyObject
*_res
= NULL
;
5554 ScriptCode scriptTag
;
5555 long createMovieFileFlags
;
5558 if (!PyArg_ParseTuple(_args
, "O&O&hl",
5559 PyMac_GetFSSpec
, &fileSpec
,
5560 PyMac_GetOSType
, &creator
,
5562 &createMovieFileFlags
))
5564 _err
= CreateMovieFile(&fileSpec
,
5567 createMovieFileFlags
,
5570 if (_err
!= noErr
) return PyMac_Error(_err
);
5571 _res
= Py_BuildValue("hO&",
5573 MovieObj_New
, newmovie
);
5577 static PyObject
*Qt_OpenMovieFile(_self
, _args
)
5581 PyObject
*_res
= NULL
;
5586 if (!PyArg_ParseTuple(_args
, "O&b",
5587 PyMac_GetFSSpec
, &fileSpec
,
5590 _err
= OpenMovieFile(&fileSpec
,
5593 if (_err
!= noErr
) return PyMac_Error(_err
);
5594 _res
= Py_BuildValue("h",
5599 static PyObject
*Qt_CloseMovieFile(_self
, _args
)
5603 PyObject
*_res
= NULL
;
5606 if (!PyArg_ParseTuple(_args
, "h",
5609 _err
= CloseMovieFile(resRefNum
);
5610 if (_err
!= noErr
) return PyMac_Error(_err
);
5616 static PyObject
*Qt_DeleteMovieFile(_self
, _args
)
5620 PyObject
*_res
= NULL
;
5623 if (!PyArg_ParseTuple(_args
, "O&",
5624 PyMac_GetFSSpec
, &fileSpec
))
5626 _err
= DeleteMovieFile(&fileSpec
);
5627 if (_err
!= noErr
) return PyMac_Error(_err
);
5633 static PyObject
*Qt_NewMovieFromFile(_self
, _args
)
5637 PyObject
*_res
= NULL
;
5641 short newMovieFlags
;
5642 Boolean dataRefWasChanged
;
5643 if (!PyArg_ParseTuple(_args
, "hh",
5647 _err
= NewMovieFromFile(&theMovie
,
5652 &dataRefWasChanged
);
5653 if (_err
!= noErr
) return PyMac_Error(_err
);
5654 _res
= Py_BuildValue("O&b",
5655 MovieObj_New
, theMovie
,
5660 static PyObject
*Qt_NewMovieFromHandle(_self
, _args
)
5664 PyObject
*_res
= NULL
;
5668 short newMovieFlags
;
5669 Boolean dataRefWasChanged
;
5670 if (!PyArg_ParseTuple(_args
, "O&h",
5674 _err
= NewMovieFromHandle(&theMovie
,
5677 &dataRefWasChanged
);
5678 if (_err
!= noErr
) return PyMac_Error(_err
);
5679 _res
= Py_BuildValue("O&b",
5680 MovieObj_New
, theMovie
,
5685 static PyObject
*Qt_NewMovieFromDataFork(_self
, _args
)
5689 PyObject
*_res
= NULL
;
5694 short newMovieFlags
;
5695 Boolean dataRefWasChanged
;
5696 if (!PyArg_ParseTuple(_args
, "hlh",
5701 _err
= NewMovieFromDataFork(&theMovie
,
5705 &dataRefWasChanged
);
5706 if (_err
!= noErr
) return PyMac_Error(_err
);
5707 _res
= Py_BuildValue("O&b",
5708 MovieObj_New
, theMovie
,
5713 static PyObject
*Qt_RemoveMovieResource(_self
, _args
)
5717 PyObject
*_res
= NULL
;
5721 if (!PyArg_ParseTuple(_args
, "hh",
5725 _err
= RemoveMovieResource(resRefNum
,
5727 if (_err
!= noErr
) return PyMac_Error(_err
);
5733 static PyObject
*Qt_GetVideoMediaGraphicsMode(_self
, _args
)
5737 PyObject
*_res
= NULL
;
5742 if (!PyArg_ParseTuple(_args
, "O&",
5743 CmpInstObj_Convert
, &mh
))
5745 _rv
= GetVideoMediaGraphicsMode(mh
,
5748 _res
= Py_BuildValue("llO&",
5751 QdRGB_New
, &opColor
);
5755 static PyObject
*Qt_SetVideoMediaGraphicsMode(_self
, _args
)
5759 PyObject
*_res
= NULL
;
5764 if (!PyArg_ParseTuple(_args
, "O&lO&",
5765 CmpInstObj_Convert
, &mh
,
5767 QdRGB_Convert
, &opColor
))
5769 _rv
= SetVideoMediaGraphicsMode(mh
,
5772 _res
= Py_BuildValue("l",
5777 static PyObject
*Qt_GetSoundMediaBalance(_self
, _args
)
5781 PyObject
*_res
= NULL
;
5785 if (!PyArg_ParseTuple(_args
, "O&",
5786 CmpInstObj_Convert
, &mh
))
5788 _rv
= GetSoundMediaBalance(mh
,
5790 _res
= Py_BuildValue("lh",
5796 static PyObject
*Qt_SetSoundMediaBalance(_self
, _args
)
5800 PyObject
*_res
= NULL
;
5804 if (!PyArg_ParseTuple(_args
, "O&h",
5805 CmpInstObj_Convert
, &mh
,
5808 _rv
= SetSoundMediaBalance(mh
,
5810 _res
= Py_BuildValue("l",
5815 static PyObject
*Qt_FindNextText(_self
, _args
)
5819 PyObject
*_res
= NULL
;
5820 ComponentResult _rv
;
5825 TimeValue startTime
;
5826 TimeValue foundTime
;
5827 TimeValue foundDuration
;
5829 if (!PyArg_ParseTuple(_args
, "O&slhl",
5830 CmpInstObj_Convert
, &mh
,
5836 _rv
= FindNextText(mh
,
5844 _res
= Py_BuildValue("llll",
5852 static PyObject
*Qt_NewMovieFromScrap(_self
, _args
)
5856 PyObject
*_res
= NULL
;
5859 if (!PyArg_ParseTuple(_args
, "l",
5862 _rv
= NewMovieFromScrap(newMovieFlags
);
5863 _res
= Py_BuildValue("O&",
5868 static PyObject
*Qt_NewTimeBase(_self
, _args
)
5872 PyObject
*_res
= NULL
;
5874 if (!PyArg_ParseTuple(_args
, ""))
5876 _rv
= NewTimeBase();
5877 _res
= Py_BuildValue("O&",
5878 TimeBaseObj_New
, _rv
);
5882 static PyObject
*Qt_AlignWindow(_self
, _args
)
5886 PyObject
*_res
= NULL
;
5889 if (!PyArg_ParseTuple(_args
, "O&b",
5890 WinObj_Convert
, &wp
,
5896 (ICMAlignmentProcRecordPtr
)0);
5902 static PyObject
*Qt_DragAlignedWindow(_self
, _args
)
5906 PyObject
*_res
= NULL
;
5910 if (!PyArg_ParseTuple(_args
, "O&O&O&",
5911 WinObj_Convert
, &wp
,
5912 PyMac_GetPoint
, &startPt
,
5913 PyMac_GetRect
, &boundsRect
))
5915 DragAlignedWindow(wp
,
5919 (ICMAlignmentProcRecordPtr
)0);
5925 static PyMethodDef Qt_methods
[] = {
5926 {"EnterMovies", (PyCFunction
)Qt_EnterMovies
, 1,
5928 {"ExitMovies", (PyCFunction
)Qt_ExitMovies
, 1,
5930 {"GetMoviesError", (PyCFunction
)Qt_GetMoviesError
, 1,
5932 {"ClearMoviesStickyError", (PyCFunction
)Qt_ClearMoviesStickyError
, 1,
5934 {"GetMoviesStickyError", (PyCFunction
)Qt_GetMoviesStickyError
, 1,
5936 {"DisposeMatte", (PyCFunction
)Qt_DisposeMatte
, 1,
5937 "(PixMapHandle theMatte) -> None"},
5938 {"NewMovie", (PyCFunction
)Qt_NewMovie
, 1,
5939 "(long flags) -> (Movie _rv)"},
5940 {"GetDataHandler", (PyCFunction
)Qt_GetDataHandler
, 1,
5941 "(Handle dataRef, OSType dataHandlerSubType, long flags) -> (Component _rv)"},
5942 {"PasteHandleIntoMovie", (PyCFunction
)Qt_PasteHandleIntoMovie
, 1,
5943 "(Handle h, OSType handleType, Movie theMovie, long flags, ComponentInstance userComp) -> None"},
5944 {"TrackTimeToMediaTime", (PyCFunction
)Qt_TrackTimeToMediaTime
, 1,
5945 "(TimeValue value, Track theTrack) -> (TimeValue _rv)"},
5946 {"NewUserData", (PyCFunction
)Qt_NewUserData
, 1,
5947 "() -> (UserData theUserData)"},
5948 {"NewUserDataFromHandle", (PyCFunction
)Qt_NewUserDataFromHandle
, 1,
5949 "(Handle h) -> (UserData theUserData)"},
5950 {"CreateMovieFile", (PyCFunction
)Qt_CreateMovieFile
, 1,
5951 "(FSSpec fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (short resRefNum, Movie newmovie)"},
5952 {"OpenMovieFile", (PyCFunction
)Qt_OpenMovieFile
, 1,
5953 "(FSSpec fileSpec, SInt8 permission) -> (short resRefNum)"},
5954 {"CloseMovieFile", (PyCFunction
)Qt_CloseMovieFile
, 1,
5955 "(short resRefNum) -> None"},
5956 {"DeleteMovieFile", (PyCFunction
)Qt_DeleteMovieFile
, 1,
5957 "(FSSpec fileSpec) -> None"},
5958 {"NewMovieFromFile", (PyCFunction
)Qt_NewMovieFromFile
, 1,
5959 "(short resRefNum, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
5960 {"NewMovieFromHandle", (PyCFunction
)Qt_NewMovieFromHandle
, 1,
5961 "(Handle h, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
5962 {"NewMovieFromDataFork", (PyCFunction
)Qt_NewMovieFromDataFork
, 1,
5963 "(short fRefNum, long fileOffset, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
5964 {"RemoveMovieResource", (PyCFunction
)Qt_RemoveMovieResource
, 1,
5965 "(short resRefNum, short resId) -> None"},
5966 {"GetVideoMediaGraphicsMode", (PyCFunction
)Qt_GetVideoMediaGraphicsMode
, 1,
5967 "(MediaHandler mh) -> (HandlerError _rv, long graphicsMode, RGBColor opColor)"},
5968 {"SetVideoMediaGraphicsMode", (PyCFunction
)Qt_SetVideoMediaGraphicsMode
, 1,
5969 "(MediaHandler mh, long graphicsMode, RGBColor opColor) -> (HandlerError _rv)"},
5970 {"GetSoundMediaBalance", (PyCFunction
)Qt_GetSoundMediaBalance
, 1,
5971 "(MediaHandler mh) -> (HandlerError _rv, short balance)"},
5972 {"SetSoundMediaBalance", (PyCFunction
)Qt_SetSoundMediaBalance
, 1,
5973 "(MediaHandler mh, short balance) -> (HandlerError _rv)"},
5974 {"FindNextText", (PyCFunction
)Qt_FindNextText
, 1,
5975 "(MediaHandler mh, Ptr text, long size, short findFlags, TimeValue startTime) -> (ComponentResult _rv, TimeValue foundTime, TimeValue foundDuration, long offset)"},
5976 {"NewMovieFromScrap", (PyCFunction
)Qt_NewMovieFromScrap
, 1,
5977 "(long newMovieFlags) -> (Movie _rv)"},
5978 {"NewTimeBase", (PyCFunction
)Qt_NewTimeBase
, 1,
5979 "() -> (TimeBase _rv)"},
5980 {"AlignWindow", (PyCFunction
)Qt_AlignWindow
, 1,
5981 "(WindowPtr wp, Boolean front) -> None"},
5982 {"DragAlignedWindow", (PyCFunction
)Qt_DragAlignedWindow
, 1,
5983 "(WindowPtr wp, Point startPt, Rect boundsRect) -> None"},
5998 m
= Py_InitModule("Qt", Qt_methods
);
5999 d
= PyModule_GetDict(m
);
6000 Qt_Error
= PyMac_GetOSErrException();
6001 if (Qt_Error
== NULL
||
6002 PyDict_SetItemString(d
, "Error", Qt_Error
) != 0)
6003 Py_FatalError("can't initialize Qt.Error");
6006 /* ========================= End module Qt ========================== */