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