This commit was manufactured by cvs2svn to create tag 'r212'.
[python/dscho.git] / Mac / Modules / qt / Qtmodule.c
blob12c67cafd3b8d794fd878a7e1ac8eab6438cbeaf
2 /* =========================== Module Qt ============================ */
4 #include "Python.h"
8 #include "macglue.h"
9 #include "pymactoolbox.h"
11 #ifdef WITHOUT_FRAMEWORKS
12 #include <Movies.h>
13 #else
14 /* #include <Carbon/Carbon.h> */
15 #include <QuickTime/QuickTime.h>
16 #endif
19 #ifdef USE_TOOLBOX_OBJECT_GLUE
20 extern PyObject *_TrackObj_New(Track);
21 extern int _TrackObj_Convert(PyObject *, Track *);
22 extern PyObject *_MovieObj_New(Movie);
23 extern int _MovieObj_Convert(PyObject *, Movie *);
24 extern PyObject *_MovieCtlObj_New(MovieController);
25 extern int _MovieCtlObj_Convert(PyObject *, MovieController *);
26 extern PyObject *_TimeBaseObj_New(TimeBase);
27 extern int _TimeBaseObj_Convert(PyObject *, TimeBase *);
28 extern PyObject *_UserDataObj_New(UserData);
29 extern int _UserDataObj_Convert(PyObject *, UserData *);
30 extern PyObject *_MediaObj_New(Media);
31 extern int _MediaObj_Convert(PyObject *, Media *);
33 #define TrackObj_New _TrackObj_New
34 #define TrackObj_Convert _TrackObj_Convert
35 #define MovieObj_New _MovieObj_New
36 #define MovieObj_Convert _MovieObj_Convert
37 #define MovieCtlObj_New _MovieCtlObj_New
38 #define MovieCtlObj_Convert _MovieCtlObj_Convert
39 #define TimeBaseObj_New _TimeBaseObj_New
40 #define TimeBaseObj_Convert _TimeBaseObj_Convert
41 #define UserDataObj_New _UserDataObj_New
42 #define UserDataObj_Convert _UserDataObj_Convert
43 #define MediaObj_New _MediaObj_New
44 #define MediaObj_Convert _MediaObj_Convert
45 #endif
47 /* Macro to allow us to GetNextInterestingTime without duration */
48 #define GetMediaNextInterestingTimeOnly(media, flags, time, rate, rv) GetMediaNextInterestingTime(media, flags, time, rate, rv, NULL)
51 ** Parse/generate time records
53 static PyObject *
54 QtTimeRecord_New(TimeRecord *itself)
56 if (itself->base)
57 return Py_BuildValue("O&lO&", PyMac_Buildwide, &itself->value, itself->scale,
58 TimeBaseObj_New, itself->base);
59 else
60 return Py_BuildValue("O&lO", PyMac_Buildwide, &itself->value, itself->scale,
61 Py_None);
64 static int
65 QtTimeRecord_Convert(PyObject *v, TimeRecord *p_itself)
67 PyObject *base = NULL;
68 if( !PyArg_ParseTuple(v, "O&l|O", PyMac_Getwide, &p_itself->value, &p_itself->scale,
69 &base) )
70 return 0;
71 if ( base == NULL || base == Py_None )
72 p_itself->base = NULL;
73 else
74 if ( !TimeBaseObj_Convert(base, &p_itself->base) )
75 return 0;
76 return 1;
82 static PyObject *Qt_Error;
84 /* ------------------ Object type MovieController ------------------- */
86 PyTypeObject MovieController_Type;
88 #define MovieCtlObj_Check(x) ((x)->ob_type == &MovieController_Type)
90 typedef struct MovieControllerObject {
91 PyObject_HEAD
92 MovieController ob_itself;
93 } MovieControllerObject;
95 PyObject *MovieCtlObj_New(MovieController itself)
97 MovieControllerObject *it;
98 if (itself == NULL) {
99 PyErr_SetString(Qt_Error,"Cannot create null MovieController");
100 return NULL;
102 it = PyObject_NEW(MovieControllerObject, &MovieController_Type);
103 if (it == NULL) return NULL;
104 it->ob_itself = itself;
105 return (PyObject *)it;
107 MovieCtlObj_Convert(PyObject *v, MovieController *p_itself)
109 if (!MovieCtlObj_Check(v))
111 PyErr_SetString(PyExc_TypeError, "MovieController required");
112 return 0;
114 *p_itself = ((MovieControllerObject *)v)->ob_itself;
115 return 1;
118 static void MovieCtlObj_dealloc(MovieControllerObject *self)
120 DisposeMovieController(self->ob_itself);
121 PyMem_DEL(self);
124 static PyObject *MovieCtlObj_MCSetMovie(MovieControllerObject *_self, PyObject *_args)
126 PyObject *_res = NULL;
127 ComponentResult _rv;
128 Movie theMovie;
129 WindowPtr movieWindow;
130 Point where;
131 if (!PyArg_ParseTuple(_args, "O&O&O&",
132 MovieObj_Convert, &theMovie,
133 WinObj_Convert, &movieWindow,
134 PyMac_GetPoint, &where))
135 return NULL;
136 _rv = MCSetMovie(_self->ob_itself,
137 theMovie,
138 movieWindow,
139 where);
140 _res = Py_BuildValue("l",
141 _rv);
142 return _res;
145 static PyObject *MovieCtlObj_MCGetIndMovie(MovieControllerObject *_self, PyObject *_args)
147 PyObject *_res = NULL;
148 Movie _rv;
149 short index;
150 if (!PyArg_ParseTuple(_args, "h",
151 &index))
152 return NULL;
153 _rv = MCGetIndMovie(_self->ob_itself,
154 index);
155 _res = Py_BuildValue("O&",
156 MovieObj_New, _rv);
157 return _res;
160 static PyObject *MovieCtlObj_MCRemoveAllMovies(MovieControllerObject *_self, PyObject *_args)
162 PyObject *_res = NULL;
163 ComponentResult _rv;
164 if (!PyArg_ParseTuple(_args, ""))
165 return NULL;
166 _rv = MCRemoveAllMovies(_self->ob_itself);
167 _res = Py_BuildValue("l",
168 _rv);
169 return _res;
172 static PyObject *MovieCtlObj_MCRemoveAMovie(MovieControllerObject *_self, PyObject *_args)
174 PyObject *_res = NULL;
175 ComponentResult _rv;
176 Movie m;
177 if (!PyArg_ParseTuple(_args, "O&",
178 MovieObj_Convert, &m))
179 return NULL;
180 _rv = MCRemoveAMovie(_self->ob_itself,
182 _res = Py_BuildValue("l",
183 _rv);
184 return _res;
187 static PyObject *MovieCtlObj_MCRemoveMovie(MovieControllerObject *_self, PyObject *_args)
189 PyObject *_res = NULL;
190 ComponentResult _rv;
191 if (!PyArg_ParseTuple(_args, ""))
192 return NULL;
193 _rv = MCRemoveMovie(_self->ob_itself);
194 _res = Py_BuildValue("l",
195 _rv);
196 return _res;
199 static PyObject *MovieCtlObj_MCIsPlayerEvent(MovieControllerObject *_self, PyObject *_args)
201 PyObject *_res = NULL;
202 ComponentResult _rv;
203 EventRecord e;
204 if (!PyArg_ParseTuple(_args, "O&",
205 PyMac_GetEventRecord, &e))
206 return NULL;
207 _rv = MCIsPlayerEvent(_self->ob_itself,
208 &e);
209 _res = Py_BuildValue("l",
210 _rv);
211 return _res;
214 static PyObject *MovieCtlObj_MCDoAction(MovieControllerObject *_self, PyObject *_args)
216 PyObject *_res = NULL;
217 ComponentResult _rv;
218 short action;
219 void * params;
220 if (!PyArg_ParseTuple(_args, "hs",
221 &action,
222 &params))
223 return NULL;
224 _rv = MCDoAction(_self->ob_itself,
225 action,
226 params);
227 _res = Py_BuildValue("l",
228 _rv);
229 return _res;
232 static PyObject *MovieCtlObj_MCSetControllerAttached(MovieControllerObject *_self, PyObject *_args)
234 PyObject *_res = NULL;
235 ComponentResult _rv;
236 Boolean attach;
237 if (!PyArg_ParseTuple(_args, "b",
238 &attach))
239 return NULL;
240 _rv = MCSetControllerAttached(_self->ob_itself,
241 attach);
242 _res = Py_BuildValue("l",
243 _rv);
244 return _res;
247 static PyObject *MovieCtlObj_MCIsControllerAttached(MovieControllerObject *_self, PyObject *_args)
249 PyObject *_res = NULL;
250 ComponentResult _rv;
251 if (!PyArg_ParseTuple(_args, ""))
252 return NULL;
253 _rv = MCIsControllerAttached(_self->ob_itself);
254 _res = Py_BuildValue("l",
255 _rv);
256 return _res;
259 static PyObject *MovieCtlObj_MCSetControllerPort(MovieControllerObject *_self, PyObject *_args)
261 PyObject *_res = NULL;
262 ComponentResult _rv;
263 CGrafPtr gp;
264 if (!PyArg_ParseTuple(_args, "O&",
265 GrafObj_Convert, &gp))
266 return NULL;
267 _rv = MCSetControllerPort(_self->ob_itself,
268 gp);
269 _res = Py_BuildValue("l",
270 _rv);
271 return _res;
274 static PyObject *MovieCtlObj_MCGetControllerPort(MovieControllerObject *_self, PyObject *_args)
276 PyObject *_res = NULL;
277 CGrafPtr _rv;
278 if (!PyArg_ParseTuple(_args, ""))
279 return NULL;
280 _rv = MCGetControllerPort(_self->ob_itself);
281 _res = Py_BuildValue("O&",
282 GrafObj_New, _rv);
283 return _res;
286 static PyObject *MovieCtlObj_MCSetVisible(MovieControllerObject *_self, PyObject *_args)
288 PyObject *_res = NULL;
289 ComponentResult _rv;
290 Boolean visible;
291 if (!PyArg_ParseTuple(_args, "b",
292 &visible))
293 return NULL;
294 _rv = MCSetVisible(_self->ob_itself,
295 visible);
296 _res = Py_BuildValue("l",
297 _rv);
298 return _res;
301 static PyObject *MovieCtlObj_MCGetVisible(MovieControllerObject *_self, PyObject *_args)
303 PyObject *_res = NULL;
304 ComponentResult _rv;
305 if (!PyArg_ParseTuple(_args, ""))
306 return NULL;
307 _rv = MCGetVisible(_self->ob_itself);
308 _res = Py_BuildValue("l",
309 _rv);
310 return _res;
313 static PyObject *MovieCtlObj_MCGetControllerBoundsRect(MovieControllerObject *_self, PyObject *_args)
315 PyObject *_res = NULL;
316 ComponentResult _rv;
317 Rect bounds;
318 if (!PyArg_ParseTuple(_args, ""))
319 return NULL;
320 _rv = MCGetControllerBoundsRect(_self->ob_itself,
321 &bounds);
322 _res = Py_BuildValue("lO&",
323 _rv,
324 PyMac_BuildRect, &bounds);
325 return _res;
328 static PyObject *MovieCtlObj_MCSetControllerBoundsRect(MovieControllerObject *_self, PyObject *_args)
330 PyObject *_res = NULL;
331 ComponentResult _rv;
332 Rect bounds;
333 if (!PyArg_ParseTuple(_args, "O&",
334 PyMac_GetRect, &bounds))
335 return NULL;
336 _rv = MCSetControllerBoundsRect(_self->ob_itself,
337 &bounds);
338 _res = Py_BuildValue("l",
339 _rv);
340 return _res;
343 static PyObject *MovieCtlObj_MCGetControllerBoundsRgn(MovieControllerObject *_self, PyObject *_args)
345 PyObject *_res = NULL;
346 RgnHandle _rv;
347 if (!PyArg_ParseTuple(_args, ""))
348 return NULL;
349 _rv = MCGetControllerBoundsRgn(_self->ob_itself);
350 _res = Py_BuildValue("O&",
351 ResObj_New, _rv);
352 return _res;
355 static PyObject *MovieCtlObj_MCGetWindowRgn(MovieControllerObject *_self, PyObject *_args)
357 PyObject *_res = NULL;
358 RgnHandle _rv;
359 WindowPtr w;
360 if (!PyArg_ParseTuple(_args, "O&",
361 WinObj_Convert, &w))
362 return NULL;
363 _rv = MCGetWindowRgn(_self->ob_itself,
365 _res = Py_BuildValue("O&",
366 ResObj_New, _rv);
367 return _res;
370 static PyObject *MovieCtlObj_MCMovieChanged(MovieControllerObject *_self, PyObject *_args)
372 PyObject *_res = NULL;
373 ComponentResult _rv;
374 Movie m;
375 if (!PyArg_ParseTuple(_args, "O&",
376 MovieObj_Convert, &m))
377 return NULL;
378 _rv = MCMovieChanged(_self->ob_itself,
380 _res = Py_BuildValue("l",
381 _rv);
382 return _res;
385 static PyObject *MovieCtlObj_MCSetDuration(MovieControllerObject *_self, PyObject *_args)
387 PyObject *_res = NULL;
388 ComponentResult _rv;
389 TimeValue duration;
390 if (!PyArg_ParseTuple(_args, "l",
391 &duration))
392 return NULL;
393 _rv = MCSetDuration(_self->ob_itself,
394 duration);
395 _res = Py_BuildValue("l",
396 _rv);
397 return _res;
400 static PyObject *MovieCtlObj_MCGetCurrentTime(MovieControllerObject *_self, PyObject *_args)
402 PyObject *_res = NULL;
403 TimeValue _rv;
404 TimeScale scale;
405 if (!PyArg_ParseTuple(_args, ""))
406 return NULL;
407 _rv = MCGetCurrentTime(_self->ob_itself,
408 &scale);
409 _res = Py_BuildValue("ll",
410 _rv,
411 scale);
412 return _res;
415 static PyObject *MovieCtlObj_MCNewAttachedController(MovieControllerObject *_self, PyObject *_args)
417 PyObject *_res = NULL;
418 ComponentResult _rv;
419 Movie theMovie;
420 WindowPtr w;
421 Point where;
422 if (!PyArg_ParseTuple(_args, "O&O&O&",
423 MovieObj_Convert, &theMovie,
424 WinObj_Convert, &w,
425 PyMac_GetPoint, &where))
426 return NULL;
427 _rv = MCNewAttachedController(_self->ob_itself,
428 theMovie,
430 where);
431 _res = Py_BuildValue("l",
432 _rv);
433 return _res;
436 static PyObject *MovieCtlObj_MCDraw(MovieControllerObject *_self, PyObject *_args)
438 PyObject *_res = NULL;
439 ComponentResult _rv;
440 WindowPtr w;
441 if (!PyArg_ParseTuple(_args, "O&",
442 WinObj_Convert, &w))
443 return NULL;
444 _rv = MCDraw(_self->ob_itself,
446 _res = Py_BuildValue("l",
447 _rv);
448 return _res;
451 static PyObject *MovieCtlObj_MCActivate(MovieControllerObject *_self, PyObject *_args)
453 PyObject *_res = NULL;
454 ComponentResult _rv;
455 WindowPtr w;
456 Boolean activate;
457 if (!PyArg_ParseTuple(_args, "O&b",
458 WinObj_Convert, &w,
459 &activate))
460 return NULL;
461 _rv = MCActivate(_self->ob_itself,
463 activate);
464 _res = Py_BuildValue("l",
465 _rv);
466 return _res;
469 static PyObject *MovieCtlObj_MCIdle(MovieControllerObject *_self, PyObject *_args)
471 PyObject *_res = NULL;
472 ComponentResult _rv;
473 if (!PyArg_ParseTuple(_args, ""))
474 return NULL;
475 _rv = MCIdle(_self->ob_itself);
476 _res = Py_BuildValue("l",
477 _rv);
478 return _res;
481 static PyObject *MovieCtlObj_MCKey(MovieControllerObject *_self, PyObject *_args)
483 PyObject *_res = NULL;
484 ComponentResult _rv;
485 SInt8 key;
486 long modifiers;
487 if (!PyArg_ParseTuple(_args, "bl",
488 &key,
489 &modifiers))
490 return NULL;
491 _rv = MCKey(_self->ob_itself,
492 key,
493 modifiers);
494 _res = Py_BuildValue("l",
495 _rv);
496 return _res;
499 static PyObject *MovieCtlObj_MCClick(MovieControllerObject *_self, PyObject *_args)
501 PyObject *_res = NULL;
502 ComponentResult _rv;
503 WindowPtr w;
504 Point where;
505 long when;
506 long modifiers;
507 if (!PyArg_ParseTuple(_args, "O&O&ll",
508 WinObj_Convert, &w,
509 PyMac_GetPoint, &where,
510 &when,
511 &modifiers))
512 return NULL;
513 _rv = MCClick(_self->ob_itself,
515 where,
516 when,
517 modifiers);
518 _res = Py_BuildValue("l",
519 _rv);
520 return _res;
523 static PyObject *MovieCtlObj_MCEnableEditing(MovieControllerObject *_self, PyObject *_args)
525 PyObject *_res = NULL;
526 ComponentResult _rv;
527 Boolean enabled;
528 if (!PyArg_ParseTuple(_args, "b",
529 &enabled))
530 return NULL;
531 _rv = MCEnableEditing(_self->ob_itself,
532 enabled);
533 _res = Py_BuildValue("l",
534 _rv);
535 return _res;
538 static PyObject *MovieCtlObj_MCIsEditingEnabled(MovieControllerObject *_self, PyObject *_args)
540 PyObject *_res = NULL;
541 long _rv;
542 if (!PyArg_ParseTuple(_args, ""))
543 return NULL;
544 _rv = MCIsEditingEnabled(_self->ob_itself);
545 _res = Py_BuildValue("l",
546 _rv);
547 return _res;
550 static PyObject *MovieCtlObj_MCCopy(MovieControllerObject *_self, PyObject *_args)
552 PyObject *_res = NULL;
553 Movie _rv;
554 if (!PyArg_ParseTuple(_args, ""))
555 return NULL;
556 _rv = MCCopy(_self->ob_itself);
557 _res = Py_BuildValue("O&",
558 MovieObj_New, _rv);
559 return _res;
562 static PyObject *MovieCtlObj_MCCut(MovieControllerObject *_self, PyObject *_args)
564 PyObject *_res = NULL;
565 Movie _rv;
566 if (!PyArg_ParseTuple(_args, ""))
567 return NULL;
568 _rv = MCCut(_self->ob_itself);
569 _res = Py_BuildValue("O&",
570 MovieObj_New, _rv);
571 return _res;
574 static PyObject *MovieCtlObj_MCPaste(MovieControllerObject *_self, PyObject *_args)
576 PyObject *_res = NULL;
577 ComponentResult _rv;
578 Movie srcMovie;
579 if (!PyArg_ParseTuple(_args, "O&",
580 MovieObj_Convert, &srcMovie))
581 return NULL;
582 _rv = MCPaste(_self->ob_itself,
583 srcMovie);
584 _res = Py_BuildValue("l",
585 _rv);
586 return _res;
589 static PyObject *MovieCtlObj_MCClear(MovieControllerObject *_self, PyObject *_args)
591 PyObject *_res = NULL;
592 ComponentResult _rv;
593 if (!PyArg_ParseTuple(_args, ""))
594 return NULL;
595 _rv = MCClear(_self->ob_itself);
596 _res = Py_BuildValue("l",
597 _rv);
598 return _res;
601 static PyObject *MovieCtlObj_MCUndo(MovieControllerObject *_self, PyObject *_args)
603 PyObject *_res = NULL;
604 ComponentResult _rv;
605 if (!PyArg_ParseTuple(_args, ""))
606 return NULL;
607 _rv = MCUndo(_self->ob_itself);
608 _res = Py_BuildValue("l",
609 _rv);
610 return _res;
613 static PyObject *MovieCtlObj_MCPositionController(MovieControllerObject *_self, PyObject *_args)
615 PyObject *_res = NULL;
616 ComponentResult _rv;
617 Rect movieRect;
618 Rect controllerRect;
619 long someFlags;
620 if (!PyArg_ParseTuple(_args, "O&O&l",
621 PyMac_GetRect, &movieRect,
622 PyMac_GetRect, &controllerRect,
623 &someFlags))
624 return NULL;
625 _rv = MCPositionController(_self->ob_itself,
626 &movieRect,
627 &controllerRect,
628 someFlags);
629 _res = Py_BuildValue("l",
630 _rv);
631 return _res;
634 static PyObject *MovieCtlObj_MCGetControllerInfo(MovieControllerObject *_self, PyObject *_args)
636 PyObject *_res = NULL;
637 ComponentResult _rv;
638 long someFlags;
639 if (!PyArg_ParseTuple(_args, ""))
640 return NULL;
641 _rv = MCGetControllerInfo(_self->ob_itself,
642 &someFlags);
643 _res = Py_BuildValue("ll",
644 _rv,
645 someFlags);
646 return _res;
649 static PyObject *MovieCtlObj_MCSetClip(MovieControllerObject *_self, PyObject *_args)
651 PyObject *_res = NULL;
652 ComponentResult _rv;
653 RgnHandle theClip;
654 RgnHandle movieClip;
655 if (!PyArg_ParseTuple(_args, "O&O&",
656 ResObj_Convert, &theClip,
657 ResObj_Convert, &movieClip))
658 return NULL;
659 _rv = MCSetClip(_self->ob_itself,
660 theClip,
661 movieClip);
662 _res = Py_BuildValue("l",
663 _rv);
664 return _res;
667 static PyObject *MovieCtlObj_MCGetClip(MovieControllerObject *_self, PyObject *_args)
669 PyObject *_res = NULL;
670 ComponentResult _rv;
671 RgnHandle theClip;
672 RgnHandle movieClip;
673 if (!PyArg_ParseTuple(_args, ""))
674 return NULL;
675 _rv = MCGetClip(_self->ob_itself,
676 &theClip,
677 &movieClip);
678 _res = Py_BuildValue("lO&O&",
679 _rv,
680 ResObj_New, theClip,
681 ResObj_New, movieClip);
682 return _res;
685 static PyObject *MovieCtlObj_MCDrawBadge(MovieControllerObject *_self, PyObject *_args)
687 PyObject *_res = NULL;
688 ComponentResult _rv;
689 RgnHandle movieRgn;
690 RgnHandle badgeRgn;
691 if (!PyArg_ParseTuple(_args, "O&",
692 ResObj_Convert, &movieRgn))
693 return NULL;
694 _rv = MCDrawBadge(_self->ob_itself,
695 movieRgn,
696 &badgeRgn);
697 _res = Py_BuildValue("lO&",
698 _rv,
699 ResObj_New, badgeRgn);
700 return _res;
703 static PyObject *MovieCtlObj_MCSetUpEditMenu(MovieControllerObject *_self, PyObject *_args)
705 PyObject *_res = NULL;
706 ComponentResult _rv;
707 long modifiers;
708 MenuHandle mh;
709 if (!PyArg_ParseTuple(_args, "lO&",
710 &modifiers,
711 MenuObj_Convert, &mh))
712 return NULL;
713 _rv = MCSetUpEditMenu(_self->ob_itself,
714 modifiers,
715 mh);
716 _res = Py_BuildValue("l",
717 _rv);
718 return _res;
721 static PyObject *MovieCtlObj_MCGetMenuString(MovieControllerObject *_self, PyObject *_args)
723 PyObject *_res = NULL;
724 ComponentResult _rv;
725 long modifiers;
726 short item;
727 Str255 aString;
728 if (!PyArg_ParseTuple(_args, "lhO&",
729 &modifiers,
730 &item,
731 PyMac_GetStr255, aString))
732 return NULL;
733 _rv = MCGetMenuString(_self->ob_itself,
734 modifiers,
735 item,
736 aString);
737 _res = Py_BuildValue("l",
738 _rv);
739 return _res;
742 static PyObject *MovieCtlObj_MCPtInController(MovieControllerObject *_self, PyObject *_args)
744 PyObject *_res = NULL;
745 ComponentResult _rv;
746 Point thePt;
747 Boolean inController;
748 if (!PyArg_ParseTuple(_args, "O&",
749 PyMac_GetPoint, &thePt))
750 return NULL;
751 _rv = MCPtInController(_self->ob_itself,
752 thePt,
753 &inController);
754 _res = Py_BuildValue("lb",
755 _rv,
756 inController);
757 return _res;
760 static PyObject *MovieCtlObj_MCInvalidate(MovieControllerObject *_self, PyObject *_args)
762 PyObject *_res = NULL;
763 ComponentResult _rv;
764 WindowPtr w;
765 RgnHandle invalidRgn;
766 if (!PyArg_ParseTuple(_args, "O&O&",
767 WinObj_Convert, &w,
768 ResObj_Convert, &invalidRgn))
769 return NULL;
770 _rv = MCInvalidate(_self->ob_itself,
772 invalidRgn);
773 _res = Py_BuildValue("l",
774 _rv);
775 return _res;
778 static PyObject *MovieCtlObj_MCAdjustCursor(MovieControllerObject *_self, PyObject *_args)
780 PyObject *_res = NULL;
781 ComponentResult _rv;
782 WindowPtr w;
783 Point where;
784 long modifiers;
785 if (!PyArg_ParseTuple(_args, "O&O&l",
786 WinObj_Convert, &w,
787 PyMac_GetPoint, &where,
788 &modifiers))
789 return NULL;
790 _rv = MCAdjustCursor(_self->ob_itself,
792 where,
793 modifiers);
794 _res = Py_BuildValue("l",
795 _rv);
796 return _res;
799 static PyObject *MovieCtlObj_MCGetInterfaceElement(MovieControllerObject *_self, PyObject *_args)
801 PyObject *_res = NULL;
802 ComponentResult _rv;
803 MCInterfaceElement whichElement;
804 void * element;
805 if (!PyArg_ParseTuple(_args, "ls",
806 &whichElement,
807 &element))
808 return NULL;
809 _rv = MCGetInterfaceElement(_self->ob_itself,
810 whichElement,
811 element);
812 _res = Py_BuildValue("l",
813 _rv);
814 return _res;
817 static PyMethodDef MovieCtlObj_methods[] = {
818 {"MCSetMovie", (PyCFunction)MovieCtlObj_MCSetMovie, 1,
819 "(Movie theMovie, WindowPtr movieWindow, Point where) -> (ComponentResult _rv)"},
820 {"MCGetIndMovie", (PyCFunction)MovieCtlObj_MCGetIndMovie, 1,
821 "(short index) -> (Movie _rv)"},
822 {"MCRemoveAllMovies", (PyCFunction)MovieCtlObj_MCRemoveAllMovies, 1,
823 "() -> (ComponentResult _rv)"},
824 {"MCRemoveAMovie", (PyCFunction)MovieCtlObj_MCRemoveAMovie, 1,
825 "(Movie m) -> (ComponentResult _rv)"},
826 {"MCRemoveMovie", (PyCFunction)MovieCtlObj_MCRemoveMovie, 1,
827 "() -> (ComponentResult _rv)"},
828 {"MCIsPlayerEvent", (PyCFunction)MovieCtlObj_MCIsPlayerEvent, 1,
829 "(EventRecord e) -> (ComponentResult _rv)"},
830 {"MCDoAction", (PyCFunction)MovieCtlObj_MCDoAction, 1,
831 "(short action, void * params) -> (ComponentResult _rv)"},
832 {"MCSetControllerAttached", (PyCFunction)MovieCtlObj_MCSetControllerAttached, 1,
833 "(Boolean attach) -> (ComponentResult _rv)"},
834 {"MCIsControllerAttached", (PyCFunction)MovieCtlObj_MCIsControllerAttached, 1,
835 "() -> (ComponentResult _rv)"},
836 {"MCSetControllerPort", (PyCFunction)MovieCtlObj_MCSetControllerPort, 1,
837 "(CGrafPtr gp) -> (ComponentResult _rv)"},
838 {"MCGetControllerPort", (PyCFunction)MovieCtlObj_MCGetControllerPort, 1,
839 "() -> (CGrafPtr _rv)"},
840 {"MCSetVisible", (PyCFunction)MovieCtlObj_MCSetVisible, 1,
841 "(Boolean visible) -> (ComponentResult _rv)"},
842 {"MCGetVisible", (PyCFunction)MovieCtlObj_MCGetVisible, 1,
843 "() -> (ComponentResult _rv)"},
844 {"MCGetControllerBoundsRect", (PyCFunction)MovieCtlObj_MCGetControllerBoundsRect, 1,
845 "() -> (ComponentResult _rv, Rect bounds)"},
846 {"MCSetControllerBoundsRect", (PyCFunction)MovieCtlObj_MCSetControllerBoundsRect, 1,
847 "(Rect bounds) -> (ComponentResult _rv)"},
848 {"MCGetControllerBoundsRgn", (PyCFunction)MovieCtlObj_MCGetControllerBoundsRgn, 1,
849 "() -> (RgnHandle _rv)"},
850 {"MCGetWindowRgn", (PyCFunction)MovieCtlObj_MCGetWindowRgn, 1,
851 "(WindowPtr w) -> (RgnHandle _rv)"},
852 {"MCMovieChanged", (PyCFunction)MovieCtlObj_MCMovieChanged, 1,
853 "(Movie m) -> (ComponentResult _rv)"},
854 {"MCSetDuration", (PyCFunction)MovieCtlObj_MCSetDuration, 1,
855 "(TimeValue duration) -> (ComponentResult _rv)"},
856 {"MCGetCurrentTime", (PyCFunction)MovieCtlObj_MCGetCurrentTime, 1,
857 "() -> (TimeValue _rv, TimeScale scale)"},
858 {"MCNewAttachedController", (PyCFunction)MovieCtlObj_MCNewAttachedController, 1,
859 "(Movie theMovie, WindowPtr w, Point where) -> (ComponentResult _rv)"},
860 {"MCDraw", (PyCFunction)MovieCtlObj_MCDraw, 1,
861 "(WindowPtr w) -> (ComponentResult _rv)"},
862 {"MCActivate", (PyCFunction)MovieCtlObj_MCActivate, 1,
863 "(WindowPtr w, Boolean activate) -> (ComponentResult _rv)"},
864 {"MCIdle", (PyCFunction)MovieCtlObj_MCIdle, 1,
865 "() -> (ComponentResult _rv)"},
866 {"MCKey", (PyCFunction)MovieCtlObj_MCKey, 1,
867 "(SInt8 key, long modifiers) -> (ComponentResult _rv)"},
868 {"MCClick", (PyCFunction)MovieCtlObj_MCClick, 1,
869 "(WindowPtr w, Point where, long when, long modifiers) -> (ComponentResult _rv)"},
870 {"MCEnableEditing", (PyCFunction)MovieCtlObj_MCEnableEditing, 1,
871 "(Boolean enabled) -> (ComponentResult _rv)"},
872 {"MCIsEditingEnabled", (PyCFunction)MovieCtlObj_MCIsEditingEnabled, 1,
873 "() -> (long _rv)"},
874 {"MCCopy", (PyCFunction)MovieCtlObj_MCCopy, 1,
875 "() -> (Movie _rv)"},
876 {"MCCut", (PyCFunction)MovieCtlObj_MCCut, 1,
877 "() -> (Movie _rv)"},
878 {"MCPaste", (PyCFunction)MovieCtlObj_MCPaste, 1,
879 "(Movie srcMovie) -> (ComponentResult _rv)"},
880 {"MCClear", (PyCFunction)MovieCtlObj_MCClear, 1,
881 "() -> (ComponentResult _rv)"},
882 {"MCUndo", (PyCFunction)MovieCtlObj_MCUndo, 1,
883 "() -> (ComponentResult _rv)"},
884 {"MCPositionController", (PyCFunction)MovieCtlObj_MCPositionController, 1,
885 "(Rect movieRect, Rect controllerRect, long someFlags) -> (ComponentResult _rv)"},
886 {"MCGetControllerInfo", (PyCFunction)MovieCtlObj_MCGetControllerInfo, 1,
887 "() -> (ComponentResult _rv, long someFlags)"},
888 {"MCSetClip", (PyCFunction)MovieCtlObj_MCSetClip, 1,
889 "(RgnHandle theClip, RgnHandle movieClip) -> (ComponentResult _rv)"},
890 {"MCGetClip", (PyCFunction)MovieCtlObj_MCGetClip, 1,
891 "() -> (ComponentResult _rv, RgnHandle theClip, RgnHandle movieClip)"},
892 {"MCDrawBadge", (PyCFunction)MovieCtlObj_MCDrawBadge, 1,
893 "(RgnHandle movieRgn) -> (ComponentResult _rv, RgnHandle badgeRgn)"},
894 {"MCSetUpEditMenu", (PyCFunction)MovieCtlObj_MCSetUpEditMenu, 1,
895 "(long modifiers, MenuHandle mh) -> (ComponentResult _rv)"},
896 {"MCGetMenuString", (PyCFunction)MovieCtlObj_MCGetMenuString, 1,
897 "(long modifiers, short item, Str255 aString) -> (ComponentResult _rv)"},
898 {"MCPtInController", (PyCFunction)MovieCtlObj_MCPtInController, 1,
899 "(Point thePt) -> (ComponentResult _rv, Boolean inController)"},
900 {"MCInvalidate", (PyCFunction)MovieCtlObj_MCInvalidate, 1,
901 "(WindowPtr w, RgnHandle invalidRgn) -> (ComponentResult _rv)"},
902 {"MCAdjustCursor", (PyCFunction)MovieCtlObj_MCAdjustCursor, 1,
903 "(WindowPtr w, Point where, long modifiers) -> (ComponentResult _rv)"},
904 {"MCGetInterfaceElement", (PyCFunction)MovieCtlObj_MCGetInterfaceElement, 1,
905 "(MCInterfaceElement whichElement, void * element) -> (ComponentResult _rv)"},
906 {NULL, NULL, 0}
909 PyMethodChain MovieCtlObj_chain = { MovieCtlObj_methods, NULL };
911 static PyObject *MovieCtlObj_getattr(MovieControllerObject *self, char *name)
913 return Py_FindMethodInChain(&MovieCtlObj_chain, (PyObject *)self, name);
916 #define MovieCtlObj_setattr NULL
918 #define MovieCtlObj_compare NULL
920 #define MovieCtlObj_repr NULL
922 #define MovieCtlObj_hash NULL
924 PyTypeObject MovieController_Type = {
925 PyObject_HEAD_INIT(&PyType_Type)
926 0, /*ob_size*/
927 "MovieController", /*tp_name*/
928 sizeof(MovieControllerObject), /*tp_basicsize*/
929 0, /*tp_itemsize*/
930 /* methods */
931 (destructor) MovieCtlObj_dealloc, /*tp_dealloc*/
932 0, /*tp_print*/
933 (getattrfunc) MovieCtlObj_getattr, /*tp_getattr*/
934 (setattrfunc) MovieCtlObj_setattr, /*tp_setattr*/
935 (cmpfunc) MovieCtlObj_compare, /*tp_compare*/
936 (reprfunc) MovieCtlObj_repr, /*tp_repr*/
937 (PyNumberMethods *)0, /* tp_as_number */
938 (PySequenceMethods *)0, /* tp_as_sequence */
939 (PyMappingMethods *)0, /* tp_as_mapping */
940 (hashfunc) MovieCtlObj_hash, /*tp_hash*/
943 /* ---------------- End object type MovieController ----------------- */
946 /* ---------------------- Object type TimeBase ---------------------- */
948 PyTypeObject TimeBase_Type;
950 #define TimeBaseObj_Check(x) ((x)->ob_type == &TimeBase_Type)
952 typedef struct TimeBaseObject {
953 PyObject_HEAD
954 TimeBase ob_itself;
955 } TimeBaseObject;
957 PyObject *TimeBaseObj_New(TimeBase itself)
959 TimeBaseObject *it;
960 if (itself == NULL) {
961 PyErr_SetString(Qt_Error,"Cannot create null TimeBase");
962 return NULL;
964 it = PyObject_NEW(TimeBaseObject, &TimeBase_Type);
965 if (it == NULL) return NULL;
966 it->ob_itself = itself;
967 return (PyObject *)it;
969 TimeBaseObj_Convert(PyObject *v, TimeBase *p_itself)
971 if (!TimeBaseObj_Check(v))
973 PyErr_SetString(PyExc_TypeError, "TimeBase required");
974 return 0;
976 *p_itself = ((TimeBaseObject *)v)->ob_itself;
977 return 1;
980 static void TimeBaseObj_dealloc(TimeBaseObject *self)
982 /* Cleanup of self->ob_itself goes here */
983 PyMem_DEL(self);
986 static PyObject *TimeBaseObj_DisposeTimeBase(TimeBaseObject *_self, PyObject *_args)
988 PyObject *_res = NULL;
989 if (!PyArg_ParseTuple(_args, ""))
990 return NULL;
991 DisposeTimeBase(_self->ob_itself);
992 Py_INCREF(Py_None);
993 _res = Py_None;
994 return _res;
997 static PyObject *TimeBaseObj_GetTimeBaseTime(TimeBaseObject *_self, PyObject *_args)
999 PyObject *_res = NULL;
1000 TimeValue _rv;
1001 TimeScale s;
1002 TimeRecord tr;
1003 if (!PyArg_ParseTuple(_args, "l",
1004 &s))
1005 return NULL;
1006 _rv = GetTimeBaseTime(_self->ob_itself,
1008 &tr);
1009 _res = Py_BuildValue("lO&",
1010 _rv,
1011 QtTimeRecord_New, &tr);
1012 return _res;
1015 static PyObject *TimeBaseObj_SetTimeBaseTime(TimeBaseObject *_self, PyObject *_args)
1017 PyObject *_res = NULL;
1018 TimeRecord tr;
1019 if (!PyArg_ParseTuple(_args, "O&",
1020 QtTimeRecord_Convert, &tr))
1021 return NULL;
1022 SetTimeBaseTime(_self->ob_itself,
1023 &tr);
1024 Py_INCREF(Py_None);
1025 _res = Py_None;
1026 return _res;
1029 static PyObject *TimeBaseObj_SetTimeBaseValue(TimeBaseObject *_self, PyObject *_args)
1031 PyObject *_res = NULL;
1032 TimeValue t;
1033 TimeScale s;
1034 if (!PyArg_ParseTuple(_args, "ll",
1036 &s))
1037 return NULL;
1038 SetTimeBaseValue(_self->ob_itself,
1041 Py_INCREF(Py_None);
1042 _res = Py_None;
1043 return _res;
1046 static PyObject *TimeBaseObj_GetTimeBaseRate(TimeBaseObject *_self, PyObject *_args)
1048 PyObject *_res = NULL;
1049 Fixed _rv;
1050 if (!PyArg_ParseTuple(_args, ""))
1051 return NULL;
1052 _rv = GetTimeBaseRate(_self->ob_itself);
1053 _res = Py_BuildValue("O&",
1054 PyMac_BuildFixed, _rv);
1055 return _res;
1058 static PyObject *TimeBaseObj_SetTimeBaseRate(TimeBaseObject *_self, PyObject *_args)
1060 PyObject *_res = NULL;
1061 Fixed r;
1062 if (!PyArg_ParseTuple(_args, "O&",
1063 PyMac_GetFixed, &r))
1064 return NULL;
1065 SetTimeBaseRate(_self->ob_itself,
1067 Py_INCREF(Py_None);
1068 _res = Py_None;
1069 return _res;
1072 static PyObject *TimeBaseObj_GetTimeBaseStartTime(TimeBaseObject *_self, PyObject *_args)
1074 PyObject *_res = NULL;
1075 TimeValue _rv;
1076 TimeScale s;
1077 TimeRecord tr;
1078 if (!PyArg_ParseTuple(_args, "l",
1079 &s))
1080 return NULL;
1081 _rv = GetTimeBaseStartTime(_self->ob_itself,
1083 &tr);
1084 _res = Py_BuildValue("lO&",
1085 _rv,
1086 QtTimeRecord_New, &tr);
1087 return _res;
1090 static PyObject *TimeBaseObj_SetTimeBaseStartTime(TimeBaseObject *_self, PyObject *_args)
1092 PyObject *_res = NULL;
1093 TimeRecord tr;
1094 if (!PyArg_ParseTuple(_args, "O&",
1095 QtTimeRecord_Convert, &tr))
1096 return NULL;
1097 SetTimeBaseStartTime(_self->ob_itself,
1098 &tr);
1099 Py_INCREF(Py_None);
1100 _res = Py_None;
1101 return _res;
1104 static PyObject *TimeBaseObj_GetTimeBaseStopTime(TimeBaseObject *_self, PyObject *_args)
1106 PyObject *_res = NULL;
1107 TimeValue _rv;
1108 TimeScale s;
1109 TimeRecord tr;
1110 if (!PyArg_ParseTuple(_args, "l",
1111 &s))
1112 return NULL;
1113 _rv = GetTimeBaseStopTime(_self->ob_itself,
1115 &tr);
1116 _res = Py_BuildValue("lO&",
1117 _rv,
1118 QtTimeRecord_New, &tr);
1119 return _res;
1122 static PyObject *TimeBaseObj_SetTimeBaseStopTime(TimeBaseObject *_self, PyObject *_args)
1124 PyObject *_res = NULL;
1125 TimeRecord tr;
1126 if (!PyArg_ParseTuple(_args, "O&",
1127 QtTimeRecord_Convert, &tr))
1128 return NULL;
1129 SetTimeBaseStopTime(_self->ob_itself,
1130 &tr);
1131 Py_INCREF(Py_None);
1132 _res = Py_None;
1133 return _res;
1136 static PyObject *TimeBaseObj_GetTimeBaseFlags(TimeBaseObject *_self, PyObject *_args)
1138 PyObject *_res = NULL;
1139 long _rv;
1140 if (!PyArg_ParseTuple(_args, ""))
1141 return NULL;
1142 _rv = GetTimeBaseFlags(_self->ob_itself);
1143 _res = Py_BuildValue("l",
1144 _rv);
1145 return _res;
1148 static PyObject *TimeBaseObj_SetTimeBaseFlags(TimeBaseObject *_self, PyObject *_args)
1150 PyObject *_res = NULL;
1151 long timeBaseFlags;
1152 if (!PyArg_ParseTuple(_args, "l",
1153 &timeBaseFlags))
1154 return NULL;
1155 SetTimeBaseFlags(_self->ob_itself,
1156 timeBaseFlags);
1157 Py_INCREF(Py_None);
1158 _res = Py_None;
1159 return _res;
1162 static PyObject *TimeBaseObj_SetTimeBaseMasterTimeBase(TimeBaseObject *_self, PyObject *_args)
1164 PyObject *_res = NULL;
1165 TimeBase master;
1166 TimeRecord slaveZero;
1167 if (!PyArg_ParseTuple(_args, "O&O&",
1168 TimeBaseObj_Convert, &master,
1169 QtTimeRecord_Convert, &slaveZero))
1170 return NULL;
1171 SetTimeBaseMasterTimeBase(_self->ob_itself,
1172 master,
1173 &slaveZero);
1174 Py_INCREF(Py_None);
1175 _res = Py_None;
1176 return _res;
1179 static PyObject *TimeBaseObj_GetTimeBaseMasterTimeBase(TimeBaseObject *_self, PyObject *_args)
1181 PyObject *_res = NULL;
1182 TimeBase _rv;
1183 if (!PyArg_ParseTuple(_args, ""))
1184 return NULL;
1185 _rv = GetTimeBaseMasterTimeBase(_self->ob_itself);
1186 _res = Py_BuildValue("O&",
1187 TimeBaseObj_New, _rv);
1188 return _res;
1191 static PyObject *TimeBaseObj_SetTimeBaseMasterClock(TimeBaseObject *_self, PyObject *_args)
1193 PyObject *_res = NULL;
1194 Component clockMeister;
1195 TimeRecord slaveZero;
1196 if (!PyArg_ParseTuple(_args, "O&O&",
1197 CmpObj_Convert, &clockMeister,
1198 QtTimeRecord_Convert, &slaveZero))
1199 return NULL;
1200 SetTimeBaseMasterClock(_self->ob_itself,
1201 clockMeister,
1202 &slaveZero);
1203 Py_INCREF(Py_None);
1204 _res = Py_None;
1205 return _res;
1208 static PyObject *TimeBaseObj_GetTimeBaseMasterClock(TimeBaseObject *_self, PyObject *_args)
1210 PyObject *_res = NULL;
1211 ComponentInstance _rv;
1212 if (!PyArg_ParseTuple(_args, ""))
1213 return NULL;
1214 _rv = GetTimeBaseMasterClock(_self->ob_itself);
1215 _res = Py_BuildValue("O&",
1216 CmpInstObj_New, _rv);
1217 return _res;
1220 static PyObject *TimeBaseObj_GetTimeBaseStatus(TimeBaseObject *_self, PyObject *_args)
1222 PyObject *_res = NULL;
1223 long _rv;
1224 TimeRecord unpinnedTime;
1225 if (!PyArg_ParseTuple(_args, ""))
1226 return NULL;
1227 _rv = GetTimeBaseStatus(_self->ob_itself,
1228 &unpinnedTime);
1229 _res = Py_BuildValue("lO&",
1230 _rv,
1231 QtTimeRecord_New, &unpinnedTime);
1232 return _res;
1235 static PyObject *TimeBaseObj_SetTimeBaseZero(TimeBaseObject *_self, PyObject *_args)
1237 PyObject *_res = NULL;
1238 TimeRecord zero;
1239 if (!PyArg_ParseTuple(_args, "O&",
1240 QtTimeRecord_Convert, &zero))
1241 return NULL;
1242 SetTimeBaseZero(_self->ob_itself,
1243 &zero);
1244 Py_INCREF(Py_None);
1245 _res = Py_None;
1246 return _res;
1249 static PyObject *TimeBaseObj_GetTimeBaseEffectiveRate(TimeBaseObject *_self, PyObject *_args)
1251 PyObject *_res = NULL;
1252 Fixed _rv;
1253 if (!PyArg_ParseTuple(_args, ""))
1254 return NULL;
1255 _rv = GetTimeBaseEffectiveRate(_self->ob_itself);
1256 _res = Py_BuildValue("O&",
1257 PyMac_BuildFixed, _rv);
1258 return _res;
1261 static PyMethodDef TimeBaseObj_methods[] = {
1262 {"DisposeTimeBase", (PyCFunction)TimeBaseObj_DisposeTimeBase, 1,
1263 "() -> None"},
1264 {"GetTimeBaseTime", (PyCFunction)TimeBaseObj_GetTimeBaseTime, 1,
1265 "(TimeScale s) -> (TimeValue _rv, TimeRecord tr)"},
1266 {"SetTimeBaseTime", (PyCFunction)TimeBaseObj_SetTimeBaseTime, 1,
1267 "(TimeRecord tr) -> None"},
1268 {"SetTimeBaseValue", (PyCFunction)TimeBaseObj_SetTimeBaseValue, 1,
1269 "(TimeValue t, TimeScale s) -> None"},
1270 {"GetTimeBaseRate", (PyCFunction)TimeBaseObj_GetTimeBaseRate, 1,
1271 "() -> (Fixed _rv)"},
1272 {"SetTimeBaseRate", (PyCFunction)TimeBaseObj_SetTimeBaseRate, 1,
1273 "(Fixed r) -> None"},
1274 {"GetTimeBaseStartTime", (PyCFunction)TimeBaseObj_GetTimeBaseStartTime, 1,
1275 "(TimeScale s) -> (TimeValue _rv, TimeRecord tr)"},
1276 {"SetTimeBaseStartTime", (PyCFunction)TimeBaseObj_SetTimeBaseStartTime, 1,
1277 "(TimeRecord tr) -> None"},
1278 {"GetTimeBaseStopTime", (PyCFunction)TimeBaseObj_GetTimeBaseStopTime, 1,
1279 "(TimeScale s) -> (TimeValue _rv, TimeRecord tr)"},
1280 {"SetTimeBaseStopTime", (PyCFunction)TimeBaseObj_SetTimeBaseStopTime, 1,
1281 "(TimeRecord tr) -> None"},
1282 {"GetTimeBaseFlags", (PyCFunction)TimeBaseObj_GetTimeBaseFlags, 1,
1283 "() -> (long _rv)"},
1284 {"SetTimeBaseFlags", (PyCFunction)TimeBaseObj_SetTimeBaseFlags, 1,
1285 "(long timeBaseFlags) -> None"},
1286 {"SetTimeBaseMasterTimeBase", (PyCFunction)TimeBaseObj_SetTimeBaseMasterTimeBase, 1,
1287 "(TimeBase master, TimeRecord slaveZero) -> None"},
1288 {"GetTimeBaseMasterTimeBase", (PyCFunction)TimeBaseObj_GetTimeBaseMasterTimeBase, 1,
1289 "() -> (TimeBase _rv)"},
1290 {"SetTimeBaseMasterClock", (PyCFunction)TimeBaseObj_SetTimeBaseMasterClock, 1,
1291 "(Component clockMeister, TimeRecord slaveZero) -> None"},
1292 {"GetTimeBaseMasterClock", (PyCFunction)TimeBaseObj_GetTimeBaseMasterClock, 1,
1293 "() -> (ComponentInstance _rv)"},
1294 {"GetTimeBaseStatus", (PyCFunction)TimeBaseObj_GetTimeBaseStatus, 1,
1295 "() -> (long _rv, TimeRecord unpinnedTime)"},
1296 {"SetTimeBaseZero", (PyCFunction)TimeBaseObj_SetTimeBaseZero, 1,
1297 "(TimeRecord zero) -> None"},
1298 {"GetTimeBaseEffectiveRate", (PyCFunction)TimeBaseObj_GetTimeBaseEffectiveRate, 1,
1299 "() -> (Fixed _rv)"},
1300 {NULL, NULL, 0}
1303 PyMethodChain TimeBaseObj_chain = { TimeBaseObj_methods, NULL };
1305 static PyObject *TimeBaseObj_getattr(TimeBaseObject *self, char *name)
1307 return Py_FindMethodInChain(&TimeBaseObj_chain, (PyObject *)self, name);
1310 #define TimeBaseObj_setattr NULL
1312 #define TimeBaseObj_compare NULL
1314 #define TimeBaseObj_repr NULL
1316 #define TimeBaseObj_hash NULL
1318 PyTypeObject TimeBase_Type = {
1319 PyObject_HEAD_INIT(&PyType_Type)
1320 0, /*ob_size*/
1321 "TimeBase", /*tp_name*/
1322 sizeof(TimeBaseObject), /*tp_basicsize*/
1323 0, /*tp_itemsize*/
1324 /* methods */
1325 (destructor) TimeBaseObj_dealloc, /*tp_dealloc*/
1326 0, /*tp_print*/
1327 (getattrfunc) TimeBaseObj_getattr, /*tp_getattr*/
1328 (setattrfunc) TimeBaseObj_setattr, /*tp_setattr*/
1329 (cmpfunc) TimeBaseObj_compare, /*tp_compare*/
1330 (reprfunc) TimeBaseObj_repr, /*tp_repr*/
1331 (PyNumberMethods *)0, /* tp_as_number */
1332 (PySequenceMethods *)0, /* tp_as_sequence */
1333 (PyMappingMethods *)0, /* tp_as_mapping */
1334 (hashfunc) TimeBaseObj_hash, /*tp_hash*/
1337 /* -------------------- End object type TimeBase -------------------- */
1340 /* ---------------------- Object type UserData ---------------------- */
1342 PyTypeObject UserData_Type;
1344 #define UserDataObj_Check(x) ((x)->ob_type == &UserData_Type)
1346 typedef struct UserDataObject {
1347 PyObject_HEAD
1348 UserData ob_itself;
1349 } UserDataObject;
1351 PyObject *UserDataObj_New(UserData itself)
1353 UserDataObject *it;
1354 if (itself == NULL) {
1355 PyErr_SetString(Qt_Error,"Cannot create null UserData");
1356 return NULL;
1358 it = PyObject_NEW(UserDataObject, &UserData_Type);
1359 if (it == NULL) return NULL;
1360 it->ob_itself = itself;
1361 return (PyObject *)it;
1363 UserDataObj_Convert(PyObject *v, UserData *p_itself)
1365 if (!UserDataObj_Check(v))
1367 PyErr_SetString(PyExc_TypeError, "UserData required");
1368 return 0;
1370 *p_itself = ((UserDataObject *)v)->ob_itself;
1371 return 1;
1374 static void UserDataObj_dealloc(UserDataObject *self)
1376 DisposeUserData(self->ob_itself);
1377 PyMem_DEL(self);
1380 static PyObject *UserDataObj_GetUserData(UserDataObject *_self, PyObject *_args)
1382 PyObject *_res = NULL;
1383 OSErr _err;
1384 Handle data;
1385 OSType udType;
1386 long index;
1387 if (!PyArg_ParseTuple(_args, "O&O&l",
1388 ResObj_Convert, &data,
1389 PyMac_GetOSType, &udType,
1390 &index))
1391 return NULL;
1392 _err = GetUserData(_self->ob_itself,
1393 data,
1394 udType,
1395 index);
1396 if (_err != noErr) return PyMac_Error(_err);
1397 Py_INCREF(Py_None);
1398 _res = Py_None;
1399 return _res;
1402 static PyObject *UserDataObj_AddUserData(UserDataObject *_self, PyObject *_args)
1404 PyObject *_res = NULL;
1405 OSErr _err;
1406 Handle data;
1407 OSType udType;
1408 if (!PyArg_ParseTuple(_args, "O&O&",
1409 ResObj_Convert, &data,
1410 PyMac_GetOSType, &udType))
1411 return NULL;
1412 _err = AddUserData(_self->ob_itself,
1413 data,
1414 udType);
1415 if (_err != noErr) return PyMac_Error(_err);
1416 Py_INCREF(Py_None);
1417 _res = Py_None;
1418 return _res;
1421 static PyObject *UserDataObj_RemoveUserData(UserDataObject *_self, PyObject *_args)
1423 PyObject *_res = NULL;
1424 OSErr _err;
1425 OSType udType;
1426 long index;
1427 if (!PyArg_ParseTuple(_args, "O&l",
1428 PyMac_GetOSType, &udType,
1429 &index))
1430 return NULL;
1431 _err = RemoveUserData(_self->ob_itself,
1432 udType,
1433 index);
1434 if (_err != noErr) return PyMac_Error(_err);
1435 Py_INCREF(Py_None);
1436 _res = Py_None;
1437 return _res;
1440 static PyObject *UserDataObj_CountUserDataType(UserDataObject *_self, PyObject *_args)
1442 PyObject *_res = NULL;
1443 short _rv;
1444 OSType udType;
1445 if (!PyArg_ParseTuple(_args, "O&",
1446 PyMac_GetOSType, &udType))
1447 return NULL;
1448 _rv = CountUserDataType(_self->ob_itself,
1449 udType);
1450 _res = Py_BuildValue("h",
1451 _rv);
1452 return _res;
1455 static PyObject *UserDataObj_GetNextUserDataType(UserDataObject *_self, PyObject *_args)
1457 PyObject *_res = NULL;
1458 long _rv;
1459 OSType udType;
1460 if (!PyArg_ParseTuple(_args, "O&",
1461 PyMac_GetOSType, &udType))
1462 return NULL;
1463 _rv = GetNextUserDataType(_self->ob_itself,
1464 udType);
1465 _res = Py_BuildValue("l",
1466 _rv);
1467 return _res;
1470 static PyObject *UserDataObj_AddUserDataText(UserDataObject *_self, PyObject *_args)
1472 PyObject *_res = NULL;
1473 OSErr _err;
1474 Handle data;
1475 OSType udType;
1476 long index;
1477 short itlRegionTag;
1478 if (!PyArg_ParseTuple(_args, "O&O&lh",
1479 ResObj_Convert, &data,
1480 PyMac_GetOSType, &udType,
1481 &index,
1482 &itlRegionTag))
1483 return NULL;
1484 _err = AddUserDataText(_self->ob_itself,
1485 data,
1486 udType,
1487 index,
1488 itlRegionTag);
1489 if (_err != noErr) return PyMac_Error(_err);
1490 Py_INCREF(Py_None);
1491 _res = Py_None;
1492 return _res;
1495 static PyObject *UserDataObj_GetUserDataText(UserDataObject *_self, PyObject *_args)
1497 PyObject *_res = NULL;
1498 OSErr _err;
1499 Handle data;
1500 OSType udType;
1501 long index;
1502 short itlRegionTag;
1503 if (!PyArg_ParseTuple(_args, "O&O&lh",
1504 ResObj_Convert, &data,
1505 PyMac_GetOSType, &udType,
1506 &index,
1507 &itlRegionTag))
1508 return NULL;
1509 _err = GetUserDataText(_self->ob_itself,
1510 data,
1511 udType,
1512 index,
1513 itlRegionTag);
1514 if (_err != noErr) return PyMac_Error(_err);
1515 Py_INCREF(Py_None);
1516 _res = Py_None;
1517 return _res;
1520 static PyObject *UserDataObj_RemoveUserDataText(UserDataObject *_self, PyObject *_args)
1522 PyObject *_res = NULL;
1523 OSErr _err;
1524 OSType udType;
1525 long index;
1526 short itlRegionTag;
1527 if (!PyArg_ParseTuple(_args, "O&lh",
1528 PyMac_GetOSType, &udType,
1529 &index,
1530 &itlRegionTag))
1531 return NULL;
1532 _err = RemoveUserDataText(_self->ob_itself,
1533 udType,
1534 index,
1535 itlRegionTag);
1536 if (_err != noErr) return PyMac_Error(_err);
1537 Py_INCREF(Py_None);
1538 _res = Py_None;
1539 return _res;
1542 static PyObject *UserDataObj_PutUserDataIntoHandle(UserDataObject *_self, PyObject *_args)
1544 PyObject *_res = NULL;
1545 OSErr _err;
1546 Handle h;
1547 if (!PyArg_ParseTuple(_args, "O&",
1548 ResObj_Convert, &h))
1549 return NULL;
1550 _err = PutUserDataIntoHandle(_self->ob_itself,
1552 if (_err != noErr) return PyMac_Error(_err);
1553 Py_INCREF(Py_None);
1554 _res = Py_None;
1555 return _res;
1558 static PyMethodDef UserDataObj_methods[] = {
1559 {"GetUserData", (PyCFunction)UserDataObj_GetUserData, 1,
1560 "(Handle data, OSType udType, long index) -> None"},
1561 {"AddUserData", (PyCFunction)UserDataObj_AddUserData, 1,
1562 "(Handle data, OSType udType) -> None"},
1563 {"RemoveUserData", (PyCFunction)UserDataObj_RemoveUserData, 1,
1564 "(OSType udType, long index) -> None"},
1565 {"CountUserDataType", (PyCFunction)UserDataObj_CountUserDataType, 1,
1566 "(OSType udType) -> (short _rv)"},
1567 {"GetNextUserDataType", (PyCFunction)UserDataObj_GetNextUserDataType, 1,
1568 "(OSType udType) -> (long _rv)"},
1569 {"AddUserDataText", (PyCFunction)UserDataObj_AddUserDataText, 1,
1570 "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
1571 {"GetUserDataText", (PyCFunction)UserDataObj_GetUserDataText, 1,
1572 "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
1573 {"RemoveUserDataText", (PyCFunction)UserDataObj_RemoveUserDataText, 1,
1574 "(OSType udType, long index, short itlRegionTag) -> None"},
1575 {"PutUserDataIntoHandle", (PyCFunction)UserDataObj_PutUserDataIntoHandle, 1,
1576 "(Handle h) -> None"},
1577 {NULL, NULL, 0}
1580 PyMethodChain UserDataObj_chain = { UserDataObj_methods, NULL };
1582 static PyObject *UserDataObj_getattr(UserDataObject *self, char *name)
1584 return Py_FindMethodInChain(&UserDataObj_chain, (PyObject *)self, name);
1587 #define UserDataObj_setattr NULL
1589 #define UserDataObj_compare NULL
1591 #define UserDataObj_repr NULL
1593 #define UserDataObj_hash NULL
1595 PyTypeObject UserData_Type = {
1596 PyObject_HEAD_INIT(&PyType_Type)
1597 0, /*ob_size*/
1598 "UserData", /*tp_name*/
1599 sizeof(UserDataObject), /*tp_basicsize*/
1600 0, /*tp_itemsize*/
1601 /* methods */
1602 (destructor) UserDataObj_dealloc, /*tp_dealloc*/
1603 0, /*tp_print*/
1604 (getattrfunc) UserDataObj_getattr, /*tp_getattr*/
1605 (setattrfunc) UserDataObj_setattr, /*tp_setattr*/
1606 (cmpfunc) UserDataObj_compare, /*tp_compare*/
1607 (reprfunc) UserDataObj_repr, /*tp_repr*/
1608 (PyNumberMethods *)0, /* tp_as_number */
1609 (PySequenceMethods *)0, /* tp_as_sequence */
1610 (PyMappingMethods *)0, /* tp_as_mapping */
1611 (hashfunc) UserDataObj_hash, /*tp_hash*/
1614 /* -------------------- End object type UserData -------------------- */
1617 /* ----------------------- Object type Media ------------------------ */
1619 PyTypeObject Media_Type;
1621 #define MediaObj_Check(x) ((x)->ob_type == &Media_Type)
1623 typedef struct MediaObject {
1624 PyObject_HEAD
1625 Media ob_itself;
1626 } MediaObject;
1628 PyObject *MediaObj_New(Media itself)
1630 MediaObject *it;
1631 if (itself == NULL) {
1632 PyErr_SetString(Qt_Error,"Cannot create null Media");
1633 return NULL;
1635 it = PyObject_NEW(MediaObject, &Media_Type);
1636 if (it == NULL) return NULL;
1637 it->ob_itself = itself;
1638 return (PyObject *)it;
1640 MediaObj_Convert(PyObject *v, Media *p_itself)
1642 if (!MediaObj_Check(v))
1644 PyErr_SetString(PyExc_TypeError, "Media required");
1645 return 0;
1647 *p_itself = ((MediaObject *)v)->ob_itself;
1648 return 1;
1651 static void MediaObj_dealloc(MediaObject *self)
1653 DisposeTrackMedia(self->ob_itself);
1654 PyMem_DEL(self);
1657 static PyObject *MediaObj_LoadMediaIntoRam(MediaObject *_self, PyObject *_args)
1659 PyObject *_res = NULL;
1660 OSErr _err;
1661 TimeValue time;
1662 TimeValue duration;
1663 long flags;
1664 if (!PyArg_ParseTuple(_args, "lll",
1665 &time,
1666 &duration,
1667 &flags))
1668 return NULL;
1669 _err = LoadMediaIntoRam(_self->ob_itself,
1670 time,
1671 duration,
1672 flags);
1673 if (_err != noErr) return PyMac_Error(_err);
1674 Py_INCREF(Py_None);
1675 _res = Py_None;
1676 return _res;
1679 static PyObject *MediaObj_GetMediaTrack(MediaObject *_self, PyObject *_args)
1681 PyObject *_res = NULL;
1682 Track _rv;
1683 if (!PyArg_ParseTuple(_args, ""))
1684 return NULL;
1685 _rv = GetMediaTrack(_self->ob_itself);
1686 _res = Py_BuildValue("O&",
1687 TrackObj_New, _rv);
1688 return _res;
1691 static PyObject *MediaObj_GetMediaCreationTime(MediaObject *_self, PyObject *_args)
1693 PyObject *_res = NULL;
1694 unsigned long _rv;
1695 if (!PyArg_ParseTuple(_args, ""))
1696 return NULL;
1697 _rv = GetMediaCreationTime(_self->ob_itself);
1698 _res = Py_BuildValue("l",
1699 _rv);
1700 return _res;
1703 static PyObject *MediaObj_GetMediaModificationTime(MediaObject *_self, PyObject *_args)
1705 PyObject *_res = NULL;
1706 unsigned long _rv;
1707 if (!PyArg_ParseTuple(_args, ""))
1708 return NULL;
1709 _rv = GetMediaModificationTime(_self->ob_itself);
1710 _res = Py_BuildValue("l",
1711 _rv);
1712 return _res;
1715 static PyObject *MediaObj_GetMediaTimeScale(MediaObject *_self, PyObject *_args)
1717 PyObject *_res = NULL;
1718 TimeScale _rv;
1719 if (!PyArg_ParseTuple(_args, ""))
1720 return NULL;
1721 _rv = GetMediaTimeScale(_self->ob_itself);
1722 _res = Py_BuildValue("l",
1723 _rv);
1724 return _res;
1727 static PyObject *MediaObj_SetMediaTimeScale(MediaObject *_self, PyObject *_args)
1729 PyObject *_res = NULL;
1730 TimeScale timeScale;
1731 if (!PyArg_ParseTuple(_args, "l",
1732 &timeScale))
1733 return NULL;
1734 SetMediaTimeScale(_self->ob_itself,
1735 timeScale);
1736 Py_INCREF(Py_None);
1737 _res = Py_None;
1738 return _res;
1741 static PyObject *MediaObj_GetMediaDuration(MediaObject *_self, PyObject *_args)
1743 PyObject *_res = NULL;
1744 TimeValue _rv;
1745 if (!PyArg_ParseTuple(_args, ""))
1746 return NULL;
1747 _rv = GetMediaDuration(_self->ob_itself);
1748 _res = Py_BuildValue("l",
1749 _rv);
1750 return _res;
1753 static PyObject *MediaObj_GetMediaLanguage(MediaObject *_self, PyObject *_args)
1755 PyObject *_res = NULL;
1756 short _rv;
1757 if (!PyArg_ParseTuple(_args, ""))
1758 return NULL;
1759 _rv = GetMediaLanguage(_self->ob_itself);
1760 _res = Py_BuildValue("h",
1761 _rv);
1762 return _res;
1765 static PyObject *MediaObj_SetMediaLanguage(MediaObject *_self, PyObject *_args)
1767 PyObject *_res = NULL;
1768 short language;
1769 if (!PyArg_ParseTuple(_args, "h",
1770 &language))
1771 return NULL;
1772 SetMediaLanguage(_self->ob_itself,
1773 language);
1774 Py_INCREF(Py_None);
1775 _res = Py_None;
1776 return _res;
1779 static PyObject *MediaObj_GetMediaQuality(MediaObject *_self, PyObject *_args)
1781 PyObject *_res = NULL;
1782 short _rv;
1783 if (!PyArg_ParseTuple(_args, ""))
1784 return NULL;
1785 _rv = GetMediaQuality(_self->ob_itself);
1786 _res = Py_BuildValue("h",
1787 _rv);
1788 return _res;
1791 static PyObject *MediaObj_SetMediaQuality(MediaObject *_self, PyObject *_args)
1793 PyObject *_res = NULL;
1794 short quality;
1795 if (!PyArg_ParseTuple(_args, "h",
1796 &quality))
1797 return NULL;
1798 SetMediaQuality(_self->ob_itself,
1799 quality);
1800 Py_INCREF(Py_None);
1801 _res = Py_None;
1802 return _res;
1805 static PyObject *MediaObj_GetMediaHandlerDescription(MediaObject *_self, PyObject *_args)
1807 PyObject *_res = NULL;
1808 OSType mediaType;
1809 Str255 creatorName;
1810 OSType creatorManufacturer;
1811 if (!PyArg_ParseTuple(_args, "O&",
1812 PyMac_GetStr255, creatorName))
1813 return NULL;
1814 GetMediaHandlerDescription(_self->ob_itself,
1815 &mediaType,
1816 creatorName,
1817 &creatorManufacturer);
1818 _res = Py_BuildValue("O&O&",
1819 PyMac_BuildOSType, mediaType,
1820 PyMac_BuildOSType, creatorManufacturer);
1821 return _res;
1824 static PyObject *MediaObj_GetMediaUserData(MediaObject *_self, PyObject *_args)
1826 PyObject *_res = NULL;
1827 UserData _rv;
1828 if (!PyArg_ParseTuple(_args, ""))
1829 return NULL;
1830 _rv = GetMediaUserData(_self->ob_itself);
1831 _res = Py_BuildValue("O&",
1832 UserDataObj_New, _rv);
1833 return _res;
1836 static PyObject *MediaObj_GetMediaHandler(MediaObject *_self, PyObject *_args)
1838 PyObject *_res = NULL;
1839 MediaHandler _rv;
1840 if (!PyArg_ParseTuple(_args, ""))
1841 return NULL;
1842 _rv = GetMediaHandler(_self->ob_itself);
1843 _res = Py_BuildValue("O&",
1844 CmpInstObj_New, _rv);
1845 return _res;
1848 static PyObject *MediaObj_SetMediaHandler(MediaObject *_self, PyObject *_args)
1850 PyObject *_res = NULL;
1851 OSErr _err;
1852 MediaHandlerComponent mH;
1853 if (!PyArg_ParseTuple(_args, "O&",
1854 CmpObj_Convert, &mH))
1855 return NULL;
1856 _err = SetMediaHandler(_self->ob_itself,
1857 mH);
1858 if (_err != noErr) return PyMac_Error(_err);
1859 Py_INCREF(Py_None);
1860 _res = Py_None;
1861 return _res;
1864 static PyObject *MediaObj_BeginMediaEdits(MediaObject *_self, PyObject *_args)
1866 PyObject *_res = NULL;
1867 OSErr _err;
1868 if (!PyArg_ParseTuple(_args, ""))
1869 return NULL;
1870 _err = BeginMediaEdits(_self->ob_itself);
1871 if (_err != noErr) return PyMac_Error(_err);
1872 Py_INCREF(Py_None);
1873 _res = Py_None;
1874 return _res;
1877 static PyObject *MediaObj_EndMediaEdits(MediaObject *_self, PyObject *_args)
1879 PyObject *_res = NULL;
1880 OSErr _err;
1881 if (!PyArg_ParseTuple(_args, ""))
1882 return NULL;
1883 _err = EndMediaEdits(_self->ob_itself);
1884 if (_err != noErr) return PyMac_Error(_err);
1885 Py_INCREF(Py_None);
1886 _res = Py_None;
1887 return _res;
1890 static PyObject *MediaObj_SetMediaDefaultDataRefIndex(MediaObject *_self, PyObject *_args)
1892 PyObject *_res = NULL;
1893 OSErr _err;
1894 short index;
1895 if (!PyArg_ParseTuple(_args, "h",
1896 &index))
1897 return NULL;
1898 _err = SetMediaDefaultDataRefIndex(_self->ob_itself,
1899 index);
1900 if (_err != noErr) return PyMac_Error(_err);
1901 Py_INCREF(Py_None);
1902 _res = Py_None;
1903 return _res;
1906 static PyObject *MediaObj_GetMediaDataHandlerDescription(MediaObject *_self, PyObject *_args)
1908 PyObject *_res = NULL;
1909 short index;
1910 OSType dhType;
1911 Str255 creatorName;
1912 OSType creatorManufacturer;
1913 if (!PyArg_ParseTuple(_args, "hO&",
1914 &index,
1915 PyMac_GetStr255, creatorName))
1916 return NULL;
1917 GetMediaDataHandlerDescription(_self->ob_itself,
1918 index,
1919 &dhType,
1920 creatorName,
1921 &creatorManufacturer);
1922 _res = Py_BuildValue("O&O&",
1923 PyMac_BuildOSType, dhType,
1924 PyMac_BuildOSType, creatorManufacturer);
1925 return _res;
1928 static PyObject *MediaObj_GetMediaDataHandler(MediaObject *_self, PyObject *_args)
1930 PyObject *_res = NULL;
1931 DataHandler _rv;
1932 short index;
1933 if (!PyArg_ParseTuple(_args, "h",
1934 &index))
1935 return NULL;
1936 _rv = GetMediaDataHandler(_self->ob_itself,
1937 index);
1938 _res = Py_BuildValue("O&",
1939 CmpInstObj_New, _rv);
1940 return _res;
1943 static PyObject *MediaObj_SetMediaDataHandler(MediaObject *_self, PyObject *_args)
1945 PyObject *_res = NULL;
1946 OSErr _err;
1947 short index;
1948 DataHandlerComponent dataHandler;
1949 if (!PyArg_ParseTuple(_args, "hO&",
1950 &index,
1951 CmpObj_Convert, &dataHandler))
1952 return NULL;
1953 _err = SetMediaDataHandler(_self->ob_itself,
1954 index,
1955 dataHandler);
1956 if (_err != noErr) return PyMac_Error(_err);
1957 Py_INCREF(Py_None);
1958 _res = Py_None;
1959 return _res;
1962 static PyObject *MediaObj_GetMediaSampleDescriptionCount(MediaObject *_self, PyObject *_args)
1964 PyObject *_res = NULL;
1965 long _rv;
1966 if (!PyArg_ParseTuple(_args, ""))
1967 return NULL;
1968 _rv = GetMediaSampleDescriptionCount(_self->ob_itself);
1969 _res = Py_BuildValue("l",
1970 _rv);
1971 return _res;
1974 static PyObject *MediaObj_GetMediaSampleDescription(MediaObject *_self, PyObject *_args)
1976 PyObject *_res = NULL;
1977 long index;
1978 SampleDescriptionHandle descH;
1979 if (!PyArg_ParseTuple(_args, "lO&",
1980 &index,
1981 ResObj_Convert, &descH))
1982 return NULL;
1983 GetMediaSampleDescription(_self->ob_itself,
1984 index,
1985 descH);
1986 Py_INCREF(Py_None);
1987 _res = Py_None;
1988 return _res;
1991 static PyObject *MediaObj_SetMediaSampleDescription(MediaObject *_self, PyObject *_args)
1993 PyObject *_res = NULL;
1994 OSErr _err;
1995 long index;
1996 SampleDescriptionHandle descH;
1997 if (!PyArg_ParseTuple(_args, "lO&",
1998 &index,
1999 ResObj_Convert, &descH))
2000 return NULL;
2001 _err = SetMediaSampleDescription(_self->ob_itself,
2002 index,
2003 descH);
2004 if (_err != noErr) return PyMac_Error(_err);
2005 Py_INCREF(Py_None);
2006 _res = Py_None;
2007 return _res;
2010 static PyObject *MediaObj_GetMediaSampleCount(MediaObject *_self, PyObject *_args)
2012 PyObject *_res = NULL;
2013 long _rv;
2014 if (!PyArg_ParseTuple(_args, ""))
2015 return NULL;
2016 _rv = GetMediaSampleCount(_self->ob_itself);
2017 _res = Py_BuildValue("l",
2018 _rv);
2019 return _res;
2022 static PyObject *MediaObj_GetMediaSyncSampleCount(MediaObject *_self, PyObject *_args)
2024 PyObject *_res = NULL;
2025 long _rv;
2026 if (!PyArg_ParseTuple(_args, ""))
2027 return NULL;
2028 _rv = GetMediaSyncSampleCount(_self->ob_itself);
2029 _res = Py_BuildValue("l",
2030 _rv);
2031 return _res;
2034 static PyObject *MediaObj_SampleNumToMediaTime(MediaObject *_self, PyObject *_args)
2036 PyObject *_res = NULL;
2037 long logicalSampleNum;
2038 TimeValue sampleTime;
2039 TimeValue sampleDuration;
2040 if (!PyArg_ParseTuple(_args, "l",
2041 &logicalSampleNum))
2042 return NULL;
2043 SampleNumToMediaTime(_self->ob_itself,
2044 logicalSampleNum,
2045 &sampleTime,
2046 &sampleDuration);
2047 _res = Py_BuildValue("ll",
2048 sampleTime,
2049 sampleDuration);
2050 return _res;
2053 static PyObject *MediaObj_MediaTimeToSampleNum(MediaObject *_self, PyObject *_args)
2055 PyObject *_res = NULL;
2056 TimeValue time;
2057 long sampleNum;
2058 TimeValue sampleTime;
2059 TimeValue sampleDuration;
2060 if (!PyArg_ParseTuple(_args, "l",
2061 &time))
2062 return NULL;
2063 MediaTimeToSampleNum(_self->ob_itself,
2064 time,
2065 &sampleNum,
2066 &sampleTime,
2067 &sampleDuration);
2068 _res = Py_BuildValue("lll",
2069 sampleNum,
2070 sampleTime,
2071 sampleDuration);
2072 return _res;
2075 static PyObject *MediaObj_AddMediaSample(MediaObject *_self, PyObject *_args)
2077 PyObject *_res = NULL;
2078 OSErr _err;
2079 Handle dataIn;
2080 long inOffset;
2081 unsigned long size;
2082 TimeValue durationPerSample;
2083 SampleDescriptionHandle sampleDescriptionH;
2084 long numberOfSamples;
2085 short sampleFlags;
2086 TimeValue sampleTime;
2087 if (!PyArg_ParseTuple(_args, "O&lllO&lh",
2088 ResObj_Convert, &dataIn,
2089 &inOffset,
2090 &size,
2091 &durationPerSample,
2092 ResObj_Convert, &sampleDescriptionH,
2093 &numberOfSamples,
2094 &sampleFlags))
2095 return NULL;
2096 _err = AddMediaSample(_self->ob_itself,
2097 dataIn,
2098 inOffset,
2099 size,
2100 durationPerSample,
2101 sampleDescriptionH,
2102 numberOfSamples,
2103 sampleFlags,
2104 &sampleTime);
2105 if (_err != noErr) return PyMac_Error(_err);
2106 _res = Py_BuildValue("l",
2107 sampleTime);
2108 return _res;
2111 static PyObject *MediaObj_AddMediaSampleReference(MediaObject *_self, PyObject *_args)
2113 PyObject *_res = NULL;
2114 OSErr _err;
2115 long dataOffset;
2116 unsigned long size;
2117 TimeValue durationPerSample;
2118 SampleDescriptionHandle sampleDescriptionH;
2119 long numberOfSamples;
2120 short sampleFlags;
2121 TimeValue sampleTime;
2122 if (!PyArg_ParseTuple(_args, "lllO&lh",
2123 &dataOffset,
2124 &size,
2125 &durationPerSample,
2126 ResObj_Convert, &sampleDescriptionH,
2127 &numberOfSamples,
2128 &sampleFlags))
2129 return NULL;
2130 _err = AddMediaSampleReference(_self->ob_itself,
2131 dataOffset,
2132 size,
2133 durationPerSample,
2134 sampleDescriptionH,
2135 numberOfSamples,
2136 sampleFlags,
2137 &sampleTime);
2138 if (_err != noErr) return PyMac_Error(_err);
2139 _res = Py_BuildValue("l",
2140 sampleTime);
2141 return _res;
2144 static PyObject *MediaObj_GetMediaSample(MediaObject *_self, PyObject *_args)
2146 PyObject *_res = NULL;
2147 OSErr _err;
2148 Handle dataOut;
2149 long maxSizeToGrow;
2150 long size;
2151 TimeValue time;
2152 TimeValue sampleTime;
2153 TimeValue durationPerSample;
2154 SampleDescriptionHandle sampleDescriptionH;
2155 long sampleDescriptionIndex;
2156 long maxNumberOfSamples;
2157 long numberOfSamples;
2158 short sampleFlags;
2159 if (!PyArg_ParseTuple(_args, "O&llO&l",
2160 ResObj_Convert, &dataOut,
2161 &maxSizeToGrow,
2162 &time,
2163 ResObj_Convert, &sampleDescriptionH,
2164 &maxNumberOfSamples))
2165 return NULL;
2166 _err = GetMediaSample(_self->ob_itself,
2167 dataOut,
2168 maxSizeToGrow,
2169 &size,
2170 time,
2171 &sampleTime,
2172 &durationPerSample,
2173 sampleDescriptionH,
2174 &sampleDescriptionIndex,
2175 maxNumberOfSamples,
2176 &numberOfSamples,
2177 &sampleFlags);
2178 if (_err != noErr) return PyMac_Error(_err);
2179 _res = Py_BuildValue("lllllh",
2180 size,
2181 sampleTime,
2182 durationPerSample,
2183 sampleDescriptionIndex,
2184 numberOfSamples,
2185 sampleFlags);
2186 return _res;
2189 static PyObject *MediaObj_GetMediaSampleReference(MediaObject *_self, PyObject *_args)
2191 PyObject *_res = NULL;
2192 OSErr _err;
2193 long dataOffset;
2194 long size;
2195 TimeValue time;
2196 TimeValue sampleTime;
2197 TimeValue durationPerSample;
2198 SampleDescriptionHandle sampleDescriptionH;
2199 long sampleDescriptionIndex;
2200 long maxNumberOfSamples;
2201 long numberOfSamples;
2202 short sampleFlags;
2203 if (!PyArg_ParseTuple(_args, "lO&l",
2204 &time,
2205 ResObj_Convert, &sampleDescriptionH,
2206 &maxNumberOfSamples))
2207 return NULL;
2208 _err = GetMediaSampleReference(_self->ob_itself,
2209 &dataOffset,
2210 &size,
2211 time,
2212 &sampleTime,
2213 &durationPerSample,
2214 sampleDescriptionH,
2215 &sampleDescriptionIndex,
2216 maxNumberOfSamples,
2217 &numberOfSamples,
2218 &sampleFlags);
2219 if (_err != noErr) return PyMac_Error(_err);
2220 _res = Py_BuildValue("llllllh",
2221 dataOffset,
2222 size,
2223 sampleTime,
2224 durationPerSample,
2225 sampleDescriptionIndex,
2226 numberOfSamples,
2227 sampleFlags);
2228 return _res;
2231 static PyObject *MediaObj_SetMediaPreferredChunkSize(MediaObject *_self, PyObject *_args)
2233 PyObject *_res = NULL;
2234 OSErr _err;
2235 long maxChunkSize;
2236 if (!PyArg_ParseTuple(_args, "l",
2237 &maxChunkSize))
2238 return NULL;
2239 _err = SetMediaPreferredChunkSize(_self->ob_itself,
2240 maxChunkSize);
2241 if (_err != noErr) return PyMac_Error(_err);
2242 Py_INCREF(Py_None);
2243 _res = Py_None;
2244 return _res;
2247 static PyObject *MediaObj_GetMediaPreferredChunkSize(MediaObject *_self, PyObject *_args)
2249 PyObject *_res = NULL;
2250 OSErr _err;
2251 long maxChunkSize;
2252 if (!PyArg_ParseTuple(_args, ""))
2253 return NULL;
2254 _err = GetMediaPreferredChunkSize(_self->ob_itself,
2255 &maxChunkSize);
2256 if (_err != noErr) return PyMac_Error(_err);
2257 _res = Py_BuildValue("l",
2258 maxChunkSize);
2259 return _res;
2262 static PyObject *MediaObj_SetMediaShadowSync(MediaObject *_self, PyObject *_args)
2264 PyObject *_res = NULL;
2265 OSErr _err;
2266 long frameDiffSampleNum;
2267 long syncSampleNum;
2268 if (!PyArg_ParseTuple(_args, "ll",
2269 &frameDiffSampleNum,
2270 &syncSampleNum))
2271 return NULL;
2272 _err = SetMediaShadowSync(_self->ob_itself,
2273 frameDiffSampleNum,
2274 syncSampleNum);
2275 if (_err != noErr) return PyMac_Error(_err);
2276 Py_INCREF(Py_None);
2277 _res = Py_None;
2278 return _res;
2281 static PyObject *MediaObj_GetMediaShadowSync(MediaObject *_self, PyObject *_args)
2283 PyObject *_res = NULL;
2284 OSErr _err;
2285 long frameDiffSampleNum;
2286 long syncSampleNum;
2287 if (!PyArg_ParseTuple(_args, "l",
2288 &frameDiffSampleNum))
2289 return NULL;
2290 _err = GetMediaShadowSync(_self->ob_itself,
2291 frameDiffSampleNum,
2292 &syncSampleNum);
2293 if (_err != noErr) return PyMac_Error(_err);
2294 _res = Py_BuildValue("l",
2295 syncSampleNum);
2296 return _res;
2299 static PyObject *MediaObj_GetMediaDataSize(MediaObject *_self, PyObject *_args)
2301 PyObject *_res = NULL;
2302 long _rv;
2303 TimeValue startTime;
2304 TimeValue duration;
2305 if (!PyArg_ParseTuple(_args, "ll",
2306 &startTime,
2307 &duration))
2308 return NULL;
2309 _rv = GetMediaDataSize(_self->ob_itself,
2310 startTime,
2311 duration);
2312 _res = Py_BuildValue("l",
2313 _rv);
2314 return _res;
2317 static PyObject *MediaObj_GetMediaDataSize64(MediaObject *_self, PyObject *_args)
2319 PyObject *_res = NULL;
2320 OSErr _err;
2321 TimeValue startTime;
2322 TimeValue duration;
2323 wide dataSize;
2324 if (!PyArg_ParseTuple(_args, "ll",
2325 &startTime,
2326 &duration))
2327 return NULL;
2328 _err = GetMediaDataSize64(_self->ob_itself,
2329 startTime,
2330 duration,
2331 &dataSize);
2332 if (_err != noErr) return PyMac_Error(_err);
2333 _res = Py_BuildValue("O&",
2334 PyMac_Buildwide, dataSize);
2335 return _res;
2338 static PyObject *MediaObj_GetMediaNextInterestingTime(MediaObject *_self, PyObject *_args)
2340 PyObject *_res = NULL;
2341 short interestingTimeFlags;
2342 TimeValue time;
2343 Fixed rate;
2344 TimeValue interestingTime;
2345 TimeValue interestingDuration;
2346 if (!PyArg_ParseTuple(_args, "hlO&",
2347 &interestingTimeFlags,
2348 &time,
2349 PyMac_GetFixed, &rate))
2350 return NULL;
2351 GetMediaNextInterestingTime(_self->ob_itself,
2352 interestingTimeFlags,
2353 time,
2354 rate,
2355 &interestingTime,
2356 &interestingDuration);
2357 _res = Py_BuildValue("ll",
2358 interestingTime,
2359 interestingDuration);
2360 return _res;
2363 static PyObject *MediaObj_GetMediaDataRef(MediaObject *_self, PyObject *_args)
2365 PyObject *_res = NULL;
2366 OSErr _err;
2367 short index;
2368 Handle dataRef;
2369 OSType dataRefType;
2370 long dataRefAttributes;
2371 if (!PyArg_ParseTuple(_args, "h",
2372 &index))
2373 return NULL;
2374 _err = GetMediaDataRef(_self->ob_itself,
2375 index,
2376 &dataRef,
2377 &dataRefType,
2378 &dataRefAttributes);
2379 if (_err != noErr) return PyMac_Error(_err);
2380 _res = Py_BuildValue("O&O&l",
2381 ResObj_New, dataRef,
2382 PyMac_BuildOSType, dataRefType,
2383 dataRefAttributes);
2384 return _res;
2387 static PyObject *MediaObj_SetMediaDataRef(MediaObject *_self, PyObject *_args)
2389 PyObject *_res = NULL;
2390 OSErr _err;
2391 short index;
2392 Handle dataRef;
2393 OSType dataRefType;
2394 if (!PyArg_ParseTuple(_args, "hO&O&",
2395 &index,
2396 ResObj_Convert, &dataRef,
2397 PyMac_GetOSType, &dataRefType))
2398 return NULL;
2399 _err = SetMediaDataRef(_self->ob_itself,
2400 index,
2401 dataRef,
2402 dataRefType);
2403 if (_err != noErr) return PyMac_Error(_err);
2404 Py_INCREF(Py_None);
2405 _res = Py_None;
2406 return _res;
2409 static PyObject *MediaObj_SetMediaDataRefAttributes(MediaObject *_self, PyObject *_args)
2411 PyObject *_res = NULL;
2412 OSErr _err;
2413 short index;
2414 long dataRefAttributes;
2415 if (!PyArg_ParseTuple(_args, "hl",
2416 &index,
2417 &dataRefAttributes))
2418 return NULL;
2419 _err = SetMediaDataRefAttributes(_self->ob_itself,
2420 index,
2421 dataRefAttributes);
2422 if (_err != noErr) return PyMac_Error(_err);
2423 Py_INCREF(Py_None);
2424 _res = Py_None;
2425 return _res;
2428 static PyObject *MediaObj_AddMediaDataRef(MediaObject *_self, PyObject *_args)
2430 PyObject *_res = NULL;
2431 OSErr _err;
2432 short index;
2433 Handle dataRef;
2434 OSType dataRefType;
2435 if (!PyArg_ParseTuple(_args, "O&O&",
2436 ResObj_Convert, &dataRef,
2437 PyMac_GetOSType, &dataRefType))
2438 return NULL;
2439 _err = AddMediaDataRef(_self->ob_itself,
2440 &index,
2441 dataRef,
2442 dataRefType);
2443 if (_err != noErr) return PyMac_Error(_err);
2444 _res = Py_BuildValue("h",
2445 index);
2446 return _res;
2449 static PyObject *MediaObj_GetMediaDataRefCount(MediaObject *_self, PyObject *_args)
2451 PyObject *_res = NULL;
2452 OSErr _err;
2453 short count;
2454 if (!PyArg_ParseTuple(_args, ""))
2455 return NULL;
2456 _err = GetMediaDataRefCount(_self->ob_itself,
2457 &count);
2458 if (_err != noErr) return PyMac_Error(_err);
2459 _res = Py_BuildValue("h",
2460 count);
2461 return _res;
2464 static PyObject *MediaObj_SetMediaPlayHints(MediaObject *_self, PyObject *_args)
2466 PyObject *_res = NULL;
2467 long flags;
2468 long flagsMask;
2469 if (!PyArg_ParseTuple(_args, "ll",
2470 &flags,
2471 &flagsMask))
2472 return NULL;
2473 SetMediaPlayHints(_self->ob_itself,
2474 flags,
2475 flagsMask);
2476 Py_INCREF(Py_None);
2477 _res = Py_None;
2478 return _res;
2481 static PyObject *MediaObj_GetMediaPlayHints(MediaObject *_self, PyObject *_args)
2483 PyObject *_res = NULL;
2484 long flags;
2485 if (!PyArg_ParseTuple(_args, ""))
2486 return NULL;
2487 GetMediaPlayHints(_self->ob_itself,
2488 &flags);
2489 _res = Py_BuildValue("l",
2490 flags);
2491 return _res;
2494 static PyObject *MediaObj_GetMediaNextInterestingTimeOnly(MediaObject *_self, PyObject *_args)
2496 PyObject *_res = NULL;
2497 short interestingTimeFlags;
2498 TimeValue time;
2499 Fixed rate;
2500 TimeValue interestingTime;
2501 if (!PyArg_ParseTuple(_args, "hlO&",
2502 &interestingTimeFlags,
2503 &time,
2504 PyMac_GetFixed, &rate))
2505 return NULL;
2506 GetMediaNextInterestingTimeOnly(_self->ob_itself,
2507 interestingTimeFlags,
2508 time,
2509 rate,
2510 &interestingTime);
2511 _res = Py_BuildValue("l",
2512 interestingTime);
2513 return _res;
2516 static PyMethodDef MediaObj_methods[] = {
2517 {"LoadMediaIntoRam", (PyCFunction)MediaObj_LoadMediaIntoRam, 1,
2518 "(TimeValue time, TimeValue duration, long flags) -> None"},
2519 {"GetMediaTrack", (PyCFunction)MediaObj_GetMediaTrack, 1,
2520 "() -> (Track _rv)"},
2521 {"GetMediaCreationTime", (PyCFunction)MediaObj_GetMediaCreationTime, 1,
2522 "() -> (unsigned long _rv)"},
2523 {"GetMediaModificationTime", (PyCFunction)MediaObj_GetMediaModificationTime, 1,
2524 "() -> (unsigned long _rv)"},
2525 {"GetMediaTimeScale", (PyCFunction)MediaObj_GetMediaTimeScale, 1,
2526 "() -> (TimeScale _rv)"},
2527 {"SetMediaTimeScale", (PyCFunction)MediaObj_SetMediaTimeScale, 1,
2528 "(TimeScale timeScale) -> None"},
2529 {"GetMediaDuration", (PyCFunction)MediaObj_GetMediaDuration, 1,
2530 "() -> (TimeValue _rv)"},
2531 {"GetMediaLanguage", (PyCFunction)MediaObj_GetMediaLanguage, 1,
2532 "() -> (short _rv)"},
2533 {"SetMediaLanguage", (PyCFunction)MediaObj_SetMediaLanguage, 1,
2534 "(short language) -> None"},
2535 {"GetMediaQuality", (PyCFunction)MediaObj_GetMediaQuality, 1,
2536 "() -> (short _rv)"},
2537 {"SetMediaQuality", (PyCFunction)MediaObj_SetMediaQuality, 1,
2538 "(short quality) -> None"},
2539 {"GetMediaHandlerDescription", (PyCFunction)MediaObj_GetMediaHandlerDescription, 1,
2540 "(Str255 creatorName) -> (OSType mediaType, OSType creatorManufacturer)"},
2541 {"GetMediaUserData", (PyCFunction)MediaObj_GetMediaUserData, 1,
2542 "() -> (UserData _rv)"},
2543 {"GetMediaHandler", (PyCFunction)MediaObj_GetMediaHandler, 1,
2544 "() -> (MediaHandler _rv)"},
2545 {"SetMediaHandler", (PyCFunction)MediaObj_SetMediaHandler, 1,
2546 "(MediaHandlerComponent mH) -> None"},
2547 {"BeginMediaEdits", (PyCFunction)MediaObj_BeginMediaEdits, 1,
2548 "() -> None"},
2549 {"EndMediaEdits", (PyCFunction)MediaObj_EndMediaEdits, 1,
2550 "() -> None"},
2551 {"SetMediaDefaultDataRefIndex", (PyCFunction)MediaObj_SetMediaDefaultDataRefIndex, 1,
2552 "(short index) -> None"},
2553 {"GetMediaDataHandlerDescription", (PyCFunction)MediaObj_GetMediaDataHandlerDescription, 1,
2554 "(short index, Str255 creatorName) -> (OSType dhType, OSType creatorManufacturer)"},
2555 {"GetMediaDataHandler", (PyCFunction)MediaObj_GetMediaDataHandler, 1,
2556 "(short index) -> (DataHandler _rv)"},
2557 {"SetMediaDataHandler", (PyCFunction)MediaObj_SetMediaDataHandler, 1,
2558 "(short index, DataHandlerComponent dataHandler) -> None"},
2559 {"GetMediaSampleDescriptionCount", (PyCFunction)MediaObj_GetMediaSampleDescriptionCount, 1,
2560 "() -> (long _rv)"},
2561 {"GetMediaSampleDescription", (PyCFunction)MediaObj_GetMediaSampleDescription, 1,
2562 "(long index, SampleDescriptionHandle descH) -> None"},
2563 {"SetMediaSampleDescription", (PyCFunction)MediaObj_SetMediaSampleDescription, 1,
2564 "(long index, SampleDescriptionHandle descH) -> None"},
2565 {"GetMediaSampleCount", (PyCFunction)MediaObj_GetMediaSampleCount, 1,
2566 "() -> (long _rv)"},
2567 {"GetMediaSyncSampleCount", (PyCFunction)MediaObj_GetMediaSyncSampleCount, 1,
2568 "() -> (long _rv)"},
2569 {"SampleNumToMediaTime", (PyCFunction)MediaObj_SampleNumToMediaTime, 1,
2570 "(long logicalSampleNum) -> (TimeValue sampleTime, TimeValue sampleDuration)"},
2571 {"MediaTimeToSampleNum", (PyCFunction)MediaObj_MediaTimeToSampleNum, 1,
2572 "(TimeValue time) -> (long sampleNum, TimeValue sampleTime, TimeValue sampleDuration)"},
2573 {"AddMediaSample", (PyCFunction)MediaObj_AddMediaSample, 1,
2574 "(Handle dataIn, long inOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
2575 {"AddMediaSampleReference", (PyCFunction)MediaObj_AddMediaSampleReference, 1,
2576 "(long dataOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
2577 {"GetMediaSample", (PyCFunction)MediaObj_GetMediaSample, 1,
2578 "(Handle dataOut, long maxSizeToGrow, TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
2579 {"GetMediaSampleReference", (PyCFunction)MediaObj_GetMediaSampleReference, 1,
2580 "(TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long dataOffset, long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
2581 {"SetMediaPreferredChunkSize", (PyCFunction)MediaObj_SetMediaPreferredChunkSize, 1,
2582 "(long maxChunkSize) -> None"},
2583 {"GetMediaPreferredChunkSize", (PyCFunction)MediaObj_GetMediaPreferredChunkSize, 1,
2584 "() -> (long maxChunkSize)"},
2585 {"SetMediaShadowSync", (PyCFunction)MediaObj_SetMediaShadowSync, 1,
2586 "(long frameDiffSampleNum, long syncSampleNum) -> None"},
2587 {"GetMediaShadowSync", (PyCFunction)MediaObj_GetMediaShadowSync, 1,
2588 "(long frameDiffSampleNum) -> (long syncSampleNum)"},
2589 {"GetMediaDataSize", (PyCFunction)MediaObj_GetMediaDataSize, 1,
2590 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
2591 {"GetMediaDataSize64", (PyCFunction)MediaObj_GetMediaDataSize64, 1,
2592 "(TimeValue startTime, TimeValue duration) -> (wide dataSize)"},
2593 {"GetMediaNextInterestingTime", (PyCFunction)MediaObj_GetMediaNextInterestingTime, 1,
2594 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
2595 {"GetMediaDataRef", (PyCFunction)MediaObj_GetMediaDataRef, 1,
2596 "(short index) -> (Handle dataRef, OSType dataRefType, long dataRefAttributes)"},
2597 {"SetMediaDataRef", (PyCFunction)MediaObj_SetMediaDataRef, 1,
2598 "(short index, Handle dataRef, OSType dataRefType) -> None"},
2599 {"SetMediaDataRefAttributes", (PyCFunction)MediaObj_SetMediaDataRefAttributes, 1,
2600 "(short index, long dataRefAttributes) -> None"},
2601 {"AddMediaDataRef", (PyCFunction)MediaObj_AddMediaDataRef, 1,
2602 "(Handle dataRef, OSType dataRefType) -> (short index)"},
2603 {"GetMediaDataRefCount", (PyCFunction)MediaObj_GetMediaDataRefCount, 1,
2604 "() -> (short count)"},
2605 {"SetMediaPlayHints", (PyCFunction)MediaObj_SetMediaPlayHints, 1,
2606 "(long flags, long flagsMask) -> None"},
2607 {"GetMediaPlayHints", (PyCFunction)MediaObj_GetMediaPlayHints, 1,
2608 "() -> (long flags)"},
2609 {"GetMediaNextInterestingTimeOnly", (PyCFunction)MediaObj_GetMediaNextInterestingTimeOnly, 1,
2610 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime)"},
2611 {NULL, NULL, 0}
2614 PyMethodChain MediaObj_chain = { MediaObj_methods, NULL };
2616 static PyObject *MediaObj_getattr(MediaObject *self, char *name)
2618 return Py_FindMethodInChain(&MediaObj_chain, (PyObject *)self, name);
2621 #define MediaObj_setattr NULL
2623 #define MediaObj_compare NULL
2625 #define MediaObj_repr NULL
2627 #define MediaObj_hash NULL
2629 PyTypeObject Media_Type = {
2630 PyObject_HEAD_INIT(&PyType_Type)
2631 0, /*ob_size*/
2632 "Media", /*tp_name*/
2633 sizeof(MediaObject), /*tp_basicsize*/
2634 0, /*tp_itemsize*/
2635 /* methods */
2636 (destructor) MediaObj_dealloc, /*tp_dealloc*/
2637 0, /*tp_print*/
2638 (getattrfunc) MediaObj_getattr, /*tp_getattr*/
2639 (setattrfunc) MediaObj_setattr, /*tp_setattr*/
2640 (cmpfunc) MediaObj_compare, /*tp_compare*/
2641 (reprfunc) MediaObj_repr, /*tp_repr*/
2642 (PyNumberMethods *)0, /* tp_as_number */
2643 (PySequenceMethods *)0, /* tp_as_sequence */
2644 (PyMappingMethods *)0, /* tp_as_mapping */
2645 (hashfunc) MediaObj_hash, /*tp_hash*/
2648 /* --------------------- End object type Media ---------------------- */
2651 /* ----------------------- Object type Track ------------------------ */
2653 PyTypeObject Track_Type;
2655 #define TrackObj_Check(x) ((x)->ob_type == &Track_Type)
2657 typedef struct TrackObject {
2658 PyObject_HEAD
2659 Track ob_itself;
2660 } TrackObject;
2662 PyObject *TrackObj_New(Track itself)
2664 TrackObject *it;
2665 if (itself == NULL) {
2666 PyErr_SetString(Qt_Error,"Cannot create null Track");
2667 return NULL;
2669 it = PyObject_NEW(TrackObject, &Track_Type);
2670 if (it == NULL) return NULL;
2671 it->ob_itself = itself;
2672 return (PyObject *)it;
2674 TrackObj_Convert(PyObject *v, Track *p_itself)
2676 if (!TrackObj_Check(v))
2678 PyErr_SetString(PyExc_TypeError, "Track required");
2679 return 0;
2681 *p_itself = ((TrackObject *)v)->ob_itself;
2682 return 1;
2685 static void TrackObj_dealloc(TrackObject *self)
2687 DisposeMovieTrack(self->ob_itself);
2688 PyMem_DEL(self);
2691 static PyObject *TrackObj_LoadTrackIntoRam(TrackObject *_self, PyObject *_args)
2693 PyObject *_res = NULL;
2694 OSErr _err;
2695 TimeValue time;
2696 TimeValue duration;
2697 long flags;
2698 if (!PyArg_ParseTuple(_args, "lll",
2699 &time,
2700 &duration,
2701 &flags))
2702 return NULL;
2703 _err = LoadTrackIntoRam(_self->ob_itself,
2704 time,
2705 duration,
2706 flags);
2707 if (_err != noErr) return PyMac_Error(_err);
2708 Py_INCREF(Py_None);
2709 _res = Py_None;
2710 return _res;
2713 static PyObject *TrackObj_GetTrackPict(TrackObject *_self, PyObject *_args)
2715 PyObject *_res = NULL;
2716 PicHandle _rv;
2717 TimeValue time;
2718 if (!PyArg_ParseTuple(_args, "l",
2719 &time))
2720 return NULL;
2721 _rv = GetTrackPict(_self->ob_itself,
2722 time);
2723 _res = Py_BuildValue("O&",
2724 ResObj_New, _rv);
2725 return _res;
2728 static PyObject *TrackObj_GetTrackClipRgn(TrackObject *_self, PyObject *_args)
2730 PyObject *_res = NULL;
2731 RgnHandle _rv;
2732 if (!PyArg_ParseTuple(_args, ""))
2733 return NULL;
2734 _rv = GetTrackClipRgn(_self->ob_itself);
2735 _res = Py_BuildValue("O&",
2736 ResObj_New, _rv);
2737 return _res;
2740 static PyObject *TrackObj_SetTrackClipRgn(TrackObject *_self, PyObject *_args)
2742 PyObject *_res = NULL;
2743 RgnHandle theClip;
2744 if (!PyArg_ParseTuple(_args, "O&",
2745 ResObj_Convert, &theClip))
2746 return NULL;
2747 SetTrackClipRgn(_self->ob_itself,
2748 theClip);
2749 Py_INCREF(Py_None);
2750 _res = Py_None;
2751 return _res;
2754 static PyObject *TrackObj_GetTrackDisplayBoundsRgn(TrackObject *_self, PyObject *_args)
2756 PyObject *_res = NULL;
2757 RgnHandle _rv;
2758 if (!PyArg_ParseTuple(_args, ""))
2759 return NULL;
2760 _rv = GetTrackDisplayBoundsRgn(_self->ob_itself);
2761 _res = Py_BuildValue("O&",
2762 ResObj_New, _rv);
2763 return _res;
2766 static PyObject *TrackObj_GetTrackMovieBoundsRgn(TrackObject *_self, PyObject *_args)
2768 PyObject *_res = NULL;
2769 RgnHandle _rv;
2770 if (!PyArg_ParseTuple(_args, ""))
2771 return NULL;
2772 _rv = GetTrackMovieBoundsRgn(_self->ob_itself);
2773 _res = Py_BuildValue("O&",
2774 ResObj_New, _rv);
2775 return _res;
2778 static PyObject *TrackObj_GetTrackBoundsRgn(TrackObject *_self, PyObject *_args)
2780 PyObject *_res = NULL;
2781 RgnHandle _rv;
2782 if (!PyArg_ParseTuple(_args, ""))
2783 return NULL;
2784 _rv = GetTrackBoundsRgn(_self->ob_itself);
2785 _res = Py_BuildValue("O&",
2786 ResObj_New, _rv);
2787 return _res;
2790 static PyObject *TrackObj_GetTrackMatte(TrackObject *_self, PyObject *_args)
2792 PyObject *_res = NULL;
2793 PixMapHandle _rv;
2794 if (!PyArg_ParseTuple(_args, ""))
2795 return NULL;
2796 _rv = GetTrackMatte(_self->ob_itself);
2797 _res = Py_BuildValue("O&",
2798 ResObj_New, _rv);
2799 return _res;
2802 static PyObject *TrackObj_SetTrackMatte(TrackObject *_self, PyObject *_args)
2804 PyObject *_res = NULL;
2805 PixMapHandle theMatte;
2806 if (!PyArg_ParseTuple(_args, "O&",
2807 ResObj_Convert, &theMatte))
2808 return NULL;
2809 SetTrackMatte(_self->ob_itself,
2810 theMatte);
2811 Py_INCREF(Py_None);
2812 _res = Py_None;
2813 return _res;
2816 static PyObject *TrackObj_GetTrackID(TrackObject *_self, PyObject *_args)
2818 PyObject *_res = NULL;
2819 long _rv;
2820 if (!PyArg_ParseTuple(_args, ""))
2821 return NULL;
2822 _rv = GetTrackID(_self->ob_itself);
2823 _res = Py_BuildValue("l",
2824 _rv);
2825 return _res;
2828 static PyObject *TrackObj_GetTrackMovie(TrackObject *_self, PyObject *_args)
2830 PyObject *_res = NULL;
2831 Movie _rv;
2832 if (!PyArg_ParseTuple(_args, ""))
2833 return NULL;
2834 _rv = GetTrackMovie(_self->ob_itself);
2835 _res = Py_BuildValue("O&",
2836 MovieObj_New, _rv);
2837 return _res;
2840 static PyObject *TrackObj_GetTrackCreationTime(TrackObject *_self, PyObject *_args)
2842 PyObject *_res = NULL;
2843 unsigned long _rv;
2844 if (!PyArg_ParseTuple(_args, ""))
2845 return NULL;
2846 _rv = GetTrackCreationTime(_self->ob_itself);
2847 _res = Py_BuildValue("l",
2848 _rv);
2849 return _res;
2852 static PyObject *TrackObj_GetTrackModificationTime(TrackObject *_self, PyObject *_args)
2854 PyObject *_res = NULL;
2855 unsigned long _rv;
2856 if (!PyArg_ParseTuple(_args, ""))
2857 return NULL;
2858 _rv = GetTrackModificationTime(_self->ob_itself);
2859 _res = Py_BuildValue("l",
2860 _rv);
2861 return _res;
2864 static PyObject *TrackObj_GetTrackEnabled(TrackObject *_self, PyObject *_args)
2866 PyObject *_res = NULL;
2867 Boolean _rv;
2868 if (!PyArg_ParseTuple(_args, ""))
2869 return NULL;
2870 _rv = GetTrackEnabled(_self->ob_itself);
2871 _res = Py_BuildValue("b",
2872 _rv);
2873 return _res;
2876 static PyObject *TrackObj_SetTrackEnabled(TrackObject *_self, PyObject *_args)
2878 PyObject *_res = NULL;
2879 Boolean isEnabled;
2880 if (!PyArg_ParseTuple(_args, "b",
2881 &isEnabled))
2882 return NULL;
2883 SetTrackEnabled(_self->ob_itself,
2884 isEnabled);
2885 Py_INCREF(Py_None);
2886 _res = Py_None;
2887 return _res;
2890 static PyObject *TrackObj_GetTrackUsage(TrackObject *_self, PyObject *_args)
2892 PyObject *_res = NULL;
2893 long _rv;
2894 if (!PyArg_ParseTuple(_args, ""))
2895 return NULL;
2896 _rv = GetTrackUsage(_self->ob_itself);
2897 _res = Py_BuildValue("l",
2898 _rv);
2899 return _res;
2902 static PyObject *TrackObj_SetTrackUsage(TrackObject *_self, PyObject *_args)
2904 PyObject *_res = NULL;
2905 long usage;
2906 if (!PyArg_ParseTuple(_args, "l",
2907 &usage))
2908 return NULL;
2909 SetTrackUsage(_self->ob_itself,
2910 usage);
2911 Py_INCREF(Py_None);
2912 _res = Py_None;
2913 return _res;
2916 static PyObject *TrackObj_GetTrackDuration(TrackObject *_self, PyObject *_args)
2918 PyObject *_res = NULL;
2919 TimeValue _rv;
2920 if (!PyArg_ParseTuple(_args, ""))
2921 return NULL;
2922 _rv = GetTrackDuration(_self->ob_itself);
2923 _res = Py_BuildValue("l",
2924 _rv);
2925 return _res;
2928 static PyObject *TrackObj_GetTrackOffset(TrackObject *_self, PyObject *_args)
2930 PyObject *_res = NULL;
2931 TimeValue _rv;
2932 if (!PyArg_ParseTuple(_args, ""))
2933 return NULL;
2934 _rv = GetTrackOffset(_self->ob_itself);
2935 _res = Py_BuildValue("l",
2936 _rv);
2937 return _res;
2940 static PyObject *TrackObj_SetTrackOffset(TrackObject *_self, PyObject *_args)
2942 PyObject *_res = NULL;
2943 TimeValue movieOffsetTime;
2944 if (!PyArg_ParseTuple(_args, "l",
2945 &movieOffsetTime))
2946 return NULL;
2947 SetTrackOffset(_self->ob_itself,
2948 movieOffsetTime);
2949 Py_INCREF(Py_None);
2950 _res = Py_None;
2951 return _res;
2954 static PyObject *TrackObj_GetTrackLayer(TrackObject *_self, PyObject *_args)
2956 PyObject *_res = NULL;
2957 short _rv;
2958 if (!PyArg_ParseTuple(_args, ""))
2959 return NULL;
2960 _rv = GetTrackLayer(_self->ob_itself);
2961 _res = Py_BuildValue("h",
2962 _rv);
2963 return _res;
2966 static PyObject *TrackObj_SetTrackLayer(TrackObject *_self, PyObject *_args)
2968 PyObject *_res = NULL;
2969 short layer;
2970 if (!PyArg_ParseTuple(_args, "h",
2971 &layer))
2972 return NULL;
2973 SetTrackLayer(_self->ob_itself,
2974 layer);
2975 Py_INCREF(Py_None);
2976 _res = Py_None;
2977 return _res;
2980 static PyObject *TrackObj_GetTrackAlternate(TrackObject *_self, PyObject *_args)
2982 PyObject *_res = NULL;
2983 Track _rv;
2984 if (!PyArg_ParseTuple(_args, ""))
2985 return NULL;
2986 _rv = GetTrackAlternate(_self->ob_itself);
2987 _res = Py_BuildValue("O&",
2988 TrackObj_New, _rv);
2989 return _res;
2992 static PyObject *TrackObj_SetTrackAlternate(TrackObject *_self, PyObject *_args)
2994 PyObject *_res = NULL;
2995 Track alternateT;
2996 if (!PyArg_ParseTuple(_args, "O&",
2997 TrackObj_Convert, &alternateT))
2998 return NULL;
2999 SetTrackAlternate(_self->ob_itself,
3000 alternateT);
3001 Py_INCREF(Py_None);
3002 _res = Py_None;
3003 return _res;
3006 static PyObject *TrackObj_GetTrackVolume(TrackObject *_self, PyObject *_args)
3008 PyObject *_res = NULL;
3009 short _rv;
3010 if (!PyArg_ParseTuple(_args, ""))
3011 return NULL;
3012 _rv = GetTrackVolume(_self->ob_itself);
3013 _res = Py_BuildValue("h",
3014 _rv);
3015 return _res;
3018 static PyObject *TrackObj_SetTrackVolume(TrackObject *_self, PyObject *_args)
3020 PyObject *_res = NULL;
3021 short volume;
3022 if (!PyArg_ParseTuple(_args, "h",
3023 &volume))
3024 return NULL;
3025 SetTrackVolume(_self->ob_itself,
3026 volume);
3027 Py_INCREF(Py_None);
3028 _res = Py_None;
3029 return _res;
3032 static PyObject *TrackObj_GetTrackDimensions(TrackObject *_self, PyObject *_args)
3034 PyObject *_res = NULL;
3035 Fixed width;
3036 Fixed height;
3037 if (!PyArg_ParseTuple(_args, ""))
3038 return NULL;
3039 GetTrackDimensions(_self->ob_itself,
3040 &width,
3041 &height);
3042 _res = Py_BuildValue("O&O&",
3043 PyMac_BuildFixed, width,
3044 PyMac_BuildFixed, height);
3045 return _res;
3048 static PyObject *TrackObj_SetTrackDimensions(TrackObject *_self, PyObject *_args)
3050 PyObject *_res = NULL;
3051 Fixed width;
3052 Fixed height;
3053 if (!PyArg_ParseTuple(_args, "O&O&",
3054 PyMac_GetFixed, &width,
3055 PyMac_GetFixed, &height))
3056 return NULL;
3057 SetTrackDimensions(_self->ob_itself,
3058 width,
3059 height);
3060 Py_INCREF(Py_None);
3061 _res = Py_None;
3062 return _res;
3065 static PyObject *TrackObj_GetTrackUserData(TrackObject *_self, PyObject *_args)
3067 PyObject *_res = NULL;
3068 UserData _rv;
3069 if (!PyArg_ParseTuple(_args, ""))
3070 return NULL;
3071 _rv = GetTrackUserData(_self->ob_itself);
3072 _res = Py_BuildValue("O&",
3073 UserDataObj_New, _rv);
3074 return _res;
3077 static PyObject *TrackObj_GetTrackSoundLocalizationSettings(TrackObject *_self, PyObject *_args)
3079 PyObject *_res = NULL;
3080 OSErr _err;
3081 Handle settings;
3082 if (!PyArg_ParseTuple(_args, ""))
3083 return NULL;
3084 _err = GetTrackSoundLocalizationSettings(_self->ob_itself,
3085 &settings);
3086 if (_err != noErr) return PyMac_Error(_err);
3087 _res = Py_BuildValue("O&",
3088 ResObj_New, settings);
3089 return _res;
3092 static PyObject *TrackObj_SetTrackSoundLocalizationSettings(TrackObject *_self, PyObject *_args)
3094 PyObject *_res = NULL;
3095 OSErr _err;
3096 Handle settings;
3097 if (!PyArg_ParseTuple(_args, "O&",
3098 ResObj_Convert, &settings))
3099 return NULL;
3100 _err = SetTrackSoundLocalizationSettings(_self->ob_itself,
3101 settings);
3102 if (_err != noErr) return PyMac_Error(_err);
3103 Py_INCREF(Py_None);
3104 _res = Py_None;
3105 return _res;
3108 static PyObject *TrackObj_NewTrackMedia(TrackObject *_self, PyObject *_args)
3110 PyObject *_res = NULL;
3111 Media _rv;
3112 OSType mediaType;
3113 TimeScale timeScale;
3114 Handle dataRef;
3115 OSType dataRefType;
3116 if (!PyArg_ParseTuple(_args, "O&lO&O&",
3117 PyMac_GetOSType, &mediaType,
3118 &timeScale,
3119 ResObj_Convert, &dataRef,
3120 PyMac_GetOSType, &dataRefType))
3121 return NULL;
3122 _rv = NewTrackMedia(_self->ob_itself,
3123 mediaType,
3124 timeScale,
3125 dataRef,
3126 dataRefType);
3127 _res = Py_BuildValue("O&",
3128 MediaObj_New, _rv);
3129 return _res;
3132 static PyObject *TrackObj_GetTrackMedia(TrackObject *_self, PyObject *_args)
3134 PyObject *_res = NULL;
3135 Media _rv;
3136 if (!PyArg_ParseTuple(_args, ""))
3137 return NULL;
3138 _rv = GetTrackMedia(_self->ob_itself);
3139 _res = Py_BuildValue("O&",
3140 MediaObj_New, _rv);
3141 return _res;
3144 static PyObject *TrackObj_InsertMediaIntoTrack(TrackObject *_self, PyObject *_args)
3146 PyObject *_res = NULL;
3147 OSErr _err;
3148 TimeValue trackStart;
3149 TimeValue mediaTime;
3150 TimeValue mediaDuration;
3151 Fixed mediaRate;
3152 if (!PyArg_ParseTuple(_args, "lllO&",
3153 &trackStart,
3154 &mediaTime,
3155 &mediaDuration,
3156 PyMac_GetFixed, &mediaRate))
3157 return NULL;
3158 _err = InsertMediaIntoTrack(_self->ob_itself,
3159 trackStart,
3160 mediaTime,
3161 mediaDuration,
3162 mediaRate);
3163 if (_err != noErr) return PyMac_Error(_err);
3164 Py_INCREF(Py_None);
3165 _res = Py_None;
3166 return _res;
3169 static PyObject *TrackObj_InsertTrackSegment(TrackObject *_self, PyObject *_args)
3171 PyObject *_res = NULL;
3172 OSErr _err;
3173 Track dstTrack;
3174 TimeValue srcIn;
3175 TimeValue srcDuration;
3176 TimeValue dstIn;
3177 if (!PyArg_ParseTuple(_args, "O&lll",
3178 TrackObj_Convert, &dstTrack,
3179 &srcIn,
3180 &srcDuration,
3181 &dstIn))
3182 return NULL;
3183 _err = InsertTrackSegment(_self->ob_itself,
3184 dstTrack,
3185 srcIn,
3186 srcDuration,
3187 dstIn);
3188 if (_err != noErr) return PyMac_Error(_err);
3189 Py_INCREF(Py_None);
3190 _res = Py_None;
3191 return _res;
3194 static PyObject *TrackObj_InsertEmptyTrackSegment(TrackObject *_self, PyObject *_args)
3196 PyObject *_res = NULL;
3197 OSErr _err;
3198 TimeValue dstIn;
3199 TimeValue dstDuration;
3200 if (!PyArg_ParseTuple(_args, "ll",
3201 &dstIn,
3202 &dstDuration))
3203 return NULL;
3204 _err = InsertEmptyTrackSegment(_self->ob_itself,
3205 dstIn,
3206 dstDuration);
3207 if (_err != noErr) return PyMac_Error(_err);
3208 Py_INCREF(Py_None);
3209 _res = Py_None;
3210 return _res;
3213 static PyObject *TrackObj_DeleteTrackSegment(TrackObject *_self, PyObject *_args)
3215 PyObject *_res = NULL;
3216 OSErr _err;
3217 TimeValue startTime;
3218 TimeValue duration;
3219 if (!PyArg_ParseTuple(_args, "ll",
3220 &startTime,
3221 &duration))
3222 return NULL;
3223 _err = DeleteTrackSegment(_self->ob_itself,
3224 startTime,
3225 duration);
3226 if (_err != noErr) return PyMac_Error(_err);
3227 Py_INCREF(Py_None);
3228 _res = Py_None;
3229 return _res;
3232 static PyObject *TrackObj_ScaleTrackSegment(TrackObject *_self, PyObject *_args)
3234 PyObject *_res = NULL;
3235 OSErr _err;
3236 TimeValue startTime;
3237 TimeValue oldDuration;
3238 TimeValue newDuration;
3239 if (!PyArg_ParseTuple(_args, "lll",
3240 &startTime,
3241 &oldDuration,
3242 &newDuration))
3243 return NULL;
3244 _err = ScaleTrackSegment(_self->ob_itself,
3245 startTime,
3246 oldDuration,
3247 newDuration);
3248 if (_err != noErr) return PyMac_Error(_err);
3249 Py_INCREF(Py_None);
3250 _res = Py_None;
3251 return _res;
3254 static PyObject *TrackObj_IsScrapMovie(TrackObject *_self, PyObject *_args)
3256 PyObject *_res = NULL;
3257 Component _rv;
3258 if (!PyArg_ParseTuple(_args, ""))
3259 return NULL;
3260 _rv = IsScrapMovie(_self->ob_itself);
3261 _res = Py_BuildValue("O&",
3262 CmpObj_New, _rv);
3263 return _res;
3266 static PyObject *TrackObj_CopyTrackSettings(TrackObject *_self, PyObject *_args)
3268 PyObject *_res = NULL;
3269 OSErr _err;
3270 Track dstTrack;
3271 if (!PyArg_ParseTuple(_args, "O&",
3272 TrackObj_Convert, &dstTrack))
3273 return NULL;
3274 _err = CopyTrackSettings(_self->ob_itself,
3275 dstTrack);
3276 if (_err != noErr) return PyMac_Error(_err);
3277 Py_INCREF(Py_None);
3278 _res = Py_None;
3279 return _res;
3282 static PyObject *TrackObj_AddEmptyTrackToMovie(TrackObject *_self, PyObject *_args)
3284 PyObject *_res = NULL;
3285 OSErr _err;
3286 Movie dstMovie;
3287 Handle dataRef;
3288 OSType dataRefType;
3289 Track dstTrack;
3290 if (!PyArg_ParseTuple(_args, "O&O&O&",
3291 MovieObj_Convert, &dstMovie,
3292 ResObj_Convert, &dataRef,
3293 PyMac_GetOSType, &dataRefType))
3294 return NULL;
3295 _err = AddEmptyTrackToMovie(_self->ob_itself,
3296 dstMovie,
3297 dataRef,
3298 dataRefType,
3299 &dstTrack);
3300 if (_err != noErr) return PyMac_Error(_err);
3301 _res = Py_BuildValue("O&",
3302 TrackObj_New, dstTrack);
3303 return _res;
3306 static PyObject *TrackObj_AddTrackReference(TrackObject *_self, PyObject *_args)
3308 PyObject *_res = NULL;
3309 OSErr _err;
3310 Track refTrack;
3311 OSType refType;
3312 long addedIndex;
3313 if (!PyArg_ParseTuple(_args, "O&O&",
3314 TrackObj_Convert, &refTrack,
3315 PyMac_GetOSType, &refType))
3316 return NULL;
3317 _err = AddTrackReference(_self->ob_itself,
3318 refTrack,
3319 refType,
3320 &addedIndex);
3321 if (_err != noErr) return PyMac_Error(_err);
3322 _res = Py_BuildValue("l",
3323 addedIndex);
3324 return _res;
3327 static PyObject *TrackObj_DeleteTrackReference(TrackObject *_self, PyObject *_args)
3329 PyObject *_res = NULL;
3330 OSErr _err;
3331 OSType refType;
3332 long index;
3333 if (!PyArg_ParseTuple(_args, "O&l",
3334 PyMac_GetOSType, &refType,
3335 &index))
3336 return NULL;
3337 _err = DeleteTrackReference(_self->ob_itself,
3338 refType,
3339 index);
3340 if (_err != noErr) return PyMac_Error(_err);
3341 Py_INCREF(Py_None);
3342 _res = Py_None;
3343 return _res;
3346 static PyObject *TrackObj_SetTrackReference(TrackObject *_self, PyObject *_args)
3348 PyObject *_res = NULL;
3349 OSErr _err;
3350 Track refTrack;
3351 OSType refType;
3352 long index;
3353 if (!PyArg_ParseTuple(_args, "O&O&l",
3354 TrackObj_Convert, &refTrack,
3355 PyMac_GetOSType, &refType,
3356 &index))
3357 return NULL;
3358 _err = SetTrackReference(_self->ob_itself,
3359 refTrack,
3360 refType,
3361 index);
3362 if (_err != noErr) return PyMac_Error(_err);
3363 Py_INCREF(Py_None);
3364 _res = Py_None;
3365 return _res;
3368 static PyObject *TrackObj_GetTrackReference(TrackObject *_self, PyObject *_args)
3370 PyObject *_res = NULL;
3371 Track _rv;
3372 OSType refType;
3373 long index;
3374 if (!PyArg_ParseTuple(_args, "O&l",
3375 PyMac_GetOSType, &refType,
3376 &index))
3377 return NULL;
3378 _rv = GetTrackReference(_self->ob_itself,
3379 refType,
3380 index);
3381 _res = Py_BuildValue("O&",
3382 TrackObj_New, _rv);
3383 return _res;
3386 static PyObject *TrackObj_GetNextTrackReferenceType(TrackObject *_self, PyObject *_args)
3388 PyObject *_res = NULL;
3389 OSType _rv;
3390 OSType refType;
3391 if (!PyArg_ParseTuple(_args, "O&",
3392 PyMac_GetOSType, &refType))
3393 return NULL;
3394 _rv = GetNextTrackReferenceType(_self->ob_itself,
3395 refType);
3396 _res = Py_BuildValue("O&",
3397 PyMac_BuildOSType, _rv);
3398 return _res;
3401 static PyObject *TrackObj_GetTrackReferenceCount(TrackObject *_self, PyObject *_args)
3403 PyObject *_res = NULL;
3404 long _rv;
3405 OSType refType;
3406 if (!PyArg_ParseTuple(_args, "O&",
3407 PyMac_GetOSType, &refType))
3408 return NULL;
3409 _rv = GetTrackReferenceCount(_self->ob_itself,
3410 refType);
3411 _res = Py_BuildValue("l",
3412 _rv);
3413 return _res;
3416 static PyObject *TrackObj_GetTrackEditRate(TrackObject *_self, PyObject *_args)
3418 PyObject *_res = NULL;
3419 Fixed _rv;
3420 TimeValue atTime;
3421 if (!PyArg_ParseTuple(_args, "l",
3422 &atTime))
3423 return NULL;
3424 _rv = GetTrackEditRate(_self->ob_itself,
3425 atTime);
3426 _res = Py_BuildValue("O&",
3427 PyMac_BuildFixed, _rv);
3428 return _res;
3431 static PyObject *TrackObj_GetTrackDataSize(TrackObject *_self, PyObject *_args)
3433 PyObject *_res = NULL;
3434 long _rv;
3435 TimeValue startTime;
3436 TimeValue duration;
3437 if (!PyArg_ParseTuple(_args, "ll",
3438 &startTime,
3439 &duration))
3440 return NULL;
3441 _rv = GetTrackDataSize(_self->ob_itself,
3442 startTime,
3443 duration);
3444 _res = Py_BuildValue("l",
3445 _rv);
3446 return _res;
3449 static PyObject *TrackObj_GetTrackDataSize64(TrackObject *_self, PyObject *_args)
3451 PyObject *_res = NULL;
3452 OSErr _err;
3453 TimeValue startTime;
3454 TimeValue duration;
3455 wide dataSize;
3456 if (!PyArg_ParseTuple(_args, "ll",
3457 &startTime,
3458 &duration))
3459 return NULL;
3460 _err = GetTrackDataSize64(_self->ob_itself,
3461 startTime,
3462 duration,
3463 &dataSize);
3464 if (_err != noErr) return PyMac_Error(_err);
3465 _res = Py_BuildValue("O&",
3466 PyMac_Buildwide, dataSize);
3467 return _res;
3470 static PyObject *TrackObj_PtInTrack(TrackObject *_self, PyObject *_args)
3472 PyObject *_res = NULL;
3473 Boolean _rv;
3474 Point pt;
3475 if (!PyArg_ParseTuple(_args, "O&",
3476 PyMac_GetPoint, &pt))
3477 return NULL;
3478 _rv = PtInTrack(_self->ob_itself,
3479 pt);
3480 _res = Py_BuildValue("b",
3481 _rv);
3482 return _res;
3485 static PyObject *TrackObj_GetTrackNextInterestingTime(TrackObject *_self, PyObject *_args)
3487 PyObject *_res = NULL;
3488 short interestingTimeFlags;
3489 TimeValue time;
3490 Fixed rate;
3491 TimeValue interestingTime;
3492 TimeValue interestingDuration;
3493 if (!PyArg_ParseTuple(_args, "hlO&",
3494 &interestingTimeFlags,
3495 &time,
3496 PyMac_GetFixed, &rate))
3497 return NULL;
3498 GetTrackNextInterestingTime(_self->ob_itself,
3499 interestingTimeFlags,
3500 time,
3501 rate,
3502 &interestingTime,
3503 &interestingDuration);
3504 _res = Py_BuildValue("ll",
3505 interestingTime,
3506 interestingDuration);
3507 return _res;
3510 static PyObject *TrackObj_GetTrackSegmentDisplayBoundsRgn(TrackObject *_self, PyObject *_args)
3512 PyObject *_res = NULL;
3513 RgnHandle _rv;
3514 TimeValue time;
3515 TimeValue duration;
3516 if (!PyArg_ParseTuple(_args, "ll",
3517 &time,
3518 &duration))
3519 return NULL;
3520 _rv = GetTrackSegmentDisplayBoundsRgn(_self->ob_itself,
3521 time,
3522 duration);
3523 _res = Py_BuildValue("O&",
3524 ResObj_New, _rv);
3525 return _res;
3528 static PyObject *TrackObj_GetTrackStatus(TrackObject *_self, PyObject *_args)
3530 PyObject *_res = NULL;
3531 ComponentResult _rv;
3532 if (!PyArg_ParseTuple(_args, ""))
3533 return NULL;
3534 _rv = GetTrackStatus(_self->ob_itself);
3535 _res = Py_BuildValue("l",
3536 _rv);
3537 return _res;
3540 static PyObject *TrackObj_SetTrackLoadSettings(TrackObject *_self, PyObject *_args)
3542 PyObject *_res = NULL;
3543 TimeValue preloadTime;
3544 TimeValue preloadDuration;
3545 long preloadFlags;
3546 long defaultHints;
3547 if (!PyArg_ParseTuple(_args, "llll",
3548 &preloadTime,
3549 &preloadDuration,
3550 &preloadFlags,
3551 &defaultHints))
3552 return NULL;
3553 SetTrackLoadSettings(_self->ob_itself,
3554 preloadTime,
3555 preloadDuration,
3556 preloadFlags,
3557 defaultHints);
3558 Py_INCREF(Py_None);
3559 _res = Py_None;
3560 return _res;
3563 static PyObject *TrackObj_GetTrackLoadSettings(TrackObject *_self, PyObject *_args)
3565 PyObject *_res = NULL;
3566 TimeValue preloadTime;
3567 TimeValue preloadDuration;
3568 long preloadFlags;
3569 long defaultHints;
3570 if (!PyArg_ParseTuple(_args, ""))
3571 return NULL;
3572 GetTrackLoadSettings(_self->ob_itself,
3573 &preloadTime,
3574 &preloadDuration,
3575 &preloadFlags,
3576 &defaultHints);
3577 _res = Py_BuildValue("llll",
3578 preloadTime,
3579 preloadDuration,
3580 preloadFlags,
3581 defaultHints);
3582 return _res;
3585 static PyMethodDef TrackObj_methods[] = {
3586 {"LoadTrackIntoRam", (PyCFunction)TrackObj_LoadTrackIntoRam, 1,
3587 "(TimeValue time, TimeValue duration, long flags) -> None"},
3588 {"GetTrackPict", (PyCFunction)TrackObj_GetTrackPict, 1,
3589 "(TimeValue time) -> (PicHandle _rv)"},
3590 {"GetTrackClipRgn", (PyCFunction)TrackObj_GetTrackClipRgn, 1,
3591 "() -> (RgnHandle _rv)"},
3592 {"SetTrackClipRgn", (PyCFunction)TrackObj_SetTrackClipRgn, 1,
3593 "(RgnHandle theClip) -> None"},
3594 {"GetTrackDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackDisplayBoundsRgn, 1,
3595 "() -> (RgnHandle _rv)"},
3596 {"GetTrackMovieBoundsRgn", (PyCFunction)TrackObj_GetTrackMovieBoundsRgn, 1,
3597 "() -> (RgnHandle _rv)"},
3598 {"GetTrackBoundsRgn", (PyCFunction)TrackObj_GetTrackBoundsRgn, 1,
3599 "() -> (RgnHandle _rv)"},
3600 {"GetTrackMatte", (PyCFunction)TrackObj_GetTrackMatte, 1,
3601 "() -> (PixMapHandle _rv)"},
3602 {"SetTrackMatte", (PyCFunction)TrackObj_SetTrackMatte, 1,
3603 "(PixMapHandle theMatte) -> None"},
3604 {"GetTrackID", (PyCFunction)TrackObj_GetTrackID, 1,
3605 "() -> (long _rv)"},
3606 {"GetTrackMovie", (PyCFunction)TrackObj_GetTrackMovie, 1,
3607 "() -> (Movie _rv)"},
3608 {"GetTrackCreationTime", (PyCFunction)TrackObj_GetTrackCreationTime, 1,
3609 "() -> (unsigned long _rv)"},
3610 {"GetTrackModificationTime", (PyCFunction)TrackObj_GetTrackModificationTime, 1,
3611 "() -> (unsigned long _rv)"},
3612 {"GetTrackEnabled", (PyCFunction)TrackObj_GetTrackEnabled, 1,
3613 "() -> (Boolean _rv)"},
3614 {"SetTrackEnabled", (PyCFunction)TrackObj_SetTrackEnabled, 1,
3615 "(Boolean isEnabled) -> None"},
3616 {"GetTrackUsage", (PyCFunction)TrackObj_GetTrackUsage, 1,
3617 "() -> (long _rv)"},
3618 {"SetTrackUsage", (PyCFunction)TrackObj_SetTrackUsage, 1,
3619 "(long usage) -> None"},
3620 {"GetTrackDuration", (PyCFunction)TrackObj_GetTrackDuration, 1,
3621 "() -> (TimeValue _rv)"},
3622 {"GetTrackOffset", (PyCFunction)TrackObj_GetTrackOffset, 1,
3623 "() -> (TimeValue _rv)"},
3624 {"SetTrackOffset", (PyCFunction)TrackObj_SetTrackOffset, 1,
3625 "(TimeValue movieOffsetTime) -> None"},
3626 {"GetTrackLayer", (PyCFunction)TrackObj_GetTrackLayer, 1,
3627 "() -> (short _rv)"},
3628 {"SetTrackLayer", (PyCFunction)TrackObj_SetTrackLayer, 1,
3629 "(short layer) -> None"},
3630 {"GetTrackAlternate", (PyCFunction)TrackObj_GetTrackAlternate, 1,
3631 "() -> (Track _rv)"},
3632 {"SetTrackAlternate", (PyCFunction)TrackObj_SetTrackAlternate, 1,
3633 "(Track alternateT) -> None"},
3634 {"GetTrackVolume", (PyCFunction)TrackObj_GetTrackVolume, 1,
3635 "() -> (short _rv)"},
3636 {"SetTrackVolume", (PyCFunction)TrackObj_SetTrackVolume, 1,
3637 "(short volume) -> None"},
3638 {"GetTrackDimensions", (PyCFunction)TrackObj_GetTrackDimensions, 1,
3639 "() -> (Fixed width, Fixed height)"},
3640 {"SetTrackDimensions", (PyCFunction)TrackObj_SetTrackDimensions, 1,
3641 "(Fixed width, Fixed height) -> None"},
3642 {"GetTrackUserData", (PyCFunction)TrackObj_GetTrackUserData, 1,
3643 "() -> (UserData _rv)"},
3644 {"GetTrackSoundLocalizationSettings", (PyCFunction)TrackObj_GetTrackSoundLocalizationSettings, 1,
3645 "() -> (Handle settings)"},
3646 {"SetTrackSoundLocalizationSettings", (PyCFunction)TrackObj_SetTrackSoundLocalizationSettings, 1,
3647 "(Handle settings) -> None"},
3648 {"NewTrackMedia", (PyCFunction)TrackObj_NewTrackMedia, 1,
3649 "(OSType mediaType, TimeScale timeScale, Handle dataRef, OSType dataRefType) -> (Media _rv)"},
3650 {"GetTrackMedia", (PyCFunction)TrackObj_GetTrackMedia, 1,
3651 "() -> (Media _rv)"},
3652 {"InsertMediaIntoTrack", (PyCFunction)TrackObj_InsertMediaIntoTrack, 1,
3653 "(TimeValue trackStart, TimeValue mediaTime, TimeValue mediaDuration, Fixed mediaRate) -> None"},
3654 {"InsertTrackSegment", (PyCFunction)TrackObj_InsertTrackSegment, 1,
3655 "(Track dstTrack, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
3656 {"InsertEmptyTrackSegment", (PyCFunction)TrackObj_InsertEmptyTrackSegment, 1,
3657 "(TimeValue dstIn, TimeValue dstDuration) -> None"},
3658 {"DeleteTrackSegment", (PyCFunction)TrackObj_DeleteTrackSegment, 1,
3659 "(TimeValue startTime, TimeValue duration) -> None"},
3660 {"ScaleTrackSegment", (PyCFunction)TrackObj_ScaleTrackSegment, 1,
3661 "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
3662 {"IsScrapMovie", (PyCFunction)TrackObj_IsScrapMovie, 1,
3663 "() -> (Component _rv)"},
3664 {"CopyTrackSettings", (PyCFunction)TrackObj_CopyTrackSettings, 1,
3665 "(Track dstTrack) -> None"},
3666 {"AddEmptyTrackToMovie", (PyCFunction)TrackObj_AddEmptyTrackToMovie, 1,
3667 "(Movie dstMovie, Handle dataRef, OSType dataRefType) -> (Track dstTrack)"},
3668 {"AddTrackReference", (PyCFunction)TrackObj_AddTrackReference, 1,
3669 "(Track refTrack, OSType refType) -> (long addedIndex)"},
3670 {"DeleteTrackReference", (PyCFunction)TrackObj_DeleteTrackReference, 1,
3671 "(OSType refType, long index) -> None"},
3672 {"SetTrackReference", (PyCFunction)TrackObj_SetTrackReference, 1,
3673 "(Track refTrack, OSType refType, long index) -> None"},
3674 {"GetTrackReference", (PyCFunction)TrackObj_GetTrackReference, 1,
3675 "(OSType refType, long index) -> (Track _rv)"},
3676 {"GetNextTrackReferenceType", (PyCFunction)TrackObj_GetNextTrackReferenceType, 1,
3677 "(OSType refType) -> (OSType _rv)"},
3678 {"GetTrackReferenceCount", (PyCFunction)TrackObj_GetTrackReferenceCount, 1,
3679 "(OSType refType) -> (long _rv)"},
3680 {"GetTrackEditRate", (PyCFunction)TrackObj_GetTrackEditRate, 1,
3681 "(TimeValue atTime) -> (Fixed _rv)"},
3682 {"GetTrackDataSize", (PyCFunction)TrackObj_GetTrackDataSize, 1,
3683 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
3684 {"GetTrackDataSize64", (PyCFunction)TrackObj_GetTrackDataSize64, 1,
3685 "(TimeValue startTime, TimeValue duration) -> (wide dataSize)"},
3686 {"PtInTrack", (PyCFunction)TrackObj_PtInTrack, 1,
3687 "(Point pt) -> (Boolean _rv)"},
3688 {"GetTrackNextInterestingTime", (PyCFunction)TrackObj_GetTrackNextInterestingTime, 1,
3689 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
3690 {"GetTrackSegmentDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackSegmentDisplayBoundsRgn, 1,
3691 "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
3692 {"GetTrackStatus", (PyCFunction)TrackObj_GetTrackStatus, 1,
3693 "() -> (ComponentResult _rv)"},
3694 {"SetTrackLoadSettings", (PyCFunction)TrackObj_SetTrackLoadSettings, 1,
3695 "(TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints) -> None"},
3696 {"GetTrackLoadSettings", (PyCFunction)TrackObj_GetTrackLoadSettings, 1,
3697 "() -> (TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints)"},
3698 {NULL, NULL, 0}
3701 PyMethodChain TrackObj_chain = { TrackObj_methods, NULL };
3703 static PyObject *TrackObj_getattr(TrackObject *self, char *name)
3705 return Py_FindMethodInChain(&TrackObj_chain, (PyObject *)self, name);
3708 #define TrackObj_setattr NULL
3710 #define TrackObj_compare NULL
3712 #define TrackObj_repr NULL
3714 #define TrackObj_hash NULL
3716 PyTypeObject Track_Type = {
3717 PyObject_HEAD_INIT(&PyType_Type)
3718 0, /*ob_size*/
3719 "Track", /*tp_name*/
3720 sizeof(TrackObject), /*tp_basicsize*/
3721 0, /*tp_itemsize*/
3722 /* methods */
3723 (destructor) TrackObj_dealloc, /*tp_dealloc*/
3724 0, /*tp_print*/
3725 (getattrfunc) TrackObj_getattr, /*tp_getattr*/
3726 (setattrfunc) TrackObj_setattr, /*tp_setattr*/
3727 (cmpfunc) TrackObj_compare, /*tp_compare*/
3728 (reprfunc) TrackObj_repr, /*tp_repr*/
3729 (PyNumberMethods *)0, /* tp_as_number */
3730 (PySequenceMethods *)0, /* tp_as_sequence */
3731 (PyMappingMethods *)0, /* tp_as_mapping */
3732 (hashfunc) TrackObj_hash, /*tp_hash*/
3735 /* --------------------- End object type Track ---------------------- */
3738 /* ----------------------- Object type Movie ------------------------ */
3740 PyTypeObject Movie_Type;
3742 #define MovieObj_Check(x) ((x)->ob_type == &Movie_Type)
3744 typedef struct MovieObject {
3745 PyObject_HEAD
3746 Movie ob_itself;
3747 } MovieObject;
3749 PyObject *MovieObj_New(Movie itself)
3751 MovieObject *it;
3752 if (itself == NULL) {
3753 PyErr_SetString(Qt_Error,"Cannot create null Movie");
3754 return NULL;
3756 it = PyObject_NEW(MovieObject, &Movie_Type);
3757 if (it == NULL) return NULL;
3758 it->ob_itself = itself;
3759 return (PyObject *)it;
3761 MovieObj_Convert(PyObject *v, Movie *p_itself)
3763 if (!MovieObj_Check(v))
3765 PyErr_SetString(PyExc_TypeError, "Movie required");
3766 return 0;
3768 *p_itself = ((MovieObject *)v)->ob_itself;
3769 return 1;
3772 static void MovieObj_dealloc(MovieObject *self)
3774 DisposeMovie(self->ob_itself);
3775 PyMem_DEL(self);
3778 static PyObject *MovieObj_MoviesTask(MovieObject *_self, PyObject *_args)
3780 PyObject *_res = NULL;
3781 long maxMilliSecToUse;
3782 if (!PyArg_ParseTuple(_args, "l",
3783 &maxMilliSecToUse))
3784 return NULL;
3785 MoviesTask(_self->ob_itself,
3786 maxMilliSecToUse);
3787 Py_INCREF(Py_None);
3788 _res = Py_None;
3789 return _res;
3792 static PyObject *MovieObj_PrerollMovie(MovieObject *_self, PyObject *_args)
3794 PyObject *_res = NULL;
3795 OSErr _err;
3796 TimeValue time;
3797 Fixed Rate;
3798 if (!PyArg_ParseTuple(_args, "lO&",
3799 &time,
3800 PyMac_GetFixed, &Rate))
3801 return NULL;
3802 _err = PrerollMovie(_self->ob_itself,
3803 time,
3804 Rate);
3805 if (_err != noErr) return PyMac_Error(_err);
3806 Py_INCREF(Py_None);
3807 _res = Py_None;
3808 return _res;
3811 static PyObject *MovieObj_AbortPrePrerollMovie(MovieObject *_self, PyObject *_args)
3813 PyObject *_res = NULL;
3814 OSErr err;
3815 if (!PyArg_ParseTuple(_args, "h",
3816 &err))
3817 return NULL;
3818 AbortPrePrerollMovie(_self->ob_itself,
3819 err);
3820 Py_INCREF(Py_None);
3821 _res = Py_None;
3822 return _res;
3825 static PyObject *MovieObj_LoadMovieIntoRam(MovieObject *_self, PyObject *_args)
3827 PyObject *_res = NULL;
3828 OSErr _err;
3829 TimeValue time;
3830 TimeValue duration;
3831 long flags;
3832 if (!PyArg_ParseTuple(_args, "lll",
3833 &time,
3834 &duration,
3835 &flags))
3836 return NULL;
3837 _err = LoadMovieIntoRam(_self->ob_itself,
3838 time,
3839 duration,
3840 flags);
3841 if (_err != noErr) return PyMac_Error(_err);
3842 Py_INCREF(Py_None);
3843 _res = Py_None;
3844 return _res;
3847 static PyObject *MovieObj_SetMovieActive(MovieObject *_self, PyObject *_args)
3849 PyObject *_res = NULL;
3850 Boolean active;
3851 if (!PyArg_ParseTuple(_args, "b",
3852 &active))
3853 return NULL;
3854 SetMovieActive(_self->ob_itself,
3855 active);
3856 Py_INCREF(Py_None);
3857 _res = Py_None;
3858 return _res;
3861 static PyObject *MovieObj_GetMovieActive(MovieObject *_self, PyObject *_args)
3863 PyObject *_res = NULL;
3864 Boolean _rv;
3865 if (!PyArg_ParseTuple(_args, ""))
3866 return NULL;
3867 _rv = GetMovieActive(_self->ob_itself);
3868 _res = Py_BuildValue("b",
3869 _rv);
3870 return _res;
3873 static PyObject *MovieObj_StartMovie(MovieObject *_self, PyObject *_args)
3875 PyObject *_res = NULL;
3876 if (!PyArg_ParseTuple(_args, ""))
3877 return NULL;
3878 StartMovie(_self->ob_itself);
3879 Py_INCREF(Py_None);
3880 _res = Py_None;
3881 return _res;
3884 static PyObject *MovieObj_StopMovie(MovieObject *_self, PyObject *_args)
3886 PyObject *_res = NULL;
3887 if (!PyArg_ParseTuple(_args, ""))
3888 return NULL;
3889 StopMovie(_self->ob_itself);
3890 Py_INCREF(Py_None);
3891 _res = Py_None;
3892 return _res;
3895 static PyObject *MovieObj_GoToBeginningOfMovie(MovieObject *_self, PyObject *_args)
3897 PyObject *_res = NULL;
3898 if (!PyArg_ParseTuple(_args, ""))
3899 return NULL;
3900 GoToBeginningOfMovie(_self->ob_itself);
3901 Py_INCREF(Py_None);
3902 _res = Py_None;
3903 return _res;
3906 static PyObject *MovieObj_GoToEndOfMovie(MovieObject *_self, PyObject *_args)
3908 PyObject *_res = NULL;
3909 if (!PyArg_ParseTuple(_args, ""))
3910 return NULL;
3911 GoToEndOfMovie(_self->ob_itself);
3912 Py_INCREF(Py_None);
3913 _res = Py_None;
3914 return _res;
3917 static PyObject *MovieObj_IsMovieDone(MovieObject *_self, PyObject *_args)
3919 PyObject *_res = NULL;
3920 Boolean _rv;
3921 if (!PyArg_ParseTuple(_args, ""))
3922 return NULL;
3923 _rv = IsMovieDone(_self->ob_itself);
3924 _res = Py_BuildValue("b",
3925 _rv);
3926 return _res;
3929 static PyObject *MovieObj_GetMoviePreviewMode(MovieObject *_self, PyObject *_args)
3931 PyObject *_res = NULL;
3932 Boolean _rv;
3933 if (!PyArg_ParseTuple(_args, ""))
3934 return NULL;
3935 _rv = GetMoviePreviewMode(_self->ob_itself);
3936 _res = Py_BuildValue("b",
3937 _rv);
3938 return _res;
3941 static PyObject *MovieObj_SetMoviePreviewMode(MovieObject *_self, PyObject *_args)
3943 PyObject *_res = NULL;
3944 Boolean usePreview;
3945 if (!PyArg_ParseTuple(_args, "b",
3946 &usePreview))
3947 return NULL;
3948 SetMoviePreviewMode(_self->ob_itself,
3949 usePreview);
3950 Py_INCREF(Py_None);
3951 _res = Py_None;
3952 return _res;
3955 static PyObject *MovieObj_ShowMoviePoster(MovieObject *_self, PyObject *_args)
3957 PyObject *_res = NULL;
3958 if (!PyArg_ParseTuple(_args, ""))
3959 return NULL;
3960 ShowMoviePoster(_self->ob_itself);
3961 Py_INCREF(Py_None);
3962 _res = Py_None;
3963 return _res;
3966 static PyObject *MovieObj_GetMovieTimeBase(MovieObject *_self, PyObject *_args)
3968 PyObject *_res = NULL;
3969 TimeBase _rv;
3970 if (!PyArg_ParseTuple(_args, ""))
3971 return NULL;
3972 _rv = GetMovieTimeBase(_self->ob_itself);
3973 _res = Py_BuildValue("O&",
3974 TimeBaseObj_New, _rv);
3975 return _res;
3978 static PyObject *MovieObj_SetMovieMasterTimeBase(MovieObject *_self, PyObject *_args)
3980 PyObject *_res = NULL;
3981 TimeBase tb;
3982 TimeRecord slaveZero;
3983 if (!PyArg_ParseTuple(_args, "O&O&",
3984 TimeBaseObj_Convert, &tb,
3985 QtTimeRecord_Convert, &slaveZero))
3986 return NULL;
3987 SetMovieMasterTimeBase(_self->ob_itself,
3989 &slaveZero);
3990 Py_INCREF(Py_None);
3991 _res = Py_None;
3992 return _res;
3995 static PyObject *MovieObj_SetMovieMasterClock(MovieObject *_self, PyObject *_args)
3997 PyObject *_res = NULL;
3998 Component clockMeister;
3999 TimeRecord slaveZero;
4000 if (!PyArg_ParseTuple(_args, "O&O&",
4001 CmpObj_Convert, &clockMeister,
4002 QtTimeRecord_Convert, &slaveZero))
4003 return NULL;
4004 SetMovieMasterClock(_self->ob_itself,
4005 clockMeister,
4006 &slaveZero);
4007 Py_INCREF(Py_None);
4008 _res = Py_None;
4009 return _res;
4012 static PyObject *MovieObj_GetMovieGWorld(MovieObject *_self, PyObject *_args)
4014 PyObject *_res = NULL;
4015 CGrafPtr port;
4016 GDHandle gdh;
4017 if (!PyArg_ParseTuple(_args, ""))
4018 return NULL;
4019 GetMovieGWorld(_self->ob_itself,
4020 &port,
4021 &gdh);
4022 _res = Py_BuildValue("O&O&",
4023 GrafObj_New, port,
4024 OptResObj_New, gdh);
4025 return _res;
4028 static PyObject *MovieObj_SetMovieGWorld(MovieObject *_self, PyObject *_args)
4030 PyObject *_res = NULL;
4031 CGrafPtr port;
4032 GDHandle gdh;
4033 if (!PyArg_ParseTuple(_args, "O&O&",
4034 GrafObj_Convert, &port,
4035 OptResObj_Convert, &gdh))
4036 return NULL;
4037 SetMovieGWorld(_self->ob_itself,
4038 port,
4039 gdh);
4040 Py_INCREF(Py_None);
4041 _res = Py_None;
4042 return _res;
4045 static PyObject *MovieObj_GetMovieNaturalBoundsRect(MovieObject *_self, PyObject *_args)
4047 PyObject *_res = NULL;
4048 Rect naturalBounds;
4049 if (!PyArg_ParseTuple(_args, ""))
4050 return NULL;
4051 GetMovieNaturalBoundsRect(_self->ob_itself,
4052 &naturalBounds);
4053 _res = Py_BuildValue("O&",
4054 PyMac_BuildRect, &naturalBounds);
4055 return _res;
4058 static PyObject *MovieObj_GetNextTrackForCompositing(MovieObject *_self, PyObject *_args)
4060 PyObject *_res = NULL;
4061 Track _rv;
4062 Track theTrack;
4063 if (!PyArg_ParseTuple(_args, "O&",
4064 TrackObj_Convert, &theTrack))
4065 return NULL;
4066 _rv = GetNextTrackForCompositing(_self->ob_itself,
4067 theTrack);
4068 _res = Py_BuildValue("O&",
4069 TrackObj_New, _rv);
4070 return _res;
4073 static PyObject *MovieObj_GetPrevTrackForCompositing(MovieObject *_self, PyObject *_args)
4075 PyObject *_res = NULL;
4076 Track _rv;
4077 Track theTrack;
4078 if (!PyArg_ParseTuple(_args, "O&",
4079 TrackObj_Convert, &theTrack))
4080 return NULL;
4081 _rv = GetPrevTrackForCompositing(_self->ob_itself,
4082 theTrack);
4083 _res = Py_BuildValue("O&",
4084 TrackObj_New, _rv);
4085 return _res;
4088 static PyObject *MovieObj_GetMoviePict(MovieObject *_self, PyObject *_args)
4090 PyObject *_res = NULL;
4091 PicHandle _rv;
4092 TimeValue time;
4093 if (!PyArg_ParseTuple(_args, "l",
4094 &time))
4095 return NULL;
4096 _rv = GetMoviePict(_self->ob_itself,
4097 time);
4098 _res = Py_BuildValue("O&",
4099 ResObj_New, _rv);
4100 return _res;
4103 static PyObject *MovieObj_GetMoviePosterPict(MovieObject *_self, PyObject *_args)
4105 PyObject *_res = NULL;
4106 PicHandle _rv;
4107 if (!PyArg_ParseTuple(_args, ""))
4108 return NULL;
4109 _rv = GetMoviePosterPict(_self->ob_itself);
4110 _res = Py_BuildValue("O&",
4111 ResObj_New, _rv);
4112 return _res;
4115 static PyObject *MovieObj_UpdateMovie(MovieObject *_self, PyObject *_args)
4117 PyObject *_res = NULL;
4118 OSErr _err;
4119 if (!PyArg_ParseTuple(_args, ""))
4120 return NULL;
4121 _err = UpdateMovie(_self->ob_itself);
4122 if (_err != noErr) return PyMac_Error(_err);
4123 Py_INCREF(Py_None);
4124 _res = Py_None;
4125 return _res;
4128 static PyObject *MovieObj_InvalidateMovieRegion(MovieObject *_self, PyObject *_args)
4130 PyObject *_res = NULL;
4131 OSErr _err;
4132 RgnHandle invalidRgn;
4133 if (!PyArg_ParseTuple(_args, "O&",
4134 ResObj_Convert, &invalidRgn))
4135 return NULL;
4136 _err = InvalidateMovieRegion(_self->ob_itself,
4137 invalidRgn);
4138 if (_err != noErr) return PyMac_Error(_err);
4139 Py_INCREF(Py_None);
4140 _res = Py_None;
4141 return _res;
4144 static PyObject *MovieObj_GetMovieBox(MovieObject *_self, PyObject *_args)
4146 PyObject *_res = NULL;
4147 Rect boxRect;
4148 if (!PyArg_ParseTuple(_args, ""))
4149 return NULL;
4150 GetMovieBox(_self->ob_itself,
4151 &boxRect);
4152 _res = Py_BuildValue("O&",
4153 PyMac_BuildRect, &boxRect);
4154 return _res;
4157 static PyObject *MovieObj_SetMovieBox(MovieObject *_self, PyObject *_args)
4159 PyObject *_res = NULL;
4160 Rect boxRect;
4161 if (!PyArg_ParseTuple(_args, "O&",
4162 PyMac_GetRect, &boxRect))
4163 return NULL;
4164 SetMovieBox(_self->ob_itself,
4165 &boxRect);
4166 Py_INCREF(Py_None);
4167 _res = Py_None;
4168 return _res;
4171 static PyObject *MovieObj_GetMovieDisplayClipRgn(MovieObject *_self, PyObject *_args)
4173 PyObject *_res = NULL;
4174 RgnHandle _rv;
4175 if (!PyArg_ParseTuple(_args, ""))
4176 return NULL;
4177 _rv = GetMovieDisplayClipRgn(_self->ob_itself);
4178 _res = Py_BuildValue("O&",
4179 ResObj_New, _rv);
4180 return _res;
4183 static PyObject *MovieObj_SetMovieDisplayClipRgn(MovieObject *_self, PyObject *_args)
4185 PyObject *_res = NULL;
4186 RgnHandle theClip;
4187 if (!PyArg_ParseTuple(_args, "O&",
4188 ResObj_Convert, &theClip))
4189 return NULL;
4190 SetMovieDisplayClipRgn(_self->ob_itself,
4191 theClip);
4192 Py_INCREF(Py_None);
4193 _res = Py_None;
4194 return _res;
4197 static PyObject *MovieObj_GetMovieClipRgn(MovieObject *_self, PyObject *_args)
4199 PyObject *_res = NULL;
4200 RgnHandle _rv;
4201 if (!PyArg_ParseTuple(_args, ""))
4202 return NULL;
4203 _rv = GetMovieClipRgn(_self->ob_itself);
4204 _res = Py_BuildValue("O&",
4205 ResObj_New, _rv);
4206 return _res;
4209 static PyObject *MovieObj_SetMovieClipRgn(MovieObject *_self, PyObject *_args)
4211 PyObject *_res = NULL;
4212 RgnHandle theClip;
4213 if (!PyArg_ParseTuple(_args, "O&",
4214 ResObj_Convert, &theClip))
4215 return NULL;
4216 SetMovieClipRgn(_self->ob_itself,
4217 theClip);
4218 Py_INCREF(Py_None);
4219 _res = Py_None;
4220 return _res;
4223 static PyObject *MovieObj_GetMovieDisplayBoundsRgn(MovieObject *_self, PyObject *_args)
4225 PyObject *_res = NULL;
4226 RgnHandle _rv;
4227 if (!PyArg_ParseTuple(_args, ""))
4228 return NULL;
4229 _rv = GetMovieDisplayBoundsRgn(_self->ob_itself);
4230 _res = Py_BuildValue("O&",
4231 ResObj_New, _rv);
4232 return _res;
4235 static PyObject *MovieObj_GetMovieBoundsRgn(MovieObject *_self, PyObject *_args)
4237 PyObject *_res = NULL;
4238 RgnHandle _rv;
4239 if (!PyArg_ParseTuple(_args, ""))
4240 return NULL;
4241 _rv = GetMovieBoundsRgn(_self->ob_itself);
4242 _res = Py_BuildValue("O&",
4243 ResObj_New, _rv);
4244 return _res;
4247 static PyObject *MovieObj_PutMovieIntoHandle(MovieObject *_self, PyObject *_args)
4249 PyObject *_res = NULL;
4250 OSErr _err;
4251 Handle publicMovie;
4252 if (!PyArg_ParseTuple(_args, "O&",
4253 ResObj_Convert, &publicMovie))
4254 return NULL;
4255 _err = PutMovieIntoHandle(_self->ob_itself,
4256 publicMovie);
4257 if (_err != noErr) return PyMac_Error(_err);
4258 Py_INCREF(Py_None);
4259 _res = Py_None;
4260 return _res;
4263 static PyObject *MovieObj_PutMovieIntoDataFork(MovieObject *_self, PyObject *_args)
4265 PyObject *_res = NULL;
4266 OSErr _err;
4267 short fRefNum;
4268 long offset;
4269 long maxSize;
4270 if (!PyArg_ParseTuple(_args, "hll",
4271 &fRefNum,
4272 &offset,
4273 &maxSize))
4274 return NULL;
4275 _err = PutMovieIntoDataFork(_self->ob_itself,
4276 fRefNum,
4277 offset,
4278 maxSize);
4279 if (_err != noErr) return PyMac_Error(_err);
4280 Py_INCREF(Py_None);
4281 _res = Py_None;
4282 return _res;
4285 static PyObject *MovieObj_PutMovieIntoDataFork64(MovieObject *_self, PyObject *_args)
4287 PyObject *_res = NULL;
4288 OSErr _err;
4289 long fRefNum;
4290 wide offset;
4291 unsigned long maxSize;
4292 if (!PyArg_ParseTuple(_args, "lO&l",
4293 &fRefNum,
4294 PyMac_Getwide, &offset,
4295 &maxSize))
4296 return NULL;
4297 _err = PutMovieIntoDataFork64(_self->ob_itself,
4298 fRefNum,
4299 &offset,
4300 maxSize);
4301 if (_err != noErr) return PyMac_Error(_err);
4302 Py_INCREF(Py_None);
4303 _res = Py_None;
4304 return _res;
4307 static PyObject *MovieObj_GetMovieCreationTime(MovieObject *_self, PyObject *_args)
4309 PyObject *_res = NULL;
4310 unsigned long _rv;
4311 if (!PyArg_ParseTuple(_args, ""))
4312 return NULL;
4313 _rv = GetMovieCreationTime(_self->ob_itself);
4314 _res = Py_BuildValue("l",
4315 _rv);
4316 return _res;
4319 static PyObject *MovieObj_GetMovieModificationTime(MovieObject *_self, PyObject *_args)
4321 PyObject *_res = NULL;
4322 unsigned long _rv;
4323 if (!PyArg_ParseTuple(_args, ""))
4324 return NULL;
4325 _rv = GetMovieModificationTime(_self->ob_itself);
4326 _res = Py_BuildValue("l",
4327 _rv);
4328 return _res;
4331 static PyObject *MovieObj_GetMovieTimeScale(MovieObject *_self, PyObject *_args)
4333 PyObject *_res = NULL;
4334 TimeScale _rv;
4335 if (!PyArg_ParseTuple(_args, ""))
4336 return NULL;
4337 _rv = GetMovieTimeScale(_self->ob_itself);
4338 _res = Py_BuildValue("l",
4339 _rv);
4340 return _res;
4343 static PyObject *MovieObj_SetMovieTimeScale(MovieObject *_self, PyObject *_args)
4345 PyObject *_res = NULL;
4346 TimeScale timeScale;
4347 if (!PyArg_ParseTuple(_args, "l",
4348 &timeScale))
4349 return NULL;
4350 SetMovieTimeScale(_self->ob_itself,
4351 timeScale);
4352 Py_INCREF(Py_None);
4353 _res = Py_None;
4354 return _res;
4357 static PyObject *MovieObj_GetMovieDuration(MovieObject *_self, PyObject *_args)
4359 PyObject *_res = NULL;
4360 TimeValue _rv;
4361 if (!PyArg_ParseTuple(_args, ""))
4362 return NULL;
4363 _rv = GetMovieDuration(_self->ob_itself);
4364 _res = Py_BuildValue("l",
4365 _rv);
4366 return _res;
4369 static PyObject *MovieObj_GetMovieRate(MovieObject *_self, PyObject *_args)
4371 PyObject *_res = NULL;
4372 Fixed _rv;
4373 if (!PyArg_ParseTuple(_args, ""))
4374 return NULL;
4375 _rv = GetMovieRate(_self->ob_itself);
4376 _res = Py_BuildValue("O&",
4377 PyMac_BuildFixed, _rv);
4378 return _res;
4381 static PyObject *MovieObj_SetMovieRate(MovieObject *_self, PyObject *_args)
4383 PyObject *_res = NULL;
4384 Fixed rate;
4385 if (!PyArg_ParseTuple(_args, "O&",
4386 PyMac_GetFixed, &rate))
4387 return NULL;
4388 SetMovieRate(_self->ob_itself,
4389 rate);
4390 Py_INCREF(Py_None);
4391 _res = Py_None;
4392 return _res;
4395 static PyObject *MovieObj_GetMoviePreferredRate(MovieObject *_self, PyObject *_args)
4397 PyObject *_res = NULL;
4398 Fixed _rv;
4399 if (!PyArg_ParseTuple(_args, ""))
4400 return NULL;
4401 _rv = GetMoviePreferredRate(_self->ob_itself);
4402 _res = Py_BuildValue("O&",
4403 PyMac_BuildFixed, _rv);
4404 return _res;
4407 static PyObject *MovieObj_SetMoviePreferredRate(MovieObject *_self, PyObject *_args)
4409 PyObject *_res = NULL;
4410 Fixed rate;
4411 if (!PyArg_ParseTuple(_args, "O&",
4412 PyMac_GetFixed, &rate))
4413 return NULL;
4414 SetMoviePreferredRate(_self->ob_itself,
4415 rate);
4416 Py_INCREF(Py_None);
4417 _res = Py_None;
4418 return _res;
4421 static PyObject *MovieObj_GetMoviePreferredVolume(MovieObject *_self, PyObject *_args)
4423 PyObject *_res = NULL;
4424 short _rv;
4425 if (!PyArg_ParseTuple(_args, ""))
4426 return NULL;
4427 _rv = GetMoviePreferredVolume(_self->ob_itself);
4428 _res = Py_BuildValue("h",
4429 _rv);
4430 return _res;
4433 static PyObject *MovieObj_SetMoviePreferredVolume(MovieObject *_self, PyObject *_args)
4435 PyObject *_res = NULL;
4436 short volume;
4437 if (!PyArg_ParseTuple(_args, "h",
4438 &volume))
4439 return NULL;
4440 SetMoviePreferredVolume(_self->ob_itself,
4441 volume);
4442 Py_INCREF(Py_None);
4443 _res = Py_None;
4444 return _res;
4447 static PyObject *MovieObj_GetMovieVolume(MovieObject *_self, PyObject *_args)
4449 PyObject *_res = NULL;
4450 short _rv;
4451 if (!PyArg_ParseTuple(_args, ""))
4452 return NULL;
4453 _rv = GetMovieVolume(_self->ob_itself);
4454 _res = Py_BuildValue("h",
4455 _rv);
4456 return _res;
4459 static PyObject *MovieObj_SetMovieVolume(MovieObject *_self, PyObject *_args)
4461 PyObject *_res = NULL;
4462 short volume;
4463 if (!PyArg_ParseTuple(_args, "h",
4464 &volume))
4465 return NULL;
4466 SetMovieVolume(_self->ob_itself,
4467 volume);
4468 Py_INCREF(Py_None);
4469 _res = Py_None;
4470 return _res;
4473 static PyObject *MovieObj_GetMoviePreviewTime(MovieObject *_self, PyObject *_args)
4475 PyObject *_res = NULL;
4476 TimeValue previewTime;
4477 TimeValue previewDuration;
4478 if (!PyArg_ParseTuple(_args, ""))
4479 return NULL;
4480 GetMoviePreviewTime(_self->ob_itself,
4481 &previewTime,
4482 &previewDuration);
4483 _res = Py_BuildValue("ll",
4484 previewTime,
4485 previewDuration);
4486 return _res;
4489 static PyObject *MovieObj_SetMoviePreviewTime(MovieObject *_self, PyObject *_args)
4491 PyObject *_res = NULL;
4492 TimeValue previewTime;
4493 TimeValue previewDuration;
4494 if (!PyArg_ParseTuple(_args, "ll",
4495 &previewTime,
4496 &previewDuration))
4497 return NULL;
4498 SetMoviePreviewTime(_self->ob_itself,
4499 previewTime,
4500 previewDuration);
4501 Py_INCREF(Py_None);
4502 _res = Py_None;
4503 return _res;
4506 static PyObject *MovieObj_GetMoviePosterTime(MovieObject *_self, PyObject *_args)
4508 PyObject *_res = NULL;
4509 TimeValue _rv;
4510 if (!PyArg_ParseTuple(_args, ""))
4511 return NULL;
4512 _rv = GetMoviePosterTime(_self->ob_itself);
4513 _res = Py_BuildValue("l",
4514 _rv);
4515 return _res;
4518 static PyObject *MovieObj_SetMoviePosterTime(MovieObject *_self, PyObject *_args)
4520 PyObject *_res = NULL;
4521 TimeValue posterTime;
4522 if (!PyArg_ParseTuple(_args, "l",
4523 &posterTime))
4524 return NULL;
4525 SetMoviePosterTime(_self->ob_itself,
4526 posterTime);
4527 Py_INCREF(Py_None);
4528 _res = Py_None;
4529 return _res;
4532 static PyObject *MovieObj_GetMovieSelection(MovieObject *_self, PyObject *_args)
4534 PyObject *_res = NULL;
4535 TimeValue selectionTime;
4536 TimeValue selectionDuration;
4537 if (!PyArg_ParseTuple(_args, ""))
4538 return NULL;
4539 GetMovieSelection(_self->ob_itself,
4540 &selectionTime,
4541 &selectionDuration);
4542 _res = Py_BuildValue("ll",
4543 selectionTime,
4544 selectionDuration);
4545 return _res;
4548 static PyObject *MovieObj_SetMovieSelection(MovieObject *_self, PyObject *_args)
4550 PyObject *_res = NULL;
4551 TimeValue selectionTime;
4552 TimeValue selectionDuration;
4553 if (!PyArg_ParseTuple(_args, "ll",
4554 &selectionTime,
4555 &selectionDuration))
4556 return NULL;
4557 SetMovieSelection(_self->ob_itself,
4558 selectionTime,
4559 selectionDuration);
4560 Py_INCREF(Py_None);
4561 _res = Py_None;
4562 return _res;
4565 static PyObject *MovieObj_SetMovieActiveSegment(MovieObject *_self, PyObject *_args)
4567 PyObject *_res = NULL;
4568 TimeValue startTime;
4569 TimeValue duration;
4570 if (!PyArg_ParseTuple(_args, "ll",
4571 &startTime,
4572 &duration))
4573 return NULL;
4574 SetMovieActiveSegment(_self->ob_itself,
4575 startTime,
4576 duration);
4577 Py_INCREF(Py_None);
4578 _res = Py_None;
4579 return _res;
4582 static PyObject *MovieObj_GetMovieActiveSegment(MovieObject *_self, PyObject *_args)
4584 PyObject *_res = NULL;
4585 TimeValue startTime;
4586 TimeValue duration;
4587 if (!PyArg_ParseTuple(_args, ""))
4588 return NULL;
4589 GetMovieActiveSegment(_self->ob_itself,
4590 &startTime,
4591 &duration);
4592 _res = Py_BuildValue("ll",
4593 startTime,
4594 duration);
4595 return _res;
4598 static PyObject *MovieObj_GetMovieTime(MovieObject *_self, PyObject *_args)
4600 PyObject *_res = NULL;
4601 TimeValue _rv;
4602 TimeRecord currentTime;
4603 if (!PyArg_ParseTuple(_args, ""))
4604 return NULL;
4605 _rv = GetMovieTime(_self->ob_itself,
4606 &currentTime);
4607 _res = Py_BuildValue("lO&",
4608 _rv,
4609 QtTimeRecord_New, &currentTime);
4610 return _res;
4613 static PyObject *MovieObj_SetMovieTime(MovieObject *_self, PyObject *_args)
4615 PyObject *_res = NULL;
4616 TimeRecord newtime;
4617 if (!PyArg_ParseTuple(_args, "O&",
4618 QtTimeRecord_Convert, &newtime))
4619 return NULL;
4620 SetMovieTime(_self->ob_itself,
4621 &newtime);
4622 Py_INCREF(Py_None);
4623 _res = Py_None;
4624 return _res;
4627 static PyObject *MovieObj_SetMovieTimeValue(MovieObject *_self, PyObject *_args)
4629 PyObject *_res = NULL;
4630 TimeValue newtime;
4631 if (!PyArg_ParseTuple(_args, "l",
4632 &newtime))
4633 return NULL;
4634 SetMovieTimeValue(_self->ob_itself,
4635 newtime);
4636 Py_INCREF(Py_None);
4637 _res = Py_None;
4638 return _res;
4641 static PyObject *MovieObj_GetMovieUserData(MovieObject *_self, PyObject *_args)
4643 PyObject *_res = NULL;
4644 UserData _rv;
4645 if (!PyArg_ParseTuple(_args, ""))
4646 return NULL;
4647 _rv = GetMovieUserData(_self->ob_itself);
4648 _res = Py_BuildValue("O&",
4649 UserDataObj_New, _rv);
4650 return _res;
4653 static PyObject *MovieObj_GetMovieTrackCount(MovieObject *_self, PyObject *_args)
4655 PyObject *_res = NULL;
4656 long _rv;
4657 if (!PyArg_ParseTuple(_args, ""))
4658 return NULL;
4659 _rv = GetMovieTrackCount(_self->ob_itself);
4660 _res = Py_BuildValue("l",
4661 _rv);
4662 return _res;
4665 static PyObject *MovieObj_GetMovieTrack(MovieObject *_self, PyObject *_args)
4667 PyObject *_res = NULL;
4668 Track _rv;
4669 long trackID;
4670 if (!PyArg_ParseTuple(_args, "l",
4671 &trackID))
4672 return NULL;
4673 _rv = GetMovieTrack(_self->ob_itself,
4674 trackID);
4675 _res = Py_BuildValue("O&",
4676 TrackObj_New, _rv);
4677 return _res;
4680 static PyObject *MovieObj_GetMovieIndTrack(MovieObject *_self, PyObject *_args)
4682 PyObject *_res = NULL;
4683 Track _rv;
4684 long index;
4685 if (!PyArg_ParseTuple(_args, "l",
4686 &index))
4687 return NULL;
4688 _rv = GetMovieIndTrack(_self->ob_itself,
4689 index);
4690 _res = Py_BuildValue("O&",
4691 TrackObj_New, _rv);
4692 return _res;
4695 static PyObject *MovieObj_GetMovieIndTrackType(MovieObject *_self, PyObject *_args)
4697 PyObject *_res = NULL;
4698 Track _rv;
4699 long index;
4700 OSType trackType;
4701 long flags;
4702 if (!PyArg_ParseTuple(_args, "lO&l",
4703 &index,
4704 PyMac_GetOSType, &trackType,
4705 &flags))
4706 return NULL;
4707 _rv = GetMovieIndTrackType(_self->ob_itself,
4708 index,
4709 trackType,
4710 flags);
4711 _res = Py_BuildValue("O&",
4712 TrackObj_New, _rv);
4713 return _res;
4716 static PyObject *MovieObj_NewMovieTrack(MovieObject *_self, PyObject *_args)
4718 PyObject *_res = NULL;
4719 Track _rv;
4720 Fixed width;
4721 Fixed height;
4722 short trackVolume;
4723 if (!PyArg_ParseTuple(_args, "O&O&h",
4724 PyMac_GetFixed, &width,
4725 PyMac_GetFixed, &height,
4726 &trackVolume))
4727 return NULL;
4728 _rv = NewMovieTrack(_self->ob_itself,
4729 width,
4730 height,
4731 trackVolume);
4732 _res = Py_BuildValue("O&",
4733 TrackObj_New, _rv);
4734 return _res;
4737 static PyObject *MovieObj_SetAutoTrackAlternatesEnabled(MovieObject *_self, PyObject *_args)
4739 PyObject *_res = NULL;
4740 Boolean enable;
4741 if (!PyArg_ParseTuple(_args, "b",
4742 &enable))
4743 return NULL;
4744 SetAutoTrackAlternatesEnabled(_self->ob_itself,
4745 enable);
4746 Py_INCREF(Py_None);
4747 _res = Py_None;
4748 return _res;
4751 static PyObject *MovieObj_SelectMovieAlternates(MovieObject *_self, PyObject *_args)
4753 PyObject *_res = NULL;
4754 if (!PyArg_ParseTuple(_args, ""))
4755 return NULL;
4756 SelectMovieAlternates(_self->ob_itself);
4757 Py_INCREF(Py_None);
4758 _res = Py_None;
4759 return _res;
4762 static PyObject *MovieObj_InsertMovieSegment(MovieObject *_self, PyObject *_args)
4764 PyObject *_res = NULL;
4765 OSErr _err;
4766 Movie dstMovie;
4767 TimeValue srcIn;
4768 TimeValue srcDuration;
4769 TimeValue dstIn;
4770 if (!PyArg_ParseTuple(_args, "O&lll",
4771 MovieObj_Convert, &dstMovie,
4772 &srcIn,
4773 &srcDuration,
4774 &dstIn))
4775 return NULL;
4776 _err = InsertMovieSegment(_self->ob_itself,
4777 dstMovie,
4778 srcIn,
4779 srcDuration,
4780 dstIn);
4781 if (_err != noErr) return PyMac_Error(_err);
4782 Py_INCREF(Py_None);
4783 _res = Py_None;
4784 return _res;
4787 static PyObject *MovieObj_InsertEmptyMovieSegment(MovieObject *_self, PyObject *_args)
4789 PyObject *_res = NULL;
4790 OSErr _err;
4791 TimeValue dstIn;
4792 TimeValue dstDuration;
4793 if (!PyArg_ParseTuple(_args, "ll",
4794 &dstIn,
4795 &dstDuration))
4796 return NULL;
4797 _err = InsertEmptyMovieSegment(_self->ob_itself,
4798 dstIn,
4799 dstDuration);
4800 if (_err != noErr) return PyMac_Error(_err);
4801 Py_INCREF(Py_None);
4802 _res = Py_None;
4803 return _res;
4806 static PyObject *MovieObj_DeleteMovieSegment(MovieObject *_self, PyObject *_args)
4808 PyObject *_res = NULL;
4809 OSErr _err;
4810 TimeValue startTime;
4811 TimeValue duration;
4812 if (!PyArg_ParseTuple(_args, "ll",
4813 &startTime,
4814 &duration))
4815 return NULL;
4816 _err = DeleteMovieSegment(_self->ob_itself,
4817 startTime,
4818 duration);
4819 if (_err != noErr) return PyMac_Error(_err);
4820 Py_INCREF(Py_None);
4821 _res = Py_None;
4822 return _res;
4825 static PyObject *MovieObj_ScaleMovieSegment(MovieObject *_self, PyObject *_args)
4827 PyObject *_res = NULL;
4828 OSErr _err;
4829 TimeValue startTime;
4830 TimeValue oldDuration;
4831 TimeValue newDuration;
4832 if (!PyArg_ParseTuple(_args, "lll",
4833 &startTime,
4834 &oldDuration,
4835 &newDuration))
4836 return NULL;
4837 _err = ScaleMovieSegment(_self->ob_itself,
4838 startTime,
4839 oldDuration,
4840 newDuration);
4841 if (_err != noErr) return PyMac_Error(_err);
4842 Py_INCREF(Py_None);
4843 _res = Py_None;
4844 return _res;
4847 static PyObject *MovieObj_CutMovieSelection(MovieObject *_self, PyObject *_args)
4849 PyObject *_res = NULL;
4850 Movie _rv;
4851 if (!PyArg_ParseTuple(_args, ""))
4852 return NULL;
4853 _rv = CutMovieSelection(_self->ob_itself);
4854 _res = Py_BuildValue("O&",
4855 MovieObj_New, _rv);
4856 return _res;
4859 static PyObject *MovieObj_CopyMovieSelection(MovieObject *_self, PyObject *_args)
4861 PyObject *_res = NULL;
4862 Movie _rv;
4863 if (!PyArg_ParseTuple(_args, ""))
4864 return NULL;
4865 _rv = CopyMovieSelection(_self->ob_itself);
4866 _res = Py_BuildValue("O&",
4867 MovieObj_New, _rv);
4868 return _res;
4871 static PyObject *MovieObj_PasteMovieSelection(MovieObject *_self, PyObject *_args)
4873 PyObject *_res = NULL;
4874 Movie src;
4875 if (!PyArg_ParseTuple(_args, "O&",
4876 MovieObj_Convert, &src))
4877 return NULL;
4878 PasteMovieSelection(_self->ob_itself,
4879 src);
4880 Py_INCREF(Py_None);
4881 _res = Py_None;
4882 return _res;
4885 static PyObject *MovieObj_AddMovieSelection(MovieObject *_self, PyObject *_args)
4887 PyObject *_res = NULL;
4888 Movie src;
4889 if (!PyArg_ParseTuple(_args, "O&",
4890 MovieObj_Convert, &src))
4891 return NULL;
4892 AddMovieSelection(_self->ob_itself,
4893 src);
4894 Py_INCREF(Py_None);
4895 _res = Py_None;
4896 return _res;
4899 static PyObject *MovieObj_ClearMovieSelection(MovieObject *_self, PyObject *_args)
4901 PyObject *_res = NULL;
4902 if (!PyArg_ParseTuple(_args, ""))
4903 return NULL;
4904 ClearMovieSelection(_self->ob_itself);
4905 Py_INCREF(Py_None);
4906 _res = Py_None;
4907 return _res;
4910 static PyObject *MovieObj_PutMovieIntoTypedHandle(MovieObject *_self, PyObject *_args)
4912 PyObject *_res = NULL;
4913 OSErr _err;
4914 Track targetTrack;
4915 OSType handleType;
4916 Handle publicMovie;
4917 TimeValue start;
4918 TimeValue dur;
4919 long flags;
4920 ComponentInstance userComp;
4921 if (!PyArg_ParseTuple(_args, "O&O&O&lllO&",
4922 TrackObj_Convert, &targetTrack,
4923 PyMac_GetOSType, &handleType,
4924 ResObj_Convert, &publicMovie,
4925 &start,
4926 &dur,
4927 &flags,
4928 CmpInstObj_Convert, &userComp))
4929 return NULL;
4930 _err = PutMovieIntoTypedHandle(_self->ob_itself,
4931 targetTrack,
4932 handleType,
4933 publicMovie,
4934 start,
4935 dur,
4936 flags,
4937 userComp);
4938 if (_err != noErr) return PyMac_Error(_err);
4939 Py_INCREF(Py_None);
4940 _res = Py_None;
4941 return _res;
4944 static PyObject *MovieObj_CopyMovieSettings(MovieObject *_self, PyObject *_args)
4946 PyObject *_res = NULL;
4947 OSErr _err;
4948 Movie dstMovie;
4949 if (!PyArg_ParseTuple(_args, "O&",
4950 MovieObj_Convert, &dstMovie))
4951 return NULL;
4952 _err = CopyMovieSettings(_self->ob_itself,
4953 dstMovie);
4954 if (_err != noErr) return PyMac_Error(_err);
4955 Py_INCREF(Py_None);
4956 _res = Py_None;
4957 return _res;
4960 static PyObject *MovieObj_ConvertMovieToFile(MovieObject *_self, PyObject *_args)
4962 PyObject *_res = NULL;
4963 OSErr _err;
4964 Track onlyTrack;
4965 FSSpec outputFile;
4966 OSType fileType;
4967 OSType creator;
4968 ScriptCode scriptTag;
4969 short resID;
4970 long flags;
4971 ComponentInstance userComp;
4972 if (!PyArg_ParseTuple(_args, "O&O&O&O&hlO&",
4973 TrackObj_Convert, &onlyTrack,
4974 PyMac_GetFSSpec, &outputFile,
4975 PyMac_GetOSType, &fileType,
4976 PyMac_GetOSType, &creator,
4977 &scriptTag,
4978 &flags,
4979 CmpInstObj_Convert, &userComp))
4980 return NULL;
4981 _err = ConvertMovieToFile(_self->ob_itself,
4982 onlyTrack,
4983 &outputFile,
4984 fileType,
4985 creator,
4986 scriptTag,
4987 &resID,
4988 flags,
4989 userComp);
4990 if (_err != noErr) return PyMac_Error(_err);
4991 _res = Py_BuildValue("h",
4992 resID);
4993 return _res;
4996 static PyObject *MovieObj_GetMovieDataSize(MovieObject *_self, PyObject *_args)
4998 PyObject *_res = NULL;
4999 long _rv;
5000 TimeValue startTime;
5001 TimeValue duration;
5002 if (!PyArg_ParseTuple(_args, "ll",
5003 &startTime,
5004 &duration))
5005 return NULL;
5006 _rv = GetMovieDataSize(_self->ob_itself,
5007 startTime,
5008 duration);
5009 _res = Py_BuildValue("l",
5010 _rv);
5011 return _res;
5014 static PyObject *MovieObj_GetMovieDataSize64(MovieObject *_self, PyObject *_args)
5016 PyObject *_res = NULL;
5017 OSErr _err;
5018 TimeValue startTime;
5019 TimeValue duration;
5020 wide dataSize;
5021 if (!PyArg_ParseTuple(_args, "ll",
5022 &startTime,
5023 &duration))
5024 return NULL;
5025 _err = GetMovieDataSize64(_self->ob_itself,
5026 startTime,
5027 duration,
5028 &dataSize);
5029 if (_err != noErr) return PyMac_Error(_err);
5030 _res = Py_BuildValue("O&",
5031 PyMac_Buildwide, dataSize);
5032 return _res;
5035 static PyObject *MovieObj_PtInMovie(MovieObject *_self, PyObject *_args)
5037 PyObject *_res = NULL;
5038 Boolean _rv;
5039 Point pt;
5040 if (!PyArg_ParseTuple(_args, "O&",
5041 PyMac_GetPoint, &pt))
5042 return NULL;
5043 _rv = PtInMovie(_self->ob_itself,
5044 pt);
5045 _res = Py_BuildValue("b",
5046 _rv);
5047 return _res;
5050 static PyObject *MovieObj_SetMovieLanguage(MovieObject *_self, PyObject *_args)
5052 PyObject *_res = NULL;
5053 long language;
5054 if (!PyArg_ParseTuple(_args, "l",
5055 &language))
5056 return NULL;
5057 SetMovieLanguage(_self->ob_itself,
5058 language);
5059 Py_INCREF(Py_None);
5060 _res = Py_None;
5061 return _res;
5064 static PyObject *MovieObj_GetMovieNextInterestingTime(MovieObject *_self, PyObject *_args)
5066 PyObject *_res = NULL;
5067 short interestingTimeFlags;
5068 short numMediaTypes;
5069 OSType whichMediaTypes;
5070 TimeValue time;
5071 Fixed rate;
5072 TimeValue interestingTime;
5073 TimeValue interestingDuration;
5074 if (!PyArg_ParseTuple(_args, "hhO&lO&",
5075 &interestingTimeFlags,
5076 &numMediaTypes,
5077 PyMac_GetOSType, &whichMediaTypes,
5078 &time,
5079 PyMac_GetFixed, &rate))
5080 return NULL;
5081 GetMovieNextInterestingTime(_self->ob_itself,
5082 interestingTimeFlags,
5083 numMediaTypes,
5084 &whichMediaTypes,
5085 time,
5086 rate,
5087 &interestingTime,
5088 &interestingDuration);
5089 _res = Py_BuildValue("ll",
5090 interestingTime,
5091 interestingDuration);
5092 return _res;
5095 static PyObject *MovieObj_AddMovieResource(MovieObject *_self, PyObject *_args)
5097 PyObject *_res = NULL;
5098 OSErr _err;
5099 short resRefNum;
5100 short resId;
5101 Str255 resName;
5102 if (!PyArg_ParseTuple(_args, "hO&",
5103 &resRefNum,
5104 PyMac_GetStr255, resName))
5105 return NULL;
5106 _err = AddMovieResource(_self->ob_itself,
5107 resRefNum,
5108 &resId,
5109 resName);
5110 if (_err != noErr) return PyMac_Error(_err);
5111 _res = Py_BuildValue("h",
5112 resId);
5113 return _res;
5116 static PyObject *MovieObj_UpdateMovieResource(MovieObject *_self, PyObject *_args)
5118 PyObject *_res = NULL;
5119 OSErr _err;
5120 short resRefNum;
5121 short resId;
5122 Str255 resName;
5123 if (!PyArg_ParseTuple(_args, "hhO&",
5124 &resRefNum,
5125 &resId,
5126 PyMac_GetStr255, resName))
5127 return NULL;
5128 _err = UpdateMovieResource(_self->ob_itself,
5129 resRefNum,
5130 resId,
5131 resName);
5132 if (_err != noErr) return PyMac_Error(_err);
5133 Py_INCREF(Py_None);
5134 _res = Py_None;
5135 return _res;
5138 static PyObject *MovieObj_HasMovieChanged(MovieObject *_self, PyObject *_args)
5140 PyObject *_res = NULL;
5141 Boolean _rv;
5142 if (!PyArg_ParseTuple(_args, ""))
5143 return NULL;
5144 _rv = HasMovieChanged(_self->ob_itself);
5145 _res = Py_BuildValue("b",
5146 _rv);
5147 return _res;
5150 static PyObject *MovieObj_ClearMovieChanged(MovieObject *_self, PyObject *_args)
5152 PyObject *_res = NULL;
5153 if (!PyArg_ParseTuple(_args, ""))
5154 return NULL;
5155 ClearMovieChanged(_self->ob_itself);
5156 Py_INCREF(Py_None);
5157 _res = Py_None;
5158 return _res;
5161 static PyObject *MovieObj_SetMovieDefaultDataRef(MovieObject *_self, PyObject *_args)
5163 PyObject *_res = NULL;
5164 OSErr _err;
5165 Handle dataRef;
5166 OSType dataRefType;
5167 if (!PyArg_ParseTuple(_args, "O&O&",
5168 ResObj_Convert, &dataRef,
5169 PyMac_GetOSType, &dataRefType))
5170 return NULL;
5171 _err = SetMovieDefaultDataRef(_self->ob_itself,
5172 dataRef,
5173 dataRefType);
5174 if (_err != noErr) return PyMac_Error(_err);
5175 Py_INCREF(Py_None);
5176 _res = Py_None;
5177 return _res;
5180 static PyObject *MovieObj_GetMovieDefaultDataRef(MovieObject *_self, PyObject *_args)
5182 PyObject *_res = NULL;
5183 OSErr _err;
5184 Handle dataRef;
5185 OSType dataRefType;
5186 if (!PyArg_ParseTuple(_args, ""))
5187 return NULL;
5188 _err = GetMovieDefaultDataRef(_self->ob_itself,
5189 &dataRef,
5190 &dataRefType);
5191 if (_err != noErr) return PyMac_Error(_err);
5192 _res = Py_BuildValue("O&O&",
5193 ResObj_New, dataRef,
5194 PyMac_BuildOSType, dataRefType);
5195 return _res;
5198 #if !TARGET_API_MAC_CARBON
5200 static PyObject *MovieObj_SetMovieAnchorDataRef(MovieObject *_self, PyObject *_args)
5202 PyObject *_res = NULL;
5203 OSErr _err;
5204 Handle dataRef;
5205 OSType dataRefType;
5206 if (!PyArg_ParseTuple(_args, "O&O&",
5207 ResObj_Convert, &dataRef,
5208 PyMac_GetOSType, &dataRefType))
5209 return NULL;
5210 _err = SetMovieAnchorDataRef(_self->ob_itself,
5211 dataRef,
5212 dataRefType);
5213 if (_err != noErr) return PyMac_Error(_err);
5214 Py_INCREF(Py_None);
5215 _res = Py_None;
5216 return _res;
5218 #endif
5220 #if !TARGET_API_MAC_CARBON
5222 static PyObject *MovieObj_GetMovieAnchorDataRef(MovieObject *_self, PyObject *_args)
5224 PyObject *_res = NULL;
5225 OSErr _err;
5226 Handle dataRef;
5227 OSType dataRefType;
5228 long outFlags;
5229 if (!PyArg_ParseTuple(_args, ""))
5230 return NULL;
5231 _err = GetMovieAnchorDataRef(_self->ob_itself,
5232 &dataRef,
5233 &dataRefType,
5234 &outFlags);
5235 if (_err != noErr) return PyMac_Error(_err);
5236 _res = Py_BuildValue("O&O&l",
5237 ResObj_New, dataRef,
5238 PyMac_BuildOSType, dataRefType,
5239 outFlags);
5240 return _res;
5242 #endif
5244 static PyObject *MovieObj_SetMovieColorTable(MovieObject *_self, PyObject *_args)
5246 PyObject *_res = NULL;
5247 OSErr _err;
5248 CTabHandle ctab;
5249 if (!PyArg_ParseTuple(_args, "O&",
5250 ResObj_Convert, &ctab))
5251 return NULL;
5252 _err = SetMovieColorTable(_self->ob_itself,
5253 ctab);
5254 if (_err != noErr) return PyMac_Error(_err);
5255 Py_INCREF(Py_None);
5256 _res = Py_None;
5257 return _res;
5260 static PyObject *MovieObj_GetMovieColorTable(MovieObject *_self, PyObject *_args)
5262 PyObject *_res = NULL;
5263 OSErr _err;
5264 CTabHandle ctab;
5265 if (!PyArg_ParseTuple(_args, ""))
5266 return NULL;
5267 _err = GetMovieColorTable(_self->ob_itself,
5268 &ctab);
5269 if (_err != noErr) return PyMac_Error(_err);
5270 _res = Py_BuildValue("O&",
5271 ResObj_New, ctab);
5272 return _res;
5275 static PyObject *MovieObj_FlattenMovie(MovieObject *_self, PyObject *_args)
5277 PyObject *_res = NULL;
5278 long movieFlattenFlags;
5279 FSSpec theFile;
5280 OSType creator;
5281 ScriptCode scriptTag;
5282 long createMovieFileFlags;
5283 short resId;
5284 Str255 resName;
5285 if (!PyArg_ParseTuple(_args, "lO&O&hlO&",
5286 &movieFlattenFlags,
5287 PyMac_GetFSSpec, &theFile,
5288 PyMac_GetOSType, &creator,
5289 &scriptTag,
5290 &createMovieFileFlags,
5291 PyMac_GetStr255, resName))
5292 return NULL;
5293 FlattenMovie(_self->ob_itself,
5294 movieFlattenFlags,
5295 &theFile,
5296 creator,
5297 scriptTag,
5298 createMovieFileFlags,
5299 &resId,
5300 resName);
5301 _res = Py_BuildValue("h",
5302 resId);
5303 return _res;
5306 static PyObject *MovieObj_FlattenMovieData(MovieObject *_self, PyObject *_args)
5308 PyObject *_res = NULL;
5309 Movie _rv;
5310 long movieFlattenFlags;
5311 FSSpec theFile;
5312 OSType creator;
5313 ScriptCode scriptTag;
5314 long createMovieFileFlags;
5315 if (!PyArg_ParseTuple(_args, "lO&O&hl",
5316 &movieFlattenFlags,
5317 PyMac_GetFSSpec, &theFile,
5318 PyMac_GetOSType, &creator,
5319 &scriptTag,
5320 &createMovieFileFlags))
5321 return NULL;
5322 _rv = FlattenMovieData(_self->ob_itself,
5323 movieFlattenFlags,
5324 &theFile,
5325 creator,
5326 scriptTag,
5327 createMovieFileFlags);
5328 _res = Py_BuildValue("O&",
5329 MovieObj_New, _rv);
5330 return _res;
5333 static PyObject *MovieObj_MovieSearchText(MovieObject *_self, PyObject *_args)
5335 PyObject *_res = NULL;
5336 OSErr _err;
5337 Ptr text;
5338 long size;
5339 long searchFlags;
5340 Track searchTrack;
5341 TimeValue searchTime;
5342 long searchOffset;
5343 if (!PyArg_ParseTuple(_args, "sll",
5344 &text,
5345 &size,
5346 &searchFlags))
5347 return NULL;
5348 _err = MovieSearchText(_self->ob_itself,
5349 text,
5350 size,
5351 searchFlags,
5352 &searchTrack,
5353 &searchTime,
5354 &searchOffset);
5355 if (_err != noErr) return PyMac_Error(_err);
5356 _res = Py_BuildValue("O&ll",
5357 TrackObj_New, searchTrack,
5358 searchTime,
5359 searchOffset);
5360 return _res;
5363 static PyObject *MovieObj_GetPosterBox(MovieObject *_self, PyObject *_args)
5365 PyObject *_res = NULL;
5366 Rect boxRect;
5367 if (!PyArg_ParseTuple(_args, ""))
5368 return NULL;
5369 GetPosterBox(_self->ob_itself,
5370 &boxRect);
5371 _res = Py_BuildValue("O&",
5372 PyMac_BuildRect, &boxRect);
5373 return _res;
5376 static PyObject *MovieObj_SetPosterBox(MovieObject *_self, PyObject *_args)
5378 PyObject *_res = NULL;
5379 Rect boxRect;
5380 if (!PyArg_ParseTuple(_args, "O&",
5381 PyMac_GetRect, &boxRect))
5382 return NULL;
5383 SetPosterBox(_self->ob_itself,
5384 &boxRect);
5385 Py_INCREF(Py_None);
5386 _res = Py_None;
5387 return _res;
5390 static PyObject *MovieObj_GetMovieSegmentDisplayBoundsRgn(MovieObject *_self, PyObject *_args)
5392 PyObject *_res = NULL;
5393 RgnHandle _rv;
5394 TimeValue time;
5395 TimeValue duration;
5396 if (!PyArg_ParseTuple(_args, "ll",
5397 &time,
5398 &duration))
5399 return NULL;
5400 _rv = GetMovieSegmentDisplayBoundsRgn(_self->ob_itself,
5401 time,
5402 duration);
5403 _res = Py_BuildValue("O&",
5404 ResObj_New, _rv);
5405 return _res;
5408 static PyObject *MovieObj_GetMovieStatus(MovieObject *_self, PyObject *_args)
5410 PyObject *_res = NULL;
5411 ComponentResult _rv;
5412 Track firstProblemTrack;
5413 if (!PyArg_ParseTuple(_args, ""))
5414 return NULL;
5415 _rv = GetMovieStatus(_self->ob_itself,
5416 &firstProblemTrack);
5417 _res = Py_BuildValue("lO&",
5418 _rv,
5419 TrackObj_New, firstProblemTrack);
5420 return _res;
5423 #if !TARGET_API_MAC_CARBON
5425 static PyObject *MovieObj_GetMovieLoadState(MovieObject *_self, PyObject *_args)
5427 PyObject *_res = NULL;
5428 long _rv;
5429 if (!PyArg_ParseTuple(_args, ""))
5430 return NULL;
5431 _rv = GetMovieLoadState(_self->ob_itself);
5432 _res = Py_BuildValue("l",
5433 _rv);
5434 return _res;
5436 #endif
5438 static PyObject *MovieObj_NewMovieController(MovieObject *_self, PyObject *_args)
5440 PyObject *_res = NULL;
5441 MovieController _rv;
5442 Rect movieRect;
5443 long someFlags;
5444 if (!PyArg_ParseTuple(_args, "O&l",
5445 PyMac_GetRect, &movieRect,
5446 &someFlags))
5447 return NULL;
5448 _rv = NewMovieController(_self->ob_itself,
5449 &movieRect,
5450 someFlags);
5451 _res = Py_BuildValue("O&",
5452 MovieCtlObj_New, _rv);
5453 return _res;
5456 static PyObject *MovieObj_PutMovieOnScrap(MovieObject *_self, PyObject *_args)
5458 PyObject *_res = NULL;
5459 OSErr _err;
5460 long movieScrapFlags;
5461 if (!PyArg_ParseTuple(_args, "l",
5462 &movieScrapFlags))
5463 return NULL;
5464 _err = PutMovieOnScrap(_self->ob_itself,
5465 movieScrapFlags);
5466 if (_err != noErr) return PyMac_Error(_err);
5467 Py_INCREF(Py_None);
5468 _res = Py_None;
5469 return _res;
5472 static PyObject *MovieObj_SetMoviePlayHints(MovieObject *_self, PyObject *_args)
5474 PyObject *_res = NULL;
5475 long flags;
5476 long flagsMask;
5477 if (!PyArg_ParseTuple(_args, "ll",
5478 &flags,
5479 &flagsMask))
5480 return NULL;
5481 SetMoviePlayHints(_self->ob_itself,
5482 flags,
5483 flagsMask);
5484 Py_INCREF(Py_None);
5485 _res = Py_None;
5486 return _res;
5489 static PyObject *MovieObj_GetMaxLoadedTimeInMovie(MovieObject *_self, PyObject *_args)
5491 PyObject *_res = NULL;
5492 OSErr _err;
5493 TimeValue time;
5494 if (!PyArg_ParseTuple(_args, ""))
5495 return NULL;
5496 _err = GetMaxLoadedTimeInMovie(_self->ob_itself,
5497 &time);
5498 if (_err != noErr) return PyMac_Error(_err);
5499 _res = Py_BuildValue("l",
5500 time);
5501 return _res;
5504 static PyObject *MovieObj_QTMovieNeedsTimeTable(MovieObject *_self, PyObject *_args)
5506 PyObject *_res = NULL;
5507 OSErr _err;
5508 Boolean needsTimeTable;
5509 if (!PyArg_ParseTuple(_args, ""))
5510 return NULL;
5511 _err = QTMovieNeedsTimeTable(_self->ob_itself,
5512 &needsTimeTable);
5513 if (_err != noErr) return PyMac_Error(_err);
5514 _res = Py_BuildValue("b",
5515 needsTimeTable);
5516 return _res;
5519 static PyObject *MovieObj_QTGetDataRefMaxFileOffset(MovieObject *_self, PyObject *_args)
5521 PyObject *_res = NULL;
5522 OSErr _err;
5523 OSType dataRefType;
5524 Handle dataRef;
5525 long offset;
5526 if (!PyArg_ParseTuple(_args, "O&O&",
5527 PyMac_GetOSType, &dataRefType,
5528 ResObj_Convert, &dataRef))
5529 return NULL;
5530 _err = QTGetDataRefMaxFileOffset(_self->ob_itself,
5531 dataRefType,
5532 dataRef,
5533 &offset);
5534 if (_err != noErr) return PyMac_Error(_err);
5535 _res = Py_BuildValue("l",
5536 offset);
5537 return _res;
5540 static PyMethodDef MovieObj_methods[] = {
5541 {"MoviesTask", (PyCFunction)MovieObj_MoviesTask, 1,
5542 "(long maxMilliSecToUse) -> None"},
5543 {"PrerollMovie", (PyCFunction)MovieObj_PrerollMovie, 1,
5544 "(TimeValue time, Fixed Rate) -> None"},
5545 {"AbortPrePrerollMovie", (PyCFunction)MovieObj_AbortPrePrerollMovie, 1,
5546 "(OSErr err) -> None"},
5547 {"LoadMovieIntoRam", (PyCFunction)MovieObj_LoadMovieIntoRam, 1,
5548 "(TimeValue time, TimeValue duration, long flags) -> None"},
5549 {"SetMovieActive", (PyCFunction)MovieObj_SetMovieActive, 1,
5550 "(Boolean active) -> None"},
5551 {"GetMovieActive", (PyCFunction)MovieObj_GetMovieActive, 1,
5552 "() -> (Boolean _rv)"},
5553 {"StartMovie", (PyCFunction)MovieObj_StartMovie, 1,
5554 "() -> None"},
5555 {"StopMovie", (PyCFunction)MovieObj_StopMovie, 1,
5556 "() -> None"},
5557 {"GoToBeginningOfMovie", (PyCFunction)MovieObj_GoToBeginningOfMovie, 1,
5558 "() -> None"},
5559 {"GoToEndOfMovie", (PyCFunction)MovieObj_GoToEndOfMovie, 1,
5560 "() -> None"},
5561 {"IsMovieDone", (PyCFunction)MovieObj_IsMovieDone, 1,
5562 "() -> (Boolean _rv)"},
5563 {"GetMoviePreviewMode", (PyCFunction)MovieObj_GetMoviePreviewMode, 1,
5564 "() -> (Boolean _rv)"},
5565 {"SetMoviePreviewMode", (PyCFunction)MovieObj_SetMoviePreviewMode, 1,
5566 "(Boolean usePreview) -> None"},
5567 {"ShowMoviePoster", (PyCFunction)MovieObj_ShowMoviePoster, 1,
5568 "() -> None"},
5569 {"GetMovieTimeBase", (PyCFunction)MovieObj_GetMovieTimeBase, 1,
5570 "() -> (TimeBase _rv)"},
5571 {"SetMovieMasterTimeBase", (PyCFunction)MovieObj_SetMovieMasterTimeBase, 1,
5572 "(TimeBase tb, TimeRecord slaveZero) -> None"},
5573 {"SetMovieMasterClock", (PyCFunction)MovieObj_SetMovieMasterClock, 1,
5574 "(Component clockMeister, TimeRecord slaveZero) -> None"},
5575 {"GetMovieGWorld", (PyCFunction)MovieObj_GetMovieGWorld, 1,
5576 "() -> (CGrafPtr port, GDHandle gdh)"},
5577 {"SetMovieGWorld", (PyCFunction)MovieObj_SetMovieGWorld, 1,
5578 "(CGrafPtr port, GDHandle gdh) -> None"},
5579 {"GetMovieNaturalBoundsRect", (PyCFunction)MovieObj_GetMovieNaturalBoundsRect, 1,
5580 "() -> (Rect naturalBounds)"},
5581 {"GetNextTrackForCompositing", (PyCFunction)MovieObj_GetNextTrackForCompositing, 1,
5582 "(Track theTrack) -> (Track _rv)"},
5583 {"GetPrevTrackForCompositing", (PyCFunction)MovieObj_GetPrevTrackForCompositing, 1,
5584 "(Track theTrack) -> (Track _rv)"},
5585 {"GetMoviePict", (PyCFunction)MovieObj_GetMoviePict, 1,
5586 "(TimeValue time) -> (PicHandle _rv)"},
5587 {"GetMoviePosterPict", (PyCFunction)MovieObj_GetMoviePosterPict, 1,
5588 "() -> (PicHandle _rv)"},
5589 {"UpdateMovie", (PyCFunction)MovieObj_UpdateMovie, 1,
5590 "() -> None"},
5591 {"InvalidateMovieRegion", (PyCFunction)MovieObj_InvalidateMovieRegion, 1,
5592 "(RgnHandle invalidRgn) -> None"},
5593 {"GetMovieBox", (PyCFunction)MovieObj_GetMovieBox, 1,
5594 "() -> (Rect boxRect)"},
5595 {"SetMovieBox", (PyCFunction)MovieObj_SetMovieBox, 1,
5596 "(Rect boxRect) -> None"},
5597 {"GetMovieDisplayClipRgn", (PyCFunction)MovieObj_GetMovieDisplayClipRgn, 1,
5598 "() -> (RgnHandle _rv)"},
5599 {"SetMovieDisplayClipRgn", (PyCFunction)MovieObj_SetMovieDisplayClipRgn, 1,
5600 "(RgnHandle theClip) -> None"},
5601 {"GetMovieClipRgn", (PyCFunction)MovieObj_GetMovieClipRgn, 1,
5602 "() -> (RgnHandle _rv)"},
5603 {"SetMovieClipRgn", (PyCFunction)MovieObj_SetMovieClipRgn, 1,
5604 "(RgnHandle theClip) -> None"},
5605 {"GetMovieDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieDisplayBoundsRgn, 1,
5606 "() -> (RgnHandle _rv)"},
5607 {"GetMovieBoundsRgn", (PyCFunction)MovieObj_GetMovieBoundsRgn, 1,
5608 "() -> (RgnHandle _rv)"},
5609 {"PutMovieIntoHandle", (PyCFunction)MovieObj_PutMovieIntoHandle, 1,
5610 "(Handle publicMovie) -> None"},
5611 {"PutMovieIntoDataFork", (PyCFunction)MovieObj_PutMovieIntoDataFork, 1,
5612 "(short fRefNum, long offset, long maxSize) -> None"},
5613 {"PutMovieIntoDataFork64", (PyCFunction)MovieObj_PutMovieIntoDataFork64, 1,
5614 "(long fRefNum, wide offset, unsigned long maxSize) -> None"},
5615 {"GetMovieCreationTime", (PyCFunction)MovieObj_GetMovieCreationTime, 1,
5616 "() -> (unsigned long _rv)"},
5617 {"GetMovieModificationTime", (PyCFunction)MovieObj_GetMovieModificationTime, 1,
5618 "() -> (unsigned long _rv)"},
5619 {"GetMovieTimeScale", (PyCFunction)MovieObj_GetMovieTimeScale, 1,
5620 "() -> (TimeScale _rv)"},
5621 {"SetMovieTimeScale", (PyCFunction)MovieObj_SetMovieTimeScale, 1,
5622 "(TimeScale timeScale) -> None"},
5623 {"GetMovieDuration", (PyCFunction)MovieObj_GetMovieDuration, 1,
5624 "() -> (TimeValue _rv)"},
5625 {"GetMovieRate", (PyCFunction)MovieObj_GetMovieRate, 1,
5626 "() -> (Fixed _rv)"},
5627 {"SetMovieRate", (PyCFunction)MovieObj_SetMovieRate, 1,
5628 "(Fixed rate) -> None"},
5629 {"GetMoviePreferredRate", (PyCFunction)MovieObj_GetMoviePreferredRate, 1,
5630 "() -> (Fixed _rv)"},
5631 {"SetMoviePreferredRate", (PyCFunction)MovieObj_SetMoviePreferredRate, 1,
5632 "(Fixed rate) -> None"},
5633 {"GetMoviePreferredVolume", (PyCFunction)MovieObj_GetMoviePreferredVolume, 1,
5634 "() -> (short _rv)"},
5635 {"SetMoviePreferredVolume", (PyCFunction)MovieObj_SetMoviePreferredVolume, 1,
5636 "(short volume) -> None"},
5637 {"GetMovieVolume", (PyCFunction)MovieObj_GetMovieVolume, 1,
5638 "() -> (short _rv)"},
5639 {"SetMovieVolume", (PyCFunction)MovieObj_SetMovieVolume, 1,
5640 "(short volume) -> None"},
5641 {"GetMoviePreviewTime", (PyCFunction)MovieObj_GetMoviePreviewTime, 1,
5642 "() -> (TimeValue previewTime, TimeValue previewDuration)"},
5643 {"SetMoviePreviewTime", (PyCFunction)MovieObj_SetMoviePreviewTime, 1,
5644 "(TimeValue previewTime, TimeValue previewDuration) -> None"},
5645 {"GetMoviePosterTime", (PyCFunction)MovieObj_GetMoviePosterTime, 1,
5646 "() -> (TimeValue _rv)"},
5647 {"SetMoviePosterTime", (PyCFunction)MovieObj_SetMoviePosterTime, 1,
5648 "(TimeValue posterTime) -> None"},
5649 {"GetMovieSelection", (PyCFunction)MovieObj_GetMovieSelection, 1,
5650 "() -> (TimeValue selectionTime, TimeValue selectionDuration)"},
5651 {"SetMovieSelection", (PyCFunction)MovieObj_SetMovieSelection, 1,
5652 "(TimeValue selectionTime, TimeValue selectionDuration) -> None"},
5653 {"SetMovieActiveSegment", (PyCFunction)MovieObj_SetMovieActiveSegment, 1,
5654 "(TimeValue startTime, TimeValue duration) -> None"},
5655 {"GetMovieActiveSegment", (PyCFunction)MovieObj_GetMovieActiveSegment, 1,
5656 "() -> (TimeValue startTime, TimeValue duration)"},
5657 {"GetMovieTime", (PyCFunction)MovieObj_GetMovieTime, 1,
5658 "() -> (TimeValue _rv, TimeRecord currentTime)"},
5659 {"SetMovieTime", (PyCFunction)MovieObj_SetMovieTime, 1,
5660 "(TimeRecord newtime) -> None"},
5661 {"SetMovieTimeValue", (PyCFunction)MovieObj_SetMovieTimeValue, 1,
5662 "(TimeValue newtime) -> None"},
5663 {"GetMovieUserData", (PyCFunction)MovieObj_GetMovieUserData, 1,
5664 "() -> (UserData _rv)"},
5665 {"GetMovieTrackCount", (PyCFunction)MovieObj_GetMovieTrackCount, 1,
5666 "() -> (long _rv)"},
5667 {"GetMovieTrack", (PyCFunction)MovieObj_GetMovieTrack, 1,
5668 "(long trackID) -> (Track _rv)"},
5669 {"GetMovieIndTrack", (PyCFunction)MovieObj_GetMovieIndTrack, 1,
5670 "(long index) -> (Track _rv)"},
5671 {"GetMovieIndTrackType", (PyCFunction)MovieObj_GetMovieIndTrackType, 1,
5672 "(long index, OSType trackType, long flags) -> (Track _rv)"},
5673 {"NewMovieTrack", (PyCFunction)MovieObj_NewMovieTrack, 1,
5674 "(Fixed width, Fixed height, short trackVolume) -> (Track _rv)"},
5675 {"SetAutoTrackAlternatesEnabled", (PyCFunction)MovieObj_SetAutoTrackAlternatesEnabled, 1,
5676 "(Boolean enable) -> None"},
5677 {"SelectMovieAlternates", (PyCFunction)MovieObj_SelectMovieAlternates, 1,
5678 "() -> None"},
5679 {"InsertMovieSegment", (PyCFunction)MovieObj_InsertMovieSegment, 1,
5680 "(Movie dstMovie, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
5681 {"InsertEmptyMovieSegment", (PyCFunction)MovieObj_InsertEmptyMovieSegment, 1,
5682 "(TimeValue dstIn, TimeValue dstDuration) -> None"},
5683 {"DeleteMovieSegment", (PyCFunction)MovieObj_DeleteMovieSegment, 1,
5684 "(TimeValue startTime, TimeValue duration) -> None"},
5685 {"ScaleMovieSegment", (PyCFunction)MovieObj_ScaleMovieSegment, 1,
5686 "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
5687 {"CutMovieSelection", (PyCFunction)MovieObj_CutMovieSelection, 1,
5688 "() -> (Movie _rv)"},
5689 {"CopyMovieSelection", (PyCFunction)MovieObj_CopyMovieSelection, 1,
5690 "() -> (Movie _rv)"},
5691 {"PasteMovieSelection", (PyCFunction)MovieObj_PasteMovieSelection, 1,
5692 "(Movie src) -> None"},
5693 {"AddMovieSelection", (PyCFunction)MovieObj_AddMovieSelection, 1,
5694 "(Movie src) -> None"},
5695 {"ClearMovieSelection", (PyCFunction)MovieObj_ClearMovieSelection, 1,
5696 "() -> None"},
5697 {"PutMovieIntoTypedHandle", (PyCFunction)MovieObj_PutMovieIntoTypedHandle, 1,
5698 "(Track targetTrack, OSType handleType, Handle publicMovie, TimeValue start, TimeValue dur, long flags, ComponentInstance userComp) -> None"},
5699 {"CopyMovieSettings", (PyCFunction)MovieObj_CopyMovieSettings, 1,
5700 "(Movie dstMovie) -> None"},
5701 {"ConvertMovieToFile", (PyCFunction)MovieObj_ConvertMovieToFile, 1,
5702 "(Track onlyTrack, FSSpec outputFile, OSType fileType, OSType creator, ScriptCode scriptTag, long flags, ComponentInstance userComp) -> (short resID)"},
5703 {"GetMovieDataSize", (PyCFunction)MovieObj_GetMovieDataSize, 1,
5704 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
5705 {"GetMovieDataSize64", (PyCFunction)MovieObj_GetMovieDataSize64, 1,
5706 "(TimeValue startTime, TimeValue duration) -> (wide dataSize)"},
5707 {"PtInMovie", (PyCFunction)MovieObj_PtInMovie, 1,
5708 "(Point pt) -> (Boolean _rv)"},
5709 {"SetMovieLanguage", (PyCFunction)MovieObj_SetMovieLanguage, 1,
5710 "(long language) -> None"},
5711 {"GetMovieNextInterestingTime", (PyCFunction)MovieObj_GetMovieNextInterestingTime, 1,
5712 "(short interestingTimeFlags, short numMediaTypes, OSType whichMediaTypes, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
5713 {"AddMovieResource", (PyCFunction)MovieObj_AddMovieResource, 1,
5714 "(short resRefNum, Str255 resName) -> (short resId)"},
5715 {"UpdateMovieResource", (PyCFunction)MovieObj_UpdateMovieResource, 1,
5716 "(short resRefNum, short resId, Str255 resName) -> None"},
5717 {"HasMovieChanged", (PyCFunction)MovieObj_HasMovieChanged, 1,
5718 "() -> (Boolean _rv)"},
5719 {"ClearMovieChanged", (PyCFunction)MovieObj_ClearMovieChanged, 1,
5720 "() -> None"},
5721 {"SetMovieDefaultDataRef", (PyCFunction)MovieObj_SetMovieDefaultDataRef, 1,
5722 "(Handle dataRef, OSType dataRefType) -> None"},
5723 {"GetMovieDefaultDataRef", (PyCFunction)MovieObj_GetMovieDefaultDataRef, 1,
5724 "() -> (Handle dataRef, OSType dataRefType)"},
5726 #if !TARGET_API_MAC_CARBON
5727 {"SetMovieAnchorDataRef", (PyCFunction)MovieObj_SetMovieAnchorDataRef, 1,
5728 "(Handle dataRef, OSType dataRefType) -> None"},
5729 #endif
5731 #if !TARGET_API_MAC_CARBON
5732 {"GetMovieAnchorDataRef", (PyCFunction)MovieObj_GetMovieAnchorDataRef, 1,
5733 "() -> (Handle dataRef, OSType dataRefType, long outFlags)"},
5734 #endif
5735 {"SetMovieColorTable", (PyCFunction)MovieObj_SetMovieColorTable, 1,
5736 "(CTabHandle ctab) -> None"},
5737 {"GetMovieColorTable", (PyCFunction)MovieObj_GetMovieColorTable, 1,
5738 "() -> (CTabHandle ctab)"},
5739 {"FlattenMovie", (PyCFunction)MovieObj_FlattenMovie, 1,
5740 "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, Str255 resName) -> (short resId)"},
5741 {"FlattenMovieData", (PyCFunction)MovieObj_FlattenMovieData, 1,
5742 "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (Movie _rv)"},
5743 {"MovieSearchText", (PyCFunction)MovieObj_MovieSearchText, 1,
5744 "(Ptr text, long size, long searchFlags) -> (Track searchTrack, TimeValue searchTime, long searchOffset)"},
5745 {"GetPosterBox", (PyCFunction)MovieObj_GetPosterBox, 1,
5746 "() -> (Rect boxRect)"},
5747 {"SetPosterBox", (PyCFunction)MovieObj_SetPosterBox, 1,
5748 "(Rect boxRect) -> None"},
5749 {"GetMovieSegmentDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieSegmentDisplayBoundsRgn, 1,
5750 "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
5751 {"GetMovieStatus", (PyCFunction)MovieObj_GetMovieStatus, 1,
5752 "() -> (ComponentResult _rv, Track firstProblemTrack)"},
5754 #if !TARGET_API_MAC_CARBON
5755 {"GetMovieLoadState", (PyCFunction)MovieObj_GetMovieLoadState, 1,
5756 "() -> (long _rv)"},
5757 #endif
5758 {"NewMovieController", (PyCFunction)MovieObj_NewMovieController, 1,
5759 "(Rect movieRect, long someFlags) -> (MovieController _rv)"},
5760 {"PutMovieOnScrap", (PyCFunction)MovieObj_PutMovieOnScrap, 1,
5761 "(long movieScrapFlags) -> None"},
5762 {"SetMoviePlayHints", (PyCFunction)MovieObj_SetMoviePlayHints, 1,
5763 "(long flags, long flagsMask) -> None"},
5764 {"GetMaxLoadedTimeInMovie", (PyCFunction)MovieObj_GetMaxLoadedTimeInMovie, 1,
5765 "() -> (TimeValue time)"},
5766 {"QTMovieNeedsTimeTable", (PyCFunction)MovieObj_QTMovieNeedsTimeTable, 1,
5767 "() -> (Boolean needsTimeTable)"},
5768 {"QTGetDataRefMaxFileOffset", (PyCFunction)MovieObj_QTGetDataRefMaxFileOffset, 1,
5769 "(OSType dataRefType, Handle dataRef) -> (long offset)"},
5770 {NULL, NULL, 0}
5773 PyMethodChain MovieObj_chain = { MovieObj_methods, NULL };
5775 static PyObject *MovieObj_getattr(MovieObject *self, char *name)
5777 return Py_FindMethodInChain(&MovieObj_chain, (PyObject *)self, name);
5780 #define MovieObj_setattr NULL
5782 #define MovieObj_compare NULL
5784 #define MovieObj_repr NULL
5786 #define MovieObj_hash NULL
5788 PyTypeObject Movie_Type = {
5789 PyObject_HEAD_INIT(&PyType_Type)
5790 0, /*ob_size*/
5791 "Movie", /*tp_name*/
5792 sizeof(MovieObject), /*tp_basicsize*/
5793 0, /*tp_itemsize*/
5794 /* methods */
5795 (destructor) MovieObj_dealloc, /*tp_dealloc*/
5796 0, /*tp_print*/
5797 (getattrfunc) MovieObj_getattr, /*tp_getattr*/
5798 (setattrfunc) MovieObj_setattr, /*tp_setattr*/
5799 (cmpfunc) MovieObj_compare, /*tp_compare*/
5800 (reprfunc) MovieObj_repr, /*tp_repr*/
5801 (PyNumberMethods *)0, /* tp_as_number */
5802 (PySequenceMethods *)0, /* tp_as_sequence */
5803 (PyMappingMethods *)0, /* tp_as_mapping */
5804 (hashfunc) MovieObj_hash, /*tp_hash*/
5807 /* --------------------- End object type Movie ---------------------- */
5810 #if !TARGET_API_MAC_CARBON
5812 static PyObject *Qt_CheckQuickTimeRegistration(PyObject *_self, PyObject *_args)
5814 PyObject *_res = NULL;
5815 void * registrationKey;
5816 long flags;
5817 if (!PyArg_ParseTuple(_args, "sl",
5818 &registrationKey,
5819 &flags))
5820 return NULL;
5821 CheckQuickTimeRegistration(registrationKey,
5822 flags);
5823 Py_INCREF(Py_None);
5824 _res = Py_None;
5825 return _res;
5827 #endif
5829 static PyObject *Qt_EnterMovies(PyObject *_self, PyObject *_args)
5831 PyObject *_res = NULL;
5832 OSErr _err;
5833 if (!PyArg_ParseTuple(_args, ""))
5834 return NULL;
5835 _err = EnterMovies();
5836 if (_err != noErr) return PyMac_Error(_err);
5837 Py_INCREF(Py_None);
5838 _res = Py_None;
5839 return _res;
5842 static PyObject *Qt_ExitMovies(PyObject *_self, PyObject *_args)
5844 PyObject *_res = NULL;
5845 if (!PyArg_ParseTuple(_args, ""))
5846 return NULL;
5847 ExitMovies();
5848 Py_INCREF(Py_None);
5849 _res = Py_None;
5850 return _res;
5853 static PyObject *Qt_GetMoviesError(PyObject *_self, PyObject *_args)
5855 PyObject *_res = NULL;
5856 OSErr _err;
5857 if (!PyArg_ParseTuple(_args, ""))
5858 return NULL;
5859 _err = GetMoviesError();
5860 if (_err != noErr) return PyMac_Error(_err);
5861 Py_INCREF(Py_None);
5862 _res = Py_None;
5863 return _res;
5866 static PyObject *Qt_ClearMoviesStickyError(PyObject *_self, PyObject *_args)
5868 PyObject *_res = NULL;
5869 if (!PyArg_ParseTuple(_args, ""))
5870 return NULL;
5871 ClearMoviesStickyError();
5872 Py_INCREF(Py_None);
5873 _res = Py_None;
5874 return _res;
5877 static PyObject *Qt_GetMoviesStickyError(PyObject *_self, PyObject *_args)
5879 PyObject *_res = NULL;
5880 OSErr _err;
5881 if (!PyArg_ParseTuple(_args, ""))
5882 return NULL;
5883 _err = GetMoviesStickyError();
5884 if (_err != noErr) return PyMac_Error(_err);
5885 Py_INCREF(Py_None);
5886 _res = Py_None;
5887 return _res;
5890 static PyObject *Qt_DisposeMatte(PyObject *_self, PyObject *_args)
5892 PyObject *_res = NULL;
5893 PixMapHandle theMatte;
5894 if (!PyArg_ParseTuple(_args, "O&",
5895 ResObj_Convert, &theMatte))
5896 return NULL;
5897 DisposeMatte(theMatte);
5898 Py_INCREF(Py_None);
5899 _res = Py_None;
5900 return _res;
5903 static PyObject *Qt_NewMovie(PyObject *_self, PyObject *_args)
5905 PyObject *_res = NULL;
5906 Movie _rv;
5907 long flags;
5908 if (!PyArg_ParseTuple(_args, "l",
5909 &flags))
5910 return NULL;
5911 _rv = NewMovie(flags);
5912 _res = Py_BuildValue("O&",
5913 MovieObj_New, _rv);
5914 return _res;
5917 static PyObject *Qt_GetDataHandler(PyObject *_self, PyObject *_args)
5919 PyObject *_res = NULL;
5920 Component _rv;
5921 Handle dataRef;
5922 OSType dataHandlerSubType;
5923 long flags;
5924 if (!PyArg_ParseTuple(_args, "O&O&l",
5925 ResObj_Convert, &dataRef,
5926 PyMac_GetOSType, &dataHandlerSubType,
5927 &flags))
5928 return NULL;
5929 _rv = GetDataHandler(dataRef,
5930 dataHandlerSubType,
5931 flags);
5932 _res = Py_BuildValue("O&",
5933 CmpObj_New, _rv);
5934 return _res;
5937 #if !TARGET_API_MAC_CARBON
5939 static PyObject *Qt_OpenADataHandler(PyObject *_self, PyObject *_args)
5941 PyObject *_res = NULL;
5942 OSErr _err;
5943 Handle dataRef;
5944 OSType dataHandlerSubType;
5945 Handle anchorDataRef;
5946 OSType anchorDataRefType;
5947 TimeBase tb;
5948 long flags;
5949 ComponentInstance dh;
5950 if (!PyArg_ParseTuple(_args, "O&O&O&O&O&l",
5951 ResObj_Convert, &dataRef,
5952 PyMac_GetOSType, &dataHandlerSubType,
5953 ResObj_Convert, &anchorDataRef,
5954 PyMac_GetOSType, &anchorDataRefType,
5955 TimeBaseObj_Convert, &tb,
5956 &flags))
5957 return NULL;
5958 _err = OpenADataHandler(dataRef,
5959 dataHandlerSubType,
5960 anchorDataRef,
5961 anchorDataRefType,
5963 flags,
5964 &dh);
5965 if (_err != noErr) return PyMac_Error(_err);
5966 _res = Py_BuildValue("O&",
5967 CmpInstObj_New, dh);
5968 return _res;
5970 #endif
5972 static PyObject *Qt_PasteHandleIntoMovie(PyObject *_self, PyObject *_args)
5974 PyObject *_res = NULL;
5975 OSErr _err;
5976 Handle h;
5977 OSType handleType;
5978 Movie theMovie;
5979 long flags;
5980 ComponentInstance userComp;
5981 if (!PyArg_ParseTuple(_args, "O&O&O&lO&",
5982 ResObj_Convert, &h,
5983 PyMac_GetOSType, &handleType,
5984 MovieObj_Convert, &theMovie,
5985 &flags,
5986 CmpInstObj_Convert, &userComp))
5987 return NULL;
5988 _err = PasteHandleIntoMovie(h,
5989 handleType,
5990 theMovie,
5991 flags,
5992 userComp);
5993 if (_err != noErr) return PyMac_Error(_err);
5994 Py_INCREF(Py_None);
5995 _res = Py_None;
5996 return _res;
5999 static PyObject *Qt_GetMovieImporterForDataRef(PyObject *_self, PyObject *_args)
6001 PyObject *_res = NULL;
6002 OSErr _err;
6003 OSType dataRefType;
6004 Handle dataRef;
6005 long flags;
6006 Component importer;
6007 if (!PyArg_ParseTuple(_args, "O&O&l",
6008 PyMac_GetOSType, &dataRefType,
6009 ResObj_Convert, &dataRef,
6010 &flags))
6011 return NULL;
6012 _err = GetMovieImporterForDataRef(dataRefType,
6013 dataRef,
6014 flags,
6015 &importer);
6016 if (_err != noErr) return PyMac_Error(_err);
6017 _res = Py_BuildValue("O&",
6018 CmpObj_New, importer);
6019 return _res;
6022 static PyObject *Qt_TrackTimeToMediaTime(PyObject *_self, PyObject *_args)
6024 PyObject *_res = NULL;
6025 TimeValue _rv;
6026 TimeValue value;
6027 Track theTrack;
6028 if (!PyArg_ParseTuple(_args, "lO&",
6029 &value,
6030 TrackObj_Convert, &theTrack))
6031 return NULL;
6032 _rv = TrackTimeToMediaTime(value,
6033 theTrack);
6034 _res = Py_BuildValue("l",
6035 _rv);
6036 return _res;
6039 static PyObject *Qt_NewUserData(PyObject *_self, PyObject *_args)
6041 PyObject *_res = NULL;
6042 OSErr _err;
6043 UserData theUserData;
6044 if (!PyArg_ParseTuple(_args, ""))
6045 return NULL;
6046 _err = NewUserData(&theUserData);
6047 if (_err != noErr) return PyMac_Error(_err);
6048 _res = Py_BuildValue("O&",
6049 UserDataObj_New, theUserData);
6050 return _res;
6053 static PyObject *Qt_NewUserDataFromHandle(PyObject *_self, PyObject *_args)
6055 PyObject *_res = NULL;
6056 OSErr _err;
6057 Handle h;
6058 UserData theUserData;
6059 if (!PyArg_ParseTuple(_args, "O&",
6060 ResObj_Convert, &h))
6061 return NULL;
6062 _err = NewUserDataFromHandle(h,
6063 &theUserData);
6064 if (_err != noErr) return PyMac_Error(_err);
6065 _res = Py_BuildValue("O&",
6066 UserDataObj_New, theUserData);
6067 return _res;
6070 static PyObject *Qt_CreateMovieFile(PyObject *_self, PyObject *_args)
6072 PyObject *_res = NULL;
6073 OSErr _err;
6074 FSSpec fileSpec;
6075 OSType creator;
6076 ScriptCode scriptTag;
6077 long createMovieFileFlags;
6078 short resRefNum;
6079 Movie newmovie;
6080 if (!PyArg_ParseTuple(_args, "O&O&hl",
6081 PyMac_GetFSSpec, &fileSpec,
6082 PyMac_GetOSType, &creator,
6083 &scriptTag,
6084 &createMovieFileFlags))
6085 return NULL;
6086 _err = CreateMovieFile(&fileSpec,
6087 creator,
6088 scriptTag,
6089 createMovieFileFlags,
6090 &resRefNum,
6091 &newmovie);
6092 if (_err != noErr) return PyMac_Error(_err);
6093 _res = Py_BuildValue("hO&",
6094 resRefNum,
6095 MovieObj_New, newmovie);
6096 return _res;
6099 static PyObject *Qt_OpenMovieFile(PyObject *_self, PyObject *_args)
6101 PyObject *_res = NULL;
6102 OSErr _err;
6103 FSSpec fileSpec;
6104 short resRefNum;
6105 SInt8 permission;
6106 if (!PyArg_ParseTuple(_args, "O&b",
6107 PyMac_GetFSSpec, &fileSpec,
6108 &permission))
6109 return NULL;
6110 _err = OpenMovieFile(&fileSpec,
6111 &resRefNum,
6112 permission);
6113 if (_err != noErr) return PyMac_Error(_err);
6114 _res = Py_BuildValue("h",
6115 resRefNum);
6116 return _res;
6119 static PyObject *Qt_CloseMovieFile(PyObject *_self, PyObject *_args)
6121 PyObject *_res = NULL;
6122 OSErr _err;
6123 short resRefNum;
6124 if (!PyArg_ParseTuple(_args, "h",
6125 &resRefNum))
6126 return NULL;
6127 _err = CloseMovieFile(resRefNum);
6128 if (_err != noErr) return PyMac_Error(_err);
6129 Py_INCREF(Py_None);
6130 _res = Py_None;
6131 return _res;
6134 static PyObject *Qt_DeleteMovieFile(PyObject *_self, PyObject *_args)
6136 PyObject *_res = NULL;
6137 OSErr _err;
6138 FSSpec fileSpec;
6139 if (!PyArg_ParseTuple(_args, "O&",
6140 PyMac_GetFSSpec, &fileSpec))
6141 return NULL;
6142 _err = DeleteMovieFile(&fileSpec);
6143 if (_err != noErr) return PyMac_Error(_err);
6144 Py_INCREF(Py_None);
6145 _res = Py_None;
6146 return _res;
6149 static PyObject *Qt_NewMovieFromFile(PyObject *_self, PyObject *_args)
6151 PyObject *_res = NULL;
6152 OSErr _err;
6153 Movie theMovie;
6154 short resRefNum;
6155 short resId;
6156 short newMovieFlags;
6157 Boolean dataRefWasChanged;
6158 if (!PyArg_ParseTuple(_args, "hhh",
6159 &resRefNum,
6160 &resId,
6161 &newMovieFlags))
6162 return NULL;
6163 _err = NewMovieFromFile(&theMovie,
6164 resRefNum,
6165 &resId,
6166 (StringPtr)0,
6167 newMovieFlags,
6168 &dataRefWasChanged);
6169 if (_err != noErr) return PyMac_Error(_err);
6170 _res = Py_BuildValue("O&hb",
6171 MovieObj_New, theMovie,
6172 resId,
6173 dataRefWasChanged);
6174 return _res;
6177 static PyObject *Qt_NewMovieFromHandle(PyObject *_self, PyObject *_args)
6179 PyObject *_res = NULL;
6180 OSErr _err;
6181 Movie theMovie;
6182 Handle h;
6183 short newMovieFlags;
6184 Boolean dataRefWasChanged;
6185 if (!PyArg_ParseTuple(_args, "O&h",
6186 ResObj_Convert, &h,
6187 &newMovieFlags))
6188 return NULL;
6189 _err = NewMovieFromHandle(&theMovie,
6191 newMovieFlags,
6192 &dataRefWasChanged);
6193 if (_err != noErr) return PyMac_Error(_err);
6194 _res = Py_BuildValue("O&b",
6195 MovieObj_New, theMovie,
6196 dataRefWasChanged);
6197 return _res;
6200 static PyObject *Qt_NewMovieFromDataFork(PyObject *_self, PyObject *_args)
6202 PyObject *_res = NULL;
6203 OSErr _err;
6204 Movie theMovie;
6205 short fRefNum;
6206 long fileOffset;
6207 short newMovieFlags;
6208 Boolean dataRefWasChanged;
6209 if (!PyArg_ParseTuple(_args, "hlh",
6210 &fRefNum,
6211 &fileOffset,
6212 &newMovieFlags))
6213 return NULL;
6214 _err = NewMovieFromDataFork(&theMovie,
6215 fRefNum,
6216 fileOffset,
6217 newMovieFlags,
6218 &dataRefWasChanged);
6219 if (_err != noErr) return PyMac_Error(_err);
6220 _res = Py_BuildValue("O&b",
6221 MovieObj_New, theMovie,
6222 dataRefWasChanged);
6223 return _res;
6226 static PyObject *Qt_NewMovieFromDataFork64(PyObject *_self, PyObject *_args)
6228 PyObject *_res = NULL;
6229 OSErr _err;
6230 Movie theMovie;
6231 long fRefNum;
6232 wide fileOffset;
6233 short newMovieFlags;
6234 Boolean dataRefWasChanged;
6235 if (!PyArg_ParseTuple(_args, "lO&h",
6236 &fRefNum,
6237 PyMac_Getwide, &fileOffset,
6238 &newMovieFlags))
6239 return NULL;
6240 _err = NewMovieFromDataFork64(&theMovie,
6241 fRefNum,
6242 &fileOffset,
6243 newMovieFlags,
6244 &dataRefWasChanged);
6245 if (_err != noErr) return PyMac_Error(_err);
6246 _res = Py_BuildValue("O&b",
6247 MovieObj_New, theMovie,
6248 dataRefWasChanged);
6249 return _res;
6252 static PyObject *Qt_NewMovieFromDataRef(PyObject *_self, PyObject *_args)
6254 PyObject *_res = NULL;
6255 OSErr _err;
6256 Movie m;
6257 short flags;
6258 short id;
6259 Handle dataRef;
6260 OSType dataRefType;
6261 if (!PyArg_ParseTuple(_args, "hO&O&",
6262 &flags,
6263 ResObj_Convert, &dataRef,
6264 PyMac_GetOSType, &dataRefType))
6265 return NULL;
6266 _err = NewMovieFromDataRef(&m,
6267 flags,
6268 &id,
6269 dataRef,
6270 dataRefType);
6271 if (_err != noErr) return PyMac_Error(_err);
6272 _res = Py_BuildValue("O&h",
6273 MovieObj_New, m,
6274 id);
6275 return _res;
6278 static PyObject *Qt_RemoveMovieResource(PyObject *_self, PyObject *_args)
6280 PyObject *_res = NULL;
6281 OSErr _err;
6282 short resRefNum;
6283 short resId;
6284 if (!PyArg_ParseTuple(_args, "hh",
6285 &resRefNum,
6286 &resId))
6287 return NULL;
6288 _err = RemoveMovieResource(resRefNum,
6289 resId);
6290 if (_err != noErr) return PyMac_Error(_err);
6291 Py_INCREF(Py_None);
6292 _res = Py_None;
6293 return _res;
6296 static PyObject *Qt_CreateShortcutMovieFile(PyObject *_self, PyObject *_args)
6298 PyObject *_res = NULL;
6299 OSErr _err;
6300 FSSpec fileSpec;
6301 OSType creator;
6302 ScriptCode scriptTag;
6303 long createMovieFileFlags;
6304 Handle targetDataRef;
6305 OSType targetDataRefType;
6306 if (!PyArg_ParseTuple(_args, "O&O&hlO&O&",
6307 PyMac_GetFSSpec, &fileSpec,
6308 PyMac_GetOSType, &creator,
6309 &scriptTag,
6310 &createMovieFileFlags,
6311 ResObj_Convert, &targetDataRef,
6312 PyMac_GetOSType, &targetDataRefType))
6313 return NULL;
6314 _err = CreateShortcutMovieFile(&fileSpec,
6315 creator,
6316 scriptTag,
6317 createMovieFileFlags,
6318 targetDataRef,
6319 targetDataRefType);
6320 if (_err != noErr) return PyMac_Error(_err);
6321 Py_INCREF(Py_None);
6322 _res = Py_None;
6323 return _res;
6326 static PyObject *Qt_NewMovieFromScrap(PyObject *_self, PyObject *_args)
6328 PyObject *_res = NULL;
6329 Movie _rv;
6330 long newMovieFlags;
6331 if (!PyArg_ParseTuple(_args, "l",
6332 &newMovieFlags))
6333 return NULL;
6334 _rv = NewMovieFromScrap(newMovieFlags);
6335 _res = Py_BuildValue("O&",
6336 MovieObj_New, _rv);
6337 return _res;
6340 static PyObject *Qt_QTNewAlias(PyObject *_self, PyObject *_args)
6342 PyObject *_res = NULL;
6343 OSErr _err;
6344 FSSpec fss;
6345 AliasHandle alias;
6346 Boolean minimal;
6347 if (!PyArg_ParseTuple(_args, "O&b",
6348 PyMac_GetFSSpec, &fss,
6349 &minimal))
6350 return NULL;
6351 _err = QTNewAlias(&fss,
6352 &alias,
6353 minimal);
6354 if (_err != noErr) return PyMac_Error(_err);
6355 _res = Py_BuildValue("O&",
6356 ResObj_New, alias);
6357 return _res;
6360 static PyObject *Qt_EndFullScreen(PyObject *_self, PyObject *_args)
6362 PyObject *_res = NULL;
6363 OSErr _err;
6364 Ptr fullState;
6365 long flags;
6366 if (!PyArg_ParseTuple(_args, "sl",
6367 &fullState,
6368 &flags))
6369 return NULL;
6370 _err = EndFullScreen(fullState,
6371 flags);
6372 if (_err != noErr) return PyMac_Error(_err);
6373 Py_INCREF(Py_None);
6374 _res = Py_None;
6375 return _res;
6378 static PyObject *Qt_AddSoundDescriptionExtension(PyObject *_self, PyObject *_args)
6380 PyObject *_res = NULL;
6381 OSErr _err;
6382 SoundDescriptionHandle desc;
6383 Handle extension;
6384 OSType idType;
6385 if (!PyArg_ParseTuple(_args, "O&O&O&",
6386 ResObj_Convert, &desc,
6387 ResObj_Convert, &extension,
6388 PyMac_GetOSType, &idType))
6389 return NULL;
6390 _err = AddSoundDescriptionExtension(desc,
6391 extension,
6392 idType);
6393 if (_err != noErr) return PyMac_Error(_err);
6394 Py_INCREF(Py_None);
6395 _res = Py_None;
6396 return _res;
6399 static PyObject *Qt_GetSoundDescriptionExtension(PyObject *_self, PyObject *_args)
6401 PyObject *_res = NULL;
6402 OSErr _err;
6403 SoundDescriptionHandle desc;
6404 Handle extension;
6405 OSType idType;
6406 if (!PyArg_ParseTuple(_args, "O&O&",
6407 ResObj_Convert, &desc,
6408 PyMac_GetOSType, &idType))
6409 return NULL;
6410 _err = GetSoundDescriptionExtension(desc,
6411 &extension,
6412 idType);
6413 if (_err != noErr) return PyMac_Error(_err);
6414 _res = Py_BuildValue("O&",
6415 ResObj_New, extension);
6416 return _res;
6419 static PyObject *Qt_RemoveSoundDescriptionExtension(PyObject *_self, PyObject *_args)
6421 PyObject *_res = NULL;
6422 OSErr _err;
6423 SoundDescriptionHandle desc;
6424 OSType idType;
6425 if (!PyArg_ParseTuple(_args, "O&O&",
6426 ResObj_Convert, &desc,
6427 PyMac_GetOSType, &idType))
6428 return NULL;
6429 _err = RemoveSoundDescriptionExtension(desc,
6430 idType);
6431 if (_err != noErr) return PyMac_Error(_err);
6432 Py_INCREF(Py_None);
6433 _res = Py_None;
6434 return _res;
6437 static PyObject *Qt_QTIsStandardParameterDialogEvent(PyObject *_self, PyObject *_args)
6439 PyObject *_res = NULL;
6440 OSErr _err;
6441 EventRecord pEvent;
6442 QTParameterDialog createdDialog;
6443 if (!PyArg_ParseTuple(_args, "l",
6444 &createdDialog))
6445 return NULL;
6446 _err = QTIsStandardParameterDialogEvent(&pEvent,
6447 createdDialog);
6448 if (_err != noErr) return PyMac_Error(_err);
6449 _res = Py_BuildValue("O&",
6450 PyMac_BuildEventRecord, &pEvent);
6451 return _res;
6454 static PyObject *Qt_QTDismissStandardParameterDialog(PyObject *_self, PyObject *_args)
6456 PyObject *_res = NULL;
6457 OSErr _err;
6458 QTParameterDialog createdDialog;
6459 if (!PyArg_ParseTuple(_args, "l",
6460 &createdDialog))
6461 return NULL;
6462 _err = QTDismissStandardParameterDialog(createdDialog);
6463 if (_err != noErr) return PyMac_Error(_err);
6464 Py_INCREF(Py_None);
6465 _res = Py_None;
6466 return _res;
6469 static PyObject *Qt_QTStandardParameterDialogDoAction(PyObject *_self, PyObject *_args)
6471 PyObject *_res = NULL;
6472 OSErr _err;
6473 QTParameterDialog createdDialog;
6474 long action;
6475 void * params;
6476 if (!PyArg_ParseTuple(_args, "lls",
6477 &createdDialog,
6478 &action,
6479 &params))
6480 return NULL;
6481 _err = QTStandardParameterDialogDoAction(createdDialog,
6482 action,
6483 params);
6484 if (_err != noErr) return PyMac_Error(_err);
6485 Py_INCREF(Py_None);
6486 _res = Py_None;
6487 return _res;
6490 static PyObject *Qt_QTRegisterAccessKey(PyObject *_self, PyObject *_args)
6492 PyObject *_res = NULL;
6493 OSErr _err;
6494 Str255 accessKeyType;
6495 long flags;
6496 Handle accessKey;
6497 if (!PyArg_ParseTuple(_args, "O&lO&",
6498 PyMac_GetStr255, accessKeyType,
6499 &flags,
6500 ResObj_Convert, &accessKey))
6501 return NULL;
6502 _err = QTRegisterAccessKey(accessKeyType,
6503 flags,
6504 accessKey);
6505 if (_err != noErr) return PyMac_Error(_err);
6506 Py_INCREF(Py_None);
6507 _res = Py_None;
6508 return _res;
6511 static PyObject *Qt_QTUnregisterAccessKey(PyObject *_self, PyObject *_args)
6513 PyObject *_res = NULL;
6514 OSErr _err;
6515 Str255 accessKeyType;
6516 long flags;
6517 Handle accessKey;
6518 if (!PyArg_ParseTuple(_args, "O&lO&",
6519 PyMac_GetStr255, accessKeyType,
6520 &flags,
6521 ResObj_Convert, &accessKey))
6522 return NULL;
6523 _err = QTUnregisterAccessKey(accessKeyType,
6524 flags,
6525 accessKey);
6526 if (_err != noErr) return PyMac_Error(_err);
6527 Py_INCREF(Py_None);
6528 _res = Py_None;
6529 return _res;
6532 static PyObject *Qt_QTTextToNativeText(PyObject *_self, PyObject *_args)
6534 PyObject *_res = NULL;
6535 OSErr _err;
6536 Handle theText;
6537 long encoding;
6538 long flags;
6539 if (!PyArg_ParseTuple(_args, "O&ll",
6540 ResObj_Convert, &theText,
6541 &encoding,
6542 &flags))
6543 return NULL;
6544 _err = QTTextToNativeText(theText,
6545 encoding,
6546 flags);
6547 if (_err != noErr) return PyMac_Error(_err);
6548 Py_INCREF(Py_None);
6549 _res = Py_None;
6550 return _res;
6553 static PyObject *Qt_VideoMediaResetStatistics(PyObject *_self, PyObject *_args)
6555 PyObject *_res = NULL;
6556 ComponentResult _rv;
6557 MediaHandler mh;
6558 if (!PyArg_ParseTuple(_args, "O&",
6559 CmpInstObj_Convert, &mh))
6560 return NULL;
6561 _rv = VideoMediaResetStatistics(mh);
6562 _res = Py_BuildValue("l",
6563 _rv);
6564 return _res;
6567 static PyObject *Qt_VideoMediaGetStatistics(PyObject *_self, PyObject *_args)
6569 PyObject *_res = NULL;
6570 ComponentResult _rv;
6571 MediaHandler mh;
6572 if (!PyArg_ParseTuple(_args, "O&",
6573 CmpInstObj_Convert, &mh))
6574 return NULL;
6575 _rv = VideoMediaGetStatistics(mh);
6576 _res = Py_BuildValue("l",
6577 _rv);
6578 return _res;
6581 static PyObject *Qt_VideoMediaGetStallCount(PyObject *_self, PyObject *_args)
6583 PyObject *_res = NULL;
6584 ComponentResult _rv;
6585 MediaHandler mh;
6586 unsigned long stalls;
6587 if (!PyArg_ParseTuple(_args, "O&",
6588 CmpInstObj_Convert, &mh))
6589 return NULL;
6590 _rv = VideoMediaGetStallCount(mh,
6591 &stalls);
6592 _res = Py_BuildValue("ll",
6593 _rv,
6594 stalls);
6595 return _res;
6598 static PyObject *Qt_VideoMediaSetCodecParameter(PyObject *_self, PyObject *_args)
6600 PyObject *_res = NULL;
6601 ComponentResult _rv;
6602 MediaHandler mh;
6603 CodecType cType;
6604 OSType parameterID;
6605 long parameterChangeSeed;
6606 void * dataPtr;
6607 long dataSize;
6608 if (!PyArg_ParseTuple(_args, "O&O&O&lsl",
6609 CmpInstObj_Convert, &mh,
6610 PyMac_GetOSType, &cType,
6611 PyMac_GetOSType, &parameterID,
6612 &parameterChangeSeed,
6613 &dataPtr,
6614 &dataSize))
6615 return NULL;
6616 _rv = VideoMediaSetCodecParameter(mh,
6617 cType,
6618 parameterID,
6619 parameterChangeSeed,
6620 dataPtr,
6621 dataSize);
6622 _res = Py_BuildValue("l",
6623 _rv);
6624 return _res;
6627 static PyObject *Qt_VideoMediaGetCodecParameter(PyObject *_self, PyObject *_args)
6629 PyObject *_res = NULL;
6630 ComponentResult _rv;
6631 MediaHandler mh;
6632 CodecType cType;
6633 OSType parameterID;
6634 Handle outParameterData;
6635 if (!PyArg_ParseTuple(_args, "O&O&O&O&",
6636 CmpInstObj_Convert, &mh,
6637 PyMac_GetOSType, &cType,
6638 PyMac_GetOSType, &parameterID,
6639 ResObj_Convert, &outParameterData))
6640 return NULL;
6641 _rv = VideoMediaGetCodecParameter(mh,
6642 cType,
6643 parameterID,
6644 outParameterData);
6645 _res = Py_BuildValue("l",
6646 _rv);
6647 return _res;
6650 static PyObject *Qt_TextMediaAddTextSample(PyObject *_self, PyObject *_args)
6652 PyObject *_res = NULL;
6653 ComponentResult _rv;
6654 MediaHandler mh;
6655 Ptr text;
6656 unsigned long size;
6657 short fontNumber;
6658 short fontSize;
6659 Style textFace;
6660 RGBColor textColor;
6661 RGBColor backColor;
6662 short textJustification;
6663 Rect textBox;
6664 long displayFlags;
6665 TimeValue scrollDelay;
6666 short hiliteStart;
6667 short hiliteEnd;
6668 RGBColor rgbHiliteColor;
6669 TimeValue duration;
6670 TimeValue sampleTime;
6671 if (!PyArg_ParseTuple(_args, "O&slhhbhllhhl",
6672 CmpInstObj_Convert, &mh,
6673 &text,
6674 &size,
6675 &fontNumber,
6676 &fontSize,
6677 &textFace,
6678 &textJustification,
6679 &displayFlags,
6680 &scrollDelay,
6681 &hiliteStart,
6682 &hiliteEnd,
6683 &duration))
6684 return NULL;
6685 _rv = TextMediaAddTextSample(mh,
6686 text,
6687 size,
6688 fontNumber,
6689 fontSize,
6690 textFace,
6691 &textColor,
6692 &backColor,
6693 textJustification,
6694 &textBox,
6695 displayFlags,
6696 scrollDelay,
6697 hiliteStart,
6698 hiliteEnd,
6699 &rgbHiliteColor,
6700 duration,
6701 &sampleTime);
6702 _res = Py_BuildValue("lO&O&O&O&l",
6703 _rv,
6704 QdRGB_New, &textColor,
6705 QdRGB_New, &backColor,
6706 PyMac_BuildRect, &textBox,
6707 QdRGB_New, &rgbHiliteColor,
6708 sampleTime);
6709 return _res;
6712 static PyObject *Qt_TextMediaAddTESample(PyObject *_self, PyObject *_args)
6714 PyObject *_res = NULL;
6715 ComponentResult _rv;
6716 MediaHandler mh;
6717 TEHandle hTE;
6718 RGBColor backColor;
6719 short textJustification;
6720 Rect textBox;
6721 long displayFlags;
6722 TimeValue scrollDelay;
6723 short hiliteStart;
6724 short hiliteEnd;
6725 RGBColor rgbHiliteColor;
6726 TimeValue duration;
6727 TimeValue sampleTime;
6728 if (!PyArg_ParseTuple(_args, "O&O&hllhhl",
6729 CmpInstObj_Convert, &mh,
6730 ResObj_Convert, &hTE,
6731 &textJustification,
6732 &displayFlags,
6733 &scrollDelay,
6734 &hiliteStart,
6735 &hiliteEnd,
6736 &duration))
6737 return NULL;
6738 _rv = TextMediaAddTESample(mh,
6739 hTE,
6740 &backColor,
6741 textJustification,
6742 &textBox,
6743 displayFlags,
6744 scrollDelay,
6745 hiliteStart,
6746 hiliteEnd,
6747 &rgbHiliteColor,
6748 duration,
6749 &sampleTime);
6750 _res = Py_BuildValue("lO&O&O&l",
6751 _rv,
6752 QdRGB_New, &backColor,
6753 PyMac_BuildRect, &textBox,
6754 QdRGB_New, &rgbHiliteColor,
6755 sampleTime);
6756 return _res;
6759 static PyObject *Qt_TextMediaAddHiliteSample(PyObject *_self, PyObject *_args)
6761 PyObject *_res = NULL;
6762 ComponentResult _rv;
6763 MediaHandler mh;
6764 short hiliteStart;
6765 short hiliteEnd;
6766 RGBColor rgbHiliteColor;
6767 TimeValue duration;
6768 TimeValue sampleTime;
6769 if (!PyArg_ParseTuple(_args, "O&hhl",
6770 CmpInstObj_Convert, &mh,
6771 &hiliteStart,
6772 &hiliteEnd,
6773 &duration))
6774 return NULL;
6775 _rv = TextMediaAddHiliteSample(mh,
6776 hiliteStart,
6777 hiliteEnd,
6778 &rgbHiliteColor,
6779 duration,
6780 &sampleTime);
6781 _res = Py_BuildValue("lO&l",
6782 _rv,
6783 QdRGB_New, &rgbHiliteColor,
6784 sampleTime);
6785 return _res;
6788 static PyObject *Qt_TextMediaDrawRaw(PyObject *_self, PyObject *_args)
6790 PyObject *_res = NULL;
6791 ComponentResult _rv;
6792 MediaHandler mh;
6793 GWorldPtr gw;
6794 GDHandle gd;
6795 void * data;
6796 long dataSize;
6797 TextDescriptionHandle tdh;
6798 if (!PyArg_ParseTuple(_args, "O&O&O&slO&",
6799 CmpInstObj_Convert, &mh,
6800 GWorldObj_Convert, &gw,
6801 OptResObj_Convert, &gd,
6802 &data,
6803 &dataSize,
6804 ResObj_Convert, &tdh))
6805 return NULL;
6806 _rv = TextMediaDrawRaw(mh,
6809 data,
6810 dataSize,
6811 tdh);
6812 _res = Py_BuildValue("l",
6813 _rv);
6814 return _res;
6817 static PyObject *Qt_TextMediaSetTextProperty(PyObject *_self, PyObject *_args)
6819 PyObject *_res = NULL;
6820 ComponentResult _rv;
6821 MediaHandler mh;
6822 TimeValue atMediaTime;
6823 long propertyType;
6824 void * data;
6825 long dataSize;
6826 if (!PyArg_ParseTuple(_args, "O&llsl",
6827 CmpInstObj_Convert, &mh,
6828 &atMediaTime,
6829 &propertyType,
6830 &data,
6831 &dataSize))
6832 return NULL;
6833 _rv = TextMediaSetTextProperty(mh,
6834 atMediaTime,
6835 propertyType,
6836 data,
6837 dataSize);
6838 _res = Py_BuildValue("l",
6839 _rv);
6840 return _res;
6843 static PyObject *Qt_TextMediaRawSetup(PyObject *_self, PyObject *_args)
6845 PyObject *_res = NULL;
6846 ComponentResult _rv;
6847 MediaHandler mh;
6848 GWorldPtr gw;
6849 GDHandle gd;
6850 void * data;
6851 long dataSize;
6852 TextDescriptionHandle tdh;
6853 TimeValue sampleDuration;
6854 if (!PyArg_ParseTuple(_args, "O&O&O&slO&l",
6855 CmpInstObj_Convert, &mh,
6856 GWorldObj_Convert, &gw,
6857 OptResObj_Convert, &gd,
6858 &data,
6859 &dataSize,
6860 ResObj_Convert, &tdh,
6861 &sampleDuration))
6862 return NULL;
6863 _rv = TextMediaRawSetup(mh,
6866 data,
6867 dataSize,
6868 tdh,
6869 sampleDuration);
6870 _res = Py_BuildValue("l",
6871 _rv);
6872 return _res;
6875 static PyObject *Qt_TextMediaRawIdle(PyObject *_self, PyObject *_args)
6877 PyObject *_res = NULL;
6878 ComponentResult _rv;
6879 MediaHandler mh;
6880 GWorldPtr gw;
6881 GDHandle gd;
6882 TimeValue sampleTime;
6883 long flagsIn;
6884 long flagsOut;
6885 if (!PyArg_ParseTuple(_args, "O&O&O&ll",
6886 CmpInstObj_Convert, &mh,
6887 GWorldObj_Convert, &gw,
6888 OptResObj_Convert, &gd,
6889 &sampleTime,
6890 &flagsIn))
6891 return NULL;
6892 _rv = TextMediaRawIdle(mh,
6895 sampleTime,
6896 flagsIn,
6897 &flagsOut);
6898 _res = Py_BuildValue("ll",
6899 _rv,
6900 flagsOut);
6901 return _res;
6904 static PyObject *Qt_TextMediaFindNextText(PyObject *_self, PyObject *_args)
6906 PyObject *_res = NULL;
6907 ComponentResult _rv;
6908 MediaHandler mh;
6909 Ptr text;
6910 long size;
6911 short findFlags;
6912 TimeValue startTime;
6913 TimeValue foundTime;
6914 TimeValue foundDuration;
6915 long offset;
6916 if (!PyArg_ParseTuple(_args, "O&slhl",
6917 CmpInstObj_Convert, &mh,
6918 &text,
6919 &size,
6920 &findFlags,
6921 &startTime))
6922 return NULL;
6923 _rv = TextMediaFindNextText(mh,
6924 text,
6925 size,
6926 findFlags,
6927 startTime,
6928 &foundTime,
6929 &foundDuration,
6930 &offset);
6931 _res = Py_BuildValue("llll",
6932 _rv,
6933 foundTime,
6934 foundDuration,
6935 offset);
6936 return _res;
6939 static PyObject *Qt_TextMediaHiliteTextSample(PyObject *_self, PyObject *_args)
6941 PyObject *_res = NULL;
6942 ComponentResult _rv;
6943 MediaHandler mh;
6944 TimeValue sampleTime;
6945 short hiliteStart;
6946 short hiliteEnd;
6947 RGBColor rgbHiliteColor;
6948 if (!PyArg_ParseTuple(_args, "O&lhh",
6949 CmpInstObj_Convert, &mh,
6950 &sampleTime,
6951 &hiliteStart,
6952 &hiliteEnd))
6953 return NULL;
6954 _rv = TextMediaHiliteTextSample(mh,
6955 sampleTime,
6956 hiliteStart,
6957 hiliteEnd,
6958 &rgbHiliteColor);
6959 _res = Py_BuildValue("lO&",
6960 _rv,
6961 QdRGB_New, &rgbHiliteColor);
6962 return _res;
6965 static PyObject *Qt_TextMediaSetTextSampleData(PyObject *_self, PyObject *_args)
6967 PyObject *_res = NULL;
6968 ComponentResult _rv;
6969 MediaHandler mh;
6970 void * data;
6971 OSType dataType;
6972 if (!PyArg_ParseTuple(_args, "O&sO&",
6973 CmpInstObj_Convert, &mh,
6974 &data,
6975 PyMac_GetOSType, &dataType))
6976 return NULL;
6977 _rv = TextMediaSetTextSampleData(mh,
6978 data,
6979 dataType);
6980 _res = Py_BuildValue("l",
6981 _rv);
6982 return _res;
6985 static PyObject *Qt_SpriteMediaSetProperty(PyObject *_self, PyObject *_args)
6987 PyObject *_res = NULL;
6988 ComponentResult _rv;
6989 MediaHandler mh;
6990 short spriteIndex;
6991 long propertyType;
6992 void * propertyValue;
6993 if (!PyArg_ParseTuple(_args, "O&hls",
6994 CmpInstObj_Convert, &mh,
6995 &spriteIndex,
6996 &propertyType,
6997 &propertyValue))
6998 return NULL;
6999 _rv = SpriteMediaSetProperty(mh,
7000 spriteIndex,
7001 propertyType,
7002 propertyValue);
7003 _res = Py_BuildValue("l",
7004 _rv);
7005 return _res;
7008 static PyObject *Qt_SpriteMediaGetProperty(PyObject *_self, PyObject *_args)
7010 PyObject *_res = NULL;
7011 ComponentResult _rv;
7012 MediaHandler mh;
7013 short spriteIndex;
7014 long propertyType;
7015 void * propertyValue;
7016 if (!PyArg_ParseTuple(_args, "O&hls",
7017 CmpInstObj_Convert, &mh,
7018 &spriteIndex,
7019 &propertyType,
7020 &propertyValue))
7021 return NULL;
7022 _rv = SpriteMediaGetProperty(mh,
7023 spriteIndex,
7024 propertyType,
7025 propertyValue);
7026 _res = Py_BuildValue("l",
7027 _rv);
7028 return _res;
7031 static PyObject *Qt_SpriteMediaHitTestSprites(PyObject *_self, PyObject *_args)
7033 PyObject *_res = NULL;
7034 ComponentResult _rv;
7035 MediaHandler mh;
7036 long flags;
7037 Point loc;
7038 short spriteHitIndex;
7039 if (!PyArg_ParseTuple(_args, "O&lO&",
7040 CmpInstObj_Convert, &mh,
7041 &flags,
7042 PyMac_GetPoint, &loc))
7043 return NULL;
7044 _rv = SpriteMediaHitTestSprites(mh,
7045 flags,
7046 loc,
7047 &spriteHitIndex);
7048 _res = Py_BuildValue("lh",
7049 _rv,
7050 spriteHitIndex);
7051 return _res;
7054 static PyObject *Qt_SpriteMediaCountSprites(PyObject *_self, PyObject *_args)
7056 PyObject *_res = NULL;
7057 ComponentResult _rv;
7058 MediaHandler mh;
7059 short numSprites;
7060 if (!PyArg_ParseTuple(_args, "O&",
7061 CmpInstObj_Convert, &mh))
7062 return NULL;
7063 _rv = SpriteMediaCountSprites(mh,
7064 &numSprites);
7065 _res = Py_BuildValue("lh",
7066 _rv,
7067 numSprites);
7068 return _res;
7071 static PyObject *Qt_SpriteMediaCountImages(PyObject *_self, PyObject *_args)
7073 PyObject *_res = NULL;
7074 ComponentResult _rv;
7075 MediaHandler mh;
7076 short numImages;
7077 if (!PyArg_ParseTuple(_args, "O&",
7078 CmpInstObj_Convert, &mh))
7079 return NULL;
7080 _rv = SpriteMediaCountImages(mh,
7081 &numImages);
7082 _res = Py_BuildValue("lh",
7083 _rv,
7084 numImages);
7085 return _res;
7088 static PyObject *Qt_SpriteMediaGetIndImageDescription(PyObject *_self, PyObject *_args)
7090 PyObject *_res = NULL;
7091 ComponentResult _rv;
7092 MediaHandler mh;
7093 short imageIndex;
7094 ImageDescriptionHandle imageDescription;
7095 if (!PyArg_ParseTuple(_args, "O&hO&",
7096 CmpInstObj_Convert, &mh,
7097 &imageIndex,
7098 ResObj_Convert, &imageDescription))
7099 return NULL;
7100 _rv = SpriteMediaGetIndImageDescription(mh,
7101 imageIndex,
7102 imageDescription);
7103 _res = Py_BuildValue("l",
7104 _rv);
7105 return _res;
7108 static PyObject *Qt_SpriteMediaGetDisplayedSampleNumber(PyObject *_self, PyObject *_args)
7110 PyObject *_res = NULL;
7111 ComponentResult _rv;
7112 MediaHandler mh;
7113 long sampleNum;
7114 if (!PyArg_ParseTuple(_args, "O&",
7115 CmpInstObj_Convert, &mh))
7116 return NULL;
7117 _rv = SpriteMediaGetDisplayedSampleNumber(mh,
7118 &sampleNum);
7119 _res = Py_BuildValue("ll",
7120 _rv,
7121 sampleNum);
7122 return _res;
7125 static PyObject *Qt_SpriteMediaGetSpriteName(PyObject *_self, PyObject *_args)
7127 PyObject *_res = NULL;
7128 ComponentResult _rv;
7129 MediaHandler mh;
7130 QTAtomID spriteID;
7131 Str255 spriteName;
7132 if (!PyArg_ParseTuple(_args, "O&lO&",
7133 CmpInstObj_Convert, &mh,
7134 &spriteID,
7135 PyMac_GetStr255, spriteName))
7136 return NULL;
7137 _rv = SpriteMediaGetSpriteName(mh,
7138 spriteID,
7139 spriteName);
7140 _res = Py_BuildValue("l",
7141 _rv);
7142 return _res;
7145 static PyObject *Qt_SpriteMediaGetImageName(PyObject *_self, PyObject *_args)
7147 PyObject *_res = NULL;
7148 ComponentResult _rv;
7149 MediaHandler mh;
7150 short imageIndex;
7151 Str255 imageName;
7152 if (!PyArg_ParseTuple(_args, "O&hO&",
7153 CmpInstObj_Convert, &mh,
7154 &imageIndex,
7155 PyMac_GetStr255, imageName))
7156 return NULL;
7157 _rv = SpriteMediaGetImageName(mh,
7158 imageIndex,
7159 imageName);
7160 _res = Py_BuildValue("l",
7161 _rv);
7162 return _res;
7165 static PyObject *Qt_SpriteMediaSetSpriteProperty(PyObject *_self, PyObject *_args)
7167 PyObject *_res = NULL;
7168 ComponentResult _rv;
7169 MediaHandler mh;
7170 QTAtomID spriteID;
7171 long propertyType;
7172 void * propertyValue;
7173 if (!PyArg_ParseTuple(_args, "O&lls",
7174 CmpInstObj_Convert, &mh,
7175 &spriteID,
7176 &propertyType,
7177 &propertyValue))
7178 return NULL;
7179 _rv = SpriteMediaSetSpriteProperty(mh,
7180 spriteID,
7181 propertyType,
7182 propertyValue);
7183 _res = Py_BuildValue("l",
7184 _rv);
7185 return _res;
7188 static PyObject *Qt_SpriteMediaGetSpriteProperty(PyObject *_self, PyObject *_args)
7190 PyObject *_res = NULL;
7191 ComponentResult _rv;
7192 MediaHandler mh;
7193 QTAtomID spriteID;
7194 long propertyType;
7195 void * propertyValue;
7196 if (!PyArg_ParseTuple(_args, "O&lls",
7197 CmpInstObj_Convert, &mh,
7198 &spriteID,
7199 &propertyType,
7200 &propertyValue))
7201 return NULL;
7202 _rv = SpriteMediaGetSpriteProperty(mh,
7203 spriteID,
7204 propertyType,
7205 propertyValue);
7206 _res = Py_BuildValue("l",
7207 _rv);
7208 return _res;
7211 static PyObject *Qt_SpriteMediaHitTestAllSprites(PyObject *_self, PyObject *_args)
7213 PyObject *_res = NULL;
7214 ComponentResult _rv;
7215 MediaHandler mh;
7216 long flags;
7217 Point loc;
7218 QTAtomID spriteHitID;
7219 if (!PyArg_ParseTuple(_args, "O&lO&",
7220 CmpInstObj_Convert, &mh,
7221 &flags,
7222 PyMac_GetPoint, &loc))
7223 return NULL;
7224 _rv = SpriteMediaHitTestAllSprites(mh,
7225 flags,
7226 loc,
7227 &spriteHitID);
7228 _res = Py_BuildValue("ll",
7229 _rv,
7230 spriteHitID);
7231 return _res;
7234 static PyObject *Qt_SpriteMediaHitTestOneSprite(PyObject *_self, PyObject *_args)
7236 PyObject *_res = NULL;
7237 ComponentResult _rv;
7238 MediaHandler mh;
7239 QTAtomID spriteID;
7240 long flags;
7241 Point loc;
7242 Boolean wasHit;
7243 if (!PyArg_ParseTuple(_args, "O&llO&",
7244 CmpInstObj_Convert, &mh,
7245 &spriteID,
7246 &flags,
7247 PyMac_GetPoint, &loc))
7248 return NULL;
7249 _rv = SpriteMediaHitTestOneSprite(mh,
7250 spriteID,
7251 flags,
7252 loc,
7253 &wasHit);
7254 _res = Py_BuildValue("lb",
7255 _rv,
7256 wasHit);
7257 return _res;
7260 static PyObject *Qt_SpriteMediaSpriteIndexToID(PyObject *_self, PyObject *_args)
7262 PyObject *_res = NULL;
7263 ComponentResult _rv;
7264 MediaHandler mh;
7265 short spriteIndex;
7266 QTAtomID spriteID;
7267 if (!PyArg_ParseTuple(_args, "O&h",
7268 CmpInstObj_Convert, &mh,
7269 &spriteIndex))
7270 return NULL;
7271 _rv = SpriteMediaSpriteIndexToID(mh,
7272 spriteIndex,
7273 &spriteID);
7274 _res = Py_BuildValue("ll",
7275 _rv,
7276 spriteID);
7277 return _res;
7280 static PyObject *Qt_SpriteMediaSpriteIDToIndex(PyObject *_self, PyObject *_args)
7282 PyObject *_res = NULL;
7283 ComponentResult _rv;
7284 MediaHandler mh;
7285 QTAtomID spriteID;
7286 short spriteIndex;
7287 if (!PyArg_ParseTuple(_args, "O&l",
7288 CmpInstObj_Convert, &mh,
7289 &spriteID))
7290 return NULL;
7291 _rv = SpriteMediaSpriteIDToIndex(mh,
7292 spriteID,
7293 &spriteIndex);
7294 _res = Py_BuildValue("lh",
7295 _rv,
7296 spriteIndex);
7297 return _res;
7300 static PyObject *Qt_SpriteMediaSetActionVariable(PyObject *_self, PyObject *_args)
7302 PyObject *_res = NULL;
7303 ComponentResult _rv;
7304 MediaHandler mh;
7305 QTAtomID variableID;
7306 float value;
7307 if (!PyArg_ParseTuple(_args, "O&lf",
7308 CmpInstObj_Convert, &mh,
7309 &variableID,
7310 &value))
7311 return NULL;
7312 _rv = SpriteMediaSetActionVariable(mh,
7313 variableID,
7314 &value);
7315 _res = Py_BuildValue("l",
7316 _rv);
7317 return _res;
7320 static PyObject *Qt_SpriteMediaGetActionVariable(PyObject *_self, PyObject *_args)
7322 PyObject *_res = NULL;
7323 ComponentResult _rv;
7324 MediaHandler mh;
7325 QTAtomID variableID;
7326 float value;
7327 if (!PyArg_ParseTuple(_args, "O&l",
7328 CmpInstObj_Convert, &mh,
7329 &variableID))
7330 return NULL;
7331 _rv = SpriteMediaGetActionVariable(mh,
7332 variableID,
7333 &value);
7334 _res = Py_BuildValue("lf",
7335 _rv,
7336 value);
7337 return _res;
7340 #if !TARGET_API_MAC_CARBON
7342 static PyObject *Qt_SpriteMediaGetIndImageProperty(PyObject *_self, PyObject *_args)
7344 PyObject *_res = NULL;
7345 ComponentResult _rv;
7346 MediaHandler mh;
7347 short imageIndex;
7348 long imagePropertyType;
7349 void * imagePropertyValue;
7350 if (!PyArg_ParseTuple(_args, "O&hls",
7351 CmpInstObj_Convert, &mh,
7352 &imageIndex,
7353 &imagePropertyType,
7354 &imagePropertyValue))
7355 return NULL;
7356 _rv = SpriteMediaGetIndImageProperty(mh,
7357 imageIndex,
7358 imagePropertyType,
7359 imagePropertyValue);
7360 _res = Py_BuildValue("l",
7361 _rv);
7362 return _res;
7364 #endif
7366 static PyObject *Qt_SpriteMediaDisposeSprite(PyObject *_self, PyObject *_args)
7368 PyObject *_res = NULL;
7369 ComponentResult _rv;
7370 MediaHandler mh;
7371 QTAtomID spriteID;
7372 if (!PyArg_ParseTuple(_args, "O&l",
7373 CmpInstObj_Convert, &mh,
7374 &spriteID))
7375 return NULL;
7376 _rv = SpriteMediaDisposeSprite(mh,
7377 spriteID);
7378 _res = Py_BuildValue("l",
7379 _rv);
7380 return _res;
7383 static PyObject *Qt_SpriteMediaSetActionVariableToString(PyObject *_self, PyObject *_args)
7385 PyObject *_res = NULL;
7386 ComponentResult _rv;
7387 MediaHandler mh;
7388 QTAtomID variableID;
7389 Ptr theCString;
7390 if (!PyArg_ParseTuple(_args, "O&ls",
7391 CmpInstObj_Convert, &mh,
7392 &variableID,
7393 &theCString))
7394 return NULL;
7395 _rv = SpriteMediaSetActionVariableToString(mh,
7396 variableID,
7397 theCString);
7398 _res = Py_BuildValue("l",
7399 _rv);
7400 return _res;
7403 static PyObject *Qt_SpriteMediaGetActionVariableAsString(PyObject *_self, PyObject *_args)
7405 PyObject *_res = NULL;
7406 ComponentResult _rv;
7407 MediaHandler mh;
7408 QTAtomID variableID;
7409 Handle theCString;
7410 if (!PyArg_ParseTuple(_args, "O&l",
7411 CmpInstObj_Convert, &mh,
7412 &variableID))
7413 return NULL;
7414 _rv = SpriteMediaGetActionVariableAsString(mh,
7415 variableID,
7416 &theCString);
7417 _res = Py_BuildValue("lO&",
7418 _rv,
7419 ResObj_New, theCString);
7420 return _res;
7423 static PyObject *Qt_FlashMediaSetPan(PyObject *_self, PyObject *_args)
7425 PyObject *_res = NULL;
7426 ComponentResult _rv;
7427 MediaHandler mh;
7428 short xPercent;
7429 short yPercent;
7430 if (!PyArg_ParseTuple(_args, "O&hh",
7431 CmpInstObj_Convert, &mh,
7432 &xPercent,
7433 &yPercent))
7434 return NULL;
7435 _rv = FlashMediaSetPan(mh,
7436 xPercent,
7437 yPercent);
7438 _res = Py_BuildValue("l",
7439 _rv);
7440 return _res;
7443 static PyObject *Qt_FlashMediaSetZoom(PyObject *_self, PyObject *_args)
7445 PyObject *_res = NULL;
7446 ComponentResult _rv;
7447 MediaHandler mh;
7448 short factor;
7449 if (!PyArg_ParseTuple(_args, "O&h",
7450 CmpInstObj_Convert, &mh,
7451 &factor))
7452 return NULL;
7453 _rv = FlashMediaSetZoom(mh,
7454 factor);
7455 _res = Py_BuildValue("l",
7456 _rv);
7457 return _res;
7460 static PyObject *Qt_FlashMediaSetZoomRect(PyObject *_self, PyObject *_args)
7462 PyObject *_res = NULL;
7463 ComponentResult _rv;
7464 MediaHandler mh;
7465 long left;
7466 long top;
7467 long right;
7468 long bottom;
7469 if (!PyArg_ParseTuple(_args, "O&llll",
7470 CmpInstObj_Convert, &mh,
7471 &left,
7472 &top,
7473 &right,
7474 &bottom))
7475 return NULL;
7476 _rv = FlashMediaSetZoomRect(mh,
7477 left,
7478 top,
7479 right,
7480 bottom);
7481 _res = Py_BuildValue("l",
7482 _rv);
7483 return _res;
7486 static PyObject *Qt_FlashMediaGetRefConBounds(PyObject *_self, PyObject *_args)
7488 PyObject *_res = NULL;
7489 ComponentResult _rv;
7490 MediaHandler mh;
7491 long refCon;
7492 long left;
7493 long top;
7494 long right;
7495 long bottom;
7496 if (!PyArg_ParseTuple(_args, "O&l",
7497 CmpInstObj_Convert, &mh,
7498 &refCon))
7499 return NULL;
7500 _rv = FlashMediaGetRefConBounds(mh,
7501 refCon,
7502 &left,
7503 &top,
7504 &right,
7505 &bottom);
7506 _res = Py_BuildValue("lllll",
7507 _rv,
7508 left,
7509 top,
7510 right,
7511 bottom);
7512 return _res;
7515 static PyObject *Qt_FlashMediaGetRefConID(PyObject *_self, PyObject *_args)
7517 PyObject *_res = NULL;
7518 ComponentResult _rv;
7519 MediaHandler mh;
7520 long refCon;
7521 long refConID;
7522 if (!PyArg_ParseTuple(_args, "O&l",
7523 CmpInstObj_Convert, &mh,
7524 &refCon))
7525 return NULL;
7526 _rv = FlashMediaGetRefConID(mh,
7527 refCon,
7528 &refConID);
7529 _res = Py_BuildValue("ll",
7530 _rv,
7531 refConID);
7532 return _res;
7535 static PyObject *Qt_FlashMediaIDToRefCon(PyObject *_self, PyObject *_args)
7537 PyObject *_res = NULL;
7538 ComponentResult _rv;
7539 MediaHandler mh;
7540 long refConID;
7541 long refCon;
7542 if (!PyArg_ParseTuple(_args, "O&l",
7543 CmpInstObj_Convert, &mh,
7544 &refConID))
7545 return NULL;
7546 _rv = FlashMediaIDToRefCon(mh,
7547 refConID,
7548 &refCon);
7549 _res = Py_BuildValue("ll",
7550 _rv,
7551 refCon);
7552 return _res;
7555 static PyObject *Qt_FlashMediaGetDisplayedFrameNumber(PyObject *_self, PyObject *_args)
7557 PyObject *_res = NULL;
7558 ComponentResult _rv;
7559 MediaHandler mh;
7560 long flashFrameNumber;
7561 if (!PyArg_ParseTuple(_args, "O&",
7562 CmpInstObj_Convert, &mh))
7563 return NULL;
7564 _rv = FlashMediaGetDisplayedFrameNumber(mh,
7565 &flashFrameNumber);
7566 _res = Py_BuildValue("ll",
7567 _rv,
7568 flashFrameNumber);
7569 return _res;
7572 static PyObject *Qt_FlashMediaFrameNumberToMovieTime(PyObject *_self, PyObject *_args)
7574 PyObject *_res = NULL;
7575 ComponentResult _rv;
7576 MediaHandler mh;
7577 long flashFrameNumber;
7578 TimeValue movieTime;
7579 if (!PyArg_ParseTuple(_args, "O&l",
7580 CmpInstObj_Convert, &mh,
7581 &flashFrameNumber))
7582 return NULL;
7583 _rv = FlashMediaFrameNumberToMovieTime(mh,
7584 flashFrameNumber,
7585 &movieTime);
7586 _res = Py_BuildValue("ll",
7587 _rv,
7588 movieTime);
7589 return _res;
7592 static PyObject *Qt_FlashMediaFrameLabelToMovieTime(PyObject *_self, PyObject *_args)
7594 PyObject *_res = NULL;
7595 ComponentResult _rv;
7596 MediaHandler mh;
7597 Ptr theLabel;
7598 TimeValue movieTime;
7599 if (!PyArg_ParseTuple(_args, "O&s",
7600 CmpInstObj_Convert, &mh,
7601 &theLabel))
7602 return NULL;
7603 _rv = FlashMediaFrameLabelToMovieTime(mh,
7604 theLabel,
7605 &movieTime);
7606 _res = Py_BuildValue("ll",
7607 _rv,
7608 movieTime);
7609 return _res;
7612 #if !TARGET_API_MAC_CARBON
7614 static PyObject *Qt_MovieMediaGetCurrentMovieProperty(PyObject *_self, PyObject *_args)
7616 PyObject *_res = NULL;
7617 ComponentResult _rv;
7618 MediaHandler mh;
7619 OSType whichProperty;
7620 void * value;
7621 if (!PyArg_ParseTuple(_args, "O&O&s",
7622 CmpInstObj_Convert, &mh,
7623 PyMac_GetOSType, &whichProperty,
7624 &value))
7625 return NULL;
7626 _rv = MovieMediaGetCurrentMovieProperty(mh,
7627 whichProperty,
7628 value);
7629 _res = Py_BuildValue("l",
7630 _rv);
7631 return _res;
7633 #endif
7635 #if !TARGET_API_MAC_CARBON
7637 static PyObject *Qt_MovieMediaGetCurrentTrackProperty(PyObject *_self, PyObject *_args)
7639 PyObject *_res = NULL;
7640 ComponentResult _rv;
7641 MediaHandler mh;
7642 long trackID;
7643 OSType whichProperty;
7644 void * value;
7645 if (!PyArg_ParseTuple(_args, "O&lO&s",
7646 CmpInstObj_Convert, &mh,
7647 &trackID,
7648 PyMac_GetOSType, &whichProperty,
7649 &value))
7650 return NULL;
7651 _rv = MovieMediaGetCurrentTrackProperty(mh,
7652 trackID,
7653 whichProperty,
7654 value);
7655 _res = Py_BuildValue("l",
7656 _rv);
7657 return _res;
7659 #endif
7661 #if !TARGET_API_MAC_CARBON
7663 static PyObject *Qt_MovieMediaGetChildMovieDataReference(PyObject *_self, PyObject *_args)
7665 PyObject *_res = NULL;
7666 ComponentResult _rv;
7667 MediaHandler mh;
7668 QTAtomID dataRefID;
7669 short dataRefIndex;
7670 OSType dataRefType;
7671 Handle dataRef;
7672 QTAtomID dataRefIDOut;
7673 short dataRefIndexOut;
7674 if (!PyArg_ParseTuple(_args, "O&lh",
7675 CmpInstObj_Convert, &mh,
7676 &dataRefID,
7677 &dataRefIndex))
7678 return NULL;
7679 _rv = MovieMediaGetChildMovieDataReference(mh,
7680 dataRefID,
7681 dataRefIndex,
7682 &dataRefType,
7683 &dataRef,
7684 &dataRefIDOut,
7685 &dataRefIndexOut);
7686 _res = Py_BuildValue("lO&O&lh",
7687 _rv,
7688 PyMac_BuildOSType, dataRefType,
7689 ResObj_New, dataRef,
7690 dataRefIDOut,
7691 dataRefIndexOut);
7692 return _res;
7694 #endif
7696 #if !TARGET_API_MAC_CARBON
7698 static PyObject *Qt_MovieMediaSetChildMovieDataReference(PyObject *_self, PyObject *_args)
7700 PyObject *_res = NULL;
7701 ComponentResult _rv;
7702 MediaHandler mh;
7703 QTAtomID dataRefID;
7704 OSType dataRefType;
7705 Handle dataRef;
7706 if (!PyArg_ParseTuple(_args, "O&lO&O&",
7707 CmpInstObj_Convert, &mh,
7708 &dataRefID,
7709 PyMac_GetOSType, &dataRefType,
7710 ResObj_Convert, &dataRef))
7711 return NULL;
7712 _rv = MovieMediaSetChildMovieDataReference(mh,
7713 dataRefID,
7714 dataRefType,
7715 dataRef);
7716 _res = Py_BuildValue("l",
7717 _rv);
7718 return _res;
7720 #endif
7722 #if !TARGET_API_MAC_CARBON
7724 static PyObject *Qt_MovieMediaLoadChildMovieFromDataReference(PyObject *_self, PyObject *_args)
7726 PyObject *_res = NULL;
7727 ComponentResult _rv;
7728 MediaHandler mh;
7729 QTAtomID dataRefID;
7730 if (!PyArg_ParseTuple(_args, "O&l",
7731 CmpInstObj_Convert, &mh,
7732 &dataRefID))
7733 return NULL;
7734 _rv = MovieMediaLoadChildMovieFromDataReference(mh,
7735 dataRefID);
7736 _res = Py_BuildValue("l",
7737 _rv);
7738 return _res;
7740 #endif
7742 static PyObject *Qt_Media3DGetCurrentGroup(PyObject *_self, PyObject *_args)
7744 PyObject *_res = NULL;
7745 ComponentResult _rv;
7746 MediaHandler mh;
7747 void * group;
7748 if (!PyArg_ParseTuple(_args, "O&s",
7749 CmpInstObj_Convert, &mh,
7750 &group))
7751 return NULL;
7752 _rv = Media3DGetCurrentGroup(mh,
7753 group);
7754 _res = Py_BuildValue("l",
7755 _rv);
7756 return _res;
7759 static PyObject *Qt_Media3DTranslateNamedObjectTo(PyObject *_self, PyObject *_args)
7761 PyObject *_res = NULL;
7762 ComponentResult _rv;
7763 MediaHandler mh;
7764 char objectName;
7765 Fixed x;
7766 Fixed y;
7767 Fixed z;
7768 if (!PyArg_ParseTuple(_args, "O&O&O&O&",
7769 CmpInstObj_Convert, &mh,
7770 PyMac_GetFixed, &x,
7771 PyMac_GetFixed, &y,
7772 PyMac_GetFixed, &z))
7773 return NULL;
7774 _rv = Media3DTranslateNamedObjectTo(mh,
7775 &objectName,
7779 _res = Py_BuildValue("lc",
7780 _rv,
7781 objectName);
7782 return _res;
7785 static PyObject *Qt_Media3DScaleNamedObjectTo(PyObject *_self, PyObject *_args)
7787 PyObject *_res = NULL;
7788 ComponentResult _rv;
7789 MediaHandler mh;
7790 char objectName;
7791 Fixed xScale;
7792 Fixed yScale;
7793 Fixed zScale;
7794 if (!PyArg_ParseTuple(_args, "O&O&O&O&",
7795 CmpInstObj_Convert, &mh,
7796 PyMac_GetFixed, &xScale,
7797 PyMac_GetFixed, &yScale,
7798 PyMac_GetFixed, &zScale))
7799 return NULL;
7800 _rv = Media3DScaleNamedObjectTo(mh,
7801 &objectName,
7802 xScale,
7803 yScale,
7804 zScale);
7805 _res = Py_BuildValue("lc",
7806 _rv,
7807 objectName);
7808 return _res;
7811 static PyObject *Qt_Media3DRotateNamedObjectTo(PyObject *_self, PyObject *_args)
7813 PyObject *_res = NULL;
7814 ComponentResult _rv;
7815 MediaHandler mh;
7816 char objectName;
7817 Fixed xDegrees;
7818 Fixed yDegrees;
7819 Fixed zDegrees;
7820 if (!PyArg_ParseTuple(_args, "O&O&O&O&",
7821 CmpInstObj_Convert, &mh,
7822 PyMac_GetFixed, &xDegrees,
7823 PyMac_GetFixed, &yDegrees,
7824 PyMac_GetFixed, &zDegrees))
7825 return NULL;
7826 _rv = Media3DRotateNamedObjectTo(mh,
7827 &objectName,
7828 xDegrees,
7829 yDegrees,
7830 zDegrees);
7831 _res = Py_BuildValue("lc",
7832 _rv,
7833 objectName);
7834 return _res;
7837 static PyObject *Qt_Media3DSetCameraData(PyObject *_self, PyObject *_args)
7839 PyObject *_res = NULL;
7840 ComponentResult _rv;
7841 MediaHandler mh;
7842 void * cameraData;
7843 if (!PyArg_ParseTuple(_args, "O&s",
7844 CmpInstObj_Convert, &mh,
7845 &cameraData))
7846 return NULL;
7847 _rv = Media3DSetCameraData(mh,
7848 cameraData);
7849 _res = Py_BuildValue("l",
7850 _rv);
7851 return _res;
7854 static PyObject *Qt_Media3DGetCameraData(PyObject *_self, PyObject *_args)
7856 PyObject *_res = NULL;
7857 ComponentResult _rv;
7858 MediaHandler mh;
7859 void * cameraData;
7860 if (!PyArg_ParseTuple(_args, "O&s",
7861 CmpInstObj_Convert, &mh,
7862 &cameraData))
7863 return NULL;
7864 _rv = Media3DGetCameraData(mh,
7865 cameraData);
7866 _res = Py_BuildValue("l",
7867 _rv);
7868 return _res;
7871 static PyObject *Qt_Media3DSetCameraAngleAspect(PyObject *_self, PyObject *_args)
7873 PyObject *_res = NULL;
7874 ComponentResult _rv;
7875 MediaHandler mh;
7876 QTFloatSingle fov;
7877 QTFloatSingle aspectRatioXToY;
7878 if (!PyArg_ParseTuple(_args, "O&ff",
7879 CmpInstObj_Convert, &mh,
7880 &fov,
7881 &aspectRatioXToY))
7882 return NULL;
7883 _rv = Media3DSetCameraAngleAspect(mh,
7884 fov,
7885 aspectRatioXToY);
7886 _res = Py_BuildValue("l",
7887 _rv);
7888 return _res;
7891 static PyObject *Qt_Media3DGetCameraAngleAspect(PyObject *_self, PyObject *_args)
7893 PyObject *_res = NULL;
7894 ComponentResult _rv;
7895 MediaHandler mh;
7896 QTFloatSingle fov;
7897 QTFloatSingle aspectRatioXToY;
7898 if (!PyArg_ParseTuple(_args, "O&",
7899 CmpInstObj_Convert, &mh))
7900 return NULL;
7901 _rv = Media3DGetCameraAngleAspect(mh,
7902 &fov,
7903 &aspectRatioXToY);
7904 _res = Py_BuildValue("lff",
7905 _rv,
7906 fov,
7907 aspectRatioXToY);
7908 return _res;
7911 static PyObject *Qt_Media3DSetCameraRange(PyObject *_self, PyObject *_args)
7913 PyObject *_res = NULL;
7914 ComponentResult _rv;
7915 MediaHandler mh;
7916 void * tQ3CameraRange;
7917 if (!PyArg_ParseTuple(_args, "O&s",
7918 CmpInstObj_Convert, &mh,
7919 &tQ3CameraRange))
7920 return NULL;
7921 _rv = Media3DSetCameraRange(mh,
7922 tQ3CameraRange);
7923 _res = Py_BuildValue("l",
7924 _rv);
7925 return _res;
7928 static PyObject *Qt_Media3DGetCameraRange(PyObject *_self, PyObject *_args)
7930 PyObject *_res = NULL;
7931 ComponentResult _rv;
7932 MediaHandler mh;
7933 void * tQ3CameraRange;
7934 if (!PyArg_ParseTuple(_args, "O&s",
7935 CmpInstObj_Convert, &mh,
7936 &tQ3CameraRange))
7937 return NULL;
7938 _rv = Media3DGetCameraRange(mh,
7939 tQ3CameraRange);
7940 _res = Py_BuildValue("l",
7941 _rv);
7942 return _res;
7945 #if !TARGET_API_MAC_CARBON
7947 static PyObject *Qt_Media3DGetViewObject(PyObject *_self, PyObject *_args)
7949 PyObject *_res = NULL;
7950 ComponentResult _rv;
7951 MediaHandler mh;
7952 void * tq3viewObject;
7953 if (!PyArg_ParseTuple(_args, "O&s",
7954 CmpInstObj_Convert, &mh,
7955 &tq3viewObject))
7956 return NULL;
7957 _rv = Media3DGetViewObject(mh,
7958 tq3viewObject);
7959 _res = Py_BuildValue("l",
7960 _rv);
7961 return _res;
7963 #endif
7965 static PyObject *Qt_NewTimeBase(PyObject *_self, PyObject *_args)
7967 PyObject *_res = NULL;
7968 TimeBase _rv;
7969 if (!PyArg_ParseTuple(_args, ""))
7970 return NULL;
7971 _rv = NewTimeBase();
7972 _res = Py_BuildValue("O&",
7973 TimeBaseObj_New, _rv);
7974 return _res;
7977 static PyObject *Qt_ConvertTime(PyObject *_self, PyObject *_args)
7979 PyObject *_res = NULL;
7980 TimeRecord inout;
7981 TimeBase newBase;
7982 if (!PyArg_ParseTuple(_args, "O&O&",
7983 QtTimeRecord_Convert, &inout,
7984 TimeBaseObj_Convert, &newBase))
7985 return NULL;
7986 ConvertTime(&inout,
7987 newBase);
7988 _res = Py_BuildValue("O&",
7989 QtTimeRecord_New, &inout);
7990 return _res;
7993 static PyObject *Qt_ConvertTimeScale(PyObject *_self, PyObject *_args)
7995 PyObject *_res = NULL;
7996 TimeRecord inout;
7997 TimeScale newScale;
7998 if (!PyArg_ParseTuple(_args, "O&l",
7999 QtTimeRecord_Convert, &inout,
8000 &newScale))
8001 return NULL;
8002 ConvertTimeScale(&inout,
8003 newScale);
8004 _res = Py_BuildValue("O&",
8005 QtTimeRecord_New, &inout);
8006 return _res;
8009 static PyObject *Qt_AddTime(PyObject *_self, PyObject *_args)
8011 PyObject *_res = NULL;
8012 TimeRecord dst;
8013 TimeRecord src;
8014 if (!PyArg_ParseTuple(_args, "O&O&",
8015 QtTimeRecord_Convert, &dst,
8016 QtTimeRecord_Convert, &src))
8017 return NULL;
8018 AddTime(&dst,
8019 &src);
8020 _res = Py_BuildValue("O&",
8021 QtTimeRecord_New, &dst);
8022 return _res;
8025 static PyObject *Qt_SubtractTime(PyObject *_self, PyObject *_args)
8027 PyObject *_res = NULL;
8028 TimeRecord dst;
8029 TimeRecord src;
8030 if (!PyArg_ParseTuple(_args, "O&O&",
8031 QtTimeRecord_Convert, &dst,
8032 QtTimeRecord_Convert, &src))
8033 return NULL;
8034 SubtractTime(&dst,
8035 &src);
8036 _res = Py_BuildValue("O&",
8037 QtTimeRecord_New, &dst);
8038 return _res;
8041 static PyObject *Qt_MusicMediaGetIndexedTunePlayer(PyObject *_self, PyObject *_args)
8043 PyObject *_res = NULL;
8044 ComponentResult _rv;
8045 ComponentInstance ti;
8046 long sampleDescIndex;
8047 ComponentInstance tp;
8048 if (!PyArg_ParseTuple(_args, "O&l",
8049 CmpInstObj_Convert, &ti,
8050 &sampleDescIndex))
8051 return NULL;
8052 _rv = MusicMediaGetIndexedTunePlayer(ti,
8053 sampleDescIndex,
8054 &tp);
8055 _res = Py_BuildValue("lO&",
8056 _rv,
8057 CmpInstObj_New, tp);
8058 return _res;
8061 static PyObject *Qt_AlignWindow(PyObject *_self, PyObject *_args)
8063 PyObject *_res = NULL;
8064 WindowPtr wp;
8065 Boolean front;
8066 if (!PyArg_ParseTuple(_args, "O&b",
8067 WinObj_Convert, &wp,
8068 &front))
8069 return NULL;
8070 AlignWindow(wp,
8071 front,
8072 (Rect *)0,
8073 (ICMAlignmentProcRecordPtr)0);
8074 Py_INCREF(Py_None);
8075 _res = Py_None;
8076 return _res;
8079 static PyObject *Qt_DragAlignedWindow(PyObject *_self, PyObject *_args)
8081 PyObject *_res = NULL;
8082 WindowPtr wp;
8083 Point startPt;
8084 Rect boundsRect;
8085 if (!PyArg_ParseTuple(_args, "O&O&O&",
8086 WinObj_Convert, &wp,
8087 PyMac_GetPoint, &startPt,
8088 PyMac_GetRect, &boundsRect))
8089 return NULL;
8090 DragAlignedWindow(wp,
8091 startPt,
8092 &boundsRect,
8093 (Rect *)0,
8094 (ICMAlignmentProcRecordPtr)0);
8095 Py_INCREF(Py_None);
8096 _res = Py_None;
8097 return _res;
8100 static PyObject *Qt_MoviesTask(PyObject *_self, PyObject *_args)
8102 PyObject *_res = NULL;
8103 long maxMilliSecToUse;
8104 if (!PyArg_ParseTuple(_args, "l",
8105 &maxMilliSecToUse))
8106 return NULL;
8107 MoviesTask((Movie)0,
8108 maxMilliSecToUse);
8109 Py_INCREF(Py_None);
8110 _res = Py_None;
8111 return _res;
8114 static PyMethodDef Qt_methods[] = {
8116 #if !TARGET_API_MAC_CARBON
8117 {"CheckQuickTimeRegistration", (PyCFunction)Qt_CheckQuickTimeRegistration, 1,
8118 "(void * registrationKey, long flags) -> None"},
8119 #endif
8120 {"EnterMovies", (PyCFunction)Qt_EnterMovies, 1,
8121 "() -> None"},
8122 {"ExitMovies", (PyCFunction)Qt_ExitMovies, 1,
8123 "() -> None"},
8124 {"GetMoviesError", (PyCFunction)Qt_GetMoviesError, 1,
8125 "() -> None"},
8126 {"ClearMoviesStickyError", (PyCFunction)Qt_ClearMoviesStickyError, 1,
8127 "() -> None"},
8128 {"GetMoviesStickyError", (PyCFunction)Qt_GetMoviesStickyError, 1,
8129 "() -> None"},
8130 {"DisposeMatte", (PyCFunction)Qt_DisposeMatte, 1,
8131 "(PixMapHandle theMatte) -> None"},
8132 {"NewMovie", (PyCFunction)Qt_NewMovie, 1,
8133 "(long flags) -> (Movie _rv)"},
8134 {"GetDataHandler", (PyCFunction)Qt_GetDataHandler, 1,
8135 "(Handle dataRef, OSType dataHandlerSubType, long flags) -> (Component _rv)"},
8137 #if !TARGET_API_MAC_CARBON
8138 {"OpenADataHandler", (PyCFunction)Qt_OpenADataHandler, 1,
8139 "(Handle dataRef, OSType dataHandlerSubType, Handle anchorDataRef, OSType anchorDataRefType, TimeBase tb, long flags) -> (ComponentInstance dh)"},
8140 #endif
8141 {"PasteHandleIntoMovie", (PyCFunction)Qt_PasteHandleIntoMovie, 1,
8142 "(Handle h, OSType handleType, Movie theMovie, long flags, ComponentInstance userComp) -> None"},
8143 {"GetMovieImporterForDataRef", (PyCFunction)Qt_GetMovieImporterForDataRef, 1,
8144 "(OSType dataRefType, Handle dataRef, long flags) -> (Component importer)"},
8145 {"TrackTimeToMediaTime", (PyCFunction)Qt_TrackTimeToMediaTime, 1,
8146 "(TimeValue value, Track theTrack) -> (TimeValue _rv)"},
8147 {"NewUserData", (PyCFunction)Qt_NewUserData, 1,
8148 "() -> (UserData theUserData)"},
8149 {"NewUserDataFromHandle", (PyCFunction)Qt_NewUserDataFromHandle, 1,
8150 "(Handle h) -> (UserData theUserData)"},
8151 {"CreateMovieFile", (PyCFunction)Qt_CreateMovieFile, 1,
8152 "(FSSpec fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (short resRefNum, Movie newmovie)"},
8153 {"OpenMovieFile", (PyCFunction)Qt_OpenMovieFile, 1,
8154 "(FSSpec fileSpec, SInt8 permission) -> (short resRefNum)"},
8155 {"CloseMovieFile", (PyCFunction)Qt_CloseMovieFile, 1,
8156 "(short resRefNum) -> None"},
8157 {"DeleteMovieFile", (PyCFunction)Qt_DeleteMovieFile, 1,
8158 "(FSSpec fileSpec) -> None"},
8159 {"NewMovieFromFile", (PyCFunction)Qt_NewMovieFromFile, 1,
8160 "(short resRefNum, short resId, short newMovieFlags) -> (Movie theMovie, short resId, Boolean dataRefWasChanged)"},
8161 {"NewMovieFromHandle", (PyCFunction)Qt_NewMovieFromHandle, 1,
8162 "(Handle h, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
8163 {"NewMovieFromDataFork", (PyCFunction)Qt_NewMovieFromDataFork, 1,
8164 "(short fRefNum, long fileOffset, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
8165 {"NewMovieFromDataFork64", (PyCFunction)Qt_NewMovieFromDataFork64, 1,
8166 "(long fRefNum, wide fileOffset, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
8167 {"NewMovieFromDataRef", (PyCFunction)Qt_NewMovieFromDataRef, 1,
8168 "(short flags, Handle dataRef, OSType dataRefType) -> (Movie m, short id)"},
8169 {"RemoveMovieResource", (PyCFunction)Qt_RemoveMovieResource, 1,
8170 "(short resRefNum, short resId) -> None"},
8171 {"CreateShortcutMovieFile", (PyCFunction)Qt_CreateShortcutMovieFile, 1,
8172 "(FSSpec fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, Handle targetDataRef, OSType targetDataRefType) -> None"},
8173 {"NewMovieFromScrap", (PyCFunction)Qt_NewMovieFromScrap, 1,
8174 "(long newMovieFlags) -> (Movie _rv)"},
8175 {"QTNewAlias", (PyCFunction)Qt_QTNewAlias, 1,
8176 "(FSSpec fss, Boolean minimal) -> (AliasHandle alias)"},
8177 {"EndFullScreen", (PyCFunction)Qt_EndFullScreen, 1,
8178 "(Ptr fullState, long flags) -> None"},
8179 {"AddSoundDescriptionExtension", (PyCFunction)Qt_AddSoundDescriptionExtension, 1,
8180 "(SoundDescriptionHandle desc, Handle extension, OSType idType) -> None"},
8181 {"GetSoundDescriptionExtension", (PyCFunction)Qt_GetSoundDescriptionExtension, 1,
8182 "(SoundDescriptionHandle desc, OSType idType) -> (Handle extension)"},
8183 {"RemoveSoundDescriptionExtension", (PyCFunction)Qt_RemoveSoundDescriptionExtension, 1,
8184 "(SoundDescriptionHandle desc, OSType idType) -> None"},
8185 {"QTIsStandardParameterDialogEvent", (PyCFunction)Qt_QTIsStandardParameterDialogEvent, 1,
8186 "(QTParameterDialog createdDialog) -> (EventRecord pEvent)"},
8187 {"QTDismissStandardParameterDialog", (PyCFunction)Qt_QTDismissStandardParameterDialog, 1,
8188 "(QTParameterDialog createdDialog) -> None"},
8189 {"QTStandardParameterDialogDoAction", (PyCFunction)Qt_QTStandardParameterDialogDoAction, 1,
8190 "(QTParameterDialog createdDialog, long action, void * params) -> None"},
8191 {"QTRegisterAccessKey", (PyCFunction)Qt_QTRegisterAccessKey, 1,
8192 "(Str255 accessKeyType, long flags, Handle accessKey) -> None"},
8193 {"QTUnregisterAccessKey", (PyCFunction)Qt_QTUnregisterAccessKey, 1,
8194 "(Str255 accessKeyType, long flags, Handle accessKey) -> None"},
8195 {"QTTextToNativeText", (PyCFunction)Qt_QTTextToNativeText, 1,
8196 "(Handle theText, long encoding, long flags) -> None"},
8197 {"VideoMediaResetStatistics", (PyCFunction)Qt_VideoMediaResetStatistics, 1,
8198 "(MediaHandler mh) -> (ComponentResult _rv)"},
8199 {"VideoMediaGetStatistics", (PyCFunction)Qt_VideoMediaGetStatistics, 1,
8200 "(MediaHandler mh) -> (ComponentResult _rv)"},
8201 {"VideoMediaGetStallCount", (PyCFunction)Qt_VideoMediaGetStallCount, 1,
8202 "(MediaHandler mh) -> (ComponentResult _rv, unsigned long stalls)"},
8203 {"VideoMediaSetCodecParameter", (PyCFunction)Qt_VideoMediaSetCodecParameter, 1,
8204 "(MediaHandler mh, CodecType cType, OSType parameterID, long parameterChangeSeed, void * dataPtr, long dataSize) -> (ComponentResult _rv)"},
8205 {"VideoMediaGetCodecParameter", (PyCFunction)Qt_VideoMediaGetCodecParameter, 1,
8206 "(MediaHandler mh, CodecType cType, OSType parameterID, Handle outParameterData) -> (ComponentResult _rv)"},
8207 {"TextMediaAddTextSample", (PyCFunction)Qt_TextMediaAddTextSample, 1,
8208 "(MediaHandler mh, Ptr text, unsigned long size, short fontNumber, short fontSize, Style textFace, short textJustification, long displayFlags, TimeValue scrollDelay, short hiliteStart, short hiliteEnd, TimeValue duration) -> (ComponentResult _rv, RGBColor textColor, RGBColor backColor, Rect textBox, RGBColor rgbHiliteColor, TimeValue sampleTime)"},
8209 {"TextMediaAddTESample", (PyCFunction)Qt_TextMediaAddTESample, 1,
8210 "(MediaHandler mh, TEHandle hTE, short textJustification, long displayFlags, TimeValue scrollDelay, short hiliteStart, short hiliteEnd, TimeValue duration) -> (ComponentResult _rv, RGBColor backColor, Rect textBox, RGBColor rgbHiliteColor, TimeValue sampleTime)"},
8211 {"TextMediaAddHiliteSample", (PyCFunction)Qt_TextMediaAddHiliteSample, 1,
8212 "(MediaHandler mh, short hiliteStart, short hiliteEnd, TimeValue duration) -> (ComponentResult _rv, RGBColor rgbHiliteColor, TimeValue sampleTime)"},
8213 {"TextMediaDrawRaw", (PyCFunction)Qt_TextMediaDrawRaw, 1,
8214 "(MediaHandler mh, GWorldPtr gw, GDHandle gd, void * data, long dataSize, TextDescriptionHandle tdh) -> (ComponentResult _rv)"},
8215 {"TextMediaSetTextProperty", (PyCFunction)Qt_TextMediaSetTextProperty, 1,
8216 "(MediaHandler mh, TimeValue atMediaTime, long propertyType, void * data, long dataSize) -> (ComponentResult _rv)"},
8217 {"TextMediaRawSetup", (PyCFunction)Qt_TextMediaRawSetup, 1,
8218 "(MediaHandler mh, GWorldPtr gw, GDHandle gd, void * data, long dataSize, TextDescriptionHandle tdh, TimeValue sampleDuration) -> (ComponentResult _rv)"},
8219 {"TextMediaRawIdle", (PyCFunction)Qt_TextMediaRawIdle, 1,
8220 "(MediaHandler mh, GWorldPtr gw, GDHandle gd, TimeValue sampleTime, long flagsIn) -> (ComponentResult _rv, long flagsOut)"},
8221 {"TextMediaFindNextText", (PyCFunction)Qt_TextMediaFindNextText, 1,
8222 "(MediaHandler mh, Ptr text, long size, short findFlags, TimeValue startTime) -> (ComponentResult _rv, TimeValue foundTime, TimeValue foundDuration, long offset)"},
8223 {"TextMediaHiliteTextSample", (PyCFunction)Qt_TextMediaHiliteTextSample, 1,
8224 "(MediaHandler mh, TimeValue sampleTime, short hiliteStart, short hiliteEnd) -> (ComponentResult _rv, RGBColor rgbHiliteColor)"},
8225 {"TextMediaSetTextSampleData", (PyCFunction)Qt_TextMediaSetTextSampleData, 1,
8226 "(MediaHandler mh, void * data, OSType dataType) -> (ComponentResult _rv)"},
8227 {"SpriteMediaSetProperty", (PyCFunction)Qt_SpriteMediaSetProperty, 1,
8228 "(MediaHandler mh, short spriteIndex, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
8229 {"SpriteMediaGetProperty", (PyCFunction)Qt_SpriteMediaGetProperty, 1,
8230 "(MediaHandler mh, short spriteIndex, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
8231 {"SpriteMediaHitTestSprites", (PyCFunction)Qt_SpriteMediaHitTestSprites, 1,
8232 "(MediaHandler mh, long flags, Point loc) -> (ComponentResult _rv, short spriteHitIndex)"},
8233 {"SpriteMediaCountSprites", (PyCFunction)Qt_SpriteMediaCountSprites, 1,
8234 "(MediaHandler mh) -> (ComponentResult _rv, short numSprites)"},
8235 {"SpriteMediaCountImages", (PyCFunction)Qt_SpriteMediaCountImages, 1,
8236 "(MediaHandler mh) -> (ComponentResult _rv, short numImages)"},
8237 {"SpriteMediaGetIndImageDescription", (PyCFunction)Qt_SpriteMediaGetIndImageDescription, 1,
8238 "(MediaHandler mh, short imageIndex, ImageDescriptionHandle imageDescription) -> (ComponentResult _rv)"},
8239 {"SpriteMediaGetDisplayedSampleNumber", (PyCFunction)Qt_SpriteMediaGetDisplayedSampleNumber, 1,
8240 "(MediaHandler mh) -> (ComponentResult _rv, long sampleNum)"},
8241 {"SpriteMediaGetSpriteName", (PyCFunction)Qt_SpriteMediaGetSpriteName, 1,
8242 "(MediaHandler mh, QTAtomID spriteID, Str255 spriteName) -> (ComponentResult _rv)"},
8243 {"SpriteMediaGetImageName", (PyCFunction)Qt_SpriteMediaGetImageName, 1,
8244 "(MediaHandler mh, short imageIndex, Str255 imageName) -> (ComponentResult _rv)"},
8245 {"SpriteMediaSetSpriteProperty", (PyCFunction)Qt_SpriteMediaSetSpriteProperty, 1,
8246 "(MediaHandler mh, QTAtomID spriteID, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
8247 {"SpriteMediaGetSpriteProperty", (PyCFunction)Qt_SpriteMediaGetSpriteProperty, 1,
8248 "(MediaHandler mh, QTAtomID spriteID, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
8249 {"SpriteMediaHitTestAllSprites", (PyCFunction)Qt_SpriteMediaHitTestAllSprites, 1,
8250 "(MediaHandler mh, long flags, Point loc) -> (ComponentResult _rv, QTAtomID spriteHitID)"},
8251 {"SpriteMediaHitTestOneSprite", (PyCFunction)Qt_SpriteMediaHitTestOneSprite, 1,
8252 "(MediaHandler mh, QTAtomID spriteID, long flags, Point loc) -> (ComponentResult _rv, Boolean wasHit)"},
8253 {"SpriteMediaSpriteIndexToID", (PyCFunction)Qt_SpriteMediaSpriteIndexToID, 1,
8254 "(MediaHandler mh, short spriteIndex) -> (ComponentResult _rv, QTAtomID spriteID)"},
8255 {"SpriteMediaSpriteIDToIndex", (PyCFunction)Qt_SpriteMediaSpriteIDToIndex, 1,
8256 "(MediaHandler mh, QTAtomID spriteID) -> (ComponentResult _rv, short spriteIndex)"},
8257 {"SpriteMediaSetActionVariable", (PyCFunction)Qt_SpriteMediaSetActionVariable, 1,
8258 "(MediaHandler mh, QTAtomID variableID, float value) -> (ComponentResult _rv)"},
8259 {"SpriteMediaGetActionVariable", (PyCFunction)Qt_SpriteMediaGetActionVariable, 1,
8260 "(MediaHandler mh, QTAtomID variableID) -> (ComponentResult _rv, float value)"},
8262 #if !TARGET_API_MAC_CARBON
8263 {"SpriteMediaGetIndImageProperty", (PyCFunction)Qt_SpriteMediaGetIndImageProperty, 1,
8264 "(MediaHandler mh, short imageIndex, long imagePropertyType, void * imagePropertyValue) -> (ComponentResult _rv)"},
8265 #endif
8266 {"SpriteMediaDisposeSprite", (PyCFunction)Qt_SpriteMediaDisposeSprite, 1,
8267 "(MediaHandler mh, QTAtomID spriteID) -> (ComponentResult _rv)"},
8268 {"SpriteMediaSetActionVariableToString", (PyCFunction)Qt_SpriteMediaSetActionVariableToString, 1,
8269 "(MediaHandler mh, QTAtomID variableID, Ptr theCString) -> (ComponentResult _rv)"},
8270 {"SpriteMediaGetActionVariableAsString", (PyCFunction)Qt_SpriteMediaGetActionVariableAsString, 1,
8271 "(MediaHandler mh, QTAtomID variableID) -> (ComponentResult _rv, Handle theCString)"},
8272 {"FlashMediaSetPan", (PyCFunction)Qt_FlashMediaSetPan, 1,
8273 "(MediaHandler mh, short xPercent, short yPercent) -> (ComponentResult _rv)"},
8274 {"FlashMediaSetZoom", (PyCFunction)Qt_FlashMediaSetZoom, 1,
8275 "(MediaHandler mh, short factor) -> (ComponentResult _rv)"},
8276 {"FlashMediaSetZoomRect", (PyCFunction)Qt_FlashMediaSetZoomRect, 1,
8277 "(MediaHandler mh, long left, long top, long right, long bottom) -> (ComponentResult _rv)"},
8278 {"FlashMediaGetRefConBounds", (PyCFunction)Qt_FlashMediaGetRefConBounds, 1,
8279 "(MediaHandler mh, long refCon) -> (ComponentResult _rv, long left, long top, long right, long bottom)"},
8280 {"FlashMediaGetRefConID", (PyCFunction)Qt_FlashMediaGetRefConID, 1,
8281 "(MediaHandler mh, long refCon) -> (ComponentResult _rv, long refConID)"},
8282 {"FlashMediaIDToRefCon", (PyCFunction)Qt_FlashMediaIDToRefCon, 1,
8283 "(MediaHandler mh, long refConID) -> (ComponentResult _rv, long refCon)"},
8284 {"FlashMediaGetDisplayedFrameNumber", (PyCFunction)Qt_FlashMediaGetDisplayedFrameNumber, 1,
8285 "(MediaHandler mh) -> (ComponentResult _rv, long flashFrameNumber)"},
8286 {"FlashMediaFrameNumberToMovieTime", (PyCFunction)Qt_FlashMediaFrameNumberToMovieTime, 1,
8287 "(MediaHandler mh, long flashFrameNumber) -> (ComponentResult _rv, TimeValue movieTime)"},
8288 {"FlashMediaFrameLabelToMovieTime", (PyCFunction)Qt_FlashMediaFrameLabelToMovieTime, 1,
8289 "(MediaHandler mh, Ptr theLabel) -> (ComponentResult _rv, TimeValue movieTime)"},
8291 #if !TARGET_API_MAC_CARBON
8292 {"MovieMediaGetCurrentMovieProperty", (PyCFunction)Qt_MovieMediaGetCurrentMovieProperty, 1,
8293 "(MediaHandler mh, OSType whichProperty, void * value) -> (ComponentResult _rv)"},
8294 #endif
8296 #if !TARGET_API_MAC_CARBON
8297 {"MovieMediaGetCurrentTrackProperty", (PyCFunction)Qt_MovieMediaGetCurrentTrackProperty, 1,
8298 "(MediaHandler mh, long trackID, OSType whichProperty, void * value) -> (ComponentResult _rv)"},
8299 #endif
8301 #if !TARGET_API_MAC_CARBON
8302 {"MovieMediaGetChildMovieDataReference", (PyCFunction)Qt_MovieMediaGetChildMovieDataReference, 1,
8303 "(MediaHandler mh, QTAtomID dataRefID, short dataRefIndex) -> (ComponentResult _rv, OSType dataRefType, Handle dataRef, QTAtomID dataRefIDOut, short dataRefIndexOut)"},
8304 #endif
8306 #if !TARGET_API_MAC_CARBON
8307 {"MovieMediaSetChildMovieDataReference", (PyCFunction)Qt_MovieMediaSetChildMovieDataReference, 1,
8308 "(MediaHandler mh, QTAtomID dataRefID, OSType dataRefType, Handle dataRef) -> (ComponentResult _rv)"},
8309 #endif
8311 #if !TARGET_API_MAC_CARBON
8312 {"MovieMediaLoadChildMovieFromDataReference", (PyCFunction)Qt_MovieMediaLoadChildMovieFromDataReference, 1,
8313 "(MediaHandler mh, QTAtomID dataRefID) -> (ComponentResult _rv)"},
8314 #endif
8315 {"Media3DGetCurrentGroup", (PyCFunction)Qt_Media3DGetCurrentGroup, 1,
8316 "(MediaHandler mh, void * group) -> (ComponentResult _rv)"},
8317 {"Media3DTranslateNamedObjectTo", (PyCFunction)Qt_Media3DTranslateNamedObjectTo, 1,
8318 "(MediaHandler mh, Fixed x, Fixed y, Fixed z) -> (ComponentResult _rv, char objectName)"},
8319 {"Media3DScaleNamedObjectTo", (PyCFunction)Qt_Media3DScaleNamedObjectTo, 1,
8320 "(MediaHandler mh, Fixed xScale, Fixed yScale, Fixed zScale) -> (ComponentResult _rv, char objectName)"},
8321 {"Media3DRotateNamedObjectTo", (PyCFunction)Qt_Media3DRotateNamedObjectTo, 1,
8322 "(MediaHandler mh, Fixed xDegrees, Fixed yDegrees, Fixed zDegrees) -> (ComponentResult _rv, char objectName)"},
8323 {"Media3DSetCameraData", (PyCFunction)Qt_Media3DSetCameraData, 1,
8324 "(MediaHandler mh, void * cameraData) -> (ComponentResult _rv)"},
8325 {"Media3DGetCameraData", (PyCFunction)Qt_Media3DGetCameraData, 1,
8326 "(MediaHandler mh, void * cameraData) -> (ComponentResult _rv)"},
8327 {"Media3DSetCameraAngleAspect", (PyCFunction)Qt_Media3DSetCameraAngleAspect, 1,
8328 "(MediaHandler mh, QTFloatSingle fov, QTFloatSingle aspectRatioXToY) -> (ComponentResult _rv)"},
8329 {"Media3DGetCameraAngleAspect", (PyCFunction)Qt_Media3DGetCameraAngleAspect, 1,
8330 "(MediaHandler mh) -> (ComponentResult _rv, QTFloatSingle fov, QTFloatSingle aspectRatioXToY)"},
8331 {"Media3DSetCameraRange", (PyCFunction)Qt_Media3DSetCameraRange, 1,
8332 "(MediaHandler mh, void * tQ3CameraRange) -> (ComponentResult _rv)"},
8333 {"Media3DGetCameraRange", (PyCFunction)Qt_Media3DGetCameraRange, 1,
8334 "(MediaHandler mh, void * tQ3CameraRange) -> (ComponentResult _rv)"},
8336 #if !TARGET_API_MAC_CARBON
8337 {"Media3DGetViewObject", (PyCFunction)Qt_Media3DGetViewObject, 1,
8338 "(MediaHandler mh, void * tq3viewObject) -> (ComponentResult _rv)"},
8339 #endif
8340 {"NewTimeBase", (PyCFunction)Qt_NewTimeBase, 1,
8341 "() -> (TimeBase _rv)"},
8342 {"ConvertTime", (PyCFunction)Qt_ConvertTime, 1,
8343 "(TimeRecord inout, TimeBase newBase) -> (TimeRecord inout)"},
8344 {"ConvertTimeScale", (PyCFunction)Qt_ConvertTimeScale, 1,
8345 "(TimeRecord inout, TimeScale newScale) -> (TimeRecord inout)"},
8346 {"AddTime", (PyCFunction)Qt_AddTime, 1,
8347 "(TimeRecord dst, TimeRecord src) -> (TimeRecord dst)"},
8348 {"SubtractTime", (PyCFunction)Qt_SubtractTime, 1,
8349 "(TimeRecord dst, TimeRecord src) -> (TimeRecord dst)"},
8350 {"MusicMediaGetIndexedTunePlayer", (PyCFunction)Qt_MusicMediaGetIndexedTunePlayer, 1,
8351 "(ComponentInstance ti, long sampleDescIndex) -> (ComponentResult _rv, ComponentInstance tp)"},
8352 {"AlignWindow", (PyCFunction)Qt_AlignWindow, 1,
8353 "(WindowPtr wp, Boolean front) -> None"},
8354 {"DragAlignedWindow", (PyCFunction)Qt_DragAlignedWindow, 1,
8355 "(WindowPtr wp, Point startPt, Rect boundsRect) -> None"},
8356 {"MoviesTask", (PyCFunction)Qt_MoviesTask, 1,
8357 "(long maxMilliSecToUse) -> None"},
8358 {NULL, NULL, 0}
8364 void initQt(void)
8366 PyObject *m;
8367 PyObject *d;
8371 PyMac_INIT_TOOLBOX_OBJECT_NEW(Track, TrackObj_New);
8372 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Track, TrackObj_Convert);
8373 PyMac_INIT_TOOLBOX_OBJECT_NEW(Movie, MovieObj_New);
8374 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Movie, MovieObj_Convert);
8375 PyMac_INIT_TOOLBOX_OBJECT_NEW(MovieController, MovieCtlObj_New);
8376 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MovieController, MovieCtlObj_Convert);
8377 PyMac_INIT_TOOLBOX_OBJECT_NEW(TimeBase, TimeBaseObj_New);
8378 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(TimeBase, TimeBaseObj_Convert);
8379 PyMac_INIT_TOOLBOX_OBJECT_NEW(UserData, UserDataObj_New);
8380 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(UserData, UserDataObj_Convert);
8381 PyMac_INIT_TOOLBOX_OBJECT_NEW(Media, MediaObj_New);
8382 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Media, MediaObj_Convert);
8385 m = Py_InitModule("Qt", Qt_methods);
8386 d = PyModule_GetDict(m);
8387 Qt_Error = PyMac_GetOSErrException();
8388 if (Qt_Error == NULL ||
8389 PyDict_SetItemString(d, "Error", Qt_Error) != 0)
8390 return;
8391 MovieController_Type.ob_type = &PyType_Type;
8392 Py_INCREF(&MovieController_Type);
8393 if (PyDict_SetItemString(d, "MovieControllerType", (PyObject *)&MovieController_Type) != 0)
8394 Py_FatalError("can't initialize MovieControllerType");
8395 TimeBase_Type.ob_type = &PyType_Type;
8396 Py_INCREF(&TimeBase_Type);
8397 if (PyDict_SetItemString(d, "TimeBaseType", (PyObject *)&TimeBase_Type) != 0)
8398 Py_FatalError("can't initialize TimeBaseType");
8399 UserData_Type.ob_type = &PyType_Type;
8400 Py_INCREF(&UserData_Type);
8401 if (PyDict_SetItemString(d, "UserDataType", (PyObject *)&UserData_Type) != 0)
8402 Py_FatalError("can't initialize UserDataType");
8403 Media_Type.ob_type = &PyType_Type;
8404 Py_INCREF(&Media_Type);
8405 if (PyDict_SetItemString(d, "MediaType", (PyObject *)&Media_Type) != 0)
8406 Py_FatalError("can't initialize MediaType");
8407 Track_Type.ob_type = &PyType_Type;
8408 Py_INCREF(&Track_Type);
8409 if (PyDict_SetItemString(d, "TrackType", (PyObject *)&Track_Type) != 0)
8410 Py_FatalError("can't initialize TrackType");
8411 Movie_Type.ob_type = &PyType_Type;
8412 Py_INCREF(&Movie_Type);
8413 if (PyDict_SetItemString(d, "MovieType", (PyObject *)&Movie_Type) != 0)
8414 Py_FatalError("can't initialize MovieType");
8417 /* ========================= End module Qt ========================== */