Added support for APIs in QuickTimeMusic.h. This one is a bit dodgy:

the header file seems to be hand-written and missing the "const" keywords
for input parameters passed by reference.
This commit is contained in:
Jack Jansen 2004-01-11 22:27:42 +00:00
parent 7e6bbe1516
commit ae57b7f843
3 changed files with 1636 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,11 @@ HEADERFILES= (
"ImageCompression.h",
"QuickTimeComponents.h",
# "ImageCodec.h" -- seems not too useful, and difficult.
"MediaHandlers.h"
"MediaHandlers.h",
# "QTML.h", -- Windows only, needs separate module
# "QuickTimeStreaming.h", -- Difficult
# "QTStreamingComponents.h", -- Needs QTStreaming
"QuickTimeMusic.h",
)
OBJECTS = ("Movie", "Track", "Media", "UserData", "TimeBase", "MovieController",
"IdleManager", "SGOutput")
@ -47,6 +51,24 @@ class MyScanner(Scanner):
def writeinitialdefs(self):
self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
self.defsfile.write("xmlIdentifierUnrecognized = -1\n")
self.defsfile.write("kControllerMinimum = -0xf777\n")
self.defsfile.write("notImplementedMusicOSErr = -2071\n")
self.defsfile.write("cantSendToSynthesizerOSErr = -2072\n")
self.defsfile.write("cantReceiveFromSynthesizerOSErr = -2073\n")
self.defsfile.write("illegalVoiceAllocationOSErr = -2074\n")
self.defsfile.write("illegalPartOSErr = -2075\n")
self.defsfile.write("illegalChannelOSErr = -2076\n")
self.defsfile.write("illegalKnobOSErr = -2077\n")
self.defsfile.write("illegalKnobValueOSErr = -2078\n")
self.defsfile.write("illegalInstrumentOSErr = -2079\n")
self.defsfile.write("illegalControllerOSErr = -2080\n")
self.defsfile.write("midiManagerAbsentOSErr = -2081\n")
self.defsfile.write("synthesizerNotRespondingOSErr = -2082\n")
self.defsfile.write("synthesizerOSErr = -2083\n")
self.defsfile.write("illegalNoteChannelOSErr = -2084\n")
self.defsfile.write("noteChannelNotAllocatedOSErr = -2085\n")
self.defsfile.write("tunePlayerFullOSErr = -2086\n")
self.defsfile.write("tuneParseOSErr = -2087\n")
def makeblacklistnames(self):
return [
@ -100,6 +122,15 @@ class MyScanner(Scanner):
# MediaHandlers
"MediaMakeMediaTimeTable", # just lazy
"MediaGetSampleDataPointer", # funny output pointer
# QuickTimeMusic
"kControllerMinimum",
# These are artefacts of a macro definition
"ulen",
"_ext",
"x",
"w1",
"w2",
]
def makeblacklisttypes(self):
@ -223,6 +254,23 @@ class MyScanner(Scanner):
"GetMovieCompleteParams", # Immense struct
"LevelMeterInfoPtr", # Lazy. Also: can be an output parameter!!
"MediaEQSpectrumBandsRecordPtr", # ditto
# From QuickTimeMusic
"MusicMIDISendUPP",
"MusicOfflineDataUPP",
"TuneCallBackUPP",
"TunePlayCallBackUPP",
"GCPart", # Struct with lots of fields
"GCPart_ptr",
"GenericKnobDescription", # Struct with lots of fields
"KnobDescription", # Struct with lots of fields
"InstrumentAboutInfo", # Struct, not too difficult
"NoteChannel", # XXXX Lazy. Could be opaque, I think
"NoteRequest", # XXXX Lazy. Not-too-difficult struct
"SynthesizerConnections", # Struct with lots of fields
"SynthesizerDescription", # Struct with lots of fields
"TuneStatus", # Struct with lots of fields
]
def makerepairinstructions(self):
@ -254,6 +302,10 @@ class MyScanner(Scanner):
([('char_ptr', '*', 'InMode')], [('stringptr', '*', 'InMode')]),
([('FSSpecPtr', '*', 'InMode')], [('FSSpec_ptr', '*', 'InMode')]),
([('unsigned_char', 'swfVersion', 'OutMode')], [('UInt8', 'swfVersion', 'OutMode')]),
# It seems MusicMIDIPacket if never flagged with const but always used
# for sending only. If that ever changes this needs to be fixed.
([('MusicMIDIPacket', '*', 'OutMode')], [('MusicMIDIPacket_ptr', '*', 'InMode')]),
]
if __name__ == "__main__":

