blob: 9b2a854319917945417bdebba9bf62014f442fad [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);
63staticforward int MovieCtlObj_Convert(PyObject *, MovieController *);
Jack Jansen453ced51995-11-30 17:42:08 +000064
65
66
67static PyObject *Qt_Error;
68
Jack Jansen9cfea101995-12-09 14:05:56 +000069/* ------------------ Object type MovieController ------------------- */
70
71PyTypeObject MovieController_Type;
72
73#define MovieCtlObj_Check(x) ((x)->ob_type == &MovieController_Type)
74
75typedef struct MovieControllerObject {
76 PyObject_HEAD
77 MovieController ob_itself;
78} MovieControllerObject;
79
80PyObject *MovieCtlObj_New(itself)
81 MovieController itself;
82{
83 MovieControllerObject *it;
84 if (itself == NULL) {
85 PyErr_SetString(Qt_Error,"Cannot create null MovieController");
86 return NULL;
87 }
88 it = PyObject_NEW(MovieControllerObject, &MovieController_Type);
89 if (it == NULL) return NULL;
90 it->ob_itself = itself;
91 return (PyObject *)it;
92}
93MovieCtlObj_Convert(v, p_itself)
94 PyObject *v;
95 MovieController *p_itself;
96{
97 if (!MovieCtlObj_Check(v))
98 {
99 PyErr_SetString(PyExc_TypeError, "MovieController required");
100 return 0;
101 }
102 *p_itself = ((MovieControllerObject *)v)->ob_itself;
103 return 1;
104}
105
106static void MovieCtlObj_dealloc(self)
107 MovieControllerObject *self;
108{
109 DisposeMovieController(self->ob_itself);
110 PyMem_DEL(self);
111}
112
113static PyObject *MovieCtlObj_MCSetMovie(_self, _args)
114 MovieControllerObject *_self;
115 PyObject *_args;
116{
117 PyObject *_res = NULL;
118 ComponentResult _rv;
119 Movie theMovie;
120 WindowPtr movieWindow;
121 Point where;
122 if (!PyArg_ParseTuple(_args, "O&O&O&",
123 MovieObj_Convert, &theMovie,
124 WinObj_Convert, &movieWindow,
125 PyMac_GetPoint, &where))
126 return NULL;
127 _rv = MCSetMovie(_self->ob_itself,
128 theMovie,
129 movieWindow,
130 where);
131 _res = Py_BuildValue("l",
132 _rv);
133 return _res;
134}
135
136static PyObject *MovieCtlObj_MCGetIndMovie(_self, _args)
137 MovieControllerObject *_self;
138 PyObject *_args;
139{
140 PyObject *_res = NULL;
141 Movie _rv;
142 short index;
143 if (!PyArg_ParseTuple(_args, "h",
144 &index))
145 return NULL;
146 _rv = MCGetIndMovie(_self->ob_itself,
147 index);
148 _res = Py_BuildValue("O&",
149 MovieObj_New, _rv);
150 return _res;
151}
152
153static PyObject *MovieCtlObj_MCRemoveMovie(_self, _args)
154 MovieControllerObject *_self;
155 PyObject *_args;
156{
157 PyObject *_res = NULL;
158 ComponentResult _rv;
159 if (!PyArg_ParseTuple(_args, ""))
160 return NULL;
161 _rv = MCRemoveMovie(_self->ob_itself);
162 _res = Py_BuildValue("l",
163 _rv);
164 return _res;
165}
166
167static PyObject *MovieCtlObj_MCIsPlayerEvent(_self, _args)
168 MovieControllerObject *_self;
169 PyObject *_args;
170{
171 PyObject *_res = NULL;
172 ComponentResult _rv;
173 EventRecord e;
174 if (!PyArg_ParseTuple(_args, "O&",
175 PyMac_GetEventRecord, &e))
176 return NULL;
177 _rv = MCIsPlayerEvent(_self->ob_itself,
178 &e);
179 _res = Py_BuildValue("l",
180 _rv);
181 return _res;
182}
183
184static PyObject *MovieCtlObj_MCDoAction(_self, _args)
185 MovieControllerObject *_self;
186 PyObject *_args;
187{
188 PyObject *_res = NULL;
189 ComponentResult _rv;
190 short action;
191 void * params;
192 if (!PyArg_ParseTuple(_args, "hs",
193 &action,
194 &params))
195 return NULL;
196 _rv = MCDoAction(_self->ob_itself,
197 action,
198 params);
199 _res = Py_BuildValue("l",
200 _rv);
201 return _res;
202}
203
204static PyObject *MovieCtlObj_MCSetControllerAttached(_self, _args)
205 MovieControllerObject *_self;
206 PyObject *_args;
207{
208 PyObject *_res = NULL;
209 ComponentResult _rv;
210 Boolean attach;
211 if (!PyArg_ParseTuple(_args, "b",
212 &attach))
213 return NULL;
214 _rv = MCSetControllerAttached(_self->ob_itself,
215 attach);
216 _res = Py_BuildValue("l",
217 _rv);
218 return _res;
219}
220
221static PyObject *MovieCtlObj_MCIsControllerAttached(_self, _args)
222 MovieControllerObject *_self;
223 PyObject *_args;
224{
225 PyObject *_res = NULL;
226 ComponentResult _rv;
227 if (!PyArg_ParseTuple(_args, ""))
228 return NULL;
229 _rv = MCIsControllerAttached(_self->ob_itself);
230 _res = Py_BuildValue("l",
231 _rv);
232 return _res;
233}
234
Jack Jansene0cf87b1997-04-09 15:53:46 +0000235static PyObject *MovieCtlObj_MCSetControllerPort(_self, _args)
236 MovieControllerObject *_self;
237 PyObject *_args;
238{
239 PyObject *_res = NULL;
240 ComponentResult _rv;
241 CGrafPtr gp;
242 if (!PyArg_ParseTuple(_args, "O&",
243 GrafObj_Convert, &gp))
244 return NULL;
245 _rv = MCSetControllerPort(_self->ob_itself,
246 gp);
247 _res = Py_BuildValue("l",
248 _rv);
249 return _res;
250}
251
252static PyObject *MovieCtlObj_MCGetControllerPort(_self, _args)
253 MovieControllerObject *_self;
254 PyObject *_args;
255{
256 PyObject *_res = NULL;
257 CGrafPtr _rv;
258 if (!PyArg_ParseTuple(_args, ""))
259 return NULL;
260 _rv = MCGetControllerPort(_self->ob_itself);
261 _res = Py_BuildValue("O&",
262 GrafObj_New, _rv);
263 return _res;
264}
265
Jack Jansen9cfea101995-12-09 14:05:56 +0000266static PyObject *MovieCtlObj_MCSetVisible(_self, _args)
267 MovieControllerObject *_self;
268 PyObject *_args;
269{
270 PyObject *_res = NULL;
271 ComponentResult _rv;
272 Boolean visible;
273 if (!PyArg_ParseTuple(_args, "b",
274 &visible))
275 return NULL;
276 _rv = MCSetVisible(_self->ob_itself,
277 visible);
278 _res = Py_BuildValue("l",
279 _rv);
280 return _res;
281}
282
283static PyObject *MovieCtlObj_MCGetVisible(_self, _args)
284 MovieControllerObject *_self;
285 PyObject *_args;
286{
287 PyObject *_res = NULL;
288 ComponentResult _rv;
289 if (!PyArg_ParseTuple(_args, ""))
290 return NULL;
291 _rv = MCGetVisible(_self->ob_itself);
292 _res = Py_BuildValue("l",
293 _rv);
294 return _res;
295}
296
297static PyObject *MovieCtlObj_MCGetControllerBoundsRect(_self, _args)
298 MovieControllerObject *_self;
299 PyObject *_args;
300{
301 PyObject *_res = NULL;
302 ComponentResult _rv;
303 Rect bounds;
304 if (!PyArg_ParseTuple(_args, ""))
305 return NULL;
306 _rv = MCGetControllerBoundsRect(_self->ob_itself,
307 &bounds);
308 _res = Py_BuildValue("lO&",
309 _rv,
310 PyMac_BuildRect, &bounds);
311 return _res;
312}
313
314static PyObject *MovieCtlObj_MCSetControllerBoundsRect(_self, _args)
315 MovieControllerObject *_self;
316 PyObject *_args;
317{
318 PyObject *_res = NULL;
319 ComponentResult _rv;
320 Rect bounds;
321 if (!PyArg_ParseTuple(_args, "O&",
322 PyMac_GetRect, &bounds))
323 return NULL;
324 _rv = MCSetControllerBoundsRect(_self->ob_itself,
325 &bounds);
326 _res = Py_BuildValue("l",
327 _rv);
328 return _res;
329}
330
331static PyObject *MovieCtlObj_MCGetControllerBoundsRgn(_self, _args)
332 MovieControllerObject *_self;
333 PyObject *_args;
334{
335 PyObject *_res = NULL;
336 RgnHandle _rv;
337 if (!PyArg_ParseTuple(_args, ""))
338 return NULL;
339 _rv = MCGetControllerBoundsRgn(_self->ob_itself);
340 _res = Py_BuildValue("O&",
341 ResObj_New, _rv);
342 return _res;
343}
344
345static PyObject *MovieCtlObj_MCGetWindowRgn(_self, _args)
346 MovieControllerObject *_self;
347 PyObject *_args;
348{
349 PyObject *_res = NULL;
350 RgnHandle _rv;
351 WindowPtr w;
352 if (!PyArg_ParseTuple(_args, "O&",
353 WinObj_Convert, &w))
354 return NULL;
355 _rv = MCGetWindowRgn(_self->ob_itself,
356 w);
357 _res = Py_BuildValue("O&",
358 ResObj_New, _rv);
359 return _res;
360}
361
362static PyObject *MovieCtlObj_MCMovieChanged(_self, _args)
363 MovieControllerObject *_self;
364 PyObject *_args;
365{
366 PyObject *_res = NULL;
367 ComponentResult _rv;
368 Movie m;
369 if (!PyArg_ParseTuple(_args, "O&",
370 MovieObj_Convert, &m))
371 return NULL;
372 _rv = MCMovieChanged(_self->ob_itself,
373 m);
374 _res = Py_BuildValue("l",
375 _rv);
376 return _res;
377}
378
379static PyObject *MovieCtlObj_MCSetDuration(_self, _args)
380 MovieControllerObject *_self;
381 PyObject *_args;
382{
383 PyObject *_res = NULL;
384 ComponentResult _rv;
385 TimeValue duration;
386 if (!PyArg_ParseTuple(_args, "l",
387 &duration))
388 return NULL;
389 _rv = MCSetDuration(_self->ob_itself,
390 duration);
391 _res = Py_BuildValue("l",
392 _rv);
393 return _res;
394}
395
396static PyObject *MovieCtlObj_MCGetCurrentTime(_self, _args)
397 MovieControllerObject *_self;
398 PyObject *_args;
399{
400 PyObject *_res = NULL;
401 TimeValue _rv;
402 TimeScale scale;
403 if (!PyArg_ParseTuple(_args, ""))
404 return NULL;
405 _rv = MCGetCurrentTime(_self->ob_itself,
406 &scale);
407 _res = Py_BuildValue("ll",
408 _rv,
409 scale);
410 return _res;
411}
412
413static PyObject *MovieCtlObj_MCNewAttachedController(_self, _args)
414 MovieControllerObject *_self;
415 PyObject *_args;
416{
417 PyObject *_res = NULL;
418 ComponentResult _rv;
419 Movie theMovie;
420 WindowPtr w;
421 Point where;
422 if (!PyArg_ParseTuple(_args, "O&O&O&",
423 MovieObj_Convert, &theMovie,
424 WinObj_Convert, &w,
425 PyMac_GetPoint, &where))
426 return NULL;
427 _rv = MCNewAttachedController(_self->ob_itself,
428 theMovie,
429 w,
430 where);
431 _res = Py_BuildValue("l",
432 _rv);
433 return _res;
434}
435
436static PyObject *MovieCtlObj_MCDraw(_self, _args)
437 MovieControllerObject *_self;
438 PyObject *_args;
439{
440 PyObject *_res = NULL;
441 ComponentResult _rv;
442 WindowPtr w;
443 if (!PyArg_ParseTuple(_args, "O&",
444 WinObj_Convert, &w))
445 return NULL;
446 _rv = MCDraw(_self->ob_itself,
447 w);
448 _res = Py_BuildValue("l",
449 _rv);
450 return _res;
451}
452
453static PyObject *MovieCtlObj_MCActivate(_self, _args)
454 MovieControllerObject *_self;
455 PyObject *_args;
456{
457 PyObject *_res = NULL;
458 ComponentResult _rv;
459 WindowPtr w;
460 Boolean activate;
461 if (!PyArg_ParseTuple(_args, "O&b",
462 WinObj_Convert, &w,
463 &activate))
464 return NULL;
465 _rv = MCActivate(_self->ob_itself,
466 w,
467 activate);
468 _res = Py_BuildValue("l",
469 _rv);
470 return _res;
471}
472
473static PyObject *MovieCtlObj_MCIdle(_self, _args)
474 MovieControllerObject *_self;
475 PyObject *_args;
476{
477 PyObject *_res = NULL;
478 ComponentResult _rv;
479 if (!PyArg_ParseTuple(_args, ""))
480 return NULL;
481 _rv = MCIdle(_self->ob_itself);
482 _res = Py_BuildValue("l",
483 _rv);
484 return _res;
485}
486
487static PyObject *MovieCtlObj_MCKey(_self, _args)
488 MovieControllerObject *_self;
489 PyObject *_args;
490{
491 PyObject *_res = NULL;
492 ComponentResult _rv;
493 SInt8 key;
494 long modifiers;
495 if (!PyArg_ParseTuple(_args, "bl",
496 &key,
497 &modifiers))
498 return NULL;
499 _rv = MCKey(_self->ob_itself,
500 key,
501 modifiers);
502 _res = Py_BuildValue("l",
503 _rv);
504 return _res;
505}
506
507static PyObject *MovieCtlObj_MCClick(_self, _args)
508 MovieControllerObject *_self;
509 PyObject *_args;
510{
511 PyObject *_res = NULL;
512 ComponentResult _rv;
513 WindowPtr w;
514 Point where;
515 long when;
516 long modifiers;
517 if (!PyArg_ParseTuple(_args, "O&O&ll",
518 WinObj_Convert, &w,
519 PyMac_GetPoint, &where,
520 &when,
521 &modifiers))
522 return NULL;
523 _rv = MCClick(_self->ob_itself,
524 w,
525 where,
526 when,
527 modifiers);
528 _res = Py_BuildValue("l",
529 _rv);
530 return _res;
531}
532
533static PyObject *MovieCtlObj_MCEnableEditing(_self, _args)
534 MovieControllerObject *_self;
535 PyObject *_args;
536{
537 PyObject *_res = NULL;
538 ComponentResult _rv;
539 Boolean enabled;
540 if (!PyArg_ParseTuple(_args, "b",
541 &enabled))
542 return NULL;
543 _rv = MCEnableEditing(_self->ob_itself,
544 enabled);
545 _res = Py_BuildValue("l",
546 _rv);
547 return _res;
548}
549
550static PyObject *MovieCtlObj_MCIsEditingEnabled(_self, _args)
551 MovieControllerObject *_self;
552 PyObject *_args;
553{
554 PyObject *_res = NULL;
555 long _rv;
556 if (!PyArg_ParseTuple(_args, ""))
557 return NULL;
558 _rv = MCIsEditingEnabled(_self->ob_itself);
559 _res = Py_BuildValue("l",
560 _rv);
561 return _res;
562}
563
564static PyObject *MovieCtlObj_MCCopy(_self, _args)
565 MovieControllerObject *_self;
566 PyObject *_args;
567{
568 PyObject *_res = NULL;
569 Movie _rv;
570 if (!PyArg_ParseTuple(_args, ""))
571 return NULL;
572 _rv = MCCopy(_self->ob_itself);
573 _res = Py_BuildValue("O&",
574 MovieObj_New, _rv);
575 return _res;
576}
577
578static PyObject *MovieCtlObj_MCCut(_self, _args)
579 MovieControllerObject *_self;
580 PyObject *_args;
581{
582 PyObject *_res = NULL;
583 Movie _rv;
584 if (!PyArg_ParseTuple(_args, ""))
585 return NULL;
586 _rv = MCCut(_self->ob_itself);
587 _res = Py_BuildValue("O&",
588 MovieObj_New, _rv);
589 return _res;
590}
591
592static PyObject *MovieCtlObj_MCPaste(_self, _args)
593 MovieControllerObject *_self;
594 PyObject *_args;
595{
596 PyObject *_res = NULL;
597 ComponentResult _rv;
598 Movie srcMovie;
599 if (!PyArg_ParseTuple(_args, "O&",
600 MovieObj_Convert, &srcMovie))
601 return NULL;
602 _rv = MCPaste(_self->ob_itself,
603 srcMovie);
604 _res = Py_BuildValue("l",
605 _rv);
606 return _res;
607}
608
609static PyObject *MovieCtlObj_MCClear(_self, _args)
610 MovieControllerObject *_self;
611 PyObject *_args;
612{
613 PyObject *_res = NULL;
614 ComponentResult _rv;
615 if (!PyArg_ParseTuple(_args, ""))
616 return NULL;
617 _rv = MCClear(_self->ob_itself);
618 _res = Py_BuildValue("l",
619 _rv);
620 return _res;
621}
622
623static PyObject *MovieCtlObj_MCUndo(_self, _args)
624 MovieControllerObject *_self;
625 PyObject *_args;
626{
627 PyObject *_res = NULL;
628 ComponentResult _rv;
629 if (!PyArg_ParseTuple(_args, ""))
630 return NULL;
631 _rv = MCUndo(_self->ob_itself);
632 _res = Py_BuildValue("l",
633 _rv);
634 return _res;
635}
636
637static PyObject *MovieCtlObj_MCPositionController(_self, _args)
638 MovieControllerObject *_self;
639 PyObject *_args;
640{
641 PyObject *_res = NULL;
642 ComponentResult _rv;
643 Rect movieRect;
644 Rect controllerRect;
645 long someFlags;
646 if (!PyArg_ParseTuple(_args, "O&O&l",
647 PyMac_GetRect, &movieRect,
648 PyMac_GetRect, &controllerRect,
649 &someFlags))
650 return NULL;
651 _rv = MCPositionController(_self->ob_itself,
652 &movieRect,
653 &controllerRect,
654 someFlags);
655 _res = Py_BuildValue("l",
656 _rv);
657 return _res;
658}
659
660static PyObject *MovieCtlObj_MCGetControllerInfo(_self, _args)
661 MovieControllerObject *_self;
662 PyObject *_args;
663{
664 PyObject *_res = NULL;
665 ComponentResult _rv;
666 long someFlags;
667 if (!PyArg_ParseTuple(_args, ""))
668 return NULL;
669 _rv = MCGetControllerInfo(_self->ob_itself,
670 &someFlags);
671 _res = Py_BuildValue("ll",
672 _rv,
673 someFlags);
674 return _res;
675}
676
677static PyObject *MovieCtlObj_MCSetClip(_self, _args)
678 MovieControllerObject *_self;
679 PyObject *_args;
680{
681 PyObject *_res = NULL;
682 ComponentResult _rv;
683 RgnHandle theClip;
684 RgnHandle movieClip;
685 if (!PyArg_ParseTuple(_args, "O&O&",
686 ResObj_Convert, &theClip,
687 ResObj_Convert, &movieClip))
688 return NULL;
689 _rv = MCSetClip(_self->ob_itself,
690 theClip,
691 movieClip);
692 _res = Py_BuildValue("l",
693 _rv);
694 return _res;
695}
696
697static PyObject *MovieCtlObj_MCGetClip(_self, _args)
698 MovieControllerObject *_self;
699 PyObject *_args;
700{
701 PyObject *_res = NULL;
702 ComponentResult _rv;
703 RgnHandle theClip;
704 RgnHandle movieClip;
705 if (!PyArg_ParseTuple(_args, ""))
706 return NULL;
707 _rv = MCGetClip(_self->ob_itself,
708 &theClip,
709 &movieClip);
710 _res = Py_BuildValue("lO&O&",
711 _rv,
712 ResObj_New, theClip,
713 ResObj_New, movieClip);
714 return _res;
715}
716
717static PyObject *MovieCtlObj_MCDrawBadge(_self, _args)
718 MovieControllerObject *_self;
719 PyObject *_args;
720{
721 PyObject *_res = NULL;
722 ComponentResult _rv;
723 RgnHandle movieRgn;
724 RgnHandle badgeRgn;
725 if (!PyArg_ParseTuple(_args, "O&",
726 ResObj_Convert, &movieRgn))
727 return NULL;
728 _rv = MCDrawBadge(_self->ob_itself,
729 movieRgn,
730 &badgeRgn);
731 _res = Py_BuildValue("lO&",
732 _rv,
733 ResObj_New, badgeRgn);
734 return _res;
735}
736
737static PyObject *MovieCtlObj_MCSetUpEditMenu(_self, _args)
738 MovieControllerObject *_self;
739 PyObject *_args;
740{
741 PyObject *_res = NULL;
742 ComponentResult _rv;
743 long modifiers;
744 MenuHandle mh;
745 if (!PyArg_ParseTuple(_args, "lO&",
746 &modifiers,
747 MenuObj_Convert, &mh))
748 return NULL;
749 _rv = MCSetUpEditMenu(_self->ob_itself,
750 modifiers,
751 mh);
752 _res = Py_BuildValue("l",
753 _rv);
754 return _res;
755}
756
757static PyObject *MovieCtlObj_MCGetMenuString(_self, _args)
758 MovieControllerObject *_self;
759 PyObject *_args;
760{
761 PyObject *_res = NULL;
762 ComponentResult _rv;
763 long modifiers;
764 short item;
765 Str255 aString;
766 if (!PyArg_ParseTuple(_args, "lhO&",
767 &modifiers,
768 &item,
769 PyMac_GetStr255, aString))
770 return NULL;
771 _rv = MCGetMenuString(_self->ob_itself,
772 modifiers,
773 item,
774 aString);
775 _res = Py_BuildValue("l",
776 _rv);
777 return _res;
778}
779
780static PyMethodDef MovieCtlObj_methods[] = {
781 {"MCSetMovie", (PyCFunction)MovieCtlObj_MCSetMovie, 1,
782 "(Movie theMovie, WindowPtr movieWindow, Point where) -> (ComponentResult _rv)"},
783 {"MCGetIndMovie", (PyCFunction)MovieCtlObj_MCGetIndMovie, 1,
784 "(short index) -> (Movie _rv)"},
785 {"MCRemoveMovie", (PyCFunction)MovieCtlObj_MCRemoveMovie, 1,
786 "() -> (ComponentResult _rv)"},
787 {"MCIsPlayerEvent", (PyCFunction)MovieCtlObj_MCIsPlayerEvent, 1,
788 "(EventRecord e) -> (ComponentResult _rv)"},
789 {"MCDoAction", (PyCFunction)MovieCtlObj_MCDoAction, 1,
790 "(short action, void * params) -> (ComponentResult _rv)"},
791 {"MCSetControllerAttached", (PyCFunction)MovieCtlObj_MCSetControllerAttached, 1,
792 "(Boolean attach) -> (ComponentResult _rv)"},
793 {"MCIsControllerAttached", (PyCFunction)MovieCtlObj_MCIsControllerAttached, 1,
794 "() -> (ComponentResult _rv)"},
Jack Jansene0cf87b1997-04-09 15:53:46 +0000795 {"MCSetControllerPort", (PyCFunction)MovieCtlObj_MCSetControllerPort, 1,
796 "(CGrafPtr gp) -> (ComponentResult _rv)"},
797 {"MCGetControllerPort", (PyCFunction)MovieCtlObj_MCGetControllerPort, 1,
798 "() -> (CGrafPtr _rv)"},
Jack Jansen9cfea101995-12-09 14:05:56 +0000799 {"MCSetVisible", (PyCFunction)MovieCtlObj_MCSetVisible, 1,
800 "(Boolean visible) -> (ComponentResult _rv)"},
801 {"MCGetVisible", (PyCFunction)MovieCtlObj_MCGetVisible, 1,
802 "() -> (ComponentResult _rv)"},
803 {"MCGetControllerBoundsRect", (PyCFunction)MovieCtlObj_MCGetControllerBoundsRect, 1,
804 "() -> (ComponentResult _rv, Rect bounds)"},
805 {"MCSetControllerBoundsRect", (PyCFunction)MovieCtlObj_MCSetControllerBoundsRect, 1,
806 "(Rect bounds) -> (ComponentResult _rv)"},
807 {"MCGetControllerBoundsRgn", (PyCFunction)MovieCtlObj_MCGetControllerBoundsRgn, 1,
808 "() -> (RgnHandle _rv)"},
809 {"MCGetWindowRgn", (PyCFunction)MovieCtlObj_MCGetWindowRgn, 1,
810 "(WindowPtr w) -> (RgnHandle _rv)"},
811 {"MCMovieChanged", (PyCFunction)MovieCtlObj_MCMovieChanged, 1,
812 "(Movie m) -> (ComponentResult _rv)"},
813 {"MCSetDuration", (PyCFunction)MovieCtlObj_MCSetDuration, 1,
814 "(TimeValue duration) -> (ComponentResult _rv)"},
815 {"MCGetCurrentTime", (PyCFunction)MovieCtlObj_MCGetCurrentTime, 1,
816 "() -> (TimeValue _rv, TimeScale scale)"},
817 {"MCNewAttachedController", (PyCFunction)MovieCtlObj_MCNewAttachedController, 1,
818 "(Movie theMovie, WindowPtr w, Point where) -> (ComponentResult _rv)"},
819 {"MCDraw", (PyCFunction)MovieCtlObj_MCDraw, 1,
820 "(WindowPtr w) -> (ComponentResult _rv)"},
821 {"MCActivate", (PyCFunction)MovieCtlObj_MCActivate, 1,
822 "(WindowPtr w, Boolean activate) -> (ComponentResult _rv)"},
823 {"MCIdle", (PyCFunction)MovieCtlObj_MCIdle, 1,
824 "() -> (ComponentResult _rv)"},
825 {"MCKey", (PyCFunction)MovieCtlObj_MCKey, 1,
826 "(SInt8 key, long modifiers) -> (ComponentResult _rv)"},
827 {"MCClick", (PyCFunction)MovieCtlObj_MCClick, 1,
828 "(WindowPtr w, Point where, long when, long modifiers) -> (ComponentResult _rv)"},
829 {"MCEnableEditing", (PyCFunction)MovieCtlObj_MCEnableEditing, 1,
830 "(Boolean enabled) -> (ComponentResult _rv)"},
831 {"MCIsEditingEnabled", (PyCFunction)MovieCtlObj_MCIsEditingEnabled, 1,
832 "() -> (long _rv)"},
833 {"MCCopy", (PyCFunction)MovieCtlObj_MCCopy, 1,
834 "() -> (Movie _rv)"},
835 {"MCCut", (PyCFunction)MovieCtlObj_MCCut, 1,
836 "() -> (Movie _rv)"},
837 {"MCPaste", (PyCFunction)MovieCtlObj_MCPaste, 1,
838 "(Movie srcMovie) -> (ComponentResult _rv)"},
839 {"MCClear", (PyCFunction)MovieCtlObj_MCClear, 1,
840 "() -> (ComponentResult _rv)"},
841 {"MCUndo", (PyCFunction)MovieCtlObj_MCUndo, 1,
842 "() -> (ComponentResult _rv)"},
843 {"MCPositionController", (PyCFunction)MovieCtlObj_MCPositionController, 1,
844 "(Rect movieRect, Rect controllerRect, long someFlags) -> (ComponentResult _rv)"},
845 {"MCGetControllerInfo", (PyCFunction)MovieCtlObj_MCGetControllerInfo, 1,
846 "() -> (ComponentResult _rv, long someFlags)"},
847 {"MCSetClip", (PyCFunction)MovieCtlObj_MCSetClip, 1,
848 "(RgnHandle theClip, RgnHandle movieClip) -> (ComponentResult _rv)"},
849 {"MCGetClip", (PyCFunction)MovieCtlObj_MCGetClip, 1,
850 "() -> (ComponentResult _rv, RgnHandle theClip, RgnHandle movieClip)"},
851 {"MCDrawBadge", (PyCFunction)MovieCtlObj_MCDrawBadge, 1,
852 "(RgnHandle movieRgn) -> (ComponentResult _rv, RgnHandle badgeRgn)"},
853 {"MCSetUpEditMenu", (PyCFunction)MovieCtlObj_MCSetUpEditMenu, 1,
854 "(long modifiers, MenuHandle mh) -> (ComponentResult _rv)"},
855 {"MCGetMenuString", (PyCFunction)MovieCtlObj_MCGetMenuString, 1,
856 "(long modifiers, short item, Str255 aString) -> (ComponentResult _rv)"},
857 {NULL, NULL, 0}
858};
859
860PyMethodChain MovieCtlObj_chain = { MovieCtlObj_methods, NULL };
861
862static PyObject *MovieCtlObj_getattr(self, name)
863 MovieControllerObject *self;
864 char *name;
865{
866 return Py_FindMethodInChain(&MovieCtlObj_chain, (PyObject *)self, name);
867}
868
869#define MovieCtlObj_setattr NULL
870
871PyTypeObject MovieController_Type = {
872 PyObject_HEAD_INIT(&PyType_Type)
873 0, /*ob_size*/
874 "MovieController", /*tp_name*/
875 sizeof(MovieControllerObject), /*tp_basicsize*/
876 0, /*tp_itemsize*/
877 /* methods */
878 (destructor) MovieCtlObj_dealloc, /*tp_dealloc*/
879 0, /*tp_print*/
880 (getattrfunc) MovieCtlObj_getattr, /*tp_getattr*/
881 (setattrfunc) MovieCtlObj_setattr, /*tp_setattr*/
882};
883
884/* ---------------- End object type MovieController ----------------- */
885
886
Jack Jansen453ced51995-11-30 17:42:08 +0000887/* ---------------------- Object type TimeBase ---------------------- */
888
889PyTypeObject TimeBase_Type;
890
891#define TimeBaseObj_Check(x) ((x)->ob_type == &TimeBase_Type)
892
893typedef struct TimeBaseObject {
894 PyObject_HEAD
895 TimeBase ob_itself;
896} TimeBaseObject;
897
898PyObject *TimeBaseObj_New(itself)
899 TimeBase itself;
900{
901 TimeBaseObject *it;
902 if (itself == NULL) {
903 PyErr_SetString(Qt_Error,"Cannot create null TimeBase");
904 return NULL;
905 }
906 it = PyObject_NEW(TimeBaseObject, &TimeBase_Type);
907 if (it == NULL) return NULL;
908 it->ob_itself = itself;
909 return (PyObject *)it;
910}
911TimeBaseObj_Convert(v, p_itself)
912 PyObject *v;
913 TimeBase *p_itself;
914{
915 if (!TimeBaseObj_Check(v))
916 {
917 PyErr_SetString(PyExc_TypeError, "TimeBase required");
918 return 0;
919 }
920 *p_itself = ((TimeBaseObject *)v)->ob_itself;
921 return 1;
922}
923
924static void TimeBaseObj_dealloc(self)
925 TimeBaseObject *self;
926{
927 DisposeTimeBase(self->ob_itself);
928 PyMem_DEL(self);
929}
930
931static PyObject *TimeBaseObj_SetTimeBaseValue(_self, _args)
932 TimeBaseObject *_self;
933 PyObject *_args;
934{
935 PyObject *_res = NULL;
936 TimeValue t;
937 TimeScale s;
938 if (!PyArg_ParseTuple(_args, "ll",
939 &t,
940 &s))
941 return NULL;
942 SetTimeBaseValue(_self->ob_itself,
943 t,
944 s);
945 Py_INCREF(Py_None);
946 _res = Py_None;
947 return _res;
948}
949
950static PyObject *TimeBaseObj_GetTimeBaseRate(_self, _args)
951 TimeBaseObject *_self;
952 PyObject *_args;
953{
954 PyObject *_res = NULL;
955 Fixed _rv;
956 if (!PyArg_ParseTuple(_args, ""))
957 return NULL;
958 _rv = GetTimeBaseRate(_self->ob_itself);
959 _res = Py_BuildValue("O&",
960 PyMac_BuildFixed, _rv);
961 return _res;
962}
963
964static PyObject *TimeBaseObj_SetTimeBaseRate(_self, _args)
965 TimeBaseObject *_self;
966 PyObject *_args;
967{
968 PyObject *_res = NULL;
969 Fixed r;
970 if (!PyArg_ParseTuple(_args, "O&",
971 PyMac_GetFixed, &r))
972 return NULL;
973 SetTimeBaseRate(_self->ob_itself,
974 r);
975 Py_INCREF(Py_None);
976 _res = Py_None;
977 return _res;
978}
979
980static PyObject *TimeBaseObj_GetTimeBaseFlags(_self, _args)
981 TimeBaseObject *_self;
982 PyObject *_args;
983{
984 PyObject *_res = NULL;
985 long _rv;
986 if (!PyArg_ParseTuple(_args, ""))
987 return NULL;
988 _rv = GetTimeBaseFlags(_self->ob_itself);
989 _res = Py_BuildValue("l",
990 _rv);
991 return _res;
992}
993
994static PyObject *TimeBaseObj_SetTimeBaseFlags(_self, _args)
995 TimeBaseObject *_self;
996 PyObject *_args;
997{
998 PyObject *_res = NULL;
999 long timeBaseFlags;
1000 if (!PyArg_ParseTuple(_args, "l",
1001 &timeBaseFlags))
1002 return NULL;
1003 SetTimeBaseFlags(_self->ob_itself,
1004 timeBaseFlags);
1005 Py_INCREF(Py_None);
1006 _res = Py_None;
1007 return _res;
1008}
1009
1010static PyObject *TimeBaseObj_GetTimeBaseMasterTimeBase(_self, _args)
1011 TimeBaseObject *_self;
1012 PyObject *_args;
1013{
1014 PyObject *_res = NULL;
1015 TimeBase _rv;
1016 if (!PyArg_ParseTuple(_args, ""))
1017 return NULL;
1018 _rv = GetTimeBaseMasterTimeBase(_self->ob_itself);
1019 _res = Py_BuildValue("O&",
1020 TimeBaseObj_New, _rv);
1021 return _res;
1022}
1023
1024static PyObject *TimeBaseObj_GetTimeBaseMasterClock(_self, _args)
1025 TimeBaseObject *_self;
1026 PyObject *_args;
1027{
1028 PyObject *_res = NULL;
1029 ComponentInstance _rv;
1030 if (!PyArg_ParseTuple(_args, ""))
1031 return NULL;
1032 _rv = GetTimeBaseMasterClock(_self->ob_itself);
1033 _res = Py_BuildValue("O&",
1034 CmpInstObj_New, _rv);
1035 return _res;
1036}
1037
1038static PyObject *TimeBaseObj_GetTimeBaseEffectiveRate(_self, _args)
1039 TimeBaseObject *_self;
1040 PyObject *_args;
1041{
1042 PyObject *_res = NULL;
1043 Fixed _rv;
1044 if (!PyArg_ParseTuple(_args, ""))
1045 return NULL;
1046 _rv = GetTimeBaseEffectiveRate(_self->ob_itself);
1047 _res = Py_BuildValue("O&",
1048 PyMac_BuildFixed, _rv);
1049 return _res;
1050}
1051
1052static PyMethodDef TimeBaseObj_methods[] = {
1053 {"SetTimeBaseValue", (PyCFunction)TimeBaseObj_SetTimeBaseValue, 1,
1054 "(TimeValue t, TimeScale s) -> None"},
1055 {"GetTimeBaseRate", (PyCFunction)TimeBaseObj_GetTimeBaseRate, 1,
1056 "() -> (Fixed _rv)"},
1057 {"SetTimeBaseRate", (PyCFunction)TimeBaseObj_SetTimeBaseRate, 1,
1058 "(Fixed r) -> None"},
1059 {"GetTimeBaseFlags", (PyCFunction)TimeBaseObj_GetTimeBaseFlags, 1,
1060 "() -> (long _rv)"},
1061 {"SetTimeBaseFlags", (PyCFunction)TimeBaseObj_SetTimeBaseFlags, 1,
1062 "(long timeBaseFlags) -> None"},
1063 {"GetTimeBaseMasterTimeBase", (PyCFunction)TimeBaseObj_GetTimeBaseMasterTimeBase, 1,
1064 "() -> (TimeBase _rv)"},
1065 {"GetTimeBaseMasterClock", (PyCFunction)TimeBaseObj_GetTimeBaseMasterClock, 1,
1066 "() -> (ComponentInstance _rv)"},
1067 {"GetTimeBaseEffectiveRate", (PyCFunction)TimeBaseObj_GetTimeBaseEffectiveRate, 1,
1068 "() -> (Fixed _rv)"},
1069 {NULL, NULL, 0}
1070};
1071
1072PyMethodChain TimeBaseObj_chain = { TimeBaseObj_methods, NULL };
1073
1074static PyObject *TimeBaseObj_getattr(self, name)
1075 TimeBaseObject *self;
1076 char *name;
1077{
1078 return Py_FindMethodInChain(&TimeBaseObj_chain, (PyObject *)self, name);
1079}
1080
1081#define TimeBaseObj_setattr NULL
1082
1083PyTypeObject TimeBase_Type = {
1084 PyObject_HEAD_INIT(&PyType_Type)
1085 0, /*ob_size*/
1086 "TimeBase", /*tp_name*/
1087 sizeof(TimeBaseObject), /*tp_basicsize*/
1088 0, /*tp_itemsize*/
1089 /* methods */
1090 (destructor) TimeBaseObj_dealloc, /*tp_dealloc*/
1091 0, /*tp_print*/
1092 (getattrfunc) TimeBaseObj_getattr, /*tp_getattr*/
1093 (setattrfunc) TimeBaseObj_setattr, /*tp_setattr*/
1094};
1095
1096/* -------------------- End object type TimeBase -------------------- */
1097
1098
1099/* ---------------------- Object type UserData ---------------------- */
1100
1101PyTypeObject UserData_Type;
1102
1103#define UserDataObj_Check(x) ((x)->ob_type == &UserData_Type)
1104
1105typedef struct UserDataObject {
1106 PyObject_HEAD
1107 UserData ob_itself;
1108} UserDataObject;
1109
1110PyObject *UserDataObj_New(itself)
1111 UserData itself;
1112{
1113 UserDataObject *it;
1114 if (itself == NULL) {
1115 PyErr_SetString(Qt_Error,"Cannot create null UserData");
1116 return NULL;
1117 }
1118 it = PyObject_NEW(UserDataObject, &UserData_Type);
1119 if (it == NULL) return NULL;
1120 it->ob_itself = itself;
1121 return (PyObject *)it;
1122}
1123UserDataObj_Convert(v, p_itself)
1124 PyObject *v;
1125 UserData *p_itself;
1126{
1127 if (!UserDataObj_Check(v))
1128 {
1129 PyErr_SetString(PyExc_TypeError, "UserData required");
1130 return 0;
1131 }
1132 *p_itself = ((UserDataObject *)v)->ob_itself;
1133 return 1;
1134}
1135
1136static void UserDataObj_dealloc(self)
1137 UserDataObject *self;
1138{
1139 DisposeUserData(self->ob_itself);
1140 PyMem_DEL(self);
1141}
1142
1143static PyObject *UserDataObj_GetUserData(_self, _args)
1144 UserDataObject *_self;
1145 PyObject *_args;
1146{
1147 PyObject *_res = NULL;
1148 OSErr _err;
1149 Handle data;
1150 OSType udType;
1151 long index;
1152 if (!PyArg_ParseTuple(_args, "O&O&l",
1153 ResObj_Convert, &data,
1154 PyMac_GetOSType, &udType,
1155 &index))
1156 return NULL;
1157 _err = GetUserData(_self->ob_itself,
1158 data,
1159 udType,
1160 index);
1161 if (_err != noErr) return PyMac_Error(_err);
1162 Py_INCREF(Py_None);
1163 _res = Py_None;
1164 return _res;
1165}
1166
1167static PyObject *UserDataObj_AddUserData(_self, _args)
1168 UserDataObject *_self;
1169 PyObject *_args;
1170{
1171 PyObject *_res = NULL;
1172 OSErr _err;
1173 Handle data;
1174 OSType udType;
1175 if (!PyArg_ParseTuple(_args, "O&O&",
1176 ResObj_Convert, &data,
1177 PyMac_GetOSType, &udType))
1178 return NULL;
1179 _err = AddUserData(_self->ob_itself,
1180 data,
1181 udType);
1182 if (_err != noErr) return PyMac_Error(_err);
1183 Py_INCREF(Py_None);
1184 _res = Py_None;
1185 return _res;
1186}
1187
1188static PyObject *UserDataObj_RemoveUserData(_self, _args)
1189 UserDataObject *_self;
1190 PyObject *_args;
1191{
1192 PyObject *_res = NULL;
1193 OSErr _err;
1194 OSType udType;
1195 long index;
1196 if (!PyArg_ParseTuple(_args, "O&l",
1197 PyMac_GetOSType, &udType,
1198 &index))
1199 return NULL;
1200 _err = RemoveUserData(_self->ob_itself,
1201 udType,
1202 index);
1203 if (_err != noErr) return PyMac_Error(_err);
1204 Py_INCREF(Py_None);
1205 _res = Py_None;
1206 return _res;
1207}
1208
1209static PyObject *UserDataObj_CountUserDataType(_self, _args)
1210 UserDataObject *_self;
1211 PyObject *_args;
1212{
1213 PyObject *_res = NULL;
1214 short _rv;
1215 OSType udType;
1216 if (!PyArg_ParseTuple(_args, "O&",
1217 PyMac_GetOSType, &udType))
1218 return NULL;
1219 _rv = CountUserDataType(_self->ob_itself,
1220 udType);
1221 _res = Py_BuildValue("h",
1222 _rv);
1223 return _res;
1224}
1225
1226static PyObject *UserDataObj_GetNextUserDataType(_self, _args)
1227 UserDataObject *_self;
1228 PyObject *_args;
1229{
1230 PyObject *_res = NULL;
1231 long _rv;
1232 OSType udType;
1233 if (!PyArg_ParseTuple(_args, "O&",
1234 PyMac_GetOSType, &udType))
1235 return NULL;
1236 _rv = GetNextUserDataType(_self->ob_itself,
1237 udType);
1238 _res = Py_BuildValue("l",
1239 _rv);
1240 return _res;
1241}
1242
1243static PyObject *UserDataObj_AddUserDataText(_self, _args)
1244 UserDataObject *_self;
1245 PyObject *_args;
1246{
1247 PyObject *_res = NULL;
1248 OSErr _err;
1249 Handle data;
1250 OSType udType;
1251 long index;
1252 short itlRegionTag;
1253 if (!PyArg_ParseTuple(_args, "O&O&lh",
1254 ResObj_Convert, &data,
1255 PyMac_GetOSType, &udType,
1256 &index,
1257 &itlRegionTag))
1258 return NULL;
1259 _err = AddUserDataText(_self->ob_itself,
1260 data,
1261 udType,
1262 index,
1263 itlRegionTag);
1264 if (_err != noErr) return PyMac_Error(_err);
1265 Py_INCREF(Py_None);
1266 _res = Py_None;
1267 return _res;
1268}
1269
1270static PyObject *UserDataObj_GetUserDataText(_self, _args)
1271 UserDataObject *_self;
1272 PyObject *_args;
1273{
1274 PyObject *_res = NULL;
1275 OSErr _err;
1276 Handle data;
1277 OSType udType;
1278 long index;
1279 short itlRegionTag;
1280 if (!PyArg_ParseTuple(_args, "O&O&lh",
1281 ResObj_Convert, &data,
1282 PyMac_GetOSType, &udType,
1283 &index,
1284 &itlRegionTag))
1285 return NULL;
1286 _err = GetUserDataText(_self->ob_itself,
1287 data,
1288 udType,
1289 index,
1290 itlRegionTag);
1291 if (_err != noErr) return PyMac_Error(_err);
1292 Py_INCREF(Py_None);
1293 _res = Py_None;
1294 return _res;
1295}
1296
1297static PyObject *UserDataObj_RemoveUserDataText(_self, _args)
1298 UserDataObject *_self;
1299 PyObject *_args;
1300{
1301 PyObject *_res = NULL;
1302 OSErr _err;
1303 OSType udType;
1304 long index;
1305 short itlRegionTag;
1306 if (!PyArg_ParseTuple(_args, "O&lh",
1307 PyMac_GetOSType, &udType,
1308 &index,
1309 &itlRegionTag))
1310 return NULL;
1311 _err = RemoveUserDataText(_self->ob_itself,
1312 udType,
1313 index,
1314 itlRegionTag);
1315 if (_err != noErr) return PyMac_Error(_err);
1316 Py_INCREF(Py_None);
1317 _res = Py_None;
1318 return _res;
1319}
1320
1321static PyObject *UserDataObj_PutUserDataIntoHandle(_self, _args)
1322 UserDataObject *_self;
1323 PyObject *_args;
1324{
1325 PyObject *_res = NULL;
1326 OSErr _err;
1327 Handle h;
1328 if (!PyArg_ParseTuple(_args, "O&",
1329 ResObj_Convert, &h))
1330 return NULL;
1331 _err = PutUserDataIntoHandle(_self->ob_itself,
1332 h);
1333 if (_err != noErr) return PyMac_Error(_err);
1334 Py_INCREF(Py_None);
1335 _res = Py_None;
1336 return _res;
1337}
1338
1339static PyMethodDef UserDataObj_methods[] = {
1340 {"GetUserData", (PyCFunction)UserDataObj_GetUserData, 1,
1341 "(Handle data, OSType udType, long index) -> None"},
1342 {"AddUserData", (PyCFunction)UserDataObj_AddUserData, 1,
1343 "(Handle data, OSType udType) -> None"},
1344 {"RemoveUserData", (PyCFunction)UserDataObj_RemoveUserData, 1,
1345 "(OSType udType, long index) -> None"},
1346 {"CountUserDataType", (PyCFunction)UserDataObj_CountUserDataType, 1,
1347 "(OSType udType) -> (short _rv)"},
1348 {"GetNextUserDataType", (PyCFunction)UserDataObj_GetNextUserDataType, 1,
1349 "(OSType udType) -> (long _rv)"},
1350 {"AddUserDataText", (PyCFunction)UserDataObj_AddUserDataText, 1,
1351 "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
1352 {"GetUserDataText", (PyCFunction)UserDataObj_GetUserDataText, 1,
1353 "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
1354 {"RemoveUserDataText", (PyCFunction)UserDataObj_RemoveUserDataText, 1,
1355 "(OSType udType, long index, short itlRegionTag) -> None"},
1356 {"PutUserDataIntoHandle", (PyCFunction)UserDataObj_PutUserDataIntoHandle, 1,
1357 "(Handle h) -> None"},
1358 {NULL, NULL, 0}
1359};
1360
1361PyMethodChain UserDataObj_chain = { UserDataObj_methods, NULL };
1362
1363static PyObject *UserDataObj_getattr(self, name)
1364 UserDataObject *self;
1365 char *name;
1366{
1367 return Py_FindMethodInChain(&UserDataObj_chain, (PyObject *)self, name);
1368}
1369
1370#define UserDataObj_setattr NULL
1371
1372PyTypeObject UserData_Type = {
1373 PyObject_HEAD_INIT(&PyType_Type)
1374 0, /*ob_size*/
1375 "UserData", /*tp_name*/
1376 sizeof(UserDataObject), /*tp_basicsize*/
1377 0, /*tp_itemsize*/
1378 /* methods */
1379 (destructor) UserDataObj_dealloc, /*tp_dealloc*/
1380 0, /*tp_print*/
1381 (getattrfunc) UserDataObj_getattr, /*tp_getattr*/
1382 (setattrfunc) UserDataObj_setattr, /*tp_setattr*/
1383};
1384
1385/* -------------------- End object type UserData -------------------- */
1386
1387
1388/* ----------------------- Object type Media ------------------------ */
1389
1390PyTypeObject Media_Type;
1391
1392#define MediaObj_Check(x) ((x)->ob_type == &Media_Type)
1393
1394typedef struct MediaObject {
1395 PyObject_HEAD
1396 Media ob_itself;
1397} MediaObject;
1398
1399PyObject *MediaObj_New(itself)
1400 Media itself;
1401{
1402 MediaObject *it;
1403 if (itself == NULL) {
1404 PyErr_SetString(Qt_Error,"Cannot create null Media");
1405 return NULL;
1406 }
1407 it = PyObject_NEW(MediaObject, &Media_Type);
1408 if (it == NULL) return NULL;
1409 it->ob_itself = itself;
1410 return (PyObject *)it;
1411}
1412MediaObj_Convert(v, p_itself)
1413 PyObject *v;
1414 Media *p_itself;
1415{
1416 if (!MediaObj_Check(v))
1417 {
1418 PyErr_SetString(PyExc_TypeError, "Media required");
1419 return 0;
1420 }
1421 *p_itself = ((MediaObject *)v)->ob_itself;
1422 return 1;
1423}
1424
1425static void MediaObj_dealloc(self)
1426 MediaObject *self;
1427{
1428 DisposeTrackMedia(self->ob_itself);
1429 PyMem_DEL(self);
1430}
1431
1432static PyObject *MediaObj_LoadMediaIntoRam(_self, _args)
1433 MediaObject *_self;
1434 PyObject *_args;
1435{
1436 PyObject *_res = NULL;
1437 OSErr _err;
1438 TimeValue time;
1439 TimeValue duration;
1440 long flags;
1441 if (!PyArg_ParseTuple(_args, "lll",
1442 &time,
1443 &duration,
1444 &flags))
1445 return NULL;
1446 _err = LoadMediaIntoRam(_self->ob_itself,
1447 time,
1448 duration,
1449 flags);
1450 if (_err != noErr) return PyMac_Error(_err);
1451 Py_INCREF(Py_None);
1452 _res = Py_None;
1453 return _res;
1454}
1455
1456static PyObject *MediaObj_GetMediaTrack(_self, _args)
1457 MediaObject *_self;
1458 PyObject *_args;
1459{
1460 PyObject *_res = NULL;
1461 Track _rv;
1462 if (!PyArg_ParseTuple(_args, ""))
1463 return NULL;
1464 _rv = GetMediaTrack(_self->ob_itself);
1465 _res = Py_BuildValue("O&",
1466 TrackObj_New, _rv);
1467 return _res;
1468}
1469
Jack Jansene0cf87b1997-04-09 15:53:46 +00001470static PyObject *MediaObj_GetMediaCreationTime(_self, _args)
1471 MediaObject *_self;
1472 PyObject *_args;
1473{
1474 PyObject *_res = NULL;
1475 unsigned long _rv;
1476 if (!PyArg_ParseTuple(_args, ""))
1477 return NULL;
1478 _rv = GetMediaCreationTime(_self->ob_itself);
1479 _res = Py_BuildValue("l",
1480 _rv);
1481 return _res;
1482}
1483
1484static PyObject *MediaObj_GetMediaModificationTime(_self, _args)
1485 MediaObject *_self;
1486 PyObject *_args;
1487{
1488 PyObject *_res = NULL;
1489 unsigned long _rv;
1490 if (!PyArg_ParseTuple(_args, ""))
1491 return NULL;
1492 _rv = GetMediaModificationTime(_self->ob_itself);
1493 _res = Py_BuildValue("l",
1494 _rv);
1495 return _res;
1496}
1497
Jack Jansen453ced51995-11-30 17:42:08 +00001498static PyObject *MediaObj_GetMediaTimeScale(_self, _args)
1499 MediaObject *_self;
1500 PyObject *_args;
1501{
1502 PyObject *_res = NULL;
1503 TimeScale _rv;
1504 if (!PyArg_ParseTuple(_args, ""))
1505 return NULL;
1506 _rv = GetMediaTimeScale(_self->ob_itself);
1507 _res = Py_BuildValue("l",
1508 _rv);
1509 return _res;
1510}
1511
1512static PyObject *MediaObj_SetMediaTimeScale(_self, _args)
1513 MediaObject *_self;
1514 PyObject *_args;
1515{
1516 PyObject *_res = NULL;
1517 TimeScale timeScale;
1518 if (!PyArg_ParseTuple(_args, "l",
1519 &timeScale))
1520 return NULL;
1521 SetMediaTimeScale(_self->ob_itself,
1522 timeScale);
1523 Py_INCREF(Py_None);
1524 _res = Py_None;
1525 return _res;
1526}
1527
1528static PyObject *MediaObj_GetMediaDuration(_self, _args)
1529 MediaObject *_self;
1530 PyObject *_args;
1531{
1532 PyObject *_res = NULL;
1533 TimeValue _rv;
1534 if (!PyArg_ParseTuple(_args, ""))
1535 return NULL;
1536 _rv = GetMediaDuration(_self->ob_itself);
1537 _res = Py_BuildValue("l",
1538 _rv);
1539 return _res;
1540}
1541
1542static PyObject *MediaObj_GetMediaLanguage(_self, _args)
1543 MediaObject *_self;
1544 PyObject *_args;
1545{
1546 PyObject *_res = NULL;
1547 short _rv;
1548 if (!PyArg_ParseTuple(_args, ""))
1549 return NULL;
1550 _rv = GetMediaLanguage(_self->ob_itself);
1551 _res = Py_BuildValue("h",
1552 _rv);
1553 return _res;
1554}
1555
1556static PyObject *MediaObj_SetMediaLanguage(_self, _args)
1557 MediaObject *_self;
1558 PyObject *_args;
1559{
1560 PyObject *_res = NULL;
1561 short language;
1562 if (!PyArg_ParseTuple(_args, "h",
1563 &language))
1564 return NULL;
1565 SetMediaLanguage(_self->ob_itself,
1566 language);
1567 Py_INCREF(Py_None);
1568 _res = Py_None;
1569 return _res;
1570}
1571
1572static PyObject *MediaObj_GetMediaQuality(_self, _args)
1573 MediaObject *_self;
1574 PyObject *_args;
1575{
1576 PyObject *_res = NULL;
1577 short _rv;
1578 if (!PyArg_ParseTuple(_args, ""))
1579 return NULL;
1580 _rv = GetMediaQuality(_self->ob_itself);
1581 _res = Py_BuildValue("h",
1582 _rv);
1583 return _res;
1584}
1585
1586static PyObject *MediaObj_SetMediaQuality(_self, _args)
1587 MediaObject *_self;
1588 PyObject *_args;
1589{
1590 PyObject *_res = NULL;
1591 short quality;
1592 if (!PyArg_ParseTuple(_args, "h",
1593 &quality))
1594 return NULL;
1595 SetMediaQuality(_self->ob_itself,
1596 quality);
1597 Py_INCREF(Py_None);
1598 _res = Py_None;
1599 return _res;
1600}
1601
1602static PyObject *MediaObj_GetMediaHandlerDescription(_self, _args)
1603 MediaObject *_self;
1604 PyObject *_args;
1605{
1606 PyObject *_res = NULL;
1607 OSType mediaType;
1608 Str255 creatorName;
1609 OSType creatorManufacturer;
1610 if (!PyArg_ParseTuple(_args, "O&",
1611 PyMac_GetStr255, creatorName))
1612 return NULL;
1613 GetMediaHandlerDescription(_self->ob_itself,
1614 &mediaType,
1615 creatorName,
1616 &creatorManufacturer);
1617 _res = Py_BuildValue("O&O&",
1618 PyMac_BuildOSType, mediaType,
1619 PyMac_BuildOSType, creatorManufacturer);
1620 return _res;
1621}
1622
1623static PyObject *MediaObj_GetMediaUserData(_self, _args)
1624 MediaObject *_self;
1625 PyObject *_args;
1626{
1627 PyObject *_res = NULL;
1628 UserData _rv;
1629 if (!PyArg_ParseTuple(_args, ""))
1630 return NULL;
1631 _rv = GetMediaUserData(_self->ob_itself);
1632 _res = Py_BuildValue("O&",
1633 UserDataObj_New, _rv);
1634 return _res;
1635}
1636
1637static PyObject *MediaObj_GetMediaHandler(_self, _args)
1638 MediaObject *_self;
1639 PyObject *_args;
1640{
1641 PyObject *_res = NULL;
1642 MediaHandler _rv;
1643 if (!PyArg_ParseTuple(_args, ""))
1644 return NULL;
1645 _rv = GetMediaHandler(_self->ob_itself);
1646 _res = Py_BuildValue("O&",
1647 CmpInstObj_New, _rv);
1648 return _res;
1649}
1650
1651static PyObject *MediaObj_SetMediaHandler(_self, _args)
1652 MediaObject *_self;
1653 PyObject *_args;
1654{
1655 PyObject *_res = NULL;
1656 OSErr _err;
1657 MediaHandlerComponent mH;
1658 if (!PyArg_ParseTuple(_args, "O&",
1659 CmpObj_Convert, &mH))
1660 return NULL;
1661 _err = SetMediaHandler(_self->ob_itself,
1662 mH);
1663 if (_err != noErr) return PyMac_Error(_err);
1664 Py_INCREF(Py_None);
1665 _res = Py_None;
1666 return _res;
1667}
1668
1669static PyObject *MediaObj_BeginMediaEdits(_self, _args)
1670 MediaObject *_self;
1671 PyObject *_args;
1672{
1673 PyObject *_res = NULL;
1674 OSErr _err;
1675 if (!PyArg_ParseTuple(_args, ""))
1676 return NULL;
1677 _err = BeginMediaEdits(_self->ob_itself);
1678 if (_err != noErr) return PyMac_Error(_err);
1679 Py_INCREF(Py_None);
1680 _res = Py_None;
1681 return _res;
1682}
1683
1684static PyObject *MediaObj_EndMediaEdits(_self, _args)
1685 MediaObject *_self;
1686 PyObject *_args;
1687{
1688 PyObject *_res = NULL;
1689 OSErr _err;
1690 if (!PyArg_ParseTuple(_args, ""))
1691 return NULL;
1692 _err = EndMediaEdits(_self->ob_itself);
1693 if (_err != noErr) return PyMac_Error(_err);
1694 Py_INCREF(Py_None);
1695 _res = Py_None;
1696 return _res;
1697}
1698
1699static PyObject *MediaObj_SetMediaDefaultDataRefIndex(_self, _args)
1700 MediaObject *_self;
1701 PyObject *_args;
1702{
1703 PyObject *_res = NULL;
1704 OSErr _err;
1705 short index;
1706 if (!PyArg_ParseTuple(_args, "h",
1707 &index))
1708 return NULL;
1709 _err = SetMediaDefaultDataRefIndex(_self->ob_itself,
1710 index);
1711 if (_err != noErr) return PyMac_Error(_err);
1712 Py_INCREF(Py_None);
1713 _res = Py_None;
1714 return _res;
1715}
1716
1717static PyObject *MediaObj_GetMediaDataHandlerDescription(_self, _args)
1718 MediaObject *_self;
1719 PyObject *_args;
1720{
1721 PyObject *_res = NULL;
1722 short index;
1723 OSType dhType;
1724 Str255 creatorName;
1725 OSType creatorManufacturer;
1726 if (!PyArg_ParseTuple(_args, "hO&",
1727 &index,
1728 PyMac_GetStr255, creatorName))
1729 return NULL;
1730 GetMediaDataHandlerDescription(_self->ob_itself,
1731 index,
1732 &dhType,
1733 creatorName,
1734 &creatorManufacturer);
1735 _res = Py_BuildValue("O&O&",
1736 PyMac_BuildOSType, dhType,
1737 PyMac_BuildOSType, creatorManufacturer);
1738 return _res;
1739}
1740
1741static PyObject *MediaObj_GetMediaDataHandler(_self, _args)
1742 MediaObject *_self;
1743 PyObject *_args;
1744{
1745 PyObject *_res = NULL;
1746 DataHandler _rv;
1747 short index;
1748 if (!PyArg_ParseTuple(_args, "h",
1749 &index))
1750 return NULL;
1751 _rv = GetMediaDataHandler(_self->ob_itself,
1752 index);
1753 _res = Py_BuildValue("O&",
1754 CmpInstObj_New, _rv);
1755 return _res;
1756}
1757
1758static PyObject *MediaObj_SetMediaDataHandler(_self, _args)
1759 MediaObject *_self;
1760 PyObject *_args;
1761{
1762 PyObject *_res = NULL;
1763 OSErr _err;
1764 short index;
1765 DataHandlerComponent dataHandler;
1766 if (!PyArg_ParseTuple(_args, "hO&",
1767 &index,
1768 CmpObj_Convert, &dataHandler))
1769 return NULL;
1770 _err = SetMediaDataHandler(_self->ob_itself,
1771 index,
1772 dataHandler);
1773 if (_err != noErr) return PyMac_Error(_err);
1774 Py_INCREF(Py_None);
1775 _res = Py_None;
1776 return _res;
1777}
1778
1779static PyObject *MediaObj_GetMediaSampleDescriptionCount(_self, _args)
1780 MediaObject *_self;
1781 PyObject *_args;
1782{
1783 PyObject *_res = NULL;
1784 long _rv;
1785 if (!PyArg_ParseTuple(_args, ""))
1786 return NULL;
1787 _rv = GetMediaSampleDescriptionCount(_self->ob_itself);
1788 _res = Py_BuildValue("l",
1789 _rv);
1790 return _res;
1791}
1792
1793static PyObject *MediaObj_GetMediaSampleDescription(_self, _args)
1794 MediaObject *_self;
1795 PyObject *_args;
1796{
1797 PyObject *_res = NULL;
1798 long index;
1799 SampleDescriptionHandle descH;
1800 if (!PyArg_ParseTuple(_args, "lO&",
1801 &index,
1802 ResObj_Convert, &descH))
1803 return NULL;
1804 GetMediaSampleDescription(_self->ob_itself,
1805 index,
1806 descH);
1807 Py_INCREF(Py_None);
1808 _res = Py_None;
1809 return _res;
1810}
1811
1812static PyObject *MediaObj_SetMediaSampleDescription(_self, _args)
1813 MediaObject *_self;
1814 PyObject *_args;
1815{
1816 PyObject *_res = NULL;
1817 OSErr _err;
1818 long index;
1819 SampleDescriptionHandle descH;
1820 if (!PyArg_ParseTuple(_args, "lO&",
1821 &index,
1822 ResObj_Convert, &descH))
1823 return NULL;
1824 _err = SetMediaSampleDescription(_self->ob_itself,
1825 index,
1826 descH);
1827 if (_err != noErr) return PyMac_Error(_err);
1828 Py_INCREF(Py_None);
1829 _res = Py_None;
1830 return _res;
1831}
1832
1833static PyObject *MediaObj_GetMediaSampleCount(_self, _args)
1834 MediaObject *_self;
1835 PyObject *_args;
1836{
1837 PyObject *_res = NULL;
1838 long _rv;
1839 if (!PyArg_ParseTuple(_args, ""))
1840 return NULL;
1841 _rv = GetMediaSampleCount(_self->ob_itself);
1842 _res = Py_BuildValue("l",
1843 _rv);
1844 return _res;
1845}
1846
1847static PyObject *MediaObj_SampleNumToMediaTime(_self, _args)
1848 MediaObject *_self;
1849 PyObject *_args;
1850{
1851 PyObject *_res = NULL;
1852 long logicalSampleNum;
1853 TimeValue sampleTime;
1854 TimeValue sampleDuration;
1855 if (!PyArg_ParseTuple(_args, "l",
1856 &logicalSampleNum))
1857 return NULL;
1858 SampleNumToMediaTime(_self->ob_itself,
1859 logicalSampleNum,
1860 &sampleTime,
1861 &sampleDuration);
1862 _res = Py_BuildValue("ll",
1863 sampleTime,
1864 sampleDuration);
1865 return _res;
1866}
1867
1868static PyObject *MediaObj_MediaTimeToSampleNum(_self, _args)
1869 MediaObject *_self;
1870 PyObject *_args;
1871{
1872 PyObject *_res = NULL;
1873 TimeValue time;
1874 long sampleNum;
1875 TimeValue sampleTime;
1876 TimeValue sampleDuration;
1877 if (!PyArg_ParseTuple(_args, "l",
1878 &time))
1879 return NULL;
1880 MediaTimeToSampleNum(_self->ob_itself,
1881 time,
1882 &sampleNum,
1883 &sampleTime,
1884 &sampleDuration);
1885 _res = Py_BuildValue("lll",
1886 sampleNum,
1887 sampleTime,
1888 sampleDuration);
1889 return _res;
1890}
1891
1892static PyObject *MediaObj_AddMediaSample(_self, _args)
1893 MediaObject *_self;
1894 PyObject *_args;
1895{
1896 PyObject *_res = NULL;
1897 OSErr _err;
1898 Handle dataIn;
1899 long inOffset;
1900 unsigned long size;
1901 TimeValue durationPerSample;
1902 SampleDescriptionHandle sampleDescriptionH;
1903 long numberOfSamples;
1904 short sampleFlags;
1905 TimeValue sampleTime;
1906 if (!PyArg_ParseTuple(_args, "O&lllO&lh",
1907 ResObj_Convert, &dataIn,
1908 &inOffset,
1909 &size,
1910 &durationPerSample,
1911 ResObj_Convert, &sampleDescriptionH,
1912 &numberOfSamples,
1913 &sampleFlags))
1914 return NULL;
1915 _err = AddMediaSample(_self->ob_itself,
1916 dataIn,
1917 inOffset,
1918 size,
1919 durationPerSample,
1920 sampleDescriptionH,
1921 numberOfSamples,
1922 sampleFlags,
1923 &sampleTime);
1924 if (_err != noErr) return PyMac_Error(_err);
1925 _res = Py_BuildValue("l",
1926 sampleTime);
1927 return _res;
1928}
1929
1930static PyObject *MediaObj_AddMediaSampleReference(_self, _args)
1931 MediaObject *_self;
1932 PyObject *_args;
1933{
1934 PyObject *_res = NULL;
1935 OSErr _err;
1936 long dataOffset;
1937 unsigned long size;
1938 TimeValue durationPerSample;
1939 SampleDescriptionHandle sampleDescriptionH;
1940 long numberOfSamples;
1941 short sampleFlags;
1942 TimeValue sampleTime;
1943 if (!PyArg_ParseTuple(_args, "lllO&lh",
1944 &dataOffset,
1945 &size,
1946 &durationPerSample,
1947 ResObj_Convert, &sampleDescriptionH,
1948 &numberOfSamples,
1949 &sampleFlags))
1950 return NULL;
1951 _err = AddMediaSampleReference(_self->ob_itself,
1952 dataOffset,
1953 size,
1954 durationPerSample,
1955 sampleDescriptionH,
1956 numberOfSamples,
1957 sampleFlags,
1958 &sampleTime);
1959 if (_err != noErr) return PyMac_Error(_err);
1960 _res = Py_BuildValue("l",
1961 sampleTime);
1962 return _res;
1963}
1964
1965static PyObject *MediaObj_GetMediaSample(_self, _args)
1966 MediaObject *_self;
1967 PyObject *_args;
1968{
1969 PyObject *_res = NULL;
1970 OSErr _err;
1971 Handle dataOut;
1972 long maxSizeToGrow;
1973 long size;
1974 TimeValue time;
1975 TimeValue sampleTime;
1976 TimeValue durationPerSample;
1977 SampleDescriptionHandle sampleDescriptionH;
1978 long sampleDescriptionIndex;
1979 long maxNumberOfSamples;
1980 long numberOfSamples;
1981 short sampleFlags;
1982 if (!PyArg_ParseTuple(_args, "O&llO&l",
1983 ResObj_Convert, &dataOut,
1984 &maxSizeToGrow,
1985 &time,
1986 ResObj_Convert, &sampleDescriptionH,
1987 &maxNumberOfSamples))
1988 return NULL;
1989 _err = GetMediaSample(_self->ob_itself,
1990 dataOut,
1991 maxSizeToGrow,
1992 &size,
1993 time,
1994 &sampleTime,
1995 &durationPerSample,
1996 sampleDescriptionH,
1997 &sampleDescriptionIndex,
1998 maxNumberOfSamples,
1999 &numberOfSamples,
2000 &sampleFlags);
2001 if (_err != noErr) return PyMac_Error(_err);
2002 _res = Py_BuildValue("lllllh",
2003 size,
2004 sampleTime,
2005 durationPerSample,
2006 sampleDescriptionIndex,
2007 numberOfSamples,
2008 sampleFlags);
2009 return _res;
2010}
2011
2012static PyObject *MediaObj_GetMediaSampleReference(_self, _args)
2013 MediaObject *_self;
2014 PyObject *_args;
2015{
2016 PyObject *_res = NULL;
2017 OSErr _err;
2018 long dataOffset;
2019 long size;
2020 TimeValue time;
2021 TimeValue sampleTime;
2022 TimeValue durationPerSample;
2023 SampleDescriptionHandle sampleDescriptionH;
2024 long sampleDescriptionIndex;
2025 long maxNumberOfSamples;
2026 long numberOfSamples;
2027 short sampleFlags;
2028 if (!PyArg_ParseTuple(_args, "lO&l",
2029 &time,
2030 ResObj_Convert, &sampleDescriptionH,
2031 &maxNumberOfSamples))
2032 return NULL;
2033 _err = GetMediaSampleReference(_self->ob_itself,
2034 &dataOffset,
2035 &size,
2036 time,
2037 &sampleTime,
2038 &durationPerSample,
2039 sampleDescriptionH,
2040 &sampleDescriptionIndex,
2041 maxNumberOfSamples,
2042 &numberOfSamples,
2043 &sampleFlags);
2044 if (_err != noErr) return PyMac_Error(_err);
2045 _res = Py_BuildValue("llllllh",
2046 dataOffset,
2047 size,
2048 sampleTime,
2049 durationPerSample,
2050 sampleDescriptionIndex,
2051 numberOfSamples,
2052 sampleFlags);
2053 return _res;
2054}
2055
2056static PyObject *MediaObj_SetMediaPreferredChunkSize(_self, _args)
2057 MediaObject *_self;
2058 PyObject *_args;
2059{
2060 PyObject *_res = NULL;
2061 OSErr _err;
2062 long maxChunkSize;
2063 if (!PyArg_ParseTuple(_args, "l",
2064 &maxChunkSize))
2065 return NULL;
2066 _err = SetMediaPreferredChunkSize(_self->ob_itself,
2067 maxChunkSize);
2068 if (_err != noErr) return PyMac_Error(_err);
2069 Py_INCREF(Py_None);
2070 _res = Py_None;
2071 return _res;
2072}
2073
2074static PyObject *MediaObj_GetMediaPreferredChunkSize(_self, _args)
2075 MediaObject *_self;
2076 PyObject *_args;
2077{
2078 PyObject *_res = NULL;
2079 OSErr _err;
2080 long maxChunkSize;
2081 if (!PyArg_ParseTuple(_args, ""))
2082 return NULL;
2083 _err = GetMediaPreferredChunkSize(_self->ob_itself,
2084 &maxChunkSize);
2085 if (_err != noErr) return PyMac_Error(_err);
2086 _res = Py_BuildValue("l",
2087 maxChunkSize);
2088 return _res;
2089}
2090
2091static PyObject *MediaObj_SetMediaShadowSync(_self, _args)
2092 MediaObject *_self;
2093 PyObject *_args;
2094{
2095 PyObject *_res = NULL;
2096 OSErr _err;
2097 long frameDiffSampleNum;
2098 long syncSampleNum;
2099 if (!PyArg_ParseTuple(_args, "ll",
2100 &frameDiffSampleNum,
2101 &syncSampleNum))
2102 return NULL;
2103 _err = SetMediaShadowSync(_self->ob_itself,
2104 frameDiffSampleNum,
2105 syncSampleNum);
2106 if (_err != noErr) return PyMac_Error(_err);
2107 Py_INCREF(Py_None);
2108 _res = Py_None;
2109 return _res;
2110}
2111
2112static PyObject *MediaObj_GetMediaShadowSync(_self, _args)
2113 MediaObject *_self;
2114 PyObject *_args;
2115{
2116 PyObject *_res = NULL;
2117 OSErr _err;
2118 long frameDiffSampleNum;
2119 long syncSampleNum;
2120 if (!PyArg_ParseTuple(_args, "l",
2121 &frameDiffSampleNum))
2122 return NULL;
2123 _err = GetMediaShadowSync(_self->ob_itself,
2124 frameDiffSampleNum,
2125 &syncSampleNum);
2126 if (_err != noErr) return PyMac_Error(_err);
2127 _res = Py_BuildValue("l",
2128 syncSampleNum);
2129 return _res;
2130}
2131
2132static PyObject *MediaObj_GetMediaDataSize(_self, _args)
2133 MediaObject *_self;
2134 PyObject *_args;
2135{
2136 PyObject *_res = NULL;
2137 long _rv;
2138 TimeValue startTime;
2139 TimeValue duration;
2140 if (!PyArg_ParseTuple(_args, "ll",
2141 &startTime,
2142 &duration))
2143 return NULL;
2144 _rv = GetMediaDataSize(_self->ob_itself,
2145 startTime,
2146 duration);
2147 _res = Py_BuildValue("l",
2148 _rv);
2149 return _res;
2150}
2151
2152static PyObject *MediaObj_GetMediaNextInterestingTime(_self, _args)
2153 MediaObject *_self;
2154 PyObject *_args;
2155{
2156 PyObject *_res = NULL;
2157 short interestingTimeFlags;
2158 TimeValue time;
2159 Fixed rate;
2160 TimeValue interestingTime;
2161 TimeValue interestingDuration;
2162 if (!PyArg_ParseTuple(_args, "hlO&",
2163 &interestingTimeFlags,
2164 &time,
2165 PyMac_GetFixed, &rate))
2166 return NULL;
2167 GetMediaNextInterestingTime(_self->ob_itself,
2168 interestingTimeFlags,
2169 time,
2170 rate,
2171 &interestingTime,
2172 &interestingDuration);
2173 _res = Py_BuildValue("ll",
2174 interestingTime,
2175 interestingDuration);
2176 return _res;
2177}
2178
2179static PyObject *MediaObj_GetMediaDataRef(_self, _args)
2180 MediaObject *_self;
2181 PyObject *_args;
2182{
2183 PyObject *_res = NULL;
2184 OSErr _err;
2185 short index;
2186 Handle dataRef;
2187 OSType dataRefType;
2188 long dataRefAttributes;
2189 if (!PyArg_ParseTuple(_args, "h",
2190 &index))
2191 return NULL;
2192 _err = GetMediaDataRef(_self->ob_itself,
2193 index,
2194 &dataRef,
2195 &dataRefType,
2196 &dataRefAttributes);
2197 if (_err != noErr) return PyMac_Error(_err);
2198 _res = Py_BuildValue("O&O&l",
2199 ResObj_New, dataRef,
2200 PyMac_BuildOSType, dataRefType,
2201 dataRefAttributes);
2202 return _res;
2203}
2204
2205static PyObject *MediaObj_SetMediaDataRef(_self, _args)
2206 MediaObject *_self;
2207 PyObject *_args;
2208{
2209 PyObject *_res = NULL;
2210 OSErr _err;
2211 short index;
2212 Handle dataRef;
2213 OSType dataRefType;
2214 if (!PyArg_ParseTuple(_args, "hO&O&",
2215 &index,
2216 ResObj_Convert, &dataRef,
2217 PyMac_GetOSType, &dataRefType))
2218 return NULL;
2219 _err = SetMediaDataRef(_self->ob_itself,
2220 index,
2221 dataRef,
2222 dataRefType);
2223 if (_err != noErr) return PyMac_Error(_err);
2224 Py_INCREF(Py_None);
2225 _res = Py_None;
2226 return _res;
2227}
2228
2229static PyObject *MediaObj_SetMediaDataRefAttributes(_self, _args)
2230 MediaObject *_self;
2231 PyObject *_args;
2232{
2233 PyObject *_res = NULL;
2234 OSErr _err;
2235 short index;
2236 long dataRefAttributes;
2237 if (!PyArg_ParseTuple(_args, "hl",
2238 &index,
2239 &dataRefAttributes))
2240 return NULL;
2241 _err = SetMediaDataRefAttributes(_self->ob_itself,
2242 index,
2243 dataRefAttributes);
2244 if (_err != noErr) return PyMac_Error(_err);
2245 Py_INCREF(Py_None);
2246 _res = Py_None;
2247 return _res;
2248}
2249
2250static PyObject *MediaObj_AddMediaDataRef(_self, _args)
2251 MediaObject *_self;
2252 PyObject *_args;
2253{
2254 PyObject *_res = NULL;
2255 OSErr _err;
2256 short index;
2257 Handle dataRef;
2258 OSType dataRefType;
2259 if (!PyArg_ParseTuple(_args, "O&O&",
2260 ResObj_Convert, &dataRef,
2261 PyMac_GetOSType, &dataRefType))
2262 return NULL;
2263 _err = AddMediaDataRef(_self->ob_itself,
2264 &index,
2265 dataRef,
2266 dataRefType);
2267 if (_err != noErr) return PyMac_Error(_err);
2268 _res = Py_BuildValue("h",
2269 index);
2270 return _res;
2271}
2272
2273static PyObject *MediaObj_GetMediaDataRefCount(_self, _args)
2274 MediaObject *_self;
2275 PyObject *_args;
2276{
2277 PyObject *_res = NULL;
2278 OSErr _err;
2279 short count;
2280 if (!PyArg_ParseTuple(_args, ""))
2281 return NULL;
2282 _err = GetMediaDataRefCount(_self->ob_itself,
2283 &count);
2284 if (_err != noErr) return PyMac_Error(_err);
2285 _res = Py_BuildValue("h",
2286 count);
2287 return _res;
2288}
2289
2290static PyObject *MediaObj_SetMediaPlayHints(_self, _args)
2291 MediaObject *_self;
2292 PyObject *_args;
2293{
2294 PyObject *_res = NULL;
2295 long flags;
2296 long flagsMask;
2297 if (!PyArg_ParseTuple(_args, "ll",
2298 &flags,
2299 &flagsMask))
2300 return NULL;
2301 SetMediaPlayHints(_self->ob_itself,
2302 flags,
2303 flagsMask);
2304 Py_INCREF(Py_None);
2305 _res = Py_None;
2306 return _res;
2307}
2308
2309static PyMethodDef MediaObj_methods[] = {
2310 {"LoadMediaIntoRam", (PyCFunction)MediaObj_LoadMediaIntoRam, 1,
2311 "(TimeValue time, TimeValue duration, long flags) -> None"},
2312 {"GetMediaTrack", (PyCFunction)MediaObj_GetMediaTrack, 1,
2313 "() -> (Track _rv)"},
Jack Jansene0cf87b1997-04-09 15:53:46 +00002314 {"GetMediaCreationTime", (PyCFunction)MediaObj_GetMediaCreationTime, 1,
2315 "() -> (unsigned long _rv)"},
2316 {"GetMediaModificationTime", (PyCFunction)MediaObj_GetMediaModificationTime, 1,
2317 "() -> (unsigned long _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00002318 {"GetMediaTimeScale", (PyCFunction)MediaObj_GetMediaTimeScale, 1,
2319 "() -> (TimeScale _rv)"},
2320 {"SetMediaTimeScale", (PyCFunction)MediaObj_SetMediaTimeScale, 1,
2321 "(TimeScale timeScale) -> None"},
2322 {"GetMediaDuration", (PyCFunction)MediaObj_GetMediaDuration, 1,
2323 "() -> (TimeValue _rv)"},
2324 {"GetMediaLanguage", (PyCFunction)MediaObj_GetMediaLanguage, 1,
2325 "() -> (short _rv)"},
2326 {"SetMediaLanguage", (PyCFunction)MediaObj_SetMediaLanguage, 1,
2327 "(short language) -> None"},
2328 {"GetMediaQuality", (PyCFunction)MediaObj_GetMediaQuality, 1,
2329 "() -> (short _rv)"},
2330 {"SetMediaQuality", (PyCFunction)MediaObj_SetMediaQuality, 1,
2331 "(short quality) -> None"},
2332 {"GetMediaHandlerDescription", (PyCFunction)MediaObj_GetMediaHandlerDescription, 1,
2333 "(Str255 creatorName) -> (OSType mediaType, OSType creatorManufacturer)"},
2334 {"GetMediaUserData", (PyCFunction)MediaObj_GetMediaUserData, 1,
2335 "() -> (UserData _rv)"},
2336 {"GetMediaHandler", (PyCFunction)MediaObj_GetMediaHandler, 1,
2337 "() -> (MediaHandler _rv)"},
2338 {"SetMediaHandler", (PyCFunction)MediaObj_SetMediaHandler, 1,
2339 "(MediaHandlerComponent mH) -> None"},
2340 {"BeginMediaEdits", (PyCFunction)MediaObj_BeginMediaEdits, 1,
2341 "() -> None"},
2342 {"EndMediaEdits", (PyCFunction)MediaObj_EndMediaEdits, 1,
2343 "() -> None"},
2344 {"SetMediaDefaultDataRefIndex", (PyCFunction)MediaObj_SetMediaDefaultDataRefIndex, 1,
2345 "(short index) -> None"},
2346 {"GetMediaDataHandlerDescription", (PyCFunction)MediaObj_GetMediaDataHandlerDescription, 1,
2347 "(short index, Str255 creatorName) -> (OSType dhType, OSType creatorManufacturer)"},
2348 {"GetMediaDataHandler", (PyCFunction)MediaObj_GetMediaDataHandler, 1,
2349 "(short index) -> (DataHandler _rv)"},
2350 {"SetMediaDataHandler", (PyCFunction)MediaObj_SetMediaDataHandler, 1,
2351 "(short index, DataHandlerComponent dataHandler) -> None"},
2352 {"GetMediaSampleDescriptionCount", (PyCFunction)MediaObj_GetMediaSampleDescriptionCount, 1,
2353 "() -> (long _rv)"},
2354 {"GetMediaSampleDescription", (PyCFunction)MediaObj_GetMediaSampleDescription, 1,
2355 "(long index, SampleDescriptionHandle descH) -> None"},
2356 {"SetMediaSampleDescription", (PyCFunction)MediaObj_SetMediaSampleDescription, 1,
2357 "(long index, SampleDescriptionHandle descH) -> None"},
2358 {"GetMediaSampleCount", (PyCFunction)MediaObj_GetMediaSampleCount, 1,
2359 "() -> (long _rv)"},
2360 {"SampleNumToMediaTime", (PyCFunction)MediaObj_SampleNumToMediaTime, 1,
2361 "(long logicalSampleNum) -> (TimeValue sampleTime, TimeValue sampleDuration)"},
2362 {"MediaTimeToSampleNum", (PyCFunction)MediaObj_MediaTimeToSampleNum, 1,
2363 "(TimeValue time) -> (long sampleNum, TimeValue sampleTime, TimeValue sampleDuration)"},
2364 {"AddMediaSample", (PyCFunction)MediaObj_AddMediaSample, 1,
2365 "(Handle dataIn, long inOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
2366 {"AddMediaSampleReference", (PyCFunction)MediaObj_AddMediaSampleReference, 1,
2367 "(long dataOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
2368 {"GetMediaSample", (PyCFunction)MediaObj_GetMediaSample, 1,
2369 "(Handle dataOut, long maxSizeToGrow, TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
2370 {"GetMediaSampleReference", (PyCFunction)MediaObj_GetMediaSampleReference, 1,
2371 "(TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long dataOffset, long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
2372 {"SetMediaPreferredChunkSize", (PyCFunction)MediaObj_SetMediaPreferredChunkSize, 1,
2373 "(long maxChunkSize) -> None"},
2374 {"GetMediaPreferredChunkSize", (PyCFunction)MediaObj_GetMediaPreferredChunkSize, 1,
2375 "() -> (long maxChunkSize)"},
2376 {"SetMediaShadowSync", (PyCFunction)MediaObj_SetMediaShadowSync, 1,
2377 "(long frameDiffSampleNum, long syncSampleNum) -> None"},
2378 {"GetMediaShadowSync", (PyCFunction)MediaObj_GetMediaShadowSync, 1,
2379 "(long frameDiffSampleNum) -> (long syncSampleNum)"},
2380 {"GetMediaDataSize", (PyCFunction)MediaObj_GetMediaDataSize, 1,
2381 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
2382 {"GetMediaNextInterestingTime", (PyCFunction)MediaObj_GetMediaNextInterestingTime, 1,
2383 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
2384 {"GetMediaDataRef", (PyCFunction)MediaObj_GetMediaDataRef, 1,
2385 "(short index) -> (Handle dataRef, OSType dataRefType, long dataRefAttributes)"},
2386 {"SetMediaDataRef", (PyCFunction)MediaObj_SetMediaDataRef, 1,
2387 "(short index, Handle dataRef, OSType dataRefType) -> None"},
2388 {"SetMediaDataRefAttributes", (PyCFunction)MediaObj_SetMediaDataRefAttributes, 1,
2389 "(short index, long dataRefAttributes) -> None"},
2390 {"AddMediaDataRef", (PyCFunction)MediaObj_AddMediaDataRef, 1,
2391 "(Handle dataRef, OSType dataRefType) -> (short index)"},
2392 {"GetMediaDataRefCount", (PyCFunction)MediaObj_GetMediaDataRefCount, 1,
2393 "() -> (short count)"},
2394 {"SetMediaPlayHints", (PyCFunction)MediaObj_SetMediaPlayHints, 1,
2395 "(long flags, long flagsMask) -> None"},
2396 {NULL, NULL, 0}
2397};
2398
2399PyMethodChain MediaObj_chain = { MediaObj_methods, NULL };
2400
2401static PyObject *MediaObj_getattr(self, name)
2402 MediaObject *self;
2403 char *name;
2404{
2405 return Py_FindMethodInChain(&MediaObj_chain, (PyObject *)self, name);
2406}
2407
2408#define MediaObj_setattr NULL
2409
2410PyTypeObject Media_Type = {
2411 PyObject_HEAD_INIT(&PyType_Type)
2412 0, /*ob_size*/
2413 "Media", /*tp_name*/
2414 sizeof(MediaObject), /*tp_basicsize*/
2415 0, /*tp_itemsize*/
2416 /* methods */
2417 (destructor) MediaObj_dealloc, /*tp_dealloc*/
2418 0, /*tp_print*/
2419 (getattrfunc) MediaObj_getattr, /*tp_getattr*/
2420 (setattrfunc) MediaObj_setattr, /*tp_setattr*/
2421};
2422
2423/* --------------------- End object type Media ---------------------- */
2424
2425
2426/* ----------------------- Object type Track ------------------------ */
2427
2428PyTypeObject Track_Type;
2429
2430#define TrackObj_Check(x) ((x)->ob_type == &Track_Type)
2431
2432typedef struct TrackObject {
2433 PyObject_HEAD
2434 Track ob_itself;
2435} TrackObject;
2436
2437PyObject *TrackObj_New(itself)
2438 Track itself;
2439{
2440 TrackObject *it;
2441 if (itself == NULL) {
2442 PyErr_SetString(Qt_Error,"Cannot create null Track");
2443 return NULL;
2444 }
2445 it = PyObject_NEW(TrackObject, &Track_Type);
2446 if (it == NULL) return NULL;
2447 it->ob_itself = itself;
2448 return (PyObject *)it;
2449}
2450TrackObj_Convert(v, p_itself)
2451 PyObject *v;
2452 Track *p_itself;
2453{
2454 if (!TrackObj_Check(v))
2455 {
2456 PyErr_SetString(PyExc_TypeError, "Track required");
2457 return 0;
2458 }
2459 *p_itself = ((TrackObject *)v)->ob_itself;
2460 return 1;
2461}
2462
2463static void TrackObj_dealloc(self)
2464 TrackObject *self;
2465{
2466 DisposeMovieTrack(self->ob_itself);
2467 PyMem_DEL(self);
2468}
2469
2470static PyObject *TrackObj_LoadTrackIntoRam(_self, _args)
2471 TrackObject *_self;
2472 PyObject *_args;
2473{
2474 PyObject *_res = NULL;
2475 OSErr _err;
2476 TimeValue time;
2477 TimeValue duration;
2478 long flags;
2479 if (!PyArg_ParseTuple(_args, "lll",
2480 &time,
2481 &duration,
2482 &flags))
2483 return NULL;
2484 _err = LoadTrackIntoRam(_self->ob_itself,
2485 time,
2486 duration,
2487 flags);
2488 if (_err != noErr) return PyMac_Error(_err);
2489 Py_INCREF(Py_None);
2490 _res = Py_None;
2491 return _res;
2492}
2493
2494static PyObject *TrackObj_GetTrackPict(_self, _args)
2495 TrackObject *_self;
2496 PyObject *_args;
2497{
2498 PyObject *_res = NULL;
2499 PicHandle _rv;
2500 TimeValue time;
2501 if (!PyArg_ParseTuple(_args, "l",
2502 &time))
2503 return NULL;
2504 _rv = GetTrackPict(_self->ob_itself,
2505 time);
2506 _res = Py_BuildValue("O&",
2507 ResObj_New, _rv);
2508 return _res;
2509}
2510
2511static PyObject *TrackObj_GetTrackClipRgn(_self, _args)
2512 TrackObject *_self;
2513 PyObject *_args;
2514{
2515 PyObject *_res = NULL;
2516 RgnHandle _rv;
2517 if (!PyArg_ParseTuple(_args, ""))
2518 return NULL;
2519 _rv = GetTrackClipRgn(_self->ob_itself);
2520 _res = Py_BuildValue("O&",
2521 ResObj_New, _rv);
2522 return _res;
2523}
2524
2525static PyObject *TrackObj_SetTrackClipRgn(_self, _args)
2526 TrackObject *_self;
2527 PyObject *_args;
2528{
2529 PyObject *_res = NULL;
2530 RgnHandle theClip;
2531 if (!PyArg_ParseTuple(_args, "O&",
2532 ResObj_Convert, &theClip))
2533 return NULL;
2534 SetTrackClipRgn(_self->ob_itself,
2535 theClip);
2536 Py_INCREF(Py_None);
2537 _res = Py_None;
2538 return _res;
2539}
2540
2541static PyObject *TrackObj_GetTrackDisplayBoundsRgn(_self, _args)
2542 TrackObject *_self;
2543 PyObject *_args;
2544{
2545 PyObject *_res = NULL;
2546 RgnHandle _rv;
2547 if (!PyArg_ParseTuple(_args, ""))
2548 return NULL;
2549 _rv = GetTrackDisplayBoundsRgn(_self->ob_itself);
2550 _res = Py_BuildValue("O&",
2551 ResObj_New, _rv);
2552 return _res;
2553}
2554
2555static PyObject *TrackObj_GetTrackMovieBoundsRgn(_self, _args)
2556 TrackObject *_self;
2557 PyObject *_args;
2558{
2559 PyObject *_res = NULL;
2560 RgnHandle _rv;
2561 if (!PyArg_ParseTuple(_args, ""))
2562 return NULL;
2563 _rv = GetTrackMovieBoundsRgn(_self->ob_itself);
2564 _res = Py_BuildValue("O&",
2565 ResObj_New, _rv);
2566 return _res;
2567}
2568
2569static PyObject *TrackObj_GetTrackBoundsRgn(_self, _args)
2570 TrackObject *_self;
2571 PyObject *_args;
2572{
2573 PyObject *_res = NULL;
2574 RgnHandle _rv;
2575 if (!PyArg_ParseTuple(_args, ""))
2576 return NULL;
2577 _rv = GetTrackBoundsRgn(_self->ob_itself);
2578 _res = Py_BuildValue("O&",
2579 ResObj_New, _rv);
2580 return _res;
2581}
2582
2583static PyObject *TrackObj_GetTrackMatte(_self, _args)
2584 TrackObject *_self;
2585 PyObject *_args;
2586{
2587 PyObject *_res = NULL;
2588 PixMapHandle _rv;
2589 if (!PyArg_ParseTuple(_args, ""))
2590 return NULL;
2591 _rv = GetTrackMatte(_self->ob_itself);
2592 _res = Py_BuildValue("O&",
2593 ResObj_New, _rv);
2594 return _res;
2595}
2596
2597static PyObject *TrackObj_SetTrackMatte(_self, _args)
2598 TrackObject *_self;
2599 PyObject *_args;
2600{
2601 PyObject *_res = NULL;
2602 PixMapHandle theMatte;
2603 if (!PyArg_ParseTuple(_args, "O&",
2604 ResObj_Convert, &theMatte))
2605 return NULL;
2606 SetTrackMatte(_self->ob_itself,
2607 theMatte);
2608 Py_INCREF(Py_None);
2609 _res = Py_None;
2610 return _res;
2611}
2612
2613static PyObject *TrackObj_GetTrackID(_self, _args)
2614 TrackObject *_self;
2615 PyObject *_args;
2616{
2617 PyObject *_res = NULL;
2618 long _rv;
2619 if (!PyArg_ParseTuple(_args, ""))
2620 return NULL;
2621 _rv = GetTrackID(_self->ob_itself);
2622 _res = Py_BuildValue("l",
2623 _rv);
2624 return _res;
2625}
2626
2627static PyObject *TrackObj_GetTrackMovie(_self, _args)
2628 TrackObject *_self;
2629 PyObject *_args;
2630{
2631 PyObject *_res = NULL;
2632 Movie _rv;
2633 if (!PyArg_ParseTuple(_args, ""))
2634 return NULL;
2635 _rv = GetTrackMovie(_self->ob_itself);
2636 _res = Py_BuildValue("O&",
2637 MovieObj_New, _rv);
2638 return _res;
2639}
2640
Jack Jansene0cf87b1997-04-09 15:53:46 +00002641static PyObject *TrackObj_GetTrackCreationTime(_self, _args)
2642 TrackObject *_self;
2643 PyObject *_args;
2644{
2645 PyObject *_res = NULL;
2646 unsigned long _rv;
2647 if (!PyArg_ParseTuple(_args, ""))
2648 return NULL;
2649 _rv = GetTrackCreationTime(_self->ob_itself);
2650 _res = Py_BuildValue("l",
2651 _rv);
2652 return _res;
2653}
2654
2655static PyObject *TrackObj_GetTrackModificationTime(_self, _args)
2656 TrackObject *_self;
2657 PyObject *_args;
2658{
2659 PyObject *_res = NULL;
2660 unsigned long _rv;
2661 if (!PyArg_ParseTuple(_args, ""))
2662 return NULL;
2663 _rv = GetTrackModificationTime(_self->ob_itself);
2664 _res = Py_BuildValue("l",
2665 _rv);
2666 return _res;
2667}
2668
Jack Jansen453ced51995-11-30 17:42:08 +00002669static PyObject *TrackObj_GetTrackEnabled(_self, _args)
2670 TrackObject *_self;
2671 PyObject *_args;
2672{
2673 PyObject *_res = NULL;
2674 Boolean _rv;
2675 if (!PyArg_ParseTuple(_args, ""))
2676 return NULL;
2677 _rv = GetTrackEnabled(_self->ob_itself);
2678 _res = Py_BuildValue("b",
2679 _rv);
2680 return _res;
2681}
2682
2683static PyObject *TrackObj_SetTrackEnabled(_self, _args)
2684 TrackObject *_self;
2685 PyObject *_args;
2686{
2687 PyObject *_res = NULL;
2688 Boolean isEnabled;
2689 if (!PyArg_ParseTuple(_args, "b",
2690 &isEnabled))
2691 return NULL;
2692 SetTrackEnabled(_self->ob_itself,
2693 isEnabled);
2694 Py_INCREF(Py_None);
2695 _res = Py_None;
2696 return _res;
2697}
2698
2699static PyObject *TrackObj_GetTrackUsage(_self, _args)
2700 TrackObject *_self;
2701 PyObject *_args;
2702{
2703 PyObject *_res = NULL;
2704 long _rv;
2705 if (!PyArg_ParseTuple(_args, ""))
2706 return NULL;
2707 _rv = GetTrackUsage(_self->ob_itself);
2708 _res = Py_BuildValue("l",
2709 _rv);
2710 return _res;
2711}
2712
2713static PyObject *TrackObj_SetTrackUsage(_self, _args)
2714 TrackObject *_self;
2715 PyObject *_args;
2716{
2717 PyObject *_res = NULL;
2718 long usage;
2719 if (!PyArg_ParseTuple(_args, "l",
2720 &usage))
2721 return NULL;
2722 SetTrackUsage(_self->ob_itself,
2723 usage);
2724 Py_INCREF(Py_None);
2725 _res = Py_None;
2726 return _res;
2727}
2728
2729static PyObject *TrackObj_GetTrackDuration(_self, _args)
2730 TrackObject *_self;
2731 PyObject *_args;
2732{
2733 PyObject *_res = NULL;
2734 TimeValue _rv;
2735 if (!PyArg_ParseTuple(_args, ""))
2736 return NULL;
2737 _rv = GetTrackDuration(_self->ob_itself);
2738 _res = Py_BuildValue("l",
2739 _rv);
2740 return _res;
2741}
2742
2743static PyObject *TrackObj_GetTrackOffset(_self, _args)
2744 TrackObject *_self;
2745 PyObject *_args;
2746{
2747 PyObject *_res = NULL;
2748 TimeValue _rv;
2749 if (!PyArg_ParseTuple(_args, ""))
2750 return NULL;
2751 _rv = GetTrackOffset(_self->ob_itself);
2752 _res = Py_BuildValue("l",
2753 _rv);
2754 return _res;
2755}
2756
2757static PyObject *TrackObj_SetTrackOffset(_self, _args)
2758 TrackObject *_self;
2759 PyObject *_args;
2760{
2761 PyObject *_res = NULL;
2762 TimeValue movieOffsetTime;
2763 if (!PyArg_ParseTuple(_args, "l",
2764 &movieOffsetTime))
2765 return NULL;
2766 SetTrackOffset(_self->ob_itself,
2767 movieOffsetTime);
2768 Py_INCREF(Py_None);
2769 _res = Py_None;
2770 return _res;
2771}
2772
2773static PyObject *TrackObj_GetTrackLayer(_self, _args)
2774 TrackObject *_self;
2775 PyObject *_args;
2776{
2777 PyObject *_res = NULL;
2778 short _rv;
2779 if (!PyArg_ParseTuple(_args, ""))
2780 return NULL;
2781 _rv = GetTrackLayer(_self->ob_itself);
2782 _res = Py_BuildValue("h",
2783 _rv);
2784 return _res;
2785}
2786
2787static PyObject *TrackObj_SetTrackLayer(_self, _args)
2788 TrackObject *_self;
2789 PyObject *_args;
2790{
2791 PyObject *_res = NULL;
2792 short layer;
2793 if (!PyArg_ParseTuple(_args, "h",
2794 &layer))
2795 return NULL;
2796 SetTrackLayer(_self->ob_itself,
2797 layer);
2798 Py_INCREF(Py_None);
2799 _res = Py_None;
2800 return _res;
2801}
2802
2803static PyObject *TrackObj_GetTrackAlternate(_self, _args)
2804 TrackObject *_self;
2805 PyObject *_args;
2806{
2807 PyObject *_res = NULL;
2808 Track _rv;
2809 if (!PyArg_ParseTuple(_args, ""))
2810 return NULL;
2811 _rv = GetTrackAlternate(_self->ob_itself);
2812 _res = Py_BuildValue("O&",
2813 TrackObj_New, _rv);
2814 return _res;
2815}
2816
2817static PyObject *TrackObj_SetTrackAlternate(_self, _args)
2818 TrackObject *_self;
2819 PyObject *_args;
2820{
2821 PyObject *_res = NULL;
2822 Track alternateT;
2823 if (!PyArg_ParseTuple(_args, "O&",
2824 TrackObj_Convert, &alternateT))
2825 return NULL;
2826 SetTrackAlternate(_self->ob_itself,
2827 alternateT);
2828 Py_INCREF(Py_None);
2829 _res = Py_None;
2830 return _res;
2831}
2832
2833static PyObject *TrackObj_GetTrackVolume(_self, _args)
2834 TrackObject *_self;
2835 PyObject *_args;
2836{
2837 PyObject *_res = NULL;
2838 short _rv;
2839 if (!PyArg_ParseTuple(_args, ""))
2840 return NULL;
2841 _rv = GetTrackVolume(_self->ob_itself);
2842 _res = Py_BuildValue("h",
2843 _rv);
2844 return _res;
2845}
2846
2847static PyObject *TrackObj_SetTrackVolume(_self, _args)
2848 TrackObject *_self;
2849 PyObject *_args;
2850{
2851 PyObject *_res = NULL;
2852 short volume;
2853 if (!PyArg_ParseTuple(_args, "h",
2854 &volume))
2855 return NULL;
2856 SetTrackVolume(_self->ob_itself,
2857 volume);
2858 Py_INCREF(Py_None);
2859 _res = Py_None;
2860 return _res;
2861}
2862
2863static PyObject *TrackObj_GetTrackDimensions(_self, _args)
2864 TrackObject *_self;
2865 PyObject *_args;
2866{
2867 PyObject *_res = NULL;
2868 Fixed width;
2869 Fixed height;
2870 if (!PyArg_ParseTuple(_args, ""))
2871 return NULL;
2872 GetTrackDimensions(_self->ob_itself,
2873 &width,
2874 &height);
2875 _res = Py_BuildValue("O&O&",
2876 PyMac_BuildFixed, width,
2877 PyMac_BuildFixed, height);
2878 return _res;
2879}
2880
2881static PyObject *TrackObj_SetTrackDimensions(_self, _args)
2882 TrackObject *_self;
2883 PyObject *_args;
2884{
2885 PyObject *_res = NULL;
2886 Fixed width;
2887 Fixed height;
2888 if (!PyArg_ParseTuple(_args, "O&O&",
2889 PyMac_GetFixed, &width,
2890 PyMac_GetFixed, &height))
2891 return NULL;
2892 SetTrackDimensions(_self->ob_itself,
2893 width,
2894 height);
2895 Py_INCREF(Py_None);
2896 _res = Py_None;
2897 return _res;
2898}
2899
2900static PyObject *TrackObj_GetTrackUserData(_self, _args)
2901 TrackObject *_self;
2902 PyObject *_args;
2903{
2904 PyObject *_res = NULL;
2905 UserData _rv;
2906 if (!PyArg_ParseTuple(_args, ""))
2907 return NULL;
2908 _rv = GetTrackUserData(_self->ob_itself);
2909 _res = Py_BuildValue("O&",
2910 UserDataObj_New, _rv);
2911 return _res;
2912}
2913
2914static PyObject *TrackObj_NewTrackMedia(_self, _args)
2915 TrackObject *_self;
2916 PyObject *_args;
2917{
2918 PyObject *_res = NULL;
2919 Media _rv;
2920 OSType mediaType;
2921 TimeScale timeScale;
2922 Handle dataRef;
2923 OSType dataRefType;
2924 if (!PyArg_ParseTuple(_args, "O&lO&O&",
2925 PyMac_GetOSType, &mediaType,
2926 &timeScale,
2927 ResObj_Convert, &dataRef,
2928 PyMac_GetOSType, &dataRefType))
2929 return NULL;
2930 _rv = NewTrackMedia(_self->ob_itself,
2931 mediaType,
2932 timeScale,
2933 dataRef,
2934 dataRefType);
2935 _res = Py_BuildValue("O&",
2936 MediaObj_New, _rv);
2937 return _res;
2938}
2939
2940static PyObject *TrackObj_GetTrackMedia(_self, _args)
2941 TrackObject *_self;
2942 PyObject *_args;
2943{
2944 PyObject *_res = NULL;
2945 Media _rv;
2946 if (!PyArg_ParseTuple(_args, ""))
2947 return NULL;
2948 _rv = GetTrackMedia(_self->ob_itself);
2949 _res = Py_BuildValue("O&",
2950 MediaObj_New, _rv);
2951 return _res;
2952}
2953
2954static PyObject *TrackObj_InsertMediaIntoTrack(_self, _args)
2955 TrackObject *_self;
2956 PyObject *_args;
2957{
2958 PyObject *_res = NULL;
2959 OSErr _err;
2960 TimeValue trackStart;
2961 TimeValue mediaTime;
2962 TimeValue mediaDuration;
2963 Fixed mediaRate;
2964 if (!PyArg_ParseTuple(_args, "lllO&",
2965 &trackStart,
2966 &mediaTime,
2967 &mediaDuration,
2968 PyMac_GetFixed, &mediaRate))
2969 return NULL;
2970 _err = InsertMediaIntoTrack(_self->ob_itself,
2971 trackStart,
2972 mediaTime,
2973 mediaDuration,
2974 mediaRate);
2975 if (_err != noErr) return PyMac_Error(_err);
2976 Py_INCREF(Py_None);
2977 _res = Py_None;
2978 return _res;
2979}
2980
2981static PyObject *TrackObj_InsertTrackSegment(_self, _args)
2982 TrackObject *_self;
2983 PyObject *_args;
2984{
2985 PyObject *_res = NULL;
2986 OSErr _err;
2987 Track dstTrack;
2988 TimeValue srcIn;
2989 TimeValue srcDuration;
2990 TimeValue dstIn;
2991 if (!PyArg_ParseTuple(_args, "O&lll",
2992 TrackObj_Convert, &dstTrack,
2993 &srcIn,
2994 &srcDuration,
2995 &dstIn))
2996 return NULL;
2997 _err = InsertTrackSegment(_self->ob_itself,
2998 dstTrack,
2999 srcIn,
3000 srcDuration,
3001 dstIn);
3002 if (_err != noErr) return PyMac_Error(_err);
3003 Py_INCREF(Py_None);
3004 _res = Py_None;
3005 return _res;
3006}
3007
3008static PyObject *TrackObj_InsertEmptyTrackSegment(_self, _args)
3009 TrackObject *_self;
3010 PyObject *_args;
3011{
3012 PyObject *_res = NULL;
3013 OSErr _err;
3014 TimeValue dstIn;
3015 TimeValue dstDuration;
3016 if (!PyArg_ParseTuple(_args, "ll",
3017 &dstIn,
3018 &dstDuration))
3019 return NULL;
3020 _err = InsertEmptyTrackSegment(_self->ob_itself,
3021 dstIn,
3022 dstDuration);
3023 if (_err != noErr) return PyMac_Error(_err);
3024 Py_INCREF(Py_None);
3025 _res = Py_None;
3026 return _res;
3027}
3028
3029static PyObject *TrackObj_DeleteTrackSegment(_self, _args)
3030 TrackObject *_self;
3031 PyObject *_args;
3032{
3033 PyObject *_res = NULL;
3034 OSErr _err;
3035 TimeValue startTime;
3036 TimeValue duration;
3037 if (!PyArg_ParseTuple(_args, "ll",
3038 &startTime,
3039 &duration))
3040 return NULL;
3041 _err = DeleteTrackSegment(_self->ob_itself,
3042 startTime,
3043 duration);
3044 if (_err != noErr) return PyMac_Error(_err);
3045 Py_INCREF(Py_None);
3046 _res = Py_None;
3047 return _res;
3048}
3049
3050static PyObject *TrackObj_ScaleTrackSegment(_self, _args)
3051 TrackObject *_self;
3052 PyObject *_args;
3053{
3054 PyObject *_res = NULL;
3055 OSErr _err;
3056 TimeValue startTime;
3057 TimeValue oldDuration;
3058 TimeValue newDuration;
3059 if (!PyArg_ParseTuple(_args, "lll",
3060 &startTime,
3061 &oldDuration,
3062 &newDuration))
3063 return NULL;
3064 _err = ScaleTrackSegment(_self->ob_itself,
3065 startTime,
3066 oldDuration,
3067 newDuration);
3068 if (_err != noErr) return PyMac_Error(_err);
3069 Py_INCREF(Py_None);
3070 _res = Py_None;
3071 return _res;
3072}
3073
3074static PyObject *TrackObj_IsScrapMovie(_self, _args)
3075 TrackObject *_self;
3076 PyObject *_args;
3077{
3078 PyObject *_res = NULL;
3079 Component _rv;
3080 if (!PyArg_ParseTuple(_args, ""))
3081 return NULL;
3082 _rv = IsScrapMovie(_self->ob_itself);
3083 _res = Py_BuildValue("O&",
3084 CmpObj_New, _rv);
3085 return _res;
3086}
3087
3088static PyObject *TrackObj_CopyTrackSettings(_self, _args)
3089 TrackObject *_self;
3090 PyObject *_args;
3091{
3092 PyObject *_res = NULL;
3093 OSErr _err;
3094 Track dstTrack;
3095 if (!PyArg_ParseTuple(_args, "O&",
3096 TrackObj_Convert, &dstTrack))
3097 return NULL;
3098 _err = CopyTrackSettings(_self->ob_itself,
3099 dstTrack);
3100 if (_err != noErr) return PyMac_Error(_err);
3101 Py_INCREF(Py_None);
3102 _res = Py_None;
3103 return _res;
3104}
3105
3106static PyObject *TrackObj_AddEmptyTrackToMovie(_self, _args)
3107 TrackObject *_self;
3108 PyObject *_args;
3109{
3110 PyObject *_res = NULL;
3111 OSErr _err;
3112 Movie dstMovie;
3113 Handle dataRef;
3114 OSType dataRefType;
3115 Track dstTrack;
3116 if (!PyArg_ParseTuple(_args, "O&O&O&",
3117 MovieObj_Convert, &dstMovie,
3118 ResObj_Convert, &dataRef,
3119 PyMac_GetOSType, &dataRefType))
3120 return NULL;
3121 _err = AddEmptyTrackToMovie(_self->ob_itself,
3122 dstMovie,
3123 dataRef,
3124 dataRefType,
3125 &dstTrack);
3126 if (_err != noErr) return PyMac_Error(_err);
3127 _res = Py_BuildValue("O&",
3128 TrackObj_New, dstTrack);
3129 return _res;
3130}
3131
3132static PyObject *TrackObj_AddTrackReference(_self, _args)
3133 TrackObject *_self;
3134 PyObject *_args;
3135{
3136 PyObject *_res = NULL;
3137 OSErr _err;
3138 Track refTrack;
3139 OSType refType;
3140 long addedIndex;
3141 if (!PyArg_ParseTuple(_args, "O&O&",
3142 TrackObj_Convert, &refTrack,
3143 PyMac_GetOSType, &refType))
3144 return NULL;
3145 _err = AddTrackReference(_self->ob_itself,
3146 refTrack,
3147 refType,
3148 &addedIndex);
3149 if (_err != noErr) return PyMac_Error(_err);
3150 _res = Py_BuildValue("l",
3151 addedIndex);
3152 return _res;
3153}
3154
3155static PyObject *TrackObj_DeleteTrackReference(_self, _args)
3156 TrackObject *_self;
3157 PyObject *_args;
3158{
3159 PyObject *_res = NULL;
3160 OSErr _err;
3161 OSType refType;
3162 long index;
3163 if (!PyArg_ParseTuple(_args, "O&l",
3164 PyMac_GetOSType, &refType,
3165 &index))
3166 return NULL;
3167 _err = DeleteTrackReference(_self->ob_itself,
3168 refType,
3169 index);
3170 if (_err != noErr) return PyMac_Error(_err);
3171 Py_INCREF(Py_None);
3172 _res = Py_None;
3173 return _res;
3174}
3175
3176static PyObject *TrackObj_SetTrackReference(_self, _args)
3177 TrackObject *_self;
3178 PyObject *_args;
3179{
3180 PyObject *_res = NULL;
3181 OSErr _err;
3182 Track refTrack;
3183 OSType refType;
3184 long index;
3185 if (!PyArg_ParseTuple(_args, "O&O&l",
3186 TrackObj_Convert, &refTrack,
3187 PyMac_GetOSType, &refType,
3188 &index))
3189 return NULL;
3190 _err = SetTrackReference(_self->ob_itself,
3191 refTrack,
3192 refType,
3193 index);
3194 if (_err != noErr) return PyMac_Error(_err);
3195 Py_INCREF(Py_None);
3196 _res = Py_None;
3197 return _res;
3198}
3199
3200static PyObject *TrackObj_GetTrackReference(_self, _args)
3201 TrackObject *_self;
3202 PyObject *_args;
3203{
3204 PyObject *_res = NULL;
3205 Track _rv;
3206 OSType refType;
3207 long index;
3208 if (!PyArg_ParseTuple(_args, "O&l",
3209 PyMac_GetOSType, &refType,
3210 &index))
3211 return NULL;
3212 _rv = GetTrackReference(_self->ob_itself,
3213 refType,
3214 index);
3215 _res = Py_BuildValue("O&",
3216 TrackObj_New, _rv);
3217 return _res;
3218}
3219
3220static PyObject *TrackObj_GetNextTrackReferenceType(_self, _args)
3221 TrackObject *_self;
3222 PyObject *_args;
3223{
3224 PyObject *_res = NULL;
3225 OSType _rv;
3226 OSType refType;
3227 if (!PyArg_ParseTuple(_args, "O&",
3228 PyMac_GetOSType, &refType))
3229 return NULL;
3230 _rv = GetNextTrackReferenceType(_self->ob_itself,
3231 refType);
3232 _res = Py_BuildValue("O&",
3233 PyMac_BuildOSType, _rv);
3234 return _res;
3235}
3236
3237static PyObject *TrackObj_GetTrackReferenceCount(_self, _args)
3238 TrackObject *_self;
3239 PyObject *_args;
3240{
3241 PyObject *_res = NULL;
3242 long _rv;
3243 OSType refType;
3244 if (!PyArg_ParseTuple(_args, "O&",
3245 PyMac_GetOSType, &refType))
3246 return NULL;
3247 _rv = GetTrackReferenceCount(_self->ob_itself,
3248 refType);
3249 _res = Py_BuildValue("l",
3250 _rv);
3251 return _res;
3252}
3253
3254static PyObject *TrackObj_GetTrackEditRate(_self, _args)
3255 TrackObject *_self;
3256 PyObject *_args;
3257{
3258 PyObject *_res = NULL;
3259 Fixed _rv;
3260 TimeValue atTime;
3261 if (!PyArg_ParseTuple(_args, "l",
3262 &atTime))
3263 return NULL;
3264 _rv = GetTrackEditRate(_self->ob_itself,
3265 atTime);
3266 _res = Py_BuildValue("O&",
3267 PyMac_BuildFixed, _rv);
3268 return _res;
3269}
3270
3271static PyObject *TrackObj_GetTrackDataSize(_self, _args)
3272 TrackObject *_self;
3273 PyObject *_args;
3274{
3275 PyObject *_res = NULL;
3276 long _rv;
3277 TimeValue startTime;
3278 TimeValue duration;
3279 if (!PyArg_ParseTuple(_args, "ll",
3280 &startTime,
3281 &duration))
3282 return NULL;
3283 _rv = GetTrackDataSize(_self->ob_itself,
3284 startTime,
3285 duration);
3286 _res = Py_BuildValue("l",
3287 _rv);
3288 return _res;
3289}
3290
3291static PyObject *TrackObj_PtInTrack(_self, _args)
3292 TrackObject *_self;
3293 PyObject *_args;
3294{
3295 PyObject *_res = NULL;
3296 Boolean _rv;
3297 Point pt;
3298 if (!PyArg_ParseTuple(_args, "O&",
3299 PyMac_GetPoint, &pt))
3300 return NULL;
3301 _rv = PtInTrack(_self->ob_itself,
3302 pt);
3303 _res = Py_BuildValue("b",
3304 _rv);
3305 return _res;
3306}
3307
3308static PyObject *TrackObj_GetTrackNextInterestingTime(_self, _args)
3309 TrackObject *_self;
3310 PyObject *_args;
3311{
3312 PyObject *_res = NULL;
3313 short interestingTimeFlags;
3314 TimeValue time;
3315 Fixed rate;
3316 TimeValue interestingTime;
3317 TimeValue interestingDuration;
3318 if (!PyArg_ParseTuple(_args, "hlO&",
3319 &interestingTimeFlags,
3320 &time,
3321 PyMac_GetFixed, &rate))
3322 return NULL;
3323 GetTrackNextInterestingTime(_self->ob_itself,
3324 interestingTimeFlags,
3325 time,
3326 rate,
3327 &interestingTime,
3328 &interestingDuration);
3329 _res = Py_BuildValue("ll",
3330 interestingTime,
3331 interestingDuration);
3332 return _res;
3333}
3334
3335static PyObject *TrackObj_GetTrackSegmentDisplayBoundsRgn(_self, _args)
3336 TrackObject *_self;
3337 PyObject *_args;
3338{
3339 PyObject *_res = NULL;
3340 RgnHandle _rv;
3341 TimeValue time;
3342 TimeValue duration;
3343 if (!PyArg_ParseTuple(_args, "ll",
3344 &time,
3345 &duration))
3346 return NULL;
3347 _rv = GetTrackSegmentDisplayBoundsRgn(_self->ob_itself,
3348 time,
3349 duration);
3350 _res = Py_BuildValue("O&",
3351 ResObj_New, _rv);
3352 return _res;
3353}
3354
3355static PyObject *TrackObj_GetTrackStatus(_self, _args)
3356 TrackObject *_self;
3357 PyObject *_args;
3358{
3359 PyObject *_res = NULL;
3360 ComponentResult _rv;
3361 if (!PyArg_ParseTuple(_args, ""))
3362 return NULL;
3363 _rv = GetTrackStatus(_self->ob_itself);
3364 _res = Py_BuildValue("l",
3365 _rv);
3366 return _res;
3367}
3368
3369static PyObject *TrackObj_SetTrackLoadSettings(_self, _args)
3370 TrackObject *_self;
3371 PyObject *_args;
3372{
3373 PyObject *_res = NULL;
3374 TimeValue preloadTime;
3375 TimeValue preloadDuration;
3376 long preloadFlags;
3377 long defaultHints;
3378 if (!PyArg_ParseTuple(_args, "llll",
3379 &preloadTime,
3380 &preloadDuration,
3381 &preloadFlags,
3382 &defaultHints))
3383 return NULL;
3384 SetTrackLoadSettings(_self->ob_itself,
3385 preloadTime,
3386 preloadDuration,
3387 preloadFlags,
3388 defaultHints);
3389 Py_INCREF(Py_None);
3390 _res = Py_None;
3391 return _res;
3392}
3393
3394static PyObject *TrackObj_GetTrackLoadSettings(_self, _args)
3395 TrackObject *_self;
3396 PyObject *_args;
3397{
3398 PyObject *_res = NULL;
3399 TimeValue preloadTime;
3400 TimeValue preloadDuration;
3401 long preloadFlags;
3402 long defaultHints;
3403 if (!PyArg_ParseTuple(_args, ""))
3404 return NULL;
3405 GetTrackLoadSettings(_self->ob_itself,
3406 &preloadTime,
3407 &preloadDuration,
3408 &preloadFlags,
3409 &defaultHints);
3410 _res = Py_BuildValue("llll",
3411 preloadTime,
3412 preloadDuration,
3413 preloadFlags,
3414 defaultHints);
3415 return _res;
3416}
3417
3418static PyMethodDef TrackObj_methods[] = {
3419 {"LoadTrackIntoRam", (PyCFunction)TrackObj_LoadTrackIntoRam, 1,
3420 "(TimeValue time, TimeValue duration, long flags) -> None"},
3421 {"GetTrackPict", (PyCFunction)TrackObj_GetTrackPict, 1,
3422 "(TimeValue time) -> (PicHandle _rv)"},
3423 {"GetTrackClipRgn", (PyCFunction)TrackObj_GetTrackClipRgn, 1,
3424 "() -> (RgnHandle _rv)"},
3425 {"SetTrackClipRgn", (PyCFunction)TrackObj_SetTrackClipRgn, 1,
3426 "(RgnHandle theClip) -> None"},
3427 {"GetTrackDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackDisplayBoundsRgn, 1,
3428 "() -> (RgnHandle _rv)"},
3429 {"GetTrackMovieBoundsRgn", (PyCFunction)TrackObj_GetTrackMovieBoundsRgn, 1,
3430 "() -> (RgnHandle _rv)"},
3431 {"GetTrackBoundsRgn", (PyCFunction)TrackObj_GetTrackBoundsRgn, 1,
3432 "() -> (RgnHandle _rv)"},
3433 {"GetTrackMatte", (PyCFunction)TrackObj_GetTrackMatte, 1,
3434 "() -> (PixMapHandle _rv)"},
3435 {"SetTrackMatte", (PyCFunction)TrackObj_SetTrackMatte, 1,
3436 "(PixMapHandle theMatte) -> None"},
3437 {"GetTrackID", (PyCFunction)TrackObj_GetTrackID, 1,
3438 "() -> (long _rv)"},
3439 {"GetTrackMovie", (PyCFunction)TrackObj_GetTrackMovie, 1,
3440 "() -> (Movie _rv)"},
Jack Jansene0cf87b1997-04-09 15:53:46 +00003441 {"GetTrackCreationTime", (PyCFunction)TrackObj_GetTrackCreationTime, 1,
3442 "() -> (unsigned long _rv)"},
3443 {"GetTrackModificationTime", (PyCFunction)TrackObj_GetTrackModificationTime, 1,
3444 "() -> (unsigned long _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00003445 {"GetTrackEnabled", (PyCFunction)TrackObj_GetTrackEnabled, 1,
3446 "() -> (Boolean _rv)"},
3447 {"SetTrackEnabled", (PyCFunction)TrackObj_SetTrackEnabled, 1,
3448 "(Boolean isEnabled) -> None"},
3449 {"GetTrackUsage", (PyCFunction)TrackObj_GetTrackUsage, 1,
3450 "() -> (long _rv)"},
3451 {"SetTrackUsage", (PyCFunction)TrackObj_SetTrackUsage, 1,
3452 "(long usage) -> None"},
3453 {"GetTrackDuration", (PyCFunction)TrackObj_GetTrackDuration, 1,
3454 "() -> (TimeValue _rv)"},
3455 {"GetTrackOffset", (PyCFunction)TrackObj_GetTrackOffset, 1,
3456 "() -> (TimeValue _rv)"},
3457 {"SetTrackOffset", (PyCFunction)TrackObj_SetTrackOffset, 1,
3458 "(TimeValue movieOffsetTime) -> None"},
3459 {"GetTrackLayer", (PyCFunction)TrackObj_GetTrackLayer, 1,
3460 "() -> (short _rv)"},
3461 {"SetTrackLayer", (PyCFunction)TrackObj_SetTrackLayer, 1,
3462 "(short layer) -> None"},
3463 {"GetTrackAlternate", (PyCFunction)TrackObj_GetTrackAlternate, 1,
3464 "() -> (Track _rv)"},
3465 {"SetTrackAlternate", (PyCFunction)TrackObj_SetTrackAlternate, 1,
3466 "(Track alternateT) -> None"},
3467 {"GetTrackVolume", (PyCFunction)TrackObj_GetTrackVolume, 1,
3468 "() -> (short _rv)"},
3469 {"SetTrackVolume", (PyCFunction)TrackObj_SetTrackVolume, 1,
3470 "(short volume) -> None"},
3471 {"GetTrackDimensions", (PyCFunction)TrackObj_GetTrackDimensions, 1,
3472 "() -> (Fixed width, Fixed height)"},
3473 {"SetTrackDimensions", (PyCFunction)TrackObj_SetTrackDimensions, 1,
3474 "(Fixed width, Fixed height) -> None"},
3475 {"GetTrackUserData", (PyCFunction)TrackObj_GetTrackUserData, 1,
3476 "() -> (UserData _rv)"},
3477 {"NewTrackMedia", (PyCFunction)TrackObj_NewTrackMedia, 1,
3478 "(OSType mediaType, TimeScale timeScale, Handle dataRef, OSType dataRefType) -> (Media _rv)"},
3479 {"GetTrackMedia", (PyCFunction)TrackObj_GetTrackMedia, 1,
3480 "() -> (Media _rv)"},
3481 {"InsertMediaIntoTrack", (PyCFunction)TrackObj_InsertMediaIntoTrack, 1,
3482 "(TimeValue trackStart, TimeValue mediaTime, TimeValue mediaDuration, Fixed mediaRate) -> None"},
3483 {"InsertTrackSegment", (PyCFunction)TrackObj_InsertTrackSegment, 1,
3484 "(Track dstTrack, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
3485 {"InsertEmptyTrackSegment", (PyCFunction)TrackObj_InsertEmptyTrackSegment, 1,
3486 "(TimeValue dstIn, TimeValue dstDuration) -> None"},
3487 {"DeleteTrackSegment", (PyCFunction)TrackObj_DeleteTrackSegment, 1,
3488 "(TimeValue startTime, TimeValue duration) -> None"},
3489 {"ScaleTrackSegment", (PyCFunction)TrackObj_ScaleTrackSegment, 1,
3490 "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
3491 {"IsScrapMovie", (PyCFunction)TrackObj_IsScrapMovie, 1,
3492 "() -> (Component _rv)"},
3493 {"CopyTrackSettings", (PyCFunction)TrackObj_CopyTrackSettings, 1,
3494 "(Track dstTrack) -> None"},
3495 {"AddEmptyTrackToMovie", (PyCFunction)TrackObj_AddEmptyTrackToMovie, 1,
3496 "(Movie dstMovie, Handle dataRef, OSType dataRefType) -> (Track dstTrack)"},
3497 {"AddTrackReference", (PyCFunction)TrackObj_AddTrackReference, 1,
3498 "(Track refTrack, OSType refType) -> (long addedIndex)"},
3499 {"DeleteTrackReference", (PyCFunction)TrackObj_DeleteTrackReference, 1,
3500 "(OSType refType, long index) -> None"},
3501 {"SetTrackReference", (PyCFunction)TrackObj_SetTrackReference, 1,
3502 "(Track refTrack, OSType refType, long index) -> None"},
3503 {"GetTrackReference", (PyCFunction)TrackObj_GetTrackReference, 1,
3504 "(OSType refType, long index) -> (Track _rv)"},
3505 {"GetNextTrackReferenceType", (PyCFunction)TrackObj_GetNextTrackReferenceType, 1,
3506 "(OSType refType) -> (OSType _rv)"},
3507 {"GetTrackReferenceCount", (PyCFunction)TrackObj_GetTrackReferenceCount, 1,
3508 "(OSType refType) -> (long _rv)"},
3509 {"GetTrackEditRate", (PyCFunction)TrackObj_GetTrackEditRate, 1,
3510 "(TimeValue atTime) -> (Fixed _rv)"},
3511 {"GetTrackDataSize", (PyCFunction)TrackObj_GetTrackDataSize, 1,
3512 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
3513 {"PtInTrack", (PyCFunction)TrackObj_PtInTrack, 1,
3514 "(Point pt) -> (Boolean _rv)"},
3515 {"GetTrackNextInterestingTime", (PyCFunction)TrackObj_GetTrackNextInterestingTime, 1,
3516 "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
3517 {"GetTrackSegmentDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackSegmentDisplayBoundsRgn, 1,
3518 "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
3519 {"GetTrackStatus", (PyCFunction)TrackObj_GetTrackStatus, 1,
3520 "() -> (ComponentResult _rv)"},
3521 {"SetTrackLoadSettings", (PyCFunction)TrackObj_SetTrackLoadSettings, 1,
3522 "(TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints) -> None"},
3523 {"GetTrackLoadSettings", (PyCFunction)TrackObj_GetTrackLoadSettings, 1,
3524 "() -> (TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints)"},
3525 {NULL, NULL, 0}
3526};
3527
3528PyMethodChain TrackObj_chain = { TrackObj_methods, NULL };
3529
3530static PyObject *TrackObj_getattr(self, name)
3531 TrackObject *self;
3532 char *name;
3533{
3534 return Py_FindMethodInChain(&TrackObj_chain, (PyObject *)self, name);
3535}
3536
3537#define TrackObj_setattr NULL
3538
3539PyTypeObject Track_Type = {
3540 PyObject_HEAD_INIT(&PyType_Type)
3541 0, /*ob_size*/
3542 "Track", /*tp_name*/
3543 sizeof(TrackObject), /*tp_basicsize*/
3544 0, /*tp_itemsize*/
3545 /* methods */
3546 (destructor) TrackObj_dealloc, /*tp_dealloc*/
3547 0, /*tp_print*/
3548 (getattrfunc) TrackObj_getattr, /*tp_getattr*/
3549 (setattrfunc) TrackObj_setattr, /*tp_setattr*/
3550};
3551
3552/* --------------------- End object type Track ---------------------- */
3553
3554
3555/* ----------------------- Object type Movie ------------------------ */
3556
3557PyTypeObject Movie_Type;
3558
3559#define MovieObj_Check(x) ((x)->ob_type == &Movie_Type)
3560
3561typedef struct MovieObject {
3562 PyObject_HEAD
3563 Movie ob_itself;
3564} MovieObject;
3565
3566PyObject *MovieObj_New(itself)
3567 Movie itself;
3568{
3569 MovieObject *it;
3570 if (itself == NULL) {
3571 PyErr_SetString(Qt_Error,"Cannot create null Movie");
3572 return NULL;
3573 }
3574 it = PyObject_NEW(MovieObject, &Movie_Type);
3575 if (it == NULL) return NULL;
3576 it->ob_itself = itself;
3577 return (PyObject *)it;
3578}
3579MovieObj_Convert(v, p_itself)
3580 PyObject *v;
3581 Movie *p_itself;
3582{
3583 if (!MovieObj_Check(v))
3584 {
3585 PyErr_SetString(PyExc_TypeError, "Movie required");
3586 return 0;
3587 }
3588 *p_itself = ((MovieObject *)v)->ob_itself;
3589 return 1;
3590}
3591
3592static void MovieObj_dealloc(self)
3593 MovieObject *self;
3594{
3595 DisposeMovie(self->ob_itself);
3596 PyMem_DEL(self);
3597}
3598
3599static PyObject *MovieObj_MoviesTask(_self, _args)
3600 MovieObject *_self;
3601 PyObject *_args;
3602{
3603 PyObject *_res = NULL;
3604 long maxMilliSecToUse;
3605 if (!PyArg_ParseTuple(_args, "l",
3606 &maxMilliSecToUse))
3607 return NULL;
3608 MoviesTask(_self->ob_itself,
3609 maxMilliSecToUse);
3610 Py_INCREF(Py_None);
3611 _res = Py_None;
3612 return _res;
3613}
3614
3615static PyObject *MovieObj_PrerollMovie(_self, _args)
3616 MovieObject *_self;
3617 PyObject *_args;
3618{
3619 PyObject *_res = NULL;
3620 OSErr _err;
3621 TimeValue time;
3622 Fixed Rate;
3623 if (!PyArg_ParseTuple(_args, "lO&",
3624 &time,
3625 PyMac_GetFixed, &Rate))
3626 return NULL;
3627 _err = PrerollMovie(_self->ob_itself,
3628 time,
3629 Rate);
3630 if (_err != noErr) return PyMac_Error(_err);
3631 Py_INCREF(Py_None);
3632 _res = Py_None;
3633 return _res;
3634}
3635
3636static PyObject *MovieObj_LoadMovieIntoRam(_self, _args)
3637 MovieObject *_self;
3638 PyObject *_args;
3639{
3640 PyObject *_res = NULL;
3641 OSErr _err;
3642 TimeValue time;
3643 TimeValue duration;
3644 long flags;
3645 if (!PyArg_ParseTuple(_args, "lll",
3646 &time,
3647 &duration,
3648 &flags))
3649 return NULL;
3650 _err = LoadMovieIntoRam(_self->ob_itself,
3651 time,
3652 duration,
3653 flags);
3654 if (_err != noErr) return PyMac_Error(_err);
3655 Py_INCREF(Py_None);
3656 _res = Py_None;
3657 return _res;
3658}
3659
3660static PyObject *MovieObj_SetMovieActive(_self, _args)
3661 MovieObject *_self;
3662 PyObject *_args;
3663{
3664 PyObject *_res = NULL;
3665 Boolean active;
3666 if (!PyArg_ParseTuple(_args, "b",
3667 &active))
3668 return NULL;
3669 SetMovieActive(_self->ob_itself,
3670 active);
3671 Py_INCREF(Py_None);
3672 _res = Py_None;
3673 return _res;
3674}
3675
3676static PyObject *MovieObj_GetMovieActive(_self, _args)
3677 MovieObject *_self;
3678 PyObject *_args;
3679{
3680 PyObject *_res = NULL;
3681 Boolean _rv;
3682 if (!PyArg_ParseTuple(_args, ""))
3683 return NULL;
3684 _rv = GetMovieActive(_self->ob_itself);
3685 _res = Py_BuildValue("b",
3686 _rv);
3687 return _res;
3688}
3689
3690static PyObject *MovieObj_StartMovie(_self, _args)
3691 MovieObject *_self;
3692 PyObject *_args;
3693{
3694 PyObject *_res = NULL;
3695 if (!PyArg_ParseTuple(_args, ""))
3696 return NULL;
3697 StartMovie(_self->ob_itself);
3698 Py_INCREF(Py_None);
3699 _res = Py_None;
3700 return _res;
3701}
3702
3703static PyObject *MovieObj_StopMovie(_self, _args)
3704 MovieObject *_self;
3705 PyObject *_args;
3706{
3707 PyObject *_res = NULL;
3708 if (!PyArg_ParseTuple(_args, ""))
3709 return NULL;
3710 StopMovie(_self->ob_itself);
3711 Py_INCREF(Py_None);
3712 _res = Py_None;
3713 return _res;
3714}
3715
3716static PyObject *MovieObj_GoToBeginningOfMovie(_self, _args)
3717 MovieObject *_self;
3718 PyObject *_args;
3719{
3720 PyObject *_res = NULL;
3721 if (!PyArg_ParseTuple(_args, ""))
3722 return NULL;
3723 GoToBeginningOfMovie(_self->ob_itself);
3724 Py_INCREF(Py_None);
3725 _res = Py_None;
3726 return _res;
3727}
3728
3729static PyObject *MovieObj_GoToEndOfMovie(_self, _args)
3730 MovieObject *_self;
3731 PyObject *_args;
3732{
3733 PyObject *_res = NULL;
3734 if (!PyArg_ParseTuple(_args, ""))
3735 return NULL;
3736 GoToEndOfMovie(_self->ob_itself);
3737 Py_INCREF(Py_None);
3738 _res = Py_None;
3739 return _res;
3740}
3741
3742static PyObject *MovieObj_IsMovieDone(_self, _args)
3743 MovieObject *_self;
3744 PyObject *_args;
3745{
3746 PyObject *_res = NULL;
3747 Boolean _rv;
3748 if (!PyArg_ParseTuple(_args, ""))
3749 return NULL;
3750 _rv = IsMovieDone(_self->ob_itself);
3751 _res = Py_BuildValue("b",
3752 _rv);
3753 return _res;
3754}
3755
3756static PyObject *MovieObj_GetMoviePreviewMode(_self, _args)
3757 MovieObject *_self;
3758 PyObject *_args;
3759{
3760 PyObject *_res = NULL;
3761 Boolean _rv;
3762 if (!PyArg_ParseTuple(_args, ""))
3763 return NULL;
3764 _rv = GetMoviePreviewMode(_self->ob_itself);
3765 _res = Py_BuildValue("b",
3766 _rv);
3767 return _res;
3768}
3769
3770static PyObject *MovieObj_SetMoviePreviewMode(_self, _args)
3771 MovieObject *_self;
3772 PyObject *_args;
3773{
3774 PyObject *_res = NULL;
3775 Boolean usePreview;
3776 if (!PyArg_ParseTuple(_args, "b",
3777 &usePreview))
3778 return NULL;
3779 SetMoviePreviewMode(_self->ob_itself,
3780 usePreview);
3781 Py_INCREF(Py_None);
3782 _res = Py_None;
3783 return _res;
3784}
3785
3786static PyObject *MovieObj_ShowMoviePoster(_self, _args)
3787 MovieObject *_self;
3788 PyObject *_args;
3789{
3790 PyObject *_res = NULL;
3791 if (!PyArg_ParseTuple(_args, ""))
3792 return NULL;
3793 ShowMoviePoster(_self->ob_itself);
3794 Py_INCREF(Py_None);
3795 _res = Py_None;
3796 return _res;
3797}
3798
3799static PyObject *MovieObj_GetMovieTimeBase(_self, _args)
3800 MovieObject *_self;
3801 PyObject *_args;
3802{
3803 PyObject *_res = NULL;
3804 TimeBase _rv;
3805 if (!PyArg_ParseTuple(_args, ""))
3806 return NULL;
3807 _rv = GetMovieTimeBase(_self->ob_itself);
3808 _res = Py_BuildValue("O&",
3809 TimeBaseObj_New, _rv);
3810 return _res;
3811}
3812
Jack Jansene0cf87b1997-04-09 15:53:46 +00003813static PyObject *MovieObj_GetMovieGWorld(_self, _args)
3814 MovieObject *_self;
3815 PyObject *_args;
3816{
3817 PyObject *_res = NULL;
3818 CGrafPtr port;
3819 GDHandle gdh;
3820 if (!PyArg_ParseTuple(_args, ""))
3821 return NULL;
3822 GetMovieGWorld(_self->ob_itself,
3823 &port,
3824 &gdh);
3825 _res = Py_BuildValue("O&O&",
3826 GrafObj_New, port,
3827 ResObj_New, gdh);
3828 return _res;
3829}
3830
3831static PyObject *MovieObj_SetMovieGWorld(_self, _args)
3832 MovieObject *_self;
3833 PyObject *_args;
3834{
3835 PyObject *_res = NULL;
3836 CGrafPtr port;
3837 GDHandle gdh;
3838 if (!PyArg_ParseTuple(_args, "O&O&",
3839 GrafObj_Convert, &port,
3840 ResObj_Convert, &gdh))
3841 return NULL;
3842 SetMovieGWorld(_self->ob_itself,
3843 port,
3844 gdh);
3845 Py_INCREF(Py_None);
3846 _res = Py_None;
3847 return _res;
3848}
3849
Jack Jansen453ced51995-11-30 17:42:08 +00003850static PyObject *MovieObj_GetNextTrackForCompositing(_self, _args)
3851 MovieObject *_self;
3852 PyObject *_args;
3853{
3854 PyObject *_res = NULL;
3855 Track _rv;
3856 Track theTrack;
3857 if (!PyArg_ParseTuple(_args, "O&",
3858 TrackObj_Convert, &theTrack))
3859 return NULL;
3860 _rv = GetNextTrackForCompositing(_self->ob_itself,
3861 theTrack);
3862 _res = Py_BuildValue("O&",
3863 TrackObj_New, _rv);
3864 return _res;
3865}
3866
3867static PyObject *MovieObj_GetPrevTrackForCompositing(_self, _args)
3868 MovieObject *_self;
3869 PyObject *_args;
3870{
3871 PyObject *_res = NULL;
3872 Track _rv;
3873 Track theTrack;
3874 if (!PyArg_ParseTuple(_args, "O&",
3875 TrackObj_Convert, &theTrack))
3876 return NULL;
3877 _rv = GetPrevTrackForCompositing(_self->ob_itself,
3878 theTrack);
3879 _res = Py_BuildValue("O&",
3880 TrackObj_New, _rv);
3881 return _res;
3882}
3883
3884static PyObject *MovieObj_GetMoviePict(_self, _args)
3885 MovieObject *_self;
3886 PyObject *_args;
3887{
3888 PyObject *_res = NULL;
3889 PicHandle _rv;
3890 TimeValue time;
3891 if (!PyArg_ParseTuple(_args, "l",
3892 &time))
3893 return NULL;
3894 _rv = GetMoviePict(_self->ob_itself,
3895 time);
3896 _res = Py_BuildValue("O&",
3897 ResObj_New, _rv);
3898 return _res;
3899}
3900
3901static PyObject *MovieObj_GetMoviePosterPict(_self, _args)
3902 MovieObject *_self;
3903 PyObject *_args;
3904{
3905 PyObject *_res = NULL;
3906 PicHandle _rv;
3907 if (!PyArg_ParseTuple(_args, ""))
3908 return NULL;
3909 _rv = GetMoviePosterPict(_self->ob_itself);
3910 _res = Py_BuildValue("O&",
3911 ResObj_New, _rv);
3912 return _res;
3913}
3914
3915static PyObject *MovieObj_UpdateMovie(_self, _args)
3916 MovieObject *_self;
3917 PyObject *_args;
3918{
3919 PyObject *_res = NULL;
3920 OSErr _err;
3921 if (!PyArg_ParseTuple(_args, ""))
3922 return NULL;
3923 _err = UpdateMovie(_self->ob_itself);
3924 if (_err != noErr) return PyMac_Error(_err);
3925 Py_INCREF(Py_None);
3926 _res = Py_None;
3927 return _res;
3928}
3929
3930static PyObject *MovieObj_GetMovieBox(_self, _args)
3931 MovieObject *_self;
3932 PyObject *_args;
3933{
3934 PyObject *_res = NULL;
3935 Rect boxRect;
3936 if (!PyArg_ParseTuple(_args, ""))
3937 return NULL;
3938 GetMovieBox(_self->ob_itself,
3939 &boxRect);
3940 _res = Py_BuildValue("O&",
3941 PyMac_BuildRect, &boxRect);
3942 return _res;
3943}
3944
3945static PyObject *MovieObj_SetMovieBox(_self, _args)
3946 MovieObject *_self;
3947 PyObject *_args;
3948{
3949 PyObject *_res = NULL;
3950 Rect boxRect;
3951 if (!PyArg_ParseTuple(_args, "O&",
3952 PyMac_GetRect, &boxRect))
3953 return NULL;
3954 SetMovieBox(_self->ob_itself,
3955 &boxRect);
3956 Py_INCREF(Py_None);
3957 _res = Py_None;
3958 return _res;
3959}
3960
3961static PyObject *MovieObj_GetMovieDisplayClipRgn(_self, _args)
3962 MovieObject *_self;
3963 PyObject *_args;
3964{
3965 PyObject *_res = NULL;
3966 RgnHandle _rv;
3967 if (!PyArg_ParseTuple(_args, ""))
3968 return NULL;
3969 _rv = GetMovieDisplayClipRgn(_self->ob_itself);
3970 _res = Py_BuildValue("O&",
3971 ResObj_New, _rv);
3972 return _res;
3973}
3974
3975static PyObject *MovieObj_SetMovieDisplayClipRgn(_self, _args)
3976 MovieObject *_self;
3977 PyObject *_args;
3978{
3979 PyObject *_res = NULL;
3980 RgnHandle theClip;
3981 if (!PyArg_ParseTuple(_args, "O&",
3982 ResObj_Convert, &theClip))
3983 return NULL;
3984 SetMovieDisplayClipRgn(_self->ob_itself,
3985 theClip);
3986 Py_INCREF(Py_None);
3987 _res = Py_None;
3988 return _res;
3989}
3990
3991static PyObject *MovieObj_GetMovieClipRgn(_self, _args)
3992 MovieObject *_self;
3993 PyObject *_args;
3994{
3995 PyObject *_res = NULL;
3996 RgnHandle _rv;
3997 if (!PyArg_ParseTuple(_args, ""))
3998 return NULL;
3999 _rv = GetMovieClipRgn(_self->ob_itself);
4000 _res = Py_BuildValue("O&",
4001 ResObj_New, _rv);
4002 return _res;
4003}
4004
4005static PyObject *MovieObj_SetMovieClipRgn(_self, _args)
4006 MovieObject *_self;
4007 PyObject *_args;
4008{
4009 PyObject *_res = NULL;
4010 RgnHandle theClip;
4011 if (!PyArg_ParseTuple(_args, "O&",
4012 ResObj_Convert, &theClip))
4013 return NULL;
4014 SetMovieClipRgn(_self->ob_itself,
4015 theClip);
4016 Py_INCREF(Py_None);
4017 _res = Py_None;
4018 return _res;
4019}
4020
4021static PyObject *MovieObj_GetMovieDisplayBoundsRgn(_self, _args)
4022 MovieObject *_self;
4023 PyObject *_args;
4024{
4025 PyObject *_res = NULL;
4026 RgnHandle _rv;
4027 if (!PyArg_ParseTuple(_args, ""))
4028 return NULL;
4029 _rv = GetMovieDisplayBoundsRgn(_self->ob_itself);
4030 _res = Py_BuildValue("O&",
4031 ResObj_New, _rv);
4032 return _res;
4033}
4034
4035static PyObject *MovieObj_GetMovieBoundsRgn(_self, _args)
4036 MovieObject *_self;
4037 PyObject *_args;
4038{
4039 PyObject *_res = NULL;
4040 RgnHandle _rv;
4041 if (!PyArg_ParseTuple(_args, ""))
4042 return NULL;
4043 _rv = GetMovieBoundsRgn(_self->ob_itself);
4044 _res = Py_BuildValue("O&",
4045 ResObj_New, _rv);
4046 return _res;
4047}
4048
4049static PyObject *MovieObj_PutMovieIntoHandle(_self, _args)
4050 MovieObject *_self;
4051 PyObject *_args;
4052{
4053 PyObject *_res = NULL;
4054 OSErr _err;
4055 Handle publicMovie;
4056 if (!PyArg_ParseTuple(_args, "O&",
4057 ResObj_Convert, &publicMovie))
4058 return NULL;
4059 _err = PutMovieIntoHandle(_self->ob_itself,
4060 publicMovie);
4061 if (_err != noErr) return PyMac_Error(_err);
4062 Py_INCREF(Py_None);
4063 _res = Py_None;
4064 return _res;
4065}
4066
4067static PyObject *MovieObj_PutMovieIntoDataFork(_self, _args)
4068 MovieObject *_self;
4069 PyObject *_args;
4070{
4071 PyObject *_res = NULL;
4072 OSErr _err;
4073 short fRefNum;
4074 long offset;
4075 long maxSize;
4076 if (!PyArg_ParseTuple(_args, "hll",
4077 &fRefNum,
4078 &offset,
4079 &maxSize))
4080 return NULL;
4081 _err = PutMovieIntoDataFork(_self->ob_itself,
4082 fRefNum,
4083 offset,
4084 maxSize);
4085 if (_err != noErr) return PyMac_Error(_err);
4086 Py_INCREF(Py_None);
4087 _res = Py_None;
4088 return _res;
4089}
4090
Jack Jansene0cf87b1997-04-09 15:53:46 +00004091static PyObject *MovieObj_GetMovieCreationTime(_self, _args)
4092 MovieObject *_self;
4093 PyObject *_args;
4094{
4095 PyObject *_res = NULL;
4096 unsigned long _rv;
4097 if (!PyArg_ParseTuple(_args, ""))
4098 return NULL;
4099 _rv = GetMovieCreationTime(_self->ob_itself);
4100 _res = Py_BuildValue("l",
4101 _rv);
4102 return _res;
4103}
4104
4105static PyObject *MovieObj_GetMovieModificationTime(_self, _args)
4106 MovieObject *_self;
4107 PyObject *_args;
4108{
4109 PyObject *_res = NULL;
4110 unsigned long _rv;
4111 if (!PyArg_ParseTuple(_args, ""))
4112 return NULL;
4113 _rv = GetMovieModificationTime(_self->ob_itself);
4114 _res = Py_BuildValue("l",
4115 _rv);
4116 return _res;
4117}
4118
Jack Jansen453ced51995-11-30 17:42:08 +00004119static PyObject *MovieObj_GetMovieTimeScale(_self, _args)
4120 MovieObject *_self;
4121 PyObject *_args;
4122{
4123 PyObject *_res = NULL;
4124 TimeScale _rv;
4125 if (!PyArg_ParseTuple(_args, ""))
4126 return NULL;
4127 _rv = GetMovieTimeScale(_self->ob_itself);
4128 _res = Py_BuildValue("l",
4129 _rv);
4130 return _res;
4131}
4132
4133static PyObject *MovieObj_SetMovieTimeScale(_self, _args)
4134 MovieObject *_self;
4135 PyObject *_args;
4136{
4137 PyObject *_res = NULL;
4138 TimeScale timeScale;
4139 if (!PyArg_ParseTuple(_args, "l",
4140 &timeScale))
4141 return NULL;
4142 SetMovieTimeScale(_self->ob_itself,
4143 timeScale);
4144 Py_INCREF(Py_None);
4145 _res = Py_None;
4146 return _res;
4147}
4148
4149static PyObject *MovieObj_GetMovieDuration(_self, _args)
4150 MovieObject *_self;
4151 PyObject *_args;
4152{
4153 PyObject *_res = NULL;
4154 TimeValue _rv;
4155 if (!PyArg_ParseTuple(_args, ""))
4156 return NULL;
4157 _rv = GetMovieDuration(_self->ob_itself);
4158 _res = Py_BuildValue("l",
4159 _rv);
4160 return _res;
4161}
4162
4163static PyObject *MovieObj_GetMovieRate(_self, _args)
4164 MovieObject *_self;
4165 PyObject *_args;
4166{
4167 PyObject *_res = NULL;
4168 Fixed _rv;
4169 if (!PyArg_ParseTuple(_args, ""))
4170 return NULL;
4171 _rv = GetMovieRate(_self->ob_itself);
4172 _res = Py_BuildValue("O&",
4173 PyMac_BuildFixed, _rv);
4174 return _res;
4175}
4176
4177static PyObject *MovieObj_SetMovieRate(_self, _args)
4178 MovieObject *_self;
4179 PyObject *_args;
4180{
4181 PyObject *_res = NULL;
4182 Fixed rate;
4183 if (!PyArg_ParseTuple(_args, "O&",
4184 PyMac_GetFixed, &rate))
4185 return NULL;
4186 SetMovieRate(_self->ob_itself,
4187 rate);
4188 Py_INCREF(Py_None);
4189 _res = Py_None;
4190 return _res;
4191}
4192
4193static PyObject *MovieObj_GetMoviePreferredRate(_self, _args)
4194 MovieObject *_self;
4195 PyObject *_args;
4196{
4197 PyObject *_res = NULL;
4198 Fixed _rv;
4199 if (!PyArg_ParseTuple(_args, ""))
4200 return NULL;
4201 _rv = GetMoviePreferredRate(_self->ob_itself);
4202 _res = Py_BuildValue("O&",
4203 PyMac_BuildFixed, _rv);
4204 return _res;
4205}
4206
4207static PyObject *MovieObj_SetMoviePreferredRate(_self, _args)
4208 MovieObject *_self;
4209 PyObject *_args;
4210{
4211 PyObject *_res = NULL;
4212 Fixed rate;
4213 if (!PyArg_ParseTuple(_args, "O&",
4214 PyMac_GetFixed, &rate))
4215 return NULL;
4216 SetMoviePreferredRate(_self->ob_itself,
4217 rate);
4218 Py_INCREF(Py_None);
4219 _res = Py_None;
4220 return _res;
4221}
4222
4223static PyObject *MovieObj_GetMoviePreferredVolume(_self, _args)
4224 MovieObject *_self;
4225 PyObject *_args;
4226{
4227 PyObject *_res = NULL;
4228 short _rv;
4229 if (!PyArg_ParseTuple(_args, ""))
4230 return NULL;
4231 _rv = GetMoviePreferredVolume(_self->ob_itself);
4232 _res = Py_BuildValue("h",
4233 _rv);
4234 return _res;
4235}
4236
4237static PyObject *MovieObj_SetMoviePreferredVolume(_self, _args)
4238 MovieObject *_self;
4239 PyObject *_args;
4240{
4241 PyObject *_res = NULL;
4242 short volume;
4243 if (!PyArg_ParseTuple(_args, "h",
4244 &volume))
4245 return NULL;
4246 SetMoviePreferredVolume(_self->ob_itself,
4247 volume);
4248 Py_INCREF(Py_None);
4249 _res = Py_None;
4250 return _res;
4251}
4252
4253static PyObject *MovieObj_GetMovieVolume(_self, _args)
4254 MovieObject *_self;
4255 PyObject *_args;
4256{
4257 PyObject *_res = NULL;
4258 short _rv;
4259 if (!PyArg_ParseTuple(_args, ""))
4260 return NULL;
4261 _rv = GetMovieVolume(_self->ob_itself);
4262 _res = Py_BuildValue("h",
4263 _rv);
4264 return _res;
4265}
4266
4267static PyObject *MovieObj_SetMovieVolume(_self, _args)
4268 MovieObject *_self;
4269 PyObject *_args;
4270{
4271 PyObject *_res = NULL;
4272 short volume;
4273 if (!PyArg_ParseTuple(_args, "h",
4274 &volume))
4275 return NULL;
4276 SetMovieVolume(_self->ob_itself,
4277 volume);
4278 Py_INCREF(Py_None);
4279 _res = Py_None;
4280 return _res;
4281}
4282
4283static PyObject *MovieObj_GetMoviePreviewTime(_self, _args)
4284 MovieObject *_self;
4285 PyObject *_args;
4286{
4287 PyObject *_res = NULL;
4288 TimeValue previewTime;
4289 TimeValue previewDuration;
4290 if (!PyArg_ParseTuple(_args, ""))
4291 return NULL;
4292 GetMoviePreviewTime(_self->ob_itself,
4293 &previewTime,
4294 &previewDuration);
4295 _res = Py_BuildValue("ll",
4296 previewTime,
4297 previewDuration);
4298 return _res;
4299}
4300
4301static PyObject *MovieObj_SetMoviePreviewTime(_self, _args)
4302 MovieObject *_self;
4303 PyObject *_args;
4304{
4305 PyObject *_res = NULL;
4306 TimeValue previewTime;
4307 TimeValue previewDuration;
4308 if (!PyArg_ParseTuple(_args, "ll",
4309 &previewTime,
4310 &previewDuration))
4311 return NULL;
4312 SetMoviePreviewTime(_self->ob_itself,
4313 previewTime,
4314 previewDuration);
4315 Py_INCREF(Py_None);
4316 _res = Py_None;
4317 return _res;
4318}
4319
4320static PyObject *MovieObj_GetMoviePosterTime(_self, _args)
4321 MovieObject *_self;
4322 PyObject *_args;
4323{
4324 PyObject *_res = NULL;
4325 TimeValue _rv;
4326 if (!PyArg_ParseTuple(_args, ""))
4327 return NULL;
4328 _rv = GetMoviePosterTime(_self->ob_itself);
4329 _res = Py_BuildValue("l",
4330 _rv);
4331 return _res;
4332}
4333
4334static PyObject *MovieObj_SetMoviePosterTime(_self, _args)
4335 MovieObject *_self;
4336 PyObject *_args;
4337{
4338 PyObject *_res = NULL;
4339 TimeValue posterTime;
4340 if (!PyArg_ParseTuple(_args, "l",
4341 &posterTime))
4342 return NULL;
4343 SetMoviePosterTime(_self->ob_itself,
4344 posterTime);
4345 Py_INCREF(Py_None);
4346 _res = Py_None;
4347 return _res;
4348}
4349
4350static PyObject *MovieObj_GetMovieSelection(_self, _args)
4351 MovieObject *_self;
4352 PyObject *_args;
4353{
4354 PyObject *_res = NULL;
4355 TimeValue selectionTime;
4356 TimeValue selectionDuration;
4357 if (!PyArg_ParseTuple(_args, ""))
4358 return NULL;
4359 GetMovieSelection(_self->ob_itself,
4360 &selectionTime,
4361 &selectionDuration);
4362 _res = Py_BuildValue("ll",
4363 selectionTime,
4364 selectionDuration);
4365 return _res;
4366}
4367
4368static PyObject *MovieObj_SetMovieSelection(_self, _args)
4369 MovieObject *_self;
4370 PyObject *_args;
4371{
4372 PyObject *_res = NULL;
4373 TimeValue selectionTime;
4374 TimeValue selectionDuration;
4375 if (!PyArg_ParseTuple(_args, "ll",
4376 &selectionTime,
4377 &selectionDuration))
4378 return NULL;
4379 SetMovieSelection(_self->ob_itself,
4380 selectionTime,
4381 selectionDuration);
4382 Py_INCREF(Py_None);
4383 _res = Py_None;
4384 return _res;
4385}
4386
4387static PyObject *MovieObj_SetMovieActiveSegment(_self, _args)
4388 MovieObject *_self;
4389 PyObject *_args;
4390{
4391 PyObject *_res = NULL;
4392 TimeValue startTime;
4393 TimeValue duration;
4394 if (!PyArg_ParseTuple(_args, "ll",
4395 &startTime,
4396 &duration))
4397 return NULL;
4398 SetMovieActiveSegment(_self->ob_itself,
4399 startTime,
4400 duration);
4401 Py_INCREF(Py_None);
4402 _res = Py_None;
4403 return _res;
4404}
4405
4406static PyObject *MovieObj_GetMovieActiveSegment(_self, _args)
4407 MovieObject *_self;
4408 PyObject *_args;
4409{
4410 PyObject *_res = NULL;
4411 TimeValue startTime;
4412 TimeValue duration;
4413 if (!PyArg_ParseTuple(_args, ""))
4414 return NULL;
4415 GetMovieActiveSegment(_self->ob_itself,
4416 &startTime,
4417 &duration);
4418 _res = Py_BuildValue("ll",
4419 startTime,
4420 duration);
4421 return _res;
4422}
4423
4424static PyObject *MovieObj_SetMovieTimeValue(_self, _args)
4425 MovieObject *_self;
4426 PyObject *_args;
4427{
4428 PyObject *_res = NULL;
4429 TimeValue newtime;
4430 if (!PyArg_ParseTuple(_args, "l",
4431 &newtime))
4432 return NULL;
4433 SetMovieTimeValue(_self->ob_itself,
4434 newtime);
4435 Py_INCREF(Py_None);
4436 _res = Py_None;
4437 return _res;
4438}
4439
4440static PyObject *MovieObj_GetMovieUserData(_self, _args)
4441 MovieObject *_self;
4442 PyObject *_args;
4443{
4444 PyObject *_res = NULL;
4445 UserData _rv;
4446 if (!PyArg_ParseTuple(_args, ""))
4447 return NULL;
4448 _rv = GetMovieUserData(_self->ob_itself);
4449 _res = Py_BuildValue("O&",
4450 UserDataObj_New, _rv);
4451 return _res;
4452}
4453
4454static PyObject *MovieObj_GetMovieTrackCount(_self, _args)
4455 MovieObject *_self;
4456 PyObject *_args;
4457{
4458 PyObject *_res = NULL;
4459 long _rv;
4460 if (!PyArg_ParseTuple(_args, ""))
4461 return NULL;
4462 _rv = GetMovieTrackCount(_self->ob_itself);
4463 _res = Py_BuildValue("l",
4464 _rv);
4465 return _res;
4466}
4467
4468static PyObject *MovieObj_GetMovieTrack(_self, _args)
4469 MovieObject *_self;
4470 PyObject *_args;
4471{
4472 PyObject *_res = NULL;
4473 Track _rv;
4474 long trackID;
4475 if (!PyArg_ParseTuple(_args, "l",
4476 &trackID))
4477 return NULL;
4478 _rv = GetMovieTrack(_self->ob_itself,
4479 trackID);
4480 _res = Py_BuildValue("O&",
4481 TrackObj_New, _rv);
4482 return _res;
4483}
4484
4485static PyObject *MovieObj_GetMovieIndTrack(_self, _args)
4486 MovieObject *_self;
4487 PyObject *_args;
4488{
4489 PyObject *_res = NULL;
4490 Track _rv;
4491 long index;
4492 if (!PyArg_ParseTuple(_args, "l",
4493 &index))
4494 return NULL;
4495 _rv = GetMovieIndTrack(_self->ob_itself,
4496 index);
4497 _res = Py_BuildValue("O&",
4498 TrackObj_New, _rv);
4499 return _res;
4500}
4501
4502static PyObject *MovieObj_GetMovieIndTrackType(_self, _args)
4503 MovieObject *_self;
4504 PyObject *_args;
4505{
4506 PyObject *_res = NULL;
4507 Track _rv;
4508 long index;
4509 OSType trackType;
4510 long flags;
4511 if (!PyArg_ParseTuple(_args, "lO&l",
4512 &index,
4513 PyMac_GetOSType, &trackType,
4514 &flags))
4515 return NULL;
4516 _rv = GetMovieIndTrackType(_self->ob_itself,
4517 index,
4518 trackType,
4519 flags);
4520 _res = Py_BuildValue("O&",
4521 TrackObj_New, _rv);
4522 return _res;
4523}
4524
4525static PyObject *MovieObj_NewMovieTrack(_self, _args)
4526 MovieObject *_self;
4527 PyObject *_args;
4528{
4529 PyObject *_res = NULL;
4530 Track _rv;
4531 Fixed width;
4532 Fixed height;
4533 short trackVolume;
4534 if (!PyArg_ParseTuple(_args, "O&O&h",
4535 PyMac_GetFixed, &width,
4536 PyMac_GetFixed, &height,
4537 &trackVolume))
4538 return NULL;
4539 _rv = NewMovieTrack(_self->ob_itself,
4540 width,
4541 height,
4542 trackVolume);
4543 _res = Py_BuildValue("O&",
4544 TrackObj_New, _rv);
4545 return _res;
4546}
4547
4548static PyObject *MovieObj_SetAutoTrackAlternatesEnabled(_self, _args)
4549 MovieObject *_self;
4550 PyObject *_args;
4551{
4552 PyObject *_res = NULL;
4553 Boolean enable;
4554 if (!PyArg_ParseTuple(_args, "b",
4555 &enable))
4556 return NULL;
4557 SetAutoTrackAlternatesEnabled(_self->ob_itself,
4558 enable);
4559 Py_INCREF(Py_None);
4560 _res = Py_None;
4561 return _res;
4562}
4563
4564static PyObject *MovieObj_SelectMovieAlternates(_self, _args)
4565 MovieObject *_self;
4566 PyObject *_args;
4567{
4568 PyObject *_res = NULL;
4569 if (!PyArg_ParseTuple(_args, ""))
4570 return NULL;
4571 SelectMovieAlternates(_self->ob_itself);
4572 Py_INCREF(Py_None);
4573 _res = Py_None;
4574 return _res;
4575}
4576
4577static PyObject *MovieObj_InsertMovieSegment(_self, _args)
4578 MovieObject *_self;
4579 PyObject *_args;
4580{
4581 PyObject *_res = NULL;
4582 OSErr _err;
4583 Movie dstMovie;
4584 TimeValue srcIn;
4585 TimeValue srcDuration;
4586 TimeValue dstIn;
4587 if (!PyArg_ParseTuple(_args, "O&lll",
4588 MovieObj_Convert, &dstMovie,
4589 &srcIn,
4590 &srcDuration,
4591 &dstIn))
4592 return NULL;
4593 _err = InsertMovieSegment(_self->ob_itself,
4594 dstMovie,
4595 srcIn,
4596 srcDuration,
4597 dstIn);
4598 if (_err != noErr) return PyMac_Error(_err);
4599 Py_INCREF(Py_None);
4600 _res = Py_None;
4601 return _res;
4602}
4603
4604static PyObject *MovieObj_InsertEmptyMovieSegment(_self, _args)
4605 MovieObject *_self;
4606 PyObject *_args;
4607{
4608 PyObject *_res = NULL;
4609 OSErr _err;
4610 TimeValue dstIn;
4611 TimeValue dstDuration;
4612 if (!PyArg_ParseTuple(_args, "ll",
4613 &dstIn,
4614 &dstDuration))
4615 return NULL;
4616 _err = InsertEmptyMovieSegment(_self->ob_itself,
4617 dstIn,
4618 dstDuration);
4619 if (_err != noErr) return PyMac_Error(_err);
4620 Py_INCREF(Py_None);
4621 _res = Py_None;
4622 return _res;
4623}
4624
4625static PyObject *MovieObj_DeleteMovieSegment(_self, _args)
4626 MovieObject *_self;
4627 PyObject *_args;
4628{
4629 PyObject *_res = NULL;
4630 OSErr _err;
4631 TimeValue startTime;
4632 TimeValue duration;
4633 if (!PyArg_ParseTuple(_args, "ll",
4634 &startTime,
4635 &duration))
4636 return NULL;
4637 _err = DeleteMovieSegment(_self->ob_itself,
4638 startTime,
4639 duration);
4640 if (_err != noErr) return PyMac_Error(_err);
4641 Py_INCREF(Py_None);
4642 _res = Py_None;
4643 return _res;
4644}
4645
4646static PyObject *MovieObj_ScaleMovieSegment(_self, _args)
4647 MovieObject *_self;
4648 PyObject *_args;
4649{
4650 PyObject *_res = NULL;
4651 OSErr _err;
4652 TimeValue startTime;
4653 TimeValue oldDuration;
4654 TimeValue newDuration;
4655 if (!PyArg_ParseTuple(_args, "lll",
4656 &startTime,
4657 &oldDuration,
4658 &newDuration))
4659 return NULL;
4660 _err = ScaleMovieSegment(_self->ob_itself,
4661 startTime,
4662 oldDuration,
4663 newDuration);
4664 if (_err != noErr) return PyMac_Error(_err);
4665 Py_INCREF(Py_None);
4666 _res = Py_None;
4667 return _res;
4668}
4669
4670static PyObject *MovieObj_CutMovieSelection(_self, _args)
4671 MovieObject *_self;
4672 PyObject *_args;
4673{
4674 PyObject *_res = NULL;
4675 Movie _rv;
4676 if (!PyArg_ParseTuple(_args, ""))
4677 return NULL;
4678 _rv = CutMovieSelection(_self->ob_itself);
4679 _res = Py_BuildValue("O&",
4680 MovieObj_New, _rv);
4681 return _res;
4682}
4683
4684static PyObject *MovieObj_CopyMovieSelection(_self, _args)
4685 MovieObject *_self;
4686 PyObject *_args;
4687{
4688 PyObject *_res = NULL;
4689 Movie _rv;
4690 if (!PyArg_ParseTuple(_args, ""))
4691 return NULL;
4692 _rv = CopyMovieSelection(_self->ob_itself);
4693 _res = Py_BuildValue("O&",
4694 MovieObj_New, _rv);
4695 return _res;
4696}
4697
4698static PyObject *MovieObj_PasteMovieSelection(_self, _args)
4699 MovieObject *_self;
4700 PyObject *_args;
4701{
4702 PyObject *_res = NULL;
4703 Movie src;
4704 if (!PyArg_ParseTuple(_args, "O&",
4705 MovieObj_Convert, &src))
4706 return NULL;
4707 PasteMovieSelection(_self->ob_itself,
4708 src);
4709 Py_INCREF(Py_None);
4710 _res = Py_None;
4711 return _res;
4712}
4713
4714static PyObject *MovieObj_AddMovieSelection(_self, _args)
4715 MovieObject *_self;
4716 PyObject *_args;
4717{
4718 PyObject *_res = NULL;
4719 Movie src;
4720 if (!PyArg_ParseTuple(_args, "O&",
4721 MovieObj_Convert, &src))
4722 return NULL;
4723 AddMovieSelection(_self->ob_itself,
4724 src);
4725 Py_INCREF(Py_None);
4726 _res = Py_None;
4727 return _res;
4728}
4729
4730static PyObject *MovieObj_ClearMovieSelection(_self, _args)
4731 MovieObject *_self;
4732 PyObject *_args;
4733{
4734 PyObject *_res = NULL;
4735 if (!PyArg_ParseTuple(_args, ""))
4736 return NULL;
4737 ClearMovieSelection(_self->ob_itself);
4738 Py_INCREF(Py_None);
4739 _res = Py_None;
4740 return _res;
4741}
4742
4743static PyObject *MovieObj_PutMovieIntoTypedHandle(_self, _args)
4744 MovieObject *_self;
4745 PyObject *_args;
4746{
4747 PyObject *_res = NULL;
4748 OSErr _err;
4749 Track targetTrack;
4750 OSType handleType;
4751 Handle publicMovie;
4752 TimeValue start;
4753 TimeValue dur;
4754 long flags;
4755 ComponentInstance userComp;
4756 if (!PyArg_ParseTuple(_args, "O&O&O&lllO&",
4757 TrackObj_Convert, &targetTrack,
4758 PyMac_GetOSType, &handleType,
4759 ResObj_Convert, &publicMovie,
4760 &start,
4761 &dur,
4762 &flags,
4763 CmpInstObj_Convert, &userComp))
4764 return NULL;
4765 _err = PutMovieIntoTypedHandle(_self->ob_itself,
4766 targetTrack,
4767 handleType,
4768 publicMovie,
4769 start,
4770 dur,
4771 flags,
4772 userComp);
4773 if (_err != noErr) return PyMac_Error(_err);
4774 Py_INCREF(Py_None);
4775 _res = Py_None;
4776 return _res;
4777}
4778
4779static PyObject *MovieObj_CopyMovieSettings(_self, _args)
4780 MovieObject *_self;
4781 PyObject *_args;
4782{
4783 PyObject *_res = NULL;
4784 OSErr _err;
4785 Movie dstMovie;
4786 if (!PyArg_ParseTuple(_args, "O&",
4787 MovieObj_Convert, &dstMovie))
4788 return NULL;
4789 _err = CopyMovieSettings(_self->ob_itself,
4790 dstMovie);
4791 if (_err != noErr) return PyMac_Error(_err);
4792 Py_INCREF(Py_None);
4793 _res = Py_None;
4794 return _res;
4795}
4796
4797static PyObject *MovieObj_ConvertMovieToFile(_self, _args)
4798 MovieObject *_self;
4799 PyObject *_args;
4800{
4801 PyObject *_res = NULL;
4802 OSErr _err;
4803 Track onlyTrack;
4804 FSSpec outputFile;
4805 OSType fileType;
4806 OSType creator;
4807 ScriptCode scriptTag;
4808 short resID;
4809 long flags;
4810 ComponentInstance userComp;
4811 if (!PyArg_ParseTuple(_args, "O&O&O&O&hlO&",
4812 TrackObj_Convert, &onlyTrack,
4813 PyMac_GetFSSpec, &outputFile,
4814 PyMac_GetOSType, &fileType,
4815 PyMac_GetOSType, &creator,
4816 &scriptTag,
4817 &flags,
4818 CmpInstObj_Convert, &userComp))
4819 return NULL;
4820 _err = ConvertMovieToFile(_self->ob_itself,
4821 onlyTrack,
4822 &outputFile,
4823 fileType,
4824 creator,
4825 scriptTag,
4826 &resID,
4827 flags,
4828 userComp);
4829 if (_err != noErr) return PyMac_Error(_err);
4830 _res = Py_BuildValue("h",
4831 resID);
4832 return _res;
4833}
4834
4835static PyObject *MovieObj_GetMovieDataSize(_self, _args)
4836 MovieObject *_self;
4837 PyObject *_args;
4838{
4839 PyObject *_res = NULL;
4840 long _rv;
4841 TimeValue startTime;
4842 TimeValue duration;
4843 if (!PyArg_ParseTuple(_args, "ll",
4844 &startTime,
4845 &duration))
4846 return NULL;
4847 _rv = GetMovieDataSize(_self->ob_itself,
4848 startTime,
4849 duration);
4850 _res = Py_BuildValue("l",
4851 _rv);
4852 return _res;
4853}
4854
4855static PyObject *MovieObj_PtInMovie(_self, _args)
4856 MovieObject *_self;
4857 PyObject *_args;
4858{
4859 PyObject *_res = NULL;
4860 Boolean _rv;
4861 Point pt;
4862 if (!PyArg_ParseTuple(_args, "O&",
4863 PyMac_GetPoint, &pt))
4864 return NULL;
4865 _rv = PtInMovie(_self->ob_itself,
4866 pt);
4867 _res = Py_BuildValue("b",
4868 _rv);
4869 return _res;
4870}
4871
4872static PyObject *MovieObj_SetMovieLanguage(_self, _args)
4873 MovieObject *_self;
4874 PyObject *_args;
4875{
4876 PyObject *_res = NULL;
4877 long language;
4878 if (!PyArg_ParseTuple(_args, "l",
4879 &language))
4880 return NULL;
4881 SetMovieLanguage(_self->ob_itself,
4882 language);
4883 Py_INCREF(Py_None);
4884 _res = Py_None;
4885 return _res;
4886}
4887
4888static PyObject *MovieObj_GetMovieNextInterestingTime(_self, _args)
4889 MovieObject *_self;
4890 PyObject *_args;
4891{
4892 PyObject *_res = NULL;
4893 short interestingTimeFlags;
4894 short numMediaTypes;
4895 OSType whichMediaTypes;
4896 TimeValue time;
4897 Fixed rate;
4898 TimeValue interestingTime;
4899 TimeValue interestingDuration;
4900 if (!PyArg_ParseTuple(_args, "hhO&lO&",
4901 &interestingTimeFlags,
4902 &numMediaTypes,
4903 PyMac_GetOSType, &whichMediaTypes,
4904 &time,
4905 PyMac_GetFixed, &rate))
4906 return NULL;
4907 GetMovieNextInterestingTime(_self->ob_itself,
4908 interestingTimeFlags,
4909 numMediaTypes,
4910 &whichMediaTypes,
4911 time,
4912 rate,
4913 &interestingTime,
4914 &interestingDuration);
4915 _res = Py_BuildValue("ll",
4916 interestingTime,
4917 interestingDuration);
4918 return _res;
4919}
4920
4921static PyObject *MovieObj_AddMovieResource(_self, _args)
4922 MovieObject *_self;
4923 PyObject *_args;
4924{
4925 PyObject *_res = NULL;
4926 OSErr _err;
4927 short resRefNum;
4928 short resId;
4929 Str255 resName;
4930 if (!PyArg_ParseTuple(_args, "hO&",
4931 &resRefNum,
4932 PyMac_GetStr255, resName))
4933 return NULL;
4934 _err = AddMovieResource(_self->ob_itself,
4935 resRefNum,
4936 &resId,
4937 resName);
4938 if (_err != noErr) return PyMac_Error(_err);
4939 _res = Py_BuildValue("h",
4940 resId);
4941 return _res;
4942}
4943
4944static PyObject *MovieObj_UpdateMovieResource(_self, _args)
4945 MovieObject *_self;
4946 PyObject *_args;
4947{
4948 PyObject *_res = NULL;
4949 OSErr _err;
4950 short resRefNum;
4951 short resId;
4952 Str255 resName;
4953 if (!PyArg_ParseTuple(_args, "hhO&",
4954 &resRefNum,
4955 &resId,
4956 PyMac_GetStr255, resName))
4957 return NULL;
4958 _err = UpdateMovieResource(_self->ob_itself,
4959 resRefNum,
4960 resId,
4961 resName);
4962 if (_err != noErr) return PyMac_Error(_err);
4963 Py_INCREF(Py_None);
4964 _res = Py_None;
4965 return _res;
4966}
4967
4968static PyObject *MovieObj_HasMovieChanged(_self, _args)
4969 MovieObject *_self;
4970 PyObject *_args;
4971{
4972 PyObject *_res = NULL;
4973 Boolean _rv;
4974 if (!PyArg_ParseTuple(_args, ""))
4975 return NULL;
4976 _rv = HasMovieChanged(_self->ob_itself);
4977 _res = Py_BuildValue("b",
4978 _rv);
4979 return _res;
4980}
4981
4982static PyObject *MovieObj_ClearMovieChanged(_self, _args)
4983 MovieObject *_self;
4984 PyObject *_args;
4985{
4986 PyObject *_res = NULL;
4987 if (!PyArg_ParseTuple(_args, ""))
4988 return NULL;
4989 ClearMovieChanged(_self->ob_itself);
4990 Py_INCREF(Py_None);
4991 _res = Py_None;
4992 return _res;
4993}
4994
4995static PyObject *MovieObj_SetMovieDefaultDataRef(_self, _args)
4996 MovieObject *_self;
4997 PyObject *_args;
4998{
4999 PyObject *_res = NULL;
5000 OSErr _err;
5001 Handle dataRef;
5002 OSType dataRefType;
5003 if (!PyArg_ParseTuple(_args, "O&O&",
5004 ResObj_Convert, &dataRef,
5005 PyMac_GetOSType, &dataRefType))
5006 return NULL;
5007 _err = SetMovieDefaultDataRef(_self->ob_itself,
5008 dataRef,
5009 dataRefType);
5010 if (_err != noErr) return PyMac_Error(_err);
5011 Py_INCREF(Py_None);
5012 _res = Py_None;
5013 return _res;
5014}
5015
5016static PyObject *MovieObj_GetMovieDefaultDataRef(_self, _args)
5017 MovieObject *_self;
5018 PyObject *_args;
5019{
5020 PyObject *_res = NULL;
5021 OSErr _err;
5022 Handle dataRef;
5023 OSType dataRefType;
5024 if (!PyArg_ParseTuple(_args, ""))
5025 return NULL;
5026 _err = GetMovieDefaultDataRef(_self->ob_itself,
5027 &dataRef,
5028 &dataRefType);
5029 if (_err != noErr) return PyMac_Error(_err);
5030 _res = Py_BuildValue("O&O&",
5031 ResObj_New, dataRef,
5032 PyMac_BuildOSType, dataRefType);
5033 return _res;
5034}
5035
5036static PyObject *MovieObj_SetMovieColorTable(_self, _args)
5037 MovieObject *_self;
5038 PyObject *_args;
5039{
5040 PyObject *_res = NULL;
5041 OSErr _err;
5042 CTabHandle ctab;
5043 if (!PyArg_ParseTuple(_args, "O&",
5044 ResObj_Convert, &ctab))
5045 return NULL;
5046 _err = SetMovieColorTable(_self->ob_itself,
5047 ctab);
5048 if (_err != noErr) return PyMac_Error(_err);
5049 Py_INCREF(Py_None);
5050 _res = Py_None;
5051 return _res;
5052}
5053
5054static PyObject *MovieObj_GetMovieColorTable(_self, _args)
5055 MovieObject *_self;
5056 PyObject *_args;
5057{
5058 PyObject *_res = NULL;
5059 OSErr _err;
5060 CTabHandle ctab;
5061 if (!PyArg_ParseTuple(_args, ""))
5062 return NULL;
5063 _err = GetMovieColorTable(_self->ob_itself,
5064 &ctab);
5065 if (_err != noErr) return PyMac_Error(_err);
5066 _res = Py_BuildValue("O&",
5067 ResObj_New, ctab);
5068 return _res;
5069}
5070
5071static PyObject *MovieObj_FlattenMovie(_self, _args)
5072 MovieObject *_self;
5073 PyObject *_args;
5074{
5075 PyObject *_res = NULL;
5076 long movieFlattenFlags;
5077 FSSpec theFile;
5078 OSType creator;
5079 ScriptCode scriptTag;
5080 long createMovieFileFlags;
5081 short resId;
5082 Str255 resName;
5083 if (!PyArg_ParseTuple(_args, "lO&O&hlO&",
5084 &movieFlattenFlags,
5085 PyMac_GetFSSpec, &theFile,
5086 PyMac_GetOSType, &creator,
5087 &scriptTag,
5088 &createMovieFileFlags,
5089 PyMac_GetStr255, resName))
5090 return NULL;
5091 FlattenMovie(_self->ob_itself,
5092 movieFlattenFlags,
5093 &theFile,
5094 creator,
5095 scriptTag,
5096 createMovieFileFlags,
5097 &resId,
5098 resName);
5099 _res = Py_BuildValue("h",
5100 resId);
5101 return _res;
5102}
5103
5104static PyObject *MovieObj_FlattenMovieData(_self, _args)
5105 MovieObject *_self;
5106 PyObject *_args;
5107{
5108 PyObject *_res = NULL;
5109 Movie _rv;
5110 long movieFlattenFlags;
5111 FSSpec theFile;
5112 OSType creator;
5113 ScriptCode scriptTag;
5114 long createMovieFileFlags;
5115 if (!PyArg_ParseTuple(_args, "lO&O&hl",
5116 &movieFlattenFlags,
5117 PyMac_GetFSSpec, &theFile,
5118 PyMac_GetOSType, &creator,
5119 &scriptTag,
5120 &createMovieFileFlags))
5121 return NULL;
5122 _rv = FlattenMovieData(_self->ob_itself,
5123 movieFlattenFlags,
5124 &theFile,
5125 creator,
5126 scriptTag,
5127 createMovieFileFlags);
5128 _res = Py_BuildValue("O&",
5129 MovieObj_New, _rv);
5130 return _res;
5131}
5132
5133static PyObject *MovieObj_MovieSearchText(_self, _args)
5134 MovieObject *_self;
5135 PyObject *_args;
5136{
5137 PyObject *_res = NULL;
5138 OSErr _err;
5139 Ptr text;
5140 long size;
5141 long searchFlags;
5142 Track searchTrack;
5143 TimeValue searchTime;
5144 long searchOffset;
5145 if (!PyArg_ParseTuple(_args, "sll",
5146 &text,
5147 &size,
5148 &searchFlags))
5149 return NULL;
5150 _err = MovieSearchText(_self->ob_itself,
5151 text,
5152 size,
5153 searchFlags,
5154 &searchTrack,
5155 &searchTime,
5156 &searchOffset);
5157 if (_err != noErr) return PyMac_Error(_err);
5158 _res = Py_BuildValue("O&ll",
5159 TrackObj_New, searchTrack,
5160 searchTime,
5161 searchOffset);
5162 return _res;
5163}
5164
5165static PyObject *MovieObj_GetPosterBox(_self, _args)
5166 MovieObject *_self;
5167 PyObject *_args;
5168{
5169 PyObject *_res = NULL;
5170 Rect boxRect;
5171 if (!PyArg_ParseTuple(_args, ""))
5172 return NULL;
5173 GetPosterBox(_self->ob_itself,
5174 &boxRect);
5175 _res = Py_BuildValue("O&",
5176 PyMac_BuildRect, &boxRect);
5177 return _res;
5178}
5179
5180static PyObject *MovieObj_SetPosterBox(_self, _args)
5181 MovieObject *_self;
5182 PyObject *_args;
5183{
5184 PyObject *_res = NULL;
5185 Rect boxRect;
5186 if (!PyArg_ParseTuple(_args, "O&",
5187 PyMac_GetRect, &boxRect))
5188 return NULL;
5189 SetPosterBox(_self->ob_itself,
5190 &boxRect);
5191 Py_INCREF(Py_None);
5192 _res = Py_None;
5193 return _res;
5194}
5195
5196static PyObject *MovieObj_GetMovieSegmentDisplayBoundsRgn(_self, _args)
5197 MovieObject *_self;
5198 PyObject *_args;
5199{
5200 PyObject *_res = NULL;
5201 RgnHandle _rv;
5202 TimeValue time;
5203 TimeValue duration;
5204 if (!PyArg_ParseTuple(_args, "ll",
5205 &time,
5206 &duration))
5207 return NULL;
5208 _rv = GetMovieSegmentDisplayBoundsRgn(_self->ob_itself,
5209 time,
5210 duration);
5211 _res = Py_BuildValue("O&",
5212 ResObj_New, _rv);
5213 return _res;
5214}
5215
5216static PyObject *MovieObj_GetMovieStatus(_self, _args)
5217 MovieObject *_self;
5218 PyObject *_args;
5219{
5220 PyObject *_res = NULL;
5221 ComponentResult _rv;
5222 Track firstProblemTrack;
5223 if (!PyArg_ParseTuple(_args, ""))
5224 return NULL;
5225 _rv = GetMovieStatus(_self->ob_itself,
5226 &firstProblemTrack);
5227 _res = Py_BuildValue("lO&",
5228 _rv,
5229 TrackObj_New, firstProblemTrack);
5230 return _res;
5231}
5232
5233static PyObject *MovieObj_NewMovieController(_self, _args)
5234 MovieObject *_self;
5235 PyObject *_args;
5236{
5237 PyObject *_res = NULL;
Jack Jansen9cfea101995-12-09 14:05:56 +00005238 MovieController _rv;
Jack Jansen453ced51995-11-30 17:42:08 +00005239 Rect movieRect;
5240 long someFlags;
5241 if (!PyArg_ParseTuple(_args, "O&l",
5242 PyMac_GetRect, &movieRect,
5243 &someFlags))
5244 return NULL;
5245 _rv = NewMovieController(_self->ob_itself,
5246 &movieRect,
5247 someFlags);
5248 _res = Py_BuildValue("O&",
Jack Jansen9cfea101995-12-09 14:05:56 +00005249 MovieCtlObj_New, _rv);
Jack Jansen453ced51995-11-30 17:42:08 +00005250 return _res;
5251}
5252
5253static PyObject *MovieObj_PutMovieOnScrap(_self, _args)
5254 MovieObject *_self;
5255 PyObject *_args;
5256{
5257 PyObject *_res = NULL;
5258 OSErr _err;
5259 long movieScrapFlags;
5260 if (!PyArg_ParseTuple(_args, "l",
5261 &movieScrapFlags))
5262 return NULL;
5263 _err = PutMovieOnScrap(_self->ob_itself,
5264 movieScrapFlags);
5265 if (_err != noErr) return PyMac_Error(_err);
5266 Py_INCREF(Py_None);
5267 _res = Py_None;
5268 return _res;
5269}
5270
5271static PyObject *MovieObj_SetMoviePlayHints(_self, _args)
5272 MovieObject *_self;
5273 PyObject *_args;
5274{
5275 PyObject *_res = NULL;
5276 long flags;
5277 long flagsMask;
5278 if (!PyArg_ParseTuple(_args, "ll",
5279 &flags,
5280 &flagsMask))
5281 return NULL;
5282 SetMoviePlayHints(_self->ob_itself,
5283 flags,
5284 flagsMask);
5285 Py_INCREF(Py_None);
5286 _res = Py_None;
5287 return _res;
5288}
5289
5290static PyMethodDef MovieObj_methods[] = {
5291 {"MoviesTask", (PyCFunction)MovieObj_MoviesTask, 1,
5292 "(long maxMilliSecToUse) -> None"},
5293 {"PrerollMovie", (PyCFunction)MovieObj_PrerollMovie, 1,
5294 "(TimeValue time, Fixed Rate) -> None"},
5295 {"LoadMovieIntoRam", (PyCFunction)MovieObj_LoadMovieIntoRam, 1,
5296 "(TimeValue time, TimeValue duration, long flags) -> None"},
5297 {"SetMovieActive", (PyCFunction)MovieObj_SetMovieActive, 1,
5298 "(Boolean active) -> None"},
5299 {"GetMovieActive", (PyCFunction)MovieObj_GetMovieActive, 1,
5300 "() -> (Boolean _rv)"},
5301 {"StartMovie", (PyCFunction)MovieObj_StartMovie, 1,
5302 "() -> None"},
5303 {"StopMovie", (PyCFunction)MovieObj_StopMovie, 1,
5304 "() -> None"},
5305 {"GoToBeginningOfMovie", (PyCFunction)MovieObj_GoToBeginningOfMovie, 1,
5306 "() -> None"},
5307 {"GoToEndOfMovie", (PyCFunction)MovieObj_GoToEndOfMovie, 1,
5308 "() -> None"},
5309 {"IsMovieDone", (PyCFunction)MovieObj_IsMovieDone, 1,
5310 "() -> (Boolean _rv)"},
5311 {"GetMoviePreviewMode", (PyCFunction)MovieObj_GetMoviePreviewMode, 1,
5312 "() -> (Boolean _rv)"},
5313 {"SetMoviePreviewMode", (PyCFunction)MovieObj_SetMoviePreviewMode, 1,
5314 "(Boolean usePreview) -> None"},
5315 {"ShowMoviePoster", (PyCFunction)MovieObj_ShowMoviePoster, 1,
5316 "() -> None"},
5317 {"GetMovieTimeBase", (PyCFunction)MovieObj_GetMovieTimeBase, 1,
5318 "() -> (TimeBase _rv)"},
Jack Jansene0cf87b1997-04-09 15:53:46 +00005319 {"GetMovieGWorld", (PyCFunction)MovieObj_GetMovieGWorld, 1,
5320 "() -> (CGrafPtr port, GDHandle gdh)"},
5321 {"SetMovieGWorld", (PyCFunction)MovieObj_SetMovieGWorld, 1,
5322 "(CGrafPtr port, GDHandle gdh) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00005323 {"GetNextTrackForCompositing", (PyCFunction)MovieObj_GetNextTrackForCompositing, 1,
5324 "(Track theTrack) -> (Track _rv)"},
5325 {"GetPrevTrackForCompositing", (PyCFunction)MovieObj_GetPrevTrackForCompositing, 1,
5326 "(Track theTrack) -> (Track _rv)"},
5327 {"GetMoviePict", (PyCFunction)MovieObj_GetMoviePict, 1,
5328 "(TimeValue time) -> (PicHandle _rv)"},
5329 {"GetMoviePosterPict", (PyCFunction)MovieObj_GetMoviePosterPict, 1,
5330 "() -> (PicHandle _rv)"},
5331 {"UpdateMovie", (PyCFunction)MovieObj_UpdateMovie, 1,
5332 "() -> None"},
5333 {"GetMovieBox", (PyCFunction)MovieObj_GetMovieBox, 1,
5334 "() -> (Rect boxRect)"},
5335 {"SetMovieBox", (PyCFunction)MovieObj_SetMovieBox, 1,
5336 "(Rect boxRect) -> None"},
5337 {"GetMovieDisplayClipRgn", (PyCFunction)MovieObj_GetMovieDisplayClipRgn, 1,
5338 "() -> (RgnHandle _rv)"},
5339 {"SetMovieDisplayClipRgn", (PyCFunction)MovieObj_SetMovieDisplayClipRgn, 1,
5340 "(RgnHandle theClip) -> None"},
5341 {"GetMovieClipRgn", (PyCFunction)MovieObj_GetMovieClipRgn, 1,
5342 "() -> (RgnHandle _rv)"},
5343 {"SetMovieClipRgn", (PyCFunction)MovieObj_SetMovieClipRgn, 1,
5344 "(RgnHandle theClip) -> None"},
5345 {"GetMovieDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieDisplayBoundsRgn, 1,
5346 "() -> (RgnHandle _rv)"},
5347 {"GetMovieBoundsRgn", (PyCFunction)MovieObj_GetMovieBoundsRgn, 1,
5348 "() -> (RgnHandle _rv)"},
5349 {"PutMovieIntoHandle", (PyCFunction)MovieObj_PutMovieIntoHandle, 1,
5350 "(Handle publicMovie) -> None"},
5351 {"PutMovieIntoDataFork", (PyCFunction)MovieObj_PutMovieIntoDataFork, 1,
5352 "(short fRefNum, long offset, long maxSize) -> None"},
Jack Jansene0cf87b1997-04-09 15:53:46 +00005353 {"GetMovieCreationTime", (PyCFunction)MovieObj_GetMovieCreationTime, 1,
5354 "() -> (unsigned long _rv)"},
5355 {"GetMovieModificationTime", (PyCFunction)MovieObj_GetMovieModificationTime, 1,
5356 "() -> (unsigned long _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00005357 {"GetMovieTimeScale", (PyCFunction)MovieObj_GetMovieTimeScale, 1,
5358 "() -> (TimeScale _rv)"},
5359 {"SetMovieTimeScale", (PyCFunction)MovieObj_SetMovieTimeScale, 1,
5360 "(TimeScale timeScale) -> None"},
5361 {"GetMovieDuration", (PyCFunction)MovieObj_GetMovieDuration, 1,
5362 "() -> (TimeValue _rv)"},
5363 {"GetMovieRate", (PyCFunction)MovieObj_GetMovieRate, 1,
5364 "() -> (Fixed _rv)"},
5365 {"SetMovieRate", (PyCFunction)MovieObj_SetMovieRate, 1,
5366 "(Fixed rate) -> None"},
5367 {"GetMoviePreferredRate", (PyCFunction)MovieObj_GetMoviePreferredRate, 1,
5368 "() -> (Fixed _rv)"},
5369 {"SetMoviePreferredRate", (PyCFunction)MovieObj_SetMoviePreferredRate, 1,
5370 "(Fixed rate) -> None"},
5371 {"GetMoviePreferredVolume", (PyCFunction)MovieObj_GetMoviePreferredVolume, 1,
5372 "() -> (short _rv)"},
5373 {"SetMoviePreferredVolume", (PyCFunction)MovieObj_SetMoviePreferredVolume, 1,
5374 "(short volume) -> None"},
5375 {"GetMovieVolume", (PyCFunction)MovieObj_GetMovieVolume, 1,
5376 "() -> (short _rv)"},
5377 {"SetMovieVolume", (PyCFunction)MovieObj_SetMovieVolume, 1,
5378 "(short volume) -> None"},
5379 {"GetMoviePreviewTime", (PyCFunction)MovieObj_GetMoviePreviewTime, 1,
5380 "() -> (TimeValue previewTime, TimeValue previewDuration)"},
5381 {"SetMoviePreviewTime", (PyCFunction)MovieObj_SetMoviePreviewTime, 1,
5382 "(TimeValue previewTime, TimeValue previewDuration) -> None"},
5383 {"GetMoviePosterTime", (PyCFunction)MovieObj_GetMoviePosterTime, 1,
5384 "() -> (TimeValue _rv)"},
5385 {"SetMoviePosterTime", (PyCFunction)MovieObj_SetMoviePosterTime, 1,
5386 "(TimeValue posterTime) -> None"},
5387 {"GetMovieSelection", (PyCFunction)MovieObj_GetMovieSelection, 1,
5388 "() -> (TimeValue selectionTime, TimeValue selectionDuration)"},
5389 {"SetMovieSelection", (PyCFunction)MovieObj_SetMovieSelection, 1,
5390 "(TimeValue selectionTime, TimeValue selectionDuration) -> None"},
5391 {"SetMovieActiveSegment", (PyCFunction)MovieObj_SetMovieActiveSegment, 1,
5392 "(TimeValue startTime, TimeValue duration) -> None"},
5393 {"GetMovieActiveSegment", (PyCFunction)MovieObj_GetMovieActiveSegment, 1,
5394 "() -> (TimeValue startTime, TimeValue duration)"},
5395 {"SetMovieTimeValue", (PyCFunction)MovieObj_SetMovieTimeValue, 1,
5396 "(TimeValue newtime) -> None"},
5397 {"GetMovieUserData", (PyCFunction)MovieObj_GetMovieUserData, 1,
5398 "() -> (UserData _rv)"},
5399 {"GetMovieTrackCount", (PyCFunction)MovieObj_GetMovieTrackCount, 1,
5400 "() -> (long _rv)"},
5401 {"GetMovieTrack", (PyCFunction)MovieObj_GetMovieTrack, 1,
5402 "(long trackID) -> (Track _rv)"},
5403 {"GetMovieIndTrack", (PyCFunction)MovieObj_GetMovieIndTrack, 1,
5404 "(long index) -> (Track _rv)"},
5405 {"GetMovieIndTrackType", (PyCFunction)MovieObj_GetMovieIndTrackType, 1,
5406 "(long index, OSType trackType, long flags) -> (Track _rv)"},
5407 {"NewMovieTrack", (PyCFunction)MovieObj_NewMovieTrack, 1,
5408 "(Fixed width, Fixed height, short trackVolume) -> (Track _rv)"},
5409 {"SetAutoTrackAlternatesEnabled", (PyCFunction)MovieObj_SetAutoTrackAlternatesEnabled, 1,
5410 "(Boolean enable) -> None"},
5411 {"SelectMovieAlternates", (PyCFunction)MovieObj_SelectMovieAlternates, 1,
5412 "() -> None"},
5413 {"InsertMovieSegment", (PyCFunction)MovieObj_InsertMovieSegment, 1,
5414 "(Movie dstMovie, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
5415 {"InsertEmptyMovieSegment", (PyCFunction)MovieObj_InsertEmptyMovieSegment, 1,
5416 "(TimeValue dstIn, TimeValue dstDuration) -> None"},
5417 {"DeleteMovieSegment", (PyCFunction)MovieObj_DeleteMovieSegment, 1,
5418 "(TimeValue startTime, TimeValue duration) -> None"},
5419 {"ScaleMovieSegment", (PyCFunction)MovieObj_ScaleMovieSegment, 1,
5420 "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
5421 {"CutMovieSelection", (PyCFunction)MovieObj_CutMovieSelection, 1,
5422 "() -> (Movie _rv)"},
5423 {"CopyMovieSelection", (PyCFunction)MovieObj_CopyMovieSelection, 1,
5424 "() -> (Movie _rv)"},
5425 {"PasteMovieSelection", (PyCFunction)MovieObj_PasteMovieSelection, 1,
5426 "(Movie src) -> None"},
5427 {"AddMovieSelection", (PyCFunction)MovieObj_AddMovieSelection, 1,
5428 "(Movie src) -> None"},
5429 {"ClearMovieSelection", (PyCFunction)MovieObj_ClearMovieSelection, 1,
5430 "() -> None"},
5431 {"PutMovieIntoTypedHandle", (PyCFunction)MovieObj_PutMovieIntoTypedHandle, 1,
5432 "(Track targetTrack, OSType handleType, Handle publicMovie, TimeValue start, TimeValue dur, long flags, ComponentInstance userComp) -> None"},
5433 {"CopyMovieSettings", (PyCFunction)MovieObj_CopyMovieSettings, 1,
5434 "(Movie dstMovie) -> None"},
5435 {"ConvertMovieToFile", (PyCFunction)MovieObj_ConvertMovieToFile, 1,
5436 "(Track onlyTrack, FSSpec outputFile, OSType fileType, OSType creator, ScriptCode scriptTag, long flags, ComponentInstance userComp) -> (short resID)"},
5437 {"GetMovieDataSize", (PyCFunction)MovieObj_GetMovieDataSize, 1,
5438 "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
5439 {"PtInMovie", (PyCFunction)MovieObj_PtInMovie, 1,
5440 "(Point pt) -> (Boolean _rv)"},
5441 {"SetMovieLanguage", (PyCFunction)MovieObj_SetMovieLanguage, 1,
5442 "(long language) -> None"},
5443 {"GetMovieNextInterestingTime", (PyCFunction)MovieObj_GetMovieNextInterestingTime, 1,
5444 "(short interestingTimeFlags, short numMediaTypes, OSType whichMediaTypes, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
5445 {"AddMovieResource", (PyCFunction)MovieObj_AddMovieResource, 1,
5446 "(short resRefNum, Str255 resName) -> (short resId)"},
5447 {"UpdateMovieResource", (PyCFunction)MovieObj_UpdateMovieResource, 1,
5448 "(short resRefNum, short resId, Str255 resName) -> None"},
5449 {"HasMovieChanged", (PyCFunction)MovieObj_HasMovieChanged, 1,
5450 "() -> (Boolean _rv)"},
5451 {"ClearMovieChanged", (PyCFunction)MovieObj_ClearMovieChanged, 1,
5452 "() -> None"},
5453 {"SetMovieDefaultDataRef", (PyCFunction)MovieObj_SetMovieDefaultDataRef, 1,
5454 "(Handle dataRef, OSType dataRefType) -> None"},
5455 {"GetMovieDefaultDataRef", (PyCFunction)MovieObj_GetMovieDefaultDataRef, 1,
5456 "() -> (Handle dataRef, OSType dataRefType)"},
5457 {"SetMovieColorTable", (PyCFunction)MovieObj_SetMovieColorTable, 1,
5458 "(CTabHandle ctab) -> None"},
5459 {"GetMovieColorTable", (PyCFunction)MovieObj_GetMovieColorTable, 1,
5460 "() -> (CTabHandle ctab)"},
5461 {"FlattenMovie", (PyCFunction)MovieObj_FlattenMovie, 1,
5462 "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, Str255 resName) -> (short resId)"},
5463 {"FlattenMovieData", (PyCFunction)MovieObj_FlattenMovieData, 1,
5464 "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (Movie _rv)"},
5465 {"MovieSearchText", (PyCFunction)MovieObj_MovieSearchText, 1,
5466 "(Ptr text, long size, long searchFlags) -> (Track searchTrack, TimeValue searchTime, long searchOffset)"},
5467 {"GetPosterBox", (PyCFunction)MovieObj_GetPosterBox, 1,
5468 "() -> (Rect boxRect)"},
5469 {"SetPosterBox", (PyCFunction)MovieObj_SetPosterBox, 1,
5470 "(Rect boxRect) -> None"},
5471 {"GetMovieSegmentDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieSegmentDisplayBoundsRgn, 1,
5472 "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
5473 {"GetMovieStatus", (PyCFunction)MovieObj_GetMovieStatus, 1,
5474 "() -> (ComponentResult _rv, Track firstProblemTrack)"},
5475 {"NewMovieController", (PyCFunction)MovieObj_NewMovieController, 1,
Jack Jansen9cfea101995-12-09 14:05:56 +00005476 "(Rect movieRect, long someFlags) -> (MovieController _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00005477 {"PutMovieOnScrap", (PyCFunction)MovieObj_PutMovieOnScrap, 1,
5478 "(long movieScrapFlags) -> None"},
5479 {"SetMoviePlayHints", (PyCFunction)MovieObj_SetMoviePlayHints, 1,
5480 "(long flags, long flagsMask) -> None"},
5481 {NULL, NULL, 0}
5482};
5483
5484PyMethodChain MovieObj_chain = { MovieObj_methods, NULL };
5485
5486static PyObject *MovieObj_getattr(self, name)
5487 MovieObject *self;
5488 char *name;
5489{
5490 return Py_FindMethodInChain(&MovieObj_chain, (PyObject *)self, name);
5491}
5492
5493#define MovieObj_setattr NULL
5494
5495PyTypeObject Movie_Type = {
5496 PyObject_HEAD_INIT(&PyType_Type)
5497 0, /*ob_size*/
5498 "Movie", /*tp_name*/
5499 sizeof(MovieObject), /*tp_basicsize*/
5500 0, /*tp_itemsize*/
5501 /* methods */
5502 (destructor) MovieObj_dealloc, /*tp_dealloc*/
5503 0, /*tp_print*/
5504 (getattrfunc) MovieObj_getattr, /*tp_getattr*/
5505 (setattrfunc) MovieObj_setattr, /*tp_setattr*/
5506};
5507
5508/* --------------------- End object type Movie ---------------------- */
5509
5510
5511static PyObject *Qt_EnterMovies(_self, _args)
5512 PyObject *_self;
5513 PyObject *_args;
5514{
5515 PyObject *_res = NULL;
5516 OSErr _err;
5517 if (!PyArg_ParseTuple(_args, ""))
5518 return NULL;
5519 _err = EnterMovies();
5520 if (_err != noErr) return PyMac_Error(_err);
5521 Py_INCREF(Py_None);
5522 _res = Py_None;
5523 return _res;
5524}
5525
5526static PyObject *Qt_ExitMovies(_self, _args)
5527 PyObject *_self;
5528 PyObject *_args;
5529{
5530 PyObject *_res = NULL;
5531 if (!PyArg_ParseTuple(_args, ""))
5532 return NULL;
5533 ExitMovies();
5534 Py_INCREF(Py_None);
5535 _res = Py_None;
5536 return _res;
5537}
5538
5539static PyObject *Qt_GetMoviesError(_self, _args)
5540 PyObject *_self;
5541 PyObject *_args;
5542{
5543 PyObject *_res = NULL;
5544 OSErr _err;
5545 if (!PyArg_ParseTuple(_args, ""))
5546 return NULL;
5547 _err = GetMoviesError();
5548 if (_err != noErr) return PyMac_Error(_err);
5549 Py_INCREF(Py_None);
5550 _res = Py_None;
5551 return _res;
5552}
5553
5554static PyObject *Qt_ClearMoviesStickyError(_self, _args)
5555 PyObject *_self;
5556 PyObject *_args;
5557{
5558 PyObject *_res = NULL;
5559 if (!PyArg_ParseTuple(_args, ""))
5560 return NULL;
5561 ClearMoviesStickyError();
5562 Py_INCREF(Py_None);
5563 _res = Py_None;
5564 return _res;
5565}
5566
5567static PyObject *Qt_GetMoviesStickyError(_self, _args)
5568 PyObject *_self;
5569 PyObject *_args;
5570{
5571 PyObject *_res = NULL;
5572 OSErr _err;
5573 if (!PyArg_ParseTuple(_args, ""))
5574 return NULL;
5575 _err = GetMoviesStickyError();
5576 if (_err != noErr) return PyMac_Error(_err);
5577 Py_INCREF(Py_None);
5578 _res = Py_None;
5579 return _res;
5580}
5581
5582static PyObject *Qt_DisposeMatte(_self, _args)
5583 PyObject *_self;
5584 PyObject *_args;
5585{
5586 PyObject *_res = NULL;
5587 PixMapHandle theMatte;
5588 if (!PyArg_ParseTuple(_args, "O&",
5589 ResObj_Convert, &theMatte))
5590 return NULL;
5591 DisposeMatte(theMatte);
5592 Py_INCREF(Py_None);
5593 _res = Py_None;
5594 return _res;
5595}
5596
5597static PyObject *Qt_NewMovie(_self, _args)
5598 PyObject *_self;
5599 PyObject *_args;
5600{
5601 PyObject *_res = NULL;
5602 Movie _rv;
5603 long flags;
5604 if (!PyArg_ParseTuple(_args, "l",
5605 &flags))
5606 return NULL;
5607 _rv = NewMovie(flags);
5608 _res = Py_BuildValue("O&",
5609 MovieObj_New, _rv);
5610 return _res;
5611}
5612
5613static PyObject *Qt_GetDataHandler(_self, _args)
5614 PyObject *_self;
5615 PyObject *_args;
5616{
5617 PyObject *_res = NULL;
5618 Component _rv;
5619 Handle dataRef;
5620 OSType dataHandlerSubType;
5621 long flags;
5622 if (!PyArg_ParseTuple(_args, "O&O&l",
5623 ResObj_Convert, &dataRef,
5624 PyMac_GetOSType, &dataHandlerSubType,
5625 &flags))
5626 return NULL;
5627 _rv = GetDataHandler(dataRef,
5628 dataHandlerSubType,
5629 flags);
5630 _res = Py_BuildValue("O&",
5631 CmpObj_New, _rv);
5632 return _res;
5633}
5634
5635static PyObject *Qt_PasteHandleIntoMovie(_self, _args)
5636 PyObject *_self;
5637 PyObject *_args;
5638{
5639 PyObject *_res = NULL;
5640 OSErr _err;
5641 Handle h;
5642 OSType handleType;
5643 Movie theMovie;
5644 long flags;
5645 ComponentInstance userComp;
5646 if (!PyArg_ParseTuple(_args, "O&O&O&lO&",
5647 ResObj_Convert, &h,
5648 PyMac_GetOSType, &handleType,
5649 MovieObj_Convert, &theMovie,
5650 &flags,
5651 CmpInstObj_Convert, &userComp))
5652 return NULL;
5653 _err = PasteHandleIntoMovie(h,
5654 handleType,
5655 theMovie,
5656 flags,
5657 userComp);
5658 if (_err != noErr) return PyMac_Error(_err);
5659 Py_INCREF(Py_None);
5660 _res = Py_None;
5661 return _res;
5662}
5663
5664static PyObject *Qt_TrackTimeToMediaTime(_self, _args)
5665 PyObject *_self;
5666 PyObject *_args;
5667{
5668 PyObject *_res = NULL;
5669 TimeValue _rv;
5670 TimeValue value;
5671 Track theTrack;
5672 if (!PyArg_ParseTuple(_args, "lO&",
5673 &value,
5674 TrackObj_Convert, &theTrack))
5675 return NULL;
5676 _rv = TrackTimeToMediaTime(value,
5677 theTrack);
5678 _res = Py_BuildValue("l",
5679 _rv);
5680 return _res;
5681}
5682
5683static PyObject *Qt_NewUserData(_self, _args)
5684 PyObject *_self;
5685 PyObject *_args;
5686{
5687 PyObject *_res = NULL;
5688 OSErr _err;
5689 UserData theUserData;
5690 if (!PyArg_ParseTuple(_args, ""))
5691 return NULL;
5692 _err = NewUserData(&theUserData);
5693 if (_err != noErr) return PyMac_Error(_err);
5694 _res = Py_BuildValue("O&",
5695 UserDataObj_New, theUserData);
5696 return _res;
5697}
5698
5699static PyObject *Qt_NewUserDataFromHandle(_self, _args)
5700 PyObject *_self;
5701 PyObject *_args;
5702{
5703 PyObject *_res = NULL;
5704 OSErr _err;
5705 Handle h;
5706 UserData theUserData;
5707 if (!PyArg_ParseTuple(_args, "O&",
5708 ResObj_Convert, &h))
5709 return NULL;
5710 _err = NewUserDataFromHandle(h,
5711 &theUserData);
5712 if (_err != noErr) return PyMac_Error(_err);
5713 _res = Py_BuildValue("O&",
5714 UserDataObj_New, theUserData);
5715 return _res;
5716}
5717
5718static PyObject *Qt_CreateMovieFile(_self, _args)
5719 PyObject *_self;
5720 PyObject *_args;
5721{
5722 PyObject *_res = NULL;
5723 OSErr _err;
5724 FSSpec fileSpec;
5725 OSType creator;
5726 ScriptCode scriptTag;
5727 long createMovieFileFlags;
5728 short resRefNum;
5729 Movie newmovie;
5730 if (!PyArg_ParseTuple(_args, "O&O&hl",
5731 PyMac_GetFSSpec, &fileSpec,
5732 PyMac_GetOSType, &creator,
5733 &scriptTag,
5734 &createMovieFileFlags))
5735 return NULL;
5736 _err = CreateMovieFile(&fileSpec,
5737 creator,
5738 scriptTag,
5739 createMovieFileFlags,
5740 &resRefNum,
5741 &newmovie);
5742 if (_err != noErr) return PyMac_Error(_err);
5743 _res = Py_BuildValue("hO&",
5744 resRefNum,
5745 MovieObj_New, newmovie);
5746 return _res;
5747}
5748
5749static PyObject *Qt_OpenMovieFile(_self, _args)
5750 PyObject *_self;
5751 PyObject *_args;
5752{
5753 PyObject *_res = NULL;
5754 OSErr _err;
5755 FSSpec fileSpec;
5756 short resRefNum;
5757 SInt8 permission;
5758 if (!PyArg_ParseTuple(_args, "O&b",
5759 PyMac_GetFSSpec, &fileSpec,
5760 &permission))
5761 return NULL;
5762 _err = OpenMovieFile(&fileSpec,
5763 &resRefNum,
5764 permission);
5765 if (_err != noErr) return PyMac_Error(_err);
5766 _res = Py_BuildValue("h",
5767 resRefNum);
5768 return _res;
5769}
5770
5771static PyObject *Qt_CloseMovieFile(_self, _args)
5772 PyObject *_self;
5773 PyObject *_args;
5774{
5775 PyObject *_res = NULL;
5776 OSErr _err;
5777 short resRefNum;
5778 if (!PyArg_ParseTuple(_args, "h",
5779 &resRefNum))
5780 return NULL;
5781 _err = CloseMovieFile(resRefNum);
5782 if (_err != noErr) return PyMac_Error(_err);
5783 Py_INCREF(Py_None);
5784 _res = Py_None;
5785 return _res;
5786}
5787
5788static PyObject *Qt_DeleteMovieFile(_self, _args)
5789 PyObject *_self;
5790 PyObject *_args;
5791{
5792 PyObject *_res = NULL;
5793 OSErr _err;
5794 FSSpec fileSpec;
5795 if (!PyArg_ParseTuple(_args, "O&",
5796 PyMac_GetFSSpec, &fileSpec))
5797 return NULL;
5798 _err = DeleteMovieFile(&fileSpec);
5799 if (_err != noErr) return PyMac_Error(_err);
5800 Py_INCREF(Py_None);
5801 _res = Py_None;
5802 return _res;
5803}
5804
5805static PyObject *Qt_NewMovieFromFile(_self, _args)
5806 PyObject *_self;
5807 PyObject *_args;
5808{
5809 PyObject *_res = NULL;
5810 OSErr _err;
5811 Movie theMovie;
5812 short resRefNum;
Jack Jansene0cf87b1997-04-09 15:53:46 +00005813 short resId;
Jack Jansen453ced51995-11-30 17:42:08 +00005814 short newMovieFlags;
5815 Boolean dataRefWasChanged;
Jack Jansene0cf87b1997-04-09 15:53:46 +00005816 if (!PyArg_ParseTuple(_args, "hhh",
Jack Jansen453ced51995-11-30 17:42:08 +00005817 &resRefNum,
Jack Jansene0cf87b1997-04-09 15:53:46 +00005818 &resId,
Jack Jansen453ced51995-11-30 17:42:08 +00005819 &newMovieFlags))
5820 return NULL;
5821 _err = NewMovieFromFile(&theMovie,
5822 resRefNum,
Jack Jansene0cf87b1997-04-09 15:53:46 +00005823 &resId,
Jack Jansen9cfea101995-12-09 14:05:56 +00005824 (StringPtr)0,
Jack Jansen453ced51995-11-30 17:42:08 +00005825 newMovieFlags,
5826 &dataRefWasChanged);
5827 if (_err != noErr) return PyMac_Error(_err);
Jack Jansene0cf87b1997-04-09 15:53:46 +00005828 _res = Py_BuildValue("O&hb",
Jack Jansen453ced51995-11-30 17:42:08 +00005829 MovieObj_New, theMovie,
Jack Jansene0cf87b1997-04-09 15:53:46 +00005830 resId,
Jack Jansen453ced51995-11-30 17:42:08 +00005831 dataRefWasChanged);
5832 return _res;
5833}
5834
5835static PyObject *Qt_NewMovieFromHandle(_self, _args)
5836 PyObject *_self;
5837 PyObject *_args;
5838{
5839 PyObject *_res = NULL;
5840 OSErr _err;
5841 Movie theMovie;
5842 Handle h;
5843 short newMovieFlags;
5844 Boolean dataRefWasChanged;
5845 if (!PyArg_ParseTuple(_args, "O&h",
5846 ResObj_Convert, &h,
5847 &newMovieFlags))
5848 return NULL;
5849 _err = NewMovieFromHandle(&theMovie,
5850 h,
5851 newMovieFlags,
5852 &dataRefWasChanged);
5853 if (_err != noErr) return PyMac_Error(_err);
5854 _res = Py_BuildValue("O&b",
5855 MovieObj_New, theMovie,
5856 dataRefWasChanged);
5857 return _res;
5858}
5859
5860static PyObject *Qt_NewMovieFromDataFork(_self, _args)
5861 PyObject *_self;
5862 PyObject *_args;
5863{
5864 PyObject *_res = NULL;
5865 OSErr _err;
5866 Movie theMovie;
5867 short fRefNum;
5868 long fileOffset;
5869 short newMovieFlags;
5870 Boolean dataRefWasChanged;
5871 if (!PyArg_ParseTuple(_args, "hlh",
5872 &fRefNum,
5873 &fileOffset,
5874 &newMovieFlags))
5875 return NULL;
5876 _err = NewMovieFromDataFork(&theMovie,
5877 fRefNum,
5878 fileOffset,
5879 newMovieFlags,
5880 &dataRefWasChanged);
5881 if (_err != noErr) return PyMac_Error(_err);
5882 _res = Py_BuildValue("O&b",
5883 MovieObj_New, theMovie,
5884 dataRefWasChanged);
5885 return _res;
5886}
5887
5888static PyObject *Qt_RemoveMovieResource(_self, _args)
5889 PyObject *_self;
5890 PyObject *_args;
5891{
5892 PyObject *_res = NULL;
5893 OSErr _err;
5894 short resRefNum;
5895 short resId;
5896 if (!PyArg_ParseTuple(_args, "hh",
5897 &resRefNum,
5898 &resId))
5899 return NULL;
5900 _err = RemoveMovieResource(resRefNum,
5901 resId);
5902 if (_err != noErr) return PyMac_Error(_err);
5903 Py_INCREF(Py_None);
5904 _res = Py_None;
5905 return _res;
5906}
5907
Jack Jansen453ced51995-11-30 17:42:08 +00005908static PyObject *Qt_NewMovieFromScrap(_self, _args)
5909 PyObject *_self;
5910 PyObject *_args;
5911{
5912 PyObject *_res = NULL;
5913 Movie _rv;
5914 long newMovieFlags;
5915 if (!PyArg_ParseTuple(_args, "l",
5916 &newMovieFlags))
5917 return NULL;
5918 _rv = NewMovieFromScrap(newMovieFlags);
5919 _res = Py_BuildValue("O&",
5920 MovieObj_New, _rv);
5921 return _res;
5922}
5923
Jack Jansen453ced51995-11-30 17:42:08 +00005924static PyObject *Qt_NewTimeBase(_self, _args)
5925 PyObject *_self;
5926 PyObject *_args;
5927{
5928 PyObject *_res = NULL;
5929 TimeBase _rv;
5930 if (!PyArg_ParseTuple(_args, ""))
5931 return NULL;
5932 _rv = NewTimeBase();
5933 _res = Py_BuildValue("O&",
5934 TimeBaseObj_New, _rv);
5935 return _res;
5936}
5937
Jack Jansen9cfea101995-12-09 14:05:56 +00005938static PyObject *Qt_AlignWindow(_self, _args)
5939 PyObject *_self;
5940 PyObject *_args;
5941{
5942 PyObject *_res = NULL;
5943 WindowPtr wp;
5944 Boolean front;
5945 if (!PyArg_ParseTuple(_args, "O&b",
5946 WinObj_Convert, &wp,
5947 &front))
5948 return NULL;
5949 AlignWindow(wp,
5950 front,
5951 (Rect *)0,
5952 (ICMAlignmentProcRecordPtr)0);
5953 Py_INCREF(Py_None);
5954 _res = Py_None;
5955 return _res;
5956}
5957
5958static PyObject *Qt_DragAlignedWindow(_self, _args)
5959 PyObject *_self;
5960 PyObject *_args;
5961{
5962 PyObject *_res = NULL;
5963 WindowPtr wp;
5964 Point startPt;
5965 Rect boundsRect;
5966 if (!PyArg_ParseTuple(_args, "O&O&O&",
5967 WinObj_Convert, &wp,
5968 PyMac_GetPoint, &startPt,
5969 PyMac_GetRect, &boundsRect))
5970 return NULL;
5971 DragAlignedWindow(wp,
5972 startPt,
5973 &boundsRect,
5974 (Rect *)0,
5975 (ICMAlignmentProcRecordPtr)0);
5976 Py_INCREF(Py_None);
5977 _res = Py_None;
5978 return _res;
5979}
5980
Jack Jansen453ced51995-11-30 17:42:08 +00005981static PyMethodDef Qt_methods[] = {
5982 {"EnterMovies", (PyCFunction)Qt_EnterMovies, 1,
5983 "() -> None"},
5984 {"ExitMovies", (PyCFunction)Qt_ExitMovies, 1,
5985 "() -> None"},
5986 {"GetMoviesError", (PyCFunction)Qt_GetMoviesError, 1,
5987 "() -> None"},
5988 {"ClearMoviesStickyError", (PyCFunction)Qt_ClearMoviesStickyError, 1,
5989 "() -> None"},
5990 {"GetMoviesStickyError", (PyCFunction)Qt_GetMoviesStickyError, 1,
5991 "() -> None"},
5992 {"DisposeMatte", (PyCFunction)Qt_DisposeMatte, 1,
5993 "(PixMapHandle theMatte) -> None"},
5994 {"NewMovie", (PyCFunction)Qt_NewMovie, 1,
5995 "(long flags) -> (Movie _rv)"},
5996 {"GetDataHandler", (PyCFunction)Qt_GetDataHandler, 1,
5997 "(Handle dataRef, OSType dataHandlerSubType, long flags) -> (Component _rv)"},
5998 {"PasteHandleIntoMovie", (PyCFunction)Qt_PasteHandleIntoMovie, 1,
5999 "(Handle h, OSType handleType, Movie theMovie, long flags, ComponentInstance userComp) -> None"},
6000 {"TrackTimeToMediaTime", (PyCFunction)Qt_TrackTimeToMediaTime, 1,
6001 "(TimeValue value, Track theTrack) -> (TimeValue _rv)"},
6002 {"NewUserData", (PyCFunction)Qt_NewUserData, 1,
6003 "() -> (UserData theUserData)"},
6004 {"NewUserDataFromHandle", (PyCFunction)Qt_NewUserDataFromHandle, 1,
6005 "(Handle h) -> (UserData theUserData)"},
6006 {"CreateMovieFile", (PyCFunction)Qt_CreateMovieFile, 1,
6007 "(FSSpec fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (short resRefNum, Movie newmovie)"},
6008 {"OpenMovieFile", (PyCFunction)Qt_OpenMovieFile, 1,
6009 "(FSSpec fileSpec, SInt8 permission) -> (short resRefNum)"},
6010 {"CloseMovieFile", (PyCFunction)Qt_CloseMovieFile, 1,
6011 "(short resRefNum) -> None"},
6012 {"DeleteMovieFile", (PyCFunction)Qt_DeleteMovieFile, 1,
6013 "(FSSpec fileSpec) -> None"},
6014 {"NewMovieFromFile", (PyCFunction)Qt_NewMovieFromFile, 1,
Jack Jansene0cf87b1997-04-09 15:53:46 +00006015 "(short resRefNum, short resId, short newMovieFlags) -> (Movie theMovie, short resId, Boolean dataRefWasChanged)"},
Jack Jansen453ced51995-11-30 17:42:08 +00006016 {"NewMovieFromHandle", (PyCFunction)Qt_NewMovieFromHandle, 1,
6017 "(Handle h, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
6018 {"NewMovieFromDataFork", (PyCFunction)Qt_NewMovieFromDataFork, 1,
6019 "(short fRefNum, long fileOffset, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
6020 {"RemoveMovieResource", (PyCFunction)Qt_RemoveMovieResource, 1,
6021 "(short resRefNum, short resId) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00006022 {"NewMovieFromScrap", (PyCFunction)Qt_NewMovieFromScrap, 1,
6023 "(long newMovieFlags) -> (Movie _rv)"},
Jack Jansen453ced51995-11-30 17:42:08 +00006024 {"NewTimeBase", (PyCFunction)Qt_NewTimeBase, 1,
6025 "() -> (TimeBase _rv)"},
Jack Jansen9cfea101995-12-09 14:05:56 +00006026 {"AlignWindow", (PyCFunction)Qt_AlignWindow, 1,
6027 "(WindowPtr wp, Boolean front) -> None"},
6028 {"DragAlignedWindow", (PyCFunction)Qt_DragAlignedWindow, 1,
6029 "(WindowPtr wp, Point startPt, Rect boundsRect) -> None"},
Jack Jansen453ced51995-11-30 17:42:08 +00006030 {NULL, NULL, 0}
6031};
6032
6033
6034
6035
6036void initQt()
6037{
6038 PyObject *m;
6039 PyObject *d;
6040
6041
6042
6043
6044 m = Py_InitModule("Qt", Qt_methods);
6045 d = PyModule_GetDict(m);
6046 Qt_Error = PyMac_GetOSErrException();
6047 if (Qt_Error == NULL ||
6048 PyDict_SetItemString(d, "Error", Qt_Error) != 0)
6049 Py_FatalError("can't initialize Qt.Error");
6050}
6051
6052/* ========================= End module Qt ========================== */
6053