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