1995-11-30 13:42:08 -04:00
/* =========================== Module Qt ============================ */
# include "Python.h"
# include "macglue.h"
2000-07-14 19:16:45 -03:00
# include "pymactoolbox.h"
1995-11-30 13:42:08 -04:00
2001-05-22 18:56:42 -03:00
# ifdef WITHOUT_FRAMEWORKS
1995-11-30 13:42:08 -04:00
# include <Movies.h>
2001-05-22 18:56:42 -03:00
# else
/* #include <Carbon/Carbon.h> */
# include <QuickTime/QuickTime.h>
# endif
1995-11-30 13:42:08 -04:00
2001-05-17 18:58:34 -03:00
# ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject * _TrackObj_New ( Track ) ;
extern int _TrackObj_Convert ( PyObject * , Track * ) ;
extern PyObject * _MovieObj_New ( Movie ) ;
extern int _MovieObj_Convert ( PyObject * , Movie * ) ;
extern PyObject * _MovieCtlObj_New ( MovieController ) ;
extern int _MovieCtlObj_Convert ( PyObject * , MovieController * ) ;
extern PyObject * _TimeBaseObj_New ( TimeBase ) ;
extern int _TimeBaseObj_Convert ( PyObject * , TimeBase * ) ;
extern PyObject * _UserDataObj_New ( UserData ) ;
extern int _UserDataObj_Convert ( PyObject * , UserData * ) ;
extern PyObject * _MediaObj_New ( Media ) ;
extern int _MediaObj_Convert ( PyObject * , Media * ) ;
# define TrackObj_New _TrackObj_New
# define TrackObj_Convert _TrackObj_Convert
# define MovieObj_New _MovieObj_New
# define MovieObj_Convert _MovieObj_Convert
# define MovieCtlObj_New _MovieCtlObj_New
# define MovieCtlObj_Convert _MovieCtlObj_Convert
# define TimeBaseObj_New _TimeBaseObj_New
# define TimeBaseObj_Convert _TimeBaseObj_Convert
# define UserDataObj_New _UserDataObj_New
# define UserDataObj_Convert _UserDataObj_Convert
# define MediaObj_New _MediaObj_New
# define MediaObj_Convert _MediaObj_Convert
# endif
1998-04-23 10:22:44 -03:00
2000-03-17 12:49:59 -04:00
/* Macro to allow us to GetNextInterestingTime without duration */
# define GetMediaNextInterestingTimeOnly(media, flags, time, rate, rv) GetMediaNextInterestingTime(media, flags, time, rate, rv, NULL)
1998-04-23 10:22:44 -03:00
/*
* * Parse / generate time records
*/
static PyObject *
2001-05-22 18:56:42 -03:00
QtTimeRecord_New ( TimeRecord * itself )
1998-04-23 10:22:44 -03:00
{
2000-03-06 12:34:49 -04:00
if ( itself - > base )
return Py_BuildValue ( " O&lO& " , PyMac_Buildwide , & itself - > value , itself - > scale ,
1998-04-23 10:22:44 -03:00
TimeBaseObj_New , itself - > base ) ;
2000-03-06 12:34:49 -04:00
else
return Py_BuildValue ( " O&lO " , PyMac_Buildwide , & itself - > value , itself - > scale ,
Py_None ) ;
1998-04-23 10:22:44 -03:00
}
static int
2001-05-22 18:56:42 -03:00
QtTimeRecord_Convert ( PyObject * v , TimeRecord * p_itself )
1998-04-23 10:22:44 -03:00
{
2000-03-06 12:34:49 -04:00
PyObject * base = NULL ;
if ( ! PyArg_ParseTuple ( v , " O&l|O " , PyMac_Getwide , & p_itself - > value , & p_itself - > scale ,
& base ) )
1998-04-23 10:22:44 -03:00
return 0 ;
2000-03-06 12:34:49 -04:00
if ( base = = NULL | | base = = Py_None )
p_itself - > base = NULL ;
else
if ( ! TimeBaseObj_Convert ( base , & p_itself - > base ) )
return 0 ;
1998-04-23 10:22:44 -03:00
return 1 ;
}
1995-11-30 13:42:08 -04:00
static PyObject * Qt_Error ;
1995-12-09 10:05:56 -04:00
/* ------------------ Object type MovieController ------------------- */
1995-11-30 13:42:08 -04:00
1995-12-09 10:05:56 -04:00
PyTypeObject MovieController_Type ;
1995-11-30 13:42:08 -04:00
1995-12-09 10:05:56 -04:00
# define MovieCtlObj_Check(x) ((x)->ob_type == &MovieController_Type)
1995-11-30 13:42:08 -04:00
1995-12-09 10:05:56 -04:00
typedef struct MovieControllerObject {
1995-11-30 13:42:08 -04:00
PyObject_HEAD
1995-12-09 10:05:56 -04:00
MovieController ob_itself ;
} MovieControllerObject ;
1995-11-30 13:42:08 -04:00
2001-05-22 18:56:42 -03:00
PyObject * MovieCtlObj_New ( MovieController itself )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
MovieControllerObject * it ;
1995-11-30 13:42:08 -04:00
if ( itself = = NULL ) {
1995-12-09 10:05:56 -04:00
PyErr_SetString ( Qt_Error , " Cannot create null MovieController " ) ;
1995-11-30 13:42:08 -04:00
return NULL ;
}
1995-12-09 10:05:56 -04:00
it = PyObject_NEW ( MovieControllerObject , & MovieController_Type ) ;
1995-11-30 13:42:08 -04:00
if ( it = = NULL ) return NULL ;
it - > ob_itself = itself ;
return ( PyObject * ) it ;
}
2001-05-22 18:56:42 -03:00
MovieCtlObj_Convert ( PyObject * v , MovieController * p_itself )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
if ( ! MovieCtlObj_Check ( v ) )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
PyErr_SetString ( PyExc_TypeError , " MovieController required " ) ;
1995-11-30 13:42:08 -04:00
return 0 ;
}
1995-12-09 10:05:56 -04:00
* p_itself = ( ( MovieControllerObject * ) v ) - > ob_itself ;
1995-11-30 13:42:08 -04:00
return 1 ;
}
2001-05-22 18:56:42 -03:00
static void MovieCtlObj_dealloc ( MovieControllerObject * self )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
DisposeMovieController ( self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
PyMem_DEL ( self ) ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCSetMovie ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
Movie theMovie ;
WindowPtr movieWindow ;
Point where ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
MovieObj_Convert , & theMovie ,
WinObj_Convert , & movieWindow ,
PyMac_GetPoint , & where ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCSetMovie ( _self - > ob_itself ,
theMovie ,
movieWindow ,
where ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCGetIndMovie ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Movie _rv ;
short index ;
if ( ! PyArg_ParseTuple ( _args , " h " ,
& index ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCGetIndMovie ( _self - > ob_itself ,
index ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
MovieObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCRemoveAllMovies ( MovieControllerObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = MCRemoveAllMovies ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCRemoveAMovie ( MovieControllerObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
Movie m ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
MovieObj_Convert , & m ) )
return NULL ;
_rv = MCRemoveAMovie ( _self - > ob_itself ,
m ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCRemoveMovie ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCRemoveMovie ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCIsPlayerEvent ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
EventRecord e ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetEventRecord , & e ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCIsPlayerEvent ( _self - > ob_itself ,
& e ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCDoAction ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
short action ;
void * params ;
if ( ! PyArg_ParseTuple ( _args , " hs " ,
& action ,
& params ) )
return NULL ;
_rv = MCDoAction ( _self - > ob_itself ,
action ,
params ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCSetControllerAttached ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
Boolean attach ;
if ( ! PyArg_ParseTuple ( _args , " b " ,
& attach ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCSetControllerAttached ( _self - > ob_itself ,
attach ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCIsControllerAttached ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCIsControllerAttached ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCSetControllerPort ( MovieControllerObject * _self , PyObject * _args )
1997-04-09 12:53:46 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
CGrafPtr gp ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
GrafObj_Convert , & gp ) )
return NULL ;
_rv = MCSetControllerPort ( _self - > ob_itself ,
gp ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCGetControllerPort ( MovieControllerObject * _self , PyObject * _args )
1997-04-09 12:53:46 -03:00
{
PyObject * _res = NULL ;
CGrafPtr _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = MCGetControllerPort ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
GrafObj_New , _rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCSetVisible ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
Boolean visible ;
if ( ! PyArg_ParseTuple ( _args , " b " ,
& visible ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCSetVisible ( _self - > ob_itself ,
visible ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCGetVisible ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
PyObject * _res = NULL ;
ComponentResult _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = MCGetVisible ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
1995-11-30 13:42:08 -04:00
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCGetControllerBoundsRect ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
PyObject * _res = NULL ;
ComponentResult _rv ;
Rect bounds ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = MCGetControllerBoundsRect ( _self - > ob_itself ,
& bounds ) ;
_res = Py_BuildValue ( " lO& " ,
_rv ,
PyMac_BuildRect , & bounds ) ;
return _res ;
1995-11-30 13:42:08 -04:00
}
1995-12-09 10:05:56 -04:00
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCSetControllerBoundsRect ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
PyObject * _res = NULL ;
ComponentResult _rv ;
Rect bounds ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & bounds ) )
return NULL ;
_rv = MCSetControllerBoundsRect ( _self - > ob_itself ,
& bounds ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
1995-11-30 13:42:08 -04:00
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCGetControllerBoundsRgn ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
PyObject * _res = NULL ;
RgnHandle _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = MCGetControllerBoundsRgn ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
1995-11-30 13:42:08 -04:00
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCGetWindowRgn ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
RgnHandle _rv ;
WindowPtr w ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
WinObj_Convert , & w ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCGetWindowRgn ( _self - > ob_itself ,
w ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCMovieChanged ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
Movie m ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
MovieObj_Convert , & m ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCMovieChanged ( _self - > ob_itself ,
m ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCSetDuration ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
TimeValue duration ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& duration ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCSetDuration ( _self - > ob_itself ,
duration ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCGetCurrentTime ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue _rv ;
TimeScale scale ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCGetCurrentTime ( _self - > ob_itself ,
& scale ) ;
_res = Py_BuildValue ( " ll " ,
_rv ,
scale ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCNewAttachedController ( MovieControllerObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
Movie theMovie ;
WindowPtr w ;
Point where ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
MovieObj_Convert , & theMovie ,
WinObj_Convert , & w ,
PyMac_GetPoint , & where ) )
return NULL ;
_rv = MCNewAttachedController ( _self - > ob_itself ,
theMovie ,
w ,
where ) ;
_res = Py_BuildValue ( " l " ,
1995-11-30 13:42:08 -04:00
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCDraw ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
WindowPtr w ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
1995-12-09 10:05:56 -04:00
WinObj_Convert , & w ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCDraw ( _self - > ob_itself ,
w ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCActivate ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
WindowPtr w ;
Boolean activate ;
if ( ! PyArg_ParseTuple ( _args , " O&b " ,
WinObj_Convert , & w ,
& activate ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCActivate ( _self - > ob_itself ,
w ,
activate ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCIdle ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCIdle ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCKey ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
SInt8 key ;
long modifiers ;
if ( ! PyArg_ParseTuple ( _args , " bl " ,
& key ,
& modifiers ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCKey ( _self - > ob_itself ,
key ,
modifiers ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCClick ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
WindowPtr w ;
Point where ;
long when ;
long modifiers ;
if ( ! PyArg_ParseTuple ( _args , " O&O&ll " ,
WinObj_Convert , & w ,
PyMac_GetPoint , & where ,
& when ,
& modifiers ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCClick ( _self - > ob_itself ,
w ,
where ,
when ,
modifiers ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCEnableEditing ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
PyObject * _res = NULL ;
ComponentResult _rv ;
Boolean enabled ;
if ( ! PyArg_ParseTuple ( _args , " b " ,
& enabled ) )
return NULL ;
_rv = MCEnableEditing ( _self - > ob_itself ,
enabled ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
1995-11-30 13:42:08 -04:00
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCIsEditingEnabled ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCIsEditingEnabled ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCCopy ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Movie _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCCopy ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
MovieObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCCut ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Movie _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCCut ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
MovieObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCPaste ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
Movie srcMovie ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
MovieObj_Convert , & srcMovie ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCPaste ( _self - > ob_itself ,
srcMovie ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCClear ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCClear ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCUndo ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCUndo ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
1995-11-30 13:42:08 -04:00
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCPositionController ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
Rect movieRect ;
Rect controllerRect ;
long someFlags ;
if ( ! PyArg_ParseTuple ( _args , " O&O&l " ,
PyMac_GetRect , & movieRect ,
PyMac_GetRect , & controllerRect ,
& someFlags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCPositionController ( _self - > ob_itself ,
& movieRect ,
& controllerRect ,
someFlags ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCGetControllerInfo ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
long someFlags ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCGetControllerInfo ( _self - > ob_itself ,
& someFlags ) ;
_res = Py_BuildValue ( " ll " ,
_rv ,
someFlags ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCSetClip ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
RgnHandle theClip ;
RgnHandle movieClip ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & theClip ,
ResObj_Convert , & movieClip ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCSetClip ( _self - > ob_itself ,
theClip ,
movieClip ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCGetClip ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
RgnHandle theClip ;
RgnHandle movieClip ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCGetClip ( _self - > ob_itself ,
& theClip ,
& movieClip ) ;
_res = Py_BuildValue ( " lO&O& " ,
_rv ,
ResObj_New , theClip ,
ResObj_New , movieClip ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCDrawBadge ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
RgnHandle movieRgn ;
RgnHandle badgeRgn ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & movieRgn ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCDrawBadge ( _self - > ob_itself ,
movieRgn ,
& badgeRgn ) ;
_res = Py_BuildValue ( " lO& " ,
_rv ,
ResObj_New , badgeRgn ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCSetUpEditMenu ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
long modifiers ;
MenuHandle mh ;
if ( ! PyArg_ParseTuple ( _args , " lO& " ,
& modifiers ,
MenuObj_Convert , & mh ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCSetUpEditMenu ( _self - > ob_itself ,
modifiers ,
mh ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCGetMenuString ( MovieControllerObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
long modifiers ;
short item ;
Str255 aString ;
if ( ! PyArg_ParseTuple ( _args , " lhO& " ,
& modifiers ,
& item ,
PyMac_GetStr255 , aString ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = MCGetMenuString ( _self - > ob_itself ,
modifiers ,
item ,
aString ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCPtInController ( MovieControllerObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
Point thePt ;
Boolean inController ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetPoint , & thePt ) )
return NULL ;
_rv = MCPtInController ( _self - > ob_itself ,
thePt ,
& inController ) ;
_res = Py_BuildValue ( " lb " ,
_rv ,
inController ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCInvalidate ( MovieControllerObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
WindowPtr w ;
RgnHandle invalidRgn ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
WinObj_Convert , & w ,
ResObj_Convert , & invalidRgn ) )
return NULL ;
_rv = MCInvalidate ( _self - > ob_itself ,
w ,
invalidRgn ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCAdjustCursor ( MovieControllerObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
WindowPtr w ;
Point where ;
long modifiers ;
if ( ! PyArg_ParseTuple ( _args , " O&O&l " ,
WinObj_Convert , & w ,
PyMac_GetPoint , & where ,
& modifiers ) )
return NULL ;
_rv = MCAdjustCursor ( _self - > ob_itself ,
w ,
where ,
modifiers ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_MCGetInterfaceElement ( MovieControllerObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MCInterfaceElement whichElement ;
void * element ;
if ( ! PyArg_ParseTuple ( _args , " ls " ,
& whichElement ,
& element ) )
return NULL ;
_rv = MCGetInterfaceElement ( _self - > ob_itself ,
whichElement ,
element ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
1995-12-09 10:05:56 -04:00
static PyMethodDef MovieCtlObj_methods [ ] = {
{ " MCSetMovie " , ( PyCFunction ) MovieCtlObj_MCSetMovie , 1 ,
" (Movie theMovie, WindowPtr movieWindow, Point where) -> (ComponentResult _rv) " } ,
{ " MCGetIndMovie " , ( PyCFunction ) MovieCtlObj_MCGetIndMovie , 1 ,
" (short index) -> (Movie _rv) " } ,
1998-04-21 12:23:55 -03:00
{ " MCRemoveAllMovies " , ( PyCFunction ) MovieCtlObj_MCRemoveAllMovies , 1 ,
" () -> (ComponentResult _rv) " } ,
{ " MCRemoveAMovie " , ( PyCFunction ) MovieCtlObj_MCRemoveAMovie , 1 ,
" (Movie m) -> (ComponentResult _rv) " } ,
1995-12-09 10:05:56 -04:00
{ " MCRemoveMovie " , ( PyCFunction ) MovieCtlObj_MCRemoveMovie , 1 ,
" () -> (ComponentResult _rv) " } ,
{ " MCIsPlayerEvent " , ( PyCFunction ) MovieCtlObj_MCIsPlayerEvent , 1 ,
" (EventRecord e) -> (ComponentResult _rv) " } ,
{ " MCDoAction " , ( PyCFunction ) MovieCtlObj_MCDoAction , 1 ,
" (short action, void * params) -> (ComponentResult _rv) " } ,
{ " MCSetControllerAttached " , ( PyCFunction ) MovieCtlObj_MCSetControllerAttached , 1 ,
" (Boolean attach) -> (ComponentResult _rv) " } ,
{ " MCIsControllerAttached " , ( PyCFunction ) MovieCtlObj_MCIsControllerAttached , 1 ,
" () -> (ComponentResult _rv) " } ,
1997-04-09 12:53:46 -03:00
{ " MCSetControllerPort " , ( PyCFunction ) MovieCtlObj_MCSetControllerPort , 1 ,
" (CGrafPtr gp) -> (ComponentResult _rv) " } ,
{ " MCGetControllerPort " , ( PyCFunction ) MovieCtlObj_MCGetControllerPort , 1 ,
" () -> (CGrafPtr _rv) " } ,
1995-12-09 10:05:56 -04:00
{ " MCSetVisible " , ( PyCFunction ) MovieCtlObj_MCSetVisible , 1 ,
" (Boolean visible) -> (ComponentResult _rv) " } ,
{ " MCGetVisible " , ( PyCFunction ) MovieCtlObj_MCGetVisible , 1 ,
" () -> (ComponentResult _rv) " } ,
{ " MCGetControllerBoundsRect " , ( PyCFunction ) MovieCtlObj_MCGetControllerBoundsRect , 1 ,
" () -> (ComponentResult _rv, Rect bounds) " } ,
{ " MCSetControllerBoundsRect " , ( PyCFunction ) MovieCtlObj_MCSetControllerBoundsRect , 1 ,
" (Rect bounds) -> (ComponentResult _rv) " } ,
{ " MCGetControllerBoundsRgn " , ( PyCFunction ) MovieCtlObj_MCGetControllerBoundsRgn , 1 ,
" () -> (RgnHandle _rv) " } ,
{ " MCGetWindowRgn " , ( PyCFunction ) MovieCtlObj_MCGetWindowRgn , 1 ,
" (WindowPtr w) -> (RgnHandle _rv) " } ,
{ " MCMovieChanged " , ( PyCFunction ) MovieCtlObj_MCMovieChanged , 1 ,
" (Movie m) -> (ComponentResult _rv) " } ,
{ " MCSetDuration " , ( PyCFunction ) MovieCtlObj_MCSetDuration , 1 ,
" (TimeValue duration) -> (ComponentResult _rv) " } ,
{ " MCGetCurrentTime " , ( PyCFunction ) MovieCtlObj_MCGetCurrentTime , 1 ,
" () -> (TimeValue _rv, TimeScale scale) " } ,
{ " MCNewAttachedController " , ( PyCFunction ) MovieCtlObj_MCNewAttachedController , 1 ,
" (Movie theMovie, WindowPtr w, Point where) -> (ComponentResult _rv) " } ,
{ " MCDraw " , ( PyCFunction ) MovieCtlObj_MCDraw , 1 ,
" (WindowPtr w) -> (ComponentResult _rv) " } ,
{ " MCActivate " , ( PyCFunction ) MovieCtlObj_MCActivate , 1 ,
" (WindowPtr w, Boolean activate) -> (ComponentResult _rv) " } ,
{ " MCIdle " , ( PyCFunction ) MovieCtlObj_MCIdle , 1 ,
" () -> (ComponentResult _rv) " } ,
{ " MCKey " , ( PyCFunction ) MovieCtlObj_MCKey , 1 ,
" (SInt8 key, long modifiers) -> (ComponentResult _rv) " } ,
{ " MCClick " , ( PyCFunction ) MovieCtlObj_MCClick , 1 ,
" (WindowPtr w, Point where, long when, long modifiers) -> (ComponentResult _rv) " } ,
{ " MCEnableEditing " , ( PyCFunction ) MovieCtlObj_MCEnableEditing , 1 ,
" (Boolean enabled) -> (ComponentResult _rv) " } ,
{ " MCIsEditingEnabled " , ( PyCFunction ) MovieCtlObj_MCIsEditingEnabled , 1 ,
" () -> (long _rv) " } ,
{ " MCCopy " , ( PyCFunction ) MovieCtlObj_MCCopy , 1 ,
" () -> (Movie _rv) " } ,
{ " MCCut " , ( PyCFunction ) MovieCtlObj_MCCut , 1 ,
" () -> (Movie _rv) " } ,
{ " MCPaste " , ( PyCFunction ) MovieCtlObj_MCPaste , 1 ,
" (Movie srcMovie) -> (ComponentResult _rv) " } ,
{ " MCClear " , ( PyCFunction ) MovieCtlObj_MCClear , 1 ,
" () -> (ComponentResult _rv) " } ,
{ " MCUndo " , ( PyCFunction ) MovieCtlObj_MCUndo , 1 ,
" () -> (ComponentResult _rv) " } ,
{ " MCPositionController " , ( PyCFunction ) MovieCtlObj_MCPositionController , 1 ,
" (Rect movieRect, Rect controllerRect, long someFlags) -> (ComponentResult _rv) " } ,
{ " MCGetControllerInfo " , ( PyCFunction ) MovieCtlObj_MCGetControllerInfo , 1 ,
" () -> (ComponentResult _rv, long someFlags) " } ,
{ " MCSetClip " , ( PyCFunction ) MovieCtlObj_MCSetClip , 1 ,
" (RgnHandle theClip, RgnHandle movieClip) -> (ComponentResult _rv) " } ,
{ " MCGetClip " , ( PyCFunction ) MovieCtlObj_MCGetClip , 1 ,
" () -> (ComponentResult _rv, RgnHandle theClip, RgnHandle movieClip) " } ,
{ " MCDrawBadge " , ( PyCFunction ) MovieCtlObj_MCDrawBadge , 1 ,
" (RgnHandle movieRgn) -> (ComponentResult _rv, RgnHandle badgeRgn) " } ,
{ " MCSetUpEditMenu " , ( PyCFunction ) MovieCtlObj_MCSetUpEditMenu , 1 ,
" (long modifiers, MenuHandle mh) -> (ComponentResult _rv) " } ,
{ " MCGetMenuString " , ( PyCFunction ) MovieCtlObj_MCGetMenuString , 1 ,
" (long modifiers, short item, Str255 aString) -> (ComponentResult _rv) " } ,
1998-04-21 12:23:55 -03:00
{ " MCPtInController " , ( PyCFunction ) MovieCtlObj_MCPtInController , 1 ,
" (Point thePt) -> (ComponentResult _rv, Boolean inController) " } ,
{ " MCInvalidate " , ( PyCFunction ) MovieCtlObj_MCInvalidate , 1 ,
" (WindowPtr w, RgnHandle invalidRgn) -> (ComponentResult _rv) " } ,
{ " MCAdjustCursor " , ( PyCFunction ) MovieCtlObj_MCAdjustCursor , 1 ,
" (WindowPtr w, Point where, long modifiers) -> (ComponentResult _rv) " } ,
{ " MCGetInterfaceElement " , ( PyCFunction ) MovieCtlObj_MCGetInterfaceElement , 1 ,
" (MCInterfaceElement whichElement, void * element) -> (ComponentResult _rv) " } ,
1995-12-09 10:05:56 -04:00
{ NULL , NULL , 0 }
} ;
PyMethodChain MovieCtlObj_chain = { MovieCtlObj_methods , NULL } ;
2001-05-22 18:56:42 -03:00
static PyObject * MovieCtlObj_getattr ( MovieControllerObject * self , char * name )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
return Py_FindMethodInChain ( & MovieCtlObj_chain , ( PyObject * ) self , name ) ;
1995-11-30 13:42:08 -04:00
}
1995-12-09 10:05:56 -04:00
# define MovieCtlObj_setattr NULL
1999-12-12 17:41:51 -04:00
# define MovieCtlObj_compare NULL
# define MovieCtlObj_repr NULL
# define MovieCtlObj_hash NULL
1995-12-09 10:05:56 -04:00
PyTypeObject MovieController_Type = {
PyObject_HEAD_INIT ( & PyType_Type )
0 , /*ob_size*/
" MovieController " , /*tp_name*/
sizeof ( MovieControllerObject ) , /*tp_basicsize*/
0 , /*tp_itemsize*/
/* methods */
( destructor ) MovieCtlObj_dealloc , /*tp_dealloc*/
0 , /*tp_print*/
( getattrfunc ) MovieCtlObj_getattr , /*tp_getattr*/
( setattrfunc ) MovieCtlObj_setattr , /*tp_setattr*/
1999-12-12 17:41:51 -04:00
( cmpfunc ) MovieCtlObj_compare , /*tp_compare*/
( reprfunc ) MovieCtlObj_repr , /*tp_repr*/
( PyNumberMethods * ) 0 , /* tp_as_number */
( PySequenceMethods * ) 0 , /* tp_as_sequence */
( PyMappingMethods * ) 0 , /* tp_as_mapping */
( hashfunc ) MovieCtlObj_hash , /*tp_hash*/
1995-12-09 10:05:56 -04:00
} ;
/* ---------------- End object type MovieController ----------------- */
/* ---------------------- Object type TimeBase ---------------------- */
PyTypeObject TimeBase_Type ;
# define TimeBaseObj_Check(x) ((x)->ob_type == &TimeBase_Type)
typedef struct TimeBaseObject {
PyObject_HEAD
TimeBase ob_itself ;
} TimeBaseObject ;
2001-05-22 18:56:42 -03:00
PyObject * TimeBaseObj_New ( TimeBase itself )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
TimeBaseObject * it ;
if ( itself = = NULL ) {
PyErr_SetString ( Qt_Error , " Cannot create null TimeBase " ) ;
return NULL ;
}
it = PyObject_NEW ( TimeBaseObject , & TimeBase_Type ) ;
if ( it = = NULL ) return NULL ;
it - > ob_itself = itself ;
return ( PyObject * ) it ;
}
2001-05-22 18:56:42 -03:00
TimeBaseObj_Convert ( PyObject * v , TimeBase * p_itself )
1995-12-09 10:05:56 -04:00
{
if ( ! TimeBaseObj_Check ( v ) )
{
PyErr_SetString ( PyExc_TypeError , " TimeBase required " ) ;
return 0 ;
}
* p_itself = ( ( TimeBaseObject * ) v ) - > ob_itself ;
return 1 ;
1995-11-30 13:42:08 -04:00
}
2001-05-22 18:56:42 -03:00
static void TimeBaseObj_dealloc ( TimeBaseObject * self )
1995-11-30 13:42:08 -04:00
{
1998-04-23 10:22:44 -03:00
/* Cleanup of self->ob_itself goes here */
1995-12-09 10:05:56 -04:00
PyMem_DEL ( self ) ;
1995-11-30 13:42:08 -04:00
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_DisposeTimeBase ( TimeBaseObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
DisposeTimeBase ( _self - > ob_itself ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_GetTimeBaseTime ( TimeBaseObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
TimeValue _rv ;
TimeScale s ;
TimeRecord tr ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& s ) )
return NULL ;
_rv = GetTimeBaseTime ( _self - > ob_itself ,
s ,
& tr ) ;
_res = Py_BuildValue ( " lO& " ,
_rv ,
QtTimeRecord_New , & tr ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_SetTimeBaseTime ( TimeBaseObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
TimeRecord tr ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
QtTimeRecord_Convert , & tr ) )
return NULL ;
SetTimeBaseTime ( _self - > ob_itself ,
& tr ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_SetTimeBaseValue ( TimeBaseObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue t ;
TimeScale s ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& t ,
& s ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetTimeBaseValue ( _self - > ob_itself ,
t ,
s ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_GetTimeBaseRate ( TimeBaseObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Fixed _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTimeBaseRate ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
PyMac_BuildFixed , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_SetTimeBaseRate ( TimeBaseObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Fixed r ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetFixed , & r ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetTimeBaseRate ( _self - > ob_itself ,
r ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_GetTimeBaseStartTime ( TimeBaseObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
TimeValue _rv ;
TimeScale s ;
TimeRecord tr ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& s ) )
return NULL ;
_rv = GetTimeBaseStartTime ( _self - > ob_itself ,
s ,
& tr ) ;
_res = Py_BuildValue ( " lO& " ,
_rv ,
QtTimeRecord_New , & tr ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_SetTimeBaseStartTime ( TimeBaseObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
TimeRecord tr ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
QtTimeRecord_Convert , & tr ) )
return NULL ;
SetTimeBaseStartTime ( _self - > ob_itself ,
& tr ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_GetTimeBaseStopTime ( TimeBaseObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
TimeValue _rv ;
TimeScale s ;
TimeRecord tr ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& s ) )
return NULL ;
_rv = GetTimeBaseStopTime ( _self - > ob_itself ,
s ,
& tr ) ;
_res = Py_BuildValue ( " lO& " ,
_rv ,
QtTimeRecord_New , & tr ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_SetTimeBaseStopTime ( TimeBaseObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
TimeRecord tr ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
QtTimeRecord_Convert , & tr ) )
return NULL ;
SetTimeBaseStopTime ( _self - > ob_itself ,
& tr ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_GetTimeBaseFlags ( TimeBaseObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
long _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTimeBaseFlags ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_SetTimeBaseFlags ( TimeBaseObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long timeBaseFlags ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& timeBaseFlags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetTimeBaseFlags ( _self - > ob_itself ,
timeBaseFlags ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_SetTimeBaseMasterTimeBase ( TimeBaseObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
TimeBase master ;
TimeRecord slaveZero ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
TimeBaseObj_Convert , & master ,
QtTimeRecord_Convert , & slaveZero ) )
return NULL ;
SetTimeBaseMasterTimeBase ( _self - > ob_itself ,
master ,
& slaveZero ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_GetTimeBaseMasterTimeBase ( TimeBaseObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeBase _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTimeBaseMasterTimeBase ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
TimeBaseObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_SetTimeBaseMasterClock ( TimeBaseObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
Component clockMeister ;
TimeRecord slaveZero ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
CmpObj_Convert , & clockMeister ,
QtTimeRecord_Convert , & slaveZero ) )
return NULL ;
SetTimeBaseMasterClock ( _self - > ob_itself ,
clockMeister ,
& slaveZero ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_GetTimeBaseMasterClock ( TimeBaseObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentInstance _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTimeBaseMasterClock ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
CmpInstObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_GetTimeBaseStatus ( TimeBaseObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
long _rv ;
TimeRecord unpinnedTime ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetTimeBaseStatus ( _self - > ob_itself ,
& unpinnedTime ) ;
_res = Py_BuildValue ( " lO& " ,
_rv ,
QtTimeRecord_New , & unpinnedTime ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_SetTimeBaseZero ( TimeBaseObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
TimeRecord zero ;
2000-03-03 13:06:13 -04:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
QtTimeRecord_Convert , & zero ) )
1998-04-23 10:22:44 -03:00
return NULL ;
SetTimeBaseZero ( _self - > ob_itself ,
& zero ) ;
2000-03-03 13:06:13 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1998-04-23 10:22:44 -03:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_GetTimeBaseEffectiveRate ( TimeBaseObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Fixed _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTimeBaseEffectiveRate ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildFixed , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
1995-12-09 10:05:56 -04:00
static PyMethodDef TimeBaseObj_methods [ ] = {
1998-04-23 10:22:44 -03:00
{ " DisposeTimeBase " , ( PyCFunction ) TimeBaseObj_DisposeTimeBase , 1 ,
" () -> None " } ,
{ " GetTimeBaseTime " , ( PyCFunction ) TimeBaseObj_GetTimeBaseTime , 1 ,
" (TimeScale s) -> (TimeValue _rv, TimeRecord tr) " } ,
{ " SetTimeBaseTime " , ( PyCFunction ) TimeBaseObj_SetTimeBaseTime , 1 ,
" (TimeRecord tr) -> None " } ,
1995-12-09 10:05:56 -04:00
{ " SetTimeBaseValue " , ( PyCFunction ) TimeBaseObj_SetTimeBaseValue , 1 ,
" (TimeValue t, TimeScale s) -> None " } ,
{ " GetTimeBaseRate " , ( PyCFunction ) TimeBaseObj_GetTimeBaseRate , 1 ,
" () -> (Fixed _rv) " } ,
{ " SetTimeBaseRate " , ( PyCFunction ) TimeBaseObj_SetTimeBaseRate , 1 ,
" (Fixed r) -> None " } ,
1998-04-23 10:22:44 -03:00
{ " GetTimeBaseStartTime " , ( PyCFunction ) TimeBaseObj_GetTimeBaseStartTime , 1 ,
" (TimeScale s) -> (TimeValue _rv, TimeRecord tr) " } ,
{ " SetTimeBaseStartTime " , ( PyCFunction ) TimeBaseObj_SetTimeBaseStartTime , 1 ,
" (TimeRecord tr) -> None " } ,
{ " GetTimeBaseStopTime " , ( PyCFunction ) TimeBaseObj_GetTimeBaseStopTime , 1 ,
" (TimeScale s) -> (TimeValue _rv, TimeRecord tr) " } ,
{ " SetTimeBaseStopTime " , ( PyCFunction ) TimeBaseObj_SetTimeBaseStopTime , 1 ,
" (TimeRecord tr) -> None " } ,
1995-12-09 10:05:56 -04:00
{ " GetTimeBaseFlags " , ( PyCFunction ) TimeBaseObj_GetTimeBaseFlags , 1 ,
" () -> (long _rv) " } ,
{ " SetTimeBaseFlags " , ( PyCFunction ) TimeBaseObj_SetTimeBaseFlags , 1 ,
" (long timeBaseFlags) -> None " } ,
1998-04-23 10:22:44 -03:00
{ " SetTimeBaseMasterTimeBase " , ( PyCFunction ) TimeBaseObj_SetTimeBaseMasterTimeBase , 1 ,
" (TimeBase master, TimeRecord slaveZero) -> None " } ,
1995-12-09 10:05:56 -04:00
{ " GetTimeBaseMasterTimeBase " , ( PyCFunction ) TimeBaseObj_GetTimeBaseMasterTimeBase , 1 ,
" () -> (TimeBase _rv) " } ,
1998-04-23 10:22:44 -03:00
{ " SetTimeBaseMasterClock " , ( PyCFunction ) TimeBaseObj_SetTimeBaseMasterClock , 1 ,
" (Component clockMeister, TimeRecord slaveZero) -> None " } ,
1995-12-09 10:05:56 -04:00
{ " GetTimeBaseMasterClock " , ( PyCFunction ) TimeBaseObj_GetTimeBaseMasterClock , 1 ,
" () -> (ComponentInstance _rv) " } ,
1998-04-23 10:22:44 -03:00
{ " GetTimeBaseStatus " , ( PyCFunction ) TimeBaseObj_GetTimeBaseStatus , 1 ,
" () -> (long _rv, TimeRecord unpinnedTime) " } ,
{ " SetTimeBaseZero " , ( PyCFunction ) TimeBaseObj_SetTimeBaseZero , 1 ,
2000-03-03 13:06:13 -04:00
" (TimeRecord zero) -> None " } ,
1995-12-09 10:05:56 -04:00
{ " GetTimeBaseEffectiveRate " , ( PyCFunction ) TimeBaseObj_GetTimeBaseEffectiveRate , 1 ,
" () -> (Fixed _rv) " } ,
{ NULL , NULL , 0 }
} ;
PyMethodChain TimeBaseObj_chain = { TimeBaseObj_methods , NULL } ;
2001-05-22 18:56:42 -03:00
static PyObject * TimeBaseObj_getattr ( TimeBaseObject * self , char * name )
1995-12-09 10:05:56 -04:00
{
return Py_FindMethodInChain ( & TimeBaseObj_chain , ( PyObject * ) self , name ) ;
1995-11-30 13:42:08 -04:00
}
1995-12-09 10:05:56 -04:00
# define TimeBaseObj_setattr NULL
1999-12-12 17:41:51 -04:00
# define TimeBaseObj_compare NULL
# define TimeBaseObj_repr NULL
# define TimeBaseObj_hash NULL
1995-12-09 10:05:56 -04:00
PyTypeObject TimeBase_Type = {
PyObject_HEAD_INIT ( & PyType_Type )
0 , /*ob_size*/
" TimeBase " , /*tp_name*/
sizeof ( TimeBaseObject ) , /*tp_basicsize*/
0 , /*tp_itemsize*/
/* methods */
( destructor ) TimeBaseObj_dealloc , /*tp_dealloc*/
0 , /*tp_print*/
( getattrfunc ) TimeBaseObj_getattr , /*tp_getattr*/
( setattrfunc ) TimeBaseObj_setattr , /*tp_setattr*/
1999-12-12 17:41:51 -04:00
( cmpfunc ) TimeBaseObj_compare , /*tp_compare*/
( reprfunc ) TimeBaseObj_repr , /*tp_repr*/
( PyNumberMethods * ) 0 , /* tp_as_number */
( PySequenceMethods * ) 0 , /* tp_as_sequence */
( PyMappingMethods * ) 0 , /* tp_as_mapping */
( hashfunc ) TimeBaseObj_hash , /*tp_hash*/
1995-12-09 10:05:56 -04:00
} ;
/* -------------------- End object type TimeBase -------------------- */
/* ---------------------- Object type UserData ---------------------- */
PyTypeObject UserData_Type ;
# define UserDataObj_Check(x) ((x)->ob_type == &UserData_Type)
typedef struct UserDataObject {
PyObject_HEAD
UserData ob_itself ;
} UserDataObject ;
2001-05-22 18:56:42 -03:00
PyObject * UserDataObj_New ( UserData itself )
1995-12-09 10:05:56 -04:00
{
UserDataObject * it ;
if ( itself = = NULL ) {
PyErr_SetString ( Qt_Error , " Cannot create null UserData " ) ;
return NULL ;
}
it = PyObject_NEW ( UserDataObject , & UserData_Type ) ;
if ( it = = NULL ) return NULL ;
it - > ob_itself = itself ;
return ( PyObject * ) it ;
}
2001-05-22 18:56:42 -03:00
UserDataObj_Convert ( PyObject * v , UserData * p_itself )
1995-12-09 10:05:56 -04:00
{
if ( ! UserDataObj_Check ( v ) )
{
PyErr_SetString ( PyExc_TypeError , " UserData required " ) ;
return 0 ;
}
* p_itself = ( ( UserDataObject * ) v ) - > ob_itself ;
return 1 ;
}
2001-05-22 18:56:42 -03:00
static void UserDataObj_dealloc ( UserDataObject * self )
1995-12-09 10:05:56 -04:00
{
DisposeUserData ( self - > ob_itself ) ;
PyMem_DEL ( self ) ;
}
2001-05-22 18:56:42 -03:00
static PyObject * UserDataObj_GetUserData ( UserDataObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
Handle data ;
OSType udType ;
long index ;
if ( ! PyArg_ParseTuple ( _args , " O&O&l " ,
ResObj_Convert , & data ,
PyMac_GetOSType , & udType ,
& index ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = GetUserData ( _self - > ob_itself ,
data ,
udType ,
index ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-12-09 10:05:56 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * UserDataObj_AddUserData ( UserDataObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
Handle data ;
OSType udType ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & data ,
PyMac_GetOSType , & udType ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = AddUserData ( _self - > ob_itself ,
data ,
udType ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-12-09 10:05:56 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * UserDataObj_RemoveUserData ( UserDataObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
OSType udType ;
long index ;
if ( ! PyArg_ParseTuple ( _args , " O&l " ,
PyMac_GetOSType , & udType ,
& index ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = RemoveUserData ( _self - > ob_itself ,
udType ,
index ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-12-09 10:05:56 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * UserDataObj_CountUserDataType ( UserDataObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short _rv ;
OSType udType ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetOSType , & udType ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = CountUserDataType ( _self - > ob_itself ,
udType ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * UserDataObj_GetNextUserDataType ( UserDataObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
long _rv ;
1995-12-09 10:05:56 -04:00
OSType udType ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetOSType , & udType ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetNextUserDataType ( _self - > ob_itself ,
udType ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * UserDataObj_AddUserDataText ( UserDataObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
Handle data ;
OSType udType ;
long index ;
short itlRegionTag ;
if ( ! PyArg_ParseTuple ( _args , " O&O&lh " ,
ResObj_Convert , & data ,
PyMac_GetOSType , & udType ,
& index ,
& itlRegionTag ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = AddUserDataText ( _self - > ob_itself ,
data ,
udType ,
1995-11-30 13:42:08 -04:00
index ,
1995-12-09 10:05:56 -04:00
itlRegionTag ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-12-09 10:05:56 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * UserDataObj_GetUserDataText ( UserDataObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
Handle data ;
OSType udType ;
long index ;
short itlRegionTag ;
if ( ! PyArg_ParseTuple ( _args , " O&O&lh " ,
ResObj_Convert , & data ,
PyMac_GetOSType , & udType ,
1995-11-30 13:42:08 -04:00
& index ,
1995-12-09 10:05:56 -04:00
& itlRegionTag ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = GetUserDataText ( _self - > ob_itself ,
data ,
udType ,
1995-11-30 13:42:08 -04:00
index ,
1995-12-09 10:05:56 -04:00
itlRegionTag ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * UserDataObj_RemoveUserDataText ( UserDataObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
OSType udType ;
long index ;
short itlRegionTag ;
if ( ! PyArg_ParseTuple ( _args , " O&lh " ,
PyMac_GetOSType , & udType ,
1995-11-30 13:42:08 -04:00
& index ,
1995-12-09 10:05:56 -04:00
& itlRegionTag ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = RemoveUserDataText ( _self - > ob_itself ,
udType ,
index ,
itlRegionTag ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * UserDataObj_PutUserDataIntoHandle ( UserDataObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
Handle h ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & h ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = PutUserDataIntoHandle ( _self - > ob_itself ,
h ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-12-09 10:05:56 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
1995-12-09 10:05:56 -04:00
static PyMethodDef UserDataObj_methods [ ] = {
{ " GetUserData " , ( PyCFunction ) UserDataObj_GetUserData , 1 ,
" (Handle data, OSType udType, long index) -> None " } ,
{ " AddUserData " , ( PyCFunction ) UserDataObj_AddUserData , 1 ,
" (Handle data, OSType udType) -> None " } ,
{ " RemoveUserData " , ( PyCFunction ) UserDataObj_RemoveUserData , 1 ,
" (OSType udType, long index) -> None " } ,
{ " CountUserDataType " , ( PyCFunction ) UserDataObj_CountUserDataType , 1 ,
" (OSType udType) -> (short _rv) " } ,
{ " GetNextUserDataType " , ( PyCFunction ) UserDataObj_GetNextUserDataType , 1 ,
" (OSType udType) -> (long _rv) " } ,
{ " AddUserDataText " , ( PyCFunction ) UserDataObj_AddUserDataText , 1 ,
" (Handle data, OSType udType, long index, short itlRegionTag) -> None " } ,
{ " GetUserDataText " , ( PyCFunction ) UserDataObj_GetUserDataText , 1 ,
" (Handle data, OSType udType, long index, short itlRegionTag) -> None " } ,
{ " RemoveUserDataText " , ( PyCFunction ) UserDataObj_RemoveUserDataText , 1 ,
" (OSType udType, long index, short itlRegionTag) -> None " } ,
{ " PutUserDataIntoHandle " , ( PyCFunction ) UserDataObj_PutUserDataIntoHandle , 1 ,
" (Handle h) -> None " } ,
1995-11-30 13:42:08 -04:00
{ NULL , NULL , 0 }
} ;
1995-12-09 10:05:56 -04:00
PyMethodChain UserDataObj_chain = { UserDataObj_methods , NULL } ;
1995-11-30 13:42:08 -04:00
2001-05-22 18:56:42 -03:00
static PyObject * UserDataObj_getattr ( UserDataObject * self , char * name )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
return Py_FindMethodInChain ( & UserDataObj_chain , ( PyObject * ) self , name ) ;
1995-11-30 13:42:08 -04:00
}
1995-12-09 10:05:56 -04:00
# define UserDataObj_setattr NULL
1995-11-30 13:42:08 -04:00
1999-12-12 17:41:51 -04:00
# define UserDataObj_compare NULL
# define UserDataObj_repr NULL
# define UserDataObj_hash NULL
1995-12-09 10:05:56 -04:00
PyTypeObject UserData_Type = {
1995-11-30 13:42:08 -04:00
PyObject_HEAD_INIT ( & PyType_Type )
0 , /*ob_size*/
1995-12-09 10:05:56 -04:00
" UserData " , /*tp_name*/
sizeof ( UserDataObject ) , /*tp_basicsize*/
1995-11-30 13:42:08 -04:00
0 , /*tp_itemsize*/
/* methods */
1995-12-09 10:05:56 -04:00
( destructor ) UserDataObj_dealloc , /*tp_dealloc*/
1995-11-30 13:42:08 -04:00
0 , /*tp_print*/
1995-12-09 10:05:56 -04:00
( getattrfunc ) UserDataObj_getattr , /*tp_getattr*/
( setattrfunc ) UserDataObj_setattr , /*tp_setattr*/
1999-12-12 17:41:51 -04:00
( cmpfunc ) UserDataObj_compare , /*tp_compare*/
( reprfunc ) UserDataObj_repr , /*tp_repr*/
( PyNumberMethods * ) 0 , /* tp_as_number */
( PySequenceMethods * ) 0 , /* tp_as_sequence */
( PyMappingMethods * ) 0 , /* tp_as_mapping */
( hashfunc ) UserDataObj_hash , /*tp_hash*/
1995-11-30 13:42:08 -04:00
} ;
1995-12-09 10:05:56 -04:00
/* -------------------- End object type UserData -------------------- */
1995-11-30 13:42:08 -04:00
1995-12-09 10:05:56 -04:00
/* ----------------------- Object type Media ------------------------ */
1995-11-30 13:42:08 -04:00
1995-12-09 10:05:56 -04:00
PyTypeObject Media_Type ;
1995-11-30 13:42:08 -04:00
1995-12-09 10:05:56 -04:00
# define MediaObj_Check(x) ((x)->ob_type == &Media_Type)
1995-11-30 13:42:08 -04:00
1995-12-09 10:05:56 -04:00
typedef struct MediaObject {
1995-11-30 13:42:08 -04:00
PyObject_HEAD
1995-12-09 10:05:56 -04:00
Media ob_itself ;
} MediaObject ;
1995-11-30 13:42:08 -04:00
2001-05-22 18:56:42 -03:00
PyObject * MediaObj_New ( Media itself )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
MediaObject * it ;
1995-11-30 13:42:08 -04:00
if ( itself = = NULL ) {
1995-12-09 10:05:56 -04:00
PyErr_SetString ( Qt_Error , " Cannot create null Media " ) ;
1995-11-30 13:42:08 -04:00
return NULL ;
}
1995-12-09 10:05:56 -04:00
it = PyObject_NEW ( MediaObject , & Media_Type ) ;
1995-11-30 13:42:08 -04:00
if ( it = = NULL ) return NULL ;
it - > ob_itself = itself ;
return ( PyObject * ) it ;
}
2001-05-22 18:56:42 -03:00
MediaObj_Convert ( PyObject * v , Media * p_itself )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
if ( ! MediaObj_Check ( v ) )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
PyErr_SetString ( PyExc_TypeError , " Media required " ) ;
1995-11-30 13:42:08 -04:00
return 0 ;
}
1995-12-09 10:05:56 -04:00
* p_itself = ( ( MediaObject * ) v ) - > ob_itself ;
1995-11-30 13:42:08 -04:00
return 1 ;
}
2001-05-22 18:56:42 -03:00
static void MediaObj_dealloc ( MediaObject * self )
1995-11-30 13:42:08 -04:00
{
1995-12-09 10:05:56 -04:00
DisposeTrackMedia ( self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
PyMem_DEL ( self ) ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_LoadMediaIntoRam ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
TimeValue time ;
TimeValue duration ;
long flags ;
if ( ! PyArg_ParseTuple ( _args , " lll " ,
& time ,
& duration ,
& flags ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_err = LoadMediaIntoRam ( _self - > ob_itself ,
1995-11-30 13:42:08 -04:00
time ,
duration ,
flags ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaTrack ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Track _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMediaTrack ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
TrackObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaCreationTime ( MediaObject * _self , PyObject * _args )
1997-04-09 12:53:46 -03:00
{
PyObject * _res = NULL ;
unsigned long _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetMediaCreationTime ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaModificationTime ( MediaObject * _self , PyObject * _args )
1997-04-09 12:53:46 -03:00
{
PyObject * _res = NULL ;
unsigned long _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetMediaModificationTime ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaTimeScale ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeScale _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMediaTimeScale ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_SetMediaTimeScale ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeScale timeScale ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& timeScale ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMediaTimeScale ( _self - > ob_itself ,
timeScale ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaDuration ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMediaDuration ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaLanguage ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMediaLanguage ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_SetMediaLanguage ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short language ;
if ( ! PyArg_ParseTuple ( _args , " h " ,
& language ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMediaLanguage ( _self - > ob_itself ,
language ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaQuality ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMediaQuality ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_SetMediaQuality ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short quality ;
if ( ! PyArg_ParseTuple ( _args , " h " ,
& quality ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMediaQuality ( _self - > ob_itself ,
quality ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaHandlerDescription ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSType mediaType ;
Str255 creatorName ;
OSType creatorManufacturer ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetStr255 , creatorName ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
GetMediaHandlerDescription ( _self - > ob_itself ,
& mediaType ,
creatorName ,
& creatorManufacturer ) ;
_res = Py_BuildValue ( " O&O& " ,
PyMac_BuildOSType , mediaType ,
PyMac_BuildOSType , creatorManufacturer ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaUserData ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
UserData _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMediaUserData ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
UserDataObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaHandler ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
MediaHandler _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMediaHandler ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
CmpInstObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_SetMediaHandler ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
MediaHandlerComponent mH ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
CmpObj_Convert , & mH ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = SetMediaHandler ( _self - > ob_itself ,
mH ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_BeginMediaEdits ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_err = BeginMediaEdits ( _self - > ob_itself ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_EndMediaEdits ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_err = EndMediaEdits ( _self - > ob_itself ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_SetMediaDefaultDataRefIndex ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
short index ;
if ( ! PyArg_ParseTuple ( _args , " h " ,
& index ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = SetMediaDefaultDataRefIndex ( _self - > ob_itself ,
index ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaDataHandlerDescription ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short index ;
OSType dhType ;
Str255 creatorName ;
OSType creatorManufacturer ;
if ( ! PyArg_ParseTuple ( _args , " hO& " ,
& index ,
PyMac_GetStr255 , creatorName ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
GetMediaDataHandlerDescription ( _self - > ob_itself ,
index ,
& dhType ,
creatorName ,
& creatorManufacturer ) ;
_res = Py_BuildValue ( " O&O& " ,
PyMac_BuildOSType , dhType ,
PyMac_BuildOSType , creatorManufacturer ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaDataHandler ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
DataHandler _rv ;
short index ;
if ( ! PyArg_ParseTuple ( _args , " h " ,
& index ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMediaDataHandler ( _self - > ob_itself ,
index ) ;
_res = Py_BuildValue ( " O& " ,
CmpInstObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_SetMediaDataHandler ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
short index ;
DataHandlerComponent dataHandler ;
if ( ! PyArg_ParseTuple ( _args , " hO& " ,
& index ,
CmpObj_Convert , & dataHandler ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = SetMediaDataHandler ( _self - > ob_itself ,
index ,
dataHandler ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaSampleDescriptionCount ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMediaSampleDescriptionCount ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaSampleDescription ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long index ;
SampleDescriptionHandle descH ;
if ( ! PyArg_ParseTuple ( _args , " lO& " ,
& index ,
ResObj_Convert , & descH ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
GetMediaSampleDescription ( _self - > ob_itself ,
index ,
descH ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_SetMediaSampleDescription ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
long index ;
SampleDescriptionHandle descH ;
if ( ! PyArg_ParseTuple ( _args , " lO& " ,
& index ,
ResObj_Convert , & descH ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = SetMediaSampleDescription ( _self - > ob_itself ,
index ,
descH ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaSampleCount ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMediaSampleCount ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaSyncSampleCount ( MediaObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
long _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetMediaSyncSampleCount ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_SampleNumToMediaTime ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long logicalSampleNum ;
TimeValue sampleTime ;
TimeValue sampleDuration ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& logicalSampleNum ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SampleNumToMediaTime ( _self - > ob_itself ,
logicalSampleNum ,
& sampleTime ,
& sampleDuration ) ;
_res = Py_BuildValue ( " ll " ,
sampleTime ,
sampleDuration ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_MediaTimeToSampleNum ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue time ;
long sampleNum ;
TimeValue sampleTime ;
TimeValue sampleDuration ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& time ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
MediaTimeToSampleNum ( _self - > ob_itself ,
time ,
& sampleNum ,
& sampleTime ,
& sampleDuration ) ;
_res = Py_BuildValue ( " lll " ,
sampleNum ,
sampleTime ,
sampleDuration ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_AddMediaSample ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
Handle dataIn ;
long inOffset ;
unsigned long size ;
TimeValue durationPerSample ;
SampleDescriptionHandle sampleDescriptionH ;
long numberOfSamples ;
short sampleFlags ;
TimeValue sampleTime ;
if ( ! PyArg_ParseTuple ( _args , " O&lllO&lh " ,
ResObj_Convert , & dataIn ,
& inOffset ,
& size ,
& durationPerSample ,
ResObj_Convert , & sampleDescriptionH ,
& numberOfSamples ,
& sampleFlags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = AddMediaSample ( _self - > ob_itself ,
dataIn ,
inOffset ,
size ,
durationPerSample ,
sampleDescriptionH ,
numberOfSamples ,
sampleFlags ,
& sampleTime ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " l " ,
sampleTime ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_AddMediaSampleReference ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
long dataOffset ;
unsigned long size ;
TimeValue durationPerSample ;
SampleDescriptionHandle sampleDescriptionH ;
long numberOfSamples ;
short sampleFlags ;
TimeValue sampleTime ;
if ( ! PyArg_ParseTuple ( _args , " lllO&lh " ,
& dataOffset ,
& size ,
& durationPerSample ,
ResObj_Convert , & sampleDescriptionH ,
& numberOfSamples ,
& sampleFlags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = AddMediaSampleReference ( _self - > ob_itself ,
dataOffset ,
size ,
durationPerSample ,
sampleDescriptionH ,
numberOfSamples ,
sampleFlags ,
& sampleTime ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " l " ,
sampleTime ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaSample ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
Handle dataOut ;
long maxSizeToGrow ;
long size ;
TimeValue time ;
TimeValue sampleTime ;
TimeValue durationPerSample ;
SampleDescriptionHandle sampleDescriptionH ;
long sampleDescriptionIndex ;
long maxNumberOfSamples ;
long numberOfSamples ;
short sampleFlags ;
if ( ! PyArg_ParseTuple ( _args , " O&llO&l " ,
ResObj_Convert , & dataOut ,
& maxSizeToGrow ,
& time ,
ResObj_Convert , & sampleDescriptionH ,
& maxNumberOfSamples ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = GetMediaSample ( _self - > ob_itself ,
dataOut ,
maxSizeToGrow ,
& size ,
time ,
& sampleTime ,
& durationPerSample ,
sampleDescriptionH ,
& sampleDescriptionIndex ,
maxNumberOfSamples ,
& numberOfSamples ,
& sampleFlags ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-12-09 10:05:56 -04:00
_res = Py_BuildValue ( " lllllh " ,
size ,
sampleTime ,
durationPerSample ,
sampleDescriptionIndex ,
numberOfSamples ,
sampleFlags ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaSampleReference ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
long dataOffset ;
long size ;
TimeValue time ;
TimeValue sampleTime ;
TimeValue durationPerSample ;
SampleDescriptionHandle sampleDescriptionH ;
long sampleDescriptionIndex ;
long maxNumberOfSamples ;
long numberOfSamples ;
short sampleFlags ;
if ( ! PyArg_ParseTuple ( _args , " lO&l " ,
& time ,
ResObj_Convert , & sampleDescriptionH ,
& maxNumberOfSamples ) )
return NULL ;
_err = GetMediaSampleReference ( _self - > ob_itself ,
& dataOffset ,
& size ,
time ,
& sampleTime ,
& durationPerSample ,
sampleDescriptionH ,
& sampleDescriptionIndex ,
maxNumberOfSamples ,
& numberOfSamples ,
& sampleFlags ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " llllllh " ,
dataOffset ,
size ,
sampleTime ,
durationPerSample ,
sampleDescriptionIndex ,
numberOfSamples ,
sampleFlags ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_SetMediaPreferredChunkSize ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
long maxChunkSize ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& maxChunkSize ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = SetMediaPreferredChunkSize ( _self - > ob_itself ,
maxChunkSize ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaPreferredChunkSize ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
long maxChunkSize ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_err = GetMediaPreferredChunkSize ( _self - > ob_itself ,
& maxChunkSize ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " l " ,
maxChunkSize ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_SetMediaShadowSync ( MediaObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
long frameDiffSampleNum ;
long syncSampleNum ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " ll " ,
1995-12-09 10:05:56 -04:00
& frameDiffSampleNum ,
& syncSampleNum ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = SetMediaShadowSync ( _self - > ob_itself ,
frameDiffSampleNum ,
syncSampleNum ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaShadowSync ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
long frameDiffSampleNum ;
long syncSampleNum ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& frameDiffSampleNum ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = GetMediaShadowSync ( _self - > ob_itself ,
frameDiffSampleNum ,
& syncSampleNum ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-12-09 10:05:56 -04:00
_res = Py_BuildValue ( " l " ,
syncSampleNum ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaDataSize ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long _rv ;
TimeValue startTime ;
TimeValue duration ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& startTime ,
& duration ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMediaDataSize ( _self - > ob_itself ,
startTime ,
duration ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaDataSize64 ( MediaObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
TimeValue startTime ;
TimeValue duration ;
wide dataSize ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& startTime ,
& duration ) )
return NULL ;
_err = GetMediaDataSize64 ( _self - > ob_itself ,
startTime ,
duration ,
& dataSize ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_Buildwide , dataSize ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaNextInterestingTime ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short interestingTimeFlags ;
TimeValue time ;
Fixed rate ;
TimeValue interestingTime ;
TimeValue interestingDuration ;
if ( ! PyArg_ParseTuple ( _args , " hlO& " ,
& interestingTimeFlags ,
& time ,
PyMac_GetFixed , & rate ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
GetMediaNextInterestingTime ( _self - > ob_itself ,
interestingTimeFlags ,
time ,
rate ,
& interestingTime ,
& interestingDuration ) ;
_res = Py_BuildValue ( " ll " ,
interestingTime ,
interestingDuration ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaDataRef ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
short index ;
1995-11-30 13:42:08 -04:00
Handle dataRef ;
OSType dataRefType ;
1995-12-09 10:05:56 -04:00
long dataRefAttributes ;
if ( ! PyArg_ParseTuple ( _args , " h " ,
& index ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = GetMediaDataRef ( _self - > ob_itself ,
index ,
& dataRef ,
& dataRefType ,
& dataRefAttributes ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-12-09 10:05:56 -04:00
_res = Py_BuildValue ( " O&O&l " ,
ResObj_New , dataRef ,
PyMac_BuildOSType , dataRefType ,
dataRefAttributes ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_SetMediaDataRef ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
short index ;
Handle dataRef ;
OSType dataRefType ;
if ( ! PyArg_ParseTuple ( _args , " hO&O& " ,
& index ,
ResObj_Convert , & dataRef ,
PyMac_GetOSType , & dataRefType ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = SetMediaDataRef ( _self - > ob_itself ,
index ,
dataRef ,
dataRefType ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-12-09 10:05:56 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_SetMediaDataRefAttributes ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
short index ;
long dataRefAttributes ;
if ( ! PyArg_ParseTuple ( _args , " hl " ,
& index ,
& dataRefAttributes ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = SetMediaDataRefAttributes ( _self - > ob_itself ,
index ,
dataRefAttributes ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_AddMediaDataRef ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
short index ;
Handle dataRef ;
OSType dataRefType ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & dataRef ,
PyMac_GetOSType , & dataRefType ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = AddMediaDataRef ( _self - > ob_itself ,
& index ,
dataRef ,
dataRefType ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-12-09 10:05:56 -04:00
_res = Py_BuildValue ( " h " ,
index ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaDataRefCount ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
short count ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = GetMediaDataRefCount ( _self - > ob_itself ,
& count ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " h " ,
count ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_SetMediaPlayHints ( MediaObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long flags ;
long flagsMask ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& flags ,
& flagsMask ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMediaPlayHints ( _self - > ob_itself ,
flags ,
flagsMask ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaPlayHints ( MediaObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
long flags ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetMediaPlayHints ( _self - > ob_itself ,
& flags ) ;
_res = Py_BuildValue ( " l " ,
flags ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_GetMediaNextInterestingTimeOnly ( MediaObject * _self , PyObject * _args )
2000-03-17 12:49:59 -04:00
{
PyObject * _res = NULL ;
short interestingTimeFlags ;
TimeValue time ;
Fixed rate ;
TimeValue interestingTime ;
if ( ! PyArg_ParseTuple ( _args , " hlO& " ,
& interestingTimeFlags ,
& time ,
PyMac_GetFixed , & rate ) )
return NULL ;
GetMediaNextInterestingTimeOnly ( _self - > ob_itself ,
interestingTimeFlags ,
time ,
rate ,
& interestingTime ) ;
_res = Py_BuildValue ( " l " ,
interestingTime ) ;
return _res ;
}
1995-12-09 10:05:56 -04:00
static PyMethodDef MediaObj_methods [ ] = {
{ " LoadMediaIntoRam " , ( PyCFunction ) MediaObj_LoadMediaIntoRam , 1 ,
" (TimeValue time, TimeValue duration, long flags) -> None " } ,
{ " GetMediaTrack " , ( PyCFunction ) MediaObj_GetMediaTrack , 1 ,
" () -> (Track _rv) " } ,
1997-04-09 12:53:46 -03:00
{ " GetMediaCreationTime " , ( PyCFunction ) MediaObj_GetMediaCreationTime , 1 ,
" () -> (unsigned long _rv) " } ,
{ " GetMediaModificationTime " , ( PyCFunction ) MediaObj_GetMediaModificationTime , 1 ,
" () -> (unsigned long _rv) " } ,
1995-12-09 10:05:56 -04:00
{ " GetMediaTimeScale " , ( PyCFunction ) MediaObj_GetMediaTimeScale , 1 ,
" () -> (TimeScale _rv) " } ,
{ " SetMediaTimeScale " , ( PyCFunction ) MediaObj_SetMediaTimeScale , 1 ,
" (TimeScale timeScale) -> None " } ,
{ " GetMediaDuration " , ( PyCFunction ) MediaObj_GetMediaDuration , 1 ,
" () -> (TimeValue _rv) " } ,
{ " GetMediaLanguage " , ( PyCFunction ) MediaObj_GetMediaLanguage , 1 ,
" () -> (short _rv) " } ,
{ " SetMediaLanguage " , ( PyCFunction ) MediaObj_SetMediaLanguage , 1 ,
" (short language) -> None " } ,
{ " GetMediaQuality " , ( PyCFunction ) MediaObj_GetMediaQuality , 1 ,
" () -> (short _rv) " } ,
{ " SetMediaQuality " , ( PyCFunction ) MediaObj_SetMediaQuality , 1 ,
" (short quality) -> None " } ,
{ " GetMediaHandlerDescription " , ( PyCFunction ) MediaObj_GetMediaHandlerDescription , 1 ,
" (Str255 creatorName) -> (OSType mediaType, OSType creatorManufacturer) " } ,
{ " GetMediaUserData " , ( PyCFunction ) MediaObj_GetMediaUserData , 1 ,
" () -> (UserData _rv) " } ,
{ " GetMediaHandler " , ( PyCFunction ) MediaObj_GetMediaHandler , 1 ,
" () -> (MediaHandler _rv) " } ,
{ " SetMediaHandler " , ( PyCFunction ) MediaObj_SetMediaHandler , 1 ,
" (MediaHandlerComponent mH) -> None " } ,
{ " BeginMediaEdits " , ( PyCFunction ) MediaObj_BeginMediaEdits , 1 ,
" () -> None " } ,
{ " EndMediaEdits " , ( PyCFunction ) MediaObj_EndMediaEdits , 1 ,
" () -> None " } ,
{ " SetMediaDefaultDataRefIndex " , ( PyCFunction ) MediaObj_SetMediaDefaultDataRefIndex , 1 ,
" (short index) -> None " } ,
{ " GetMediaDataHandlerDescription " , ( PyCFunction ) MediaObj_GetMediaDataHandlerDescription , 1 ,
" (short index, Str255 creatorName) -> (OSType dhType, OSType creatorManufacturer) " } ,
{ " GetMediaDataHandler " , ( PyCFunction ) MediaObj_GetMediaDataHandler , 1 ,
" (short index) -> (DataHandler _rv) " } ,
{ " SetMediaDataHandler " , ( PyCFunction ) MediaObj_SetMediaDataHandler , 1 ,
" (short index, DataHandlerComponent dataHandler) -> None " } ,
{ " GetMediaSampleDescriptionCount " , ( PyCFunction ) MediaObj_GetMediaSampleDescriptionCount , 1 ,
" () -> (long _rv) " } ,
{ " GetMediaSampleDescription " , ( PyCFunction ) MediaObj_GetMediaSampleDescription , 1 ,
" (long index, SampleDescriptionHandle descH) -> None " } ,
{ " SetMediaSampleDescription " , ( PyCFunction ) MediaObj_SetMediaSampleDescription , 1 ,
" (long index, SampleDescriptionHandle descH) -> None " } ,
{ " GetMediaSampleCount " , ( PyCFunction ) MediaObj_GetMediaSampleCount , 1 ,
" () -> (long _rv) " } ,
1998-04-21 12:23:55 -03:00
{ " GetMediaSyncSampleCount " , ( PyCFunction ) MediaObj_GetMediaSyncSampleCount , 1 ,
" () -> (long _rv) " } ,
1995-12-09 10:05:56 -04:00
{ " SampleNumToMediaTime " , ( PyCFunction ) MediaObj_SampleNumToMediaTime , 1 ,
" (long logicalSampleNum) -> (TimeValue sampleTime, TimeValue sampleDuration) " } ,
{ " MediaTimeToSampleNum " , ( PyCFunction ) MediaObj_MediaTimeToSampleNum , 1 ,
" (TimeValue time) -> (long sampleNum, TimeValue sampleTime, TimeValue sampleDuration) " } ,
{ " AddMediaSample " , ( PyCFunction ) MediaObj_AddMediaSample , 1 ,
" (Handle dataIn, long inOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime) " } ,
{ " AddMediaSampleReference " , ( PyCFunction ) MediaObj_AddMediaSampleReference , 1 ,
" (long dataOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime) " } ,
{ " GetMediaSample " , ( PyCFunction ) MediaObj_GetMediaSample , 1 ,
" (Handle dataOut, long maxSizeToGrow, TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags) " } ,
{ " GetMediaSampleReference " , ( PyCFunction ) MediaObj_GetMediaSampleReference , 1 ,
" (TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long dataOffset, long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags) " } ,
{ " SetMediaPreferredChunkSize " , ( PyCFunction ) MediaObj_SetMediaPreferredChunkSize , 1 ,
" (long maxChunkSize) -> None " } ,
{ " GetMediaPreferredChunkSize " , ( PyCFunction ) MediaObj_GetMediaPreferredChunkSize , 1 ,
" () -> (long maxChunkSize) " } ,
{ " SetMediaShadowSync " , ( PyCFunction ) MediaObj_SetMediaShadowSync , 1 ,
" (long frameDiffSampleNum, long syncSampleNum) -> None " } ,
{ " GetMediaShadowSync " , ( PyCFunction ) MediaObj_GetMediaShadowSync , 1 ,
" (long frameDiffSampleNum) -> (long syncSampleNum) " } ,
{ " GetMediaDataSize " , ( PyCFunction ) MediaObj_GetMediaDataSize , 1 ,
" (TimeValue startTime, TimeValue duration) -> (long _rv) " } ,
2000-12-12 18:10:21 -04:00
{ " GetMediaDataSize64 " , ( PyCFunction ) MediaObj_GetMediaDataSize64 , 1 ,
" (TimeValue startTime, TimeValue duration) -> (wide dataSize) " } ,
1995-12-09 10:05:56 -04:00
{ " GetMediaNextInterestingTime " , ( PyCFunction ) MediaObj_GetMediaNextInterestingTime , 1 ,
" (short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration) " } ,
{ " GetMediaDataRef " , ( PyCFunction ) MediaObj_GetMediaDataRef , 1 ,
" (short index) -> (Handle dataRef, OSType dataRefType, long dataRefAttributes) " } ,
{ " SetMediaDataRef " , ( PyCFunction ) MediaObj_SetMediaDataRef , 1 ,
" (short index, Handle dataRef, OSType dataRefType) -> None " } ,
{ " SetMediaDataRefAttributes " , ( PyCFunction ) MediaObj_SetMediaDataRefAttributes , 1 ,
" (short index, long dataRefAttributes) -> None " } ,
{ " AddMediaDataRef " , ( PyCFunction ) MediaObj_AddMediaDataRef , 1 ,
" (Handle dataRef, OSType dataRefType) -> (short index) " } ,
{ " GetMediaDataRefCount " , ( PyCFunction ) MediaObj_GetMediaDataRefCount , 1 ,
" () -> (short count) " } ,
{ " SetMediaPlayHints " , ( PyCFunction ) MediaObj_SetMediaPlayHints , 1 ,
" (long flags, long flagsMask) -> None " } ,
1998-04-21 12:23:55 -03:00
{ " GetMediaPlayHints " , ( PyCFunction ) MediaObj_GetMediaPlayHints , 1 ,
" () -> (long flags) " } ,
2000-03-17 12:49:59 -04:00
{ " GetMediaNextInterestingTimeOnly " , ( PyCFunction ) MediaObj_GetMediaNextInterestingTimeOnly , 1 ,
" (short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime) " } ,
1995-12-09 10:05:56 -04:00
{ NULL , NULL , 0 }
} ;
PyMethodChain MediaObj_chain = { MediaObj_methods , NULL } ;
2001-05-22 18:56:42 -03:00
static PyObject * MediaObj_getattr ( MediaObject * self , char * name )
1995-12-09 10:05:56 -04:00
{
return Py_FindMethodInChain ( & MediaObj_chain , ( PyObject * ) self , name ) ;
}
# define MediaObj_setattr NULL
1999-12-12 17:41:51 -04:00
# define MediaObj_compare NULL
# define MediaObj_repr NULL
# define MediaObj_hash NULL
1995-12-09 10:05:56 -04:00
PyTypeObject Media_Type = {
PyObject_HEAD_INIT ( & PyType_Type )
0 , /*ob_size*/
" Media " , /*tp_name*/
sizeof ( MediaObject ) , /*tp_basicsize*/
0 , /*tp_itemsize*/
/* methods */
( destructor ) MediaObj_dealloc , /*tp_dealloc*/
0 , /*tp_print*/
( getattrfunc ) MediaObj_getattr , /*tp_getattr*/
( setattrfunc ) MediaObj_setattr , /*tp_setattr*/
1999-12-12 17:41:51 -04:00
( cmpfunc ) MediaObj_compare , /*tp_compare*/
( reprfunc ) MediaObj_repr , /*tp_repr*/
( PyNumberMethods * ) 0 , /* tp_as_number */
( PySequenceMethods * ) 0 , /* tp_as_sequence */
( PyMappingMethods * ) 0 , /* tp_as_mapping */
( hashfunc ) MediaObj_hash , /*tp_hash*/
1995-12-09 10:05:56 -04:00
} ;
/* --------------------- End object type Media ---------------------- */
/* ----------------------- Object type Track ------------------------ */
PyTypeObject Track_Type ;
# define TrackObj_Check(x) ((x)->ob_type == &Track_Type)
typedef struct TrackObject {
PyObject_HEAD
Track ob_itself ;
} TrackObject ;
2001-05-22 18:56:42 -03:00
PyObject * TrackObj_New ( Track itself )
1995-12-09 10:05:56 -04:00
{
TrackObject * it ;
if ( itself = = NULL ) {
PyErr_SetString ( Qt_Error , " Cannot create null Track " ) ;
return NULL ;
}
it = PyObject_NEW ( TrackObject , & Track_Type ) ;
if ( it = = NULL ) return NULL ;
it - > ob_itself = itself ;
return ( PyObject * ) it ;
}
2001-05-22 18:56:42 -03:00
TrackObj_Convert ( PyObject * v , Track * p_itself )
1995-12-09 10:05:56 -04:00
{
if ( ! TrackObj_Check ( v ) )
{
PyErr_SetString ( PyExc_TypeError , " Track required " ) ;
return 0 ;
}
* p_itself = ( ( TrackObject * ) v ) - > ob_itself ;
return 1 ;
}
2001-05-22 18:56:42 -03:00
static void TrackObj_dealloc ( TrackObject * self )
1995-12-09 10:05:56 -04:00
{
DisposeMovieTrack ( self - > ob_itself ) ;
PyMem_DEL ( self ) ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_LoadTrackIntoRam ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
TimeValue time ;
TimeValue duration ;
long flags ;
if ( ! PyArg_ParseTuple ( _args , " lll " ,
& time ,
& duration ,
& flags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = LoadTrackIntoRam ( _self - > ob_itself ,
time ,
duration ,
flags ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackPict ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
PicHandle _rv ;
TimeValue time ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " l " ,
1995-12-09 10:05:56 -04:00
& time ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackPict ( _self - > ob_itself ,
time ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
ResObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackClipRgn ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
RgnHandle _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackClipRgn ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_SetTrackClipRgn ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
RgnHandle theClip ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
1995-12-09 10:05:56 -04:00
ResObj_Convert , & theClip ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetTrackClipRgn ( _self - > ob_itself ,
theClip ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackDisplayBoundsRgn ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
RgnHandle _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackDisplayBoundsRgn ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackMovieBoundsRgn ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
RgnHandle _rv ;
1995-12-09 10:05:56 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackMovieBoundsRgn ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackBoundsRgn ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
RgnHandle _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackBoundsRgn ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackMatte ( TrackObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
PixMapHandle _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetTrackMatte ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_SetTrackMatte ( TrackObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
PixMapHandle theMatte ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & theMatte ) )
return NULL ;
SetTrackMatte ( _self - > ob_itself ,
theMatte ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackID ( TrackObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
long _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetTrackID ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackMovie ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Movie _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackMovie ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
MovieObj_New , _rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackCreationTime ( TrackObject * _self , PyObject * _args )
1997-04-09 12:53:46 -03:00
{
PyObject * _res = NULL ;
unsigned long _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetTrackCreationTime ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackModificationTime ( TrackObject * _self , PyObject * _args )
1997-04-09 12:53:46 -03:00
{
PyObject * _res = NULL ;
unsigned long _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetTrackModificationTime ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackEnabled ( TrackObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
Boolean _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetTrackEnabled ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_SetTrackEnabled ( TrackObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
Boolean isEnabled ;
if ( ! PyArg_ParseTuple ( _args , " b " ,
& isEnabled ) )
return NULL ;
SetTrackEnabled ( _self - > ob_itself ,
isEnabled ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackUsage ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackUsage ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_SetTrackUsage ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long usage ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " l " ,
1995-12-09 10:05:56 -04:00
& usage ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetTrackUsage ( _self - > ob_itself ,
usage ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackDuration ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackDuration ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackOffset ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackOffset ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_SetTrackOffset ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue movieOffsetTime ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& movieOffsetTime ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetTrackOffset ( _self - > ob_itself ,
movieOffsetTime ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackLayer ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackLayer ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " h " ,
1995-11-30 13:42:08 -04:00
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_SetTrackLayer ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short layer ;
if ( ! PyArg_ParseTuple ( _args , " h " ,
& layer ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetTrackLayer ( _self - > ob_itself ,
layer ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackAlternate ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Track _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackAlternate ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
TrackObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_SetTrackAlternate ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Track alternateT ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
TrackObj_Convert , & alternateT ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetTrackAlternate ( _self - > ob_itself ,
alternateT ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackVolume ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackVolume ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_SetTrackVolume ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short volume ;
if ( ! PyArg_ParseTuple ( _args , " h " ,
& volume ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetTrackVolume ( _self - > ob_itself ,
volume ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackDimensions ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Fixed width ;
Fixed height ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
GetTrackDimensions ( _self - > ob_itself ,
& width ,
& height ) ;
_res = Py_BuildValue ( " O&O& " ,
PyMac_BuildFixed , width ,
PyMac_BuildFixed , height ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_SetTrackDimensions ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Fixed width ;
Fixed height ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetFixed , & width ,
PyMac_GetFixed , & height ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetTrackDimensions ( _self - > ob_itself ,
width ,
height ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackUserData ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
UserData _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackUserData ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
UserDataObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackSoundLocalizationSettings ( TrackObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
Handle settings ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_err = GetTrackSoundLocalizationSettings ( _self - > ob_itself ,
& settings ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , settings ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_SetTrackSoundLocalizationSettings ( TrackObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
Handle settings ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & settings ) )
return NULL ;
_err = SetTrackSoundLocalizationSettings ( _self - > ob_itself ,
settings ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_NewTrackMedia ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Media _rv ;
OSType mediaType ;
TimeScale timeScale ;
Handle dataRef ;
OSType dataRefType ;
if ( ! PyArg_ParseTuple ( _args , " O&lO&O& " ,
PyMac_GetOSType , & mediaType ,
& timeScale ,
ResObj_Convert , & dataRef ,
PyMac_GetOSType , & dataRefType ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = NewTrackMedia ( _self - > ob_itself ,
mediaType ,
timeScale ,
dataRef ,
dataRefType ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
MediaObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackMedia ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Media _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackMedia ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
MediaObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_InsertMediaIntoTrack ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
TimeValue trackStart ;
TimeValue mediaTime ;
TimeValue mediaDuration ;
Fixed mediaRate ;
if ( ! PyArg_ParseTuple ( _args , " lllO& " ,
& trackStart ,
& mediaTime ,
& mediaDuration ,
PyMac_GetFixed , & mediaRate ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = InsertMediaIntoTrack ( _self - > ob_itself ,
trackStart ,
mediaTime ,
mediaDuration ,
mediaRate ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_InsertTrackSegment ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
Track dstTrack ;
TimeValue srcIn ;
TimeValue srcDuration ;
TimeValue dstIn ;
if ( ! PyArg_ParseTuple ( _args , " O&lll " ,
TrackObj_Convert , & dstTrack ,
& srcIn ,
& srcDuration ,
& dstIn ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = InsertTrackSegment ( _self - > ob_itself ,
dstTrack ,
srcIn ,
srcDuration ,
dstIn ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_InsertEmptyTrackSegment ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
TimeValue dstIn ;
TimeValue dstDuration ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& dstIn ,
& dstDuration ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = InsertEmptyTrackSegment ( _self - > ob_itself ,
dstIn ,
dstDuration ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_DeleteTrackSegment ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
TimeValue startTime ;
TimeValue duration ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& startTime ,
& duration ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = DeleteTrackSegment ( _self - > ob_itself ,
startTime ,
duration ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_ScaleTrackSegment ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
TimeValue startTime ;
TimeValue oldDuration ;
TimeValue newDuration ;
if ( ! PyArg_ParseTuple ( _args , " lll " ,
& startTime ,
& oldDuration ,
& newDuration ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = ScaleTrackSegment ( _self - > ob_itself ,
startTime ,
oldDuration ,
newDuration ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_IsScrapMovie ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Component _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = IsScrapMovie ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
CmpObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_CopyTrackSettings ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
Track dstTrack ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
1995-12-09 10:05:56 -04:00
TrackObj_Convert , & dstTrack ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = CopyTrackSettings ( _self - > ob_itself ,
dstTrack ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_AddEmptyTrackToMovie ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
Movie dstMovie ;
Handle dataRef ;
OSType dataRefType ;
Track dstTrack ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
MovieObj_Convert , & dstMovie ,
ResObj_Convert , & dataRef ,
PyMac_GetOSType , & dataRefType ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = AddEmptyTrackToMovie ( _self - > ob_itself ,
dstMovie ,
dataRef ,
dataRefType ,
& dstTrack ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
TrackObj_New , dstTrack ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_AddTrackReference ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
Track refTrack ;
OSType refType ;
long addedIndex ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
TrackObj_Convert , & refTrack ,
PyMac_GetOSType , & refType ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = AddTrackReference ( _self - > ob_itself ,
refTrack ,
refType ,
& addedIndex ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " l " ,
addedIndex ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_DeleteTrackReference ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
OSType refType ;
long index ;
if ( ! PyArg_ParseTuple ( _args , " O&l " ,
PyMac_GetOSType , & refType ,
& index ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = DeleteTrackReference ( _self - > ob_itself ,
refType ,
index ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_SetTrackReference ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
Track refTrack ;
OSType refType ;
long index ;
if ( ! PyArg_ParseTuple ( _args , " O&O&l " ,
TrackObj_Convert , & refTrack ,
PyMac_GetOSType , & refType ,
& index ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = SetTrackReference ( _self - > ob_itself ,
refTrack ,
refType ,
index ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackReference ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Track _rv ;
OSType refType ;
long index ;
if ( ! PyArg_ParseTuple ( _args , " O&l " ,
PyMac_GetOSType , & refType ,
& index ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackReference ( _self - > ob_itself ,
refType ,
index ) ;
_res = Py_BuildValue ( " O& " ,
TrackObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetNextTrackReferenceType ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSType _rv ;
OSType refType ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetOSType , & refType ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetNextTrackReferenceType ( _self - > ob_itself ,
refType ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildOSType , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackReferenceCount ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long _rv ;
OSType refType ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetOSType , & refType ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackReferenceCount ( _self - > ob_itself ,
refType ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackEditRate ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
Fixed _rv ;
1995-12-09 10:05:56 -04:00
TimeValue atTime ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& atTime ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackEditRate ( _self - > ob_itself ,
atTime ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
PyMac_BuildFixed , _rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackDataSize ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long _rv ;
TimeValue startTime ;
TimeValue duration ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& startTime ,
& duration ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackDataSize ( _self - > ob_itself ,
startTime ,
duration ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackDataSize64 ( TrackObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
TimeValue startTime ;
TimeValue duration ;
wide dataSize ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& startTime ,
& duration ) )
return NULL ;
_err = GetTrackDataSize64 ( _self - > ob_itself ,
startTime ,
duration ,
& dataSize ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_Buildwide , dataSize ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_PtInTrack ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Boolean _rv ;
Point pt ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetPoint , & pt ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = PtInTrack ( _self - > ob_itself ,
pt ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackNextInterestingTime ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short interestingTimeFlags ;
TimeValue time ;
1995-11-30 13:42:08 -04:00
Fixed rate ;
1995-12-09 10:05:56 -04:00
TimeValue interestingTime ;
TimeValue interestingDuration ;
if ( ! PyArg_ParseTuple ( _args , " hlO& " ,
& interestingTimeFlags ,
& time ,
1995-11-30 13:42:08 -04:00
PyMac_GetFixed , & rate ) )
return NULL ;
1995-12-09 10:05:56 -04:00
GetTrackNextInterestingTime ( _self - > ob_itself ,
interestingTimeFlags ,
time ,
rate ,
& interestingTime ,
& interestingDuration ) ;
_res = Py_BuildValue ( " ll " ,
interestingTime ,
interestingDuration ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackSegmentDisplayBoundsRgn ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
RgnHandle _rv ;
TimeValue time ;
TimeValue duration ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& time ,
& duration ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackSegmentDisplayBoundsRgn ( _self - > ob_itself ,
time ,
duration ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackStatus ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
ComponentResult _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetTrackStatus ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_SetTrackLoadSettings ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue preloadTime ;
TimeValue preloadDuration ;
long preloadFlags ;
long defaultHints ;
if ( ! PyArg_ParseTuple ( _args , " llll " ,
& preloadTime ,
& preloadDuration ,
& preloadFlags ,
& defaultHints ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetTrackLoadSettings ( _self - > ob_itself ,
preloadTime ,
preloadDuration ,
preloadFlags ,
defaultHints ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_GetTrackLoadSettings ( TrackObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue preloadTime ;
TimeValue preloadDuration ;
long preloadFlags ;
long defaultHints ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
GetTrackLoadSettings ( _self - > ob_itself ,
& preloadTime ,
& preloadDuration ,
& preloadFlags ,
& defaultHints ) ;
_res = Py_BuildValue ( " llll " ,
preloadTime ,
preloadDuration ,
preloadFlags ,
defaultHints ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
1995-12-09 10:05:56 -04:00
static PyMethodDef TrackObj_methods [ ] = {
{ " LoadTrackIntoRam " , ( PyCFunction ) TrackObj_LoadTrackIntoRam , 1 ,
" (TimeValue time, TimeValue duration, long flags) -> None " } ,
{ " GetTrackPict " , ( PyCFunction ) TrackObj_GetTrackPict , 1 ,
" (TimeValue time) -> (PicHandle _rv) " } ,
{ " GetTrackClipRgn " , ( PyCFunction ) TrackObj_GetTrackClipRgn , 1 ,
" () -> (RgnHandle _rv) " } ,
{ " SetTrackClipRgn " , ( PyCFunction ) TrackObj_SetTrackClipRgn , 1 ,
" (RgnHandle theClip) -> None " } ,
{ " GetTrackDisplayBoundsRgn " , ( PyCFunction ) TrackObj_GetTrackDisplayBoundsRgn , 1 ,
" () -> (RgnHandle _rv) " } ,
{ " GetTrackMovieBoundsRgn " , ( PyCFunction ) TrackObj_GetTrackMovieBoundsRgn , 1 ,
" () -> (RgnHandle _rv) " } ,
{ " GetTrackBoundsRgn " , ( PyCFunction ) TrackObj_GetTrackBoundsRgn , 1 ,
" () -> (RgnHandle _rv) " } ,
{ " GetTrackMatte " , ( PyCFunction ) TrackObj_GetTrackMatte , 1 ,
" () -> (PixMapHandle _rv) " } ,
{ " SetTrackMatte " , ( PyCFunction ) TrackObj_SetTrackMatte , 1 ,
" (PixMapHandle theMatte) -> None " } ,
{ " GetTrackID " , ( PyCFunction ) TrackObj_GetTrackID , 1 ,
" () -> (long _rv) " } ,
{ " GetTrackMovie " , ( PyCFunction ) TrackObj_GetTrackMovie , 1 ,
" () -> (Movie _rv) " } ,
1997-04-09 12:53:46 -03:00
{ " GetTrackCreationTime " , ( PyCFunction ) TrackObj_GetTrackCreationTime , 1 ,
" () -> (unsigned long _rv) " } ,
{ " GetTrackModificationTime " , ( PyCFunction ) TrackObj_GetTrackModificationTime , 1 ,
" () -> (unsigned long _rv) " } ,
1995-12-09 10:05:56 -04:00
{ " GetTrackEnabled " , ( PyCFunction ) TrackObj_GetTrackEnabled , 1 ,
" () -> (Boolean _rv) " } ,
{ " SetTrackEnabled " , ( PyCFunction ) TrackObj_SetTrackEnabled , 1 ,
" (Boolean isEnabled) -> None " } ,
{ " GetTrackUsage " , ( PyCFunction ) TrackObj_GetTrackUsage , 1 ,
" () -> (long _rv) " } ,
{ " SetTrackUsage " , ( PyCFunction ) TrackObj_SetTrackUsage , 1 ,
" (long usage) -> None " } ,
{ " GetTrackDuration " , ( PyCFunction ) TrackObj_GetTrackDuration , 1 ,
" () -> (TimeValue _rv) " } ,
{ " GetTrackOffset " , ( PyCFunction ) TrackObj_GetTrackOffset , 1 ,
" () -> (TimeValue _rv) " } ,
{ " SetTrackOffset " , ( PyCFunction ) TrackObj_SetTrackOffset , 1 ,
" (TimeValue movieOffsetTime) -> None " } ,
{ " GetTrackLayer " , ( PyCFunction ) TrackObj_GetTrackLayer , 1 ,
" () -> (short _rv) " } ,
{ " SetTrackLayer " , ( PyCFunction ) TrackObj_SetTrackLayer , 1 ,
" (short layer) -> None " } ,
{ " GetTrackAlternate " , ( PyCFunction ) TrackObj_GetTrackAlternate , 1 ,
" () -> (Track _rv) " } ,
{ " SetTrackAlternate " , ( PyCFunction ) TrackObj_SetTrackAlternate , 1 ,
" (Track alternateT) -> None " } ,
{ " GetTrackVolume " , ( PyCFunction ) TrackObj_GetTrackVolume , 1 ,
" () -> (short _rv) " } ,
{ " SetTrackVolume " , ( PyCFunction ) TrackObj_SetTrackVolume , 1 ,
" (short volume) -> None " } ,
{ " GetTrackDimensions " , ( PyCFunction ) TrackObj_GetTrackDimensions , 1 ,
" () -> (Fixed width, Fixed height) " } ,
{ " SetTrackDimensions " , ( PyCFunction ) TrackObj_SetTrackDimensions , 1 ,
" (Fixed width, Fixed height) -> None " } ,
{ " GetTrackUserData " , ( PyCFunction ) TrackObj_GetTrackUserData , 1 ,
" () -> (UserData _rv) " } ,
1998-04-21 12:23:55 -03:00
{ " GetTrackSoundLocalizationSettings " , ( PyCFunction ) TrackObj_GetTrackSoundLocalizationSettings , 1 ,
" () -> (Handle settings) " } ,
{ " SetTrackSoundLocalizationSettings " , ( PyCFunction ) TrackObj_SetTrackSoundLocalizationSettings , 1 ,
" (Handle settings) -> None " } ,
1995-12-09 10:05:56 -04:00
{ " NewTrackMedia " , ( PyCFunction ) TrackObj_NewTrackMedia , 1 ,
" (OSType mediaType, TimeScale timeScale, Handle dataRef, OSType dataRefType) -> (Media _rv) " } ,
{ " GetTrackMedia " , ( PyCFunction ) TrackObj_GetTrackMedia , 1 ,
" () -> (Media _rv) " } ,
{ " InsertMediaIntoTrack " , ( PyCFunction ) TrackObj_InsertMediaIntoTrack , 1 ,
" (TimeValue trackStart, TimeValue mediaTime, TimeValue mediaDuration, Fixed mediaRate) -> None " } ,
{ " InsertTrackSegment " , ( PyCFunction ) TrackObj_InsertTrackSegment , 1 ,
" (Track dstTrack, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None " } ,
{ " InsertEmptyTrackSegment " , ( PyCFunction ) TrackObj_InsertEmptyTrackSegment , 1 ,
" (TimeValue dstIn, TimeValue dstDuration) -> None " } ,
{ " DeleteTrackSegment " , ( PyCFunction ) TrackObj_DeleteTrackSegment , 1 ,
" (TimeValue startTime, TimeValue duration) -> None " } ,
{ " ScaleTrackSegment " , ( PyCFunction ) TrackObj_ScaleTrackSegment , 1 ,
" (TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None " } ,
{ " IsScrapMovie " , ( PyCFunction ) TrackObj_IsScrapMovie , 1 ,
" () -> (Component _rv) " } ,
{ " CopyTrackSettings " , ( PyCFunction ) TrackObj_CopyTrackSettings , 1 ,
" (Track dstTrack) -> None " } ,
{ " AddEmptyTrackToMovie " , ( PyCFunction ) TrackObj_AddEmptyTrackToMovie , 1 ,
" (Movie dstMovie, Handle dataRef, OSType dataRefType) -> (Track dstTrack) " } ,
{ " AddTrackReference " , ( PyCFunction ) TrackObj_AddTrackReference , 1 ,
" (Track refTrack, OSType refType) -> (long addedIndex) " } ,
{ " DeleteTrackReference " , ( PyCFunction ) TrackObj_DeleteTrackReference , 1 ,
" (OSType refType, long index) -> None " } ,
{ " SetTrackReference " , ( PyCFunction ) TrackObj_SetTrackReference , 1 ,
" (Track refTrack, OSType refType, long index) -> None " } ,
{ " GetTrackReference " , ( PyCFunction ) TrackObj_GetTrackReference , 1 ,
" (OSType refType, long index) -> (Track _rv) " } ,
{ " GetNextTrackReferenceType " , ( PyCFunction ) TrackObj_GetNextTrackReferenceType , 1 ,
" (OSType refType) -> (OSType _rv) " } ,
{ " GetTrackReferenceCount " , ( PyCFunction ) TrackObj_GetTrackReferenceCount , 1 ,
" (OSType refType) -> (long _rv) " } ,
{ " GetTrackEditRate " , ( PyCFunction ) TrackObj_GetTrackEditRate , 1 ,
" (TimeValue atTime) -> (Fixed _rv) " } ,
{ " GetTrackDataSize " , ( PyCFunction ) TrackObj_GetTrackDataSize , 1 ,
" (TimeValue startTime, TimeValue duration) -> (long _rv) " } ,
2000-12-12 18:10:21 -04:00
{ " GetTrackDataSize64 " , ( PyCFunction ) TrackObj_GetTrackDataSize64 , 1 ,
" (TimeValue startTime, TimeValue duration) -> (wide dataSize) " } ,
1995-12-09 10:05:56 -04:00
{ " PtInTrack " , ( PyCFunction ) TrackObj_PtInTrack , 1 ,
" (Point pt) -> (Boolean _rv) " } ,
{ " GetTrackNextInterestingTime " , ( PyCFunction ) TrackObj_GetTrackNextInterestingTime , 1 ,
" (short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration) " } ,
{ " GetTrackSegmentDisplayBoundsRgn " , ( PyCFunction ) TrackObj_GetTrackSegmentDisplayBoundsRgn , 1 ,
" (TimeValue time, TimeValue duration) -> (RgnHandle _rv) " } ,
{ " GetTrackStatus " , ( PyCFunction ) TrackObj_GetTrackStatus , 1 ,
" () -> (ComponentResult _rv) " } ,
{ " SetTrackLoadSettings " , ( PyCFunction ) TrackObj_SetTrackLoadSettings , 1 ,
" (TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints) -> None " } ,
{ " GetTrackLoadSettings " , ( PyCFunction ) TrackObj_GetTrackLoadSettings , 1 ,
" () -> (TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints) " } ,
{ NULL , NULL , 0 }
} ;
PyMethodChain TrackObj_chain = { TrackObj_methods , NULL } ;
2001-05-22 18:56:42 -03:00
static PyObject * TrackObj_getattr ( TrackObject * self , char * name )
1995-12-09 10:05:56 -04:00
{
return Py_FindMethodInChain ( & TrackObj_chain , ( PyObject * ) self , name ) ;
}
# define TrackObj_setattr NULL
1999-12-12 17:41:51 -04:00
# define TrackObj_compare NULL
# define TrackObj_repr NULL
# define TrackObj_hash NULL
1995-12-09 10:05:56 -04:00
PyTypeObject Track_Type = {
PyObject_HEAD_INIT ( & PyType_Type )
0 , /*ob_size*/
" Track " , /*tp_name*/
sizeof ( TrackObject ) , /*tp_basicsize*/
0 , /*tp_itemsize*/
/* methods */
( destructor ) TrackObj_dealloc , /*tp_dealloc*/
0 , /*tp_print*/
( getattrfunc ) TrackObj_getattr , /*tp_getattr*/
( setattrfunc ) TrackObj_setattr , /*tp_setattr*/
1999-12-12 17:41:51 -04:00
( cmpfunc ) TrackObj_compare , /*tp_compare*/
( reprfunc ) TrackObj_repr , /*tp_repr*/
( PyNumberMethods * ) 0 , /* tp_as_number */
( PySequenceMethods * ) 0 , /* tp_as_sequence */
( PyMappingMethods * ) 0 , /* tp_as_mapping */
( hashfunc ) TrackObj_hash , /*tp_hash*/
1995-12-09 10:05:56 -04:00
} ;
/* --------------------- End object type Track ---------------------- */
/* ----------------------- Object type Movie ------------------------ */
PyTypeObject Movie_Type ;
# define MovieObj_Check(x) ((x)->ob_type == &Movie_Type)
typedef struct MovieObject {
PyObject_HEAD
Movie ob_itself ;
} MovieObject ;
2001-05-22 18:56:42 -03:00
PyObject * MovieObj_New ( Movie itself )
1995-12-09 10:05:56 -04:00
{
MovieObject * it ;
if ( itself = = NULL ) {
PyErr_SetString ( Qt_Error , " Cannot create null Movie " ) ;
return NULL ;
}
it = PyObject_NEW ( MovieObject , & Movie_Type ) ;
if ( it = = NULL ) return NULL ;
it - > ob_itself = itself ;
return ( PyObject * ) it ;
}
2001-05-22 18:56:42 -03:00
MovieObj_Convert ( PyObject * v , Movie * p_itself )
1995-12-09 10:05:56 -04:00
{
if ( ! MovieObj_Check ( v ) )
{
PyErr_SetString ( PyExc_TypeError , " Movie required " ) ;
return 0 ;
}
* p_itself = ( ( MovieObject * ) v ) - > ob_itself ;
return 1 ;
}
2001-05-22 18:56:42 -03:00
static void MovieObj_dealloc ( MovieObject * self )
1995-12-09 10:05:56 -04:00
{
DisposeMovie ( self - > ob_itself ) ;
PyMem_DEL ( self ) ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_MoviesTask ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long maxMilliSecToUse ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& maxMilliSecToUse ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
MoviesTask ( _self - > ob_itself ,
maxMilliSecToUse ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_PrerollMovie ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
TimeValue time ;
Fixed Rate ;
if ( ! PyArg_ParseTuple ( _args , " lO& " ,
& time ,
PyMac_GetFixed , & Rate ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = PrerollMovie ( _self - > ob_itself ,
time ,
Rate ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_AbortPrePrerollMovie ( MovieObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
OSErr err ;
if ( ! PyArg_ParseTuple ( _args , " h " ,
& err ) )
return NULL ;
AbortPrePrerollMovie ( _self - > ob_itself ,
err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_LoadMovieIntoRam ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
TimeValue time ;
TimeValue duration ;
long flags ;
if ( ! PyArg_ParseTuple ( _args , " lll " ,
& time ,
& duration ,
& flags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = LoadMovieIntoRam ( _self - > ob_itself ,
time ,
duration ,
flags ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieActive ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Boolean active ;
if ( ! PyArg_ParseTuple ( _args , " b " ,
& active ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMovieActive ( _self - > ob_itself ,
active ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieActive ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Boolean _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieActive ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_StartMovie ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
StartMovie ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_StopMovie ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
StopMovie ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GoToBeginningOfMovie ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
GoToBeginningOfMovie ( _self - > ob_itself ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GoToEndOfMovie ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
GoToEndOfMovie ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_IsMovieDone ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Boolean _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = IsMovieDone ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMoviePreviewMode ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Boolean _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMoviePreviewMode ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
1995-11-30 13:42:08 -04:00
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMoviePreviewMode ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Boolean usePreview ;
if ( ! PyArg_ParseTuple ( _args , " b " ,
& usePreview ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMoviePreviewMode ( _self - > ob_itself ,
usePreview ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_ShowMoviePoster ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
ShowMoviePoster ( _self - > ob_itself ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieTimeBase ( MovieObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
TimeBase _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetMovieTimeBase ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
TimeBaseObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieMasterTimeBase ( MovieObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
TimeBase tb ;
TimeRecord slaveZero ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
TimeBaseObj_Convert , & tb ,
QtTimeRecord_Convert , & slaveZero ) )
return NULL ;
SetMovieMasterTimeBase ( _self - > ob_itself ,
tb ,
& slaveZero ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieMasterClock ( MovieObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
Component clockMeister ;
TimeRecord slaveZero ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
CmpObj_Convert , & clockMeister ,
QtTimeRecord_Convert , & slaveZero ) )
return NULL ;
SetMovieMasterClock ( _self - > ob_itself ,
clockMeister ,
& slaveZero ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieGWorld ( MovieObject * _self , PyObject * _args )
1997-04-09 12:53:46 -03:00
{
PyObject * _res = NULL ;
CGrafPtr port ;
GDHandle gdh ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetMovieGWorld ( _self - > ob_itself ,
& port ,
& gdh ) ;
_res = Py_BuildValue ( " O&O& " ,
GrafObj_New , port ,
1998-07-22 10:37:37 -03:00
OptResObj_New , gdh ) ;
1997-04-09 12:53:46 -03:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieGWorld ( MovieObject * _self , PyObject * _args )
1997-04-09 12:53:46 -03:00
{
PyObject * _res = NULL ;
CGrafPtr port ;
GDHandle gdh ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
GrafObj_Convert , & port ,
1998-07-22 10:37:37 -03:00
OptResObj_Convert , & gdh ) )
1997-04-09 12:53:46 -03:00
return NULL ;
SetMovieGWorld ( _self - > ob_itself ,
port ,
gdh ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieNaturalBoundsRect ( MovieObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
Rect naturalBounds ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetMovieNaturalBoundsRect ( _self - > ob_itself ,
& naturalBounds ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & naturalBounds ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetNextTrackForCompositing ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
Track _rv ;
1995-12-09 10:05:56 -04:00
Track theTrack ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
TrackObj_Convert , & theTrack ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetNextTrackForCompositing ( _self - > ob_itself ,
theTrack ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
TrackObj_New , _rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetPrevTrackForCompositing ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
Track _rv ;
1995-12-09 10:05:56 -04:00
Track theTrack ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
TrackObj_Convert , & theTrack ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetPrevTrackForCompositing ( _self - > ob_itself ,
theTrack ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
TrackObj_New , _rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMoviePict ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
PicHandle _rv ;
TimeValue time ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& time ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMoviePict ( _self - > ob_itself ,
time ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMoviePosterPict ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
PicHandle _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMoviePosterPict ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_UpdateMovie ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = UpdateMovie ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_InvalidateMovieRegion ( MovieObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
RgnHandle invalidRgn ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & invalidRgn ) )
return NULL ;
_err = InvalidateMovieRegion ( _self - > ob_itself ,
invalidRgn ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieBox ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Rect boxRect ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
GetMovieBox ( _self - > ob_itself ,
& boxRect ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & boxRect ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieBox ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Rect boxRect ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & boxRect ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMovieBox ( _self - > ob_itself ,
& boxRect ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieDisplayClipRgn ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
RgnHandle _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieDisplayClipRgn ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieDisplayClipRgn ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
RgnHandle theClip ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & theClip ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMovieDisplayClipRgn ( _self - > ob_itself ,
theClip ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieClipRgn ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
RgnHandle _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieClipRgn ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
ResObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieClipRgn ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
RgnHandle theClip ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
1995-12-09 10:05:56 -04:00
ResObj_Convert , & theClip ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMovieClipRgn ( _self - > ob_itself ,
theClip ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieDisplayBoundsRgn ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
RgnHandle _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieDisplayBoundsRgn ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieBoundsRgn ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
RgnHandle _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieBoundsRgn ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_PutMovieIntoHandle ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
Handle publicMovie ;
1995-12-09 10:05:56 -04:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & publicMovie ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = PutMovieIntoHandle ( _self - > ob_itself ,
publicMovie ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_PutMovieIntoDataFork ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
short fRefNum ;
long offset ;
long maxSize ;
if ( ! PyArg_ParseTuple ( _args , " hll " ,
& fRefNum ,
& offset ,
& maxSize ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = PutMovieIntoDataFork ( _self - > ob_itself ,
fRefNum ,
offset ,
maxSize ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_PutMovieIntoDataFork64 ( MovieObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
long fRefNum ;
wide offset ;
unsigned long maxSize ;
if ( ! PyArg_ParseTuple ( _args , " lO&l " ,
& fRefNum ,
PyMac_Getwide , & offset ,
& maxSize ) )
return NULL ;
_err = PutMovieIntoDataFork64 ( _self - > ob_itself ,
fRefNum ,
& offset ,
maxSize ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieCreationTime ( MovieObject * _self , PyObject * _args )
1997-04-09 12:53:46 -03:00
{
PyObject * _res = NULL ;
unsigned long _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetMovieCreationTime ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieModificationTime ( MovieObject * _self , PyObject * _args )
1997-04-09 12:53:46 -03:00
{
PyObject * _res = NULL ;
unsigned long _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetMovieModificationTime ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieTimeScale ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeScale _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieTimeScale ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieTimeScale ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeScale timeScale ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& timeScale ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMovieTimeScale ( _self - > ob_itself ,
timeScale ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieDuration ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieDuration ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
1995-11-30 13:42:08 -04:00
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieRate ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Fixed _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieRate ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildFixed , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieRate ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
Fixed rate ;
1995-12-09 10:05:56 -04:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
1995-11-30 13:42:08 -04:00
PyMac_GetFixed , & rate ) )
return NULL ;
1995-12-09 10:05:56 -04:00
SetMovieRate ( _self - > ob_itself ,
rate ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMoviePreferredRate ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Fixed _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMoviePreferredRate ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildFixed , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMoviePreferredRate ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Fixed rate ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetFixed , & rate ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMoviePreferredRate ( _self - > ob_itself ,
rate ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMoviePreferredVolume ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMoviePreferredVolume ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " h " ,
1995-11-30 13:42:08 -04:00
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMoviePreferredVolume ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short volume ;
if ( ! PyArg_ParseTuple ( _args , " h " ,
& volume ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMoviePreferredVolume ( _self - > ob_itself ,
volume ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieVolume ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieVolume ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieVolume ( MovieObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
short volume ;
if ( ! PyArg_ParseTuple ( _args , " h " ,
& volume ) )
return NULL ;
SetMovieVolume ( _self - > ob_itself ,
volume ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMoviePreviewTime ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue previewTime ;
TimeValue previewDuration ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
GetMoviePreviewTime ( _self - > ob_itself ,
& previewTime ,
& previewDuration ) ;
_res = Py_BuildValue ( " ll " ,
previewTime ,
previewDuration ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMoviePreviewTime ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue previewTime ;
TimeValue previewDuration ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& previewTime ,
& previewDuration ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMoviePreviewTime ( _self - > ob_itself ,
previewTime ,
previewDuration ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMoviePosterTime ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMoviePosterTime ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMoviePosterTime ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue posterTime ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& posterTime ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMoviePosterTime ( _self - > ob_itself ,
posterTime ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieSelection ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue selectionTime ;
TimeValue selectionDuration ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
GetMovieSelection ( _self - > ob_itself ,
& selectionTime ,
& selectionDuration ) ;
_res = Py_BuildValue ( " ll " ,
selectionTime ,
selectionDuration ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieSelection ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue selectionTime ;
TimeValue selectionDuration ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& selectionTime ,
& selectionDuration ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMovieSelection ( _self - > ob_itself ,
selectionTime ,
selectionDuration ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieActiveSegment ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue startTime ;
TimeValue duration ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& startTime ,
& duration ) )
return NULL ;
SetMovieActiveSegment ( _self - > ob_itself ,
startTime ,
duration ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieActiveSegment ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue startTime ;
TimeValue duration ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
GetMovieActiveSegment ( _self - > ob_itself ,
& startTime ,
& duration ) ;
_res = Py_BuildValue ( " ll " ,
startTime ,
duration ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieTime ( MovieObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
TimeValue _rv ;
TimeRecord currentTime ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetMovieTime ( _self - > ob_itself ,
& currentTime ) ;
_res = Py_BuildValue ( " lO& " ,
_rv ,
QtTimeRecord_New , & currentTime ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieTime ( MovieObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
TimeRecord newtime ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
QtTimeRecord_Convert , & newtime ) )
return NULL ;
SetMovieTime ( _self - > ob_itself ,
& newtime ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieTimeValue ( MovieObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
TimeValue newtime ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& newtime ) )
return NULL ;
SetMovieTimeValue ( _self - > ob_itself ,
newtime ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieUserData ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
UserData _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieUserData ( _self - > ob_itself ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
UserDataObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieTrackCount ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieTrackCount ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieTrack ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Track _rv ;
long trackID ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& trackID ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieTrack ( _self - > ob_itself ,
trackID ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
TrackObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieIndTrack ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Track _rv ;
long index ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " l " ,
1995-12-09 10:05:56 -04:00
& index ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieIndTrack ( _self - > ob_itself ,
index ) ;
_res = Py_BuildValue ( " O& " ,
TrackObj_New , _rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieIndTrackType ( MovieObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
Track _rv ;
long index ;
OSType trackType ;
long flags ;
if ( ! PyArg_ParseTuple ( _args , " lO&l " ,
& index ,
PyMac_GetOSType , & trackType ,
& flags ) )
return NULL ;
_rv = GetMovieIndTrackType ( _self - > ob_itself ,
index ,
trackType ,
flags ) ;
_res = Py_BuildValue ( " O& " ,
TrackObj_New , _rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_NewMovieTrack ( MovieObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
Track _rv ;
Fixed width ;
Fixed height ;
short trackVolume ;
if ( ! PyArg_ParseTuple ( _args , " O&O&h " ,
PyMac_GetFixed , & width ,
PyMac_GetFixed , & height ,
& trackVolume ) )
return NULL ;
_rv = NewMovieTrack ( _self - > ob_itself ,
width ,
height ,
trackVolume ) ;
_res = Py_BuildValue ( " O& " ,
TrackObj_New , _rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetAutoTrackAlternatesEnabled ( MovieObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
Boolean enable ;
if ( ! PyArg_ParseTuple ( _args , " b " ,
& enable ) )
return NULL ;
SetAutoTrackAlternatesEnabled ( _self - > ob_itself ,
enable ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SelectMovieAlternates ( MovieObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
SelectMovieAlternates ( _self - > ob_itself ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_InsertMovieSegment ( MovieObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
Movie dstMovie ;
TimeValue srcIn ;
TimeValue srcDuration ;
TimeValue dstIn ;
if ( ! PyArg_ParseTuple ( _args , " O&lll " ,
MovieObj_Convert , & dstMovie ,
& srcIn ,
& srcDuration ,
& dstIn ) )
return NULL ;
_err = InsertMovieSegment ( _self - > ob_itself ,
dstMovie ,
srcIn ,
srcDuration ,
dstIn ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_InsertEmptyMovieSegment ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
TimeValue dstIn ;
TimeValue dstDuration ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " ll " ,
1995-12-09 10:05:56 -04:00
& dstIn ,
& dstDuration ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = InsertEmptyMovieSegment ( _self - > ob_itself ,
dstIn ,
dstDuration ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_DeleteMovieSegment ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
TimeValue startTime ;
TimeValue duration ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& startTime ,
& duration ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = DeleteMovieSegment ( _self - > ob_itself ,
startTime ,
duration ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_ScaleMovieSegment ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
TimeValue startTime ;
TimeValue oldDuration ;
TimeValue newDuration ;
if ( ! PyArg_ParseTuple ( _args , " lll " ,
& startTime ,
& oldDuration ,
& newDuration ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = ScaleMovieSegment ( _self - > ob_itself ,
startTime ,
oldDuration ,
newDuration ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_CutMovieSelection ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Movie _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = CutMovieSelection ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
MovieObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_CopyMovieSelection ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Movie _rv ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = CopyMovieSelection ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
MovieObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_PasteMovieSelection ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Movie src ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
MovieObj_Convert , & src ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
PasteMovieSelection ( _self - > ob_itself ,
src ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_AddMovieSelection ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Movie src ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
1995-12-09 10:05:56 -04:00
MovieObj_Convert , & src ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
AddMovieSelection ( _self - > ob_itself ,
src ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_ClearMovieSelection ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
ClearMovieSelection ( _self - > ob_itself ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_PutMovieIntoTypedHandle ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
Track targetTrack ;
1995-11-30 13:42:08 -04:00
OSType handleType ;
1995-12-09 10:05:56 -04:00
Handle publicMovie ;
TimeValue start ;
TimeValue dur ;
1995-11-30 13:42:08 -04:00
long flags ;
ComponentInstance userComp ;
1995-12-09 10:05:56 -04:00
if ( ! PyArg_ParseTuple ( _args , " O&O&O&lllO& " ,
TrackObj_Convert , & targetTrack ,
1995-11-30 13:42:08 -04:00
PyMac_GetOSType , & handleType ,
1995-12-09 10:05:56 -04:00
ResObj_Convert , & publicMovie ,
& start ,
& dur ,
1995-11-30 13:42:08 -04:00
& flags ,
CmpInstObj_Convert , & userComp ) )
return NULL ;
1995-12-09 10:05:56 -04:00
_err = PutMovieIntoTypedHandle ( _self - > ob_itself ,
targetTrack ,
handleType ,
publicMovie ,
start ,
dur ,
flags ,
userComp ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_CopyMovieSettings ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
Movie dstMovie ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
1995-12-09 10:05:56 -04:00
MovieObj_Convert , & dstMovie ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = CopyMovieSettings ( _self - > ob_itself ,
dstMovie ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-12-09 10:05:56 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_ConvertMovieToFile ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
Track onlyTrack ;
FSSpec outputFile ;
OSType fileType ;
1995-11-30 13:42:08 -04:00
OSType creator ;
ScriptCode scriptTag ;
1995-12-09 10:05:56 -04:00
short resID ;
long flags ;
ComponentInstance userComp ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O&O&hlO& " ,
TrackObj_Convert , & onlyTrack ,
PyMac_GetFSSpec , & outputFile ,
PyMac_GetOSType , & fileType ,
1995-11-30 13:42:08 -04:00
PyMac_GetOSType , & creator ,
& scriptTag ,
1995-12-09 10:05:56 -04:00
& flags ,
CmpInstObj_Convert , & userComp ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = ConvertMovieToFile ( _self - > ob_itself ,
onlyTrack ,
& outputFile ,
fileType ,
creator ,
scriptTag ,
& resID ,
flags ,
userComp ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-12-09 10:05:56 -04:00
_res = Py_BuildValue ( " h " ,
resID ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieDataSize ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long _rv ;
TimeValue startTime ;
TimeValue duration ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& startTime ,
& duration ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieDataSize ( _self - > ob_itself ,
startTime ,
duration ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieDataSize64 ( MovieObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
TimeValue startTime ;
TimeValue duration ;
wide dataSize ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& startTime ,
& duration ) )
return NULL ;
_err = GetMovieDataSize64 ( _self - > ob_itself ,
startTime ,
duration ,
& dataSize ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_Buildwide , dataSize ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_PtInMovie ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Boolean _rv ;
Point pt ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetPoint , & pt ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = PtInMovie ( _self - > ob_itself ,
pt ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieLanguage ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long language ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& language ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetMovieLanguage ( _self - > ob_itself ,
language ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieNextInterestingTime ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
short interestingTimeFlags ;
short numMediaTypes ;
OSType whichMediaTypes ;
TimeValue time ;
Fixed rate ;
TimeValue interestingTime ;
TimeValue interestingDuration ;
if ( ! PyArg_ParseTuple ( _args , " hhO&lO& " ,
& interestingTimeFlags ,
& numMediaTypes ,
PyMac_GetOSType , & whichMediaTypes ,
& time ,
PyMac_GetFixed , & rate ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
GetMovieNextInterestingTime ( _self - > ob_itself ,
interestingTimeFlags ,
numMediaTypes ,
& whichMediaTypes ,
time ,
rate ,
& interestingTime ,
& interestingDuration ) ;
_res = Py_BuildValue ( " ll " ,
interestingTime ,
interestingDuration ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_AddMovieResource ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
1995-12-09 10:05:56 -04:00
short resRefNum ;
short resId ;
Str255 resName ;
if ( ! PyArg_ParseTuple ( _args , " hO& " ,
& resRefNum ,
PyMac_GetStr255 , resName ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = AddMovieResource ( _self - > ob_itself ,
resRefNum ,
& resId ,
resName ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-12-09 10:05:56 -04:00
_res = Py_BuildValue ( " h " ,
resId ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_UpdateMovieResource ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
short resRefNum ;
short resId ;
1995-12-09 10:05:56 -04:00
Str255 resName ;
if ( ! PyArg_ParseTuple ( _args , " hhO& " ,
1995-11-30 13:42:08 -04:00
& resRefNum ,
1995-12-09 10:05:56 -04:00
& resId ,
PyMac_GetStr255 , resName ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = UpdateMovieResource ( _self - > ob_itself ,
resRefNum ,
resId ,
resName ) ;
1995-11-30 13:42:08 -04:00
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_HasMovieChanged ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Boolean _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = HasMovieChanged ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
1995-11-30 13:42:08 -04:00
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_ClearMovieChanged ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
ClearMovieChanged ( _self - > ob_itself ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieDefaultDataRef ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
Handle dataRef ;
OSType dataRefType ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & dataRef ,
PyMac_GetOSType , & dataRefType ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = SetMovieDefaultDataRef ( _self - > ob_itself ,
dataRef ,
dataRefType ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieDefaultDataRef ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
Handle dataRef ;
OSType dataRefType ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = GetMovieDefaultDataRef ( _self - > ob_itself ,
& dataRef ,
& dataRefType ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O&O& " ,
ResObj_New , dataRef ,
PyMac_BuildOSType , dataRefType ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-01-09 18:09:31 -04:00
# if !TARGET_API_MAC_CARBON
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieAnchorDataRef ( MovieObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
Handle dataRef ;
OSType dataRefType ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & dataRef ,
PyMac_GetOSType , & dataRefType ) )
return NULL ;
_err = SetMovieAnchorDataRef ( _self - > ob_itself ,
dataRef ,
dataRefType ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-01-09 18:09:31 -04:00
# endif
# if !TARGET_API_MAC_CARBON
2000-12-12 18:10:21 -04:00
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieAnchorDataRef ( MovieObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
Handle dataRef ;
OSType dataRefType ;
long outFlags ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_err = GetMovieAnchorDataRef ( _self - > ob_itself ,
& dataRef ,
& dataRefType ,
& outFlags ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O&O&l " ,
ResObj_New , dataRef ,
PyMac_BuildOSType , dataRefType ,
outFlags ) ;
return _res ;
}
2001-01-09 18:09:31 -04:00
# endif
2000-12-12 18:10:21 -04:00
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMovieColorTable ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
CTabHandle ctab ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
1995-12-09 10:05:56 -04:00
ResObj_Convert , & ctab ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = SetMovieColorTable ( _self - > ob_itself ,
ctab ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-11-30 13:42:08 -04:00
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieColorTable ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
CTabHandle ctab ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = GetMovieColorTable ( _self - > ob_itself ,
& ctab ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
1995-12-09 10:05:56 -04:00
ResObj_New , ctab ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_FlattenMovie ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
long movieFlattenFlags ;
FSSpec theFile ;
OSType creator ;
ScriptCode scriptTag ;
long createMovieFileFlags ;
short resId ;
Str255 resName ;
if ( ! PyArg_ParseTuple ( _args , " lO&O&hlO& " ,
& movieFlattenFlags ,
PyMac_GetFSSpec , & theFile ,
PyMac_GetOSType , & creator ,
& scriptTag ,
& createMovieFileFlags ,
PyMac_GetStr255 , resName ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
FlattenMovie ( _self - > ob_itself ,
movieFlattenFlags ,
& theFile ,
creator ,
scriptTag ,
createMovieFileFlags ,
& resId ,
resName ) ;
_res = Py_BuildValue ( " h " ,
resId ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_FlattenMovieData ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
Movie _rv ;
1995-12-09 10:05:56 -04:00
long movieFlattenFlags ;
FSSpec theFile ;
OSType creator ;
ScriptCode scriptTag ;
long createMovieFileFlags ;
if ( ! PyArg_ParseTuple ( _args , " lO&O&hl " ,
& movieFlattenFlags ,
PyMac_GetFSSpec , & theFile ,
PyMac_GetOSType , & creator ,
& scriptTag ,
& createMovieFileFlags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = FlattenMovieData ( _self - > ob_itself ,
movieFlattenFlags ,
& theFile ,
creator ,
scriptTag ,
createMovieFileFlags ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " O& " ,
MovieObj_New , _rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_MovieSearchText ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
Ptr text ;
long size ;
long searchFlags ;
Track searchTrack ;
TimeValue searchTime ;
long searchOffset ;
if ( ! PyArg_ParseTuple ( _args , " sll " ,
& text ,
& size ,
& searchFlags ) )
return NULL ;
_err = MovieSearchText ( _self - > ob_itself ,
text ,
size ,
searchFlags ,
& searchTrack ,
& searchTime ,
& searchOffset ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O&ll " ,
TrackObj_New , searchTrack ,
searchTime ,
searchOffset ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetPosterBox ( MovieObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
Rect boxRect ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetPosterBox ( _self - > ob_itself ,
& boxRect ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & boxRect ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetPosterBox ( MovieObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
Rect boxRect ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
1995-12-09 10:05:56 -04:00
PyMac_GetRect , & boxRect ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
SetPosterBox ( _self - > ob_itself ,
& boxRect ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieSegmentDisplayBoundsRgn ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
RgnHandle _rv ;
TimeValue time ;
TimeValue duration ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& time ,
& duration ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieSegmentDisplayBoundsRgn ( _self - > ob_itself ,
time ,
duration ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieStatus ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
1995-12-09 10:05:56 -04:00
Track firstProblemTrack ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetMovieStatus ( _self - > ob_itself ,
& firstProblemTrack ) ;
_res = Py_BuildValue ( " lO& " ,
_rv ,
TrackObj_New , firstProblemTrack ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-01-09 18:09:31 -04:00
# if !TARGET_API_MAC_CARBON
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMovieLoadState ( MovieObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
long _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetMovieLoadState ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-01-09 18:09:31 -04:00
# endif
2000-12-12 18:10:21 -04:00
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_NewMovieController ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
MovieController _rv ;
Rect movieRect ;
long someFlags ;
if ( ! PyArg_ParseTuple ( _args , " O&l " ,
PyMac_GetRect , & movieRect ,
& someFlags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = NewMovieController ( _self - > ob_itself ,
& movieRect ,
someFlags ) ;
_res = Py_BuildValue ( " O& " ,
MovieCtlObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_PutMovieOnScrap ( MovieObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
long movieScrapFlags ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& movieScrapFlags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = PutMovieOnScrap ( _self - > ob_itself ,
movieScrapFlags ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_SetMoviePlayHints ( MovieObject * _self , PyObject * _args )
1995-12-09 10:05:56 -04:00
{
PyObject * _res = NULL ;
long flags ;
long flagsMask ;
if ( ! PyArg_ParseTuple ( _args , " ll " ,
& flags ,
& flagsMask ) )
return NULL ;
SetMoviePlayHints ( _self - > ob_itself ,
flags ,
flagsMask ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_GetMaxLoadedTimeInMovie ( MovieObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
TimeValue time ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_err = GetMaxLoadedTimeInMovie ( _self - > ob_itself ,
& time ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " l " ,
time ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_QTMovieNeedsTimeTable ( MovieObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
Boolean needsTimeTable ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_err = QTMovieNeedsTimeTable ( _self - > ob_itself ,
& needsTimeTable ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " b " ,
needsTimeTable ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_QTGetDataRefMaxFileOffset ( MovieObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
OSType dataRefType ;
Handle dataRef ;
long offset ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetOSType , & dataRefType ,
ResObj_Convert , & dataRef ) )
return NULL ;
_err = QTGetDataRefMaxFileOffset ( _self - > ob_itself ,
dataRefType ,
dataRef ,
& offset ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " l " ,
offset ) ;
return _res ;
}
1995-12-09 10:05:56 -04:00
static PyMethodDef MovieObj_methods [ ] = {
{ " MoviesTask " , ( PyCFunction ) MovieObj_MoviesTask , 1 ,
" (long maxMilliSecToUse) -> None " } ,
{ " PrerollMovie " , ( PyCFunction ) MovieObj_PrerollMovie , 1 ,
" (TimeValue time, Fixed Rate) -> None " } ,
2000-12-12 18:10:21 -04:00
{ " AbortPrePrerollMovie " , ( PyCFunction ) MovieObj_AbortPrePrerollMovie , 1 ,
" (OSErr err) -> None " } ,
1995-12-09 10:05:56 -04:00
{ " LoadMovieIntoRam " , ( PyCFunction ) MovieObj_LoadMovieIntoRam , 1 ,
" (TimeValue time, TimeValue duration, long flags) -> None " } ,
{ " SetMovieActive " , ( PyCFunction ) MovieObj_SetMovieActive , 1 ,
" (Boolean active) -> None " } ,
{ " GetMovieActive " , ( PyCFunction ) MovieObj_GetMovieActive , 1 ,
" () -> (Boolean _rv) " } ,
{ " StartMovie " , ( PyCFunction ) MovieObj_StartMovie , 1 ,
" () -> None " } ,
{ " StopMovie " , ( PyCFunction ) MovieObj_StopMovie , 1 ,
" () -> None " } ,
{ " GoToBeginningOfMovie " , ( PyCFunction ) MovieObj_GoToBeginningOfMovie , 1 ,
" () -> None " } ,
{ " GoToEndOfMovie " , ( PyCFunction ) MovieObj_GoToEndOfMovie , 1 ,
" () -> None " } ,
{ " IsMovieDone " , ( PyCFunction ) MovieObj_IsMovieDone , 1 ,
" () -> (Boolean _rv) " } ,
{ " GetMoviePreviewMode " , ( PyCFunction ) MovieObj_GetMoviePreviewMode , 1 ,
" () -> (Boolean _rv) " } ,
{ " SetMoviePreviewMode " , ( PyCFunction ) MovieObj_SetMoviePreviewMode , 1 ,
" (Boolean usePreview) -> None " } ,
{ " ShowMoviePoster " , ( PyCFunction ) MovieObj_ShowMoviePoster , 1 ,
" () -> None " } ,
{ " GetMovieTimeBase " , ( PyCFunction ) MovieObj_GetMovieTimeBase , 1 ,
" () -> (TimeBase _rv) " } ,
1998-04-23 10:22:44 -03:00
{ " SetMovieMasterTimeBase " , ( PyCFunction ) MovieObj_SetMovieMasterTimeBase , 1 ,
" (TimeBase tb, TimeRecord slaveZero) -> None " } ,
{ " SetMovieMasterClock " , ( PyCFunction ) MovieObj_SetMovieMasterClock , 1 ,
" (Component clockMeister, TimeRecord slaveZero) -> None " } ,
1997-04-09 12:53:46 -03:00
{ " GetMovieGWorld " , ( PyCFunction ) MovieObj_GetMovieGWorld , 1 ,
" () -> (CGrafPtr port, GDHandle gdh) " } ,
{ " SetMovieGWorld " , ( PyCFunction ) MovieObj_SetMovieGWorld , 1 ,
" (CGrafPtr port, GDHandle gdh) -> None " } ,
1998-04-21 12:23:55 -03:00
{ " GetMovieNaturalBoundsRect " , ( PyCFunction ) MovieObj_GetMovieNaturalBoundsRect , 1 ,
" () -> (Rect naturalBounds) " } ,
1995-12-09 10:05:56 -04:00
{ " GetNextTrackForCompositing " , ( PyCFunction ) MovieObj_GetNextTrackForCompositing , 1 ,
" (Track theTrack) -> (Track _rv) " } ,
{ " GetPrevTrackForCompositing " , ( PyCFunction ) MovieObj_GetPrevTrackForCompositing , 1 ,
" (Track theTrack) -> (Track _rv) " } ,
{ " GetMoviePict " , ( PyCFunction ) MovieObj_GetMoviePict , 1 ,
" (TimeValue time) -> (PicHandle _rv) " } ,
{ " GetMoviePosterPict " , ( PyCFunction ) MovieObj_GetMoviePosterPict , 1 ,
" () -> (PicHandle _rv) " } ,
{ " UpdateMovie " , ( PyCFunction ) MovieObj_UpdateMovie , 1 ,
" () -> None " } ,
1998-04-21 12:23:55 -03:00
{ " InvalidateMovieRegion " , ( PyCFunction ) MovieObj_InvalidateMovieRegion , 1 ,
" (RgnHandle invalidRgn) -> None " } ,
1995-12-09 10:05:56 -04:00
{ " GetMovieBox " , ( PyCFunction ) MovieObj_GetMovieBox , 1 ,
" () -> (Rect boxRect) " } ,
{ " SetMovieBox " , ( PyCFunction ) MovieObj_SetMovieBox , 1 ,
" (Rect boxRect) -> None " } ,
{ " GetMovieDisplayClipRgn " , ( PyCFunction ) MovieObj_GetMovieDisplayClipRgn , 1 ,
" () -> (RgnHandle _rv) " } ,
{ " SetMovieDisplayClipRgn " , ( PyCFunction ) MovieObj_SetMovieDisplayClipRgn , 1 ,
" (RgnHandle theClip) -> None " } ,
{ " GetMovieClipRgn " , ( PyCFunction ) MovieObj_GetMovieClipRgn , 1 ,
" () -> (RgnHandle _rv) " } ,
{ " SetMovieClipRgn " , ( PyCFunction ) MovieObj_SetMovieClipRgn , 1 ,
" (RgnHandle theClip) -> None " } ,
{ " GetMovieDisplayBoundsRgn " , ( PyCFunction ) MovieObj_GetMovieDisplayBoundsRgn , 1 ,
" () -> (RgnHandle _rv) " } ,
{ " GetMovieBoundsRgn " , ( PyCFunction ) MovieObj_GetMovieBoundsRgn , 1 ,
" () -> (RgnHandle _rv) " } ,
{ " PutMovieIntoHandle " , ( PyCFunction ) MovieObj_PutMovieIntoHandle , 1 ,
" (Handle publicMovie) -> None " } ,
{ " PutMovieIntoDataFork " , ( PyCFunction ) MovieObj_PutMovieIntoDataFork , 1 ,
" (short fRefNum, long offset, long maxSize) -> None " } ,
2000-12-12 18:10:21 -04:00
{ " PutMovieIntoDataFork64 " , ( PyCFunction ) MovieObj_PutMovieIntoDataFork64 , 1 ,
" (long fRefNum, wide offset, unsigned long maxSize) -> None " } ,
1997-04-09 12:53:46 -03:00
{ " GetMovieCreationTime " , ( PyCFunction ) MovieObj_GetMovieCreationTime , 1 ,
" () -> (unsigned long _rv) " } ,
{ " GetMovieModificationTime " , ( PyCFunction ) MovieObj_GetMovieModificationTime , 1 ,
" () -> (unsigned long _rv) " } ,
1995-12-09 10:05:56 -04:00
{ " GetMovieTimeScale " , ( PyCFunction ) MovieObj_GetMovieTimeScale , 1 ,
" () -> (TimeScale _rv) " } ,
{ " SetMovieTimeScale " , ( PyCFunction ) MovieObj_SetMovieTimeScale , 1 ,
" (TimeScale timeScale) -> None " } ,
{ " GetMovieDuration " , ( PyCFunction ) MovieObj_GetMovieDuration , 1 ,
" () -> (TimeValue _rv) " } ,
{ " GetMovieRate " , ( PyCFunction ) MovieObj_GetMovieRate , 1 ,
" () -> (Fixed _rv) " } ,
{ " SetMovieRate " , ( PyCFunction ) MovieObj_SetMovieRate , 1 ,
" (Fixed rate) -> None " } ,
{ " GetMoviePreferredRate " , ( PyCFunction ) MovieObj_GetMoviePreferredRate , 1 ,
" () -> (Fixed _rv) " } ,
{ " SetMoviePreferredRate " , ( PyCFunction ) MovieObj_SetMoviePreferredRate , 1 ,
" (Fixed rate) -> None " } ,
{ " GetMoviePreferredVolume " , ( PyCFunction ) MovieObj_GetMoviePreferredVolume , 1 ,
" () -> (short _rv) " } ,
{ " SetMoviePreferredVolume " , ( PyCFunction ) MovieObj_SetMoviePreferredVolume , 1 ,
" (short volume) -> None " } ,
{ " GetMovieVolume " , ( PyCFunction ) MovieObj_GetMovieVolume , 1 ,
" () -> (short _rv) " } ,
{ " SetMovieVolume " , ( PyCFunction ) MovieObj_SetMovieVolume , 1 ,
" (short volume) -> None " } ,
{ " GetMoviePreviewTime " , ( PyCFunction ) MovieObj_GetMoviePreviewTime , 1 ,
" () -> (TimeValue previewTime, TimeValue previewDuration) " } ,
{ " SetMoviePreviewTime " , ( PyCFunction ) MovieObj_SetMoviePreviewTime , 1 ,
" (TimeValue previewTime, TimeValue previewDuration) -> None " } ,
{ " GetMoviePosterTime " , ( PyCFunction ) MovieObj_GetMoviePosterTime , 1 ,
" () -> (TimeValue _rv) " } ,
{ " SetMoviePosterTime " , ( PyCFunction ) MovieObj_SetMoviePosterTime , 1 ,
" (TimeValue posterTime) -> None " } ,
{ " GetMovieSelection " , ( PyCFunction ) MovieObj_GetMovieSelection , 1 ,
" () -> (TimeValue selectionTime, TimeValue selectionDuration) " } ,
{ " SetMovieSelection " , ( PyCFunction ) MovieObj_SetMovieSelection , 1 ,
" (TimeValue selectionTime, TimeValue selectionDuration) -> None " } ,
{ " SetMovieActiveSegment " , ( PyCFunction ) MovieObj_SetMovieActiveSegment , 1 ,
" (TimeValue startTime, TimeValue duration) -> None " } ,
{ " GetMovieActiveSegment " , ( PyCFunction ) MovieObj_GetMovieActiveSegment , 1 ,
" () -> (TimeValue startTime, TimeValue duration) " } ,
1998-04-23 10:22:44 -03:00
{ " GetMovieTime " , ( PyCFunction ) MovieObj_GetMovieTime , 1 ,
" () -> (TimeValue _rv, TimeRecord currentTime) " } ,
{ " SetMovieTime " , ( PyCFunction ) MovieObj_SetMovieTime , 1 ,
" (TimeRecord newtime) -> None " } ,
1995-12-09 10:05:56 -04:00
{ " SetMovieTimeValue " , ( PyCFunction ) MovieObj_SetMovieTimeValue , 1 ,
" (TimeValue newtime) -> None " } ,
{ " GetMovieUserData " , ( PyCFunction ) MovieObj_GetMovieUserData , 1 ,
" () -> (UserData _rv) " } ,
{ " GetMovieTrackCount " , ( PyCFunction ) MovieObj_GetMovieTrackCount , 1 ,
" () -> (long _rv) " } ,
{ " GetMovieTrack " , ( PyCFunction ) MovieObj_GetMovieTrack , 1 ,
" (long trackID) -> (Track _rv) " } ,
{ " GetMovieIndTrack " , ( PyCFunction ) MovieObj_GetMovieIndTrack , 1 ,
" (long index) -> (Track _rv) " } ,
{ " GetMovieIndTrackType " , ( PyCFunction ) MovieObj_GetMovieIndTrackType , 1 ,
" (long index, OSType trackType, long flags) -> (Track _rv) " } ,
{ " NewMovieTrack " , ( PyCFunction ) MovieObj_NewMovieTrack , 1 ,
" (Fixed width, Fixed height, short trackVolume) -> (Track _rv) " } ,
{ " SetAutoTrackAlternatesEnabled " , ( PyCFunction ) MovieObj_SetAutoTrackAlternatesEnabled , 1 ,
" (Boolean enable) -> None " } ,
{ " SelectMovieAlternates " , ( PyCFunction ) MovieObj_SelectMovieAlternates , 1 ,
" () -> None " } ,
{ " InsertMovieSegment " , ( PyCFunction ) MovieObj_InsertMovieSegment , 1 ,
" (Movie dstMovie, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None " } ,
{ " InsertEmptyMovieSegment " , ( PyCFunction ) MovieObj_InsertEmptyMovieSegment , 1 ,
" (TimeValue dstIn, TimeValue dstDuration) -> None " } ,
{ " DeleteMovieSegment " , ( PyCFunction ) MovieObj_DeleteMovieSegment , 1 ,
" (TimeValue startTime, TimeValue duration) -> None " } ,
{ " ScaleMovieSegment " , ( PyCFunction ) MovieObj_ScaleMovieSegment , 1 ,
" (TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None " } ,
{ " CutMovieSelection " , ( PyCFunction ) MovieObj_CutMovieSelection , 1 ,
" () -> (Movie _rv) " } ,
{ " CopyMovieSelection " , ( PyCFunction ) MovieObj_CopyMovieSelection , 1 ,
" () -> (Movie _rv) " } ,
{ " PasteMovieSelection " , ( PyCFunction ) MovieObj_PasteMovieSelection , 1 ,
" (Movie src) -> None " } ,
{ " AddMovieSelection " , ( PyCFunction ) MovieObj_AddMovieSelection , 1 ,
" (Movie src) -> None " } ,
{ " ClearMovieSelection " , ( PyCFunction ) MovieObj_ClearMovieSelection , 1 ,
" () -> None " } ,
{ " PutMovieIntoTypedHandle " , ( PyCFunction ) MovieObj_PutMovieIntoTypedHandle , 1 ,
" (Track targetTrack, OSType handleType, Handle publicMovie, TimeValue start, TimeValue dur, long flags, ComponentInstance userComp) -> None " } ,
{ " CopyMovieSettings " , ( PyCFunction ) MovieObj_CopyMovieSettings , 1 ,
" (Movie dstMovie) -> None " } ,
{ " ConvertMovieToFile " , ( PyCFunction ) MovieObj_ConvertMovieToFile , 1 ,
" (Track onlyTrack, FSSpec outputFile, OSType fileType, OSType creator, ScriptCode scriptTag, long flags, ComponentInstance userComp) -> (short resID) " } ,
{ " GetMovieDataSize " , ( PyCFunction ) MovieObj_GetMovieDataSize , 1 ,
" (TimeValue startTime, TimeValue duration) -> (long _rv) " } ,
2000-12-12 18:10:21 -04:00
{ " GetMovieDataSize64 " , ( PyCFunction ) MovieObj_GetMovieDataSize64 , 1 ,
" (TimeValue startTime, TimeValue duration) -> (wide dataSize) " } ,
1995-12-09 10:05:56 -04:00
{ " PtInMovie " , ( PyCFunction ) MovieObj_PtInMovie , 1 ,
" (Point pt) -> (Boolean _rv) " } ,
{ " SetMovieLanguage " , ( PyCFunction ) MovieObj_SetMovieLanguage , 1 ,
" (long language) -> None " } ,
{ " GetMovieNextInterestingTime " , ( PyCFunction ) MovieObj_GetMovieNextInterestingTime , 1 ,
" (short interestingTimeFlags, short numMediaTypes, OSType whichMediaTypes, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration) " } ,
{ " AddMovieResource " , ( PyCFunction ) MovieObj_AddMovieResource , 1 ,
" (short resRefNum, Str255 resName) -> (short resId) " } ,
{ " UpdateMovieResource " , ( PyCFunction ) MovieObj_UpdateMovieResource , 1 ,
" (short resRefNum, short resId, Str255 resName) -> None " } ,
{ " HasMovieChanged " , ( PyCFunction ) MovieObj_HasMovieChanged , 1 ,
" () -> (Boolean _rv) " } ,
{ " ClearMovieChanged " , ( PyCFunction ) MovieObj_ClearMovieChanged , 1 ,
" () -> None " } ,
{ " SetMovieDefaultDataRef " , ( PyCFunction ) MovieObj_SetMovieDefaultDataRef , 1 ,
" (Handle dataRef, OSType dataRefType) -> None " } ,
{ " GetMovieDefaultDataRef " , ( PyCFunction ) MovieObj_GetMovieDefaultDataRef , 1 ,
" () -> (Handle dataRef, OSType dataRefType) " } ,
2001-01-09 18:09:31 -04:00
# if !TARGET_API_MAC_CARBON
2000-12-12 18:10:21 -04:00
{ " SetMovieAnchorDataRef " , ( PyCFunction ) MovieObj_SetMovieAnchorDataRef , 1 ,
" (Handle dataRef, OSType dataRefType) -> None " } ,
2001-01-09 18:09:31 -04:00
# endif
# if !TARGET_API_MAC_CARBON
2000-12-12 18:10:21 -04:00
{ " GetMovieAnchorDataRef " , ( PyCFunction ) MovieObj_GetMovieAnchorDataRef , 1 ,
" () -> (Handle dataRef, OSType dataRefType, long outFlags) " } ,
2001-01-09 18:09:31 -04:00
# endif
1995-12-09 10:05:56 -04:00
{ " SetMovieColorTable " , ( PyCFunction ) MovieObj_SetMovieColorTable , 1 ,
" (CTabHandle ctab) -> None " } ,
{ " GetMovieColorTable " , ( PyCFunction ) MovieObj_GetMovieColorTable , 1 ,
" () -> (CTabHandle ctab) " } ,
{ " FlattenMovie " , ( PyCFunction ) MovieObj_FlattenMovie , 1 ,
" (long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, Str255 resName) -> (short resId) " } ,
{ " FlattenMovieData " , ( PyCFunction ) MovieObj_FlattenMovieData , 1 ,
" (long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (Movie _rv) " } ,
{ " MovieSearchText " , ( PyCFunction ) MovieObj_MovieSearchText , 1 ,
" (Ptr text, long size, long searchFlags) -> (Track searchTrack, TimeValue searchTime, long searchOffset) " } ,
{ " GetPosterBox " , ( PyCFunction ) MovieObj_GetPosterBox , 1 ,
" () -> (Rect boxRect) " } ,
{ " SetPosterBox " , ( PyCFunction ) MovieObj_SetPosterBox , 1 ,
" (Rect boxRect) -> None " } ,
{ " GetMovieSegmentDisplayBoundsRgn " , ( PyCFunction ) MovieObj_GetMovieSegmentDisplayBoundsRgn , 1 ,
" (TimeValue time, TimeValue duration) -> (RgnHandle _rv) " } ,
{ " GetMovieStatus " , ( PyCFunction ) MovieObj_GetMovieStatus , 1 ,
" () -> (ComponentResult _rv, Track firstProblemTrack) " } ,
2001-01-09 18:09:31 -04:00
# if !TARGET_API_MAC_CARBON
2000-12-12 18:10:21 -04:00
{ " GetMovieLoadState " , ( PyCFunction ) MovieObj_GetMovieLoadState , 1 ,
" () -> (long _rv) " } ,
2001-01-09 18:09:31 -04:00
# endif
1995-12-09 10:05:56 -04:00
{ " NewMovieController " , ( PyCFunction ) MovieObj_NewMovieController , 1 ,
" (Rect movieRect, long someFlags) -> (MovieController _rv) " } ,
{ " PutMovieOnScrap " , ( PyCFunction ) MovieObj_PutMovieOnScrap , 1 ,
" (long movieScrapFlags) -> None " } ,
{ " SetMoviePlayHints " , ( PyCFunction ) MovieObj_SetMoviePlayHints , 1 ,
" (long flags, long flagsMask) -> None " } ,
1998-04-21 12:23:55 -03:00
{ " GetMaxLoadedTimeInMovie " , ( PyCFunction ) MovieObj_GetMaxLoadedTimeInMovie , 1 ,
" () -> (TimeValue time) " } ,
{ " QTMovieNeedsTimeTable " , ( PyCFunction ) MovieObj_QTMovieNeedsTimeTable , 1 ,
" () -> (Boolean needsTimeTable) " } ,
{ " QTGetDataRefMaxFileOffset " , ( PyCFunction ) MovieObj_QTGetDataRefMaxFileOffset , 1 ,
" (OSType dataRefType, Handle dataRef) -> (long offset) " } ,
1995-12-09 10:05:56 -04:00
{ NULL , NULL , 0 }
} ;
PyMethodChain MovieObj_chain = { MovieObj_methods , NULL } ;
2001-05-22 18:56:42 -03:00
static PyObject * MovieObj_getattr ( MovieObject * self , char * name )
1995-12-09 10:05:56 -04:00
{
return Py_FindMethodInChain ( & MovieObj_chain , ( PyObject * ) self , name ) ;
}
# define MovieObj_setattr NULL
1999-12-12 17:41:51 -04:00
# define MovieObj_compare NULL
# define MovieObj_repr NULL
# define MovieObj_hash NULL
1995-12-09 10:05:56 -04:00
PyTypeObject Movie_Type = {
PyObject_HEAD_INIT ( & PyType_Type )
0 , /*ob_size*/
" Movie " , /*tp_name*/
sizeof ( MovieObject ) , /*tp_basicsize*/
0 , /*tp_itemsize*/
/* methods */
( destructor ) MovieObj_dealloc , /*tp_dealloc*/
0 , /*tp_print*/
( getattrfunc ) MovieObj_getattr , /*tp_getattr*/
( setattrfunc ) MovieObj_setattr , /*tp_setattr*/
1999-12-12 17:41:51 -04:00
( cmpfunc ) MovieObj_compare , /*tp_compare*/
( reprfunc ) MovieObj_repr , /*tp_repr*/
( PyNumberMethods * ) 0 , /* tp_as_number */
( PySequenceMethods * ) 0 , /* tp_as_sequence */
( PyMappingMethods * ) 0 , /* tp_as_mapping */
( hashfunc ) MovieObj_hash , /*tp_hash*/
1995-12-09 10:05:56 -04:00
} ;
/* --------------------- End object type Movie ---------------------- */
2000-07-14 19:37:27 -03:00
# if !TARGET_API_MAC_CARBON
2000-06-21 19:07:06 -03:00
2001-05-22 18:56:42 -03:00
static PyObject * Qt_CheckQuickTimeRegistration ( PyObject * _self , PyObject * _args )
1999-12-12 17:41:51 -04:00
{
PyObject * _res = NULL ;
void * registrationKey ;
long flags ;
if ( ! PyArg_ParseTuple ( _args , " sl " ,
& registrationKey ,
& flags ) )
return NULL ;
CheckQuickTimeRegistration ( registrationKey ,
flags ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2000-06-21 19:07:06 -03:00
# endif
1999-12-12 17:41:51 -04:00
2001-05-22 18:56:42 -03:00
static PyObject * Qt_EnterMovies ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = EnterMovies ( ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_ExitMovies ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
ExitMovies ( ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_GetMoviesError ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = GetMoviesError ( ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_ClearMoviesStickyError ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
ClearMoviesStickyError ( ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_GetMoviesStickyError ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = GetMoviesStickyError ( ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_DisposeMatte ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
PixMapHandle theMatte ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & theMatte ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
DisposeMatte ( theMatte ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_NewMovie ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Movie _rv ;
long flags ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& flags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = NewMovie ( flags ) ;
_res = Py_BuildValue ( " O& " ,
MovieObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_GetDataHandler ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Component _rv ;
Handle dataRef ;
OSType dataHandlerSubType ;
long flags ;
if ( ! PyArg_ParseTuple ( _args , " O&O&l " ,
ResObj_Convert , & dataRef ,
PyMac_GetOSType , & dataHandlerSubType ,
& flags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = GetDataHandler ( dataRef ,
dataHandlerSubType ,
flags ) ;
_res = Py_BuildValue ( " O& " ,
CmpObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-01-09 18:09:31 -04:00
# if !TARGET_API_MAC_CARBON
2001-05-22 18:56:42 -03:00
static PyObject * Qt_OpenADataHandler ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
Handle dataRef ;
OSType dataHandlerSubType ;
Handle anchorDataRef ;
OSType anchorDataRefType ;
TimeBase tb ;
long flags ;
ComponentInstance dh ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O&O&O&l " ,
ResObj_Convert , & dataRef ,
PyMac_GetOSType , & dataHandlerSubType ,
ResObj_Convert , & anchorDataRef ,
PyMac_GetOSType , & anchorDataRefType ,
TimeBaseObj_Convert , & tb ,
& flags ) )
return NULL ;
_err = OpenADataHandler ( dataRef ,
dataHandlerSubType ,
anchorDataRef ,
anchorDataRefType ,
tb ,
flags ,
& dh ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O& " ,
CmpInstObj_New , dh ) ;
return _res ;
}
2001-01-09 18:09:31 -04:00
# endif
2000-12-12 18:10:21 -04:00
2001-05-22 18:56:42 -03:00
static PyObject * Qt_PasteHandleIntoMovie ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
Handle h ;
OSType handleType ;
1995-11-30 13:42:08 -04:00
Movie theMovie ;
1995-12-09 10:05:56 -04:00
long flags ;
ComponentInstance userComp ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O&lO& " ,
ResObj_Convert , & h ,
PyMac_GetOSType , & handleType ,
1995-11-30 13:42:08 -04:00
MovieObj_Convert , & theMovie ,
1995-12-09 10:05:56 -04:00
& flags ,
CmpInstObj_Convert , & userComp ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = PasteHandleIntoMovie ( h ,
handleType ,
theMovie ,
flags ,
userComp ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_GetMovieImporterForDataRef ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
OSType dataRefType ;
Handle dataRef ;
long flags ;
Component importer ;
if ( ! PyArg_ParseTuple ( _args , " O&O&l " ,
PyMac_GetOSType , & dataRefType ,
ResObj_Convert , & dataRef ,
& flags ) )
return NULL ;
_err = GetMovieImporterForDataRef ( dataRefType ,
dataRef ,
flags ,
& importer ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O& " ,
CmpObj_New , importer ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_TrackTimeToMediaTime ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
TimeValue _rv ;
TimeValue value ;
Track theTrack ;
if ( ! PyArg_ParseTuple ( _args , " lO& " ,
& value ,
TrackObj_Convert , & theTrack ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = TrackTimeToMediaTime ( value ,
theTrack ) ;
1995-11-30 13:42:08 -04:00
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_NewUserData ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
UserData theUserData ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = NewUserData ( & theUserData ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O& " ,
UserDataObj_New , theUserData ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_NewUserDataFromHandle ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
Handle h ;
UserData theUserData ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
1995-12-09 10:05:56 -04:00
ResObj_Convert , & h ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = NewUserDataFromHandle ( h ,
& theUserData ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O& " ,
UserDataObj_New , theUserData ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_CreateMovieFile ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
FSSpec fileSpec ;
OSType creator ;
ScriptCode scriptTag ;
long createMovieFileFlags ;
short resRefNum ;
Movie newmovie ;
if ( ! PyArg_ParseTuple ( _args , " O&O&hl " ,
PyMac_GetFSSpec , & fileSpec ,
PyMac_GetOSType , & creator ,
& scriptTag ,
& createMovieFileFlags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = CreateMovieFile ( & fileSpec ,
creator ,
scriptTag ,
createMovieFileFlags ,
& resRefNum ,
& newmovie ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " hO& " ,
resRefNum ,
MovieObj_New , newmovie ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_OpenMovieFile ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
FSSpec fileSpec ;
short resRefNum ;
SInt8 permission ;
if ( ! PyArg_ParseTuple ( _args , " O&b " ,
PyMac_GetFSSpec , & fileSpec ,
& permission ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = OpenMovieFile ( & fileSpec ,
& resRefNum ,
permission ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " h " ,
resRefNum ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_CloseMovieFile ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
short resRefNum ;
if ( ! PyArg_ParseTuple ( _args , " h " ,
& resRefNum ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = CloseMovieFile ( resRefNum ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_DeleteMovieFile ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
FSSpec fileSpec ;
1995-11-30 13:42:08 -04:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
1995-12-09 10:05:56 -04:00
PyMac_GetFSSpec , & fileSpec ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = DeleteMovieFile ( & fileSpec ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_NewMovieFromFile ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
Movie theMovie ;
short resRefNum ;
1997-04-09 12:53:46 -03:00
short resId ;
1995-12-09 10:05:56 -04:00
short newMovieFlags ;
Boolean dataRefWasChanged ;
1997-04-09 12:53:46 -03:00
if ( ! PyArg_ParseTuple ( _args , " hhh " ,
1995-12-09 10:05:56 -04:00
& resRefNum ,
1997-04-09 12:53:46 -03:00
& resId ,
1995-12-09 10:05:56 -04:00
& newMovieFlags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = NewMovieFromFile ( & theMovie ,
resRefNum ,
1997-04-09 12:53:46 -03:00
& resId ,
1995-12-09 10:05:56 -04:00
( StringPtr ) 0 ,
newMovieFlags ,
& dataRefWasChanged ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1997-04-09 12:53:46 -03:00
_res = Py_BuildValue ( " O&hb " ,
1995-12-09 10:05:56 -04:00
MovieObj_New , theMovie ,
1997-04-09 12:53:46 -03:00
resId ,
1995-12-09 10:05:56 -04:00
dataRefWasChanged ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_NewMovieFromHandle ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
Movie theMovie ;
Handle h ;
short newMovieFlags ;
Boolean dataRefWasChanged ;
if ( ! PyArg_ParseTuple ( _args , " O&h " ,
ResObj_Convert , & h ,
& newMovieFlags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = NewMovieFromHandle ( & theMovie ,
h ,
newMovieFlags ,
& dataRefWasChanged ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O&b " ,
MovieObj_New , theMovie ,
dataRefWasChanged ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_NewMovieFromDataFork ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
Movie theMovie ;
short fRefNum ;
long fileOffset ;
short newMovieFlags ;
Boolean dataRefWasChanged ;
if ( ! PyArg_ParseTuple ( _args , " hlh " ,
& fRefNum ,
& fileOffset ,
& newMovieFlags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = NewMovieFromDataFork ( & theMovie ,
fRefNum ,
fileOffset ,
newMovieFlags ,
& dataRefWasChanged ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O&b " ,
MovieObj_New , theMovie ,
dataRefWasChanged ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_NewMovieFromDataFork64 ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
Movie theMovie ;
long fRefNum ;
wide fileOffset ;
short newMovieFlags ;
Boolean dataRefWasChanged ;
if ( ! PyArg_ParseTuple ( _args , " lO&h " ,
& fRefNum ,
PyMac_Getwide , & fileOffset ,
& newMovieFlags ) )
return NULL ;
_err = NewMovieFromDataFork64 ( & theMovie ,
fRefNum ,
& fileOffset ,
newMovieFlags ,
& dataRefWasChanged ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O&b " ,
MovieObj_New , theMovie ,
dataRefWasChanged ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_NewMovieFromDataRef ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
Movie m ;
short flags ;
short id ;
Handle dataRef ;
OSType dataRefType ;
if ( ! PyArg_ParseTuple ( _args , " hO&O& " ,
& flags ,
ResObj_Convert , & dataRef ,
PyMac_GetOSType , & dataRefType ) )
return NULL ;
_err = NewMovieFromDataRef ( & m ,
flags ,
& id ,
dataRef ,
dataRefType ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O&h " ,
MovieObj_New , m ,
id ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_RemoveMovieResource ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
OSErr _err ;
short resRefNum ;
short resId ;
if ( ! PyArg_ParseTuple ( _args , " hh " ,
& resRefNum ,
& resId ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_err = RemoveMovieResource ( resRefNum ,
resId ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_CreateShortcutMovieFile ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
OSErr _err ;
FSSpec fileSpec ;
OSType creator ;
ScriptCode scriptTag ;
long createMovieFileFlags ;
Handle targetDataRef ;
OSType targetDataRefType ;
if ( ! PyArg_ParseTuple ( _args , " O&O&hlO&O& " ,
PyMac_GetFSSpec , & fileSpec ,
PyMac_GetOSType , & creator ,
& scriptTag ,
& createMovieFileFlags ,
ResObj_Convert , & targetDataRef ,
PyMac_GetOSType , & targetDataRefType ) )
return NULL ;
_err = CreateShortcutMovieFile ( & fileSpec ,
creator ,
scriptTag ,
createMovieFileFlags ,
targetDataRef ,
targetDataRefType ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_NewMovieFromScrap ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
Movie _rv ;
long newMovieFlags ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& newMovieFlags ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
_rv = NewMovieFromScrap ( newMovieFlags ) ;
_res = Py_BuildValue ( " O& " ,
MovieObj_New , _rv ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_QTNewAlias ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1998-04-21 12:23:55 -03:00
OSErr _err ;
FSSpec fss ;
AliasHandle alias ;
Boolean minimal ;
if ( ! PyArg_ParseTuple ( _args , " O&b " ,
PyMac_GetFSSpec , & fss ,
& minimal ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1998-04-21 12:23:55 -03:00
_err = QTNewAlias ( & fss ,
& alias ,
minimal ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
1995-12-09 10:05:56 -04:00
_res = Py_BuildValue ( " O& " ,
1998-04-21 12:23:55 -03:00
ResObj_New , alias ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_EndFullScreen ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
Ptr fullState ;
long flags ;
if ( ! PyArg_ParseTuple ( _args , " sl " ,
& fullState ,
& flags ) )
return NULL ;
_err = EndFullScreen ( fullState ,
flags ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_AddSoundDescriptionExtension ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
SoundDescriptionHandle desc ;
Handle extension ;
OSType idType ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
ResObj_Convert , & desc ,
ResObj_Convert , & extension ,
PyMac_GetOSType , & idType ) )
return NULL ;
_err = AddSoundDescriptionExtension ( desc ,
extension ,
idType ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_GetSoundDescriptionExtension ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
SoundDescriptionHandle desc ;
Handle extension ;
OSType idType ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & desc ,
PyMac_GetOSType , & idType ) )
return NULL ;
_err = GetSoundDescriptionExtension ( desc ,
& extension ,
idType ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , extension ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_RemoveSoundDescriptionExtension ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
SoundDescriptionHandle desc ;
OSType idType ;
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & desc ,
PyMac_GetOSType , & idType ) )
return NULL ;
_err = RemoveSoundDescriptionExtension ( desc ,
idType ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_QTIsStandardParameterDialogEvent ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
EventRecord pEvent ;
QTParameterDialog createdDialog ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& createdDialog ) )
return NULL ;
_err = QTIsStandardParameterDialogEvent ( & pEvent ,
createdDialog ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildEventRecord , & pEvent ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_QTDismissStandardParameterDialog ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
QTParameterDialog createdDialog ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& createdDialog ) )
return NULL ;
_err = QTDismissStandardParameterDialog ( createdDialog ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_QTStandardParameterDialogDoAction ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
QTParameterDialog createdDialog ;
long action ;
void * params ;
if ( ! PyArg_ParseTuple ( _args , " lls " ,
& createdDialog ,
& action ,
& params ) )
return NULL ;
_err = QTStandardParameterDialogDoAction ( createdDialog ,
action ,
params ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_QTRegisterAccessKey ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
Str255 accessKeyType ;
long flags ;
Handle accessKey ;
if ( ! PyArg_ParseTuple ( _args , " O&lO& " ,
PyMac_GetStr255 , accessKeyType ,
& flags ,
ResObj_Convert , & accessKey ) )
return NULL ;
_err = QTRegisterAccessKey ( accessKeyType ,
flags ,
accessKey ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_QTUnregisterAccessKey ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
Str255 accessKeyType ;
long flags ;
Handle accessKey ;
if ( ! PyArg_ParseTuple ( _args , " O&lO& " ,
PyMac_GetStr255 , accessKeyType ,
& flags ,
ResObj_Convert , & accessKey ) )
return NULL ;
_err = QTUnregisterAccessKey ( accessKeyType ,
flags ,
accessKey ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_QTTextToNativeText ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
OSErr _err ;
Handle theText ;
long encoding ;
long flags ;
if ( ! PyArg_ParseTuple ( _args , " O&ll " ,
ResObj_Convert , & theText ,
& encoding ,
& flags ) )
return NULL ;
_err = QTTextToNativeText ( theText ,
encoding ,
flags ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_VideoMediaResetStatistics ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
CmpInstObj_Convert , & mh ) )
return NULL ;
_rv = VideoMediaResetStatistics ( mh ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_VideoMediaGetStatistics ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
CmpInstObj_Convert , & mh ) )
return NULL ;
_rv = VideoMediaGetStatistics ( mh ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_VideoMediaGetStallCount ( PyObject * _self , PyObject * _args )
1999-12-12 17:41:51 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
unsigned long stalls ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
CmpInstObj_Convert , & mh ) )
return NULL ;
_rv = VideoMediaGetStallCount ( mh ,
& stalls ) ;
_res = Py_BuildValue ( " ll " ,
_rv ,
stalls ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_VideoMediaSetCodecParameter ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
CodecType cType ;
OSType parameterID ;
long parameterChangeSeed ;
void * dataPtr ;
long dataSize ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O&lsl " ,
CmpInstObj_Convert , & mh ,
PyMac_GetOSType , & cType ,
PyMac_GetOSType , & parameterID ,
& parameterChangeSeed ,
& dataPtr ,
& dataSize ) )
return NULL ;
_rv = VideoMediaSetCodecParameter ( mh ,
cType ,
parameterID ,
parameterChangeSeed ,
dataPtr ,
dataSize ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_VideoMediaGetCodecParameter ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
CodecType cType ;
OSType parameterID ;
Handle outParameterData ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O&O& " ,
CmpInstObj_Convert , & mh ,
PyMac_GetOSType , & cType ,
PyMac_GetOSType , & parameterID ,
ResObj_Convert , & outParameterData ) )
return NULL ;
_rv = VideoMediaGetCodecParameter ( mh ,
cType ,
parameterID ,
outParameterData ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_TextMediaAddTextSample ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
Ptr text ;
unsigned long size ;
short fontNumber ;
short fontSize ;
Style textFace ;
RGBColor textColor ;
RGBColor backColor ;
short textJustification ;
Rect textBox ;
long displayFlags ;
TimeValue scrollDelay ;
short hiliteStart ;
short hiliteEnd ;
RGBColor rgbHiliteColor ;
TimeValue duration ;
TimeValue sampleTime ;
if ( ! PyArg_ParseTuple ( _args , " O&slhhbhllhhl " ,
CmpInstObj_Convert , & mh ,
& text ,
& size ,
& fontNumber ,
& fontSize ,
& textFace ,
& textJustification ,
& displayFlags ,
& scrollDelay ,
& hiliteStart ,
& hiliteEnd ,
& duration ) )
return NULL ;
_rv = TextMediaAddTextSample ( mh ,
text ,
size ,
fontNumber ,
fontSize ,
textFace ,
& textColor ,
& backColor ,
textJustification ,
& textBox ,
displayFlags ,
scrollDelay ,
hiliteStart ,
hiliteEnd ,
& rgbHiliteColor ,
duration ,
& sampleTime ) ;
_res = Py_BuildValue ( " lO&O&O&O&l " ,
_rv ,
QdRGB_New , & textColor ,
QdRGB_New , & backColor ,
PyMac_BuildRect , & textBox ,
QdRGB_New , & rgbHiliteColor ,
sampleTime ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_TextMediaAddTESample ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
TEHandle hTE ;
RGBColor backColor ;
short textJustification ;
Rect textBox ;
long displayFlags ;
TimeValue scrollDelay ;
short hiliteStart ;
short hiliteEnd ;
RGBColor rgbHiliteColor ;
TimeValue duration ;
TimeValue sampleTime ;
if ( ! PyArg_ParseTuple ( _args , " O&O&hllhhl " ,
CmpInstObj_Convert , & mh ,
ResObj_Convert , & hTE ,
& textJustification ,
& displayFlags ,
& scrollDelay ,
& hiliteStart ,
& hiliteEnd ,
& duration ) )
return NULL ;
_rv = TextMediaAddTESample ( mh ,
hTE ,
& backColor ,
textJustification ,
& textBox ,
displayFlags ,
scrollDelay ,
hiliteStart ,
hiliteEnd ,
& rgbHiliteColor ,
duration ,
& sampleTime ) ;
_res = Py_BuildValue ( " lO&O&O&l " ,
_rv ,
QdRGB_New , & backColor ,
PyMac_BuildRect , & textBox ,
QdRGB_New , & rgbHiliteColor ,
sampleTime ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_TextMediaAddHiliteSample ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
short hiliteStart ;
short hiliteEnd ;
RGBColor rgbHiliteColor ;
TimeValue duration ;
TimeValue sampleTime ;
if ( ! PyArg_ParseTuple ( _args , " O&hhl " ,
CmpInstObj_Convert , & mh ,
& hiliteStart ,
& hiliteEnd ,
& duration ) )
return NULL ;
_rv = TextMediaAddHiliteSample ( mh ,
hiliteStart ,
hiliteEnd ,
& rgbHiliteColor ,
duration ,
& sampleTime ) ;
_res = Py_BuildValue ( " lO&l " ,
_rv ,
QdRGB_New , & rgbHiliteColor ,
sampleTime ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_TextMediaDrawRaw ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
2000-12-12 18:10:21 -04:00
GWorldPtr gw ;
GDHandle gd ;
void * data ;
long dataSize ;
TextDescriptionHandle tdh ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O&slO& " ,
1998-04-21 12:23:55 -03:00
CmpInstObj_Convert , & mh ,
2000-12-12 18:10:21 -04:00
GWorldObj_Convert , & gw ,
OptResObj_Convert , & gd ,
& data ,
& dataSize ,
ResObj_Convert , & tdh ) )
1998-04-21 12:23:55 -03:00
return NULL ;
2000-12-12 18:10:21 -04:00
_rv = TextMediaDrawRaw ( mh ,
gw ,
gd ,
data ,
dataSize ,
tdh ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
1998-04-21 12:23:55 -03:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_TextMediaSetTextProperty ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
2000-12-12 18:10:21 -04:00
TimeValue atMediaTime ;
long propertyType ;
void * data ;
long dataSize ;
if ( ! PyArg_ParseTuple ( _args , " O&llsl " ,
1998-04-21 12:23:55 -03:00
CmpInstObj_Convert , & mh ,
2000-12-12 18:10:21 -04:00
& atMediaTime ,
& propertyType ,
& data ,
& dataSize ) )
1998-04-21 12:23:55 -03:00
return NULL ;
2000-12-12 18:10:21 -04:00
_rv = TextMediaSetTextProperty ( mh ,
atMediaTime ,
propertyType ,
data ,
dataSize ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_TextMediaRawSetup ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
GWorldPtr gw ;
GDHandle gd ;
void * data ;
long dataSize ;
TextDescriptionHandle tdh ;
TimeValue sampleDuration ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O&slO&l " ,
CmpInstObj_Convert , & mh ,
GWorldObj_Convert , & gw ,
OptResObj_Convert , & gd ,
& data ,
& dataSize ,
ResObj_Convert , & tdh ,
& sampleDuration ) )
return NULL ;
_rv = TextMediaRawSetup ( mh ,
gw ,
gd ,
data ,
dataSize ,
tdh ,
sampleDuration ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_TextMediaRawIdle ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
GWorldPtr gw ;
GDHandle gd ;
TimeValue sampleTime ;
long flagsIn ;
long flagsOut ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O&ll " ,
CmpInstObj_Convert , & mh ,
GWorldObj_Convert , & gw ,
OptResObj_Convert , & gd ,
& sampleTime ,
& flagsIn ) )
return NULL ;
_rv = TextMediaRawIdle ( mh ,
gw ,
gd ,
sampleTime ,
flagsIn ,
& flagsOut ) ;
_res = Py_BuildValue ( " ll " ,
_rv ,
flagsOut ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_TextMediaFindNextText ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
Ptr text ;
long size ;
short findFlags ;
TimeValue startTime ;
TimeValue foundTime ;
TimeValue foundDuration ;
long offset ;
if ( ! PyArg_ParseTuple ( _args , " O&slhl " ,
CmpInstObj_Convert , & mh ,
& text ,
& size ,
& findFlags ,
& startTime ) )
return NULL ;
_rv = TextMediaFindNextText ( mh ,
text ,
size ,
findFlags ,
startTime ,
& foundTime ,
& foundDuration ,
& offset ) ;
_res = Py_BuildValue ( " llll " ,
_rv ,
foundTime ,
foundDuration ,
offset ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_TextMediaHiliteTextSample ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
TimeValue sampleTime ;
short hiliteStart ;
short hiliteEnd ;
RGBColor rgbHiliteColor ;
if ( ! PyArg_ParseTuple ( _args , " O&lhh " ,
CmpInstObj_Convert , & mh ,
& sampleTime ,
& hiliteStart ,
& hiliteEnd ) )
return NULL ;
_rv = TextMediaHiliteTextSample ( mh ,
sampleTime ,
hiliteStart ,
hiliteEnd ,
& rgbHiliteColor ) ;
_res = Py_BuildValue ( " lO& " ,
_rv ,
QdRGB_New , & rgbHiliteColor ) ;
1998-04-21 12:23:55 -03:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_TextMediaSetTextSampleData ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
void * data ;
OSType dataType ;
if ( ! PyArg_ParseTuple ( _args , " O&sO& " ,
CmpInstObj_Convert , & mh ,
& data ,
PyMac_GetOSType , & dataType ) )
return NULL ;
_rv = TextMediaSetTextSampleData ( mh ,
data ,
dataType ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaSetProperty ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
short spriteIndex ;
long propertyType ;
void * propertyValue ;
if ( ! PyArg_ParseTuple ( _args , " O&hls " ,
CmpInstObj_Convert , & mh ,
& spriteIndex ,
& propertyType ,
& propertyValue ) )
return NULL ;
_rv = SpriteMediaSetProperty ( mh ,
spriteIndex ,
propertyType ,
propertyValue ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaGetProperty ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
short spriteIndex ;
long propertyType ;
void * propertyValue ;
if ( ! PyArg_ParseTuple ( _args , " O&hls " ,
CmpInstObj_Convert , & mh ,
& spriteIndex ,
& propertyType ,
& propertyValue ) )
return NULL ;
_rv = SpriteMediaGetProperty ( mh ,
spriteIndex ,
propertyType ,
propertyValue ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaHitTestSprites ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
long flags ;
Point loc ;
short spriteHitIndex ;
if ( ! PyArg_ParseTuple ( _args , " O&lO& " ,
CmpInstObj_Convert , & mh ,
& flags ,
PyMac_GetPoint , & loc ) )
return NULL ;
_rv = SpriteMediaHitTestSprites ( mh ,
flags ,
loc ,
& spriteHitIndex ) ;
_res = Py_BuildValue ( " lh " ,
_rv ,
spriteHitIndex ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaCountSprites ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
short numSprites ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
CmpInstObj_Convert , & mh ) )
return NULL ;
_rv = SpriteMediaCountSprites ( mh ,
& numSprites ) ;
_res = Py_BuildValue ( " lh " ,
_rv ,
numSprites ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaCountImages ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
short numImages ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
CmpInstObj_Convert , & mh ) )
return NULL ;
_rv = SpriteMediaCountImages ( mh ,
& numImages ) ;
_res = Py_BuildValue ( " lh " ,
_rv ,
numImages ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaGetIndImageDescription ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
short imageIndex ;
ImageDescriptionHandle imageDescription ;
if ( ! PyArg_ParseTuple ( _args , " O&hO& " ,
CmpInstObj_Convert , & mh ,
& imageIndex ,
ResObj_Convert , & imageDescription ) )
return NULL ;
_rv = SpriteMediaGetIndImageDescription ( mh ,
imageIndex ,
imageDescription ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaGetDisplayedSampleNumber ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
long sampleNum ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
CmpInstObj_Convert , & mh ) )
return NULL ;
_rv = SpriteMediaGetDisplayedSampleNumber ( mh ,
& sampleNum ) ;
_res = Py_BuildValue ( " ll " ,
_rv ,
sampleNum ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaGetSpriteName ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
QTAtomID spriteID ;
Str255 spriteName ;
if ( ! PyArg_ParseTuple ( _args , " O&lO& " ,
CmpInstObj_Convert , & mh ,
& spriteID ,
PyMac_GetStr255 , spriteName ) )
return NULL ;
_rv = SpriteMediaGetSpriteName ( mh ,
spriteID ,
spriteName ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaGetImageName ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
short imageIndex ;
Str255 imageName ;
if ( ! PyArg_ParseTuple ( _args , " O&hO& " ,
CmpInstObj_Convert , & mh ,
& imageIndex ,
PyMac_GetStr255 , imageName ) )
return NULL ;
_rv = SpriteMediaGetImageName ( mh ,
imageIndex ,
imageName ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaSetSpriteProperty ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
QTAtomID spriteID ;
long propertyType ;
void * propertyValue ;
if ( ! PyArg_ParseTuple ( _args , " O&lls " ,
CmpInstObj_Convert , & mh ,
& spriteID ,
& propertyType ,
& propertyValue ) )
return NULL ;
_rv = SpriteMediaSetSpriteProperty ( mh ,
spriteID ,
propertyType ,
propertyValue ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaGetSpriteProperty ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
QTAtomID spriteID ;
long propertyType ;
void * propertyValue ;
if ( ! PyArg_ParseTuple ( _args , " O&lls " ,
CmpInstObj_Convert , & mh ,
& spriteID ,
& propertyType ,
& propertyValue ) )
return NULL ;
_rv = SpriteMediaGetSpriteProperty ( mh ,
spriteID ,
propertyType ,
propertyValue ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaHitTestAllSprites ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
long flags ;
Point loc ;
QTAtomID spriteHitID ;
if ( ! PyArg_ParseTuple ( _args , " O&lO& " ,
CmpInstObj_Convert , & mh ,
& flags ,
PyMac_GetPoint , & loc ) )
return NULL ;
_rv = SpriteMediaHitTestAllSprites ( mh ,
flags ,
loc ,
& spriteHitID ) ;
_res = Py_BuildValue ( " ll " ,
_rv ,
spriteHitID ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaHitTestOneSprite ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
QTAtomID spriteID ;
long flags ;
Point loc ;
Boolean wasHit ;
if ( ! PyArg_ParseTuple ( _args , " O&llO& " ,
CmpInstObj_Convert , & mh ,
& spriteID ,
& flags ,
PyMac_GetPoint , & loc ) )
return NULL ;
_rv = SpriteMediaHitTestOneSprite ( mh ,
spriteID ,
flags ,
loc ,
& wasHit ) ;
_res = Py_BuildValue ( " lb " ,
_rv ,
wasHit ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaSpriteIndexToID ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
short spriteIndex ;
QTAtomID spriteID ;
if ( ! PyArg_ParseTuple ( _args , " O&h " ,
CmpInstObj_Convert , & mh ,
& spriteIndex ) )
return NULL ;
_rv = SpriteMediaSpriteIndexToID ( mh ,
spriteIndex ,
& spriteID ) ;
_res = Py_BuildValue ( " ll " ,
_rv ,
spriteID ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaSpriteIDToIndex ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
QTAtomID spriteID ;
short spriteIndex ;
if ( ! PyArg_ParseTuple ( _args , " O&l " ,
CmpInstObj_Convert , & mh ,
& spriteID ) )
return NULL ;
_rv = SpriteMediaSpriteIDToIndex ( mh ,
spriteID ,
& spriteIndex ) ;
_res = Py_BuildValue ( " lh " ,
_rv ,
spriteIndex ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaSetActionVariable ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
QTAtomID variableID ;
float value ;
if ( ! PyArg_ParseTuple ( _args , " O&lf " ,
CmpInstObj_Convert , & mh ,
& variableID ,
& value ) )
return NULL ;
_rv = SpriteMediaSetActionVariable ( mh ,
variableID ,
& value ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaGetActionVariable ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
QTAtomID variableID ;
float value ;
if ( ! PyArg_ParseTuple ( _args , " O&l " ,
CmpInstObj_Convert , & mh ,
& variableID ) )
return NULL ;
_rv = SpriteMediaGetActionVariable ( mh ,
variableID ,
& value ) ;
_res = Py_BuildValue ( " lf " ,
_rv ,
value ) ;
return _res ;
}
2000-07-14 19:37:27 -03:00
# if !TARGET_API_MAC_CARBON
2000-06-21 19:07:06 -03:00
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaGetIndImageProperty ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
short imageIndex ;
long imagePropertyType ;
void * imagePropertyValue ;
if ( ! PyArg_ParseTuple ( _args , " O&hls " ,
CmpInstObj_Convert , & mh ,
& imageIndex ,
& imagePropertyType ,
& imagePropertyValue ) )
return NULL ;
_rv = SpriteMediaGetIndImageProperty ( mh ,
imageIndex ,
imagePropertyType ,
imagePropertyValue ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2000-06-21 19:07:06 -03:00
# endif
1998-04-21 12:23:55 -03:00
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaDisposeSprite ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
QTAtomID spriteID ;
if ( ! PyArg_ParseTuple ( _args , " O&l " ,
CmpInstObj_Convert , & mh ,
& spriteID ) )
return NULL ;
_rv = SpriteMediaDisposeSprite ( mh ,
spriteID ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaSetActionVariableToString ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
QTAtomID variableID ;
Ptr theCString ;
if ( ! PyArg_ParseTuple ( _args , " O&ls " ,
CmpInstObj_Convert , & mh ,
& variableID ,
& theCString ) )
return NULL ;
_rv = SpriteMediaSetActionVariableToString ( mh ,
variableID ,
theCString ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SpriteMediaGetActionVariableAsString ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
QTAtomID variableID ;
Handle theCString ;
if ( ! PyArg_ParseTuple ( _args , " O&l " ,
CmpInstObj_Convert , & mh ,
& variableID ) )
return NULL ;
_rv = SpriteMediaGetActionVariableAsString ( mh ,
variableID ,
& theCString ) ;
_res = Py_BuildValue ( " lO& " ,
_rv ,
ResObj_New , theCString ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_FlashMediaSetPan ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
short xPercent ;
short yPercent ;
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
CmpInstObj_Convert , & mh ,
& xPercent ,
& yPercent ) )
return NULL ;
_rv = FlashMediaSetPan ( mh ,
xPercent ,
yPercent ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_FlashMediaSetZoom ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
short factor ;
if ( ! PyArg_ParseTuple ( _args , " O&h " ,
CmpInstObj_Convert , & mh ,
& factor ) )
return NULL ;
_rv = FlashMediaSetZoom ( mh ,
factor ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_FlashMediaSetZoomRect ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
long left ;
long top ;
long right ;
long bottom ;
if ( ! PyArg_ParseTuple ( _args , " O&llll " ,
CmpInstObj_Convert , & mh ,
& left ,
& top ,
& right ,
& bottom ) )
return NULL ;
_rv = FlashMediaSetZoomRect ( mh ,
left ,
top ,
right ,
bottom ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_FlashMediaGetRefConBounds ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
long refCon ;
long left ;
long top ;
long right ;
long bottom ;
if ( ! PyArg_ParseTuple ( _args , " O&l " ,
CmpInstObj_Convert , & mh ,
& refCon ) )
return NULL ;
_rv = FlashMediaGetRefConBounds ( mh ,
refCon ,
& left ,
& top ,
& right ,
& bottom ) ;
_res = Py_BuildValue ( " lllll " ,
_rv ,
left ,
top ,
right ,
bottom ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_FlashMediaGetRefConID ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
long refCon ;
long refConID ;
if ( ! PyArg_ParseTuple ( _args , " O&l " ,
CmpInstObj_Convert , & mh ,
& refCon ) )
return NULL ;
_rv = FlashMediaGetRefConID ( mh ,
refCon ,
& refConID ) ;
_res = Py_BuildValue ( " ll " ,
_rv ,
refConID ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_FlashMediaIDToRefCon ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
long refConID ;
long refCon ;
if ( ! PyArg_ParseTuple ( _args , " O&l " ,
CmpInstObj_Convert , & mh ,
& refConID ) )
return NULL ;
_rv = FlashMediaIDToRefCon ( mh ,
refConID ,
& refCon ) ;
_res = Py_BuildValue ( " ll " ,
_rv ,
refCon ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_FlashMediaGetDisplayedFrameNumber ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
long flashFrameNumber ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
CmpInstObj_Convert , & mh ) )
return NULL ;
_rv = FlashMediaGetDisplayedFrameNumber ( mh ,
& flashFrameNumber ) ;
_res = Py_BuildValue ( " ll " ,
_rv ,
flashFrameNumber ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_FlashMediaFrameNumberToMovieTime ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
long flashFrameNumber ;
TimeValue movieTime ;
if ( ! PyArg_ParseTuple ( _args , " O&l " ,
CmpInstObj_Convert , & mh ,
& flashFrameNumber ) )
return NULL ;
_rv = FlashMediaFrameNumberToMovieTime ( mh ,
flashFrameNumber ,
& movieTime ) ;
_res = Py_BuildValue ( " ll " ,
_rv ,
movieTime ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_FlashMediaFrameLabelToMovieTime ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
Ptr theLabel ;
TimeValue movieTime ;
if ( ! PyArg_ParseTuple ( _args , " O&s " ,
CmpInstObj_Convert , & mh ,
& theLabel ) )
return NULL ;
_rv = FlashMediaFrameLabelToMovieTime ( mh ,
theLabel ,
& movieTime ) ;
_res = Py_BuildValue ( " ll " ,
_rv ,
movieTime ) ;
return _res ;
}
2001-01-09 18:09:31 -04:00
# if !TARGET_API_MAC_CARBON
2001-05-22 18:56:42 -03:00
static PyObject * Qt_MovieMediaGetCurrentMovieProperty ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
OSType whichProperty ;
void * value ;
if ( ! PyArg_ParseTuple ( _args , " O&O&s " ,
CmpInstObj_Convert , & mh ,
PyMac_GetOSType , & whichProperty ,
& value ) )
return NULL ;
_rv = MovieMediaGetCurrentMovieProperty ( mh ,
whichProperty ,
value ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-01-09 18:09:31 -04:00
# endif
# if !TARGET_API_MAC_CARBON
2000-12-12 18:10:21 -04:00
2001-05-22 18:56:42 -03:00
static PyObject * Qt_MovieMediaGetCurrentTrackProperty ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
long trackID ;
OSType whichProperty ;
void * value ;
if ( ! PyArg_ParseTuple ( _args , " O&lO&s " ,
CmpInstObj_Convert , & mh ,
& trackID ,
PyMac_GetOSType , & whichProperty ,
& value ) )
return NULL ;
_rv = MovieMediaGetCurrentTrackProperty ( mh ,
trackID ,
whichProperty ,
value ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-01-09 18:09:31 -04:00
# endif
# if !TARGET_API_MAC_CARBON
2000-12-12 18:10:21 -04:00
2001-05-22 18:56:42 -03:00
static PyObject * Qt_MovieMediaGetChildMovieDataReference ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
QTAtomID dataRefID ;
short dataRefIndex ;
OSType dataRefType ;
Handle dataRef ;
QTAtomID dataRefIDOut ;
short dataRefIndexOut ;
if ( ! PyArg_ParseTuple ( _args , " O&lh " ,
CmpInstObj_Convert , & mh ,
& dataRefID ,
& dataRefIndex ) )
return NULL ;
_rv = MovieMediaGetChildMovieDataReference ( mh ,
dataRefID ,
dataRefIndex ,
& dataRefType ,
& dataRef ,
& dataRefIDOut ,
& dataRefIndexOut ) ;
_res = Py_BuildValue ( " lO&O&lh " ,
_rv ,
PyMac_BuildOSType , dataRefType ,
ResObj_New , dataRef ,
dataRefIDOut ,
dataRefIndexOut ) ;
return _res ;
}
2001-01-09 18:09:31 -04:00
# endif
# if !TARGET_API_MAC_CARBON
2000-12-12 18:10:21 -04:00
2001-05-22 18:56:42 -03:00
static PyObject * Qt_MovieMediaSetChildMovieDataReference ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
QTAtomID dataRefID ;
OSType dataRefType ;
Handle dataRef ;
if ( ! PyArg_ParseTuple ( _args , " O&lO&O& " ,
CmpInstObj_Convert , & mh ,
& dataRefID ,
PyMac_GetOSType , & dataRefType ,
ResObj_Convert , & dataRef ) )
return NULL ;
_rv = MovieMediaSetChildMovieDataReference ( mh ,
dataRefID ,
dataRefType ,
dataRef ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-01-09 18:09:31 -04:00
# endif
# if !TARGET_API_MAC_CARBON
2000-12-12 18:10:21 -04:00
2001-05-22 18:56:42 -03:00
static PyObject * Qt_MovieMediaLoadChildMovieFromDataReference ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
QTAtomID dataRefID ;
if ( ! PyArg_ParseTuple ( _args , " O&l " ,
CmpInstObj_Convert , & mh ,
& dataRefID ) )
return NULL ;
_rv = MovieMediaLoadChildMovieFromDataReference ( mh ,
dataRefID ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-01-09 18:09:31 -04:00
# endif
2000-12-12 18:10:21 -04:00
2001-05-22 18:56:42 -03:00
static PyObject * Qt_Media3DGetCurrentGroup ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
void * group ;
if ( ! PyArg_ParseTuple ( _args , " O&s " ,
CmpInstObj_Convert , & mh ,
& group ) )
return NULL ;
_rv = Media3DGetCurrentGroup ( mh ,
group ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_Media3DTranslateNamedObjectTo ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
char objectName ;
Fixed x ;
Fixed y ;
Fixed z ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O&O& " ,
CmpInstObj_Convert , & mh ,
PyMac_GetFixed , & x ,
PyMac_GetFixed , & y ,
PyMac_GetFixed , & z ) )
return NULL ;
_rv = Media3DTranslateNamedObjectTo ( mh ,
& objectName ,
x ,
y ,
z ) ;
_res = Py_BuildValue ( " lc " ,
_rv ,
objectName ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_Media3DScaleNamedObjectTo ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
char objectName ;
Fixed xScale ;
Fixed yScale ;
Fixed zScale ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O&O& " ,
CmpInstObj_Convert , & mh ,
PyMac_GetFixed , & xScale ,
PyMac_GetFixed , & yScale ,
PyMac_GetFixed , & zScale ) )
return NULL ;
_rv = Media3DScaleNamedObjectTo ( mh ,
& objectName ,
xScale ,
yScale ,
zScale ) ;
_res = Py_BuildValue ( " lc " ,
_rv ,
objectName ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_Media3DRotateNamedObjectTo ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
char objectName ;
Fixed xDegrees ;
Fixed yDegrees ;
Fixed zDegrees ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O&O& " ,
CmpInstObj_Convert , & mh ,
PyMac_GetFixed , & xDegrees ,
PyMac_GetFixed , & yDegrees ,
PyMac_GetFixed , & zDegrees ) )
return NULL ;
_rv = Media3DRotateNamedObjectTo ( mh ,
& objectName ,
xDegrees ,
yDegrees ,
zDegrees ) ;
_res = Py_BuildValue ( " lc " ,
_rv ,
objectName ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_Media3DSetCameraData ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
void * cameraData ;
if ( ! PyArg_ParseTuple ( _args , " O&s " ,
CmpInstObj_Convert , & mh ,
& cameraData ) )
return NULL ;
_rv = Media3DSetCameraData ( mh ,
cameraData ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_Media3DGetCameraData ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
void * cameraData ;
if ( ! PyArg_ParseTuple ( _args , " O&s " ,
CmpInstObj_Convert , & mh ,
& cameraData ) )
return NULL ;
_rv = Media3DGetCameraData ( mh ,
cameraData ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_Media3DSetCameraAngleAspect ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
QTFloatSingle fov ;
QTFloatSingle aspectRatioXToY ;
if ( ! PyArg_ParseTuple ( _args , " O&ff " ,
CmpInstObj_Convert , & mh ,
& fov ,
& aspectRatioXToY ) )
return NULL ;
_rv = Media3DSetCameraAngleAspect ( mh ,
fov ,
aspectRatioXToY ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_Media3DGetCameraAngleAspect ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
QTFloatSingle fov ;
QTFloatSingle aspectRatioXToY ;
if ( ! PyArg_ParseTuple ( _args , " O& " ,
CmpInstObj_Convert , & mh ) )
return NULL ;
_rv = Media3DGetCameraAngleAspect ( mh ,
& fov ,
& aspectRatioXToY ) ;
_res = Py_BuildValue ( " lff " ,
_rv ,
fov ,
aspectRatioXToY ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_Media3DSetCameraRange ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
void * tQ3CameraRange ;
if ( ! PyArg_ParseTuple ( _args , " O&s " ,
CmpInstObj_Convert , & mh ,
& tQ3CameraRange ) )
return NULL ;
_rv = Media3DSetCameraRange ( mh ,
tQ3CameraRange ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_Media3DGetCameraRange ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
void * tQ3CameraRange ;
if ( ! PyArg_ParseTuple ( _args , " O&s " ,
CmpInstObj_Convert , & mh ,
& tQ3CameraRange ) )
return NULL ;
_rv = Media3DGetCameraRange ( mh ,
tQ3CameraRange ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-01-09 18:09:31 -04:00
# if !TARGET_API_MAC_CARBON
2001-05-22 18:56:42 -03:00
static PyObject * Qt_Media3DGetViewObject ( PyObject * _self , PyObject * _args )
2000-12-12 18:10:21 -04:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
MediaHandler mh ;
void * tq3viewObject ;
if ( ! PyArg_ParseTuple ( _args , " O&s " ,
CmpInstObj_Convert , & mh ,
& tq3viewObject ) )
return NULL ;
_rv = Media3DGetViewObject ( mh ,
tq3viewObject ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
}
2001-01-09 18:09:31 -04:00
# endif
2000-12-12 18:10:21 -04:00
2001-05-22 18:56:42 -03:00
static PyObject * Qt_NewTimeBase ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
TimeBase _rv ;
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = NewTimeBase ( ) ;
_res = Py_BuildValue ( " O& " ,
TimeBaseObj_New , _rv ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_ConvertTime ( PyObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
TimeRecord inout ;
TimeBase newBase ;
2000-03-03 13:06:13 -04:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
QtTimeRecord_Convert , & inout ,
1998-04-23 10:22:44 -03:00
TimeBaseObj_Convert , & newBase ) )
return NULL ;
ConvertTime ( & inout ,
newBase ) ;
_res = Py_BuildValue ( " O& " ,
QtTimeRecord_New , & inout ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_ConvertTimeScale ( PyObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
TimeRecord inout ;
TimeScale newScale ;
2000-03-03 13:06:13 -04:00
if ( ! PyArg_ParseTuple ( _args , " O&l " ,
QtTimeRecord_Convert , & inout ,
1998-04-23 10:22:44 -03:00
& newScale ) )
return NULL ;
ConvertTimeScale ( & inout ,
newScale ) ;
_res = Py_BuildValue ( " O& " ,
QtTimeRecord_New , & inout ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_AddTime ( PyObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
TimeRecord dst ;
TimeRecord src ;
2000-03-03 13:06:13 -04:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
QtTimeRecord_Convert , & dst ,
1998-04-23 10:22:44 -03:00
QtTimeRecord_Convert , & src ) )
return NULL ;
AddTime ( & dst ,
& src ) ;
_res = Py_BuildValue ( " O& " ,
QtTimeRecord_New , & dst ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_SubtractTime ( PyObject * _self , PyObject * _args )
1998-04-23 10:22:44 -03:00
{
PyObject * _res = NULL ;
TimeRecord dst ;
TimeRecord src ;
2000-03-03 13:06:13 -04:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
QtTimeRecord_Convert , & dst ,
1998-04-23 10:22:44 -03:00
QtTimeRecord_Convert , & src ) )
return NULL ;
SubtractTime ( & dst ,
& src ) ;
_res = Py_BuildValue ( " O& " ,
QtTimeRecord_New , & dst ) ;
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_MusicMediaGetIndexedTunePlayer ( PyObject * _self , PyObject * _args )
1998-04-21 12:23:55 -03:00
{
PyObject * _res = NULL ;
ComponentResult _rv ;
ComponentInstance ti ;
long sampleDescIndex ;
ComponentInstance tp ;
if ( ! PyArg_ParseTuple ( _args , " O&l " ,
CmpInstObj_Convert , & ti ,
& sampleDescIndex ) )
return NULL ;
_rv = MusicMediaGetIndexedTunePlayer ( ti ,
sampleDescIndex ,
& tp ) ;
_res = Py_BuildValue ( " lO& " ,
_rv ,
CmpInstObj_New , tp ) ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_AlignWindow ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
WindowPtr wp ;
Boolean front ;
if ( ! PyArg_ParseTuple ( _args , " O&b " ,
WinObj_Convert , & wp ,
& front ) )
1995-11-30 13:42:08 -04:00
return NULL ;
1995-12-09 10:05:56 -04:00
AlignWindow ( wp ,
front ,
( Rect * ) 0 ,
( ICMAlignmentProcRecordPtr ) 0 ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_DragAlignedWindow ( PyObject * _self , PyObject * _args )
1995-11-30 13:42:08 -04:00
{
PyObject * _res = NULL ;
1995-12-09 10:05:56 -04:00
WindowPtr wp ;
Point startPt ;
Rect boundsRect ;
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
WinObj_Convert , & wp ,
PyMac_GetPoint , & startPt ,
PyMac_GetRect , & boundsRect ) )
return NULL ;
DragAlignedWindow ( wp ,
startPt ,
& boundsRect ,
( Rect * ) 0 ,
( ICMAlignmentProcRecordPtr ) 0 ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
1995-11-30 13:42:08 -04:00
return _res ;
}
2001-05-22 18:56:42 -03:00
static PyObject * Qt_MoviesTask ( PyObject * _self , PyObject * _args )
1998-07-22 10:37:37 -03:00
{
PyObject * _res = NULL ;
long maxMilliSecToUse ;
if ( ! PyArg_ParseTuple ( _args , " l " ,
& maxMilliSecToUse ) )
return NULL ;
MoviesTask ( ( Movie ) 0 ,
maxMilliSecToUse ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
}
1995-11-30 13:42:08 -04:00
static PyMethodDef Qt_methods [ ] = {
2000-06-21 19:07:06 -03:00
2000-07-14 19:37:27 -03:00
# if !TARGET_API_MAC_CARBON
1999-12-12 17:41:51 -04:00
{ " CheckQuickTimeRegistration " , ( PyCFunction ) Qt_CheckQuickTimeRegistration , 1 ,
" (void * registrationKey, long flags) -> None " } ,
2000-06-21 19:07:06 -03:00
# endif
1995-11-30 13:42:08 -04:00
{ " EnterMovies " , ( PyCFunction ) Qt_EnterMovies , 1 ,
" () -> None " } ,
{ " ExitMovies " , ( PyCFunction ) Qt_ExitMovies , 1 ,
" () -> None " } ,
{ " GetMoviesError " , ( PyCFunction ) Qt_GetMoviesError , 1 ,
" () -> None " } ,
{ " ClearMoviesStickyError " , ( PyCFunction ) Qt_ClearMoviesStickyError , 1 ,
" () -> None " } ,
{ " GetMoviesStickyError " , ( PyCFunction ) Qt_GetMoviesStickyError , 1 ,
" () -> None " } ,
{ " DisposeMatte " , ( PyCFunction ) Qt_DisposeMatte , 1 ,
" (PixMapHandle theMatte) -> None " } ,
{ " NewMovie " , ( PyCFunction ) Qt_NewMovie , 1 ,
" (long flags) -> (Movie _rv) " } ,
{ " GetDataHandler " , ( PyCFunction ) Qt_GetDataHandler , 1 ,
" (Handle dataRef, OSType dataHandlerSubType, long flags) -> (Component _rv) " } ,
2001-01-09 18:09:31 -04:00
# if !TARGET_API_MAC_CARBON
2000-12-12 18:10:21 -04:00
{ " OpenADataHandler " , ( PyCFunction ) Qt_OpenADataHandler , 1 ,
" (Handle dataRef, OSType dataHandlerSubType, Handle anchorDataRef, OSType anchorDataRefType, TimeBase tb, long flags) -> (ComponentInstance dh) " } ,
2001-01-09 18:09:31 -04:00
# endif
1995-11-30 13:42:08 -04:00
{ " PasteHandleIntoMovie " , ( PyCFunction ) Qt_PasteHandleIntoMovie , 1 ,
" (Handle h, OSType handleType, Movie theMovie, long flags, ComponentInstance userComp) -> None " } ,
1998-04-21 12:23:55 -03:00
{ " GetMovieImporterForDataRef " , ( PyCFunction ) Qt_GetMovieImporterForDataRef , 1 ,
" (OSType dataRefType, Handle dataRef, long flags) -> (Component importer) " } ,
1995-11-30 13:42:08 -04:00
{ " TrackTimeToMediaTime " , ( PyCFunction ) Qt_TrackTimeToMediaTime , 1 ,
" (TimeValue value, Track theTrack) -> (TimeValue _rv) " } ,
{ " NewUserData " , ( PyCFunction ) Qt_NewUserData , 1 ,
" () -> (UserData theUserData) " } ,
{ " NewUserDataFromHandle " , ( PyCFunction ) Qt_NewUserDataFromHandle , 1 ,
" (Handle h) -> (UserData theUserData) " } ,
{ " CreateMovieFile " , ( PyCFunction ) Qt_CreateMovieFile , 1 ,
" (FSSpec fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (short resRefNum, Movie newmovie) " } ,
{ " OpenMovieFile " , ( PyCFunction ) Qt_OpenMovieFile , 1 ,
" (FSSpec fileSpec, SInt8 permission) -> (short resRefNum) " } ,
{ " CloseMovieFile " , ( PyCFunction ) Qt_CloseMovieFile , 1 ,
" (short resRefNum) -> None " } ,
{ " DeleteMovieFile " , ( PyCFunction ) Qt_DeleteMovieFile , 1 ,
" (FSSpec fileSpec) -> None " } ,
{ " NewMovieFromFile " , ( PyCFunction ) Qt_NewMovieFromFile , 1 ,
1997-04-09 12:53:46 -03:00
" (short resRefNum, short resId, short newMovieFlags) -> (Movie theMovie, short resId, Boolean dataRefWasChanged) " } ,
1995-11-30 13:42:08 -04:00
{ " NewMovieFromHandle " , ( PyCFunction ) Qt_NewMovieFromHandle , 1 ,
" (Handle h, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged) " } ,
{ " NewMovieFromDataFork " , ( PyCFunction ) Qt_NewMovieFromDataFork , 1 ,
" (short fRefNum, long fileOffset, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged) " } ,
2000-12-12 18:10:21 -04:00
{ " NewMovieFromDataFork64 " , ( PyCFunction ) Qt_NewMovieFromDataFork64 , 1 ,
" (long fRefNum, wide fileOffset, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged) " } ,
1998-04-21 12:23:55 -03:00
{ " NewMovieFromDataRef " , ( PyCFunction ) Qt_NewMovieFromDataRef , 1 ,
" (short flags, Handle dataRef, OSType dataRefType) -> (Movie m, short id) " } ,
1995-11-30 13:42:08 -04:00
{ " RemoveMovieResource " , ( PyCFunction ) Qt_RemoveMovieResource , 1 ,
" (short resRefNum, short resId) -> None " } ,
2000-12-12 18:10:21 -04:00
{ " CreateShortcutMovieFile " , ( PyCFunction ) Qt_CreateShortcutMovieFile , 1 ,
" (FSSpec fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, Handle targetDataRef, OSType targetDataRefType) -> None " } ,
1995-11-30 13:42:08 -04:00
{ " NewMovieFromScrap " , ( PyCFunction ) Qt_NewMovieFromScrap , 1 ,
" (long newMovieFlags) -> (Movie _rv) " } ,
1998-04-21 12:23:55 -03:00
{ " QTNewAlias " , ( PyCFunction ) Qt_QTNewAlias , 1 ,
" (FSSpec fss, Boolean minimal) -> (AliasHandle alias) " } ,
{ " EndFullScreen " , ( PyCFunction ) Qt_EndFullScreen , 1 ,
" (Ptr fullState, long flags) -> None " } ,
{ " AddSoundDescriptionExtension " , ( PyCFunction ) Qt_AddSoundDescriptionExtension , 1 ,
" (SoundDescriptionHandle desc, Handle extension, OSType idType) -> None " } ,
{ " GetSoundDescriptionExtension " , ( PyCFunction ) Qt_GetSoundDescriptionExtension , 1 ,
" (SoundDescriptionHandle desc, OSType idType) -> (Handle extension) " } ,
{ " RemoveSoundDescriptionExtension " , ( PyCFunction ) Qt_RemoveSoundDescriptionExtension , 1 ,
" (SoundDescriptionHandle desc, OSType idType) -> None " } ,
{ " QTIsStandardParameterDialogEvent " , ( PyCFunction ) Qt_QTIsStandardParameterDialogEvent , 1 ,
" (QTParameterDialog createdDialog) -> (EventRecord pEvent) " } ,
{ " QTDismissStandardParameterDialog " , ( PyCFunction ) Qt_QTDismissStandardParameterDialog , 1 ,
" (QTParameterDialog createdDialog) -> None " } ,
{ " QTStandardParameterDialogDoAction " , ( PyCFunction ) Qt_QTStandardParameterDialogDoAction , 1 ,
" (QTParameterDialog createdDialog, long action, void * params) -> None " } ,
{ " QTRegisterAccessKey " , ( PyCFunction ) Qt_QTRegisterAccessKey , 1 ,
" (Str255 accessKeyType, long flags, Handle accessKey) -> None " } ,
{ " QTUnregisterAccessKey " , ( PyCFunction ) Qt_QTUnregisterAccessKey , 1 ,
" (Str255 accessKeyType, long flags, Handle accessKey) -> None " } ,
{ " QTTextToNativeText " , ( PyCFunction ) Qt_QTTextToNativeText , 1 ,
" (Handle theText, long encoding, long flags) -> None " } ,
{ " VideoMediaResetStatistics " , ( PyCFunction ) Qt_VideoMediaResetStatistics , 1 ,
" (MediaHandler mh) -> (ComponentResult _rv) " } ,
{ " VideoMediaGetStatistics " , ( PyCFunction ) Qt_VideoMediaGetStatistics , 1 ,
" (MediaHandler mh) -> (ComponentResult _rv) " } ,
1999-12-12 17:41:51 -04:00
{ " VideoMediaGetStallCount " , ( PyCFunction ) Qt_VideoMediaGetStallCount , 1 ,
" (MediaHandler mh) -> (ComponentResult _rv, unsigned long stalls) " } ,
2000-12-12 18:10:21 -04:00
{ " VideoMediaSetCodecParameter " , ( PyCFunction ) Qt_VideoMediaSetCodecParameter , 1 ,
" (MediaHandler mh, CodecType cType, OSType parameterID, long parameterChangeSeed, void * dataPtr, long dataSize) -> (ComponentResult _rv) " } ,
{ " VideoMediaGetCodecParameter " , ( PyCFunction ) Qt_VideoMediaGetCodecParameter , 1 ,
" (MediaHandler mh, CodecType cType, OSType parameterID, Handle outParameterData) -> (ComponentResult _rv) " } ,
1998-04-21 12:23:55 -03:00
{ " TextMediaAddTextSample " , ( PyCFunction ) Qt_TextMediaAddTextSample , 1 ,
" (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) " } ,
{ " TextMediaAddTESample " , ( PyCFunction ) Qt_TextMediaAddTESample , 1 ,
" (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) " } ,
{ " TextMediaAddHiliteSample " , ( PyCFunction ) Qt_TextMediaAddHiliteSample , 1 ,
" (MediaHandler mh, short hiliteStart, short hiliteEnd, TimeValue duration) -> (ComponentResult _rv, RGBColor rgbHiliteColor, TimeValue sampleTime) " } ,
2000-12-12 18:10:21 -04:00
{ " TextMediaDrawRaw " , ( PyCFunction ) Qt_TextMediaDrawRaw , 1 ,
" (MediaHandler mh, GWorldPtr gw, GDHandle gd, void * data, long dataSize, TextDescriptionHandle tdh) -> (ComponentResult _rv) " } ,
{ " TextMediaSetTextProperty " , ( PyCFunction ) Qt_TextMediaSetTextProperty , 1 ,
" (MediaHandler mh, TimeValue atMediaTime, long propertyType, void * data, long dataSize) -> (ComponentResult _rv) " } ,
{ " TextMediaRawSetup " , ( PyCFunction ) Qt_TextMediaRawSetup , 1 ,
" (MediaHandler mh, GWorldPtr gw, GDHandle gd, void * data, long dataSize, TextDescriptionHandle tdh, TimeValue sampleDuration) -> (ComponentResult _rv) " } ,
{ " TextMediaRawIdle " , ( PyCFunction ) Qt_TextMediaRawIdle , 1 ,
" (MediaHandler mh, GWorldPtr gw, GDHandle gd, TimeValue sampleTime, long flagsIn) -> (ComponentResult _rv, long flagsOut) " } ,
1998-04-21 12:23:55 -03:00
{ " TextMediaFindNextText " , ( PyCFunction ) Qt_TextMediaFindNextText , 1 ,
" (MediaHandler mh, Ptr text, long size, short findFlags, TimeValue startTime) -> (ComponentResult _rv, TimeValue foundTime, TimeValue foundDuration, long offset) " } ,
{ " TextMediaHiliteTextSample " , ( PyCFunction ) Qt_TextMediaHiliteTextSample , 1 ,
" (MediaHandler mh, TimeValue sampleTime, short hiliteStart, short hiliteEnd) -> (ComponentResult _rv, RGBColor rgbHiliteColor) " } ,
{ " TextMediaSetTextSampleData " , ( PyCFunction ) Qt_TextMediaSetTextSampleData , 1 ,
" (MediaHandler mh, void * data, OSType dataType) -> (ComponentResult _rv) " } ,
{ " SpriteMediaSetProperty " , ( PyCFunction ) Qt_SpriteMediaSetProperty , 1 ,
" (MediaHandler mh, short spriteIndex, long propertyType, void * propertyValue) -> (ComponentResult _rv) " } ,
{ " SpriteMediaGetProperty " , ( PyCFunction ) Qt_SpriteMediaGetProperty , 1 ,
" (MediaHandler mh, short spriteIndex, long propertyType, void * propertyValue) -> (ComponentResult _rv) " } ,
{ " SpriteMediaHitTestSprites " , ( PyCFunction ) Qt_SpriteMediaHitTestSprites , 1 ,
" (MediaHandler mh, long flags, Point loc) -> (ComponentResult _rv, short spriteHitIndex) " } ,
{ " SpriteMediaCountSprites " , ( PyCFunction ) Qt_SpriteMediaCountSprites , 1 ,
" (MediaHandler mh) -> (ComponentResult _rv, short numSprites) " } ,
{ " SpriteMediaCountImages " , ( PyCFunction ) Qt_SpriteMediaCountImages , 1 ,
" (MediaHandler mh) -> (ComponentResult _rv, short numImages) " } ,
{ " SpriteMediaGetIndImageDescription " , ( PyCFunction ) Qt_SpriteMediaGetIndImageDescription , 1 ,
" (MediaHandler mh, short imageIndex, ImageDescriptionHandle imageDescription) -> (ComponentResult _rv) " } ,
{ " SpriteMediaGetDisplayedSampleNumber " , ( PyCFunction ) Qt_SpriteMediaGetDisplayedSampleNumber , 1 ,
" (MediaHandler mh) -> (ComponentResult _rv, long sampleNum) " } ,
{ " SpriteMediaGetSpriteName " , ( PyCFunction ) Qt_SpriteMediaGetSpriteName , 1 ,
" (MediaHandler mh, QTAtomID spriteID, Str255 spriteName) -> (ComponentResult _rv) " } ,
{ " SpriteMediaGetImageName " , ( PyCFunction ) Qt_SpriteMediaGetImageName , 1 ,
" (MediaHandler mh, short imageIndex, Str255 imageName) -> (ComponentResult _rv) " } ,
{ " SpriteMediaSetSpriteProperty " , ( PyCFunction ) Qt_SpriteMediaSetSpriteProperty , 1 ,
" (MediaHandler mh, QTAtomID spriteID, long propertyType, void * propertyValue) -> (ComponentResult _rv) " } ,
{ " SpriteMediaGetSpriteProperty " , ( PyCFunction ) Qt_SpriteMediaGetSpriteProperty , 1 ,
" (MediaHandler mh, QTAtomID spriteID, long propertyType, void * propertyValue) -> (ComponentResult _rv) " } ,
{ " SpriteMediaHitTestAllSprites " , ( PyCFunction ) Qt_SpriteMediaHitTestAllSprites , 1 ,
" (MediaHandler mh, long flags, Point loc) -> (ComponentResult _rv, QTAtomID spriteHitID) " } ,
{ " SpriteMediaHitTestOneSprite " , ( PyCFunction ) Qt_SpriteMediaHitTestOneSprite , 1 ,
" (MediaHandler mh, QTAtomID spriteID, long flags, Point loc) -> (ComponentResult _rv, Boolean wasHit) " } ,
{ " SpriteMediaSpriteIndexToID " , ( PyCFunction ) Qt_SpriteMediaSpriteIndexToID , 1 ,
" (MediaHandler mh, short spriteIndex) -> (ComponentResult _rv, QTAtomID spriteID) " } ,
{ " SpriteMediaSpriteIDToIndex " , ( PyCFunction ) Qt_SpriteMediaSpriteIDToIndex , 1 ,
" (MediaHandler mh, QTAtomID spriteID) -> (ComponentResult _rv, short spriteIndex) " } ,
{ " SpriteMediaSetActionVariable " , ( PyCFunction ) Qt_SpriteMediaSetActionVariable , 1 ,
" (MediaHandler mh, QTAtomID variableID, float value) -> (ComponentResult _rv) " } ,
{ " SpriteMediaGetActionVariable " , ( PyCFunction ) Qt_SpriteMediaGetActionVariable , 1 ,
" (MediaHandler mh, QTAtomID variableID) -> (ComponentResult _rv, float value) " } ,
2000-06-21 19:07:06 -03:00
2000-07-14 19:37:27 -03:00
# if !TARGET_API_MAC_CARBON
1998-04-21 12:23:55 -03:00
{ " SpriteMediaGetIndImageProperty " , ( PyCFunction ) Qt_SpriteMediaGetIndImageProperty , 1 ,
" (MediaHandler mh, short imageIndex, long imagePropertyType, void * imagePropertyValue) -> (ComponentResult _rv) " } ,
2000-06-21 19:07:06 -03:00
# endif
2000-12-12 18:10:21 -04:00
{ " SpriteMediaDisposeSprite " , ( PyCFunction ) Qt_SpriteMediaDisposeSprite , 1 ,
" (MediaHandler mh, QTAtomID spriteID) -> (ComponentResult _rv) " } ,
{ " SpriteMediaSetActionVariableToString " , ( PyCFunction ) Qt_SpriteMediaSetActionVariableToString , 1 ,
" (MediaHandler mh, QTAtomID variableID, Ptr theCString) -> (ComponentResult _rv) " } ,
{ " SpriteMediaGetActionVariableAsString " , ( PyCFunction ) Qt_SpriteMediaGetActionVariableAsString , 1 ,
" (MediaHandler mh, QTAtomID variableID) -> (ComponentResult _rv, Handle theCString) " } ,
{ " FlashMediaSetPan " , ( PyCFunction ) Qt_FlashMediaSetPan , 1 ,
" (MediaHandler mh, short xPercent, short yPercent) -> (ComponentResult _rv) " } ,
{ " FlashMediaSetZoom " , ( PyCFunction ) Qt_FlashMediaSetZoom , 1 ,
" (MediaHandler mh, short factor) -> (ComponentResult _rv) " } ,
{ " FlashMediaSetZoomRect " , ( PyCFunction ) Qt_FlashMediaSetZoomRect , 1 ,
" (MediaHandler mh, long left, long top, long right, long bottom) -> (ComponentResult _rv) " } ,
{ " FlashMediaGetRefConBounds " , ( PyCFunction ) Qt_FlashMediaGetRefConBounds , 1 ,
" (MediaHandler mh, long refCon) -> (ComponentResult _rv, long left, long top, long right, long bottom) " } ,
{ " FlashMediaGetRefConID " , ( PyCFunction ) Qt_FlashMediaGetRefConID , 1 ,
" (MediaHandler mh, long refCon) -> (ComponentResult _rv, long refConID) " } ,
{ " FlashMediaIDToRefCon " , ( PyCFunction ) Qt_FlashMediaIDToRefCon , 1 ,
" (MediaHandler mh, long refConID) -> (ComponentResult _rv, long refCon) " } ,
{ " FlashMediaGetDisplayedFrameNumber " , ( PyCFunction ) Qt_FlashMediaGetDisplayedFrameNumber , 1 ,
" (MediaHandler mh) -> (ComponentResult _rv, long flashFrameNumber) " } ,
{ " FlashMediaFrameNumberToMovieTime " , ( PyCFunction ) Qt_FlashMediaFrameNumberToMovieTime , 1 ,
" (MediaHandler mh, long flashFrameNumber) -> (ComponentResult _rv, TimeValue movieTime) " } ,
{ " FlashMediaFrameLabelToMovieTime " , ( PyCFunction ) Qt_FlashMediaFrameLabelToMovieTime , 1 ,
" (MediaHandler mh, Ptr theLabel) -> (ComponentResult _rv, TimeValue movieTime) " } ,
2001-01-09 18:09:31 -04:00
# if !TARGET_API_MAC_CARBON
2000-12-12 18:10:21 -04:00
{ " MovieMediaGetCurrentMovieProperty " , ( PyCFunction ) Qt_MovieMediaGetCurrentMovieProperty , 1 ,
" (MediaHandler mh, OSType whichProperty, void * value) -> (ComponentResult _rv) " } ,
2001-01-09 18:09:31 -04:00
# endif
# if !TARGET_API_MAC_CARBON
2000-12-12 18:10:21 -04:00
{ " MovieMediaGetCurrentTrackProperty " , ( PyCFunction ) Qt_MovieMediaGetCurrentTrackProperty , 1 ,
" (MediaHandler mh, long trackID, OSType whichProperty, void * value) -> (ComponentResult _rv) " } ,
2001-01-09 18:09:31 -04:00
# endif
# if !TARGET_API_MAC_CARBON
2000-12-12 18:10:21 -04:00
{ " MovieMediaGetChildMovieDataReference " , ( PyCFunction ) Qt_MovieMediaGetChildMovieDataReference , 1 ,
" (MediaHandler mh, QTAtomID dataRefID, short dataRefIndex) -> (ComponentResult _rv, OSType dataRefType, Handle dataRef, QTAtomID dataRefIDOut, short dataRefIndexOut) " } ,
2001-01-09 18:09:31 -04:00
# endif
# if !TARGET_API_MAC_CARBON
2000-12-12 18:10:21 -04:00
{ " MovieMediaSetChildMovieDataReference " , ( PyCFunction ) Qt_MovieMediaSetChildMovieDataReference , 1 ,
" (MediaHandler mh, QTAtomID dataRefID, OSType dataRefType, Handle dataRef) -> (ComponentResult _rv) " } ,
2001-01-09 18:09:31 -04:00
# endif
# if !TARGET_API_MAC_CARBON
2000-12-12 18:10:21 -04:00
{ " MovieMediaLoadChildMovieFromDataReference " , ( PyCFunction ) Qt_MovieMediaLoadChildMovieFromDataReference , 1 ,
" (MediaHandler mh, QTAtomID dataRefID) -> (ComponentResult _rv) " } ,
2001-01-09 18:09:31 -04:00
# endif
2000-12-12 18:10:21 -04:00
{ " Media3DGetCurrentGroup " , ( PyCFunction ) Qt_Media3DGetCurrentGroup , 1 ,
" (MediaHandler mh, void * group) -> (ComponentResult _rv) " } ,
{ " Media3DTranslateNamedObjectTo " , ( PyCFunction ) Qt_Media3DTranslateNamedObjectTo , 1 ,
" (MediaHandler mh, Fixed x, Fixed y, Fixed z) -> (ComponentResult _rv, char objectName) " } ,
{ " Media3DScaleNamedObjectTo " , ( PyCFunction ) Qt_Media3DScaleNamedObjectTo , 1 ,
" (MediaHandler mh, Fixed xScale, Fixed yScale, Fixed zScale) -> (ComponentResult _rv, char objectName) " } ,
{ " Media3DRotateNamedObjectTo " , ( PyCFunction ) Qt_Media3DRotateNamedObjectTo , 1 ,
" (MediaHandler mh, Fixed xDegrees, Fixed yDegrees, Fixed zDegrees) -> (ComponentResult _rv, char objectName) " } ,
{ " Media3DSetCameraData " , ( PyCFunction ) Qt_Media3DSetCameraData , 1 ,
" (MediaHandler mh, void * cameraData) -> (ComponentResult _rv) " } ,
{ " Media3DGetCameraData " , ( PyCFunction ) Qt_Media3DGetCameraData , 1 ,
" (MediaHandler mh, void * cameraData) -> (ComponentResult _rv) " } ,
{ " Media3DSetCameraAngleAspect " , ( PyCFunction ) Qt_Media3DSetCameraAngleAspect , 1 ,
" (MediaHandler mh, QTFloatSingle fov, QTFloatSingle aspectRatioXToY) -> (ComponentResult _rv) " } ,
{ " Media3DGetCameraAngleAspect " , ( PyCFunction ) Qt_Media3DGetCameraAngleAspect , 1 ,
" (MediaHandler mh) -> (ComponentResult _rv, QTFloatSingle fov, QTFloatSingle aspectRatioXToY) " } ,
{ " Media3DSetCameraRange " , ( PyCFunction ) Qt_Media3DSetCameraRange , 1 ,
" (MediaHandler mh, void * tQ3CameraRange) -> (ComponentResult _rv) " } ,
{ " Media3DGetCameraRange " , ( PyCFunction ) Qt_Media3DGetCameraRange , 1 ,
" (MediaHandler mh, void * tQ3CameraRange) -> (ComponentResult _rv) " } ,
2001-01-09 18:09:31 -04:00
# if !TARGET_API_MAC_CARBON
2000-12-12 18:10:21 -04:00
{ " Media3DGetViewObject " , ( PyCFunction ) Qt_Media3DGetViewObject , 1 ,
" (MediaHandler mh, void * tq3viewObject) -> (ComponentResult _rv) " } ,
2001-01-09 18:09:31 -04:00
# endif
1995-11-30 13:42:08 -04:00
{ " NewTimeBase " , ( PyCFunction ) Qt_NewTimeBase , 1 ,
" () -> (TimeBase _rv) " } ,
1998-04-23 10:22:44 -03:00
{ " ConvertTime " , ( PyCFunction ) Qt_ConvertTime , 1 ,
2000-03-03 13:06:13 -04:00
" (TimeRecord inout, TimeBase newBase) -> (TimeRecord inout) " } ,
1998-04-23 10:22:44 -03:00
{ " ConvertTimeScale " , ( PyCFunction ) Qt_ConvertTimeScale , 1 ,
2000-03-03 13:06:13 -04:00
" (TimeRecord inout, TimeScale newScale) -> (TimeRecord inout) " } ,
1998-04-23 10:22:44 -03:00
{ " AddTime " , ( PyCFunction ) Qt_AddTime , 1 ,
2000-03-03 13:06:13 -04:00
" (TimeRecord dst, TimeRecord src) -> (TimeRecord dst) " } ,
1998-04-23 10:22:44 -03:00
{ " SubtractTime " , ( PyCFunction ) Qt_SubtractTime , 1 ,
2000-03-03 13:06:13 -04:00
" (TimeRecord dst, TimeRecord src) -> (TimeRecord dst) " } ,
1998-04-21 12:23:55 -03:00
{ " MusicMediaGetIndexedTunePlayer " , ( PyCFunction ) Qt_MusicMediaGetIndexedTunePlayer , 1 ,
" (ComponentInstance ti, long sampleDescIndex) -> (ComponentResult _rv, ComponentInstance tp) " } ,
1995-12-09 10:05:56 -04:00
{ " AlignWindow " , ( PyCFunction ) Qt_AlignWindow , 1 ,
" (WindowPtr wp, Boolean front) -> None " } ,
{ " DragAlignedWindow " , ( PyCFunction ) Qt_DragAlignedWindow , 1 ,
" (WindowPtr wp, Point startPt, Rect boundsRect) -> None " } ,
1998-07-22 10:37:37 -03:00
{ " MoviesTask " , ( PyCFunction ) Qt_MoviesTask , 1 ,
" (long maxMilliSecToUse) -> None " } ,
1995-11-30 13:42:08 -04:00
{ NULL , NULL , 0 }
} ;
2001-05-22 18:56:42 -03:00
void initQt ( void )
1995-11-30 13:42:08 -04:00
{
PyObject * m ;
PyObject * d ;
2001-05-22 18:56:42 -03:00
PyMac_INIT_TOOLBOX_OBJECT_NEW ( Track , TrackObj_New ) ;
PyMac_INIT_TOOLBOX_OBJECT_CONVERT ( Track , TrackObj_Convert ) ;
PyMac_INIT_TOOLBOX_OBJECT_NEW ( Movie , MovieObj_New ) ;
PyMac_INIT_TOOLBOX_OBJECT_CONVERT ( Movie , MovieObj_Convert ) ;
PyMac_INIT_TOOLBOX_OBJECT_NEW ( MovieController , MovieCtlObj_New ) ;
PyMac_INIT_TOOLBOX_OBJECT_CONVERT ( MovieController , MovieCtlObj_Convert ) ;
PyMac_INIT_TOOLBOX_OBJECT_NEW ( TimeBase , TimeBaseObj_New ) ;
PyMac_INIT_TOOLBOX_OBJECT_CONVERT ( TimeBase , TimeBaseObj_Convert ) ;
PyMac_INIT_TOOLBOX_OBJECT_NEW ( UserData , UserDataObj_New ) ;
PyMac_INIT_TOOLBOX_OBJECT_CONVERT ( UserData , UserDataObj_Convert ) ;
PyMac_INIT_TOOLBOX_OBJECT_NEW ( Media , MediaObj_New ) ;
PyMac_INIT_TOOLBOX_OBJECT_CONVERT ( Media , MediaObj_Convert ) ;
2001-05-17 18:58:34 -03:00
1995-11-30 13:42:08 -04:00
m = Py_InitModule ( " Qt " , Qt_methods ) ;
d = PyModule_GetDict ( m ) ;
Qt_Error = PyMac_GetOSErrException ( ) ;
if ( Qt_Error = = NULL | |
PyDict_SetItemString ( d , " Error " , Qt_Error ) ! = 0 )
2000-12-12 18:10:21 -04:00
return ;
1997-09-20 14:40:22 -03:00
MovieController_Type . ob_type = & PyType_Type ;
Py_INCREF ( & MovieController_Type ) ;
if ( PyDict_SetItemString ( d , " MovieControllerType " , ( PyObject * ) & MovieController_Type ) ! = 0 )
Py_FatalError ( " can't initialize MovieControllerType " ) ;
TimeBase_Type . ob_type = & PyType_Type ;
Py_INCREF ( & TimeBase_Type ) ;
if ( PyDict_SetItemString ( d , " TimeBaseType " , ( PyObject * ) & TimeBase_Type ) ! = 0 )
Py_FatalError ( " can't initialize TimeBaseType " ) ;
UserData_Type . ob_type = & PyType_Type ;
Py_INCREF ( & UserData_Type ) ;
if ( PyDict_SetItemString ( d , " UserDataType " , ( PyObject * ) & UserData_Type ) ! = 0 )
Py_FatalError ( " can't initialize UserDataType " ) ;
Media_Type . ob_type = & PyType_Type ;
Py_INCREF ( & Media_Type ) ;
if ( PyDict_SetItemString ( d , " MediaType " , ( PyObject * ) & Media_Type ) ! = 0 )
Py_FatalError ( " can't initialize MediaType " ) ;
Track_Type . ob_type = & PyType_Type ;
Py_INCREF ( & Track_Type ) ;
if ( PyDict_SetItemString ( d , " TrackType " , ( PyObject * ) & Track_Type ) ! = 0 )
Py_FatalError ( " can't initialize TrackType " ) ;
Movie_Type . ob_type = & PyType_Type ;
Py_INCREF ( & Movie_Type ) ;
if ( PyDict_SetItemString ( d , " MovieType " , ( PyObject * ) & Movie_Type ) ! = 0 )
Py_FatalError ( " can't initialize MovieType " ) ;
1995-11-30 13:42:08 -04:00
}
/* ========================= End module Qt ========================== */