View File

@ -88,6 +88,16 @@ QtTimeRecord_Convert(PyObject *v, TimeRecord *p_itself)
return 1;
}
static int
QtMusicMIDIPacket_Convert(PyObject *v, MusicMIDIPacket *p_itself)
{
int dummy;
if( !PyArg_ParseTuple(v, "hls#", &p_itself->length, &p_itself->reserved, p_itself->data, dummy) )
return 0;
return 1;
}
"""
@ -143,6 +153,10 @@ ComponentInstance = OpaqueByValueType('ComponentInstance', 'CmpInstObj')
MediaHandler = OpaqueByValueType('MediaHandler', 'CmpInstObj')
DataHandler = OpaqueByValueType('DataHandler', 'CmpInstObj')
SGChannel = OpaqueByValueType('SGChannel', 'CmpInstObj')
TunePlayer = OpaqueByValueType('TunePlayer', 'CmpInstObj')
MusicComponent = OpaqueByValueType('MusicComponent', 'CmpInstObj')
NoteAllocator = OpaqueByValueType('NoteAllocator', 'CmpInstObj')
QTMIDIComponent = OpaqueByValueType('QTMIDIComponent', 'CmpInstObj')
ConstFSSpecPtr = FSSpec_ptr
GrafPtr = OpaqueByValueType("GrafPtr", "GrafObj")
@ -164,6 +178,9 @@ VdigBufferRecListHandle = OpaqueByValueType("VdigBufferRecListHandle", "ResObj")
VDCompressionListHandle = OpaqueByValueType("VDCompressionListHandle", "ResObj")
TimeCodeDescriptionHandle = OpaqueByValueType("TimeCodeDescriptionHandle", "ResObj")
DataHFileTypeOrderingHandle = OpaqueByValueType("DataHFileTypeOrderingHandle", "ResObj")
QTMIDIPortListHandle = OpaqueByValueType("QTMIDIPortListHandle", "ResObj")
GenericKnobDescriptionListHandle = OpaqueByValueType("GenericKnobDescriptionListHandle", "ResObj")
InstrumentInfoListHandle = OpaqueByValueType("InstrumentInfoListHandle", "ResObj")
# Silly Apple, passing an OStype by reference...
OSType_ptr = OpaqueType("OSType", "PyMac_BuildOSType", "PyMac_GetOSType")
# And even sillier: passing floats by address
@ -173,6 +190,8 @@ RGBColor = OpaqueType("RGBColor", "QdRGB")
RGBColor_ptr = RGBColor
TimeRecord = OpaqueType("TimeRecord", "QtTimeRecord")
TimeRecord_ptr = TimeRecord
MusicMIDIPacket = OpaqueType("MusicMIDIPacket", "QtMusicMIDIPacket")
MusicMIDIPacket_ptr = MusicMIDIPacket
# Non-opaque types, mostly integer-ish
TimeValue = Type("TimeValue", "l")
@ -200,11 +219,16 @@ CodecType = OSTypeType("CodecType")
GWorldPtr = OpaqueByValueType("GWorldPtr", "GWorldObj")
QTFloatSingle = Type("QTFloatSingle", "f")
CodecQ = Type("CodecQ", "l")
MusicController = Type("MusicController", "l")
# Could-not-be-bothered-types (NewMovieFromFile)
dummyshortptr = FakeType('(short *)0')
dummyStringPtr = FakeType('(StringPtr)0')
# Not-quite-sure-this-is-okay types
AtomicInstrument = OpaqueByValueType("AtomicInstrument", "ResObj")
AtomicInstrumentPtr = InputOnlyType("AtomicInstrumentPtr", "s")
# XXXX Need to override output_tp_newBody() to allow for None initializer.
class QtGlobalObjectDefinition(PEP253Mixin, GlobalObjectDefinition):
def outputCheckNewArg(self):