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