[Python-checkins] python/dist/src/Mac/Modules/qt _Qtmodule.c, 1.22, 1.23 qtscan.py, 1.26, 1.27 qtsupport.py, 1.26, 1.27

jackjansen at users.sourceforge.net jackjansen at users.sourceforge.net
Sun Jan 11 17:27:45 EST 2004


Update of /cvsroot/python/python/dist/src/Mac/Modules/qt
In directory sc8-pr-cvs1:/tmp/cvs-serv23010

Modified Files:
	_Qtmodule.c qtscan.py qtsupport.py 
Log Message:
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.


Index: _Qtmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/_Qtmodule.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** _Qtmodule.c	9 Jan 2004 23:18:47 -0000	1.22
--- _Qtmodule.c	11 Jan 2004 22:27:42 -0000	1.23
***************
*** 79,82 ****
--- 79,92 ----
  }
  
+ 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;
[...1548 lines suppressed...]
+ 	{"TuneSetPartTranspose", (PyCFunction)Qt_TuneSetPartTranspose, 1,
+ 	 PyDoc_STR("(TunePlayer tp, unsigned long part, long transpose, long velocityShift) -> (ComponentResult _rv)")},
+ 	{"TuneGetNoteAllocator", (PyCFunction)Qt_TuneGetNoteAllocator, 1,
+ 	 PyDoc_STR("(TunePlayer tp) -> (NoteAllocator _rv)")},
+ 	{"TuneSetSofter", (PyCFunction)Qt_TuneSetSofter, 1,
+ 	 PyDoc_STR("(TunePlayer tp, long softer) -> (ComponentResult _rv)")},
+ 	{"TuneTask", (PyCFunction)Qt_TuneTask, 1,
+ 	 PyDoc_STR("(TunePlayer tp) -> (ComponentResult _rv)")},
+ 	{"TuneSetBalance", (PyCFunction)Qt_TuneSetBalance, 1,
+ 	 PyDoc_STR("(TunePlayer tp, long balance) -> (ComponentResult _rv)")},
+ 	{"TuneSetSoundLocalization", (PyCFunction)Qt_TuneSetSoundLocalization, 1,
+ 	 PyDoc_STR("(TunePlayer tp, Handle data) -> (ComponentResult _rv)")},
+ 	{"TuneSetHeaderWithSize", (PyCFunction)Qt_TuneSetHeaderWithSize, 1,
+ 	 PyDoc_STR("(TunePlayer tp, unsigned long size) -> (ComponentResult _rv, unsigned long header)")},
+ 	{"TuneSetPartMix", (PyCFunction)Qt_TuneSetPartMix, 1,
+ 	 PyDoc_STR("(TunePlayer tp, unsigned long partNumber, long volume, long balance, long mixFlags) -> (ComponentResult _rv)")},
+ 	{"TuneGetPartMix", (PyCFunction)Qt_TuneGetPartMix, 1,
+ 	 PyDoc_STR("(TunePlayer tp, unsigned long partNumber) -> (ComponentResult _rv, long volumeOut, long balanceOut, long mixFlagsOut)")},
  	{"AlignWindow", (PyCFunction)Qt_AlignWindow, 1,
  	 PyDoc_STR("(WindowPtr wp, Boolean front) -> None")},

Index: qtscan.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtscan.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** qtscan.py	9 Jan 2004 23:18:47 -0000	1.26
--- qtscan.py	11 Jan 2004 22:27:42 -0000	1.27
***************
*** 14,18 ****
  	"QuickTimeComponents.h",
  #	"ImageCodec.h"  -- seems not too useful, and difficult.
! 	"MediaHandlers.h"
  	)
  OBJECTS = ("Movie", "Track", "Media", "UserData", "TimeBase", "MovieController", 
--- 14,22 ----
  	"QuickTimeComponents.h",
  #	"ImageCodec.h"  -- seems not too useful, and difficult.
! 	"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", 
***************
*** 48,51 ****
--- 52,73 ----
  		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):
***************
*** 101,104 ****
--- 123,135 ----
  			"MediaMakeMediaTimeTable", # just lazy
  			"MediaGetSampleDataPointer", # funny output pointer
+ 			
+ 			# QuickTimeMusic
+ 			"kControllerMinimum",
+ 			# These are artefacts of a macro definition
+ 			"ulen",
+ 			"_ext",
+ 			"x",
+ 			"w1",
+ 			"w2",
  			]
  
***************
*** 224,227 ****
--- 255,275 ----
              "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
+             
  			]
  
***************
*** 255,258 ****
--- 303,310 ----
  			([('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')]),
  			]
  			

Index: qtsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtsupport.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** qtsupport.py	4 Jan 2004 22:33:33 -0000	1.26
--- qtsupport.py	11 Jan 2004 22:27:42 -0000	1.27
***************
*** 89,92 ****
--- 89,102 ----
  }
  
+ 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;
+ }
+ 
  
  
***************
*** 144,147 ****
--- 154,161 ----
  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
***************
*** 165,168 ****
--- 179,185 ----
  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")
***************
*** 174,177 ****
--- 191,196 ----
  TimeRecord = OpaqueType("TimeRecord", "QtTimeRecord")
  TimeRecord_ptr = TimeRecord
+ MusicMIDIPacket = OpaqueType("MusicMIDIPacket", "QtMusicMIDIPacket")
+ MusicMIDIPacket_ptr = MusicMIDIPacket
  
  # Non-opaque types, mostly integer-ish
***************
*** 201,208 ****
--- 220,232 ----
  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.





More information about the Python-checkins mailing list