Don't reference removed files in Makefile
[python/dscho.git] / Mac / Modules / snd / sndscan.py
blob02c91773c7c0f5f0e5d692c6880685a501abd1a6
1 # Scan Sound.h header file, generate sndgen.py and Sound.py files.
2 # Then import sndsupport (which execs sndgen.py) to generate Sndmodule.c.
3 # (Should learn how to tell the compiler to compile it as well.)
5 from scantools import Scanner
7 def main():
8 input = "Sound.h"
9 output = "sndgen.py"
10 defsoutput = "Sound.py"
11 scanner = SoundScanner(input, output, defsoutput)
12 scanner.scan()
13 scanner.close()
14 print "=== Done scanning and generating, now doing 'import sndsupport' ==="
15 import sndsupport
16 print "=== Done. It's up to you to compile Sndmodule.c ==="
18 class SoundScanner(Scanner):
20 def destination(self, type, name, arglist):
21 classname = "SndFunction"
22 listname = "functions"
23 if arglist:
24 t, n, m = arglist[0]
25 if t == "SndChannelPtr" and m == "InMode":
26 classname = "SndMethod"
27 listname = "sndmethods"
28 return classname, listname
30 def makeblacklistnames(self):
31 return [
32 'SndDisposeChannel', # automatic on deallocation
33 'SndAddModifier', # for internal use only
34 'SndPlayDoubleBuffer', # very low level routine
35 # Obsolete:
36 'StartSound',
37 'StopSound',
38 'SoundDone',
42 def makeblacklisttypes(self):
43 return [
44 "GetSoundVol",
45 "SetSoundVol",
48 def makerepairinstructions(self):
49 return [
50 ([("Str255", "*", "InMode")],
51 [("*", "*", "OutMode")]),
53 ([("void_ptr", "*", "InMode"), ("long", "*", "InMode")],
54 [("InBuffer", "*", "*")]),
56 ([("void", "*", "OutMode"), ("long", "*", "InMode"),
57 ("long", "*", "OutMode")],
58 [("VarVarOutBuffer", "*", "InOutMode")]),
60 ([("SCStatusPtr", "*", "InMode")],
61 [("SCStatus", "*", "OutMode")]),
63 ([("SMStatusPtr", "*", "InMode")],
64 [("SMStatus", "*", "OutMode")]),
66 # For SndPlay's SndListHandle argument
67 ([("Handle", "sndHdl", "InMode")],
68 [("SndListHandle", "*", "*")]),
70 # For SndStartFilePlay
71 ([("long", "bufferSize", "InMode"), ("void", "theBuffer", "OutMode")],
72 [("*", "*", "*"), ("FakeType('0')", "*", "InMode")]),
74 # For Comp3to1 etc.
75 ([("void_ptr", "inBuffer", "InMode"),
76 ("void", "outBuffer", "OutMode"),
77 ("unsigned_long", "cnt", "InMode")],
78 [("InOutBuffer", "buffer", "InOutMode")]),
80 # Ditto
81 ([("void_ptr", "inState", "InMode"), ("void", "outState", "OutMode")],
82 [("InOutBuf128", "state", "InOutMode")]),
85 if __name__ == "__main__":
86 main()