Commit ae57b7f8 authored by Jack Jansen's avatar Jack Jansen

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.
parent 7e6bbe15
This diff is collapsed.
...@@ -13,7 +13,11 @@ HEADERFILES= ( ...@@ -13,7 +13,11 @@ HEADERFILES= (
"ImageCompression.h", "ImageCompression.h",
"QuickTimeComponents.h", "QuickTimeComponents.h",
# "ImageCodec.h" -- seems not too useful, and difficult. # "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", OBJECTS = ("Movie", "Track", "Media", "UserData", "TimeBase", "MovieController",
"IdleManager", "SGOutput") "IdleManager", "SGOutput")
...@@ -47,6 +51,24 @@ class MyScanner(Scanner): ...@@ -47,6 +51,24 @@ class MyScanner(Scanner):
def writeinitialdefs(self): def writeinitialdefs(self):
self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n") self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
self.defsfile.write("xmlIdentifierUnrecognized = -1\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): def makeblacklistnames(self):
return [ return [
...@@ -100,6 +122,15 @@ class MyScanner(Scanner): ...@@ -100,6 +122,15 @@ class MyScanner(Scanner):
# MediaHandlers # MediaHandlers
"MediaMakeMediaTimeTable", # just lazy "MediaMakeMediaTimeTable", # just lazy
"MediaGetSampleDataPointer", # funny output pointer "MediaGetSampleDataPointer", # funny output pointer
# QuickTimeMusic
"kControllerMinimum",
# These are artefacts of a macro definition
"ulen",
"_ext",
"x",
"w1",
"w2",
] ]
def makeblacklisttypes(self): def makeblacklisttypes(self):
...@@ -223,6 +254,23 @@ class MyScanner(Scanner): ...@@ -223,6 +254,23 @@ class MyScanner(Scanner):
"GetMovieCompleteParams", # Immense struct "GetMovieCompleteParams", # Immense struct
"LevelMeterInfoPtr", # Lazy. Also: can be an output parameter!! "LevelMeterInfoPtr", # Lazy. Also: can be an output parameter!!
"MediaEQSpectrumBandsRecordPtr", # ditto "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): def makerepairinstructions(self):
...@@ -254,6 +302,10 @@ class MyScanner(Scanner): ...@@ -254,6 +302,10 @@ class MyScanner(Scanner):
([('char_ptr', '*', 'InMode')], [('stringptr', '*', 'InMode')]), ([('char_ptr', '*', 'InMode')], [('stringptr', '*', 'InMode')]),
([('FSSpecPtr', '*', 'InMode')], [('FSSpec_ptr', '*', 'InMode')]), ([('FSSpecPtr', '*', 'InMode')], [('FSSpec_ptr', '*', 'InMode')]),
([('unsigned_char', 'swfVersion', 'OutMode')], [('UInt8', 'swfVersion', 'OutMode')]), ([('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__": if __name__ == "__main__":
......
...@@ -88,6 +88,16 @@ QtTimeRecord_Convert(PyObject *v, TimeRecord *p_itself) ...@@ -88,6 +88,16 @@ QtTimeRecord_Convert(PyObject *v, TimeRecord *p_itself)
return 1; 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') ...@@ -143,6 +153,10 @@ ComponentInstance = OpaqueByValueType('ComponentInstance', 'CmpInstObj')
MediaHandler = OpaqueByValueType('MediaHandler', 'CmpInstObj') MediaHandler = OpaqueByValueType('MediaHandler', 'CmpInstObj')
DataHandler = OpaqueByValueType('DataHandler', 'CmpInstObj') DataHandler = OpaqueByValueType('DataHandler', 'CmpInstObj')
SGChannel = OpaqueByValueType('SGChannel', 'CmpInstObj') SGChannel = OpaqueByValueType('SGChannel', 'CmpInstObj')
TunePlayer = OpaqueByValueType('TunePlayer', 'CmpInstObj')
MusicComponent = OpaqueByValueType('MusicComponent', 'CmpInstObj')
NoteAllocator = OpaqueByValueType('NoteAllocator', 'CmpInstObj')
QTMIDIComponent = OpaqueByValueType('QTMIDIComponent', 'CmpInstObj')
ConstFSSpecPtr = FSSpec_ptr ConstFSSpecPtr = FSSpec_ptr
GrafPtr = OpaqueByValueType("GrafPtr", "GrafObj") GrafPtr = OpaqueByValueType("GrafPtr", "GrafObj")
...@@ -164,6 +178,9 @@ VdigBufferRecListHandle = OpaqueByValueType("VdigBufferRecListHandle", "ResObj") ...@@ -164,6 +178,9 @@ VdigBufferRecListHandle = OpaqueByValueType("VdigBufferRecListHandle", "ResObj")
VDCompressionListHandle = OpaqueByValueType("VDCompressionListHandle", "ResObj") VDCompressionListHandle = OpaqueByValueType("VDCompressionListHandle", "ResObj")
TimeCodeDescriptionHandle = OpaqueByValueType("TimeCodeDescriptionHandle", "ResObj") TimeCodeDescriptionHandle = OpaqueByValueType("TimeCodeDescriptionHandle", "ResObj")
DataHFileTypeOrderingHandle = OpaqueByValueType("DataHFileTypeOrderingHandle", "ResObj") DataHFileTypeOrderingHandle = OpaqueByValueType("DataHFileTypeOrderingHandle", "ResObj")
QTMIDIPortListHandle = OpaqueByValueType("QTMIDIPortListHandle", "ResObj")
GenericKnobDescriptionListHandle = OpaqueByValueType("GenericKnobDescriptionListHandle", "ResObj")
InstrumentInfoListHandle = OpaqueByValueType("InstrumentInfoListHandle", "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")
# And even sillier: passing floats by address # And even sillier: passing floats by address
...@@ -173,6 +190,8 @@ RGBColor = OpaqueType("RGBColor", "QdRGB") ...@@ -173,6 +190,8 @@ RGBColor = OpaqueType("RGBColor", "QdRGB")
RGBColor_ptr = RGBColor RGBColor_ptr = RGBColor
TimeRecord = OpaqueType("TimeRecord", "QtTimeRecord") TimeRecord = OpaqueType("TimeRecord", "QtTimeRecord")
TimeRecord_ptr = TimeRecord TimeRecord_ptr = TimeRecord
MusicMIDIPacket = OpaqueType("MusicMIDIPacket", "QtMusicMIDIPacket")
MusicMIDIPacket_ptr = MusicMIDIPacket
# Non-opaque types, mostly integer-ish # Non-opaque types, mostly integer-ish
TimeValue = Type("TimeValue", "l") TimeValue = Type("TimeValue", "l")
...@@ -200,11 +219,16 @@ CodecType = OSTypeType("CodecType") ...@@ -200,11 +219,16 @@ CodecType = OSTypeType("CodecType")
GWorldPtr = OpaqueByValueType("GWorldPtr", "GWorldObj") GWorldPtr = OpaqueByValueType("GWorldPtr", "GWorldObj")
QTFloatSingle = Type("QTFloatSingle", "f") QTFloatSingle = Type("QTFloatSingle", "f")
CodecQ = Type("CodecQ", "l") CodecQ = Type("CodecQ", "l")
MusicController = Type("MusicController", "l")
# Could-not-be-bothered-types (NewMovieFromFile) # Could-not-be-bothered-types (NewMovieFromFile)
dummyshortptr = FakeType('(short *)0') dummyshortptr = FakeType('(short *)0')
dummyStringPtr = FakeType('(StringPtr)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. # XXXX Need to override output_tp_newBody() to allow for None initializer.
class QtGlobalObjectDefinition(PEP253Mixin, GlobalObjectDefinition): class QtGlobalObjectDefinition(PEP253Mixin, GlobalObjectDefinition):
def outputCheckNewArg(self): def outputCheckNewArg(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment