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