summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/snd
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-06-09 20:56:31 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-06-09 20:56:31 (GMT)
commit7d0bc8343f55f2e467abb2ce50b76b054897d72f (patch)
treec3a2618e7c6c09c201d03bb67dc1038cab7dc534 /Mac/Modules/snd
parenta0e76bebd3ddb05461c9f692ff1f53267203aaae (diff)
downloadcpython-7d0bc8343f55f2e467abb2ce50b76b054897d72f.zip
cpython-7d0bc8343f55f2e467abb2ce50b76b054897d72f.tar.gz
cpython-7d0bc8343f55f2e467abb2ce50b76b054897d72f.tar.bz2
Ported to Universal Header 2.0.1f (i.e. CW6)
Diffstat (limited to 'Mac/Modules/snd')
-rw-r--r--Mac/Modules/snd/Sndmodule.c72
-rw-r--r--Mac/Modules/snd/sndgen.py10
-rw-r--r--Mac/Modules/snd/sndscan.py10
-rw-r--r--Mac/Modules/snd/sndsupport.py3
4 files changed, 47 insertions, 48 deletions
diff --git a/Mac/Modules/snd/Sndmodule.c b/Mac/Modules/snd/Sndmodule.c
index 62e9d85..fbc8ff2 100644
--- a/Mac/Modules/snd/Sndmodule.c
+++ b/Mac/Modules/snd/Sndmodule.c
@@ -496,15 +496,14 @@ static PyObject *Snd_Comp3to1(_self, _args)
char *buffer__out__;
long buffer__len__;
int buffer__in_len__;
- char *state__in__;
- char state__out__[128];
- int state__len__;
+ StateBlock *state__in__;
+ StateBlock state__out__;
int state__in_len__;
unsigned long numChannels;
unsigned long whichChannel;
if (!PyArg_ParseTuple(_args, "s#s#ll",
&buffer__in__, &buffer__in_len__,
- &state__in__, &state__in_len__,
+ (char **)&state__in__, &state__in_len__,
&numChannels,
&whichChannel))
return NULL;
@@ -514,19 +513,18 @@ static PyObject *Snd_Comp3to1(_self, _args)
goto buffer__error__;
}
buffer__len__ = buffer__in_len__;
- if (state__in_len__ != 128)
+ if (state__in_len__ != sizeof(StateBlock))
{
- PyErr_SetString(PyExc_TypeError, "buffer length should be 128");
+ PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(StateBlock)");
goto state__error__;
}
- state__len__ = state__in_len__;
Comp3to1(buffer__in__, buffer__out__, (long)buffer__len__,
- state__in__, state__out__,
+ state__in__, &state__out__,
numChannels,
whichChannel);
_res = Py_BuildValue("s#s#",
buffer__out__, (int)buffer__len__,
- state__out__, (int)128);
+ (char *)&state__out__, (int)sizeof(StateBlock));
state__error__: ;
free(buffer__out__);
buffer__error__: ;
@@ -542,15 +540,14 @@ static PyObject *Snd_Exp1to3(_self, _args)
char *buffer__out__;
long buffer__len__;
int buffer__in_len__;
- char *state__in__;
- char state__out__[128];
- int state__len__;
+ StateBlock *state__in__;
+ StateBlock state__out__;
int state__in_len__;
unsigned long numChannels;
unsigned long whichChannel;
if (!PyArg_ParseTuple(_args, "s#s#ll",
&buffer__in__, &buffer__in_len__,
- &state__in__, &state__in_len__,
+ (char **)&state__in__, &state__in_len__,
&numChannels,
&whichChannel))
return NULL;
@@ -560,19 +557,18 @@ static PyObject *Snd_Exp1to3(_self, _args)
goto buffer__error__;
}
buffer__len__ = buffer__in_len__;
- if (state__in_len__ != 128)
+ if (state__in_len__ != sizeof(StateBlock))
{
- PyErr_SetString(PyExc_TypeError, "buffer length should be 128");
+ PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(StateBlock)");
goto state__error__;
}
- state__len__ = state__in_len__;
Exp1to3(buffer__in__, buffer__out__, (long)buffer__len__,
- state__in__, state__out__,
+ state__in__, &state__out__,
numChannels,
whichChannel);
_res = Py_BuildValue("s#s#",
buffer__out__, (int)buffer__len__,
- state__out__, (int)128);
+ (char *)&state__out__, (int)sizeof(StateBlock));
state__error__: ;
free(buffer__out__);
buffer__error__: ;
@@ -588,15 +584,14 @@ static PyObject *Snd_Comp6to1(_self, _args)
char *buffer__out__;
long buffer__len__;
int buffer__in_len__;
- char *state__in__;
- char state__out__[128];
- int state__len__;
+ StateBlock *state__in__;
+ StateBlock state__out__;
int state__in_len__;
unsigned long numChannels;
unsigned long whichChannel;
if (!PyArg_ParseTuple(_args, "s#s#ll",
&buffer__in__, &buffer__in_len__,
- &state__in__, &state__in_len__,
+ (char **)&state__in__, &state__in_len__,
&numChannels,
&whichChannel))
return NULL;
@@ -606,19 +601,18 @@ static PyObject *Snd_Comp6to1(_self, _args)
goto buffer__error__;
}
buffer__len__ = buffer__in_len__;
- if (state__in_len__ != 128)
+ if (state__in_len__ != sizeof(StateBlock))
{
- PyErr_SetString(PyExc_TypeError, "buffer length should be 128");
+ PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(StateBlock)");
goto state__error__;
}
- state__len__ = state__in_len__;
Comp6to1(buffer__in__, buffer__out__, (long)buffer__len__,
- state__in__, state__out__,
+ state__in__, &state__out__,
numChannels,
whichChannel);
_res = Py_BuildValue("s#s#",
buffer__out__, (int)buffer__len__,
- state__out__, (int)128);
+ (char *)&state__out__, (int)sizeof(StateBlock));
state__error__: ;
free(buffer__out__);
buffer__error__: ;
@@ -634,15 +628,14 @@ static PyObject *Snd_Exp1to6(_self, _args)
char *buffer__out__;
long buffer__len__;
int buffer__in_len__;
- char *state__in__;
- char state__out__[128];
- int state__len__;
+ StateBlock *state__in__;
+ StateBlock state__out__;
int state__in_len__;
unsigned long numChannels;
unsigned long whichChannel;
if (!PyArg_ParseTuple(_args, "s#s#ll",
&buffer__in__, &buffer__in_len__,
- &state__in__, &state__in_len__,
+ (char **)&state__in__, &state__in_len__,
&numChannels,
&whichChannel))
return NULL;
@@ -652,19 +645,18 @@ static PyObject *Snd_Exp1to6(_self, _args)
goto buffer__error__;
}
buffer__len__ = buffer__in_len__;
- if (state__in_len__ != 128)
+ if (state__in_len__ != sizeof(StateBlock))
{
- PyErr_SetString(PyExc_TypeError, "buffer length should be 128");
+ PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(StateBlock)");
goto state__error__;
}
- state__len__ = state__in_len__;
Exp1to6(buffer__in__, buffer__out__, (long)buffer__len__,
- state__in__, state__out__,
+ state__in__, &state__out__,
numChannels,
whichChannel);
_res = Py_BuildValue("s#s#",
buffer__out__, (int)buffer__len__,
- state__out__, (int)128);
+ (char *)&state__out__, (int)sizeof(StateBlock));
state__error__: ;
free(buffer__out__);
buffer__error__: ;
@@ -776,13 +768,13 @@ static PyMethodDef Snd_methods[] = {
{"MACEVersion", (PyCFunction)Snd_MACEVersion, 1,
"() -> (NumVersion _rv)"},
{"Comp3to1", (PyCFunction)Snd_Comp3to1, 1,
- "(Buffer buffer, Buffer state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, Buffer state)"},
+ "(Buffer buffer, StateBlock state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, StateBlock state)"},
{"Exp1to3", (PyCFunction)Snd_Exp1to3, 1,
- "(Buffer buffer, Buffer state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, Buffer state)"},
+ "(Buffer buffer, StateBlock state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, StateBlock state)"},
{"Comp6to1", (PyCFunction)Snd_Comp6to1, 1,
- "(Buffer buffer, Buffer state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, Buffer state)"},
+ "(Buffer buffer, StateBlock state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, StateBlock state)"},
{"Exp1to6", (PyCFunction)Snd_Exp1to6, 1,
- "(Buffer buffer, Buffer state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, Buffer state)"},
+ "(Buffer buffer, StateBlock state, unsigned long numChannels, unsigned long whichChannel) -> (Buffer buffer, StateBlock state)"},
{"GetSysBeepVolume", (PyCFunction)Snd_GetSysBeepVolume, 1,
"() -> (long level)"},
{"SetSysBeepVolume", (PyCFunction)Snd_SetSysBeepVolume, 1,
diff --git a/Mac/Modules/snd/sndgen.py b/Mac/Modules/snd/sndgen.py
index a980338..827b263 100644
--- a/Mac/Modules/snd/sndgen.py
+++ b/Mac/Modules/snd/sndgen.py
@@ -1,4 +1,4 @@
-# Generated from 'Moes:CW5 GOLD \304:Metrowerks C/C++ \304:Headers \304:Universal Headers 2.0a3 \304:Sound.h'
+# Generated from 'Moes:CodeWarrior6:Metrowerks C/C++:Headers:Universal Headers 2.0.1f:Sound.h'
f = SndFunction(void, 'SetSoundVol',
(short, 'level', InMode),
@@ -100,7 +100,7 @@ functions.append(f)
f = SndFunction(void, 'Comp3to1',
(InOutBuffer, 'buffer', InOutMode),
- (InOutBuf128, 'state', InOutMode),
+ (StateBlock, 'state', InOutMode),
(unsigned_long, 'numChannels', InMode),
(unsigned_long, 'whichChannel', InMode),
)
@@ -108,7 +108,7 @@ functions.append(f)
f = SndFunction(void, 'Exp1to3',
(InOutBuffer, 'buffer', InOutMode),
- (InOutBuf128, 'state', InOutMode),
+ (StateBlock, 'state', InOutMode),
(unsigned_long, 'numChannels', InMode),
(unsigned_long, 'whichChannel', InMode),
)
@@ -116,7 +116,7 @@ functions.append(f)
f = SndFunction(void, 'Comp6to1',
(InOutBuffer, 'buffer', InOutMode),
- (InOutBuf128, 'state', InOutMode),
+ (StateBlock, 'state', InOutMode),
(unsigned_long, 'numChannels', InMode),
(unsigned_long, 'whichChannel', InMode),
)
@@ -124,7 +124,7 @@ functions.append(f)
f = SndFunction(void, 'Exp1to6',
(InOutBuffer, 'buffer', InOutMode),
- (InOutBuf128, 'state', InOutMode),
+ (StateBlock, 'state', InOutMode),
(unsigned_long, 'numChannels', InMode),
(unsigned_long, 'whichChannel', InMode),
)
diff --git a/Mac/Modules/snd/sndscan.py b/Mac/Modules/snd/sndscan.py
index 8201b2c..ae52593 100644
--- a/Mac/Modules/snd/sndscan.py
+++ b/Mac/Modules/snd/sndscan.py
@@ -43,6 +43,9 @@ class SoundScanner(Scanner):
'GetSoundPreference',
'SetSoundPreference',
'GetCompressionInfo',
+ # And 3.1 calls, ditto...
+ 'SndGetInfo',
+ 'SndSetInfo',
]
@@ -89,8 +92,11 @@ class SoundScanner(Scanner):
[("InOutBuffer", "buffer", "InOutMode")]),
# Ditto
- ([("void_ptr", "inState", "InMode"), ("void", "outState", "OutMode")],
- [("InOutBuf128", "state", "InOutMode")]),
+## ([("void_ptr", "inState", "InMode"), ("void", "outState", "OutMode")],
+## [("InOutBuf128", "state", "InOutMode")]),
+ ([("StateBlockPtr", "inState", "InMode"), ("StateBlockPtr", "outState", "InMode")],
+ [("StateBlock", "state", "InOutMode")]),
+
]
if __name__ == "__main__":
diff --git a/Mac/Modules/snd/sndsupport.py b/Mac/Modules/snd/sndsupport.py
index af1908a..97a23ad 100644
--- a/Mac/Modules/snd/sndsupport.py
+++ b/Mac/Modules/snd/sndsupport.py
@@ -81,7 +81,8 @@ SndCompletionUPP = SndCompletionProcPtr
NumVersion = OpaqueByValueType('NumVersion', 'NumVer')
-InOutBuf128 = FixedInputOutputBufferType(128)
+##InOutBuf128 = FixedInputOutputBufferType(128)
+StateBlock = StructInputOutputBufferType('StateBlock')
AudioSelectionPtr = FakeType('0') # XXX