blob: 36c3efa88c36ad387fc4bd564455654d3947cb13 [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;
Jack Jansen1b7a70f2000-03-03 17:06:13 +00001385 if (!PyArg_ParseTuple(_args, "O&",
1386 QtTimeRecord_Convert, &zero))
Jack Jansenb2006391998-04-23 13:22:44 +00001387 return NULL;
1388 SetTimeBaseZero(_self->ob_itself,
1389 &zero);
Jack Jansen1b7a70f2000-03-03 17:06:13 +00001390 Py_INCREF(Py_None);
1391 _res = Py_None;
Jack Jansenb2006391998-04-23 13:22:44 +00001392 return _res;
1393}
1394
Jack Jansen453ced51995-11-30 17:42:08 +00001395static PyObject *TimeBaseObj_GetTimeBaseEffectiveRate(_self, _args)
1396 TimeBaseObject *_self;
1397 PyObject *_args;
1398{
1399 PyObject *_res = NULL;
1400 Fixed _rv;
1401 if (!PyArg_ParseTuple(_args, ""))
1402 return NULL;
1403 _rv = GetTimeBaseEffectiveRate(_self->ob_itself);
1404 _res = Py_BuildValue("O&",
1405 PyMac_BuildFixed, _rv);
1406 return _res;
1407}
1408
1409static PyMethodDef TimeBaseObj_methods[] = {
Jack Jansenb2006391998-04-23 13:22:44 +00001410 {"DisposeTimeBase", (PyCFunction)TimeBaseObj_DisposeTimeBase, 1,
1411 "() -> None"},
1412 {"GetTimeBaseTime", (PyCFunction)TimeBaseObj_GetTimeBaseTime, 1,
1413 "(TimeScale s) -> (TimeValue _rv, TimeRecord tr)"},
1414 {"SetTimeBaseTime", (PyCFunction)TimeBaseObj_SetTimeBaseTime, 1,
1415 "(TimeRecord tr) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00001416 {"SetTimeBaseValue", (PyCFunction)TimeBaseObj_SetTimeBaseValue, 1,
1417 "(TimeValue t, TimeScale s) -> None"},
1418 {"GetTimeBaseRate", (PyCFunction)TimeBaseObj_GetTimeBaseRate, 1,
1419 "() -> (Fixed _rv)"},
1420 {"SetTimeBaseRate", (PyCFunction)TimeBaseObj_SetTimeBaseRate, 1,
1421 "(Fixed r) -> None"},
Jack Jansenb2006391998-04-23 13:22:44 +00001422 {"GetTimeBaseStartTime", (PyCFunction)TimeBaseObj_GetTimeBaseStartTime, 1,
1423 "(TimeScale s) -> (TimeValue _rv, TimeRecord tr)"},
1424 {"SetTimeBaseStartTime", (PyCFunction)TimeBaseObj_SetTimeBaseStartTime, 1,
1425 "(TimeRecord tr) -> None"},
1426 {"GetTimeBaseStopTime", (PyCFunction)TimeBaseObj_GetTimeBaseStopTime, 1,
1427 "(TimeScale s) -> (TimeValue _rv, TimeRecord tr)"},
1428 {"SetTimeBaseStopTime", (PyCFunction)TimeBaseObj_SetTimeBaseStopTime, 1,
1429 "(TimeRecord tr) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00001430 {"GetTimeBaseFlags", (PyCFunction)TimeBaseObj_GetTimeBaseFlags, 1,
1431 "() -> (long _rv)"},
1432 {"SetTimeBaseFlags", (PyCFunction)TimeBaseObj_SetTimeBaseFlags, 1,
1433 "(long timeBaseFlags) -> None"},
Jack Jansenb2006391998-04-23 13:22:44 +00001434 {"SetTimeBaseMasterTimeBase", (PyCFunction)TimeBaseObj_SetTimeBaseMasterTimeBase, 1,
1435 "(TimeBase master, TimeRecord slaveZero) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00001436 {"GetTimeBaseMasterTimeBase", (PyCFunction)TimeBaseObj_GetTimeBaseMasterTimeBase, 1,
1437 "() -> (TimeBase _rv)"},
Jack Jansenb2006391998-04-23 13:22:44 +00001438 {"SetTimeBaseMasterClock", (PyCFunction)TimeBaseObj_SetTimeBaseMasterClock, 1,
1439 "(Component clockMeister, TimeRecord slaveZero) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00001440 {"GetTimeBaseMasterClock", (PyCFunction)TimeBaseObj_GetTimeBaseMasterClock, 1,
1441 "() -> (ComponentInstance _rv)"},
Jack Jansenb2006391998-04-23 13:22:44 +00001442 {"GetTimeBaseStatus", (PyCFunction)TimeBaseObj_GetTimeBaseStatus, 1,
1443 "() -> (long _rv, TimeRecord unpinnedTime)"},
1444 {"SetTimeBaseZero", (PyCFunction)TimeBaseObj_SetTimeBaseZero, 1,
Jack Jansen1b7a70f2000-03-03 17:06:13 +00001445 "(TimeRecord zero) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00001446 {"GetTimeBaseEffectiveRate", (PyCFunction)TimeBaseObj_GetTimeBaseEffectiveRate, 1,
1447 "() -> (Fixed _rv)"},
1448 {NULL, NULL, 0}
1449};
1450
1451PyMethodChain TimeBaseObj_chain = { TimeBaseObj_methods, NULL };
1452
1453static PyObject *TimeBaseObj_getattr(self, name)
1454 TimeBaseObject *self;
1455 char *name;
1456{
1457 return Py_FindMethodInChain(&TimeBaseObj_chain, (PyObject *)self, name);
1458}
1459
1460#define TimeBaseObj_setattr NULL
1461
Jack Jansena05ac601999-12-12 21:41:51 +00001462#define TimeBaseObj_compare NULL
1463
1464#define TimeBaseObj_repr NULL
1465
1466#define TimeBaseObj_hash NULL
1467
Jack Jansen453ced51995-11-30 17:42:08 +00001468PyTypeObject TimeBase_Type = {
1469 PyObject_HEAD_INIT(&PyType_Type)
1470 0, /*ob_size*/
1471 "TimeBase", /*tp_name*/
1472 sizeof(TimeBaseObject), /*tp_basicsize*/
1473 0, /*tp_itemsize*/
1474 /* methods */
1475 (destructor) TimeBaseObj_dealloc, /*tp_dealloc*/
1476 0, /*tp_print*/
1477 (getattrfunc) TimeBaseObj_getattr, /*tp_getattr*/
1478 (setattrfunc) TimeBaseObj_setattr, /*tp_setattr*/
Jack Jansena05ac601999-12-12 21:41:51 +00001479 (cmpfunc) TimeBaseObj_compare, /*tp_compare*/
1480 (reprfunc) TimeBaseObj_repr, /*tp_repr*/
1481 (PyNumberMethods *)0, /* tp_as_number */
1482 (PySequenceMethods *)0, /* tp_as_sequence */
1483 (PyMappingMethods *)0, /* tp_as_mapping */
1484 (hashfunc) TimeBaseObj_hash, /*tp_hash*/
Jack Jansen453ced51995-11-30 17:42:08 +00001485};
1486
1487/* -------------------- End object type TimeBase -------------------- */
1488
1489
1490/* ---------------------- Object type UserData ---------------------- */
1491
1492PyTypeObject UserData_Type;
1493
1494#define UserDataObj_Check(x) ((x)->ob_type == &UserData_Type)
1495
1496typedef struct UserDataObject {
1497 PyObject_HEAD
1498 UserData ob_itself;
1499} UserDataObject;
1500
1501PyObject *UserDataObj_New(itself)
1502 UserData itself;
1503{
1504 UserDataObject *it;
1505 if (itself == NULL) {
1506 PyErr_SetString(Qt_Error,"Cannot create null UserData");
1507 return NULL;
1508 }
1509 it = PyObject_NEW(UserDataObject, &UserData_Type);
1510 if (it == NULL) return NULL;
1511 it->ob_itself = itself;
1512 return (PyObject *)it;
1513}
1514UserDataObj_Convert(v, p_itself)
1515 PyObject *v;
1516 UserData *p_itself;
1517{
1518 if (!UserDataObj_Check(v))
1519 {
1520 PyErr_SetString(PyExc_TypeError, "UserData required");
1521 return 0;
1522 }
1523 *p_itself = ((UserDataObject *)v)->ob_itself;
1524 return 1;
1525}
1526
1527static void UserDataObj_dealloc(self)
1528 UserDataObject *self;
1529{
1530 DisposeUserData(self->ob_itself);
1531 PyMem_DEL(self);
1532}
1533
1534static PyObject *UserDataObj_GetUserData(_self, _args)
1535 UserDataObject *_self;
1536 PyObject *_args;
1537{
1538 PyObject *_res = NULL;
1539 OSErr _err;
1540 Handle data;
1541 OSType udType;
1542 long index;
1543 if (!PyArg_ParseTuple(_args, "O&O&l",
1544 ResObj_Convert, &data,
1545 PyMac_GetOSType, &udType,
1546 &index))
1547 return NULL;
1548 _err = GetUserData(_self->ob_itself,
1549 data,
1550 udType,
1551 index);
1552 if (_err != noErr) return PyMac_Error(_err);
1553 Py_INCREF(Py_None);
1554 _res = Py_None;
1555 return _res;
1556}
1557
1558static PyObject *UserDataObj_AddUserData(_self, _args)
1559 UserDataObject *_self;
1560 PyObject *_args;
1561{
1562 PyObject *_res = NULL;
1563 OSErr _err;
1564 Handle data;
1565 OSType udType;
1566 if (!PyArg_ParseTuple(_args, "O&O&",
1567 ResObj_Convert, &data,
1568 PyMac_GetOSType, &udType))
1569 return NULL;
1570 _err = AddUserData(_self->ob_itself,
1571 data,
1572 udType);
1573 if (_err != noErr) return PyMac_Error(_err);
1574 Py_INCREF(Py_None);
1575 _res = Py_None;
1576 return _res;
1577}
1578
1579static PyObject *UserDataObj_RemoveUserData(_self, _args)
1580 UserDataObject *_self;
1581 PyObject *_args;
1582{
1583 PyObject *_res = NULL;
1584 OSErr _err;
1585 OSType udType;
1586 long index;
1587 if (!PyArg_ParseTuple(_args, "O&l",
1588 PyMac_GetOSType, &udType,
1589 &index))
1590 return NULL;
1591 _err = RemoveUserData(_self->ob_itself,
1592 udType,
1593 index);
1594 if (_err != noErr) return PyMac_Error(_err);
1595 Py_INCREF(Py_None);
1596 _res = Py_None;
1597 return _res;
1598}
1599
1600static PyObject *UserDataObj_CountUserDataType(_self, _args)
1601 UserDataObject *_self;
1602 PyObject *_args;
1603{
1604 PyObject *_res = NULL;
1605 short _rv;
1606 OSType udType;
1607 if (!PyArg_ParseTuple(_args, "O&",
1608 PyMac_GetOSType, &udType))
1609 return NULL;
1610 _rv = CountUserDataType(_self->ob_itself,
1611 udType);
1612 _res = Py_BuildValue("h",
1613 _rv);
1614 return _res;
1615}
1616
1617static PyObject *UserDataObj_GetNextUserDataType(_self, _args)
1618 UserDataObject *_self;
1619 PyObject *_args;
1620{
1621 PyObject *_res = NULL;
1622 long _rv;
1623 OSType udType;
1624 if (!PyArg_ParseTuple(_args, "O&",
1625 PyMac_GetOSType, &udType))
1626 return NULL;
1627 _rv = GetNextUserDataType(_self->ob_itself,
1628 udType);
1629 _res = Py_BuildValue("l",
1630 _rv);
1631 return _res;
1632}
1633
1634static PyObject *UserDataObj_AddUserDataText(_self, _args)
1635 UserDataObject *_self;
1636 PyObject *_args;
1637{
1638 PyObject *_res = NULL;
1639 OSErr _err;
1640 Handle data;
1641 OSType udType;
1642 long index;
1643 short itlRegionTag;
1644 if (!PyArg_ParseTuple(_args, "O&O&lh",
1645 ResObj_Convert, &data,
1646 PyMac_GetOSType, &udType,
1647 &index,
1648 &itlRegionTag))
1649 return NULL;
1650 _err = AddUserDataText(_self->ob_itself,
1651 data,
1652 udType,
1653 index,
1654 itlRegionTag);
1655 if (_err != noErr) return PyMac_Error(_err);
1656 Py_INCREF(Py_None);
1657 _res = Py_None;
1658 return _res;
1659}
1660
1661static PyObject *UserDataObj_GetUserDataText(_self, _args)
1662 UserDataObject *_self;
1663 PyObject *_args;
1664{
1665 PyObject *_res = NULL;
1666 OSErr _err;
1667 Handle data;
1668 OSType udType;
1669 long index;
1670 short itlRegionTag;
1671 if (!PyArg_ParseTuple(_args, "O&O&lh",
1672 ResObj_Convert, &data,
1673 PyMac_GetOSType, &udType,
1674 &index,
1675 &itlRegionTag))
1676 return NULL;
1677 _err = GetUserDataText(_self->ob_itself,
1678 data,
1679 udType,
1680 index,
1681 itlRegionTag);
1682 if (_err != noErr) return PyMac_Error(_err);
1683 Py_INCREF(Py_None);
1684 _res = Py_None;
1685 return _res;
1686}
1687
1688static PyObject *UserDataObj_RemoveUserDataText(_self, _args)
1689 UserDataObject *_self;
1690 PyObject *_args;
1691{
1692 PyObject *_res = NULL;
1693 OSErr _err;
1694 OSType udType;
1695 long index;
1696 short itlRegionTag;
1697 if (!PyArg_ParseTuple(_args, "O&lh",
1698 PyMac_GetOSType, &udType,
1699 &index,
1700 &itlRegionTag))
1701 return NULL;
1702 _err = RemoveUserDataText(_self->ob_itself,
1703 udType,
1704 index,
1705 itlRegionTag);
1706 if (_err != noErr) return PyMac_Error(_err);
1707 Py_INCREF(Py_None);
1708 _res = Py_None;
1709 return _res;
1710}
1711
1712static PyObject *UserDataObj_PutUserDataIntoHandle(_self, _args)
1713 UserDataObject *_self;
1714 PyObject *_args;
1715{
1716 PyObject *_res = NULL;
1717 OSErr _err;
1718 Handle h;
1719 if (!PyArg_ParseTuple(_args, "O&",
1720 ResObj_Convert, &h))
1721 return NULL;
1722 _err = PutUserDataIntoHandle(_self->ob_itself,
1723 h);
1724 if (_err != noErr) return PyMac_Error(_err);
1725 Py_INCREF(Py_None);
1726 _res = Py_None;
1727 return _res;
1728}
1729
1730static PyMethodDef UserDataObj_methods[] = {
1731 {"GetUserData", (PyCFunction)UserDataObj_GetUserData, 1,
1732 "(Handle data, OSType udType, long index) -> None"},
1733 {"AddUserData", (PyCFunction)UserDataObj_AddUserData, 1,
1734 "(Handle data, OSType udType) -> None"},
1735 {"RemoveUserData", (PyCFunction)UserDataObj_RemoveUserData, 1,
1736 "(OSType udType, long index) -> None"},
1737 {"CountUserDataType", (PyCFunction)UserDataObj_CountUserDataType, 1,
1738 "(OSType udType) -> (short _rv)"},
1739 {"GetNextUserDataType", (PyCFunction)UserDataObj_GetNextUserDataType, 1,
1740 "(OSType udType) -> (long _rv)"},
1741 {"AddUserDataText", (PyCFunction)UserDataObj_AddUserDataText, 1,
1742 "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
1743 {"GetUserDataText", (PyCFunction)UserDataObj_GetUserDataText, 1,
1744 "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
1745 {"RemoveUserDataText", (PyCFunction)UserDataObj_RemoveUserDataText, 1,
1746 "(OSType udType, long index, short itlRegionTag) -> None"},
1747 {"PutUserDataIntoHandle", (PyCFunction)UserDataObj_PutUserDataIntoHandle, 1,
1748 "(Handle h) -> None"},
1749 {NULL, NULL, 0}
1750};
1751
1752PyMethodChain UserDataObj_chain = { UserDataObj_methods, NULL };
1753
1754static PyObject *UserDataObj_getattr(self, name)
1755 UserDataObject *self;
1756 char *name;
1757{
1758 return Py_FindMethodInChain(&UserDataObj_chain, (PyObject *)self, name);
1759}
1760
1761#define UserDataObj_setattr NULL
1762
Jack Jansena05ac601999-12-12 21:41:51 +00001763#define UserDataObj_compare NULL
1764
1765#define UserDataObj_repr NULL
1766
1767#define UserDataObj_hash NULL
1768
Jack Jansen453ced51995-11-30 17:42:08 +00001769PyTypeObject UserData_Type = {
1770 PyObject_HEAD_INIT(&PyType_Type)
1771 0, /*ob_size*/
1772 "UserData", /*tp_name*/
1773 sizeof(UserDataObject), /*tp_basicsize*/
1774 0, /*tp_itemsize*/
1775 /* methods */
1776 (destructor) UserDataObj_dealloc, /*tp_dealloc*/
1777 0, /*tp_print*/
1778 (getattrfunc) UserDataObj_getattr, /*tp_getattr*/
1779 (setattrfunc) UserDataObj_setattr, /*tp_setattr*/
Jack Jansena05ac601999-12-12 21:41:51 +00001780 (cmpfunc) UserDataObj_compare, /*tp_compare*/
1781 (reprfunc) UserDataObj_repr, /*tp_repr*/
1782 (PyNumberMethods *)0, /* tp_as_number */
1783 (PySequenceMethods *)0, /* tp_as_sequence */
1784 (PyMappingMethods *)0, /* tp_as_mapping */
1785 (hashfunc) UserDataObj_hash, /*tp_hash*/
Jack Jansen453ced51995-11-30 17:42:08 +00001786};
1787
1788/* -------------------- End object type UserData -------------------- */
1789
1790
1791/* ----------------------- Object type Media ------------------------ */
1792
1793PyTypeObject Media_Type;
1794
1795#define MediaObj_Check(x) ((x)->ob_type == &Media_Type)
1796
1797typedef struct MediaObject {
1798 PyObject_HEAD
1799 Media ob_itself;
1800} MediaObject;
1801
1802PyObject *MediaObj_New(itself)
1803 Media itself;
1804{
1805 MediaObject *it;
1806 if (itself == NULL) {
1807 PyErr_SetString(Qt_Error,"Cannot create null Media");
1808 return NULL;
1809 }
1810 it = PyObject_NEW(MediaObject, &Media_Type);
1811 if (it == NULL) return NULL;
1812 it->ob_itself = itself;
1813 return (PyObject *)it;
1814}
1815MediaObj_Convert(v, p_itself)
1816 PyObject *v;
1817 Media *p_itself;
1818{
1819 if (!MediaObj_Check(v))
1820 {
1821 PyErr_SetString(PyExc_TypeError, "Media required");
1822 return 0;
1823 }
1824 *p_itself = ((MediaObject *)v)->ob_itself;
1825 return 1;
1826}
1827
1828static void MediaObj_dealloc(self)
1829 MediaObject *self;
1830{
1831 DisposeTrackMedia(self->ob_itself);
1832 PyMem_DEL(self);
1833}
1834
1835static PyObject *MediaObj_LoadMediaIntoRam(_self, _args)
1836 MediaObject *_self;
1837 PyObject *_args;
1838{
1839 PyObject *_res = NULL;
1840 OSErr _err;
1841 TimeValue time;
1842 TimeValue duration;
1843 long flags;
1844 if (!PyArg_ParseTuple(_args, "lll",
1845 &time,
1846 &duration,
1847 &flags))
1848 return NULL;
1849 _err = LoadMediaIntoRam(_self->ob_itself,
1850 time,
1851 duration,
1852 flags);
1853 if (_err != noErr) return PyMac_Error(_err);
1854 Py_INCREF(Py_None);
1855 _res = Py_None;
1856 return _res;
1857}
1858
1859static PyObject *MediaObj_GetMediaTrack(_self, _args)
1860 MediaObject *_self;
1861 PyObject *_args;
1862{
1863 PyObject *_res = NULL;
1864 Track _rv;
1865 if (!PyArg_ParseTuple(_args, ""))
1866 return NULL;
1867 _rv = GetMediaTrack(_self->ob_itself);
1868 _res = Py_BuildValue("O&",
1869 TrackObj_New, _rv);
1870 return _res;
1871}
1872
Jack Jansene0cf87b1997-04-09 15:53:46 +00001873static PyObject *MediaObj_GetMediaCreationTime(_self, _args)
1874 MediaObject *_self;
1875 PyObject *_args;
1876{
1877 PyObject *_res = NULL;
1878 unsigned long _rv;
1879 if (!PyArg_ParseTuple(_args, ""))
1880 return NULL;
1881 _rv = GetMediaCreationTime(_self->ob_itself);
1882 _res = Py_BuildValue("l",
1883 _rv);
1884 return _res;
1885}
1886
1887static PyObject *MediaObj_GetMediaModificationTime(_self, _args)
1888 MediaObject *_self;
1889 PyObject *_args;
1890{
1891 PyObject *_res = NULL;
1892 unsigned long _rv;
1893 if (!PyArg_ParseTuple(_args, ""))
1894 return NULL;
1895 _rv = GetMediaModificationTime(_self->ob_itself);
1896 _res = Py_BuildValue("l",
1897 _rv);
1898 return _res;
1899}
1900
Jack Jansen453ced51995-11-30 17:42:08 +00001901static PyObject *MediaObj_GetMediaTimeScale(_self, _args)
1902 MediaObject *_self;
1903 PyObject *_args;
1904{
1905 PyObject *_res = NULL;
1906 TimeScale _rv;
1907 if (!PyArg_ParseTuple(_args, ""))
1908 return NULL;
1909 _rv = GetMediaTimeScale(_self->ob_itself);
1910 _res = Py_BuildValue("l",
1911 _rv);
1912 return _res;
1913}
1914
1915static PyObject *MediaObj_SetMediaTimeScale(_self, _args)
1916 MediaObject *_self;
1917 PyObject *_args;
1918{
1919 PyObject *_res = NULL;
1920 TimeScale timeScale;
1921 if (!PyArg_ParseTuple(_args, "l",
1922 &timeScale))
1923 return NULL;
1924 SetMediaTimeScale(_self->ob_itself,
1925 timeScale);
1926 Py_INCREF(Py_None);
1927 _res = Py_None;
1928 return _res;
1929}
1930
1931static PyObject *MediaObj_GetMediaDuration(_self, _args)
1932 MediaObject *_self;
1933 PyObject *_args;
1934{
1935 PyObject *_res = NULL;
1936 TimeValue _rv;
1937 if (!PyArg_ParseTuple(_args, ""))
1938 return NULL;
1939 _rv = GetMediaDuration(_self->ob_itself);
1940 _res = Py_BuildValue("l",
1941 _rv);
1942 return _res;
1943}
1944
1945static PyObject *MediaObj_GetMediaLanguage(_self, _args)
1946 MediaObject *_self;
1947 PyObject *_args;
1948{
1949 PyObject *_res = NULL;
1950 short _rv;
1951 if (!PyArg_ParseTuple(_args, ""))
1952 return NULL;
1953 _rv = GetMediaLanguage(_self->ob_itself);
1954 _res = Py_BuildValue("h",
1955 _rv);
1956 return _res;
1957}
1958
1959static PyObject *MediaObj_SetMediaLanguage(_self, _args)
1960 MediaObject *_self;
1961 PyObject *_args;
1962{
1963 PyObject *_res = NULL;
1964 short language;
1965 if (!PyArg_ParseTuple(_args, "h",
1966 &language))
1967 return NULL;
1968 SetMediaLanguage(_self->ob_itself,
1969 language);
1970 Py_INCREF(Py_None);
1971 _res = Py_None;
1972 return _res;
1973}
1974
1975static PyObject *MediaObj_GetMediaQuality(_self, _args)
1976 MediaObject *_self;
1977 PyObject *_args;
1978{
1979 PyObject *_res = NULL;
1980 short _rv;
1981 if (!PyArg_ParseTuple(_args, ""))
1982 return NULL;
1983 _rv = GetMediaQuality(_self->ob_itself);
1984 _res = Py_BuildValue("h",
1985 _rv);
1986 return _res;
1987}
1988
1989static PyObject *MediaObj_SetMediaQuality(_self, _args)
1990 MediaObject *_self;
1991 PyObject *_args;
1992{
1993 PyObject *_res = NULL;
1994 short quality;
1995 if (!PyArg_ParseTuple(_args, "h",
1996 &quality))
1997 return NULL;
1998 SetMediaQuality(_self->ob_itself,
1999 quality);
2000 Py_INCREF(Py_None);
2001 _res = Py_None;
2002 return _res;
2003}
2004
2005static PyObject *MediaObj_GetMediaHandlerDescription(_self, _args)
2006 MediaObject *_self;
2007 PyObject *_args;
2008{
2009 PyObject *_res = NULL;
2010 OSType mediaType;
2011 Str255 creatorName;
2012 OSType creatorManufacturer;
2013 if (!PyArg_ParseTuple(_args, "O&",
2014 PyMac_GetStr255, creatorName))
2015 return NULL;
2016 GetMediaHandlerDescription(_self->ob_itself,
2017 &mediaType,
2018 creatorName,
2019 &creatorManufacturer);
2020 _res = Py_BuildValue("O&O&",
2021 PyMac_BuildOSType, mediaType,
2022 PyMac_BuildOSType, creatorManufacturer);
2023 return _res;
2024}
2025
2026static PyObject *MediaObj_GetMediaUserData(_self, _args)
2027 MediaObject *_self;
2028 PyObject *_args;
2029{
2030 PyObject *_res = NULL;
2031 UserData _rv;
2032 if (!PyArg_ParseTuple(_args, ""))
2033 return NULL;
2034 _rv = GetMediaUserData(_self->ob_itself);
2035 _res = Py_BuildValue("O&",
2036 UserDataObj_New, _rv);
2037 return _res;
2038}
2039
2040static PyObject *MediaObj_GetMediaHandler(_self, _args)
2041 MediaObject *_self;
2042 PyObject *_args;
2043{
2044 PyObject *_res = NULL;
2045 MediaHandler _rv;
2046 if (!PyArg_ParseTuple(_args, ""))
2047 return NULL;
2048 _rv = GetMediaHandler(_self->ob_itself);
2049 _res = Py_BuildValue("O&",
2050 CmpInstObj_New, _rv);
2051 return _res;
2052}
2053
2054static PyObject *MediaObj_SetMediaHandler(_self, _args)
2055 MediaObject *_self;
2056 PyObject *_args;
2057{
2058 PyObject *_res = NULL;
2059 OSErr _err;
2060 MediaHandlerComponent mH;
2061 if (!PyArg_ParseTuple(_args, "O&",
2062 CmpObj_Convert, &mH))
2063 return NULL;
2064 _err = SetMediaHandler(_self->ob_itself,
2065 mH);
2066 if (_err != noErr) return PyMac_Error(_err);
2067 Py_INCREF(Py_None);
2068 _res = Py_None;
2069 return _res;
2070}
2071
2072static PyObject *MediaObj_BeginMediaEdits(_self, _args)
2073 MediaObject *_self;
2074 PyObject *_args;
2075{
2076 PyObject *_res = NULL;
2077 OSErr _err;
2078 if (!PyArg_ParseTuple(_args, ""))
2079 return NULL;
2080 _err = BeginMediaEdits(_self->ob_itself);
2081 if (_err != noErr) return PyMac_Error(_err);
2082 Py_INCREF(Py_None);
2083 _res = Py_None;
2084 return _res;
2085}
2086
2087static PyObject *MediaObj_EndMediaEdits(_self, _args)
2088 MediaObject *_self;
2089 PyObject *_args;
2090{
2091 PyObject *_res = NULL;
2092 OSErr _err;
2093 if (!PyArg_ParseTuple(_args, ""))
2094 return NULL;
2095 _err = EndMediaEdits(_self->ob_itself);
2096 if (_err != noErr) return PyMac_Error(_err);
2097 Py_INCREF(Py_None);
2098 _res = Py_None;
2099 return _res;
2100}
2101
2102static PyObject *MediaObj_SetMediaDefaultDataRefIndex(_self, _args)
2103 MediaObject *_self;
2104 PyObject *_args;
2105{
2106 PyObject *_res = NULL;
2107 OSErr _err;
2108 short index;
2109 if (!PyArg_ParseTuple(_args, "h",
2110 &index))
2111 return NULL;
2112 _err = SetMediaDefaultDataRefIndex(_self->ob_itself,
2113 index);
2114 if (_err != noErr) return PyMac_Error(_err);
2115 Py_INCREF(Py_None);
2116 _res = Py_None;
2117 return _res;
2118}
2119
2120static PyObject *MediaObj_GetMediaDataHandlerDescription(_self, _args)
2121 MediaObject *_self;
2122 PyObject *_args;
2123{
2124 PyObject *_res = NULL;
2125 short index;
2126 OSType dhType;
2127 Str255 creatorName;
2128 OSType creatorManufacturer;
2129 if (!PyArg_ParseTuple(_args, "hO&",
2130 &index,
2131 PyMac_GetStr255, creatorName))
2132 return NULL;
2133 GetMediaDataHandlerDescription(_self->ob_itself,
2134 index,
2135 &dhType,
2136 creatorName,
2137 &creatorManufacturer);
2138 _res = Py_BuildValue("O&O&",
2139 PyMac_BuildOSType, dhType,
2140 PyMac_BuildOSType, creatorManufacturer);
2141 return _res;
2142}
2143
2144static PyObject *MediaObj_GetMediaDataHandler(_self, _args)
2145 MediaObject *_self;
2146 PyObject *_args;
2147{
2148 PyObject *_res = NULL;
2149 DataHandler _rv;
2150 short index;
2151 if (!PyArg_ParseTuple(_args, "h",
2152 &index))
2153 return NULL;
2154 _rv = GetMediaDataHandler(_self->ob_itself,
2155 index);
2156 _res = Py_BuildValue("O&",
2157 CmpInstObj_New, _rv);
2158 return _res;
2159}
2160
2161static PyObject *MediaObj_SetMediaDataHandler(_self, _args)
2162 MediaObject *_self;
2163 PyObject *_args;
2164{
2165 PyObject *_res = NULL;
2166 OSErr _err;
2167 short index;
2168 DataHandlerComponent dataHandler;
2169 if (!PyArg_ParseTuple(_args, "hO&",
2170 &index,
2171 CmpObj_Convert, &dataHandler))
2172 return NULL;
2173 _err = SetMediaDataHandler(_self->ob_itself,
2174 index,
2175 dataHandler);
2176 if (_err != noErr) return PyMac_Error(_err);
2177 Py_INCREF(Py_None);
2178 _res = Py_None;
2179 return _res;
2180}
2181
2182static PyObject *MediaObj_GetMediaSampleDescriptionCount(_self, _args)
2183 MediaObject *_self;
2184 PyObject *_args;
2185{
2186 PyObject *_res = NULL;
2187 long _rv;
2188 if (!PyArg_ParseTuple(_args, ""))
2189 return NULL;
2190 _rv = GetMediaSampleDescriptionCount(_self->ob_itself);
2191 _res = Py_BuildValue("l",
2192 _rv);
2193 return _res;
2194}
2195
2196static PyObject *MediaObj_GetMediaSampleDescription(_self, _args)
2197 MediaObject *_self;
2198 PyObject *_args;
2199{
2200 PyObject *_res = NULL;
2201 long index;
2202 SampleDescriptionHandle descH;
2203 if (!PyArg_ParseTuple(_args, "lO&",
2204 &index,
2205 ResObj_Convert, &descH))
2206 return NULL;
2207 GetMediaSampleDescription(_self->ob_itself,
2208 index,
2209 descH);
2210 Py_INCREF(Py_None);
2211 _res = Py_None;
2212 return _res;
2213}
2214
2215static PyObject *MediaObj_SetMediaSampleDescription(_self, _args)
2216 MediaObject *_self;
2217 PyObject *_args;
2218{
2219 PyObject *_res = NULL;
2220 OSErr _err;
2221 long index;
2222 SampleDescriptionHandle descH;
2223 if (!PyArg_ParseTuple(_args, "lO&",
2224 &index,
2225 ResObj_Convert, &descH))
2226 return NULL;
2227 _err = SetMediaSampleDescription(_self->ob_itself,
2228 index,
2229 descH);
2230 if (_err != noErr) return PyMac_Error(_err);
2231 Py_INCREF(Py_None);
2232 _res = Py_None;
2233 return _res;
2234}
2235
2236static PyObject *MediaObj_GetMediaSampleCount(_self, _args)
2237 MediaObject *_self;
2238 PyObject *_args;
2239{
2240 PyObject *_res = NULL;
2241 long _rv;
2242 if (!PyArg_ParseTuple(_args, ""))
2243 return NULL;
2244 _rv = GetMediaSampleCount(_self->ob_itself);
2245 _res = Py_BuildValue("l",
2246 _rv);
2247 return _res;
2248}
2249
Jack Jansen1c4e6141998-04-21 15:23:55 +00002250static PyObject *MediaObj_GetMediaSyncSampleCount(_self, _args)
2251 MediaObject *_self;
2252 PyObject *_args;
2253{
2254 PyObject *_res = NULL;
2255 long _rv;
2256 if (!PyArg_ParseTuple(_args, ""))
2257 return NULL;
2258 _rv = GetMediaSyncSampleCount(_self->ob_itself);
2259 _res = Py_BuildValue("l",
2260 _rv);
2261 return _res;
2262}
2263
Jack Jansen453ced51995-11-30 17:42:08 +00002264static PyObject *MediaObj_SampleNumToMediaTime(_self, _args)
2265 MediaObject *_self;
2266 PyObject *_args;
2267{
2268 PyObject *_res = NULL;
2269 long logicalSampleNum;
2270 TimeValue sampleTime;
2271 TimeValue sampleDuration;
2272 if (!PyArg_ParseTuple(_args, "l",
2273 &logicalSampleNum))
2274 return NULL;
2275 SampleNumToMediaTime(_self->ob_itself,
2276 logicalSampleNum,
2277 &sampleTime,
2278 &sampleDuration);
2279 _res = Py_BuildValue("ll",
2280 sampleTime,
2281 sampleDuration);
2282 return _res;
2283}
2284
2285static PyObject *MediaObj_MediaTimeToSampleNum(_self, _args)
2286 MediaObject *_self;
2287 PyObject *_args;
2288{
2289 PyObject *_res = NULL;
2290 TimeValue time;
2291 long sampleNum;
2292 TimeValue sampleTime;
2293 TimeValue sampleDuration;
2294 if (!PyArg_ParseTuple(_args, "l",
2295 &time))
2296 return NULL;
2297 MediaTimeToSampleNum(_self->ob_itself,
2298 time,
2299 &sampleNum,
2300 &sampleTime,
2301 &sampleDuration);
2302 _res = Py_BuildValue("lll",
2303 sampleNum,
2304 sampleTime,
2305 sampleDuration);
2306 return _res;
2307}
2308
2309static PyObject *MediaObj_AddMediaSample(_self, _args)
2310 MediaObject *_self;
2311 PyObject *_args;
2312{
2313 PyObject *_res = NULL;
2314 OSErr _err;
2315 Handle dataIn;
2316 long inOffset;
2317 unsigned long size;
2318 TimeValue durationPerSample;
2319 SampleDescriptionHandle sampleDescriptionH;
2320 long numberOfSamples;
2321 short sampleFlags;
2322 TimeValue sampleTime;
2323 if (!PyArg_ParseTuple(_args, "O&lllO&lh",
2324 ResObj_Convert, &dataIn,
2325 &inOffset,
2326 &size,
2327 &durationPerSample,
2328 ResObj_Convert, &sampleDescriptionH,
2329 &numberOfSamples,
2330 &sampleFlags))
2331 return NULL;
2332 _err = AddMediaSample(_self->ob_itself,
2333 dataIn,
2334 inOffset,
2335 size,
2336 durationPerSample,
2337 sampleDescriptionH,
2338 numberOfSamples,
2339 sampleFlags,
2340 &sampleTime);
2341 if (_err != noErr) return PyMac_Error(_err);
2342 _res = Py_BuildValue("l",
2343 sampleTime);
2344 return _res;
2345}
2346
2347static PyObject *MediaObj_AddMediaSampleReference(_self, _args)
2348 MediaObject *_self;
2349 PyObject *_args;
2350{
2351 PyObject *_res = NULL;
2352 OSErr _err;
2353 long dataOffset;
2354 unsigned long size;
2355 TimeValue durationPerSample;
2356 SampleDescriptionHandle sampleDescriptionH;
2357 long numberOfSamples;
2358 short sampleFlags;
2359 TimeValue sampleTime;
2360 if (!PyArg_ParseTuple(_args, "lllO&lh",
2361 &dataOffset,
2362 &size,
2363 &durationPerSample,
2364 ResObj_Convert, &sampleDescriptionH,
2365 &numberOfSamples,
2366 &sampleFlags))
2367 return NULL;
2368 _err = AddMediaSampleReference(_self->ob_itself,
2369 dataOffset,
2370 size,
2371 durationPerSample,
2372 sampleDescriptionH,
2373 numberOfSamples,
2374 sampleFlags,
2375 &sampleTime);
2376 if (_err != noErr) return PyMac_Error(_err);
2377 _res = Py_BuildValue("l",
2378 sampleTime);
2379 return _res;
2380}
2381
2382static PyObject *MediaObj_GetMediaSample(_self, _args)
2383 MediaObject *_self;
2384 PyObject *_args;
2385{
2386 PyObject *_res = NULL;
2387 OSErr _err;
2388 Handle dataOut;
2389 long maxSizeToGrow;
2390 long size;
2391 TimeValue time;
2392 TimeValue sampleTime;
2393 TimeValue durationPerSample;
2394 SampleDescriptionHandle sampleDescriptionH;
2395 long sampleDescriptionIndex;
2396 long maxNumberOfSamples;
2397 long numberOfSamples;
2398 short sampleFlags;
2399 if (!PyArg_ParseTuple(_args, "O&llO&l",
2400 ResObj_Convert, &dataOut,
2401 &maxSizeToGrow,
2402 &time,
2403 ResObj_Convert, &sampleDescriptionH,
2404 &maxNumberOfSamples))
2405 return NULL;
2406 _err = GetMediaSample(_self->ob_itself,
2407 dataOut,
2408 maxSizeToGrow,
2409 &size,
2410 time,
2411 &sampleTime,
2412 &durationPerSample,
2413 sampleDescriptionH,
2414 &sampleDescriptionIndex,
2415 maxNumberOfSamples,
2416 &numberOfSamples,
2417 &sampleFlags);
2418 if (_err != noErr) return PyMac_Error(_err);
2419 _res = Py_BuildValue("lllllh",
2420 size,
2421 sampleTime,
2422 durationPerSample,
2423 sampleDescriptionIndex,
2424 numberOfSamples,
2425 sampleFlags);
2426 return _res;
2427}
2428
2429static PyObject *MediaObj_GetMediaSampleReference(_self, _args)
2430 MediaObject *_self;
2431 PyObject *_args;
2432{
2433 PyObject *_res = NULL;
2434 OSErr _err;
2435 long dataOffset;
2436 long size;
2437 TimeValue time;
2438 TimeValue sampleTime;
2439 TimeValue durationPerSample;
2440 SampleDescriptionHandle sampleDescriptionH;
2441 long sampleDescriptionIndex;
2442 long maxNumberOfSamples;
2443 long numberOfSamples;
2444 short sampleFlags;
2445 if (!PyArg_ParseTuple(_args, "lO&l",
2446 &time,
2447 ResObj_Convert, &sampleDescriptionH,
2448 &maxNumberOfSamples))
2449 return NULL;
2450 _err = GetMediaSampleReference(_self->ob_itself,
2451 &dataOffset,
2452 &size,
2453 time,
2454 &sampleTime,
2455 &durationPerSample,
2456 sampleDescriptionH,
2457 &sampleDescriptionIndex,
2458 maxNumberOfSamples,
2459 &numberOfSamples,
2460 &sampleFlags);
2461 if (_err != noErr) return PyMac_Error(_err);
2462 _res = Py_BuildValue("llllllh",
2463 dataOffset,
2464 size,
2465 sampleTime,
2466 durationPerSample,
2467 sampleDescriptionIndex,
2468 numberOfSamples,
2469 sampleFlags);
2470 return _res;
2471}
2472
2473static PyObject *MediaObj_SetMediaPreferredChunkSize(_self, _args)
2474 MediaObject *_self;
2475 PyObject *_args;
2476{
2477 PyObject *_res = NULL;
2478 OSErr _err;
2479 long maxChunkSize;
2480 if (!PyArg_ParseTuple(_args, "l",
2481 &maxChunkSize))
2482 return NULL;
2483 _err = SetMediaPreferredChunkSize(_self->ob_itself,
2484 maxChunkSize);
2485 if (_err != noErr) return PyMac_Error(_err);
2486 Py_INCREF(Py_None);
2487 _res = Py_None;
2488 return _res;
2489}
2490
2491static PyObject *MediaObj_GetMediaPreferredChunkSize(_self, _args)
2492 MediaObject *_self;
2493 PyObject *_args;
2494{
2495 PyObject *_res = NULL;
2496 OSErr _err;
2497 long maxChunkSize;
2498 if (!PyArg_ParseTuple(_args, ""))
2499 return NULL;
2500 _err = GetMediaPreferredChunkSize(_self->ob_itself,
2501 &maxChunkSize);
2502 if (_err != noErr) return PyMac_Error(_err);
2503 _res = Py_BuildValue("l",
2504 maxChunkSize);
2505 return _res;
2506}
2507
2508static PyObject *MediaObj_SetMediaShadowSync(_self, _args)
2509 MediaObject *_self;
2510 PyObject *_args;
2511{
2512 PyObject *_res = NULL;
2513 OSErr _err;
2514 long frameDiffSampleNum;
2515 long syncSampleNum;
2516 if (!PyArg_ParseTuple(_args, "ll",
2517 &frameDiffSampleNum,
2518 &syncSampleNum))
2519 return NULL;
2520 _err = SetMediaShadowSync(_self->ob_itself,
2521 frameDiffSampleNum,
2522 syncSampleNum);
2523 if (_err != noErr) return PyMac_Error(_err);
2524 Py_INCREF(Py_None);
2525 _res = Py_None;
2526 return _res;
2527}
2528
2529static PyObject *MediaObj_GetMediaShadowSync(_self, _args)
2530 MediaObject *_self;
2531 PyObject *_args;
2532{
2533 PyObject *_res = NULL;
2534 OSErr _err;
2535 long frameDiffSampleNum;
2536 long syncSampleNum;
2537 if (!PyArg_ParseTuple(_args, "l",
2538 &frameDiffSampleNum))
2539 return NULL;
2540 _err = GetMediaShadowSync(_self->ob_itself,
2541 frameDiffSampleNum,
2542 &syncSampleNum);
2543 if (_err != noErr) return PyMac_Error(_err);
2544 _res = Py_BuildValue("l",
2545 syncSampleNum);
2546 return _res;
2547}
2548
2549static PyObject *MediaObj_GetMediaDataSize(_self, _args)
2550 MediaObject *_self;
2551 PyObject *_args;
2552{
2553 PyObject *_res = NULL;
2554 long _rv;
2555 TimeValue startTime;
2556 TimeValue duration;
2557 if (!PyArg_ParseTuple(_args, "ll",
2558 &startTime,
2559 &duration))
2560 return NULL;
2561 _rv = GetMediaDataSize(_self->ob_itself,
2562 startTime,
2563 duration);
2564 _res = Py_BuildValue("l",
2565 _rv);
2566 return _res;
2567}
2568
2569static PyObject *MediaObj_GetMediaNextInterestingTime(_self, _args)
2570 MediaObject *_self;
2571 PyObject *_args;
2572{
2573 PyObject *_res = NULL;
2574 short interestingTimeFlags;
2575 TimeValue time;
2576 Fixed rate;
2577 TimeValue interestingTime;
2578 TimeValue interestingDuration;
2579 if (!PyArg_ParseTuple(_args, "hlO&",
2580 &interestingTimeFlags,
2581 &time,
2582 PyMac_GetFixed, &rate))
2583 return NULL;
2584 GetMediaNextInterestingTime(_self->ob_itself,
2585 interestingTimeFlags,
2586 time,
2587 rate,
2588 &interestingTime,
2589 &interestingDuration);
2590 _res = Py_BuildValue("ll",
2591 interestingTime,
2592 interestingDuration);
2593 return _res;
2594}
2595
2596static PyObject *MediaObj_GetMediaDataRef(_self, _args)
2597 MediaObject *_self;
2598 PyObject *_args;
2599{
2600 PyObject *_res = NULL;
2601 OSErr _err;
2602 short index;
2603 Handle dataRef;
2604 OSType dataRefType;
2605 long dataRefAttributes;
2606 if (!PyArg_ParseTuple(_args, "h",
2607 &index))
2608 return NULL;
2609 _err = GetMediaDataRef(_self->ob_itself,
2610 index,
2611 &dataRef,
2612 &dataRefType,
2613 &dataRefAttributes);
2614 if (_err != noErr) return PyMac_Error(_err);
2615 _res = Py_BuildValue("O&O&l",
2616 ResObj_New, dataRef,
2617 PyMac_BuildOSType, dataRefType,
2618 dataRefAttributes);
2619 return _res;
2620}
2621
2622static PyObject *MediaObj_SetMediaDataRef(_self, _args)
2623 MediaObject *_self;
2624 PyObject *_args;
2625{
2626 PyObject *_res = NULL;
2627 OSErr _err;
2628 short index;
2629 Handle dataRef;
2630 OSType dataRefType;
2631 if (!PyArg_ParseTuple(_args, "hO&O&",
2632 &index,
2633 ResObj_Convert, &dataRef,
2634 PyMac_GetOSType, &dataRefType))
2635 return NULL;
2636 _err = SetMediaDataRef(_self->ob_itself,
2637 index,
2638 dataRef,
2639 dataRefType);
2640 if (_err != noErr) return PyMac_Error(_err);
2641 Py_INCREF(Py_None);
2642 _res = Py_None;
2643 return _res;
2644}
2645
2646static PyObject *MediaObj_SetMediaDataRefAttributes(_self, _args)
2647 MediaObject *_self;
2648 PyObject *_args;
2649{
2650 PyObject *_res = NULL;
2651 OSErr _err;
2652 short index;
2653 long dataRefAttributes;
2654 if (!PyArg_ParseTuple(_args, "hl",
2655 &index,
2656 &dataRefAttributes))
2657 return NULL;
2658 _err = SetMediaDataRefAttributes(_self->ob_itself,
2659 index,
2660 dataRefAttributes);
2661 if (_err != noErr) return PyMac_Error(_err);
2662 Py_INCREF(Py_None);
2663 _res = Py_None;
2664 return _res;
2665}
2666
2667static PyObject *MediaObj_AddMediaDataRef(_self, _args)
2668 MediaObject *_self;
2669 PyObject *_args;
2670{
2671 PyObject *_res = NULL;
2672 OSErr _err;
2673 short index;
2674 Handle dataRef;
2675 OSType dataRefType;
2676 if (!PyArg_ParseTuple(_args, "O&O&",
2677 ResObj_Convert, &dataRef,
2678 PyMac_GetOSType, &dataRefType))
2679 return NULL;
2680 _err = AddMediaDataRef(_self->ob_itself,
2681 &index,
2682 dataRef,
2683 dataRefType);
2684 if (_err != noErr) return PyMac_Error(_err);
2685 _res = Py_BuildValue("h",
2686 index);
2687 return _res;
2688}
2689
2690static PyObject *MediaObj_GetMediaDataRefCount(_self, _args)
2691 MediaObject *_self;
2692 PyObject *_args;
2693{
2694 PyObject *_res = NULL;
2695 OSErr _err;
2696 short count;
2697 if (!PyArg_ParseTuple(_args, ""))
2698 return NULL;
2699 _err = GetMediaDataRefCount(_self->ob_itself,
2700 &count);
2701 if (_err != noErr) return PyMac_Error(_err);
2702 _res = Py_BuildValue("h",
2703 count);
2704 return _res;
2705}
2706
2707static PyObject *MediaObj_SetMediaPlayHints(_self, _args)
2708 MediaObject *_self;
2709 PyObject *_args;
2710{
2711 PyObject *_res = NULL;
2712 long flags;
2713 long flagsMask;
2714 if (!PyArg_ParseTuple(_args, "ll",
2715 &flags,
2716 &flagsMask))
2717 return NULL;
2718 SetMediaPlayHints(_self->ob_itself,
2719 flags,
2720 flagsMask);
2721 Py_INCREF(Py_None);
2722 _res = Py_None;
2723 return _res;
2724}
2725
Jack Jansen1c4e6141998-04-21 15:23:55 +00002726static PyObject *MediaObj_GetMediaPlayHints(_self, _args)
2727 MediaObject *_self;
2728 PyObject *_args;
2729{
2730 PyObject *_res = NULL;
2731 long flags;
2732 if (!PyArg_ParseTuple(_args, ""))
2733 return NULL;
2734 GetMediaPlayHints(_self->ob_itself,
2735 &flags);
2736 _res = Py_BuildValue("l",
2737 flags);
2738 return _res;
2739}
2740
Jack Jansen453ced51995-11-30 17:42:08 +00002741static PyMethodDef MediaObj_methods[] = {
2742 {"LoadMediaIntoRam", (PyCFunction)MediaObj_LoadMediaIntoRam, 1,
2743 "(TimeValue time, TimeValue duration, long flags) -> None"},
2744 {"GetMediaTrack", (PyCFunction)MediaObj_GetMediaTrack, 1,
2745 "() -> (Track _rv)"},
Jack Jansene0cf87b1997-04-09 15:53:46 +00002746 {"GetMediaCreationTime", (PyCFunction)MediaObj_GetMediaCreationTime, 1,
2747 "() -> (unsigned long _rv)"},
2748 {"GetMediaModificationTime", (PyCFunction)MediaObj_GetMediaModificationTime, 1,
2749 "() -> (unsigned long _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00002750 {"GetMediaTimeScale", (PyCFunction)MediaObj_GetMediaTimeScale, 1,
2751 "() -> (TimeScale _rv)"},
2752 {"SetMediaTimeScale", (PyCFunction)MediaObj_SetMediaTimeScale, 1,
2753 "(TimeScale timeScale) -> None"},
2754 {"GetMediaDuration", (PyCFunction)MediaObj_GetMediaDuration, 1,
2755 "() -> (TimeValue _rv)"},
2756 {"GetMediaLanguage", (PyCFunction)MediaObj_GetMediaLanguage, 1,
2757 "() -> (short _rv)"},
2758 {"SetMediaLanguage", (PyCFunction)MediaObj_SetMediaLanguage, 1,
2759 "(short language) -> None"},
2760 {"GetMediaQuality", (PyCFunction)MediaObj_GetMediaQuality, 1,
2761 "() -> (short _rv)"},
2762 {"SetMediaQuality", (PyCFunction)MediaObj_SetMediaQuality, 1,
2763 "(short quality) -> None"},
2764 {"GetMediaHandlerDescription", (PyCFunction)MediaObj_GetMediaHandlerDescription, 1,
2765 "(Str255 creatorName) -> (OSType mediaType, OSType creatorManufacturer)"},
2766 {"GetMediaUserData", (PyCFunction)MediaObj_GetMediaUserData, 1,
2767 "() -> (UserData _rv)"},
2768 {"GetMediaHandler", (PyCFunction)MediaObj_GetMediaHandler, 1,
2769 "() -> (MediaHandler _rv)"},
2770 {"SetMediaHandler", (PyCFunction)MediaObj_SetMediaHandler, 1,
2771 "(MediaHandlerComponent mH) -> None"},
2772 {"BeginMediaEdits", (PyCFunction)MediaObj_BeginMediaEdits, 1,
2773 "() -> None"},
2774 {"EndMediaEdits", (PyCFunction)MediaObj_EndMediaEdits, 1,
2775 "() -> None"},
2776 {"SetMediaDefaultDataRefIndex", (PyCFunction)MediaObj_SetMediaDefaultDataRefIndex, 1,
2777 "(short index) -> None"},
2778 {"GetMediaDataHandlerDescription", (PyCFunction)MediaObj_GetMediaDataHandlerDescription, 1,
2779 "(short index, Str255 creatorName) -> (OSType dhType, OSType creatorManufacturer)"},
2780 {"GetMediaDataHandler", (PyCFunction)MediaObj_GetMediaDataHandler, 1,
2781 "(short index) -> (DataHandler _rv)"},
2782 {"SetMediaDataHandler", (PyCFunction)MediaObj_SetMediaDataHandler, 1,
2783 "(short index, DataHandlerComponent dataHandler) -> None"},
2784 {"GetMediaSampleDescriptionCount", (PyCFunction)MediaObj_GetMediaSampleDescriptionCount, 1,
2785 "() -> (long _rv)"},
2786 {"GetMediaSampleDescription", (PyCFunction)MediaObj_GetMediaSampleDescription, 1,
2787 "(long index, SampleDescriptionHandle descH) -> None"},
2788 {"SetMediaSampleDescription", (PyCFunction)MediaObj_SetMediaSampleDescription, 1,
2789 "(long index, SampleDescriptionHandle descH) -> None"},
2790 {"GetMediaSampleCount", (PyCFunction)MediaObj_GetMediaSampleCount, 1,
2791 "() -> (long _rv)"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00002792 {"GetMediaSyncSampleCount", (PyCFunction)MediaObj_GetMediaSyncSampleCount, 1,
2793 "() -> (long _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00002794 {"SampleNumToMediaTime", (PyCFunction)MediaObj_SampleNumToMediaTime, 1,
2795 "(long logicalSampleNum) -> (TimeValue sampleTime, TimeValue sampleDuration)"},
2796 {"MediaTimeToSampleNum", (PyCFunction)MediaObj_MediaTimeToSampleNum, 1,
2797 "(TimeValue time) -> (long sampleNum, TimeValue sampleTime, TimeValue sampleDuration)"},
2798 {"AddMediaSample", (PyCFunction)MediaObj_AddMediaSample, 1,
2799 "(Handle dataIn, long inOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
2800 {"AddMediaSampleReference", (PyCFunction)MediaObj_AddMediaSampleReference, 1,
2801 "(long dataOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
2802 {"GetMediaSample", (PyCFunction)MediaObj_GetMediaSample, 1,
2803 "(Handle dataOut, long maxSizeToGrow, TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
2804 {"GetMediaSampleReference", (PyCFunction)MediaObj_GetMediaSampleReference, 1,
2805 "(TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long dataOffset, long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
2806 {"SetMediaPreferredChunkSize", (PyCFunction)MediaObj_SetMediaPreferredChunkSize, 1,
2807 "(long maxChunkSize) -> None"},
2808 {"GetMediaPreferredChunkSize", (PyCFunction)MediaObj_GetMediaPreferredChunkSize, 1,
2809 "() -> (long maxChunkSize)"},
2810 {"SetMediaShadowSync", (PyCFunction)MediaObj_SetMediaShadowSync, 1,
2811 "(long frameDiffSampleNum, long syncSampleNum) -> None"},
2812 {"GetMediaShadowSync", (PyCFunction)MediaObj_GetMediaShadowSync, 1,
2813 "(long frameDiffSampleNum) -> (long syncSampleNum)"},
2814 {"GetMediaDataSize", (PyCFunction)MediaObj_GetMediaDataSize, 1,
2815 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
2816 {"GetMediaNextInterestingTime", (PyCFunction)MediaObj_GetMediaNextInterestingTime, 1,
2817 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
2818 {"GetMediaDataRef", (PyCFunction)MediaObj_GetMediaDataRef, 1,
2819 "(short index) -> (Handle dataRef, OSType dataRefType, long dataRefAttributes)"},
2820 {"SetMediaDataRef", (PyCFunction)MediaObj_SetMediaDataRef, 1,
2821 "(short index, Handle dataRef, OSType dataRefType) -> None"},
2822 {"SetMediaDataRefAttributes", (PyCFunction)MediaObj_SetMediaDataRefAttributes, 1,
2823 "(short index, long dataRefAttributes) -> None"},
2824 {"AddMediaDataRef", (PyCFunction)MediaObj_AddMediaDataRef, 1,
2825 "(Handle dataRef, OSType dataRefType) -> (short index)"},
2826 {"GetMediaDataRefCount", (PyCFunction)MediaObj_GetMediaDataRefCount, 1,
2827 "() -> (short count)"},
2828 {"SetMediaPlayHints", (PyCFunction)MediaObj_SetMediaPlayHints, 1,
2829 "(long flags, long flagsMask) -> None"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00002830 {"GetMediaPlayHints", (PyCFunction)MediaObj_GetMediaPlayHints, 1,
2831 "() -> (long flags)"},
Jack Jansen453ced51995-11-30 17:42:08 +00002832 {NULL, NULL, 0}
2833};
2834
2835PyMethodChain MediaObj_chain = { MediaObj_methods, NULL };
2836
2837static PyObject *MediaObj_getattr(self, name)
2838 MediaObject *self;
2839 char *name;
2840{
2841 return Py_FindMethodInChain(&MediaObj_chain, (PyObject *)self, name);
2842}
2843
2844#define MediaObj_setattr NULL
2845
Jack Jansena05ac601999-12-12 21:41:51 +00002846#define MediaObj_compare NULL
2847
2848#define MediaObj_repr NULL
2849
2850#define MediaObj_hash NULL
2851
Jack Jansen453ced51995-11-30 17:42:08 +00002852PyTypeObject Media_Type = {
2853 PyObject_HEAD_INIT(&PyType_Type)
2854 0, /*ob_size*/
2855 "Media", /*tp_name*/
2856 sizeof(MediaObject), /*tp_basicsize*/
2857 0, /*tp_itemsize*/
2858 /* methods */
2859 (destructor) MediaObj_dealloc, /*tp_dealloc*/
2860 0, /*tp_print*/
2861 (getattrfunc) MediaObj_getattr, /*tp_getattr*/
2862 (setattrfunc) MediaObj_setattr, /*tp_setattr*/
Jack Jansena05ac601999-12-12 21:41:51 +00002863 (cmpfunc) MediaObj_compare, /*tp_compare*/
2864 (reprfunc) MediaObj_repr, /*tp_repr*/
2865 (PyNumberMethods *)0, /* tp_as_number */
2866 (PySequenceMethods *)0, /* tp_as_sequence */
2867 (PyMappingMethods *)0, /* tp_as_mapping */
2868 (hashfunc) MediaObj_hash, /*tp_hash*/
Jack Jansen453ced51995-11-30 17:42:08 +00002869};
2870
2871/* --------------------- End object type Media ---------------------- */
2872
2873
2874/* ----------------------- Object type Track ------------------------ */
2875
2876PyTypeObject Track_Type;
2877
2878#define TrackObj_Check(x) ((x)->ob_type == &Track_Type)
2879
2880typedef struct TrackObject {
2881 PyObject_HEAD
2882 Track ob_itself;
2883} TrackObject;
2884
2885PyObject *TrackObj_New(itself)
2886 Track itself;
2887{
2888 TrackObject *it;
2889 if (itself == NULL) {
2890 PyErr_SetString(Qt_Error,"Cannot create null Track");
2891 return NULL;
2892 }
2893 it = PyObject_NEW(TrackObject, &Track_Type);
2894 if (it == NULL) return NULL;
2895 it->ob_itself = itself;
2896 return (PyObject *)it;
2897}
2898TrackObj_Convert(v, p_itself)
2899 PyObject *v;
2900 Track *p_itself;
2901{
2902 if (!TrackObj_Check(v))
2903 {
2904 PyErr_SetString(PyExc_TypeError, "Track required");
2905 return 0;
2906 }
2907 *p_itself = ((TrackObject *)v)->ob_itself;
2908 return 1;
2909}
2910
2911static void TrackObj_dealloc(self)
2912 TrackObject *self;
2913{
2914 DisposeMovieTrack(self->ob_itself);
2915 PyMem_DEL(self);
2916}
2917
2918static PyObject *TrackObj_LoadTrackIntoRam(_self, _args)
2919 TrackObject *_self;
2920 PyObject *_args;
2921{
2922 PyObject *_res = NULL;
2923 OSErr _err;
2924 TimeValue time;
2925 TimeValue duration;
2926 long flags;
2927 if (!PyArg_ParseTuple(_args, "lll",
2928 &time,
2929 &duration,
2930 &flags))
2931 return NULL;
2932 _err = LoadTrackIntoRam(_self->ob_itself,
2933 time,
2934 duration,
2935 flags);
2936 if (_err != noErr) return PyMac_Error(_err);
2937 Py_INCREF(Py_None);
2938 _res = Py_None;
2939 return _res;
2940}
2941
2942static PyObject *TrackObj_GetTrackPict(_self, _args)
2943 TrackObject *_self;
2944 PyObject *_args;
2945{
2946 PyObject *_res = NULL;
2947 PicHandle _rv;
2948 TimeValue time;
2949 if (!PyArg_ParseTuple(_args, "l",
2950 &time))
2951 return NULL;
2952 _rv = GetTrackPict(_self->ob_itself,
2953 time);
2954 _res = Py_BuildValue("O&",
2955 ResObj_New, _rv);
2956 return _res;
2957}
2958
2959static PyObject *TrackObj_GetTrackClipRgn(_self, _args)
2960 TrackObject *_self;
2961 PyObject *_args;
2962{
2963 PyObject *_res = NULL;
2964 RgnHandle _rv;
2965 if (!PyArg_ParseTuple(_args, ""))
2966 return NULL;
2967 _rv = GetTrackClipRgn(_self->ob_itself);
2968 _res = Py_BuildValue("O&",
2969 ResObj_New, _rv);
2970 return _res;
2971}
2972
2973static PyObject *TrackObj_SetTrackClipRgn(_self, _args)
2974 TrackObject *_self;
2975 PyObject *_args;
2976{
2977 PyObject *_res = NULL;
2978 RgnHandle theClip;
2979 if (!PyArg_ParseTuple(_args, "O&",
2980 ResObj_Convert, &theClip))
2981 return NULL;
2982 SetTrackClipRgn(_self->ob_itself,
2983 theClip);
2984 Py_INCREF(Py_None);
2985 _res = Py_None;
2986 return _res;
2987}
2988
2989static PyObject *TrackObj_GetTrackDisplayBoundsRgn(_self, _args)
2990 TrackObject *_self;
2991 PyObject *_args;
2992{
2993 PyObject *_res = NULL;
2994 RgnHandle _rv;
2995 if (!PyArg_ParseTuple(_args, ""))
2996 return NULL;
2997 _rv = GetTrackDisplayBoundsRgn(_self->ob_itself);
2998 _res = Py_BuildValue("O&",
2999 ResObj_New, _rv);
3000 return _res;
3001}
3002
3003static PyObject *TrackObj_GetTrackMovieBoundsRgn(_self, _args)
3004 TrackObject *_self;
3005 PyObject *_args;
3006{
3007 PyObject *_res = NULL;
3008 RgnHandle _rv;
3009 if (!PyArg_ParseTuple(_args, ""))
3010 return NULL;
3011 _rv = GetTrackMovieBoundsRgn(_self->ob_itself);
3012 _res = Py_BuildValue("O&",
3013 ResObj_New, _rv);
3014 return _res;
3015}
3016
3017static PyObject *TrackObj_GetTrackBoundsRgn(_self, _args)
3018 TrackObject *_self;
3019 PyObject *_args;
3020{
3021 PyObject *_res = NULL;
3022 RgnHandle _rv;
3023 if (!PyArg_ParseTuple(_args, ""))
3024 return NULL;
3025 _rv = GetTrackBoundsRgn(_self->ob_itself);
3026 _res = Py_BuildValue("O&",
3027 ResObj_New, _rv);
3028 return _res;
3029}
3030
3031static PyObject *TrackObj_GetTrackMatte(_self, _args)
3032 TrackObject *_self;
3033 PyObject *_args;
3034{
3035 PyObject *_res = NULL;
3036 PixMapHandle _rv;
3037 if (!PyArg_ParseTuple(_args, ""))
3038 return NULL;
3039 _rv = GetTrackMatte(_self->ob_itself);
3040 _res = Py_BuildValue("O&",
3041 ResObj_New, _rv);
3042 return _res;
3043}
3044
3045static PyObject *TrackObj_SetTrackMatte(_self, _args)
3046 TrackObject *_self;
3047 PyObject *_args;
3048{
3049 PyObject *_res = NULL;
3050 PixMapHandle theMatte;
3051 if (!PyArg_ParseTuple(_args, "O&",
3052 ResObj_Convert, &theMatte))
3053 return NULL;
3054 SetTrackMatte(_self->ob_itself,
3055 theMatte);
3056 Py_INCREF(Py_None);
3057 _res = Py_None;
3058 return _res;
3059}
3060
3061static PyObject *TrackObj_GetTrackID(_self, _args)
3062 TrackObject *_self;
3063 PyObject *_args;
3064{
3065 PyObject *_res = NULL;
3066 long _rv;
3067 if (!PyArg_ParseTuple(_args, ""))
3068 return NULL;
3069 _rv = GetTrackID(_self->ob_itself);
3070 _res = Py_BuildValue("l",
3071 _rv);
3072 return _res;
3073}
3074
3075static PyObject *TrackObj_GetTrackMovie(_self, _args)
3076 TrackObject *_self;
3077 PyObject *_args;
3078{
3079 PyObject *_res = NULL;
3080 Movie _rv;
3081 if (!PyArg_ParseTuple(_args, ""))
3082 return NULL;
3083 _rv = GetTrackMovie(_self->ob_itself);
3084 _res = Py_BuildValue("O&",
3085 MovieObj_New, _rv);
3086 return _res;
3087}
3088
Jack Jansene0cf87b1997-04-09 15:53:46 +00003089static PyObject *TrackObj_GetTrackCreationTime(_self, _args)
3090 TrackObject *_self;
3091 PyObject *_args;
3092{
3093 PyObject *_res = NULL;
3094 unsigned long _rv;
3095 if (!PyArg_ParseTuple(_args, ""))
3096 return NULL;
3097 _rv = GetTrackCreationTime(_self->ob_itself);
3098 _res = Py_BuildValue("l",
3099 _rv);
3100 return _res;
3101}
3102
3103static PyObject *TrackObj_GetTrackModificationTime(_self, _args)
3104 TrackObject *_self;
3105 PyObject *_args;
3106{
3107 PyObject *_res = NULL;
3108 unsigned long _rv;
3109 if (!PyArg_ParseTuple(_args, ""))
3110 return NULL;
3111 _rv = GetTrackModificationTime(_self->ob_itself);
3112 _res = Py_BuildValue("l",
3113 _rv);
3114 return _res;
3115}
3116
Jack Jansen453ced51995-11-30 17:42:08 +00003117static PyObject *TrackObj_GetTrackEnabled(_self, _args)
3118 TrackObject *_self;
3119 PyObject *_args;
3120{
3121 PyObject *_res = NULL;
3122 Boolean _rv;
3123 if (!PyArg_ParseTuple(_args, ""))
3124 return NULL;
3125 _rv = GetTrackEnabled(_self->ob_itself);
3126 _res = Py_BuildValue("b",
3127 _rv);
3128 return _res;
3129}
3130
3131static PyObject *TrackObj_SetTrackEnabled(_self, _args)
3132 TrackObject *_self;
3133 PyObject *_args;
3134{
3135 PyObject *_res = NULL;
3136 Boolean isEnabled;
3137 if (!PyArg_ParseTuple(_args, "b",
3138 &isEnabled))
3139 return NULL;
3140 SetTrackEnabled(_self->ob_itself,
3141 isEnabled);
3142 Py_INCREF(Py_None);
3143 _res = Py_None;
3144 return _res;
3145}
3146
3147static PyObject *TrackObj_GetTrackUsage(_self, _args)
3148 TrackObject *_self;
3149 PyObject *_args;
3150{
3151 PyObject *_res = NULL;
3152 long _rv;
3153 if (!PyArg_ParseTuple(_args, ""))
3154 return NULL;
3155 _rv = GetTrackUsage(_self->ob_itself);
3156 _res = Py_BuildValue("l",
3157 _rv);
3158 return _res;
3159}
3160
3161static PyObject *TrackObj_SetTrackUsage(_self, _args)
3162 TrackObject *_self;
3163 PyObject *_args;
3164{
3165 PyObject *_res = NULL;
3166 long usage;
3167 if (!PyArg_ParseTuple(_args, "l",
3168 &usage))
3169 return NULL;
3170 SetTrackUsage(_self->ob_itself,
3171 usage);
3172 Py_INCREF(Py_None);
3173 _res = Py_None;
3174 return _res;
3175}
3176
3177static PyObject *TrackObj_GetTrackDuration(_self, _args)
3178 TrackObject *_self;
3179 PyObject *_args;
3180{
3181 PyObject *_res = NULL;
3182 TimeValue _rv;
3183 if (!PyArg_ParseTuple(_args, ""))
3184 return NULL;
3185 _rv = GetTrackDuration(_self->ob_itself);
3186 _res = Py_BuildValue("l",
3187 _rv);
3188 return _res;
3189}
3190
3191static PyObject *TrackObj_GetTrackOffset(_self, _args)
3192 TrackObject *_self;
3193 PyObject *_args;
3194{
3195 PyObject *_res = NULL;
3196 TimeValue _rv;
3197 if (!PyArg_ParseTuple(_args, ""))
3198 return NULL;
3199 _rv = GetTrackOffset(_self->ob_itself);
3200 _res = Py_BuildValue("l",
3201 _rv);
3202 return _res;
3203}
3204
3205static PyObject *TrackObj_SetTrackOffset(_self, _args)
3206 TrackObject *_self;
3207 PyObject *_args;
3208{
3209 PyObject *_res = NULL;
3210 TimeValue movieOffsetTime;
3211 if (!PyArg_ParseTuple(_args, "l",
3212 &movieOffsetTime))
3213 return NULL;
3214 SetTrackOffset(_self->ob_itself,
3215 movieOffsetTime);
3216 Py_INCREF(Py_None);
3217 _res = Py_None;
3218 return _res;
3219}
3220
3221static PyObject *TrackObj_GetTrackLayer(_self, _args)
3222 TrackObject *_self;
3223 PyObject *_args;
3224{
3225 PyObject *_res = NULL;
3226 short _rv;
3227 if (!PyArg_ParseTuple(_args, ""))
3228 return NULL;
3229 _rv = GetTrackLayer(_self->ob_itself);
3230 _res = Py_BuildValue("h",
3231 _rv);
3232 return _res;
3233}
3234
3235static PyObject *TrackObj_SetTrackLayer(_self, _args)
3236 TrackObject *_self;
3237 PyObject *_args;
3238{
3239 PyObject *_res = NULL;
3240 short layer;
3241 if (!PyArg_ParseTuple(_args, "h",
3242 &layer))
3243 return NULL;
3244 SetTrackLayer(_self->ob_itself,
3245 layer);
3246 Py_INCREF(Py_None);
3247 _res = Py_None;
3248 return _res;
3249}
3250
3251static PyObject *TrackObj_GetTrackAlternate(_self, _args)
3252 TrackObject *_self;
3253 PyObject *_args;
3254{
3255 PyObject *_res = NULL;
3256 Track _rv;
3257 if (!PyArg_ParseTuple(_args, ""))
3258 return NULL;
3259 _rv = GetTrackAlternate(_self->ob_itself);
3260 _res = Py_BuildValue("O&",
3261 TrackObj_New, _rv);
3262 return _res;
3263}
3264
3265static PyObject *TrackObj_SetTrackAlternate(_self, _args)
3266 TrackObject *_self;
3267 PyObject *_args;
3268{
3269 PyObject *_res = NULL;
3270 Track alternateT;
3271 if (!PyArg_ParseTuple(_args, "O&",
3272 TrackObj_Convert, &alternateT))
3273 return NULL;
3274 SetTrackAlternate(_self->ob_itself,
3275 alternateT);
3276 Py_INCREF(Py_None);
3277 _res = Py_None;
3278 return _res;
3279}
3280
3281static PyObject *TrackObj_GetTrackVolume(_self, _args)
3282 TrackObject *_self;
3283 PyObject *_args;
3284{
3285 PyObject *_res = NULL;
3286 short _rv;
3287 if (!PyArg_ParseTuple(_args, ""))
3288 return NULL;
3289 _rv = GetTrackVolume(_self->ob_itself);
3290 _res = Py_BuildValue("h",
3291 _rv);
3292 return _res;
3293}
3294
3295static PyObject *TrackObj_SetTrackVolume(_self, _args)
3296 TrackObject *_self;
3297 PyObject *_args;
3298{
3299 PyObject *_res = NULL;
3300 short volume;
3301 if (!PyArg_ParseTuple(_args, "h",
3302 &volume))
3303 return NULL;
3304 SetTrackVolume(_self->ob_itself,
3305 volume);
3306 Py_INCREF(Py_None);
3307 _res = Py_None;
3308 return _res;
3309}
3310
3311static PyObject *TrackObj_GetTrackDimensions(_self, _args)
3312 TrackObject *_self;
3313 PyObject *_args;
3314{
3315 PyObject *_res = NULL;
3316 Fixed width;
3317 Fixed height;
3318 if (!PyArg_ParseTuple(_args, ""))
3319 return NULL;
3320 GetTrackDimensions(_self->ob_itself,
3321 &width,
3322 &height);
3323 _res = Py_BuildValue("O&O&",
3324 PyMac_BuildFixed, width,
3325 PyMac_BuildFixed, height);
3326 return _res;
3327}
3328
3329static PyObject *TrackObj_SetTrackDimensions(_self, _args)
3330 TrackObject *_self;
3331 PyObject *_args;
3332{
3333 PyObject *_res = NULL;
3334 Fixed width;
3335 Fixed height;
3336 if (!PyArg_ParseTuple(_args, "O&O&",
3337 PyMac_GetFixed, &width,
3338 PyMac_GetFixed, &height))
3339 return NULL;
3340 SetTrackDimensions(_self->ob_itself,
3341 width,
3342 height);
3343 Py_INCREF(Py_None);
3344 _res = Py_None;
3345 return _res;
3346}
3347
3348static PyObject *TrackObj_GetTrackUserData(_self, _args)
3349 TrackObject *_self;
3350 PyObject *_args;
3351{
3352 PyObject *_res = NULL;
3353 UserData _rv;
3354 if (!PyArg_ParseTuple(_args, ""))
3355 return NULL;
3356 _rv = GetTrackUserData(_self->ob_itself);
3357 _res = Py_BuildValue("O&",
3358 UserDataObj_New, _rv);
3359 return _res;
3360}
3361
Jack Jansen1c4e6141998-04-21 15:23:55 +00003362static PyObject *TrackObj_GetTrackSoundLocalizationSettings(_self, _args)
3363 TrackObject *_self;
3364 PyObject *_args;
3365{
3366 PyObject *_res = NULL;
3367 OSErr _err;
3368 Handle settings;
3369 if (!PyArg_ParseTuple(_args, ""))
3370 return NULL;
3371 _err = GetTrackSoundLocalizationSettings(_self->ob_itself,
3372 &settings);
3373 if (_err != noErr) return PyMac_Error(_err);
3374 _res = Py_BuildValue("O&",
3375 ResObj_New, settings);
3376 return _res;
3377}
3378
3379static PyObject *TrackObj_SetTrackSoundLocalizationSettings(_self, _args)
3380 TrackObject *_self;
3381 PyObject *_args;
3382{
3383 PyObject *_res = NULL;
3384 OSErr _err;
3385 Handle settings;
3386 if (!PyArg_ParseTuple(_args, "O&",
3387 ResObj_Convert, &settings))
3388 return NULL;
3389 _err = SetTrackSoundLocalizationSettings(_self->ob_itself,
3390 settings);
3391 if (_err != noErr) return PyMac_Error(_err);
3392 Py_INCREF(Py_None);
3393 _res = Py_None;
3394 return _res;
3395}
3396
Jack Jansen453ced51995-11-30 17:42:08 +00003397static PyObject *TrackObj_NewTrackMedia(_self, _args)
3398 TrackObject *_self;
3399 PyObject *_args;
3400{
3401 PyObject *_res = NULL;
3402 Media _rv;
3403 OSType mediaType;
3404 TimeScale timeScale;
3405 Handle dataRef;
3406 OSType dataRefType;
3407 if (!PyArg_ParseTuple(_args, "O&lO&O&",
3408 PyMac_GetOSType, &mediaType,
3409 &timeScale,
3410 ResObj_Convert, &dataRef,
3411 PyMac_GetOSType, &dataRefType))
3412 return NULL;
3413 _rv = NewTrackMedia(_self->ob_itself,
3414 mediaType,
3415 timeScale,
3416 dataRef,
3417 dataRefType);
3418 _res = Py_BuildValue("O&",
3419 MediaObj_New, _rv);
3420 return _res;
3421}
3422
3423static PyObject *TrackObj_GetTrackMedia(_self, _args)
3424 TrackObject *_self;
3425 PyObject *_args;
3426{
3427 PyObject *_res = NULL;
3428 Media _rv;
3429 if (!PyArg_ParseTuple(_args, ""))
3430 return NULL;
3431 _rv = GetTrackMedia(_self->ob_itself);
3432 _res = Py_BuildValue("O&",
3433 MediaObj_New, _rv);
3434 return _res;
3435}
3436
3437static PyObject *TrackObj_InsertMediaIntoTrack(_self, _args)
3438 TrackObject *_self;
3439 PyObject *_args;
3440{
3441 PyObject *_res = NULL;
3442 OSErr _err;
3443 TimeValue trackStart;
3444 TimeValue mediaTime;
3445 TimeValue mediaDuration;
3446 Fixed mediaRate;
3447 if (!PyArg_ParseTuple(_args, "lllO&",
3448 &trackStart,
3449 &mediaTime,
3450 &mediaDuration,
3451 PyMac_GetFixed, &mediaRate))
3452 return NULL;
3453 _err = InsertMediaIntoTrack(_self->ob_itself,
3454 trackStart,
3455 mediaTime,
3456 mediaDuration,
3457 mediaRate);
3458 if (_err != noErr) return PyMac_Error(_err);
3459 Py_INCREF(Py_None);
3460 _res = Py_None;
3461 return _res;
3462}
3463
3464static PyObject *TrackObj_InsertTrackSegment(_self, _args)
3465 TrackObject *_self;
3466 PyObject *_args;
3467{
3468 PyObject *_res = NULL;
3469 OSErr _err;
3470 Track dstTrack;
3471 TimeValue srcIn;
3472 TimeValue srcDuration;
3473 TimeValue dstIn;
3474 if (!PyArg_ParseTuple(_args, "O&lll",
3475 TrackObj_Convert, &dstTrack,
3476 &srcIn,
3477 &srcDuration,
3478 &dstIn))
3479 return NULL;
3480 _err = InsertTrackSegment(_self->ob_itself,
3481 dstTrack,
3482 srcIn,
3483 srcDuration,
3484 dstIn);
3485 if (_err != noErr) return PyMac_Error(_err);
3486 Py_INCREF(Py_None);
3487 _res = Py_None;
3488 return _res;
3489}
3490
3491static PyObject *TrackObj_InsertEmptyTrackSegment(_self, _args)
3492 TrackObject *_self;
3493 PyObject *_args;
3494{
3495 PyObject *_res = NULL;
3496 OSErr _err;
3497 TimeValue dstIn;
3498 TimeValue dstDuration;
3499 if (!PyArg_ParseTuple(_args, "ll",
3500 &dstIn,
3501 &dstDuration))
3502 return NULL;
3503 _err = InsertEmptyTrackSegment(_self->ob_itself,
3504 dstIn,
3505 dstDuration);
3506 if (_err != noErr) return PyMac_Error(_err);
3507 Py_INCREF(Py_None);
3508 _res = Py_None;
3509 return _res;
3510}
3511
3512static PyObject *TrackObj_DeleteTrackSegment(_self, _args)
3513 TrackObject *_self;
3514 PyObject *_args;
3515{
3516 PyObject *_res = NULL;
3517 OSErr _err;
3518 TimeValue startTime;
3519 TimeValue duration;
3520 if (!PyArg_ParseTuple(_args, "ll",
3521 &startTime,
3522 &duration))
3523 return NULL;
3524 _err = DeleteTrackSegment(_self->ob_itself,
3525 startTime,
3526 duration);
3527 if (_err != noErr) return PyMac_Error(_err);
3528 Py_INCREF(Py_None);
3529 _res = Py_None;
3530 return _res;
3531}
3532
3533static PyObject *TrackObj_ScaleTrackSegment(_self, _args)
3534 TrackObject *_self;
3535 PyObject *_args;
3536{
3537 PyObject *_res = NULL;
3538 OSErr _err;
3539 TimeValue startTime;
3540 TimeValue oldDuration;
3541 TimeValue newDuration;
3542 if (!PyArg_ParseTuple(_args, "lll",
3543 &startTime,
3544 &oldDuration,
3545 &newDuration))
3546 return NULL;
3547 _err = ScaleTrackSegment(_self->ob_itself,
3548 startTime,
3549 oldDuration,
3550 newDuration);
3551 if (_err != noErr) return PyMac_Error(_err);
3552 Py_INCREF(Py_None);
3553 _res = Py_None;
3554 return _res;
3555}
3556
3557static PyObject *TrackObj_IsScrapMovie(_self, _args)
3558 TrackObject *_self;
3559 PyObject *_args;
3560{
3561 PyObject *_res = NULL;
3562 Component _rv;
3563 if (!PyArg_ParseTuple(_args, ""))
3564 return NULL;
3565 _rv = IsScrapMovie(_self->ob_itself);
3566 _res = Py_BuildValue("O&",
3567 CmpObj_New, _rv);
3568 return _res;
3569}
3570
3571static PyObject *TrackObj_CopyTrackSettings(_self, _args)
3572 TrackObject *_self;
3573 PyObject *_args;
3574{
3575 PyObject *_res = NULL;
3576 OSErr _err;
3577 Track dstTrack;
3578 if (!PyArg_ParseTuple(_args, "O&",
3579 TrackObj_Convert, &dstTrack))
3580 return NULL;
3581 _err = CopyTrackSettings(_self->ob_itself,
3582 dstTrack);
3583 if (_err != noErr) return PyMac_Error(_err);
3584 Py_INCREF(Py_None);
3585 _res = Py_None;
3586 return _res;
3587}
3588
3589static PyObject *TrackObj_AddEmptyTrackToMovie(_self, _args)
3590 TrackObject *_self;
3591 PyObject *_args;
3592{
3593 PyObject *_res = NULL;
3594 OSErr _err;
3595 Movie dstMovie;
3596 Handle dataRef;
3597 OSType dataRefType;
3598 Track dstTrack;
3599 if (!PyArg_ParseTuple(_args, "O&O&O&",
3600 MovieObj_Convert, &dstMovie,
3601 ResObj_Convert, &dataRef,
3602 PyMac_GetOSType, &dataRefType))
3603 return NULL;
3604 _err = AddEmptyTrackToMovie(_self->ob_itself,
3605 dstMovie,
3606 dataRef,
3607 dataRefType,
3608 &dstTrack);
3609 if (_err != noErr) return PyMac_Error(_err);
3610 _res = Py_BuildValue("O&",
3611 TrackObj_New, dstTrack);
3612 return _res;
3613}
3614
3615static PyObject *TrackObj_AddTrackReference(_self, _args)
3616 TrackObject *_self;
3617 PyObject *_args;
3618{
3619 PyObject *_res = NULL;
3620 OSErr _err;
3621 Track refTrack;
3622 OSType refType;
3623 long addedIndex;
3624 if (!PyArg_ParseTuple(_args, "O&O&",
3625 TrackObj_Convert, &refTrack,
3626 PyMac_GetOSType, &refType))
3627 return NULL;
3628 _err = AddTrackReference(_self->ob_itself,
3629 refTrack,
3630 refType,
3631 &addedIndex);
3632 if (_err != noErr) return PyMac_Error(_err);
3633 _res = Py_BuildValue("l",
3634 addedIndex);
3635 return _res;
3636}
3637
3638static PyObject *TrackObj_DeleteTrackReference(_self, _args)
3639 TrackObject *_self;
3640 PyObject *_args;
3641{
3642 PyObject *_res = NULL;
3643 OSErr _err;
3644 OSType refType;
3645 long index;
3646 if (!PyArg_ParseTuple(_args, "O&l",
3647 PyMac_GetOSType, &refType,
3648 &index))
3649 return NULL;
3650 _err = DeleteTrackReference(_self->ob_itself,
3651 refType,
3652 index);
3653 if (_err != noErr) return PyMac_Error(_err);
3654 Py_INCREF(Py_None);
3655 _res = Py_None;
3656 return _res;
3657}
3658
3659static PyObject *TrackObj_SetTrackReference(_self, _args)
3660 TrackObject *_self;
3661 PyObject *_args;
3662{
3663 PyObject *_res = NULL;
3664 OSErr _err;
3665 Track refTrack;
3666 OSType refType;
3667 long index;
3668 if (!PyArg_ParseTuple(_args, "O&O&l",
3669 TrackObj_Convert, &refTrack,
3670 PyMac_GetOSType, &refType,
3671 &index))
3672 return NULL;
3673 _err = SetTrackReference(_self->ob_itself,
3674 refTrack,
3675 refType,
3676 index);
3677 if (_err != noErr) return PyMac_Error(_err);
3678 Py_INCREF(Py_None);
3679 _res = Py_None;
3680 return _res;
3681}
3682
3683static PyObject *TrackObj_GetTrackReference(_self, _args)
3684 TrackObject *_self;
3685 PyObject *_args;
3686{
3687 PyObject *_res = NULL;
3688 Track _rv;
3689 OSType refType;
3690 long index;
3691 if (!PyArg_ParseTuple(_args, "O&l",
3692 PyMac_GetOSType, &refType,
3693 &index))
3694 return NULL;
3695 _rv = GetTrackReference(_self->ob_itself,
3696 refType,
3697 index);
3698 _res = Py_BuildValue("O&",
3699 TrackObj_New, _rv);
3700 return _res;
3701}
3702
3703static PyObject *TrackObj_GetNextTrackReferenceType(_self, _args)
3704 TrackObject *_self;
3705 PyObject *_args;
3706{
3707 PyObject *_res = NULL;
3708 OSType _rv;
3709 OSType refType;
3710 if (!PyArg_ParseTuple(_args, "O&",
3711 PyMac_GetOSType, &refType))
3712 return NULL;
3713 _rv = GetNextTrackReferenceType(_self->ob_itself,
3714 refType);
3715 _res = Py_BuildValue("O&",
3716 PyMac_BuildOSType, _rv);
3717 return _res;
3718}
3719
3720static PyObject *TrackObj_GetTrackReferenceCount(_self, _args)
3721 TrackObject *_self;
3722 PyObject *_args;
3723{
3724 PyObject *_res = NULL;
3725 long _rv;
3726 OSType refType;
3727 if (!PyArg_ParseTuple(_args, "O&",
3728 PyMac_GetOSType, &refType))
3729 return NULL;
3730 _rv = GetTrackReferenceCount(_self->ob_itself,
3731 refType);
3732 _res = Py_BuildValue("l",
3733 _rv);
3734 return _res;
3735}
3736
3737static PyObject *TrackObj_GetTrackEditRate(_self, _args)
3738 TrackObject *_self;
3739 PyObject *_args;
3740{
3741 PyObject *_res = NULL;
3742 Fixed _rv;
3743 TimeValue atTime;
3744 if (!PyArg_ParseTuple(_args, "l",
3745 &atTime))
3746 return NULL;
3747 _rv = GetTrackEditRate(_self->ob_itself,
3748 atTime);
3749 _res = Py_BuildValue("O&",
3750 PyMac_BuildFixed, _rv);
3751 return _res;
3752}
3753
3754static PyObject *TrackObj_GetTrackDataSize(_self, _args)
3755 TrackObject *_self;
3756 PyObject *_args;
3757{
3758 PyObject *_res = NULL;
3759 long _rv;
3760 TimeValue startTime;
3761 TimeValue duration;
3762 if (!PyArg_ParseTuple(_args, "ll",
3763 &startTime,
3764 &duration))
3765 return NULL;
3766 _rv = GetTrackDataSize(_self->ob_itself,
3767 startTime,
3768 duration);
3769 _res = Py_BuildValue("l",
3770 _rv);
3771 return _res;
3772}
3773
3774static PyObject *TrackObj_PtInTrack(_self, _args)
3775 TrackObject *_self;
3776 PyObject *_args;
3777{
3778 PyObject *_res = NULL;
3779 Boolean _rv;
3780 Point pt;
3781 if (!PyArg_ParseTuple(_args, "O&",
3782 PyMac_GetPoint, &pt))
3783 return NULL;
3784 _rv = PtInTrack(_self->ob_itself,
3785 pt);
3786 _res = Py_BuildValue("b",
3787 _rv);
3788 return _res;
3789}
3790
3791static PyObject *TrackObj_GetTrackNextInterestingTime(_self, _args)
3792 TrackObject *_self;
3793 PyObject *_args;
3794{
3795 PyObject *_res = NULL;
3796 short interestingTimeFlags;
3797 TimeValue time;
3798 Fixed rate;
3799 TimeValue interestingTime;
3800 TimeValue interestingDuration;
3801 if (!PyArg_ParseTuple(_args, "hlO&",
3802 &interestingTimeFlags,
3803 &time,
3804 PyMac_GetFixed, &rate))
3805 return NULL;
3806 GetTrackNextInterestingTime(_self->ob_itself,
3807 interestingTimeFlags,
3808 time,
3809 rate,
3810 &interestingTime,
3811 &interestingDuration);
3812 _res = Py_BuildValue("ll",
3813 interestingTime,
3814 interestingDuration);
3815 return _res;
3816}
3817
3818static PyObject *TrackObj_GetTrackSegmentDisplayBoundsRgn(_self, _args)
3819 TrackObject *_self;
3820 PyObject *_args;
3821{
3822 PyObject *_res = NULL;
3823 RgnHandle _rv;
3824 TimeValue time;
3825 TimeValue duration;
3826 if (!PyArg_ParseTuple(_args, "ll",
3827 &time,
3828 &duration))
3829 return NULL;
3830 _rv = GetTrackSegmentDisplayBoundsRgn(_self->ob_itself,
3831 time,
3832 duration);
3833 _res = Py_BuildValue("O&",
3834 ResObj_New, _rv);
3835 return _res;
3836}
3837
3838static PyObject *TrackObj_GetTrackStatus(_self, _args)
3839 TrackObject *_self;
3840 PyObject *_args;
3841{
3842 PyObject *_res = NULL;
3843 ComponentResult _rv;
3844 if (!PyArg_ParseTuple(_args, ""))
3845 return NULL;
3846 _rv = GetTrackStatus(_self->ob_itself);
3847 _res = Py_BuildValue("l",
3848 _rv);
3849 return _res;
3850}
3851
3852static PyObject *TrackObj_SetTrackLoadSettings(_self, _args)
3853 TrackObject *_self;
3854 PyObject *_args;
3855{
3856 PyObject *_res = NULL;
3857 TimeValue preloadTime;
3858 TimeValue preloadDuration;
3859 long preloadFlags;
3860 long defaultHints;
3861 if (!PyArg_ParseTuple(_args, "llll",
3862 &preloadTime,
3863 &preloadDuration,
3864 &preloadFlags,
3865 &defaultHints))
3866 return NULL;
3867 SetTrackLoadSettings(_self->ob_itself,
3868 preloadTime,
3869 preloadDuration,
3870 preloadFlags,
3871 defaultHints);
3872 Py_INCREF(Py_None);
3873 _res = Py_None;
3874 return _res;
3875}
3876
3877static PyObject *TrackObj_GetTrackLoadSettings(_self, _args)
3878 TrackObject *_self;
3879 PyObject *_args;
3880{
3881 PyObject *_res = NULL;
3882 TimeValue preloadTime;
3883 TimeValue preloadDuration;
3884 long preloadFlags;
3885 long defaultHints;
3886 if (!PyArg_ParseTuple(_args, ""))
3887 return NULL;
3888 GetTrackLoadSettings(_self->ob_itself,
3889 &preloadTime,
3890 &preloadDuration,
3891 &preloadFlags,
3892 &defaultHints);
3893 _res = Py_BuildValue("llll",
3894 preloadTime,
3895 preloadDuration,
3896 preloadFlags,
3897 defaultHints);
3898 return _res;
3899}
3900
3901static PyMethodDef TrackObj_methods[] = {
3902 {"LoadTrackIntoRam", (PyCFunction)TrackObj_LoadTrackIntoRam, 1,
3903 "(TimeValue time, TimeValue duration, long flags) -> None"},
3904 {"GetTrackPict", (PyCFunction)TrackObj_GetTrackPict, 1,
3905 "(TimeValue time) -> (PicHandle _rv)"},
3906 {"GetTrackClipRgn", (PyCFunction)TrackObj_GetTrackClipRgn, 1,
3907 "() -> (RgnHandle _rv)"},
3908 {"SetTrackClipRgn", (PyCFunction)TrackObj_SetTrackClipRgn, 1,
3909 "(RgnHandle theClip) -> None"},
3910 {"GetTrackDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackDisplayBoundsRgn, 1,
3911 "() -> (RgnHandle _rv)"},
3912 {"GetTrackMovieBoundsRgn", (PyCFunction)TrackObj_GetTrackMovieBoundsRgn, 1,
3913 "() -> (RgnHandle _rv)"},
3914 {"GetTrackBoundsRgn", (PyCFunction)TrackObj_GetTrackBoundsRgn, 1,
3915 "() -> (RgnHandle _rv)"},
3916 {"GetTrackMatte", (PyCFunction)TrackObj_GetTrackMatte, 1,
3917 "() -> (PixMapHandle _rv)"},
3918 {"SetTrackMatte", (PyCFunction)TrackObj_SetTrackMatte, 1,
3919 "(PixMapHandle theMatte) -> None"},
3920 {"GetTrackID", (PyCFunction)TrackObj_GetTrackID, 1,
3921 "() -> (long _rv)"},
3922 {"GetTrackMovie", (PyCFunction)TrackObj_GetTrackMovie, 1,
3923 "() -> (Movie _rv)"},
Jack Jansene0cf87b1997-04-09 15:53:46 +00003924 {"GetTrackCreationTime", (PyCFunction)TrackObj_GetTrackCreationTime, 1,
3925 "() -> (unsigned long _rv)"},
3926 {"GetTrackModificationTime", (PyCFunction)TrackObj_GetTrackModificationTime, 1,
3927 "() -> (unsigned long _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00003928 {"GetTrackEnabled", (PyCFunction)TrackObj_GetTrackEnabled, 1,
3929 "() -> (Boolean _rv)"},
3930 {"SetTrackEnabled", (PyCFunction)TrackObj_SetTrackEnabled, 1,
3931 "(Boolean isEnabled) -> None"},
3932 {"GetTrackUsage", (PyCFunction)TrackObj_GetTrackUsage, 1,
3933 "() -> (long _rv)"},
3934 {"SetTrackUsage", (PyCFunction)TrackObj_SetTrackUsage, 1,
3935 "(long usage) -> None"},
3936 {"GetTrackDuration", (PyCFunction)TrackObj_GetTrackDuration, 1,
3937 "() -> (TimeValue _rv)"},
3938 {"GetTrackOffset", (PyCFunction)TrackObj_GetTrackOffset, 1,
3939 "() -> (TimeValue _rv)"},
3940 {"SetTrackOffset", (PyCFunction)TrackObj_SetTrackOffset, 1,
3941 "(TimeValue movieOffsetTime) -> None"},
3942 {"GetTrackLayer", (PyCFunction)TrackObj_GetTrackLayer, 1,
3943 "() -> (short _rv)"},
3944 {"SetTrackLayer", (PyCFunction)TrackObj_SetTrackLayer, 1,
3945 "(short layer) -> None"},
3946 {"GetTrackAlternate", (PyCFunction)TrackObj_GetTrackAlternate, 1,
3947 "() -> (Track _rv)"},
3948 {"SetTrackAlternate", (PyCFunction)TrackObj_SetTrackAlternate, 1,
3949 "(Track alternateT) -> None"},
3950 {"GetTrackVolume", (PyCFunction)TrackObj_GetTrackVolume, 1,
3951 "() -> (short _rv)"},
3952 {"SetTrackVolume", (PyCFunction)TrackObj_SetTrackVolume, 1,
3953 "(short volume) -> None"},
3954 {"GetTrackDimensions", (PyCFunction)TrackObj_GetTrackDimensions, 1,
3955 "() -> (Fixed width, Fixed height)"},
3956 {"SetTrackDimensions", (PyCFunction)TrackObj_SetTrackDimensions, 1,
3957 "(Fixed width, Fixed height) -> None"},
3958 {"GetTrackUserData", (PyCFunction)TrackObj_GetTrackUserData, 1,
3959 "() -> (UserData _rv)"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00003960 {"GetTrackSoundLocalizationSettings", (PyCFunction)TrackObj_GetTrackSoundLocalizationSettings, 1,
3961 "() -> (Handle settings)"},
3962 {"SetTrackSoundLocalizationSettings", (PyCFunction)TrackObj_SetTrackSoundLocalizationSettings, 1,
3963 "(Handle settings) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00003964 {"NewTrackMedia", (PyCFunction)TrackObj_NewTrackMedia, 1,
3965 "(OSType mediaType, TimeScale timeScale, Handle dataRef, OSType dataRefType) -> (Media _rv)"},
3966 {"GetTrackMedia", (PyCFunction)TrackObj_GetTrackMedia, 1,
3967 "() -> (Media _rv)"},
3968 {"InsertMediaIntoTrack", (PyCFunction)TrackObj_InsertMediaIntoTrack, 1,
3969 "(TimeValue trackStart, TimeValue mediaTime, TimeValue mediaDuration, Fixed mediaRate) -> None"},
3970 {"InsertTrackSegment", (PyCFunction)TrackObj_InsertTrackSegment, 1,
3971 "(Track dstTrack, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
3972 {"InsertEmptyTrackSegment", (PyCFunction)TrackObj_InsertEmptyTrackSegment, 1,
3973 "(TimeValue dstIn, TimeValue dstDuration) -> None"},
3974 {"DeleteTrackSegment", (PyCFunction)TrackObj_DeleteTrackSegment, 1,
3975 "(TimeValue startTime, TimeValue duration) -> None"},
3976 {"ScaleTrackSegment", (PyCFunction)TrackObj_ScaleTrackSegment, 1,
3977 "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
3978 {"IsScrapMovie", (PyCFunction)TrackObj_IsScrapMovie, 1,
3979 "() -> (Component _rv)"},
3980 {"CopyTrackSettings", (PyCFunction)TrackObj_CopyTrackSettings, 1,
3981 "(Track dstTrack) -> None"},
3982 {"AddEmptyTrackToMovie", (PyCFunction)TrackObj_AddEmptyTrackToMovie, 1,
3983 "(Movie dstMovie, Handle dataRef, OSType dataRefType) -> (Track dstTrack)"},
3984 {"AddTrackReference", (PyCFunction)TrackObj_AddTrackReference, 1,
3985 "(Track refTrack, OSType refType) -> (long addedIndex)"},
3986 {"DeleteTrackReference", (PyCFunction)TrackObj_DeleteTrackReference, 1,
3987 "(OSType refType, long index) -> None"},
3988 {"SetTrackReference", (PyCFunction)TrackObj_SetTrackReference, 1,
3989 "(Track refTrack, OSType refType, long index) -> None"},
3990 {"GetTrackReference", (PyCFunction)TrackObj_GetTrackReference, 1,
3991 "(OSType refType, long index) -> (Track _rv)"},
3992 {"GetNextTrackReferenceType", (PyCFunction)TrackObj_GetNextTrackReferenceType, 1,
3993 "(OSType refType) -> (OSType _rv)"},
3994 {"GetTrackReferenceCount", (PyCFunction)TrackObj_GetTrackReferenceCount, 1,
3995 "(OSType refType) -> (long _rv)"},
3996 {"GetTrackEditRate", (PyCFunction)TrackObj_GetTrackEditRate, 1,
3997 "(TimeValue atTime) -> (Fixed _rv)"},
3998 {"GetTrackDataSize", (PyCFunction)TrackObj_GetTrackDataSize, 1,
3999 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
4000 {"PtInTrack", (PyCFunction)TrackObj_PtInTrack, 1,
4001 "(Point pt) -> (Boolean _rv)"},
4002 {"GetTrackNextInterestingTime", (PyCFunction)TrackObj_GetTrackNextInterestingTime, 1,
4003 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
4004 {"GetTrackSegmentDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackSegmentDisplayBoundsRgn, 1,
4005 "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
4006 {"GetTrackStatus", (PyCFunction)TrackObj_GetTrackStatus, 1,
4007 "() -> (ComponentResult _rv)"},
4008 {"SetTrackLoadSettings", (PyCFunction)TrackObj_SetTrackLoadSettings, 1,
4009 "(TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints) -> None"},
4010 {"GetTrackLoadSettings", (PyCFunction)TrackObj_GetTrackLoadSettings, 1,
4011 "() -> (TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints)"},
4012 {NULL, NULL, 0}
4013};
4014
4015PyMethodChain TrackObj_chain = { TrackObj_methods, NULL };
4016
4017static PyObject *TrackObj_getattr(self, name)
4018 TrackObject *self;
4019 char *name;
4020{
4021 return Py_FindMethodInChain(&TrackObj_chain, (PyObject *)self, name);
4022}
4023
4024#define TrackObj_setattr NULL
4025
Jack Jansena05ac601999-12-12 21:41:51 +00004026#define TrackObj_compare NULL
4027
4028#define TrackObj_repr NULL
4029
4030#define TrackObj_hash NULL
4031
Jack Jansen453ced51995-11-30 17:42:08 +00004032PyTypeObject Track_Type = {
4033 PyObject_HEAD_INIT(&PyType_Type)
4034 0, /*ob_size*/
4035 "Track", /*tp_name*/
4036 sizeof(TrackObject), /*tp_basicsize*/
4037 0, /*tp_itemsize*/
4038 /* methods */
4039 (destructor) TrackObj_dealloc, /*tp_dealloc*/
4040 0, /*tp_print*/
4041 (getattrfunc) TrackObj_getattr, /*tp_getattr*/
4042 (setattrfunc) TrackObj_setattr, /*tp_setattr*/
Jack Jansena05ac601999-12-12 21:41:51 +00004043 (cmpfunc) TrackObj_compare, /*tp_compare*/
4044 (reprfunc) TrackObj_repr, /*tp_repr*/
4045 (PyNumberMethods *)0, /* tp_as_number */
4046 (PySequenceMethods *)0, /* tp_as_sequence */
4047 (PyMappingMethods *)0, /* tp_as_mapping */
4048 (hashfunc) TrackObj_hash, /*tp_hash*/
Jack Jansen453ced51995-11-30 17:42:08 +00004049};
4050
4051/* --------------------- End object type Track ---------------------- */
4052
4053
4054/* ----------------------- Object type Movie ------------------------ */
4055
4056PyTypeObject Movie_Type;
4057
4058#define MovieObj_Check(x) ((x)->ob_type == &Movie_Type)
4059
4060typedef struct MovieObject {
4061 PyObject_HEAD
4062 Movie ob_itself;
4063} MovieObject;
4064
4065PyObject *MovieObj_New(itself)
4066 Movie itself;
4067{
4068 MovieObject *it;
4069 if (itself == NULL) {
4070 PyErr_SetString(Qt_Error,"Cannot create null Movie");
4071 return NULL;
4072 }
4073 it = PyObject_NEW(MovieObject, &Movie_Type);
4074 if (it == NULL) return NULL;
4075 it->ob_itself = itself;
4076 return (PyObject *)it;
4077}
4078MovieObj_Convert(v, p_itself)
4079 PyObject *v;
4080 Movie *p_itself;
4081{
4082 if (!MovieObj_Check(v))
4083 {
4084 PyErr_SetString(PyExc_TypeError, "Movie required");
4085 return 0;
4086 }
4087 *p_itself = ((MovieObject *)v)->ob_itself;
4088 return 1;
4089}
4090
4091static void MovieObj_dealloc(self)
4092 MovieObject *self;
4093{
4094 DisposeMovie(self->ob_itself);
4095 PyMem_DEL(self);
4096}
4097
4098static PyObject *MovieObj_MoviesTask(_self, _args)
4099 MovieObject *_self;
4100 PyObject *_args;
4101{
4102 PyObject *_res = NULL;
4103 long maxMilliSecToUse;
4104 if (!PyArg_ParseTuple(_args, "l",
4105 &maxMilliSecToUse))
4106 return NULL;
4107 MoviesTask(_self->ob_itself,
4108 maxMilliSecToUse);
4109 Py_INCREF(Py_None);
4110 _res = Py_None;
4111 return _res;
4112}
4113
4114static PyObject *MovieObj_PrerollMovie(_self, _args)
4115 MovieObject *_self;
4116 PyObject *_args;
4117{
4118 PyObject *_res = NULL;
4119 OSErr _err;
4120 TimeValue time;
4121 Fixed Rate;
4122 if (!PyArg_ParseTuple(_args, "lO&",
4123 &time,
4124 PyMac_GetFixed, &Rate))
4125 return NULL;
4126 _err = PrerollMovie(_self->ob_itself,
4127 time,
4128 Rate);
4129 if (_err != noErr) return PyMac_Error(_err);
4130 Py_INCREF(Py_None);
4131 _res = Py_None;
4132 return _res;
4133}
4134
4135static PyObject *MovieObj_LoadMovieIntoRam(_self, _args)
4136 MovieObject *_self;
4137 PyObject *_args;
4138{
4139 PyObject *_res = NULL;
4140 OSErr _err;
4141 TimeValue time;
4142 TimeValue duration;
4143 long flags;
4144 if (!PyArg_ParseTuple(_args, "lll",
4145 &time,
4146 &duration,
4147 &flags))
4148 return NULL;
4149 _err = LoadMovieIntoRam(_self->ob_itself,
4150 time,
4151 duration,
4152 flags);
4153 if (_err != noErr) return PyMac_Error(_err);
4154 Py_INCREF(Py_None);
4155 _res = Py_None;
4156 return _res;
4157}
4158
4159static PyObject *MovieObj_SetMovieActive(_self, _args)
4160 MovieObject *_self;
4161 PyObject *_args;
4162{
4163 PyObject *_res = NULL;
4164 Boolean active;
4165 if (!PyArg_ParseTuple(_args, "b",
4166 &active))
4167 return NULL;
4168 SetMovieActive(_self->ob_itself,
4169 active);
4170 Py_INCREF(Py_None);
4171 _res = Py_None;
4172 return _res;
4173}
4174
4175static PyObject *MovieObj_GetMovieActive(_self, _args)
4176 MovieObject *_self;
4177 PyObject *_args;
4178{
4179 PyObject *_res = NULL;
4180 Boolean _rv;
4181 if (!PyArg_ParseTuple(_args, ""))
4182 return NULL;
4183 _rv = GetMovieActive(_self->ob_itself);
4184 _res = Py_BuildValue("b",
4185 _rv);
4186 return _res;
4187}
4188
4189static PyObject *MovieObj_StartMovie(_self, _args)
4190 MovieObject *_self;
4191 PyObject *_args;
4192{
4193 PyObject *_res = NULL;
4194 if (!PyArg_ParseTuple(_args, ""))
4195 return NULL;
4196 StartMovie(_self->ob_itself);
4197 Py_INCREF(Py_None);
4198 _res = Py_None;
4199 return _res;
4200}
4201
4202static PyObject *MovieObj_StopMovie(_self, _args)
4203 MovieObject *_self;
4204 PyObject *_args;
4205{
4206 PyObject *_res = NULL;
4207 if (!PyArg_ParseTuple(_args, ""))
4208 return NULL;
4209 StopMovie(_self->ob_itself);
4210 Py_INCREF(Py_None);
4211 _res = Py_None;
4212 return _res;
4213}
4214
4215static PyObject *MovieObj_GoToBeginningOfMovie(_self, _args)
4216 MovieObject *_self;
4217 PyObject *_args;
4218{
4219 PyObject *_res = NULL;
4220 if (!PyArg_ParseTuple(_args, ""))
4221 return NULL;
4222 GoToBeginningOfMovie(_self->ob_itself);
4223 Py_INCREF(Py_None);
4224 _res = Py_None;
4225 return _res;
4226}
4227
4228static PyObject *MovieObj_GoToEndOfMovie(_self, _args)
4229 MovieObject *_self;
4230 PyObject *_args;
4231{
4232 PyObject *_res = NULL;
4233 if (!PyArg_ParseTuple(_args, ""))
4234 return NULL;
4235 GoToEndOfMovie(_self->ob_itself);
4236 Py_INCREF(Py_None);
4237 _res = Py_None;
4238 return _res;
4239}
4240
4241static PyObject *MovieObj_IsMovieDone(_self, _args)
4242 MovieObject *_self;
4243 PyObject *_args;
4244{
4245 PyObject *_res = NULL;
4246 Boolean _rv;
4247 if (!PyArg_ParseTuple(_args, ""))
4248 return NULL;
4249 _rv = IsMovieDone(_self->ob_itself);
4250 _res = Py_BuildValue("b",
4251 _rv);
4252 return _res;
4253}
4254
4255static PyObject *MovieObj_GetMoviePreviewMode(_self, _args)
4256 MovieObject *_self;
4257 PyObject *_args;
4258{
4259 PyObject *_res = NULL;
4260 Boolean _rv;
4261 if (!PyArg_ParseTuple(_args, ""))
4262 return NULL;
4263 _rv = GetMoviePreviewMode(_self->ob_itself);
4264 _res = Py_BuildValue("b",
4265 _rv);
4266 return _res;
4267}
4268
4269static PyObject *MovieObj_SetMoviePreviewMode(_self, _args)
4270 MovieObject *_self;
4271 PyObject *_args;
4272{
4273 PyObject *_res = NULL;
4274 Boolean usePreview;
4275 if (!PyArg_ParseTuple(_args, "b",
4276 &usePreview))
4277 return NULL;
4278 SetMoviePreviewMode(_self->ob_itself,
4279 usePreview);
4280 Py_INCREF(Py_None);
4281 _res = Py_None;
4282 return _res;
4283}
4284
4285static PyObject *MovieObj_ShowMoviePoster(_self, _args)
4286 MovieObject *_self;
4287 PyObject *_args;
4288{
4289 PyObject *_res = NULL;
4290 if (!PyArg_ParseTuple(_args, ""))
4291 return NULL;
4292 ShowMoviePoster(_self->ob_itself);
4293 Py_INCREF(Py_None);
4294 _res = Py_None;
4295 return _res;
4296}
4297
4298static PyObject *MovieObj_GetMovieTimeBase(_self, _args)
4299 MovieObject *_self;
4300 PyObject *_args;
4301{
4302 PyObject *_res = NULL;
4303 TimeBase _rv;
4304 if (!PyArg_ParseTuple(_args, ""))
4305 return NULL;
4306 _rv = GetMovieTimeBase(_self->ob_itself);
4307 _res = Py_BuildValue("O&",
4308 TimeBaseObj_New, _rv);
4309 return _res;
4310}
4311
Jack Jansenb2006391998-04-23 13:22:44 +00004312static PyObject *MovieObj_SetMovieMasterTimeBase(_self, _args)
4313 MovieObject *_self;
4314 PyObject *_args;
4315{
4316 PyObject *_res = NULL;
4317 TimeBase tb;
4318 TimeRecord slaveZero;
4319 if (!PyArg_ParseTuple(_args, "O&O&",
4320 TimeBaseObj_Convert, &tb,
4321 QtTimeRecord_Convert, &slaveZero))
4322 return NULL;
4323 SetMovieMasterTimeBase(_self->ob_itself,
4324 tb,
4325 &slaveZero);
4326 Py_INCREF(Py_None);
4327 _res = Py_None;
4328 return _res;
4329}
4330
4331static PyObject *MovieObj_SetMovieMasterClock(_self, _args)
4332 MovieObject *_self;
4333 PyObject *_args;
4334{
4335 PyObject *_res = NULL;
4336 Component clockMeister;
4337 TimeRecord slaveZero;
4338 if (!PyArg_ParseTuple(_args, "O&O&",
4339 CmpObj_Convert, &clockMeister,
4340 QtTimeRecord_Convert, &slaveZero))
4341 return NULL;
4342 SetMovieMasterClock(_self->ob_itself,
4343 clockMeister,
4344 &slaveZero);
4345 Py_INCREF(Py_None);
4346 _res = Py_None;
4347 return _res;
4348}
4349
Jack Jansene0cf87b1997-04-09 15:53:46 +00004350static PyObject *MovieObj_GetMovieGWorld(_self, _args)
4351 MovieObject *_self;
4352 PyObject *_args;
4353{
4354 PyObject *_res = NULL;
4355 CGrafPtr port;
4356 GDHandle gdh;
4357 if (!PyArg_ParseTuple(_args, ""))
4358 return NULL;
4359 GetMovieGWorld(_self->ob_itself,
4360 &port,
4361 &gdh);
4362 _res = Py_BuildValue("O&O&",
4363 GrafObj_New, port,
Jack Jansend81fc3c1998-07-22 13:37:37 +00004364 OptResObj_New, gdh);
Jack Jansene0cf87b1997-04-09 15:53:46 +00004365 return _res;
4366}
4367
4368static PyObject *MovieObj_SetMovieGWorld(_self, _args)
4369 MovieObject *_self;
4370 PyObject *_args;
4371{
4372 PyObject *_res = NULL;
4373 CGrafPtr port;
4374 GDHandle gdh;
4375 if (!PyArg_ParseTuple(_args, "O&O&",
4376 GrafObj_Convert, &port,
Jack Jansend81fc3c1998-07-22 13:37:37 +00004377 OptResObj_Convert, &gdh))
Jack Jansene0cf87b1997-04-09 15:53:46 +00004378 return NULL;
4379 SetMovieGWorld(_self->ob_itself,
4380 port,
4381 gdh);
4382 Py_INCREF(Py_None);
4383 _res = Py_None;
4384 return _res;
4385}
4386
Jack Jansen1c4e6141998-04-21 15:23:55 +00004387static PyObject *MovieObj_GetMovieNaturalBoundsRect(_self, _args)
4388 MovieObject *_self;
4389 PyObject *_args;
4390{
4391 PyObject *_res = NULL;
4392 Rect naturalBounds;
4393 if (!PyArg_ParseTuple(_args, ""))
4394 return NULL;
4395 GetMovieNaturalBoundsRect(_self->ob_itself,
4396 &naturalBounds);
4397 _res = Py_BuildValue("O&",
4398 PyMac_BuildRect, &naturalBounds);
4399 return _res;
4400}
4401
Jack Jansen453ced51995-11-30 17:42:08 +00004402static PyObject *MovieObj_GetNextTrackForCompositing(_self, _args)
4403 MovieObject *_self;
4404 PyObject *_args;
4405{
4406 PyObject *_res = NULL;
4407 Track _rv;
4408 Track theTrack;
4409 if (!PyArg_ParseTuple(_args, "O&",
4410 TrackObj_Convert, &theTrack))
4411 return NULL;
4412 _rv = GetNextTrackForCompositing(_self->ob_itself,
4413 theTrack);
4414 _res = Py_BuildValue("O&",
4415 TrackObj_New, _rv);
4416 return _res;
4417}
4418
4419static PyObject *MovieObj_GetPrevTrackForCompositing(_self, _args)
4420 MovieObject *_self;
4421 PyObject *_args;
4422{
4423 PyObject *_res = NULL;
4424 Track _rv;
4425 Track theTrack;
4426 if (!PyArg_ParseTuple(_args, "O&",
4427 TrackObj_Convert, &theTrack))
4428 return NULL;
4429 _rv = GetPrevTrackForCompositing(_self->ob_itself,
4430 theTrack);
4431 _res = Py_BuildValue("O&",
4432 TrackObj_New, _rv);
4433 return _res;
4434}
4435
4436static PyObject *MovieObj_GetMoviePict(_self, _args)
4437 MovieObject *_self;
4438 PyObject *_args;
4439{
4440 PyObject *_res = NULL;
4441 PicHandle _rv;
4442 TimeValue time;
4443 if (!PyArg_ParseTuple(_args, "l",
4444 &time))
4445 return NULL;
4446 _rv = GetMoviePict(_self->ob_itself,
4447 time);
4448 _res = Py_BuildValue("O&",
4449 ResObj_New, _rv);
4450 return _res;
4451}
4452
4453static PyObject *MovieObj_GetMoviePosterPict(_self, _args)
4454 MovieObject *_self;
4455 PyObject *_args;
4456{
4457 PyObject *_res = NULL;
4458 PicHandle _rv;
4459 if (!PyArg_ParseTuple(_args, ""))
4460 return NULL;
4461 _rv = GetMoviePosterPict(_self->ob_itself);
4462 _res = Py_BuildValue("O&",
4463 ResObj_New, _rv);
4464 return _res;
4465}
4466
4467static PyObject *MovieObj_UpdateMovie(_self, _args)
4468 MovieObject *_self;
4469 PyObject *_args;
4470{
4471 PyObject *_res = NULL;
4472 OSErr _err;
4473 if (!PyArg_ParseTuple(_args, ""))
4474 return NULL;
4475 _err = UpdateMovie(_self->ob_itself);
4476 if (_err != noErr) return PyMac_Error(_err);
4477 Py_INCREF(Py_None);
4478 _res = Py_None;
4479 return _res;
4480}
4481
Jack Jansen1c4e6141998-04-21 15:23:55 +00004482static PyObject *MovieObj_InvalidateMovieRegion(_self, _args)
4483 MovieObject *_self;
4484 PyObject *_args;
4485{
4486 PyObject *_res = NULL;
4487 OSErr _err;
4488 RgnHandle invalidRgn;
4489 if (!PyArg_ParseTuple(_args, "O&",
4490 ResObj_Convert, &invalidRgn))
4491 return NULL;
4492 _err = InvalidateMovieRegion(_self->ob_itself,
4493 invalidRgn);
4494 if (_err != noErr) return PyMac_Error(_err);
4495 Py_INCREF(Py_None);
4496 _res = Py_None;
4497 return _res;
4498}
4499
Jack Jansen453ced51995-11-30 17:42:08 +00004500static PyObject *MovieObj_GetMovieBox(_self, _args)
4501 MovieObject *_self;
4502 PyObject *_args;
4503{
4504 PyObject *_res = NULL;
4505 Rect boxRect;
4506 if (!PyArg_ParseTuple(_args, ""))
4507 return NULL;
4508 GetMovieBox(_self->ob_itself,
4509 &boxRect);
4510 _res = Py_BuildValue("O&",
4511 PyMac_BuildRect, &boxRect);
4512 return _res;
4513}
4514
4515static PyObject *MovieObj_SetMovieBox(_self, _args)
4516 MovieObject *_self;
4517 PyObject *_args;
4518{
4519 PyObject *_res = NULL;
4520 Rect boxRect;
4521 if (!PyArg_ParseTuple(_args, "O&",
4522 PyMac_GetRect, &boxRect))
4523 return NULL;
4524 SetMovieBox(_self->ob_itself,
4525 &boxRect);
4526 Py_INCREF(Py_None);
4527 _res = Py_None;
4528 return _res;
4529}
4530
4531static PyObject *MovieObj_GetMovieDisplayClipRgn(_self, _args)
4532 MovieObject *_self;
4533 PyObject *_args;
4534{
4535 PyObject *_res = NULL;
4536 RgnHandle _rv;
4537 if (!PyArg_ParseTuple(_args, ""))
4538 return NULL;
4539 _rv = GetMovieDisplayClipRgn(_self->ob_itself);
4540 _res = Py_BuildValue("O&",
4541 ResObj_New, _rv);
4542 return _res;
4543}
4544
4545static PyObject *MovieObj_SetMovieDisplayClipRgn(_self, _args)
4546 MovieObject *_self;
4547 PyObject *_args;
4548{
4549 PyObject *_res = NULL;
4550 RgnHandle theClip;
4551 if (!PyArg_ParseTuple(_args, "O&",
4552 ResObj_Convert, &theClip))
4553 return NULL;
4554 SetMovieDisplayClipRgn(_self->ob_itself,
4555 theClip);
4556 Py_INCREF(Py_None);
4557 _res = Py_None;
4558 return _res;
4559}
4560
4561static PyObject *MovieObj_GetMovieClipRgn(_self, _args)
4562 MovieObject *_self;
4563 PyObject *_args;
4564{
4565 PyObject *_res = NULL;
4566 RgnHandle _rv;
4567 if (!PyArg_ParseTuple(_args, ""))
4568 return NULL;
4569 _rv = GetMovieClipRgn(_self->ob_itself);
4570 _res = Py_BuildValue("O&",
4571 ResObj_New, _rv);
4572 return _res;
4573}
4574
4575static PyObject *MovieObj_SetMovieClipRgn(_self, _args)
4576 MovieObject *_self;
4577 PyObject *_args;
4578{
4579 PyObject *_res = NULL;
4580 RgnHandle theClip;
4581 if (!PyArg_ParseTuple(_args, "O&",
4582 ResObj_Convert, &theClip))
4583 return NULL;
4584 SetMovieClipRgn(_self->ob_itself,
4585 theClip);
4586 Py_INCREF(Py_None);
4587 _res = Py_None;
4588 return _res;
4589}
4590
4591static PyObject *MovieObj_GetMovieDisplayBoundsRgn(_self, _args)
4592 MovieObject *_self;
4593 PyObject *_args;
4594{
4595 PyObject *_res = NULL;
4596 RgnHandle _rv;
4597 if (!PyArg_ParseTuple(_args, ""))
4598 return NULL;
4599 _rv = GetMovieDisplayBoundsRgn(_self->ob_itself);
4600 _res = Py_BuildValue("O&",
4601 ResObj_New, _rv);
4602 return _res;
4603}
4604
4605static PyObject *MovieObj_GetMovieBoundsRgn(_self, _args)
4606 MovieObject *_self;
4607 PyObject *_args;
4608{
4609 PyObject *_res = NULL;
4610 RgnHandle _rv;
4611 if (!PyArg_ParseTuple(_args, ""))
4612 return NULL;
4613 _rv = GetMovieBoundsRgn(_self->ob_itself);
4614 _res = Py_BuildValue("O&",
4615 ResObj_New, _rv);
4616 return _res;
4617}
4618
4619static PyObject *MovieObj_PutMovieIntoHandle(_self, _args)
4620 MovieObject *_self;
4621 PyObject *_args;
4622{
4623 PyObject *_res = NULL;
4624 OSErr _err;
4625 Handle publicMovie;
4626 if (!PyArg_ParseTuple(_args, "O&",
4627 ResObj_Convert, &publicMovie))
4628 return NULL;
4629 _err = PutMovieIntoHandle(_self->ob_itself,
4630 publicMovie);
4631 if (_err != noErr) return PyMac_Error(_err);
4632 Py_INCREF(Py_None);
4633 _res = Py_None;
4634 return _res;
4635}
4636
4637static PyObject *MovieObj_PutMovieIntoDataFork(_self, _args)
4638 MovieObject *_self;
4639 PyObject *_args;
4640{
4641 PyObject *_res = NULL;
4642 OSErr _err;
4643 short fRefNum;
4644 long offset;
4645 long maxSize;
4646 if (!PyArg_ParseTuple(_args, "hll",
4647 &fRefNum,
4648 &offset,
4649 &maxSize))
4650 return NULL;
4651 _err = PutMovieIntoDataFork(_self->ob_itself,
4652 fRefNum,
4653 offset,
4654 maxSize);
4655 if (_err != noErr) return PyMac_Error(_err);
4656 Py_INCREF(Py_None);
4657 _res = Py_None;
4658 return _res;
4659}
4660
Jack Jansene0cf87b1997-04-09 15:53:46 +00004661static PyObject *MovieObj_GetMovieCreationTime(_self, _args)
4662 MovieObject *_self;
4663 PyObject *_args;
4664{
4665 PyObject *_res = NULL;
4666 unsigned long _rv;
4667 if (!PyArg_ParseTuple(_args, ""))
4668 return NULL;
4669 _rv = GetMovieCreationTime(_self->ob_itself);
4670 _res = Py_BuildValue("l",
4671 _rv);
4672 return _res;
4673}
4674
4675static PyObject *MovieObj_GetMovieModificationTime(_self, _args)
4676 MovieObject *_self;
4677 PyObject *_args;
4678{
4679 PyObject *_res = NULL;
4680 unsigned long _rv;
4681 if (!PyArg_ParseTuple(_args, ""))
4682 return NULL;
4683 _rv = GetMovieModificationTime(_self->ob_itself);
4684 _res = Py_BuildValue("l",
4685 _rv);
4686 return _res;
4687}
4688
Jack Jansen453ced51995-11-30 17:42:08 +00004689static PyObject *MovieObj_GetMovieTimeScale(_self, _args)
4690 MovieObject *_self;
4691 PyObject *_args;
4692{
4693 PyObject *_res = NULL;
4694 TimeScale _rv;
4695 if (!PyArg_ParseTuple(_args, ""))
4696 return NULL;
4697 _rv = GetMovieTimeScale(_self->ob_itself);
4698 _res = Py_BuildValue("l",
4699 _rv);
4700 return _res;
4701}
4702
4703static PyObject *MovieObj_SetMovieTimeScale(_self, _args)
4704 MovieObject *_self;
4705 PyObject *_args;
4706{
4707 PyObject *_res = NULL;
4708 TimeScale timeScale;
4709 if (!PyArg_ParseTuple(_args, "l",
4710 &timeScale))
4711 return NULL;
4712 SetMovieTimeScale(_self->ob_itself,
4713 timeScale);
4714 Py_INCREF(Py_None);
4715 _res = Py_None;
4716 return _res;
4717}
4718
4719static PyObject *MovieObj_GetMovieDuration(_self, _args)
4720 MovieObject *_self;
4721 PyObject *_args;
4722{
4723 PyObject *_res = NULL;
4724 TimeValue _rv;
4725 if (!PyArg_ParseTuple(_args, ""))
4726 return NULL;
4727 _rv = GetMovieDuration(_self->ob_itself);
4728 _res = Py_BuildValue("l",
4729 _rv);
4730 return _res;
4731}
4732
4733static PyObject *MovieObj_GetMovieRate(_self, _args)
4734 MovieObject *_self;
4735 PyObject *_args;
4736{
4737 PyObject *_res = NULL;
4738 Fixed _rv;
4739 if (!PyArg_ParseTuple(_args, ""))
4740 return NULL;
4741 _rv = GetMovieRate(_self->ob_itself);
4742 _res = Py_BuildValue("O&",
4743 PyMac_BuildFixed, _rv);
4744 return _res;
4745}
4746
4747static PyObject *MovieObj_SetMovieRate(_self, _args)
4748 MovieObject *_self;
4749 PyObject *_args;
4750{
4751 PyObject *_res = NULL;
4752 Fixed rate;
4753 if (!PyArg_ParseTuple(_args, "O&",
4754 PyMac_GetFixed, &rate))
4755 return NULL;
4756 SetMovieRate(_self->ob_itself,
4757 rate);
4758 Py_INCREF(Py_None);
4759 _res = Py_None;
4760 return _res;
4761}
4762
4763static PyObject *MovieObj_GetMoviePreferredRate(_self, _args)
4764 MovieObject *_self;
4765 PyObject *_args;
4766{
4767 PyObject *_res = NULL;
4768 Fixed _rv;
4769 if (!PyArg_ParseTuple(_args, ""))
4770 return NULL;
4771 _rv = GetMoviePreferredRate(_self->ob_itself);
4772 _res = Py_BuildValue("O&",
4773 PyMac_BuildFixed, _rv);
4774 return _res;
4775}
4776
4777static PyObject *MovieObj_SetMoviePreferredRate(_self, _args)
4778 MovieObject *_self;
4779 PyObject *_args;
4780{
4781 PyObject *_res = NULL;
4782 Fixed rate;
4783 if (!PyArg_ParseTuple(_args, "O&",
4784 PyMac_GetFixed, &rate))
4785 return NULL;
4786 SetMoviePreferredRate(_self->ob_itself,
4787 rate);
4788 Py_INCREF(Py_None);
4789 _res = Py_None;
4790 return _res;
4791}
4792
4793static PyObject *MovieObj_GetMoviePreferredVolume(_self, _args)
4794 MovieObject *_self;
4795 PyObject *_args;
4796{
4797 PyObject *_res = NULL;
4798 short _rv;
4799 if (!PyArg_ParseTuple(_args, ""))
4800 return NULL;
4801 _rv = GetMoviePreferredVolume(_self->ob_itself);
4802 _res = Py_BuildValue("h",
4803 _rv);
4804 return _res;
4805}
4806
4807static PyObject *MovieObj_SetMoviePreferredVolume(_self, _args)
4808 MovieObject *_self;
4809 PyObject *_args;
4810{
4811 PyObject *_res = NULL;
4812 short volume;
4813 if (!PyArg_ParseTuple(_args, "h",
4814 &volume))
4815 return NULL;
4816 SetMoviePreferredVolume(_self->ob_itself,
4817 volume);
4818 Py_INCREF(Py_None);
4819 _res = Py_None;
4820 return _res;
4821}
4822
4823static PyObject *MovieObj_GetMovieVolume(_self, _args)
4824 MovieObject *_self;
4825 PyObject *_args;
4826{
4827 PyObject *_res = NULL;
4828 short _rv;
4829 if (!PyArg_ParseTuple(_args, ""))
4830 return NULL;
4831 _rv = GetMovieVolume(_self->ob_itself);
4832 _res = Py_BuildValue("h",
4833 _rv);
4834 return _res;
4835}
4836
4837static PyObject *MovieObj_SetMovieVolume(_self, _args)
4838 MovieObject *_self;
4839 PyObject *_args;
4840{
4841 PyObject *_res = NULL;
4842 short volume;
4843 if (!PyArg_ParseTuple(_args, "h",
4844 &volume))
4845 return NULL;
4846 SetMovieVolume(_self->ob_itself,
4847 volume);
4848 Py_INCREF(Py_None);
4849 _res = Py_None;
4850 return _res;
4851}
4852
4853static PyObject *MovieObj_GetMoviePreviewTime(_self, _args)
4854 MovieObject *_self;
4855 PyObject *_args;
4856{
4857 PyObject *_res = NULL;
4858 TimeValue previewTime;
4859 TimeValue previewDuration;
4860 if (!PyArg_ParseTuple(_args, ""))
4861 return NULL;
4862 GetMoviePreviewTime(_self->ob_itself,
4863 &previewTime,
4864 &previewDuration);
4865 _res = Py_BuildValue("ll",
4866 previewTime,
4867 previewDuration);
4868 return _res;
4869}
4870
4871static PyObject *MovieObj_SetMoviePreviewTime(_self, _args)
4872 MovieObject *_self;
4873 PyObject *_args;
4874{
4875 PyObject *_res = NULL;
4876 TimeValue previewTime;
4877 TimeValue previewDuration;
4878 if (!PyArg_ParseTuple(_args, "ll",
4879 &previewTime,
4880 &previewDuration))
4881 return NULL;
4882 SetMoviePreviewTime(_self->ob_itself,
4883 previewTime,
4884 previewDuration);
4885 Py_INCREF(Py_None);
4886 _res = Py_None;
4887 return _res;
4888}
4889
4890static PyObject *MovieObj_GetMoviePosterTime(_self, _args)
4891 MovieObject *_self;
4892 PyObject *_args;
4893{
4894 PyObject *_res = NULL;
4895 TimeValue _rv;
4896 if (!PyArg_ParseTuple(_args, ""))
4897 return NULL;
4898 _rv = GetMoviePosterTime(_self->ob_itself);
4899 _res = Py_BuildValue("l",
4900 _rv);
4901 return _res;
4902}
4903
4904static PyObject *MovieObj_SetMoviePosterTime(_self, _args)
4905 MovieObject *_self;
4906 PyObject *_args;
4907{
4908 PyObject *_res = NULL;
4909 TimeValue posterTime;
4910 if (!PyArg_ParseTuple(_args, "l",
4911 &posterTime))
4912 return NULL;
4913 SetMoviePosterTime(_self->ob_itself,
4914 posterTime);
4915 Py_INCREF(Py_None);
4916 _res = Py_None;
4917 return _res;
4918}
4919
4920static PyObject *MovieObj_GetMovieSelection(_self, _args)
4921 MovieObject *_self;
4922 PyObject *_args;
4923{
4924 PyObject *_res = NULL;
4925 TimeValue selectionTime;
4926 TimeValue selectionDuration;
4927 if (!PyArg_ParseTuple(_args, ""))
4928 return NULL;
4929 GetMovieSelection(_self->ob_itself,
4930 &selectionTime,
4931 &selectionDuration);
4932 _res = Py_BuildValue("ll",
4933 selectionTime,
4934 selectionDuration);
4935 return _res;
4936}
4937
4938static PyObject *MovieObj_SetMovieSelection(_self, _args)
4939 MovieObject *_self;
4940 PyObject *_args;
4941{
4942 PyObject *_res = NULL;
4943 TimeValue selectionTime;
4944 TimeValue selectionDuration;
4945 if (!PyArg_ParseTuple(_args, "ll",
4946 &selectionTime,
4947 &selectionDuration))
4948 return NULL;
4949 SetMovieSelection(_self->ob_itself,
4950 selectionTime,
4951 selectionDuration);
4952 Py_INCREF(Py_None);
4953 _res = Py_None;
4954 return _res;
4955}
4956
4957static PyObject *MovieObj_SetMovieActiveSegment(_self, _args)
4958 MovieObject *_self;
4959 PyObject *_args;
4960{
4961 PyObject *_res = NULL;
4962 TimeValue startTime;
4963 TimeValue duration;
4964 if (!PyArg_ParseTuple(_args, "ll",
4965 &startTime,
4966 &duration))
4967 return NULL;
4968 SetMovieActiveSegment(_self->ob_itself,
4969 startTime,
4970 duration);
4971 Py_INCREF(Py_None);
4972 _res = Py_None;
4973 return _res;
4974}
4975
4976static PyObject *MovieObj_GetMovieActiveSegment(_self, _args)
4977 MovieObject *_self;
4978 PyObject *_args;
4979{
4980 PyObject *_res = NULL;
4981 TimeValue startTime;
4982 TimeValue duration;
4983 if (!PyArg_ParseTuple(_args, ""))
4984 return NULL;
4985 GetMovieActiveSegment(_self->ob_itself,
4986 &startTime,
4987 &duration);
4988 _res = Py_BuildValue("ll",
4989 startTime,
4990 duration);
4991 return _res;
4992}
4993
Jack Jansenb2006391998-04-23 13:22:44 +00004994static PyObject *MovieObj_GetMovieTime(_self, _args)
4995 MovieObject *_self;
4996 PyObject *_args;
4997{
4998 PyObject *_res = NULL;
4999 TimeValue _rv;
5000 TimeRecord currentTime;
5001 if (!PyArg_ParseTuple(_args, ""))
5002 return NULL;
5003 _rv = GetMovieTime(_self->ob_itself,
5004 &currentTime);
5005 _res = Py_BuildValue("lO&",
5006 _rv,
5007 QtTimeRecord_New, &currentTime);
5008 return _res;
5009}
5010
5011static PyObject *MovieObj_SetMovieTime(_self, _args)
5012 MovieObject *_self;
5013 PyObject *_args;
5014{
5015 PyObject *_res = NULL;
5016 TimeRecord newtime;
5017 if (!PyArg_ParseTuple(_args, "O&",
5018 QtTimeRecord_Convert, &newtime))
5019 return NULL;
5020 SetMovieTime(_self->ob_itself,
5021 &newtime);
5022 Py_INCREF(Py_None);
5023 _res = Py_None;
5024 return _res;
5025}
5026
Jack Jansen453ced51995-11-30 17:42:08 +00005027static PyObject *MovieObj_SetMovieTimeValue(_self, _args)
5028 MovieObject *_self;
5029 PyObject *_args;
5030{
5031 PyObject *_res = NULL;
5032 TimeValue newtime;
5033 if (!PyArg_ParseTuple(_args, "l",
5034 &newtime))
5035 return NULL;
5036 SetMovieTimeValue(_self->ob_itself,
5037 newtime);
5038 Py_INCREF(Py_None);
5039 _res = Py_None;
5040 return _res;
5041}
5042
5043static PyObject *MovieObj_GetMovieUserData(_self, _args)
5044 MovieObject *_self;
5045 PyObject *_args;
5046{
5047 PyObject *_res = NULL;
5048 UserData _rv;
5049 if (!PyArg_ParseTuple(_args, ""))
5050 return NULL;
5051 _rv = GetMovieUserData(_self->ob_itself);
5052 _res = Py_BuildValue("O&",
5053 UserDataObj_New, _rv);
5054 return _res;
5055}
5056
5057static PyObject *MovieObj_GetMovieTrackCount(_self, _args)
5058 MovieObject *_self;
5059 PyObject *_args;
5060{
5061 PyObject *_res = NULL;
5062 long _rv;
5063 if (!PyArg_ParseTuple(_args, ""))
5064 return NULL;
5065 _rv = GetMovieTrackCount(_self->ob_itself);
5066 _res = Py_BuildValue("l",
5067 _rv);
5068 return _res;
5069}
5070
5071static PyObject *MovieObj_GetMovieTrack(_self, _args)
5072 MovieObject *_self;
5073 PyObject *_args;
5074{
5075 PyObject *_res = NULL;
5076 Track _rv;
5077 long trackID;
5078 if (!PyArg_ParseTuple(_args, "l",
5079 &trackID))
5080 return NULL;
5081 _rv = GetMovieTrack(_self->ob_itself,
5082 trackID);
5083 _res = Py_BuildValue("O&",
5084 TrackObj_New, _rv);
5085 return _res;
5086}
5087
5088static PyObject *MovieObj_GetMovieIndTrack(_self, _args)
5089 MovieObject *_self;
5090 PyObject *_args;
5091{
5092 PyObject *_res = NULL;
5093 Track _rv;
5094 long index;
5095 if (!PyArg_ParseTuple(_args, "l",
5096 &index))
5097 return NULL;
5098 _rv = GetMovieIndTrack(_self->ob_itself,
5099 index);
5100 _res = Py_BuildValue("O&",
5101 TrackObj_New, _rv);
5102 return _res;
5103}
5104
5105static PyObject *MovieObj_GetMovieIndTrackType(_self, _args)
5106 MovieObject *_self;
5107 PyObject *_args;
5108{
5109 PyObject *_res = NULL;
5110 Track _rv;
5111 long index;
5112 OSType trackType;
5113 long flags;
5114 if (!PyArg_ParseTuple(_args, "lO&l",
5115 &index,
5116 PyMac_GetOSType, &trackType,
5117 &flags))
5118 return NULL;
5119 _rv = GetMovieIndTrackType(_self->ob_itself,
5120 index,
5121 trackType,
5122 flags);
5123 _res = Py_BuildValue("O&",
5124 TrackObj_New, _rv);
5125 return _res;
5126}
5127
5128static PyObject *MovieObj_NewMovieTrack(_self, _args)
5129 MovieObject *_self;
5130 PyObject *_args;
5131{
5132 PyObject *_res = NULL;
5133 Track _rv;
5134 Fixed width;
5135 Fixed height;
5136 short trackVolume;
5137 if (!PyArg_ParseTuple(_args, "O&O&h",
5138 PyMac_GetFixed, &width,
5139 PyMac_GetFixed, &height,
5140 &trackVolume))
5141 return NULL;
5142 _rv = NewMovieTrack(_self->ob_itself,
5143 width,
5144 height,
5145 trackVolume);
5146 _res = Py_BuildValue("O&",
5147 TrackObj_New, _rv);
5148 return _res;
5149}
5150
5151static PyObject *MovieObj_SetAutoTrackAlternatesEnabled(_self, _args)
5152 MovieObject *_self;
5153 PyObject *_args;
5154{
5155 PyObject *_res = NULL;
5156 Boolean enable;
5157 if (!PyArg_ParseTuple(_args, "b",
5158 &enable))
5159 return NULL;
5160 SetAutoTrackAlternatesEnabled(_self->ob_itself,
5161 enable);
5162 Py_INCREF(Py_None);
5163 _res = Py_None;
5164 return _res;
5165}
5166
5167static PyObject *MovieObj_SelectMovieAlternates(_self, _args)
5168 MovieObject *_self;
5169 PyObject *_args;
5170{
5171 PyObject *_res = NULL;
5172 if (!PyArg_ParseTuple(_args, ""))
5173 return NULL;
5174 SelectMovieAlternates(_self->ob_itself);
5175 Py_INCREF(Py_None);
5176 _res = Py_None;
5177 return _res;
5178}
5179
5180static PyObject *MovieObj_InsertMovieSegment(_self, _args)
5181 MovieObject *_self;
5182 PyObject *_args;
5183{
5184 PyObject *_res = NULL;
5185 OSErr _err;
5186 Movie dstMovie;
5187 TimeValue srcIn;
5188 TimeValue srcDuration;
5189 TimeValue dstIn;
5190 if (!PyArg_ParseTuple(_args, "O&lll",
5191 MovieObj_Convert, &dstMovie,
5192 &srcIn,
5193 &srcDuration,
5194 &dstIn))
5195 return NULL;
5196 _err = InsertMovieSegment(_self->ob_itself,
5197 dstMovie,
5198 srcIn,
5199 srcDuration,
5200 dstIn);
5201 if (_err != noErr) return PyMac_Error(_err);
5202 Py_INCREF(Py_None);
5203 _res = Py_None;
5204 return _res;
5205}
5206
5207static PyObject *MovieObj_InsertEmptyMovieSegment(_self, _args)
5208 MovieObject *_self;
5209 PyObject *_args;
5210{
5211 PyObject *_res = NULL;
5212 OSErr _err;
5213 TimeValue dstIn;
5214 TimeValue dstDuration;
5215 if (!PyArg_ParseTuple(_args, "ll",
5216 &dstIn,
5217 &dstDuration))
5218 return NULL;
5219 _err = InsertEmptyMovieSegment(_self->ob_itself,
5220 dstIn,
5221 dstDuration);
5222 if (_err != noErr) return PyMac_Error(_err);
5223 Py_INCREF(Py_None);
5224 _res = Py_None;
5225 return _res;
5226}
5227
5228static PyObject *MovieObj_DeleteMovieSegment(_self, _args)
5229 MovieObject *_self;
5230 PyObject *_args;
5231{
5232 PyObject *_res = NULL;
5233 OSErr _err;
5234 TimeValue startTime;
5235 TimeValue duration;
5236 if (!PyArg_ParseTuple(_args, "ll",
5237 &startTime,
5238 &duration))
5239 return NULL;
5240 _err = DeleteMovieSegment(_self->ob_itself,
5241 startTime,
5242 duration);
5243 if (_err != noErr) return PyMac_Error(_err);
5244 Py_INCREF(Py_None);
5245 _res = Py_None;
5246 return _res;
5247}
5248
5249static PyObject *MovieObj_ScaleMovieSegment(_self, _args)
5250 MovieObject *_self;
5251 PyObject *_args;
5252{
5253 PyObject *_res = NULL;
5254 OSErr _err;
5255 TimeValue startTime;
5256 TimeValue oldDuration;
5257 TimeValue newDuration;
5258 if (!PyArg_ParseTuple(_args, "lll",
5259 &startTime,
5260 &oldDuration,
5261 &newDuration))
5262 return NULL;
5263 _err = ScaleMovieSegment(_self->ob_itself,
5264 startTime,
5265 oldDuration,
5266 newDuration);
5267 if (_err != noErr) return PyMac_Error(_err);
5268 Py_INCREF(Py_None);
5269 _res = Py_None;
5270 return _res;
5271}
5272
5273static PyObject *MovieObj_CutMovieSelection(_self, _args)
5274 MovieObject *_self;
5275 PyObject *_args;
5276{
5277 PyObject *_res = NULL;
5278 Movie _rv;
5279 if (!PyArg_ParseTuple(_args, ""))
5280 return NULL;
5281 _rv = CutMovieSelection(_self->ob_itself);
5282 _res = Py_BuildValue("O&",
5283 MovieObj_New, _rv);
5284 return _res;
5285}
5286
5287static PyObject *MovieObj_CopyMovieSelection(_self, _args)
5288 MovieObject *_self;
5289 PyObject *_args;
5290{
5291 PyObject *_res = NULL;
5292 Movie _rv;
5293 if (!PyArg_ParseTuple(_args, ""))
5294 return NULL;
5295 _rv = CopyMovieSelection(_self->ob_itself);
5296 _res = Py_BuildValue("O&",
5297 MovieObj_New, _rv);
5298 return _res;
5299}
5300
5301static PyObject *MovieObj_PasteMovieSelection(_self, _args)
5302 MovieObject *_self;
5303 PyObject *_args;
5304{
5305 PyObject *_res = NULL;
5306 Movie src;
5307 if (!PyArg_ParseTuple(_args, "O&",
5308 MovieObj_Convert, &src))
5309 return NULL;
5310 PasteMovieSelection(_self->ob_itself,
5311 src);
5312 Py_INCREF(Py_None);
5313 _res = Py_None;
5314 return _res;
5315}
5316
5317static PyObject *MovieObj_AddMovieSelection(_self, _args)
5318 MovieObject *_self;
5319 PyObject *_args;
5320{
5321 PyObject *_res = NULL;
5322 Movie src;
5323 if (!PyArg_ParseTuple(_args, "O&",
5324 MovieObj_Convert, &src))
5325 return NULL;
5326 AddMovieSelection(_self->ob_itself,
5327 src);
5328 Py_INCREF(Py_None);
5329 _res = Py_None;
5330 return _res;
5331}
5332
5333static PyObject *MovieObj_ClearMovieSelection(_self, _args)
5334 MovieObject *_self;
5335 PyObject *_args;
5336{
5337 PyObject *_res = NULL;
5338 if (!PyArg_ParseTuple(_args, ""))
5339 return NULL;
5340 ClearMovieSelection(_self->ob_itself);
5341 Py_INCREF(Py_None);
5342 _res = Py_None;
5343 return _res;
5344}
5345
5346static PyObject *MovieObj_PutMovieIntoTypedHandle(_self, _args)
5347 MovieObject *_self;
5348 PyObject *_args;
5349{
5350 PyObject *_res = NULL;
5351 OSErr _err;
5352 Track targetTrack;
5353 OSType handleType;
5354 Handle publicMovie;
5355 TimeValue start;
5356 TimeValue dur;
5357 long flags;
5358 ComponentInstance userComp;
5359 if (!PyArg_ParseTuple(_args, "O&O&O&lllO&",
5360 TrackObj_Convert, &targetTrack,
5361 PyMac_GetOSType, &handleType,
5362 ResObj_Convert, &publicMovie,
5363 &start,
5364 &dur,
5365 &flags,
5366 CmpInstObj_Convert, &userComp))
5367 return NULL;
5368 _err = PutMovieIntoTypedHandle(_self->ob_itself,
5369 targetTrack,
5370 handleType,
5371 publicMovie,
5372 start,
5373 dur,
5374 flags,
5375 userComp);
5376 if (_err != noErr) return PyMac_Error(_err);
5377 Py_INCREF(Py_None);
5378 _res = Py_None;
5379 return _res;
5380}
5381
5382static PyObject *MovieObj_CopyMovieSettings(_self, _args)
5383 MovieObject *_self;
5384 PyObject *_args;
5385{
5386 PyObject *_res = NULL;
5387 OSErr _err;
5388 Movie dstMovie;
5389 if (!PyArg_ParseTuple(_args, "O&",
5390 MovieObj_Convert, &dstMovie))
5391 return NULL;
5392 _err = CopyMovieSettings(_self->ob_itself,
5393 dstMovie);
5394 if (_err != noErr) return PyMac_Error(_err);
5395 Py_INCREF(Py_None);
5396 _res = Py_None;
5397 return _res;
5398}
5399
5400static PyObject *MovieObj_ConvertMovieToFile(_self, _args)
5401 MovieObject *_self;
5402 PyObject *_args;
5403{
5404 PyObject *_res = NULL;
5405 OSErr _err;
5406 Track onlyTrack;
5407 FSSpec outputFile;
5408 OSType fileType;
5409 OSType creator;
5410 ScriptCode scriptTag;
5411 short resID;
5412 long flags;
5413 ComponentInstance userComp;
5414 if (!PyArg_ParseTuple(_args, "O&O&O&O&hlO&",
5415 TrackObj_Convert, &onlyTrack,
5416 PyMac_GetFSSpec, &outputFile,
5417 PyMac_GetOSType, &fileType,
5418 PyMac_GetOSType, &creator,
5419 &scriptTag,
5420 &flags,
5421 CmpInstObj_Convert, &userComp))
5422 return NULL;
5423 _err = ConvertMovieToFile(_self->ob_itself,
5424 onlyTrack,
5425 &outputFile,
5426 fileType,
5427 creator,
5428 scriptTag,
5429 &resID,
5430 flags,
5431 userComp);
5432 if (_err != noErr) return PyMac_Error(_err);
5433 _res = Py_BuildValue("h",
5434 resID);
5435 return _res;
5436}
5437
5438static PyObject *MovieObj_GetMovieDataSize(_self, _args)
5439 MovieObject *_self;
5440 PyObject *_args;
5441{
5442 PyObject *_res = NULL;
5443 long _rv;
5444 TimeValue startTime;
5445 TimeValue duration;
5446 if (!PyArg_ParseTuple(_args, "ll",
5447 &startTime,
5448 &duration))
5449 return NULL;
5450 _rv = GetMovieDataSize(_self->ob_itself,
5451 startTime,
5452 duration);
5453 _res = Py_BuildValue("l",
5454 _rv);
5455 return _res;
5456}
5457
5458static PyObject *MovieObj_PtInMovie(_self, _args)
5459 MovieObject *_self;
5460 PyObject *_args;
5461{
5462 PyObject *_res = NULL;
5463 Boolean _rv;
5464 Point pt;
5465 if (!PyArg_ParseTuple(_args, "O&",
5466 PyMac_GetPoint, &pt))
5467 return NULL;
5468 _rv = PtInMovie(_self->ob_itself,
5469 pt);
5470 _res = Py_BuildValue("b",
5471 _rv);
5472 return _res;
5473}
5474
5475static PyObject *MovieObj_SetMovieLanguage(_self, _args)
5476 MovieObject *_self;
5477 PyObject *_args;
5478{
5479 PyObject *_res = NULL;
5480 long language;
5481 if (!PyArg_ParseTuple(_args, "l",
5482 &language))
5483 return NULL;
5484 SetMovieLanguage(_self->ob_itself,
5485 language);
5486 Py_INCREF(Py_None);
5487 _res = Py_None;
5488 return _res;
5489}
5490
5491static PyObject *MovieObj_GetMovieNextInterestingTime(_self, _args)
5492 MovieObject *_self;
5493 PyObject *_args;
5494{
5495 PyObject *_res = NULL;
5496 short interestingTimeFlags;
5497 short numMediaTypes;
5498 OSType whichMediaTypes;
5499 TimeValue time;
5500 Fixed rate;
5501 TimeValue interestingTime;
5502 TimeValue interestingDuration;
5503 if (!PyArg_ParseTuple(_args, "hhO&lO&",
5504 &interestingTimeFlags,
5505 &numMediaTypes,
5506 PyMac_GetOSType, &whichMediaTypes,
5507 &time,
5508 PyMac_GetFixed, &rate))
5509 return NULL;
5510 GetMovieNextInterestingTime(_self->ob_itself,
5511 interestingTimeFlags,
5512 numMediaTypes,
5513 &whichMediaTypes,
5514 time,
5515 rate,
5516 &interestingTime,
5517 &interestingDuration);
5518 _res = Py_BuildValue("ll",
5519 interestingTime,
5520 interestingDuration);
5521 return _res;
5522}
5523
5524static PyObject *MovieObj_AddMovieResource(_self, _args)
5525 MovieObject *_self;
5526 PyObject *_args;
5527{
5528 PyObject *_res = NULL;
5529 OSErr _err;
5530 short resRefNum;
5531 short resId;
5532 Str255 resName;
5533 if (!PyArg_ParseTuple(_args, "hO&",
5534 &resRefNum,
5535 PyMac_GetStr255, resName))
5536 return NULL;
5537 _err = AddMovieResource(_self->ob_itself,
5538 resRefNum,
5539 &resId,
5540 resName);
5541 if (_err != noErr) return PyMac_Error(_err);
5542 _res = Py_BuildValue("h",
5543 resId);
5544 return _res;
5545}
5546
5547static PyObject *MovieObj_UpdateMovieResource(_self, _args)
5548 MovieObject *_self;
5549 PyObject *_args;
5550{
5551 PyObject *_res = NULL;
5552 OSErr _err;
5553 short resRefNum;
5554 short resId;
5555 Str255 resName;
5556 if (!PyArg_ParseTuple(_args, "hhO&",
5557 &resRefNum,
5558 &resId,
5559 PyMac_GetStr255, resName))
5560 return NULL;
5561 _err = UpdateMovieResource(_self->ob_itself,
5562 resRefNum,
5563 resId,
5564 resName);
5565 if (_err != noErr) return PyMac_Error(_err);
5566 Py_INCREF(Py_None);
5567 _res = Py_None;
5568 return _res;
5569}
5570
5571static PyObject *MovieObj_HasMovieChanged(_self, _args)
5572 MovieObject *_self;
5573 PyObject *_args;
5574{
5575 PyObject *_res = NULL;
5576 Boolean _rv;
5577 if (!PyArg_ParseTuple(_args, ""))
5578 return NULL;
5579 _rv = HasMovieChanged(_self->ob_itself);
5580 _res = Py_BuildValue("b",
5581 _rv);
5582 return _res;
5583}
5584
5585static PyObject *MovieObj_ClearMovieChanged(_self, _args)
5586 MovieObject *_self;
5587 PyObject *_args;
5588{
5589 PyObject *_res = NULL;
5590 if (!PyArg_ParseTuple(_args, ""))
5591 return NULL;
5592 ClearMovieChanged(_self->ob_itself);
5593 Py_INCREF(Py_None);
5594 _res = Py_None;
5595 return _res;
5596}
5597
5598static PyObject *MovieObj_SetMovieDefaultDataRef(_self, _args)
5599 MovieObject *_self;
5600 PyObject *_args;
5601{
5602 PyObject *_res = NULL;
5603 OSErr _err;
5604 Handle dataRef;
5605 OSType dataRefType;
5606 if (!PyArg_ParseTuple(_args, "O&O&",
5607 ResObj_Convert, &dataRef,
5608 PyMac_GetOSType, &dataRefType))
5609 return NULL;
5610 _err = SetMovieDefaultDataRef(_self->ob_itself,
5611 dataRef,
5612 dataRefType);
5613 if (_err != noErr) return PyMac_Error(_err);
5614 Py_INCREF(Py_None);
5615 _res = Py_None;
5616 return _res;
5617}
5618
5619static PyObject *MovieObj_GetMovieDefaultDataRef(_self, _args)
5620 MovieObject *_self;
5621 PyObject *_args;
5622{
5623 PyObject *_res = NULL;
5624 OSErr _err;
5625 Handle dataRef;
5626 OSType dataRefType;
5627 if (!PyArg_ParseTuple(_args, ""))
5628 return NULL;
5629 _err = GetMovieDefaultDataRef(_self->ob_itself,
5630 &dataRef,
5631 &dataRefType);
5632 if (_err != noErr) return PyMac_Error(_err);
5633 _res = Py_BuildValue("O&O&",
5634 ResObj_New, dataRef,
5635 PyMac_BuildOSType, dataRefType);
5636 return _res;
5637}
5638
5639static PyObject *MovieObj_SetMovieColorTable(_self, _args)
5640 MovieObject *_self;
5641 PyObject *_args;
5642{
5643 PyObject *_res = NULL;
5644 OSErr _err;
5645 CTabHandle ctab;
5646 if (!PyArg_ParseTuple(_args, "O&",
5647 ResObj_Convert, &ctab))
5648 return NULL;
5649 _err = SetMovieColorTable(_self->ob_itself,
5650 ctab);
5651 if (_err != noErr) return PyMac_Error(_err);
5652 Py_INCREF(Py_None);
5653 _res = Py_None;
5654 return _res;
5655}
5656
5657static PyObject *MovieObj_GetMovieColorTable(_self, _args)
5658 MovieObject *_self;
5659 PyObject *_args;
5660{
5661 PyObject *_res = NULL;
5662 OSErr _err;
5663 CTabHandle ctab;
5664 if (!PyArg_ParseTuple(_args, ""))
5665 return NULL;
5666 _err = GetMovieColorTable(_self->ob_itself,
5667 &ctab);
5668 if (_err != noErr) return PyMac_Error(_err);
5669 _res = Py_BuildValue("O&",
5670 ResObj_New, ctab);
5671 return _res;
5672}
5673
5674static PyObject *MovieObj_FlattenMovie(_self, _args)
5675 MovieObject *_self;
5676 PyObject *_args;
5677{
5678 PyObject *_res = NULL;
5679 long movieFlattenFlags;
5680 FSSpec theFile;
5681 OSType creator;
5682 ScriptCode scriptTag;
5683 long createMovieFileFlags;
5684 short resId;
5685 Str255 resName;
5686 if (!PyArg_ParseTuple(_args, "lO&O&hlO&",
5687 &movieFlattenFlags,
5688 PyMac_GetFSSpec, &theFile,
5689 PyMac_GetOSType, &creator,
5690 &scriptTag,
5691 &createMovieFileFlags,
5692 PyMac_GetStr255, resName))
5693 return NULL;
5694 FlattenMovie(_self->ob_itself,
5695 movieFlattenFlags,
5696 &theFile,
5697 creator,
5698 scriptTag,
5699 createMovieFileFlags,
5700 &resId,
5701 resName);
5702 _res = Py_BuildValue("h",
5703 resId);
5704 return _res;
5705}
5706
5707static PyObject *MovieObj_FlattenMovieData(_self, _args)
5708 MovieObject *_self;
5709 PyObject *_args;
5710{
5711 PyObject *_res = NULL;
5712 Movie _rv;
5713 long movieFlattenFlags;
5714 FSSpec theFile;
5715 OSType creator;
5716 ScriptCode scriptTag;
5717 long createMovieFileFlags;
5718 if (!PyArg_ParseTuple(_args, "lO&O&hl",
5719 &movieFlattenFlags,
5720 PyMac_GetFSSpec, &theFile,
5721 PyMac_GetOSType, &creator,
5722 &scriptTag,
5723 &createMovieFileFlags))
5724 return NULL;
5725 _rv = FlattenMovieData(_self->ob_itself,
5726 movieFlattenFlags,
5727 &theFile,
5728 creator,
5729 scriptTag,
5730 createMovieFileFlags);
5731 _res = Py_BuildValue("O&",
5732 MovieObj_New, _rv);
5733 return _res;
5734}
5735
5736static PyObject *MovieObj_MovieSearchText(_self, _args)
5737 MovieObject *_self;
5738 PyObject *_args;
5739{
5740 PyObject *_res = NULL;
5741 OSErr _err;
5742 Ptr text;
5743 long size;
5744 long searchFlags;
5745 Track searchTrack;
5746 TimeValue searchTime;
5747 long searchOffset;
5748 if (!PyArg_ParseTuple(_args, "sll",
5749 &text,
5750 &size,
5751 &searchFlags))
5752 return NULL;
5753 _err = MovieSearchText(_self->ob_itself,
5754 text,
5755 size,
5756 searchFlags,
5757 &searchTrack,
5758 &searchTime,
5759 &searchOffset);
5760 if (_err != noErr) return PyMac_Error(_err);
5761 _res = Py_BuildValue("O&ll",
5762 TrackObj_New, searchTrack,
5763 searchTime,
5764 searchOffset);
5765 return _res;
5766}
5767
5768static PyObject *MovieObj_GetPosterBox(_self, _args)
5769 MovieObject *_self;
5770 PyObject *_args;
5771{
5772 PyObject *_res = NULL;
5773 Rect boxRect;
5774 if (!PyArg_ParseTuple(_args, ""))
5775 return NULL;
5776 GetPosterBox(_self->ob_itself,
5777 &boxRect);
5778 _res = Py_BuildValue("O&",
5779 PyMac_BuildRect, &boxRect);
5780 return _res;
5781}
5782
5783static PyObject *MovieObj_SetPosterBox(_self, _args)
5784 MovieObject *_self;
5785 PyObject *_args;
5786{
5787 PyObject *_res = NULL;
5788 Rect boxRect;
5789 if (!PyArg_ParseTuple(_args, "O&",
5790 PyMac_GetRect, &boxRect))
5791 return NULL;
5792 SetPosterBox(_self->ob_itself,
5793 &boxRect);
5794 Py_INCREF(Py_None);
5795 _res = Py_None;
5796 return _res;
5797}
5798
5799static PyObject *MovieObj_GetMovieSegmentDisplayBoundsRgn(_self, _args)
5800 MovieObject *_self;
5801 PyObject *_args;
5802{
5803 PyObject *_res = NULL;
5804 RgnHandle _rv;
5805 TimeValue time;
5806 TimeValue duration;
5807 if (!PyArg_ParseTuple(_args, "ll",
5808 &time,
5809 &duration))
5810 return NULL;
5811 _rv = GetMovieSegmentDisplayBoundsRgn(_self->ob_itself,
5812 time,
5813 duration);
5814 _res = Py_BuildValue("O&",
5815 ResObj_New, _rv);
5816 return _res;
5817}
5818
5819static PyObject *MovieObj_GetMovieStatus(_self, _args)
5820 MovieObject *_self;
5821 PyObject *_args;
5822{
5823 PyObject *_res = NULL;
5824 ComponentResult _rv;
5825 Track firstProblemTrack;
5826 if (!PyArg_ParseTuple(_args, ""))
5827 return NULL;
5828 _rv = GetMovieStatus(_self->ob_itself,
5829 &firstProblemTrack);
5830 _res = Py_BuildValue("lO&",
5831 _rv,
5832 TrackObj_New, firstProblemTrack);
5833 return _res;
5834}
5835
5836static PyObject *MovieObj_NewMovieController(_self, _args)
5837 MovieObject *_self;
5838 PyObject *_args;
5839{
5840 PyObject *_res = NULL;
Jack Jansen9cfea101995-12-09 14:05:56 +00005841 MovieController _rv;
Jack Jansen453ced51995-11-30 17:42:08 +00005842 Rect movieRect;
5843 long someFlags;
5844 if (!PyArg_ParseTuple(_args, "O&l",
5845 PyMac_GetRect, &movieRect,
5846 &someFlags))
5847 return NULL;
5848 _rv = NewMovieController(_self->ob_itself,
5849 &movieRect,
5850 someFlags);
5851 _res = Py_BuildValue("O&",
Jack Jansen9cfea101995-12-09 14:05:56 +00005852 MovieCtlObj_New, _rv);
Jack Jansen453ced51995-11-30 17:42:08 +00005853 return _res;
5854}
5855
5856static PyObject *MovieObj_PutMovieOnScrap(_self, _args)
5857 MovieObject *_self;
5858 PyObject *_args;
5859{
5860 PyObject *_res = NULL;
5861 OSErr _err;
5862 long movieScrapFlags;
5863 if (!PyArg_ParseTuple(_args, "l",
5864 &movieScrapFlags))
5865 return NULL;
5866 _err = PutMovieOnScrap(_self->ob_itself,
5867 movieScrapFlags);
5868 if (_err != noErr) return PyMac_Error(_err);
5869 Py_INCREF(Py_None);
5870 _res = Py_None;
5871 return _res;
5872}
5873
5874static PyObject *MovieObj_SetMoviePlayHints(_self, _args)
5875 MovieObject *_self;
5876 PyObject *_args;
5877{
5878 PyObject *_res = NULL;
5879 long flags;
5880 long flagsMask;
5881 if (!PyArg_ParseTuple(_args, "ll",
5882 &flags,
5883 &flagsMask))
5884 return NULL;
5885 SetMoviePlayHints(_self->ob_itself,
5886 flags,
5887 flagsMask);
5888 Py_INCREF(Py_None);
5889 _res = Py_None;
5890 return _res;
5891}
5892
Jack Jansen1c4e6141998-04-21 15:23:55 +00005893static PyObject *MovieObj_GetMaxLoadedTimeInMovie(_self, _args)
5894 MovieObject *_self;
5895 PyObject *_args;
5896{
5897 PyObject *_res = NULL;
5898 OSErr _err;
5899 TimeValue time;
5900 if (!PyArg_ParseTuple(_args, ""))
5901 return NULL;
5902 _err = GetMaxLoadedTimeInMovie(_self->ob_itself,
5903 &time);
5904 if (_err != noErr) return PyMac_Error(_err);
5905 _res = Py_BuildValue("l",
5906 time);
5907 return _res;
5908}
5909
5910static PyObject *MovieObj_QTMovieNeedsTimeTable(_self, _args)
5911 MovieObject *_self;
5912 PyObject *_args;
5913{
5914 PyObject *_res = NULL;
5915 OSErr _err;
5916 Boolean needsTimeTable;
5917 if (!PyArg_ParseTuple(_args, ""))
5918 return NULL;
5919 _err = QTMovieNeedsTimeTable(_self->ob_itself,
5920 &needsTimeTable);
5921 if (_err != noErr) return PyMac_Error(_err);
5922 _res = Py_BuildValue("b",
5923 needsTimeTable);
5924 return _res;
5925}
5926
5927static PyObject *MovieObj_QTGetDataRefMaxFileOffset(_self, _args)
5928 MovieObject *_self;
5929 PyObject *_args;
5930{
5931 PyObject *_res = NULL;
5932 OSErr _err;
5933 OSType dataRefType;
5934 Handle dataRef;
5935 long offset;
5936 if (!PyArg_ParseTuple(_args, "O&O&",
5937 PyMac_GetOSType, &dataRefType,
5938 ResObj_Convert, &dataRef))
5939 return NULL;
5940 _err = QTGetDataRefMaxFileOffset(_self->ob_itself,
5941 dataRefType,
5942 dataRef,
5943 &offset);
5944 if (_err != noErr) return PyMac_Error(_err);
5945 _res = Py_BuildValue("l",
5946 offset);
5947 return _res;
5948}
5949
Jack Jansen453ced51995-11-30 17:42:08 +00005950static PyMethodDef MovieObj_methods[] = {
5951 {"MoviesTask", (PyCFunction)MovieObj_MoviesTask, 1,
5952 "(long maxMilliSecToUse) -> None"},
5953 {"PrerollMovie", (PyCFunction)MovieObj_PrerollMovie, 1,
5954 "(TimeValue time, Fixed Rate) -> None"},
5955 {"LoadMovieIntoRam", (PyCFunction)MovieObj_LoadMovieIntoRam, 1,
5956 "(TimeValue time, TimeValue duration, long flags) -> None"},
5957 {"SetMovieActive", (PyCFunction)MovieObj_SetMovieActive, 1,
5958 "(Boolean active) -> None"},
5959 {"GetMovieActive", (PyCFunction)MovieObj_GetMovieActive, 1,
5960 "() -> (Boolean _rv)"},
5961 {"StartMovie", (PyCFunction)MovieObj_StartMovie, 1,
5962 "() -> None"},
5963 {"StopMovie", (PyCFunction)MovieObj_StopMovie, 1,
5964 "() -> None"},
5965 {"GoToBeginningOfMovie", (PyCFunction)MovieObj_GoToBeginningOfMovie, 1,
5966 "() -> None"},
5967 {"GoToEndOfMovie", (PyCFunction)MovieObj_GoToEndOfMovie, 1,
5968 "() -> None"},
5969 {"IsMovieDone", (PyCFunction)MovieObj_IsMovieDone, 1,
5970 "() -> (Boolean _rv)"},
5971 {"GetMoviePreviewMode", (PyCFunction)MovieObj_GetMoviePreviewMode, 1,
5972 "() -> (Boolean _rv)"},
5973 {"SetMoviePreviewMode", (PyCFunction)MovieObj_SetMoviePreviewMode, 1,
5974 "(Boolean usePreview) -> None"},
5975 {"ShowMoviePoster", (PyCFunction)MovieObj_ShowMoviePoster, 1,
5976 "() -> None"},
5977 {"GetMovieTimeBase", (PyCFunction)MovieObj_GetMovieTimeBase, 1,
5978 "() -> (TimeBase _rv)"},
Jack Jansenb2006391998-04-23 13:22:44 +00005979 {"SetMovieMasterTimeBase", (PyCFunction)MovieObj_SetMovieMasterTimeBase, 1,
5980 "(TimeBase tb, TimeRecord slaveZero) -> None"},
5981 {"SetMovieMasterClock", (PyCFunction)MovieObj_SetMovieMasterClock, 1,
5982 "(Component clockMeister, TimeRecord slaveZero) -> None"},
Jack Jansene0cf87b1997-04-09 15:53:46 +00005983 {"GetMovieGWorld", (PyCFunction)MovieObj_GetMovieGWorld, 1,
5984 "() -> (CGrafPtr port, GDHandle gdh)"},
5985 {"SetMovieGWorld", (PyCFunction)MovieObj_SetMovieGWorld, 1,
5986 "(CGrafPtr port, GDHandle gdh) -> None"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00005987 {"GetMovieNaturalBoundsRect", (PyCFunction)MovieObj_GetMovieNaturalBoundsRect, 1,
5988 "() -> (Rect naturalBounds)"},
Jack Jansen453ced51995-11-30 17:42:08 +00005989 {"GetNextTrackForCompositing", (PyCFunction)MovieObj_GetNextTrackForCompositing, 1,
5990 "(Track theTrack) -> (Track _rv)"},
5991 {"GetPrevTrackForCompositing", (PyCFunction)MovieObj_GetPrevTrackForCompositing, 1,
5992 "(Track theTrack) -> (Track _rv)"},
5993 {"GetMoviePict", (PyCFunction)MovieObj_GetMoviePict, 1,
5994 "(TimeValue time) -> (PicHandle _rv)"},
5995 {"GetMoviePosterPict", (PyCFunction)MovieObj_GetMoviePosterPict, 1,
5996 "() -> (PicHandle _rv)"},
5997 {"UpdateMovie", (PyCFunction)MovieObj_UpdateMovie, 1,
5998 "() -> None"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00005999 {"InvalidateMovieRegion", (PyCFunction)MovieObj_InvalidateMovieRegion, 1,
6000 "(RgnHandle invalidRgn) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00006001 {"GetMovieBox", (PyCFunction)MovieObj_GetMovieBox, 1,
6002 "() -> (Rect boxRect)"},
6003 {"SetMovieBox", (PyCFunction)MovieObj_SetMovieBox, 1,
6004 "(Rect boxRect) -> None"},
6005 {"GetMovieDisplayClipRgn", (PyCFunction)MovieObj_GetMovieDisplayClipRgn, 1,
6006 "() -> (RgnHandle _rv)"},
6007 {"SetMovieDisplayClipRgn", (PyCFunction)MovieObj_SetMovieDisplayClipRgn, 1,
6008 "(RgnHandle theClip) -> None"},
6009 {"GetMovieClipRgn", (PyCFunction)MovieObj_GetMovieClipRgn, 1,
6010 "() -> (RgnHandle _rv)"},
6011 {"SetMovieClipRgn", (PyCFunction)MovieObj_SetMovieClipRgn, 1,
6012 "(RgnHandle theClip) -> None"},
6013 {"GetMovieDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieDisplayBoundsRgn, 1,
6014 "() -> (RgnHandle _rv)"},
6015 {"GetMovieBoundsRgn", (PyCFunction)MovieObj_GetMovieBoundsRgn, 1,
6016 "() -> (RgnHandle _rv)"},
6017 {"PutMovieIntoHandle", (PyCFunction)MovieObj_PutMovieIntoHandle, 1,
6018 "(Handle publicMovie) -> None"},
6019 {"PutMovieIntoDataFork", (PyCFunction)MovieObj_PutMovieIntoDataFork, 1,
6020 "(short fRefNum, long offset, long maxSize) -> None"},
Jack Jansene0cf87b1997-04-09 15:53:46 +00006021 {"GetMovieCreationTime", (PyCFunction)MovieObj_GetMovieCreationTime, 1,
6022 "() -> (unsigned long _rv)"},
6023 {"GetMovieModificationTime", (PyCFunction)MovieObj_GetMovieModificationTime, 1,
6024 "() -> (unsigned long _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00006025 {"GetMovieTimeScale", (PyCFunction)MovieObj_GetMovieTimeScale, 1,
6026 "() -> (TimeScale _rv)"},
6027 {"SetMovieTimeScale", (PyCFunction)MovieObj_SetMovieTimeScale, 1,
6028 "(TimeScale timeScale) -> None"},
6029 {"GetMovieDuration", (PyCFunction)MovieObj_GetMovieDuration, 1,
6030 "() -> (TimeValue _rv)"},
6031 {"GetMovieRate", (PyCFunction)MovieObj_GetMovieRate, 1,
6032 "() -> (Fixed _rv)"},
6033 {"SetMovieRate", (PyCFunction)MovieObj_SetMovieRate, 1,
6034 "(Fixed rate) -> None"},
6035 {"GetMoviePreferredRate", (PyCFunction)MovieObj_GetMoviePreferredRate, 1,
6036 "() -> (Fixed _rv)"},
6037 {"SetMoviePreferredRate", (PyCFunction)MovieObj_SetMoviePreferredRate, 1,
6038 "(Fixed rate) -> None"},
6039 {"GetMoviePreferredVolume", (PyCFunction)MovieObj_GetMoviePreferredVolume, 1,
6040 "() -> (short _rv)"},
6041 {"SetMoviePreferredVolume", (PyCFunction)MovieObj_SetMoviePreferredVolume, 1,
6042 "(short volume) -> None"},
6043 {"GetMovieVolume", (PyCFunction)MovieObj_GetMovieVolume, 1,
6044 "() -> (short _rv)"},
6045 {"SetMovieVolume", (PyCFunction)MovieObj_SetMovieVolume, 1,
6046 "(short volume) -> None"},
6047 {"GetMoviePreviewTime", (PyCFunction)MovieObj_GetMoviePreviewTime, 1,
6048 "() -> (TimeValue previewTime, TimeValue previewDuration)"},
6049 {"SetMoviePreviewTime", (PyCFunction)MovieObj_SetMoviePreviewTime, 1,
6050 "(TimeValue previewTime, TimeValue previewDuration) -> None"},
6051 {"GetMoviePosterTime", (PyCFunction)MovieObj_GetMoviePosterTime, 1,
6052 "() -> (TimeValue _rv)"},
6053 {"SetMoviePosterTime", (PyCFunction)MovieObj_SetMoviePosterTime, 1,
6054 "(TimeValue posterTime) -> None"},
6055 {"GetMovieSelection", (PyCFunction)MovieObj_GetMovieSelection, 1,
6056 "() -> (TimeValue selectionTime, TimeValue selectionDuration)"},
6057 {"SetMovieSelection", (PyCFunction)MovieObj_SetMovieSelection, 1,
6058 "(TimeValue selectionTime, TimeValue selectionDuration) -> None"},
6059 {"SetMovieActiveSegment", (PyCFunction)MovieObj_SetMovieActiveSegment, 1,
6060 "(TimeValue startTime, TimeValue duration) -> None"},
6061 {"GetMovieActiveSegment", (PyCFunction)MovieObj_GetMovieActiveSegment, 1,
6062 "() -> (TimeValue startTime, TimeValue duration)"},
Jack Jansenb2006391998-04-23 13:22:44 +00006063 {"GetMovieTime", (PyCFunction)MovieObj_GetMovieTime, 1,
6064 "() -> (TimeValue _rv, TimeRecord currentTime)"},
6065 {"SetMovieTime", (PyCFunction)MovieObj_SetMovieTime, 1,
6066 "(TimeRecord newtime) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00006067 {"SetMovieTimeValue", (PyCFunction)MovieObj_SetMovieTimeValue, 1,
6068 "(TimeValue newtime) -> None"},
6069 {"GetMovieUserData", (PyCFunction)MovieObj_GetMovieUserData, 1,
6070 "() -> (UserData _rv)"},
6071 {"GetMovieTrackCount", (PyCFunction)MovieObj_GetMovieTrackCount, 1,
6072 "() -> (long _rv)"},
6073 {"GetMovieTrack", (PyCFunction)MovieObj_GetMovieTrack, 1,
6074 "(long trackID) -> (Track _rv)"},
6075 {"GetMovieIndTrack", (PyCFunction)MovieObj_GetMovieIndTrack, 1,
6076 "(long index) -> (Track _rv)"},
6077 {"GetMovieIndTrackType", (PyCFunction)MovieObj_GetMovieIndTrackType, 1,
6078 "(long index, OSType trackType, long flags) -> (Track _rv)"},
6079 {"NewMovieTrack", (PyCFunction)MovieObj_NewMovieTrack, 1,
6080 "(Fixed width, Fixed height, short trackVolume) -> (Track _rv)"},
6081 {"SetAutoTrackAlternatesEnabled", (PyCFunction)MovieObj_SetAutoTrackAlternatesEnabled, 1,
6082 "(Boolean enable) -> None"},
6083 {"SelectMovieAlternates", (PyCFunction)MovieObj_SelectMovieAlternates, 1,
6084 "() -> None"},
6085 {"InsertMovieSegment", (PyCFunction)MovieObj_InsertMovieSegment, 1,
6086 "(Movie dstMovie, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
6087 {"InsertEmptyMovieSegment", (PyCFunction)MovieObj_InsertEmptyMovieSegment, 1,
6088 "(TimeValue dstIn, TimeValue dstDuration) -> None"},
6089 {"DeleteMovieSegment", (PyCFunction)MovieObj_DeleteMovieSegment, 1,
6090 "(TimeValue startTime, TimeValue duration) -> None"},
6091 {"ScaleMovieSegment", (PyCFunction)MovieObj_ScaleMovieSegment, 1,
6092 "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
6093 {"CutMovieSelection", (PyCFunction)MovieObj_CutMovieSelection, 1,
6094 "() -> (Movie _rv)"},
6095 {"CopyMovieSelection", (PyCFunction)MovieObj_CopyMovieSelection, 1,
6096 "() -> (Movie _rv)"},
6097 {"PasteMovieSelection", (PyCFunction)MovieObj_PasteMovieSelection, 1,
6098 "(Movie src) -> None"},
6099 {"AddMovieSelection", (PyCFunction)MovieObj_AddMovieSelection, 1,
6100 "(Movie src) -> None"},
6101 {"ClearMovieSelection", (PyCFunction)MovieObj_ClearMovieSelection, 1,
6102 "() -> None"},
6103 {"PutMovieIntoTypedHandle", (PyCFunction)MovieObj_PutMovieIntoTypedHandle, 1,
6104 "(Track targetTrack, OSType handleType, Handle publicMovie, TimeValue start, TimeValue dur, long flags, ComponentInstance userComp) -> None"},
6105 {"CopyMovieSettings", (PyCFunction)MovieObj_CopyMovieSettings, 1,
6106 "(Movie dstMovie) -> None"},
6107 {"ConvertMovieToFile", (PyCFunction)MovieObj_ConvertMovieToFile, 1,
6108 "(Track onlyTrack, FSSpec outputFile, OSType fileType, OSType creator, ScriptCode scriptTag, long flags, ComponentInstance userComp) -> (short resID)"},
6109 {"GetMovieDataSize", (PyCFunction)MovieObj_GetMovieDataSize, 1,
6110 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
6111 {"PtInMovie", (PyCFunction)MovieObj_PtInMovie, 1,
6112 "(Point pt) -> (Boolean _rv)"},
6113 {"SetMovieLanguage", (PyCFunction)MovieObj_SetMovieLanguage, 1,
6114 "(long language) -> None"},
6115 {"GetMovieNextInterestingTime", (PyCFunction)MovieObj_GetMovieNextInterestingTime, 1,
6116 "(short interestingTimeFlags, short numMediaTypes, OSType whichMediaTypes, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
6117 {"AddMovieResource", (PyCFunction)MovieObj_AddMovieResource, 1,
6118 "(short resRefNum, Str255 resName) -> (short resId)"},
6119 {"UpdateMovieResource", (PyCFunction)MovieObj_UpdateMovieResource, 1,
6120 "(short resRefNum, short resId, Str255 resName) -> None"},
6121 {"HasMovieChanged", (PyCFunction)MovieObj_HasMovieChanged, 1,
6122 "() -> (Boolean _rv)"},
6123 {"ClearMovieChanged", (PyCFunction)MovieObj_ClearMovieChanged, 1,
6124 "() -> None"},
6125 {"SetMovieDefaultDataRef", (PyCFunction)MovieObj_SetMovieDefaultDataRef, 1,
6126 "(Handle dataRef, OSType dataRefType) -> None"},
6127 {"GetMovieDefaultDataRef", (PyCFunction)MovieObj_GetMovieDefaultDataRef, 1,
6128 "() -> (Handle dataRef, OSType dataRefType)"},
6129 {"SetMovieColorTable", (PyCFunction)MovieObj_SetMovieColorTable, 1,
6130 "(CTabHandle ctab) -> None"},
6131 {"GetMovieColorTable", (PyCFunction)MovieObj_GetMovieColorTable, 1,
6132 "() -> (CTabHandle ctab)"},
6133 {"FlattenMovie", (PyCFunction)MovieObj_FlattenMovie, 1,
6134 "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, Str255 resName) -> (short resId)"},
6135 {"FlattenMovieData", (PyCFunction)MovieObj_FlattenMovieData, 1,
6136 "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (Movie _rv)"},
6137 {"MovieSearchText", (PyCFunction)MovieObj_MovieSearchText, 1,
6138 "(Ptr text, long size, long searchFlags) -> (Track searchTrack, TimeValue searchTime, long searchOffset)"},
6139 {"GetPosterBox", (PyCFunction)MovieObj_GetPosterBox, 1,
6140 "() -> (Rect boxRect)"},
6141 {"SetPosterBox", (PyCFunction)MovieObj_SetPosterBox, 1,
6142 "(Rect boxRect) -> None"},
6143 {"GetMovieSegmentDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieSegmentDisplayBoundsRgn, 1,
6144 "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
6145 {"GetMovieStatus", (PyCFunction)MovieObj_GetMovieStatus, 1,
6146 "() -> (ComponentResult _rv, Track firstProblemTrack)"},
6147 {"NewMovieController", (PyCFunction)MovieObj_NewMovieController, 1,
Jack Jansen9cfea101995-12-09 14:05:56 +00006148 "(Rect movieRect, long someFlags) -> (MovieController _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00006149 {"PutMovieOnScrap", (PyCFunction)MovieObj_PutMovieOnScrap, 1,
6150 "(long movieScrapFlags) -> None"},
6151 {"SetMoviePlayHints", (PyCFunction)MovieObj_SetMoviePlayHints, 1,
6152 "(long flags, long flagsMask) -> None"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00006153 {"GetMaxLoadedTimeInMovie", (PyCFunction)MovieObj_GetMaxLoadedTimeInMovie, 1,
6154 "() -> (TimeValue time)"},
6155 {"QTMovieNeedsTimeTable", (PyCFunction)MovieObj_QTMovieNeedsTimeTable, 1,
6156 "() -> (Boolean needsTimeTable)"},
6157 {"QTGetDataRefMaxFileOffset", (PyCFunction)MovieObj_QTGetDataRefMaxFileOffset, 1,
6158 "(OSType dataRefType, Handle dataRef) -> (long offset)"},
Jack Jansen453ced51995-11-30 17:42:08 +00006159 {NULL, NULL, 0}
6160};
6161
6162PyMethodChain MovieObj_chain = { MovieObj_methods, NULL };
6163
6164static PyObject *MovieObj_getattr(self, name)
6165 MovieObject *self;
6166 char *name;
6167{
6168 return Py_FindMethodInChain(&MovieObj_chain, (PyObject *)self, name);
6169}
6170
6171#define MovieObj_setattr NULL
6172
Jack Jansena05ac601999-12-12 21:41:51 +00006173#define MovieObj_compare NULL
6174
6175#define MovieObj_repr NULL
6176
6177#define MovieObj_hash NULL
6178
Jack Jansen453ced51995-11-30 17:42:08 +00006179PyTypeObject Movie_Type = {
6180 PyObject_HEAD_INIT(&PyType_Type)
6181 0, /*ob_size*/
6182 "Movie", /*tp_name*/
6183 sizeof(MovieObject), /*tp_basicsize*/
6184 0, /*tp_itemsize*/
6185 /* methods */
6186 (destructor) MovieObj_dealloc, /*tp_dealloc*/
6187 0, /*tp_print*/
6188 (getattrfunc) MovieObj_getattr, /*tp_getattr*/
6189 (setattrfunc) MovieObj_setattr, /*tp_setattr*/
Jack Jansena05ac601999-12-12 21:41:51 +00006190 (cmpfunc) MovieObj_compare, /*tp_compare*/
6191 (reprfunc) MovieObj_repr, /*tp_repr*/
6192 (PyNumberMethods *)0, /* tp_as_number */
6193 (PySequenceMethods *)0, /* tp_as_sequence */
6194 (PyMappingMethods *)0, /* tp_as_mapping */
6195 (hashfunc) MovieObj_hash, /*tp_hash*/
Jack Jansen453ced51995-11-30 17:42:08 +00006196};
6197
6198/* --------------------- End object type Movie ---------------------- */
6199
6200
Jack Jansena05ac601999-12-12 21:41:51 +00006201static PyObject *Qt_CheckQuickTimeRegistration(_self, _args)
6202 PyObject *_self;
6203 PyObject *_args;
6204{
6205 PyObject *_res = NULL;
6206 void * registrationKey;
6207 long flags;
6208 if (!PyArg_ParseTuple(_args, "sl",
6209 &registrationKey,
6210 &flags))
6211 return NULL;
6212 CheckQuickTimeRegistration(registrationKey,
6213 flags);
6214 Py_INCREF(Py_None);
6215 _res = Py_None;
6216 return _res;
6217}
6218
Jack Jansen453ced51995-11-30 17:42:08 +00006219static PyObject *Qt_EnterMovies(_self, _args)
6220 PyObject *_self;
6221 PyObject *_args;
6222{
6223 PyObject *_res = NULL;
6224 OSErr _err;
6225 if (!PyArg_ParseTuple(_args, ""))
6226 return NULL;
6227 _err = EnterMovies();
6228 if (_err != noErr) return PyMac_Error(_err);
6229 Py_INCREF(Py_None);
6230 _res = Py_None;
6231 return _res;
6232}
6233
6234static PyObject *Qt_ExitMovies(_self, _args)
6235 PyObject *_self;
6236 PyObject *_args;
6237{
6238 PyObject *_res = NULL;
6239 if (!PyArg_ParseTuple(_args, ""))
6240 return NULL;
6241 ExitMovies();
6242 Py_INCREF(Py_None);
6243 _res = Py_None;
6244 return _res;
6245}
6246
6247static PyObject *Qt_GetMoviesError(_self, _args)
6248 PyObject *_self;
6249 PyObject *_args;
6250{
6251 PyObject *_res = NULL;
6252 OSErr _err;
6253 if (!PyArg_ParseTuple(_args, ""))
6254 return NULL;
6255 _err = GetMoviesError();
6256 if (_err != noErr) return PyMac_Error(_err);
6257 Py_INCREF(Py_None);
6258 _res = Py_None;
6259 return _res;
6260}
6261
6262static PyObject *Qt_ClearMoviesStickyError(_self, _args)
6263 PyObject *_self;
6264 PyObject *_args;
6265{
6266 PyObject *_res = NULL;
6267 if (!PyArg_ParseTuple(_args, ""))
6268 return NULL;
6269 ClearMoviesStickyError();
6270 Py_INCREF(Py_None);
6271 _res = Py_None;
6272 return _res;
6273}
6274
6275static PyObject *Qt_GetMoviesStickyError(_self, _args)
6276 PyObject *_self;
6277 PyObject *_args;
6278{
6279 PyObject *_res = NULL;
6280 OSErr _err;
6281 if (!PyArg_ParseTuple(_args, ""))
6282 return NULL;
6283 _err = GetMoviesStickyError();
6284 if (_err != noErr) return PyMac_Error(_err);
6285 Py_INCREF(Py_None);
6286 _res = Py_None;
6287 return _res;
6288}
6289
6290static PyObject *Qt_DisposeMatte(_self, _args)
6291 PyObject *_self;
6292 PyObject *_args;
6293{
6294 PyObject *_res = NULL;
6295 PixMapHandle theMatte;
6296 if (!PyArg_ParseTuple(_args, "O&",
6297 ResObj_Convert, &theMatte))
6298 return NULL;
6299 DisposeMatte(theMatte);
6300 Py_INCREF(Py_None);
6301 _res = Py_None;
6302 return _res;
6303}
6304
6305static PyObject *Qt_NewMovie(_self, _args)
6306 PyObject *_self;
6307 PyObject *_args;
6308{
6309 PyObject *_res = NULL;
6310 Movie _rv;
6311 long flags;
6312 if (!PyArg_ParseTuple(_args, "l",
6313 &flags))
6314 return NULL;
6315 _rv = NewMovie(flags);
6316 _res = Py_BuildValue("O&",
6317 MovieObj_New, _rv);
6318 return _res;
6319}
6320
6321static PyObject *Qt_GetDataHandler(_self, _args)
6322 PyObject *_self;
6323 PyObject *_args;
6324{
6325 PyObject *_res = NULL;
6326 Component _rv;
6327 Handle dataRef;
6328 OSType dataHandlerSubType;
6329 long flags;
6330 if (!PyArg_ParseTuple(_args, "O&O&l",
6331 ResObj_Convert, &dataRef,
6332 PyMac_GetOSType, &dataHandlerSubType,
6333 &flags))
6334 return NULL;
6335 _rv = GetDataHandler(dataRef,
6336 dataHandlerSubType,
6337 flags);
6338 _res = Py_BuildValue("O&",
6339 CmpObj_New, _rv);
6340 return _res;
6341}
6342
6343static PyObject *Qt_PasteHandleIntoMovie(_self, _args)
6344 PyObject *_self;
6345 PyObject *_args;
6346{
6347 PyObject *_res = NULL;
6348 OSErr _err;
6349 Handle h;
6350 OSType handleType;
6351 Movie theMovie;
6352 long flags;
6353 ComponentInstance userComp;
6354 if (!PyArg_ParseTuple(_args, "O&O&O&lO&",
6355 ResObj_Convert, &h,
6356 PyMac_GetOSType, &handleType,
6357 MovieObj_Convert, &theMovie,
6358 &flags,
6359 CmpInstObj_Convert, &userComp))
6360 return NULL;
6361 _err = PasteHandleIntoMovie(h,
6362 handleType,
6363 theMovie,
6364 flags,
6365 userComp);
6366 if (_err != noErr) return PyMac_Error(_err);
6367 Py_INCREF(Py_None);
6368 _res = Py_None;
6369 return _res;
6370}
6371
Jack Jansen1c4e6141998-04-21 15:23:55 +00006372static PyObject *Qt_GetMovieImporterForDataRef(_self, _args)
6373 PyObject *_self;
6374 PyObject *_args;
6375{
6376 PyObject *_res = NULL;
6377 OSErr _err;
6378 OSType dataRefType;
6379 Handle dataRef;
6380 long flags;
6381 Component importer;
6382 if (!PyArg_ParseTuple(_args, "O&O&l",
6383 PyMac_GetOSType, &dataRefType,
6384 ResObj_Convert, &dataRef,
6385 &flags))
6386 return NULL;
6387 _err = GetMovieImporterForDataRef(dataRefType,
6388 dataRef,
6389 flags,
6390 &importer);
6391 if (_err != noErr) return PyMac_Error(_err);
6392 _res = Py_BuildValue("O&",
6393 CmpObj_New, importer);
6394 return _res;
6395}
6396
Jack Jansen453ced51995-11-30 17:42:08 +00006397static PyObject *Qt_TrackTimeToMediaTime(_self, _args)
6398 PyObject *_self;
6399 PyObject *_args;
6400{
6401 PyObject *_res = NULL;
6402 TimeValue _rv;
6403 TimeValue value;
6404 Track theTrack;
6405 if (!PyArg_ParseTuple(_args, "lO&",
6406 &value,
6407 TrackObj_Convert, &theTrack))
6408 return NULL;
6409 _rv = TrackTimeToMediaTime(value,
6410 theTrack);
6411 _res = Py_BuildValue("l",
6412 _rv);
6413 return _res;
6414}
6415
6416static PyObject *Qt_NewUserData(_self, _args)
6417 PyObject *_self;
6418 PyObject *_args;
6419{
6420 PyObject *_res = NULL;
6421 OSErr _err;
6422 UserData theUserData;
6423 if (!PyArg_ParseTuple(_args, ""))
6424 return NULL;
6425 _err = NewUserData(&theUserData);
6426 if (_err != noErr) return PyMac_Error(_err);
6427 _res = Py_BuildValue("O&",
6428 UserDataObj_New, theUserData);
6429 return _res;
6430}
6431
6432static PyObject *Qt_NewUserDataFromHandle(_self, _args)
6433 PyObject *_self;
6434 PyObject *_args;
6435{
6436 PyObject *_res = NULL;
6437 OSErr _err;
6438 Handle h;
6439 UserData theUserData;
6440 if (!PyArg_ParseTuple(_args, "O&",
6441 ResObj_Convert, &h))
6442 return NULL;
6443 _err = NewUserDataFromHandle(h,
6444 &theUserData);
6445 if (_err != noErr) return PyMac_Error(_err);
6446 _res = Py_BuildValue("O&",
6447 UserDataObj_New, theUserData);
6448 return _res;
6449}
6450
6451static PyObject *Qt_CreateMovieFile(_self, _args)
6452 PyObject *_self;
6453 PyObject *_args;
6454{
6455 PyObject *_res = NULL;
6456 OSErr _err;
6457 FSSpec fileSpec;
6458 OSType creator;
6459 ScriptCode scriptTag;
6460 long createMovieFileFlags;
6461 short resRefNum;
6462 Movie newmovie;
6463 if (!PyArg_ParseTuple(_args, "O&O&hl",
6464 PyMac_GetFSSpec, &fileSpec,
6465 PyMac_GetOSType, &creator,
6466 &scriptTag,
6467 &createMovieFileFlags))
6468 return NULL;
6469 _err = CreateMovieFile(&fileSpec,
6470 creator,
6471 scriptTag,
6472 createMovieFileFlags,
6473 &resRefNum,
6474 &newmovie);
6475 if (_err != noErr) return PyMac_Error(_err);
6476 _res = Py_BuildValue("hO&",
6477 resRefNum,
6478 MovieObj_New, newmovie);
6479 return _res;
6480}
6481
6482static PyObject *Qt_OpenMovieFile(_self, _args)
6483 PyObject *_self;
6484 PyObject *_args;
6485{
6486 PyObject *_res = NULL;
6487 OSErr _err;
6488 FSSpec fileSpec;
6489 short resRefNum;
6490 SInt8 permission;
6491 if (!PyArg_ParseTuple(_args, "O&b",
6492 PyMac_GetFSSpec, &fileSpec,
6493 &permission))
6494 return NULL;
6495 _err = OpenMovieFile(&fileSpec,
6496 &resRefNum,
6497 permission);
6498 if (_err != noErr) return PyMac_Error(_err);
6499 _res = Py_BuildValue("h",
6500 resRefNum);
6501 return _res;
6502}
6503
6504static PyObject *Qt_CloseMovieFile(_self, _args)
6505 PyObject *_self;
6506 PyObject *_args;
6507{
6508 PyObject *_res = NULL;
6509 OSErr _err;
6510 short resRefNum;
6511 if (!PyArg_ParseTuple(_args, "h",
6512 &resRefNum))
6513 return NULL;
6514 _err = CloseMovieFile(resRefNum);
6515 if (_err != noErr) return PyMac_Error(_err);
6516 Py_INCREF(Py_None);
6517 _res = Py_None;
6518 return _res;
6519}
6520
6521static PyObject *Qt_DeleteMovieFile(_self, _args)
6522 PyObject *_self;
6523 PyObject *_args;
6524{
6525 PyObject *_res = NULL;
6526 OSErr _err;
6527 FSSpec fileSpec;
6528 if (!PyArg_ParseTuple(_args, "O&",
6529 PyMac_GetFSSpec, &fileSpec))
6530 return NULL;
6531 _err = DeleteMovieFile(&fileSpec);
6532 if (_err != noErr) return PyMac_Error(_err);
6533 Py_INCREF(Py_None);
6534 _res = Py_None;
6535 return _res;
6536}
6537
6538static PyObject *Qt_NewMovieFromFile(_self, _args)
6539 PyObject *_self;
6540 PyObject *_args;
6541{
6542 PyObject *_res = NULL;
6543 OSErr _err;
6544 Movie theMovie;
6545 short resRefNum;
Jack Jansene0cf87b1997-04-09 15:53:46 +00006546 short resId;
Jack Jansen453ced51995-11-30 17:42:08 +00006547 short newMovieFlags;
6548 Boolean dataRefWasChanged;
Jack Jansene0cf87b1997-04-09 15:53:46 +00006549 if (!PyArg_ParseTuple(_args, "hhh",
Jack Jansen453ced51995-11-30 17:42:08 +00006550 &resRefNum,
Jack Jansene0cf87b1997-04-09 15:53:46 +00006551 &resId,
Jack Jansen453ced51995-11-30 17:42:08 +00006552 &newMovieFlags))
6553 return NULL;
6554 _err = NewMovieFromFile(&theMovie,
6555 resRefNum,
Jack Jansene0cf87b1997-04-09 15:53:46 +00006556 &resId,
Jack Jansen9cfea101995-12-09 14:05:56 +00006557 (StringPtr)0,
Jack Jansen453ced51995-11-30 17:42:08 +00006558 newMovieFlags,
6559 &dataRefWasChanged);
6560 if (_err != noErr) return PyMac_Error(_err);
Jack Jansene0cf87b1997-04-09 15:53:46 +00006561 _res = Py_BuildValue("O&hb",
Jack Jansen453ced51995-11-30 17:42:08 +00006562 MovieObj_New, theMovie,
Jack Jansene0cf87b1997-04-09 15:53:46 +00006563 resId,
Jack Jansen453ced51995-11-30 17:42:08 +00006564 dataRefWasChanged);
6565 return _res;
6566}
6567
6568static PyObject *Qt_NewMovieFromHandle(_self, _args)
6569 PyObject *_self;
6570 PyObject *_args;
6571{
6572 PyObject *_res = NULL;
6573 OSErr _err;
6574 Movie theMovie;
6575 Handle h;
6576 short newMovieFlags;
6577 Boolean dataRefWasChanged;
6578 if (!PyArg_ParseTuple(_args, "O&h",
6579 ResObj_Convert, &h,
6580 &newMovieFlags))
6581 return NULL;
6582 _err = NewMovieFromHandle(&theMovie,
6583 h,
6584 newMovieFlags,
6585 &dataRefWasChanged);
6586 if (_err != noErr) return PyMac_Error(_err);
6587 _res = Py_BuildValue("O&b",
6588 MovieObj_New, theMovie,
6589 dataRefWasChanged);
6590 return _res;
6591}
6592
6593static PyObject *Qt_NewMovieFromDataFork(_self, _args)
6594 PyObject *_self;
6595 PyObject *_args;
6596{
6597 PyObject *_res = NULL;
6598 OSErr _err;
6599 Movie theMovie;
6600 short fRefNum;
6601 long fileOffset;
6602 short newMovieFlags;
6603 Boolean dataRefWasChanged;
6604 if (!PyArg_ParseTuple(_args, "hlh",
6605 &fRefNum,
6606 &fileOffset,
6607 &newMovieFlags))
6608 return NULL;
6609 _err = NewMovieFromDataFork(&theMovie,
6610 fRefNum,
6611 fileOffset,
6612 newMovieFlags,
6613 &dataRefWasChanged);
6614 if (_err != noErr) return PyMac_Error(_err);
6615 _res = Py_BuildValue("O&b",
6616 MovieObj_New, theMovie,
6617 dataRefWasChanged);
6618 return _res;
6619}
6620
Jack Jansen1c4e6141998-04-21 15:23:55 +00006621static PyObject *Qt_NewMovieFromDataRef(_self, _args)
6622 PyObject *_self;
6623 PyObject *_args;
6624{
6625 PyObject *_res = NULL;
6626 OSErr _err;
6627 Movie m;
6628 short flags;
6629 short id;
6630 Handle dataRef;
6631 OSType dataRefType;
6632 if (!PyArg_ParseTuple(_args, "hO&O&",
6633 &flags,
6634 ResObj_Convert, &dataRef,
6635 PyMac_GetOSType, &dataRefType))
6636 return NULL;
6637 _err = NewMovieFromDataRef(&m,
6638 flags,
6639 &id,
6640 dataRef,
6641 dataRefType);
6642 if (_err != noErr) return PyMac_Error(_err);
6643 _res = Py_BuildValue("O&h",
6644 MovieObj_New, m,
6645 id);
6646 return _res;
6647}
6648
Jack Jansen453ced51995-11-30 17:42:08 +00006649static PyObject *Qt_RemoveMovieResource(_self, _args)
6650 PyObject *_self;
6651 PyObject *_args;
6652{
6653 PyObject *_res = NULL;
6654 OSErr _err;
6655 short resRefNum;
6656 short resId;
6657 if (!PyArg_ParseTuple(_args, "hh",
6658 &resRefNum,
6659 &resId))
6660 return NULL;
6661 _err = RemoveMovieResource(resRefNum,
6662 resId);
6663 if (_err != noErr) return PyMac_Error(_err);
6664 Py_INCREF(Py_None);
6665 _res = Py_None;
6666 return _res;
6667}
6668
Jack Jansen453ced51995-11-30 17:42:08 +00006669static PyObject *Qt_NewMovieFromScrap(_self, _args)
6670 PyObject *_self;
6671 PyObject *_args;
6672{
6673 PyObject *_res = NULL;
6674 Movie _rv;
6675 long newMovieFlags;
6676 if (!PyArg_ParseTuple(_args, "l",
6677 &newMovieFlags))
6678 return NULL;
6679 _rv = NewMovieFromScrap(newMovieFlags);
6680 _res = Py_BuildValue("O&",
6681 MovieObj_New, _rv);
6682 return _res;
6683}
6684
Jack Jansen1c4e6141998-04-21 15:23:55 +00006685static PyObject *Qt_QTNewAlias(_self, _args)
6686 PyObject *_self;
6687 PyObject *_args;
6688{
6689 PyObject *_res = NULL;
6690 OSErr _err;
6691 FSSpec fss;
6692 AliasHandle alias;
6693 Boolean minimal;
6694 if (!PyArg_ParseTuple(_args, "O&b",
6695 PyMac_GetFSSpec, &fss,
6696 &minimal))
6697 return NULL;
6698 _err = QTNewAlias(&fss,
6699 &alias,
6700 minimal);
6701 if (_err != noErr) return PyMac_Error(_err);
6702 _res = Py_BuildValue("O&",
6703 ResObj_New, alias);
6704 return _res;
6705}
6706
6707static PyObject *Qt_EndFullScreen(_self, _args)
6708 PyObject *_self;
6709 PyObject *_args;
6710{
6711 PyObject *_res = NULL;
6712 OSErr _err;
6713 Ptr fullState;
6714 long flags;
6715 if (!PyArg_ParseTuple(_args, "sl",
6716 &fullState,
6717 &flags))
6718 return NULL;
6719 _err = EndFullScreen(fullState,
6720 flags);
6721 if (_err != noErr) return PyMac_Error(_err);
6722 Py_INCREF(Py_None);
6723 _res = Py_None;
6724 return _res;
6725}
6726
6727static PyObject *Qt_AddSoundDescriptionExtension(_self, _args)
6728 PyObject *_self;
6729 PyObject *_args;
6730{
6731 PyObject *_res = NULL;
6732 OSErr _err;
6733 SoundDescriptionHandle desc;
6734 Handle extension;
6735 OSType idType;
6736 if (!PyArg_ParseTuple(_args, "O&O&O&",
6737 ResObj_Convert, &desc,
6738 ResObj_Convert, &extension,
6739 PyMac_GetOSType, &idType))
6740 return NULL;
6741 _err = AddSoundDescriptionExtension(desc,
6742 extension,
6743 idType);
6744 if (_err != noErr) return PyMac_Error(_err);
6745 Py_INCREF(Py_None);
6746 _res = Py_None;
6747 return _res;
6748}
6749
6750static PyObject *Qt_GetSoundDescriptionExtension(_self, _args)
6751 PyObject *_self;
6752 PyObject *_args;
6753{
6754 PyObject *_res = NULL;
6755 OSErr _err;
6756 SoundDescriptionHandle desc;
6757 Handle extension;
6758 OSType idType;
6759 if (!PyArg_ParseTuple(_args, "O&O&",
6760 ResObj_Convert, &desc,
6761 PyMac_GetOSType, &idType))
6762 return NULL;
6763 _err = GetSoundDescriptionExtension(desc,
6764 &extension,
6765 idType);
6766 if (_err != noErr) return PyMac_Error(_err);
6767 _res = Py_BuildValue("O&",
6768 ResObj_New, extension);
6769 return _res;
6770}
6771
6772static PyObject *Qt_RemoveSoundDescriptionExtension(_self, _args)
6773 PyObject *_self;
6774 PyObject *_args;
6775{
6776 PyObject *_res = NULL;
6777 OSErr _err;
6778 SoundDescriptionHandle desc;
6779 OSType idType;
6780 if (!PyArg_ParseTuple(_args, "O&O&",
6781 ResObj_Convert, &desc,
6782 PyMac_GetOSType, &idType))
6783 return NULL;
6784 _err = RemoveSoundDescriptionExtension(desc,
6785 idType);
6786 if (_err != noErr) return PyMac_Error(_err);
6787 Py_INCREF(Py_None);
6788 _res = Py_None;
6789 return _res;
6790}
6791
6792static PyObject *Qt_QTIsStandardParameterDialogEvent(_self, _args)
6793 PyObject *_self;
6794 PyObject *_args;
6795{
6796 PyObject *_res = NULL;
6797 OSErr _err;
6798 EventRecord pEvent;
6799 QTParameterDialog createdDialog;
6800 if (!PyArg_ParseTuple(_args, "l",
6801 &createdDialog))
6802 return NULL;
6803 _err = QTIsStandardParameterDialogEvent(&pEvent,
6804 createdDialog);
6805 if (_err != noErr) return PyMac_Error(_err);
6806 _res = Py_BuildValue("O&",
6807 PyMac_BuildEventRecord, &pEvent);
6808 return _res;
6809}
6810
6811static PyObject *Qt_QTDismissStandardParameterDialog(_self, _args)
6812 PyObject *_self;
6813 PyObject *_args;
6814{
6815 PyObject *_res = NULL;
6816 OSErr _err;
6817 QTParameterDialog createdDialog;
6818 if (!PyArg_ParseTuple(_args, "l",
6819 &createdDialog))
6820 return NULL;
6821 _err = QTDismissStandardParameterDialog(createdDialog);
6822 if (_err != noErr) return PyMac_Error(_err);
6823 Py_INCREF(Py_None);
6824 _res = Py_None;
6825 return _res;
6826}
6827
6828static PyObject *Qt_QTStandardParameterDialogDoAction(_self, _args)
6829 PyObject *_self;
6830 PyObject *_args;
6831{
6832 PyObject *_res = NULL;
6833 OSErr _err;
6834 QTParameterDialog createdDialog;
6835 long action;
6836 void * params;
6837 if (!PyArg_ParseTuple(_args, "lls",
6838 &createdDialog,
6839 &action,
6840 &params))
6841 return NULL;
6842 _err = QTStandardParameterDialogDoAction(createdDialog,
6843 action,
6844 params);
6845 if (_err != noErr) return PyMac_Error(_err);
6846 Py_INCREF(Py_None);
6847 _res = Py_None;
6848 return _res;
6849}
6850
6851static PyObject *Qt_QTRegisterAccessKey(_self, _args)
6852 PyObject *_self;
6853 PyObject *_args;
6854{
6855 PyObject *_res = NULL;
6856 OSErr _err;
6857 Str255 accessKeyType;
6858 long flags;
6859 Handle accessKey;
6860 if (!PyArg_ParseTuple(_args, "O&lO&",
6861 PyMac_GetStr255, accessKeyType,
6862 &flags,
6863 ResObj_Convert, &accessKey))
6864 return NULL;
6865 _err = QTRegisterAccessKey(accessKeyType,
6866 flags,
6867 accessKey);
6868 if (_err != noErr) return PyMac_Error(_err);
6869 Py_INCREF(Py_None);
6870 _res = Py_None;
6871 return _res;
6872}
6873
6874static PyObject *Qt_QTUnregisterAccessKey(_self, _args)
6875 PyObject *_self;
6876 PyObject *_args;
6877{
6878 PyObject *_res = NULL;
6879 OSErr _err;
6880 Str255 accessKeyType;
6881 long flags;
6882 Handle accessKey;
6883 if (!PyArg_ParseTuple(_args, "O&lO&",
6884 PyMac_GetStr255, accessKeyType,
6885 &flags,
6886 ResObj_Convert, &accessKey))
6887 return NULL;
6888 _err = QTUnregisterAccessKey(accessKeyType,
6889 flags,
6890 accessKey);
6891 if (_err != noErr) return PyMac_Error(_err);
6892 Py_INCREF(Py_None);
6893 _res = Py_None;
6894 return _res;
6895}
6896
6897static PyObject *Qt_QTTextToNativeText(_self, _args)
6898 PyObject *_self;
6899 PyObject *_args;
6900{
6901 PyObject *_res = NULL;
6902 OSErr _err;
6903 Handle theText;
6904 long encoding;
6905 long flags;
6906 if (!PyArg_ParseTuple(_args, "O&ll",
6907 ResObj_Convert, &theText,
6908 &encoding,
6909 &flags))
6910 return NULL;
6911 _err = QTTextToNativeText(theText,
6912 encoding,
6913 flags);
6914 if (_err != noErr) return PyMac_Error(_err);
6915 Py_INCREF(Py_None);
6916 _res = Py_None;
6917 return _res;
6918}
6919
6920static PyObject *Qt_VideoMediaResetStatistics(_self, _args)
6921 PyObject *_self;
6922 PyObject *_args;
6923{
6924 PyObject *_res = NULL;
6925 ComponentResult _rv;
6926 MediaHandler mh;
6927 if (!PyArg_ParseTuple(_args, "O&",
6928 CmpInstObj_Convert, &mh))
6929 return NULL;
6930 _rv = VideoMediaResetStatistics(mh);
6931 _res = Py_BuildValue("l",
6932 _rv);
6933 return _res;
6934}
6935
6936static PyObject *Qt_VideoMediaGetStatistics(_self, _args)
6937 PyObject *_self;
6938 PyObject *_args;
6939{
6940 PyObject *_res = NULL;
6941 ComponentResult _rv;
6942 MediaHandler mh;
6943 if (!PyArg_ParseTuple(_args, "O&",
6944 CmpInstObj_Convert, &mh))
6945 return NULL;
6946 _rv = VideoMediaGetStatistics(mh);
6947 _res = Py_BuildValue("l",
6948 _rv);
6949 return _res;
6950}
6951
Jack Jansena05ac601999-12-12 21:41:51 +00006952static PyObject *Qt_VideoMediaGetStallCount(_self, _args)
6953 PyObject *_self;
6954 PyObject *_args;
6955{
6956 PyObject *_res = NULL;
6957 ComponentResult _rv;
6958 MediaHandler mh;
6959 unsigned long stalls;
6960 if (!PyArg_ParseTuple(_args, "O&",
6961 CmpInstObj_Convert, &mh))
6962 return NULL;
6963 _rv = VideoMediaGetStallCount(mh,
6964 &stalls);
6965 _res = Py_BuildValue("ll",
6966 _rv,
6967 stalls);
6968 return _res;
6969}
6970
Jack Jansen1c4e6141998-04-21 15:23:55 +00006971static PyObject *Qt_TextMediaAddTextSample(_self, _args)
6972 PyObject *_self;
6973 PyObject *_args;
6974{
6975 PyObject *_res = NULL;
6976 ComponentResult _rv;
6977 MediaHandler mh;
6978 Ptr text;
6979 unsigned long size;
6980 short fontNumber;
6981 short fontSize;
6982 Style textFace;
6983 RGBColor textColor;
6984 RGBColor backColor;
6985 short textJustification;
6986 Rect textBox;
6987 long displayFlags;
6988 TimeValue scrollDelay;
6989 short hiliteStart;
6990 short hiliteEnd;
6991 RGBColor rgbHiliteColor;
6992 TimeValue duration;
6993 TimeValue sampleTime;
6994 if (!PyArg_ParseTuple(_args, "O&slhhbhllhhl",
6995 CmpInstObj_Convert, &mh,
6996 &text,
6997 &size,
6998 &fontNumber,
6999 &fontSize,
7000 &textFace,
7001 &textJustification,
7002 &displayFlags,
7003 &scrollDelay,
7004 &hiliteStart,
7005 &hiliteEnd,
7006 &duration))
7007 return NULL;
7008 _rv = TextMediaAddTextSample(mh,
7009 text,
7010 size,
7011 fontNumber,
7012 fontSize,
7013 textFace,
7014 &textColor,
7015 &backColor,
7016 textJustification,
7017 &textBox,
7018 displayFlags,
7019 scrollDelay,
7020 hiliteStart,
7021 hiliteEnd,
7022 &rgbHiliteColor,
7023 duration,
7024 &sampleTime);
7025 _res = Py_BuildValue("lO&O&O&O&l",
7026 _rv,
7027 QdRGB_New, &textColor,
7028 QdRGB_New, &backColor,
7029 PyMac_BuildRect, &textBox,
7030 QdRGB_New, &rgbHiliteColor,
7031 sampleTime);
7032 return _res;
7033}
7034
7035static PyObject *Qt_TextMediaAddTESample(_self, _args)
7036 PyObject *_self;
7037 PyObject *_args;
7038{
7039 PyObject *_res = NULL;
7040 ComponentResult _rv;
7041 MediaHandler mh;
7042 TEHandle hTE;
7043 RGBColor backColor;
7044 short textJustification;
7045 Rect textBox;
7046 long displayFlags;
7047 TimeValue scrollDelay;
7048 short hiliteStart;
7049 short hiliteEnd;
7050 RGBColor rgbHiliteColor;
7051 TimeValue duration;
7052 TimeValue sampleTime;
7053 if (!PyArg_ParseTuple(_args, "O&O&hllhhl",
7054 CmpInstObj_Convert, &mh,
7055 ResObj_Convert, &hTE,
7056 &textJustification,
7057 &displayFlags,
7058 &scrollDelay,
7059 &hiliteStart,
7060 &hiliteEnd,
7061 &duration))
7062 return NULL;
7063 _rv = TextMediaAddTESample(mh,
7064 hTE,
7065 &backColor,
7066 textJustification,
7067 &textBox,
7068 displayFlags,
7069 scrollDelay,
7070 hiliteStart,
7071 hiliteEnd,
7072 &rgbHiliteColor,
7073 duration,
7074 &sampleTime);
7075 _res = Py_BuildValue("lO&O&O&l",
7076 _rv,
7077 QdRGB_New, &backColor,
7078 PyMac_BuildRect, &textBox,
7079 QdRGB_New, &rgbHiliteColor,
7080 sampleTime);
7081 return _res;
7082}
7083
7084static PyObject *Qt_TextMediaAddHiliteSample(_self, _args)
7085 PyObject *_self;
7086 PyObject *_args;
7087{
7088 PyObject *_res = NULL;
7089 ComponentResult _rv;
7090 MediaHandler mh;
7091 short hiliteStart;
7092 short hiliteEnd;
7093 RGBColor rgbHiliteColor;
7094 TimeValue duration;
7095 TimeValue sampleTime;
7096 if (!PyArg_ParseTuple(_args, "O&hhl",
7097 CmpInstObj_Convert, &mh,
7098 &hiliteStart,
7099 &hiliteEnd,
7100 &duration))
7101 return NULL;
7102 _rv = TextMediaAddHiliteSample(mh,
7103 hiliteStart,
7104 hiliteEnd,
7105 &rgbHiliteColor,
7106 duration,
7107 &sampleTime);
7108 _res = Py_BuildValue("lO&l",
7109 _rv,
7110 QdRGB_New, &rgbHiliteColor,
7111 sampleTime);
7112 return _res;
7113}
7114
7115static PyObject *Qt_TextMediaFindNextText(_self, _args)
7116 PyObject *_self;
7117 PyObject *_args;
7118{
7119 PyObject *_res = NULL;
7120 ComponentResult _rv;
7121 MediaHandler mh;
7122 Ptr text;
7123 long size;
7124 short findFlags;
7125 TimeValue startTime;
7126 TimeValue foundTime;
7127 TimeValue foundDuration;
7128 long offset;
7129 if (!PyArg_ParseTuple(_args, "O&slhl",
7130 CmpInstObj_Convert, &mh,
7131 &text,
7132 &size,
7133 &findFlags,
7134 &startTime))
7135 return NULL;
7136 _rv = TextMediaFindNextText(mh,
7137 text,
7138 size,
7139 findFlags,
7140 startTime,
7141 &foundTime,
7142 &foundDuration,
7143 &offset);
7144 _res = Py_BuildValue("llll",
7145 _rv,
7146 foundTime,
7147 foundDuration,
7148 offset);
7149 return _res;
7150}
7151
7152static PyObject *Qt_TextMediaHiliteTextSample(_self, _args)
7153 PyObject *_self;
7154 PyObject *_args;
7155{
7156 PyObject *_res = NULL;
7157 ComponentResult _rv;
7158 MediaHandler mh;
7159 TimeValue sampleTime;
7160 short hiliteStart;
7161 short hiliteEnd;
7162 RGBColor rgbHiliteColor;
7163 if (!PyArg_ParseTuple(_args, "O&lhh",
7164 CmpInstObj_Convert, &mh,
7165 &sampleTime,
7166 &hiliteStart,
7167 &hiliteEnd))
7168 return NULL;
7169 _rv = TextMediaHiliteTextSample(mh,
7170 sampleTime,
7171 hiliteStart,
7172 hiliteEnd,
7173 &rgbHiliteColor);
7174 _res = Py_BuildValue("lO&",
7175 _rv,
7176 QdRGB_New, &rgbHiliteColor);
7177 return _res;
7178}
7179
7180static PyObject *Qt_TextMediaSetTextSampleData(_self, _args)
7181 PyObject *_self;
7182 PyObject *_args;
7183{
7184 PyObject *_res = NULL;
7185 ComponentResult _rv;
7186 MediaHandler mh;
7187 void * data;
7188 OSType dataType;
7189 if (!PyArg_ParseTuple(_args, "O&sO&",
7190 CmpInstObj_Convert, &mh,
7191 &data,
7192 PyMac_GetOSType, &dataType))
7193 return NULL;
7194 _rv = TextMediaSetTextSampleData(mh,
7195 data,
7196 dataType);
7197 _res = Py_BuildValue("l",
7198 _rv);
7199 return _res;
7200}
7201
7202static PyObject *Qt_SpriteMediaSetProperty(_self, _args)
7203 PyObject *_self;
7204 PyObject *_args;
7205{
7206 PyObject *_res = NULL;
7207 ComponentResult _rv;
7208 MediaHandler mh;
7209 short spriteIndex;
7210 long propertyType;
7211 void * propertyValue;
7212 if (!PyArg_ParseTuple(_args, "O&hls",
7213 CmpInstObj_Convert, &mh,
7214 &spriteIndex,
7215 &propertyType,
7216 &propertyValue))
7217 return NULL;
7218 _rv = SpriteMediaSetProperty(mh,
7219 spriteIndex,
7220 propertyType,
7221 propertyValue);
7222 _res = Py_BuildValue("l",
7223 _rv);
7224 return _res;
7225}
7226
7227static PyObject *Qt_SpriteMediaGetProperty(_self, _args)
7228 PyObject *_self;
7229 PyObject *_args;
7230{
7231 PyObject *_res = NULL;
7232 ComponentResult _rv;
7233 MediaHandler mh;
7234 short spriteIndex;
7235 long propertyType;
7236 void * propertyValue;
7237 if (!PyArg_ParseTuple(_args, "O&hls",
7238 CmpInstObj_Convert, &mh,
7239 &spriteIndex,
7240 &propertyType,
7241 &propertyValue))
7242 return NULL;
7243 _rv = SpriteMediaGetProperty(mh,
7244 spriteIndex,
7245 propertyType,
7246 propertyValue);
7247 _res = Py_BuildValue("l",
7248 _rv);
7249 return _res;
7250}
7251
7252static PyObject *Qt_SpriteMediaHitTestSprites(_self, _args)
7253 PyObject *_self;
7254 PyObject *_args;
7255{
7256 PyObject *_res = NULL;
7257 ComponentResult _rv;
7258 MediaHandler mh;
7259 long flags;
7260 Point loc;
7261 short spriteHitIndex;
7262 if (!PyArg_ParseTuple(_args, "O&lO&",
7263 CmpInstObj_Convert, &mh,
7264 &flags,
7265 PyMac_GetPoint, &loc))
7266 return NULL;
7267 _rv = SpriteMediaHitTestSprites(mh,
7268 flags,
7269 loc,
7270 &spriteHitIndex);
7271 _res = Py_BuildValue("lh",
7272 _rv,
7273 spriteHitIndex);
7274 return _res;
7275}
7276
7277static PyObject *Qt_SpriteMediaCountSprites(_self, _args)
7278 PyObject *_self;
7279 PyObject *_args;
7280{
7281 PyObject *_res = NULL;
7282 ComponentResult _rv;
7283 MediaHandler mh;
7284 short numSprites;
7285 if (!PyArg_ParseTuple(_args, "O&",
7286 CmpInstObj_Convert, &mh))
7287 return NULL;
7288 _rv = SpriteMediaCountSprites(mh,
7289 &numSprites);
7290 _res = Py_BuildValue("lh",
7291 _rv,
7292 numSprites);
7293 return _res;
7294}
7295
7296static PyObject *Qt_SpriteMediaCountImages(_self, _args)
7297 PyObject *_self;
7298 PyObject *_args;
7299{
7300 PyObject *_res = NULL;
7301 ComponentResult _rv;
7302 MediaHandler mh;
7303 short numImages;
7304 if (!PyArg_ParseTuple(_args, "O&",
7305 CmpInstObj_Convert, &mh))
7306 return NULL;
7307 _rv = SpriteMediaCountImages(mh,
7308 &numImages);
7309 _res = Py_BuildValue("lh",
7310 _rv,
7311 numImages);
7312 return _res;
7313}
7314
7315static PyObject *Qt_SpriteMediaGetIndImageDescription(_self, _args)
7316 PyObject *_self;
7317 PyObject *_args;
7318{
7319 PyObject *_res = NULL;
7320 ComponentResult _rv;
7321 MediaHandler mh;
7322 short imageIndex;
7323 ImageDescriptionHandle imageDescription;
7324 if (!PyArg_ParseTuple(_args, "O&hO&",
7325 CmpInstObj_Convert, &mh,
7326 &imageIndex,
7327 ResObj_Convert, &imageDescription))
7328 return NULL;
7329 _rv = SpriteMediaGetIndImageDescription(mh,
7330 imageIndex,
7331 imageDescription);
7332 _res = Py_BuildValue("l",
7333 _rv);
7334 return _res;
7335}
7336
7337static PyObject *Qt_SpriteMediaGetDisplayedSampleNumber(_self, _args)
7338 PyObject *_self;
7339 PyObject *_args;
7340{
7341 PyObject *_res = NULL;
7342 ComponentResult _rv;
7343 MediaHandler mh;
7344 long sampleNum;
7345 if (!PyArg_ParseTuple(_args, "O&",
7346 CmpInstObj_Convert, &mh))
7347 return NULL;
7348 _rv = SpriteMediaGetDisplayedSampleNumber(mh,
7349 &sampleNum);
7350 _res = Py_BuildValue("ll",
7351 _rv,
7352 sampleNum);
7353 return _res;
7354}
7355
7356static PyObject *Qt_SpriteMediaGetSpriteName(_self, _args)
7357 PyObject *_self;
7358 PyObject *_args;
7359{
7360 PyObject *_res = NULL;
7361 ComponentResult _rv;
7362 MediaHandler mh;
7363 QTAtomID spriteID;
7364 Str255 spriteName;
7365 if (!PyArg_ParseTuple(_args, "O&lO&",
7366 CmpInstObj_Convert, &mh,
7367 &spriteID,
7368 PyMac_GetStr255, spriteName))
7369 return NULL;
7370 _rv = SpriteMediaGetSpriteName(mh,
7371 spriteID,
7372 spriteName);
7373 _res = Py_BuildValue("l",
7374 _rv);
7375 return _res;
7376}
7377
7378static PyObject *Qt_SpriteMediaGetImageName(_self, _args)
7379 PyObject *_self;
7380 PyObject *_args;
7381{
7382 PyObject *_res = NULL;
7383 ComponentResult _rv;
7384 MediaHandler mh;
7385 short imageIndex;
7386 Str255 imageName;
7387 if (!PyArg_ParseTuple(_args, "O&hO&",
7388 CmpInstObj_Convert, &mh,
7389 &imageIndex,
7390 PyMac_GetStr255, imageName))
7391 return NULL;
7392 _rv = SpriteMediaGetImageName(mh,
7393 imageIndex,
7394 imageName);
7395 _res = Py_BuildValue("l",
7396 _rv);
7397 return _res;
7398}
7399
7400static PyObject *Qt_SpriteMediaSetSpriteProperty(_self, _args)
7401 PyObject *_self;
7402 PyObject *_args;
7403{
7404 PyObject *_res = NULL;
7405 ComponentResult _rv;
7406 MediaHandler mh;
7407 QTAtomID spriteID;
7408 long propertyType;
7409 void * propertyValue;
7410 if (!PyArg_ParseTuple(_args, "O&lls",
7411 CmpInstObj_Convert, &mh,
7412 &spriteID,
7413 &propertyType,
7414 &propertyValue))
7415 return NULL;
7416 _rv = SpriteMediaSetSpriteProperty(mh,
7417 spriteID,
7418 propertyType,
7419 propertyValue);
7420 _res = Py_BuildValue("l",
7421 _rv);
7422 return _res;
7423}
7424
7425static PyObject *Qt_SpriteMediaGetSpriteProperty(_self, _args)
7426 PyObject *_self;
7427 PyObject *_args;
7428{
7429 PyObject *_res = NULL;
7430 ComponentResult _rv;
7431 MediaHandler mh;
7432 QTAtomID spriteID;
7433 long propertyType;
7434 void * propertyValue;
7435 if (!PyArg_ParseTuple(_args, "O&lls",
7436 CmpInstObj_Convert, &mh,
7437 &spriteID,
7438 &propertyType,
7439 &propertyValue))
7440 return NULL;
7441 _rv = SpriteMediaGetSpriteProperty(mh,
7442 spriteID,
7443 propertyType,
7444 propertyValue);
7445 _res = Py_BuildValue("l",
7446 _rv);
7447 return _res;
7448}
7449
7450static PyObject *Qt_SpriteMediaHitTestAllSprites(_self, _args)
7451 PyObject *_self;
7452 PyObject *_args;
7453{
7454 PyObject *_res = NULL;
7455 ComponentResult _rv;
7456 MediaHandler mh;
7457 long flags;
7458 Point loc;
7459 QTAtomID spriteHitID;
7460 if (!PyArg_ParseTuple(_args, "O&lO&",
7461 CmpInstObj_Convert, &mh,
7462 &flags,
7463 PyMac_GetPoint, &loc))
7464 return NULL;
7465 _rv = SpriteMediaHitTestAllSprites(mh,
7466 flags,
7467 loc,
7468 &spriteHitID);
7469 _res = Py_BuildValue("ll",
7470 _rv,
7471 spriteHitID);
7472 return _res;
7473}
7474
7475static PyObject *Qt_SpriteMediaHitTestOneSprite(_self, _args)
7476 PyObject *_self;
7477 PyObject *_args;
7478{
7479 PyObject *_res = NULL;
7480 ComponentResult _rv;
7481 MediaHandler mh;
7482 QTAtomID spriteID;
7483 long flags;
7484 Point loc;
7485 Boolean wasHit;
7486 if (!PyArg_ParseTuple(_args, "O&llO&",
7487 CmpInstObj_Convert, &mh,
7488 &spriteID,
7489 &flags,
7490 PyMac_GetPoint, &loc))
7491 return NULL;
7492 _rv = SpriteMediaHitTestOneSprite(mh,
7493 spriteID,
7494 flags,
7495 loc,
7496 &wasHit);
7497 _res = Py_BuildValue("lb",
7498 _rv,
7499 wasHit);
7500 return _res;
7501}
7502
7503static PyObject *Qt_SpriteMediaSpriteIndexToID(_self, _args)
7504 PyObject *_self;
7505 PyObject *_args;
7506{
7507 PyObject *_res = NULL;
7508 ComponentResult _rv;
7509 MediaHandler mh;
7510 short spriteIndex;
7511 QTAtomID spriteID;
7512 if (!PyArg_ParseTuple(_args, "O&h",
7513 CmpInstObj_Convert, &mh,
7514 &spriteIndex))
7515 return NULL;
7516 _rv = SpriteMediaSpriteIndexToID(mh,
7517 spriteIndex,
7518 &spriteID);
7519 _res = Py_BuildValue("ll",
7520 _rv,
7521 spriteID);
7522 return _res;
7523}
7524
7525static PyObject *Qt_SpriteMediaSpriteIDToIndex(_self, _args)
7526 PyObject *_self;
7527 PyObject *_args;
7528{
7529 PyObject *_res = NULL;
7530 ComponentResult _rv;
7531 MediaHandler mh;
7532 QTAtomID spriteID;
7533 short spriteIndex;
7534 if (!PyArg_ParseTuple(_args, "O&l",
7535 CmpInstObj_Convert, &mh,
7536 &spriteID))
7537 return NULL;
7538 _rv = SpriteMediaSpriteIDToIndex(mh,
7539 spriteID,
7540 &spriteIndex);
7541 _res = Py_BuildValue("lh",
7542 _rv,
7543 spriteIndex);
7544 return _res;
7545}
7546
7547static PyObject *Qt_SpriteMediaSetActionVariable(_self, _args)
7548 PyObject *_self;
7549 PyObject *_args;
7550{
7551 PyObject *_res = NULL;
7552 ComponentResult _rv;
7553 MediaHandler mh;
7554 QTAtomID variableID;
7555 float value;
7556 if (!PyArg_ParseTuple(_args, "O&lf",
7557 CmpInstObj_Convert, &mh,
7558 &variableID,
7559 &value))
7560 return NULL;
7561 _rv = SpriteMediaSetActionVariable(mh,
7562 variableID,
7563 &value);
7564 _res = Py_BuildValue("l",
7565 _rv);
7566 return _res;
7567}
7568
7569static PyObject *Qt_SpriteMediaGetActionVariable(_self, _args)
7570 PyObject *_self;
7571 PyObject *_args;
7572{
7573 PyObject *_res = NULL;
7574 ComponentResult _rv;
7575 MediaHandler mh;
7576 QTAtomID variableID;
7577 float value;
7578 if (!PyArg_ParseTuple(_args, "O&l",
7579 CmpInstObj_Convert, &mh,
7580 &variableID))
7581 return NULL;
7582 _rv = SpriteMediaGetActionVariable(mh,
7583 variableID,
7584 &value);
7585 _res = Py_BuildValue("lf",
7586 _rv,
7587 value);
7588 return _res;
7589}
7590
7591static PyObject *Qt_SpriteMediaGetIndImageProperty(_self, _args)
7592 PyObject *_self;
7593 PyObject *_args;
7594{
7595 PyObject *_res = NULL;
7596 ComponentResult _rv;
7597 MediaHandler mh;
7598 short imageIndex;
7599 long imagePropertyType;
7600 void * imagePropertyValue;
7601 if (!PyArg_ParseTuple(_args, "O&hls",
7602 CmpInstObj_Convert, &mh,
7603 &imageIndex,
7604 &imagePropertyType,
7605 &imagePropertyValue))
7606 return NULL;
7607 _rv = SpriteMediaGetIndImageProperty(mh,
7608 imageIndex,
7609 imagePropertyType,
7610 imagePropertyValue);
7611 _res = Py_BuildValue("l",
7612 _rv);
7613 return _res;
7614}
7615
Jack Jansen453ced51995-11-30 17:42:08 +00007616static PyObject *Qt_NewTimeBase(_self, _args)
7617 PyObject *_self;
7618 PyObject *_args;
7619{
7620 PyObject *_res = NULL;
7621 TimeBase _rv;
7622 if (!PyArg_ParseTuple(_args, ""))
7623 return NULL;
7624 _rv = NewTimeBase();
7625 _res = Py_BuildValue("O&",
7626 TimeBaseObj_New, _rv);
7627 return _res;
7628}
7629
Jack Jansenb2006391998-04-23 13:22:44 +00007630static PyObject *Qt_ConvertTime(_self, _args)
7631 PyObject *_self;
7632 PyObject *_args;
7633{
7634 PyObject *_res = NULL;
7635 TimeRecord inout;
7636 TimeBase newBase;
Jack Jansen1b7a70f2000-03-03 17:06:13 +00007637 if (!PyArg_ParseTuple(_args, "O&O&",
7638 QtTimeRecord_Convert, &inout,
Jack Jansenb2006391998-04-23 13:22:44 +00007639 TimeBaseObj_Convert, &newBase))
7640 return NULL;
7641 ConvertTime(&inout,
7642 newBase);
7643 _res = Py_BuildValue("O&",
7644 QtTimeRecord_New, &inout);
7645 return _res;
7646}
7647
7648static PyObject *Qt_ConvertTimeScale(_self, _args)
7649 PyObject *_self;
7650 PyObject *_args;
7651{
7652 PyObject *_res = NULL;
7653 TimeRecord inout;
7654 TimeScale newScale;
Jack Jansen1b7a70f2000-03-03 17:06:13 +00007655 if (!PyArg_ParseTuple(_args, "O&l",
7656 QtTimeRecord_Convert, &inout,
Jack Jansenb2006391998-04-23 13:22:44 +00007657 &newScale))
7658 return NULL;
7659 ConvertTimeScale(&inout,
7660 newScale);
7661 _res = Py_BuildValue("O&",
7662 QtTimeRecord_New, &inout);
7663 return _res;
7664}
7665
7666static PyObject *Qt_AddTime(_self, _args)
7667 PyObject *_self;
7668 PyObject *_args;
7669{
7670 PyObject *_res = NULL;
7671 TimeRecord dst;
7672 TimeRecord src;
Jack Jansen1b7a70f2000-03-03 17:06:13 +00007673 if (!PyArg_ParseTuple(_args, "O&O&",
7674 QtTimeRecord_Convert, &dst,
Jack Jansenb2006391998-04-23 13:22:44 +00007675 QtTimeRecord_Convert, &src))
7676 return NULL;
7677 AddTime(&dst,
7678 &src);
7679 _res = Py_BuildValue("O&",
7680 QtTimeRecord_New, &dst);
7681 return _res;
7682}
7683
7684static PyObject *Qt_SubtractTime(_self, _args)
7685 PyObject *_self;
7686 PyObject *_args;
7687{
7688 PyObject *_res = NULL;
7689 TimeRecord dst;
7690 TimeRecord src;
Jack Jansen1b7a70f2000-03-03 17:06:13 +00007691 if (!PyArg_ParseTuple(_args, "O&O&",
7692 QtTimeRecord_Convert, &dst,
Jack Jansenb2006391998-04-23 13:22:44 +00007693 QtTimeRecord_Convert, &src))
7694 return NULL;
7695 SubtractTime(&dst,
7696 &src);
7697 _res = Py_BuildValue("O&",
7698 QtTimeRecord_New, &dst);
7699 return _res;
7700}
7701
Jack Jansen1c4e6141998-04-21 15:23:55 +00007702static PyObject *Qt_MusicMediaGetIndexedTunePlayer(_self, _args)
7703 PyObject *_self;
7704 PyObject *_args;
7705{
7706 PyObject *_res = NULL;
7707 ComponentResult _rv;
7708 ComponentInstance ti;
7709 long sampleDescIndex;
7710 ComponentInstance tp;
7711 if (!PyArg_ParseTuple(_args, "O&l",
7712 CmpInstObj_Convert, &ti,
7713 &sampleDescIndex))
7714 return NULL;
7715 _rv = MusicMediaGetIndexedTunePlayer(ti,
7716 sampleDescIndex,
7717 &tp);
7718 _res = Py_BuildValue("lO&",
7719 _rv,
7720 CmpInstObj_New, tp);
7721 return _res;
7722}
7723
Jack Jansen9cfea101995-12-09 14:05:56 +00007724static PyObject *Qt_AlignWindow(_self, _args)
7725 PyObject *_self;
7726 PyObject *_args;
7727{
7728 PyObject *_res = NULL;
7729 WindowPtr wp;
7730 Boolean front;
7731 if (!PyArg_ParseTuple(_args, "O&b",
7732 WinObj_Convert, &wp,
7733 &front))
7734 return NULL;
7735 AlignWindow(wp,
7736 front,
7737 (Rect *)0,
7738 (ICMAlignmentProcRecordPtr)0);
7739 Py_INCREF(Py_None);
7740 _res = Py_None;
7741 return _res;
7742}
7743
7744static PyObject *Qt_DragAlignedWindow(_self, _args)
7745 PyObject *_self;
7746 PyObject *_args;
7747{
7748 PyObject *_res = NULL;
7749 WindowPtr wp;
7750 Point startPt;
7751 Rect boundsRect;
7752 if (!PyArg_ParseTuple(_args, "O&O&O&",
7753 WinObj_Convert, &wp,
7754 PyMac_GetPoint, &startPt,
7755 PyMac_GetRect, &boundsRect))
7756 return NULL;
7757 DragAlignedWindow(wp,
7758 startPt,
7759 &boundsRect,
7760 (Rect *)0,
7761 (ICMAlignmentProcRecordPtr)0);
7762 Py_INCREF(Py_None);
7763 _res = Py_None;
7764 return _res;
7765}
7766
Jack Jansend81fc3c1998-07-22 13:37:37 +00007767static PyObject *Qt_MoviesTask(_self, _args)
7768 PyObject *_self;
7769 PyObject *_args;
7770{
7771 PyObject *_res = NULL;
7772 long maxMilliSecToUse;
7773 if (!PyArg_ParseTuple(_args, "l",
7774 &maxMilliSecToUse))
7775 return NULL;
7776 MoviesTask((Movie)0,
7777 maxMilliSecToUse);
7778 Py_INCREF(Py_None);
7779 _res = Py_None;
7780 return _res;
7781}
7782
Jack Jansen453ced51995-11-30 17:42:08 +00007783static PyMethodDef Qt_methods[] = {
Jack Jansena05ac601999-12-12 21:41:51 +00007784 {"CheckQuickTimeRegistration", (PyCFunction)Qt_CheckQuickTimeRegistration, 1,
7785 "(void * registrationKey, long flags) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00007786 {"EnterMovies", (PyCFunction)Qt_EnterMovies, 1,
7787 "() -> None"},
7788 {"ExitMovies", (PyCFunction)Qt_ExitMovies, 1,
7789 "() -> None"},
7790 {"GetMoviesError", (PyCFunction)Qt_GetMoviesError, 1,
7791 "() -> None"},
7792 {"ClearMoviesStickyError", (PyCFunction)Qt_ClearMoviesStickyError, 1,
7793 "() -> None"},
7794 {"GetMoviesStickyError", (PyCFunction)Qt_GetMoviesStickyError, 1,
7795 "() -> None"},
7796 {"DisposeMatte", (PyCFunction)Qt_DisposeMatte, 1,
7797 "(PixMapHandle theMatte) -> None"},
7798 {"NewMovie", (PyCFunction)Qt_NewMovie, 1,
7799 "(long flags) -> (Movie _rv)"},
7800 {"GetDataHandler", (PyCFunction)Qt_GetDataHandler, 1,
7801 "(Handle dataRef, OSType dataHandlerSubType, long flags) -> (Component _rv)"},
7802 {"PasteHandleIntoMovie", (PyCFunction)Qt_PasteHandleIntoMovie, 1,
7803 "(Handle h, OSType handleType, Movie theMovie, long flags, ComponentInstance userComp) -> None"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00007804 {"GetMovieImporterForDataRef", (PyCFunction)Qt_GetMovieImporterForDataRef, 1,
7805 "(OSType dataRefType, Handle dataRef, long flags) -> (Component importer)"},
Jack Jansen453ced51995-11-30 17:42:08 +00007806 {"TrackTimeToMediaTime", (PyCFunction)Qt_TrackTimeToMediaTime, 1,
7807 "(TimeValue value, Track theTrack) -> (TimeValue _rv)"},
7808 {"NewUserData", (PyCFunction)Qt_NewUserData, 1,
7809 "() -> (UserData theUserData)"},
7810 {"NewUserDataFromHandle", (PyCFunction)Qt_NewUserDataFromHandle, 1,
7811 "(Handle h) -> (UserData theUserData)"},
7812 {"CreateMovieFile", (PyCFunction)Qt_CreateMovieFile, 1,
7813 "(FSSpec fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (short resRefNum, Movie newmovie)"},
7814 {"OpenMovieFile", (PyCFunction)Qt_OpenMovieFile, 1,
7815 "(FSSpec fileSpec, SInt8 permission) -> (short resRefNum)"},
7816 {"CloseMovieFile", (PyCFunction)Qt_CloseMovieFile, 1,
7817 "(short resRefNum) -> None"},
7818 {"DeleteMovieFile", (PyCFunction)Qt_DeleteMovieFile, 1,
7819 "(FSSpec fileSpec) -> None"},
7820 {"NewMovieFromFile", (PyCFunction)Qt_NewMovieFromFile, 1,
Jack Jansene0cf87b1997-04-09 15:53:46 +00007821 "(short resRefNum, short resId, short newMovieFlags) -> (Movie theMovie, short resId, Boolean dataRefWasChanged)"},
Jack Jansen453ced51995-11-30 17:42:08 +00007822 {"NewMovieFromHandle", (PyCFunction)Qt_NewMovieFromHandle, 1,
7823 "(Handle h, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
7824 {"NewMovieFromDataFork", (PyCFunction)Qt_NewMovieFromDataFork, 1,
7825 "(short fRefNum, long fileOffset, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00007826 {"NewMovieFromDataRef", (PyCFunction)Qt_NewMovieFromDataRef, 1,
7827 "(short flags, Handle dataRef, OSType dataRefType) -> (Movie m, short id)"},
Jack Jansen453ced51995-11-30 17:42:08 +00007828 {"RemoveMovieResource", (PyCFunction)Qt_RemoveMovieResource, 1,
7829 "(short resRefNum, short resId) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00007830 {"NewMovieFromScrap", (PyCFunction)Qt_NewMovieFromScrap, 1,
7831 "(long newMovieFlags) -> (Movie _rv)"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00007832 {"QTNewAlias", (PyCFunction)Qt_QTNewAlias, 1,
7833 "(FSSpec fss, Boolean minimal) -> (AliasHandle alias)"},
7834 {"EndFullScreen", (PyCFunction)Qt_EndFullScreen, 1,
7835 "(Ptr fullState, long flags) -> None"},
7836 {"AddSoundDescriptionExtension", (PyCFunction)Qt_AddSoundDescriptionExtension, 1,
7837 "(SoundDescriptionHandle desc, Handle extension, OSType idType) -> None"},
7838 {"GetSoundDescriptionExtension", (PyCFunction)Qt_GetSoundDescriptionExtension, 1,
7839 "(SoundDescriptionHandle desc, OSType idType) -> (Handle extension)"},
7840 {"RemoveSoundDescriptionExtension", (PyCFunction)Qt_RemoveSoundDescriptionExtension, 1,
7841 "(SoundDescriptionHandle desc, OSType idType) -> None"},
7842 {"QTIsStandardParameterDialogEvent", (PyCFunction)Qt_QTIsStandardParameterDialogEvent, 1,
7843 "(QTParameterDialog createdDialog) -> (EventRecord pEvent)"},
7844 {"QTDismissStandardParameterDialog", (PyCFunction)Qt_QTDismissStandardParameterDialog, 1,
7845 "(QTParameterDialog createdDialog) -> None"},
7846 {"QTStandardParameterDialogDoAction", (PyCFunction)Qt_QTStandardParameterDialogDoAction, 1,
7847 "(QTParameterDialog createdDialog, long action, void * params) -> None"},
7848 {"QTRegisterAccessKey", (PyCFunction)Qt_QTRegisterAccessKey, 1,
7849 "(Str255 accessKeyType, long flags, Handle accessKey) -> None"},
7850 {"QTUnregisterAccessKey", (PyCFunction)Qt_QTUnregisterAccessKey, 1,
7851 "(Str255 accessKeyType, long flags, Handle accessKey) -> None"},
7852 {"QTTextToNativeText", (PyCFunction)Qt_QTTextToNativeText, 1,
7853 "(Handle theText, long encoding, long flags) -> None"},
7854 {"VideoMediaResetStatistics", (PyCFunction)Qt_VideoMediaResetStatistics, 1,
7855 "(MediaHandler mh) -> (ComponentResult _rv)"},
7856 {"VideoMediaGetStatistics", (PyCFunction)Qt_VideoMediaGetStatistics, 1,
7857 "(MediaHandler mh) -> (ComponentResult _rv)"},
Jack Jansena05ac601999-12-12 21:41:51 +00007858 {"VideoMediaGetStallCount", (PyCFunction)Qt_VideoMediaGetStallCount, 1,
7859 "(MediaHandler mh) -> (ComponentResult _rv, unsigned long stalls)"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00007860 {"TextMediaAddTextSample", (PyCFunction)Qt_TextMediaAddTextSample, 1,
7861 "(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)"},
7862 {"TextMediaAddTESample", (PyCFunction)Qt_TextMediaAddTESample, 1,
7863 "(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)"},
7864 {"TextMediaAddHiliteSample", (PyCFunction)Qt_TextMediaAddHiliteSample, 1,
7865 "(MediaHandler mh, short hiliteStart, short hiliteEnd, TimeValue duration) -> (ComponentResult _rv, RGBColor rgbHiliteColor, TimeValue sampleTime)"},
7866 {"TextMediaFindNextText", (PyCFunction)Qt_TextMediaFindNextText, 1,
7867 "(MediaHandler mh, Ptr text, long size, short findFlags, TimeValue startTime) -> (ComponentResult _rv, TimeValue foundTime, TimeValue foundDuration, long offset)"},
7868 {"TextMediaHiliteTextSample", (PyCFunction)Qt_TextMediaHiliteTextSample, 1,
7869 "(MediaHandler mh, TimeValue sampleTime, short hiliteStart, short hiliteEnd) -> (ComponentResult _rv, RGBColor rgbHiliteColor)"},
7870 {"TextMediaSetTextSampleData", (PyCFunction)Qt_TextMediaSetTextSampleData, 1,
7871 "(MediaHandler mh, void * data, OSType dataType) -> (ComponentResult _rv)"},
7872 {"SpriteMediaSetProperty", (PyCFunction)Qt_SpriteMediaSetProperty, 1,
7873 "(MediaHandler mh, short spriteIndex, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
7874 {"SpriteMediaGetProperty", (PyCFunction)Qt_SpriteMediaGetProperty, 1,
7875 "(MediaHandler mh, short spriteIndex, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
7876 {"SpriteMediaHitTestSprites", (PyCFunction)Qt_SpriteMediaHitTestSprites, 1,
7877 "(MediaHandler mh, long flags, Point loc) -> (ComponentResult _rv, short spriteHitIndex)"},
7878 {"SpriteMediaCountSprites", (PyCFunction)Qt_SpriteMediaCountSprites, 1,
7879 "(MediaHandler mh) -> (ComponentResult _rv, short numSprites)"},
7880 {"SpriteMediaCountImages", (PyCFunction)Qt_SpriteMediaCountImages, 1,
7881 "(MediaHandler mh) -> (ComponentResult _rv, short numImages)"},
7882 {"SpriteMediaGetIndImageDescription", (PyCFunction)Qt_SpriteMediaGetIndImageDescription, 1,
7883 "(MediaHandler mh, short imageIndex, ImageDescriptionHandle imageDescription) -> (ComponentResult _rv)"},
7884 {"SpriteMediaGetDisplayedSampleNumber", (PyCFunction)Qt_SpriteMediaGetDisplayedSampleNumber, 1,
7885 "(MediaHandler mh) -> (ComponentResult _rv, long sampleNum)"},
7886 {"SpriteMediaGetSpriteName", (PyCFunction)Qt_SpriteMediaGetSpriteName, 1,
7887 "(MediaHandler mh, QTAtomID spriteID, Str255 spriteName) -> (ComponentResult _rv)"},
7888 {"SpriteMediaGetImageName", (PyCFunction)Qt_SpriteMediaGetImageName, 1,
7889 "(MediaHandler mh, short imageIndex, Str255 imageName) -> (ComponentResult _rv)"},
7890 {"SpriteMediaSetSpriteProperty", (PyCFunction)Qt_SpriteMediaSetSpriteProperty, 1,
7891 "(MediaHandler mh, QTAtomID spriteID, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
7892 {"SpriteMediaGetSpriteProperty", (PyCFunction)Qt_SpriteMediaGetSpriteProperty, 1,
7893 "(MediaHandler mh, QTAtomID spriteID, long propertyType, void * propertyValue) -> (ComponentResult _rv)"},
7894 {"SpriteMediaHitTestAllSprites", (PyCFunction)Qt_SpriteMediaHitTestAllSprites, 1,
7895 "(MediaHandler mh, long flags, Point loc) -> (ComponentResult _rv, QTAtomID spriteHitID)"},
7896 {"SpriteMediaHitTestOneSprite", (PyCFunction)Qt_SpriteMediaHitTestOneSprite, 1,
7897 "(MediaHandler mh, QTAtomID spriteID, long flags, Point loc) -> (ComponentResult _rv, Boolean wasHit)"},
7898 {"SpriteMediaSpriteIndexToID", (PyCFunction)Qt_SpriteMediaSpriteIndexToID, 1,
7899 "(MediaHandler mh, short spriteIndex) -> (ComponentResult _rv, QTAtomID spriteID)"},
7900 {"SpriteMediaSpriteIDToIndex", (PyCFunction)Qt_SpriteMediaSpriteIDToIndex, 1,
7901 "(MediaHandler mh, QTAtomID spriteID) -> (ComponentResult _rv, short spriteIndex)"},
7902 {"SpriteMediaSetActionVariable", (PyCFunction)Qt_SpriteMediaSetActionVariable, 1,
7903 "(MediaHandler mh, QTAtomID variableID, float value) -> (ComponentResult _rv)"},
7904 {"SpriteMediaGetActionVariable", (PyCFunction)Qt_SpriteMediaGetActionVariable, 1,
7905 "(MediaHandler mh, QTAtomID variableID) -> (ComponentResult _rv, float value)"},
7906 {"SpriteMediaGetIndImageProperty", (PyCFunction)Qt_SpriteMediaGetIndImageProperty, 1,
7907 "(MediaHandler mh, short imageIndex, long imagePropertyType, void * imagePropertyValue) -> (ComponentResult _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00007908 {"NewTimeBase", (PyCFunction)Qt_NewTimeBase, 1,
7909 "() -> (TimeBase _rv)"},
Jack Jansenb2006391998-04-23 13:22:44 +00007910 {"ConvertTime", (PyCFunction)Qt_ConvertTime, 1,
Jack Jansen1b7a70f2000-03-03 17:06:13 +00007911 "(TimeRecord inout, TimeBase newBase) -> (TimeRecord inout)"},
Jack Jansenb2006391998-04-23 13:22:44 +00007912 {"ConvertTimeScale", (PyCFunction)Qt_ConvertTimeScale, 1,
Jack Jansen1b7a70f2000-03-03 17:06:13 +00007913 "(TimeRecord inout, TimeScale newScale) -> (TimeRecord inout)"},
Jack Jansenb2006391998-04-23 13:22:44 +00007914 {"AddTime", (PyCFunction)Qt_AddTime, 1,
Jack Jansen1b7a70f2000-03-03 17:06:13 +00007915 "(TimeRecord dst, TimeRecord src) -> (TimeRecord dst)"},
Jack Jansenb2006391998-04-23 13:22:44 +00007916 {"SubtractTime", (PyCFunction)Qt_SubtractTime, 1,
Jack Jansen1b7a70f2000-03-03 17:06:13 +00007917 "(TimeRecord dst, TimeRecord src) -> (TimeRecord dst)"},
Jack Jansen1c4e6141998-04-21 15:23:55 +00007918 {"MusicMediaGetIndexedTunePlayer", (PyCFunction)Qt_MusicMediaGetIndexedTunePlayer, 1,
7919 "(ComponentInstance ti, long sampleDescIndex) -> (ComponentResult _rv, ComponentInstance tp)"},
Jack Jansen9cfea101995-12-09 14:05:56 +00007920 {"AlignWindow", (PyCFunction)Qt_AlignWindow, 1,
7921 "(WindowPtr wp, Boolean front) -> None"},
7922 {"DragAlignedWindow", (PyCFunction)Qt_DragAlignedWindow, 1,
7923 "(WindowPtr wp, Point startPt, Rect boundsRect) -> None"},
Jack Jansend81fc3c1998-07-22 13:37:37 +00007924 {"MoviesTask", (PyCFunction)Qt_MoviesTask, 1,
7925 "(long maxMilliSecToUse) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00007926 {NULL, NULL, 0}
7927};
7928
7929
7930
7931
7932void initQt()
7933{
7934 PyObject *m;
7935 PyObject *d;
7936
7937
7938
7939
7940 m = Py_InitModule("Qt", Qt_methods);
7941 d = PyModule_GetDict(m);
7942 Qt_Error = PyMac_GetOSErrException();
7943 if (Qt_Error == NULL ||
7944 PyDict_SetItemString(d, "Error", Qt_Error) != 0)
7945 Py_FatalError("can't initialize Qt.Error");
Jack Jansena755e681997-09-20 17:40:22 +00007946 MovieController_Type.ob_type = &PyType_Type;
7947 Py_INCREF(&MovieController_Type);
7948 if (PyDict_SetItemString(d, "MovieControllerType", (PyObject *)&MovieController_Type) != 0)
7949 Py_FatalError("can't initialize MovieControllerType");
7950 TimeBase_Type.ob_type = &PyType_Type;
7951 Py_INCREF(&TimeBase_Type);
7952 if (PyDict_SetItemString(d, "TimeBaseType", (PyObject *)&TimeBase_Type) != 0)
7953 Py_FatalError("can't initialize TimeBaseType");
7954 UserData_Type.ob_type = &PyType_Type;
7955 Py_INCREF(&UserData_Type);
7956 if (PyDict_SetItemString(d, "UserDataType", (PyObject *)&UserData_Type) != 0)
7957 Py_FatalError("can't initialize UserDataType");
7958 Media_Type.ob_type = &PyType_Type;
7959 Py_INCREF(&Media_Type);
7960 if (PyDict_SetItemString(d, "MediaType", (PyObject *)&Media_Type) != 0)
7961 Py_FatalError("can't initialize MediaType");
7962 Track_Type.ob_type = &PyType_Type;
7963 Py_INCREF(&Track_Type);
7964 if (PyDict_SetItemString(d, "TrackType", (PyObject *)&Track_Type) != 0)
7965 Py_FatalError("can't initialize TrackType");
7966 Movie_Type.ob_type = &PyType_Type;
7967 Py_INCREF(&Movie_Type);
7968 if (PyDict_SetItemString(d, "MovieType", (PyObject *)&Movie_Type) != 0)
7969 Py_FatalError("can't initialize MovieType");
Jack Jansen453ced51995-11-30 17:42:08 +00007970}
7971
7972/* ========================= End module Qt ========================== */
7973