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