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