Enabled resID input/output parameter to NewMovieFromFile. This changes

the Python interface, unfortunately.
Added a few calls that were blacklisted for no apparent reason.
This commit is contained in:
Jack Jansen 1997-04-09 15:53:46 +00:00
parent 3ccd2f153f
commit e0cf87b20d
3 changed files with 192 additions and 13 deletions

View File

@ -232,6 +232,37 @@ static PyObject *MovieCtlObj_MCIsControllerAttached(_self, _args)
return _res; return _res;
} }
static PyObject *MovieCtlObj_MCSetControllerPort(_self, _args)
MovieControllerObject *_self;
PyObject *_args;
{
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;
}
static PyObject *MovieCtlObj_MCGetControllerPort(_self, _args)
MovieControllerObject *_self;
PyObject *_args;
{
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;
}
static PyObject *MovieCtlObj_MCSetVisible(_self, _args) static PyObject *MovieCtlObj_MCSetVisible(_self, _args)
MovieControllerObject *_self; MovieControllerObject *_self;
PyObject *_args; PyObject *_args;
@ -761,6 +792,10 @@ static PyMethodDef MovieCtlObj_methods[] = {
"(Boolean attach) -> (ComponentResult _rv)"}, "(Boolean attach) -> (ComponentResult _rv)"},
{"MCIsControllerAttached", (PyCFunction)MovieCtlObj_MCIsControllerAttached, 1, {"MCIsControllerAttached", (PyCFunction)MovieCtlObj_MCIsControllerAttached, 1,
"() -> (ComponentResult _rv)"}, "() -> (ComponentResult _rv)"},
{"MCSetControllerPort", (PyCFunction)MovieCtlObj_MCSetControllerPort, 1,
"(CGrafPtr gp) -> (ComponentResult _rv)"},
{"MCGetControllerPort", (PyCFunction)MovieCtlObj_MCGetControllerPort, 1,
"() -> (CGrafPtr _rv)"},
{"MCSetVisible", (PyCFunction)MovieCtlObj_MCSetVisible, 1, {"MCSetVisible", (PyCFunction)MovieCtlObj_MCSetVisible, 1,
"(Boolean visible) -> (ComponentResult _rv)"}, "(Boolean visible) -> (ComponentResult _rv)"},
{"MCGetVisible", (PyCFunction)MovieCtlObj_MCGetVisible, 1, {"MCGetVisible", (PyCFunction)MovieCtlObj_MCGetVisible, 1,
@ -1432,6 +1467,34 @@ static PyObject *MediaObj_GetMediaTrack(_self, _args)
return _res; return _res;
} }
static PyObject *MediaObj_GetMediaCreationTime(_self, _args)
MediaObject *_self;
PyObject *_args;
{
PyObject *_res = NULL;
unsigned long _rv;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetMediaCreationTime(_self->ob_itself);
_res = Py_BuildValue("l",
_rv);
return _res;
}
static PyObject *MediaObj_GetMediaModificationTime(_self, _args)
MediaObject *_self;
PyObject *_args;
{
PyObject *_res = NULL;
unsigned long _rv;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetMediaModificationTime(_self->ob_itself);
_res = Py_BuildValue("l",
_rv);
return _res;
}
static PyObject *MediaObj_GetMediaTimeScale(_self, _args) static PyObject *MediaObj_GetMediaTimeScale(_self, _args)
MediaObject *_self; MediaObject *_self;
PyObject *_args; PyObject *_args;
@ -2248,6 +2311,10 @@ static PyMethodDef MediaObj_methods[] = {
"(TimeValue time, TimeValue duration, long flags) -> None"}, "(TimeValue time, TimeValue duration, long flags) -> None"},
{"GetMediaTrack", (PyCFunction)MediaObj_GetMediaTrack, 1, {"GetMediaTrack", (PyCFunction)MediaObj_GetMediaTrack, 1,
"() -> (Track _rv)"}, "() -> (Track _rv)"},
{"GetMediaCreationTime", (PyCFunction)MediaObj_GetMediaCreationTime, 1,
"() -> (unsigned long _rv)"},
{"GetMediaModificationTime", (PyCFunction)MediaObj_GetMediaModificationTime, 1,
"() -> (unsigned long _rv)"},
{"GetMediaTimeScale", (PyCFunction)MediaObj_GetMediaTimeScale, 1, {"GetMediaTimeScale", (PyCFunction)MediaObj_GetMediaTimeScale, 1,
"() -> (TimeScale _rv)"}, "() -> (TimeScale _rv)"},
{"SetMediaTimeScale", (PyCFunction)MediaObj_SetMediaTimeScale, 1, {"SetMediaTimeScale", (PyCFunction)MediaObj_SetMediaTimeScale, 1,
@ -2571,6 +2638,34 @@ static PyObject *TrackObj_GetTrackMovie(_self, _args)
return _res; return _res;
} }
static PyObject *TrackObj_GetTrackCreationTime(_self, _args)
TrackObject *_self;
PyObject *_args;
{
PyObject *_res = NULL;
unsigned long _rv;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetTrackCreationTime(_self->ob_itself);
_res = Py_BuildValue("l",
_rv);
return _res;
}
static PyObject *TrackObj_GetTrackModificationTime(_self, _args)
TrackObject *_self;
PyObject *_args;
{
PyObject *_res = NULL;
unsigned long _rv;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetTrackModificationTime(_self->ob_itself);
_res = Py_BuildValue("l",
_rv);
return _res;
}
static PyObject *TrackObj_GetTrackEnabled(_self, _args) static PyObject *TrackObj_GetTrackEnabled(_self, _args)
TrackObject *_self; TrackObject *_self;
PyObject *_args; PyObject *_args;
@ -3343,6 +3438,10 @@ static PyMethodDef TrackObj_methods[] = {
"() -> (long _rv)"}, "() -> (long _rv)"},
{"GetTrackMovie", (PyCFunction)TrackObj_GetTrackMovie, 1, {"GetTrackMovie", (PyCFunction)TrackObj_GetTrackMovie, 1,
"() -> (Movie _rv)"}, "() -> (Movie _rv)"},
{"GetTrackCreationTime", (PyCFunction)TrackObj_GetTrackCreationTime, 1,
"() -> (unsigned long _rv)"},
{"GetTrackModificationTime", (PyCFunction)TrackObj_GetTrackModificationTime, 1,
"() -> (unsigned long _rv)"},
{"GetTrackEnabled", (PyCFunction)TrackObj_GetTrackEnabled, 1, {"GetTrackEnabled", (PyCFunction)TrackObj_GetTrackEnabled, 1,
"() -> (Boolean _rv)"}, "() -> (Boolean _rv)"},
{"SetTrackEnabled", (PyCFunction)TrackObj_SetTrackEnabled, 1, {"SetTrackEnabled", (PyCFunction)TrackObj_SetTrackEnabled, 1,
@ -3711,6 +3810,43 @@ static PyObject *MovieObj_GetMovieTimeBase(_self, _args)
return _res; return _res;
} }
static PyObject *MovieObj_GetMovieGWorld(_self, _args)
MovieObject *_self;
PyObject *_args;
{
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,
ResObj_New, gdh);
return _res;
}
static PyObject *MovieObj_SetMovieGWorld(_self, _args)
MovieObject *_self;
PyObject *_args;
{
PyObject *_res = NULL;
CGrafPtr port;
GDHandle gdh;
if (!PyArg_ParseTuple(_args, "O&O&",
GrafObj_Convert, &port,
ResObj_Convert, &gdh))
return NULL;
SetMovieGWorld(_self->ob_itself,
port,
gdh);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
static PyObject *MovieObj_GetNextTrackForCompositing(_self, _args) static PyObject *MovieObj_GetNextTrackForCompositing(_self, _args)
MovieObject *_self; MovieObject *_self;
PyObject *_args; PyObject *_args;
@ -3952,6 +4088,34 @@ static PyObject *MovieObj_PutMovieIntoDataFork(_self, _args)
return _res; return _res;
} }
static PyObject *MovieObj_GetMovieCreationTime(_self, _args)
MovieObject *_self;
PyObject *_args;
{
PyObject *_res = NULL;
unsigned long _rv;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetMovieCreationTime(_self->ob_itself);
_res = Py_BuildValue("l",
_rv);
return _res;
}
static PyObject *MovieObj_GetMovieModificationTime(_self, _args)
MovieObject *_self;
PyObject *_args;
{
PyObject *_res = NULL;
unsigned long _rv;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetMovieModificationTime(_self->ob_itself);
_res = Py_BuildValue("l",
_rv);
return _res;
}
static PyObject *MovieObj_GetMovieTimeScale(_self, _args) static PyObject *MovieObj_GetMovieTimeScale(_self, _args)
MovieObject *_self; MovieObject *_self;
PyObject *_args; PyObject *_args;
@ -5152,6 +5316,10 @@ static PyMethodDef MovieObj_methods[] = {
"() -> None"}, "() -> None"},
{"GetMovieTimeBase", (PyCFunction)MovieObj_GetMovieTimeBase, 1, {"GetMovieTimeBase", (PyCFunction)MovieObj_GetMovieTimeBase, 1,
"() -> (TimeBase _rv)"}, "() -> (TimeBase _rv)"},
{"GetMovieGWorld", (PyCFunction)MovieObj_GetMovieGWorld, 1,
"() -> (CGrafPtr port, GDHandle gdh)"},
{"SetMovieGWorld", (PyCFunction)MovieObj_SetMovieGWorld, 1,
"(CGrafPtr port, GDHandle gdh) -> None"},
{"GetNextTrackForCompositing", (PyCFunction)MovieObj_GetNextTrackForCompositing, 1, {"GetNextTrackForCompositing", (PyCFunction)MovieObj_GetNextTrackForCompositing, 1,
"(Track theTrack) -> (Track _rv)"}, "(Track theTrack) -> (Track _rv)"},
{"GetPrevTrackForCompositing", (PyCFunction)MovieObj_GetPrevTrackForCompositing, 1, {"GetPrevTrackForCompositing", (PyCFunction)MovieObj_GetPrevTrackForCompositing, 1,
@ -5182,6 +5350,10 @@ static PyMethodDef MovieObj_methods[] = {
"(Handle publicMovie) -> None"}, "(Handle publicMovie) -> None"},
{"PutMovieIntoDataFork", (PyCFunction)MovieObj_PutMovieIntoDataFork, 1, {"PutMovieIntoDataFork", (PyCFunction)MovieObj_PutMovieIntoDataFork, 1,
"(short fRefNum, long offset, long maxSize) -> None"}, "(short fRefNum, long offset, long maxSize) -> None"},
{"GetMovieCreationTime", (PyCFunction)MovieObj_GetMovieCreationTime, 1,
"() -> (unsigned long _rv)"},
{"GetMovieModificationTime", (PyCFunction)MovieObj_GetMovieModificationTime, 1,
"() -> (unsigned long _rv)"},
{"GetMovieTimeScale", (PyCFunction)MovieObj_GetMovieTimeScale, 1, {"GetMovieTimeScale", (PyCFunction)MovieObj_GetMovieTimeScale, 1,
"() -> (TimeScale _rv)"}, "() -> (TimeScale _rv)"},
{"SetMovieTimeScale", (PyCFunction)MovieObj_SetMovieTimeScale, 1, {"SetMovieTimeScale", (PyCFunction)MovieObj_SetMovieTimeScale, 1,
@ -5638,21 +5810,24 @@ static PyObject *Qt_NewMovieFromFile(_self, _args)
OSErr _err; OSErr _err;
Movie theMovie; Movie theMovie;
short resRefNum; short resRefNum;
short resId;
short newMovieFlags; short newMovieFlags;
Boolean dataRefWasChanged; Boolean dataRefWasChanged;
if (!PyArg_ParseTuple(_args, "hh", if (!PyArg_ParseTuple(_args, "hhh",
&resRefNum, &resRefNum,
&resId,
&newMovieFlags)) &newMovieFlags))
return NULL; return NULL;
_err = NewMovieFromFile(&theMovie, _err = NewMovieFromFile(&theMovie,
resRefNum, resRefNum,
(short *)0, &resId,
(StringPtr)0, (StringPtr)0,
newMovieFlags, newMovieFlags,
&dataRefWasChanged); &dataRefWasChanged);
if (_err != noErr) return PyMac_Error(_err); if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&b", _res = Py_BuildValue("O&hb",
MovieObj_New, theMovie, MovieObj_New, theMovie,
resId,
dataRefWasChanged); dataRefWasChanged);
return _res; return _res;
} }
@ -5837,7 +6012,7 @@ static PyMethodDef Qt_methods[] = {
{"DeleteMovieFile", (PyCFunction)Qt_DeleteMovieFile, 1, {"DeleteMovieFile", (PyCFunction)Qt_DeleteMovieFile, 1,
"(FSSpec fileSpec) -> None"}, "(FSSpec fileSpec) -> None"},
{"NewMovieFromFile", (PyCFunction)Qt_NewMovieFromFile, 1, {"NewMovieFromFile", (PyCFunction)Qt_NewMovieFromFile, 1,
"(short resRefNum, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"}, "(short resRefNum, short resId, short newMovieFlags) -> (Movie theMovie, short resId, Boolean dataRefWasChanged)"},
{"NewMovieFromHandle", (PyCFunction)Qt_NewMovieFromHandle, 1, {"NewMovieFromHandle", (PyCFunction)Qt_NewMovieFromHandle, 1,
"(Handle h, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"}, "(Handle h, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
{"NewMovieFromDataFork", (PyCFunction)Qt_NewMovieFromDataFork, 1, {"NewMovieFromDataFork", (PyCFunction)Qt_NewMovieFromDataFork, 1,

View File

@ -40,17 +40,18 @@ class MyScanner(Scanner):
"DisposeUserData", # ditto "DisposeUserData", # ditto
"DisposeTimeBase", # ditto "DisposeTimeBase", # ditto
"DisposeMovieController", # ditto "DisposeMovieController", # ditto
"GetMovieCreationTime", # type "unsigned long" in C, inparseable # "GetMovieCreationTime", # type "unsigned long" in C, inparseable
"GetMovieModificationTime", # Ditto # "GetMovieModificationTime", # Ditto
"GetTrackCreationTime", # ditto # "GetTrackCreationTime", # ditto
"GetTrackModificationTime", # Ditto # "GetTrackModificationTime", # Ditto
"GetMediaCreationTime", # ditto # "GetMediaCreationTime", # ditto
"GetMediaModificationTime", # Ditto # "GetMediaModificationTime", # Ditto
# The following 4 use 'void *' in an uncontrolled way # The following 4 use 'void *' in an uncontrolled way
# TBD when I've read the manual... # TBD when I've read the manual...
"GetUserDataItem", "GetUserDataItem",
"SetUserDataItem", "SetUserDataItem",
"SetTextSampleData", "SetTextSampleData",
"BeginFullScreen",
# bgen gets the argument in/out wrong.. # bgen gets the argument in/out wrong..
"AddTextSample", "AddTextSample",
"AddTESample", "AddTESample",
@ -105,8 +106,8 @@ class MyScanner(Scanner):
# "TextDescription", # "TextDescription",
# "MusicDescription", # "MusicDescription",
# I dont know yet how to do these. # I dont know yet how to do these.
"CGrafPtr", # "CGrafPtr",
"GDHandle", # "GDHandle",
# Routine pointers, not yet. # Routine pointers, not yet.
"MoviesErrorUPP", "MoviesErrorUPP",
"MoviePreviewCallOutUPP", "MoviePreviewCallOutUPP",
@ -119,6 +120,7 @@ class MyScanner(Scanner):
"MCActionFilterWithRefConUPP", "MCActionFilterWithRefConUPP",
"GetMovieUPP", "GetMovieUPP",
"ModalFilterUPP", "ModalFilterUPP",
"TrackTransferUPP",
"QTAtomContainer", "QTAtomContainer",
"SpriteWorld", "SpriteWorld",
"Sprite", "Sprite",
@ -134,7 +136,7 @@ class MyScanner(Scanner):
# NewMovieFromFile # NewMovieFromFile
([('short', 'resId', 'OutMode'), ('StringPtr', 'resName', 'InMode')], ([('short', 'resId', 'OutMode'), ('StringPtr', 'resName', 'InMode')],
[('dummyshortptr', 'resId', 'InMode'), ('dummyStringPtr', 'resName', 'InMode')]), [('short', 'resId', 'InOutMode'), ('dummyStringPtr', 'resName', 'InMode')]),
# MCDoAction and more # MCDoAction and more
([('void', '*', 'OutMode')], [('mcactionparams', '*', 'InMode')]), ([('void', '*', 'OutMode')], [('mcactionparams', '*', 'InMode')]),

View File

@ -71,6 +71,8 @@ PixMapHandle = OpaqueByValueType("PixMapHandle", "ResObj")
SampleDescriptionHandle = OpaqueByValueType("SampleDescriptionHandle", "ResObj") SampleDescriptionHandle = OpaqueByValueType("SampleDescriptionHandle", "ResObj")
ImageDescriptionHandle = OpaqueByValueType("ImageDescriptionHandle", "ResObj") ImageDescriptionHandle = OpaqueByValueType("ImageDescriptionHandle", "ResObj")
TEHandle = OpaqueByValueType("TEHandle", "ResObj") TEHandle = OpaqueByValueType("TEHandle", "ResObj")
CGrafPtr = OpaqueByValueType("CGrafPtr", "GrafObj")
GDHandle = OpaqueByValueType("GDHandle", "ResObj")
# Silly Apple, passing an OStype by reference... # Silly Apple, passing an OStype by reference...
OSType_ptr = OpaqueType("OSType", "PyMac_BuildOSType", "PyMac_GetOSType") OSType_ptr = OpaqueType("OSType", "PyMac_BuildOSType", "PyMac_GetOSType")