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