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