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

View File

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

View File

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