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