1 /***********************************************************
2 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
7 Permission to use, copy, modify, and distribute this software and its
8 documentation for any purpose and without fee is hereby granted,
9 provided that the above copyright notice appear in all copies and that
10 both that copyright notice and this permission notice appear in
11 supporting documentation, and that the names of Stichting Mathematisch
12 Centrum or CWI or Corporation for National Research Initiatives or
13 CNRI not be used in advertising or publicity pertaining to
14 distribution of the software without specific, written prior
17 While CWI is the initial source for this software, a modified version
18 is made available by the Corporation for National Research Initiatives
19 (CNRI) at the Internet address ftp://ftp.python.org.
21 STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
22 REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
23 MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
24 CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
25 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
26 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
27 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28 PERFORMANCE OF THIS SOFTWARE.
30 ******************************************************************/
32 #define OLD_INTERFACE /* define for pre-Irix 6 interface */
35 #include "stringobject.h"
42 #endif /* OLD_INTERFACE */
43 #endif /* AL_NO_ELEM */
45 static PyObject
*ErrorObject
;
47 /* ----------------------------------------------------- */
49 /* Declarations for objects of type port */
53 /* XXXX Add your own stuff here */
57 staticforward PyTypeObject Alptype
;
61 /* ---------------------------------------------------------------- */
63 /* Declarations for objects of type config */
67 /* XXXX Add your own stuff here */
71 staticforward PyTypeObject Alctype
;
75 ErrorHandler(long code
, const char *fmt
, ...)
81 vsprintf(buf
, fmt
, args
);
83 PyErr_SetString(ErrorObject
, buf
);
86 #ifdef AL_NO_ELEM /* IRIX 6 */
89 param2python(int resource
, int param
, ALvalue value
, ALparamInfo
*pinfo
)
96 if (alGetParamInfo(resource
, param
, &info
) < 0)
99 switch (pinfo
->elementType
) {
101 /* XXXX don't know how to handle this */
106 case AL_RESOURCE_ELEM
:
108 return PyInt_FromLong((long) value
.i
);
110 return PyLong_FromLongLong(value
.ll
);
112 return PyFloat_FromDouble(alFixedToDouble(value
.ll
));
114 if (value
.ptr
== NULL
) {
118 return PyString_FromString((char *) value
.ptr
);
120 PyErr_SetString(ErrorObject
, "unknown element type");
126 python2elem(PyObject
*item
, void *ptr
, int elementType
)
128 switch (elementType
) {
130 case AL_RESOURCE_ELEM
:
132 if (!PyInt_Check(item
)) {
136 *((int *) ptr
) = PyInt_AsLong(item
);
139 if (PyInt_Check(item
))
140 *((long long *) ptr
) = PyInt_AsLong(item
);
141 else if (PyLong_Check(item
))
142 *((long long *) ptr
) = PyLong_AsLongLong(item
);
149 if (PyInt_Check(item
))
150 *((long long *) ptr
) = alDoubleToFixed((double) PyInt_AsLong(item
));
151 else if (PyFloat_Check(item
))
152 *((long long *) ptr
) = alDoubleToFixed(PyFloat_AsDouble(item
));
159 PyErr_SetString(ErrorObject
, "unknown element type");
166 python2param(int resource
, ALpv
*param
, PyObject
*value
, ALparamInfo
*pinfo
)
174 if (alGetParamInfo(resource
, param
->param
, &info
) < 0)
177 switch (pinfo
->valueType
) {
179 if (pinfo
->elementType
!= AL_CHAR_ELEM
) {
180 PyErr_SetString(ErrorObject
, "unknown element type");
183 if (!PyString_Check(value
)) {
187 param
->value
.ptr
= PyString_AS_STRING(value
);
188 param
->sizeIn
= PyString_GET_SIZE(value
)+1; /*account for NUL*/
192 if (!PyList_Check(value
) && !PyTuple_Check(value
)) {
196 switch (pinfo
->elementType
) {
198 case AL_RESOURCE_ELEM
:
200 param
->sizeIn
= PySequence_Length(value
);
201 param
->value
.ptr
= PyMem_NEW(int, param
->sizeIn
);
202 stepsize
= sizeof(int);
206 param
->sizeIn
= PySequence_Length(value
);
207 param
->value
.ptr
= PyMem_NEW(long long, param
->sizeIn
);
208 stepsize
= sizeof(long long);
211 for (i
= 0; i
< param
->sizeIn
; i
++) {
212 item
= PySequence_GetItem(value
, i
);
213 if (python2elem(item
, (void *) ((char *) param
->value
.ptr
+ i
*stepsize
), pinfo
->elementType
) < 0) {
214 PyMem_DEL(param
->value
.ptr
);
220 switch (pinfo
->elementType
) {
222 case AL_RESOURCE_ELEM
:
224 return python2elem(value
, (void *) ¶m
->value
.i
,
228 return python2elem(value
, (void *) ¶m
->value
.ll
,
231 PyErr_SetString(ErrorObject
, "unknown element type");
239 python2params(int resource1
, int resource2
, PyObject
*list
, ALpv
**pvsp
, ALparamInfo
**pinfop
)
246 npvs
= PyList_Size(list
);
247 pvs
= PyMem_NEW(ALpv
, npvs
);
248 pinfo
= PyMem_NEW(ALparamInfo
, npvs
);
249 for (i
= 0; i
< npvs
; i
++) {
250 item
= PyList_GetItem(list
, i
);
251 if (!PyArg_ParseTuple(item
, "iO", &pvs
[i
].param
, &item
))
253 if (alGetParamInfo(resource1
, pvs
[i
].param
, &pinfo
[i
]) < 0 &&
254 alGetParamInfo(resource2
, pvs
[i
].param
, &pinfo
[i
]) < 0)
256 if (python2param(resource1
, &pvs
[i
], item
, &pinfo
[i
]) < 0)
265 /* XXXX we should clean up everything */
273 /* -------------------------------------------------------- */
277 SetConfig(self
, args
, func
)
280 int (*func
)(ALconfig
, int);
284 if (!PyArg_ParseTuple(args
, "i", &par
))
287 if ((*func
)(self
->config
, par
) == -1)
295 GetConfig(self
, args
, func
)
298 int (*func
)(ALconfig
);
302 if (!PyArg_ParseTuple(args
, ""))
305 if ((par
= (*func
)(self
->config
)) == -1)
308 return PyInt_FromLong((long) par
);
311 static char alc_SetWidth__doc__
[] =
312 "alSetWidth: set the wordsize for integer audio data."
316 alc_SetWidth(self
, args
)
320 return SetConfig(self
, args
, alSetWidth
);
324 static char alc_GetWidth__doc__
[] =
325 "alGetWidth: get the wordsize for integer audio data."
329 alc_GetWidth(self
, args
)
333 return GetConfig(self
, args
, alGetWidth
);
337 static char alc_SetSampFmt__doc__
[] =
338 "alSetSampFmt: set the sample format setting in an audio ALconfig structure."
342 alc_SetSampFmt(self
, args
)
346 return SetConfig(self
, args
, alSetSampFmt
);
350 static char alc_GetSampFmt__doc__
[] =
351 "alGetSampFmt: get the sample format setting in an audio ALconfig structure."
355 alc_GetSampFmt(self
, args
)
359 return GetConfig(self
, args
, alGetSampFmt
);
363 static char alc_SetChannels__doc__
[] =
364 "alSetChannels: set the channel settings in an audio ALconfig."
368 alc_SetChannels(self
, args
)
372 return SetConfig(self
, args
, alSetChannels
);
376 static char alc_GetChannels__doc__
[] =
377 "alGetChannels: get the channel settings in an audio ALconfig."
381 alc_GetChannels(self
, args
)
385 return GetConfig(self
, args
, alGetChannels
);
389 static char alc_SetFloatMax__doc__
[] =
390 "alSetFloatMax: set the maximum value of floating point sample data."
394 alc_SetFloatMax(self
, args
)
398 double maximum_value
;
400 if (!PyArg_ParseTuple(args
, "d", &maximum_value
))
402 if (alSetFloatMax(self
->config
, maximum_value
) < 0)
409 static char alc_GetFloatMax__doc__
[] =
410 "alGetFloatMax: get the maximum value of floating point sample data."
414 alc_GetFloatMax(self
, args
)
418 double maximum_value
;
420 if (!PyArg_ParseTuple(args
, ""))
422 if ((maximum_value
= alGetFloatMax(self
->config
)) == 0)
424 return PyFloat_FromDouble(maximum_value
);
428 static char alc_SetDevice__doc__
[] =
429 "alSetDevice: set the device setting in an audio ALconfig structure."
433 alc_SetDevice(self
, args
)
437 return SetConfig(self
, args
, alSetDevice
);
441 static char alc_GetDevice__doc__
[] =
442 "alGetDevice: get the device setting in an audio ALconfig structure."
446 alc_GetDevice(self
, args
)
450 return GetConfig(self
, args
, alGetDevice
);
454 static char alc_SetQueueSize__doc__
[] =
455 "alSetQueueSize: set audio port buffer size."
459 alc_SetQueueSize(self
, args
)
463 return SetConfig(self
, args
, alSetQueueSize
);
467 static char alc_GetQueueSize__doc__
[] =
468 "alGetQueueSize: get audio port buffer size."
472 alc_GetQueueSize(self
, args
)
476 return GetConfig(self
, args
, alGetQueueSize
);
479 #endif /* AL_NO_ELEM */
482 setconfig(self
, args
, func
)
485 int (*func
)(ALconfig
, long);
489 if (!PyArg_ParseTuple(args
, "l", &par
))
492 if ((*func
)(self
->config
, par
) == -1)
500 getconfig(self
, args
, func
)
503 long (*func
)(ALconfig
);
507 if (!PyArg_ParseTuple(args
, ""))
510 if ((par
= (*func
)(self
->config
)) == -1)
513 return PyInt_FromLong((long) par
);
517 alc_setqueuesize (self
, args
)
521 return setconfig(self
, args
, ALsetqueuesize
);
525 alc_getqueuesize (self
, args
)
529 return getconfig(self
, args
, ALgetqueuesize
);
533 alc_setwidth (self
, args
)
537 return setconfig(self
, args
, ALsetwidth
);
541 alc_getwidth (self
, args
)
545 return getconfig(self
, args
, ALgetwidth
);
549 alc_getchannels (self
, args
)
553 return getconfig(self
, args
, ALgetchannels
);
557 alc_setchannels (self
, args
)
561 return setconfig(self
, args
, ALsetchannels
);
567 alc_getsampfmt (self
, args
)
571 return getconfig(self
, args
, ALgetsampfmt
);
575 alc_setsampfmt (self
, args
)
579 return setconfig(self
, args
, ALsetsampfmt
);
583 alc_getfloatmax(self
, args
)
589 if (!PyArg_ParseTuple(args
, ""))
591 if ((arg
= ALgetfloatmax(self
->config
)) == 0)
593 return PyFloat_FromDouble(arg
);
597 alc_setfloatmax(self
, args
)
603 if (!PyArg_ParseTuple(args
, "d", &arg
))
605 if (ALsetfloatmax(self
->config
, arg
) == -1)
612 static struct PyMethodDef alc_methods
[] = {
613 #ifdef AL_NO_ELEM /* IRIX 6 */
614 {"SetWidth", (PyCFunction
)alc_SetWidth
, METH_VARARGS
, alc_SetWidth__doc__
},
615 {"GetWidth", (PyCFunction
)alc_GetWidth
, METH_VARARGS
, alc_GetWidth__doc__
},
616 {"SetSampFmt", (PyCFunction
)alc_SetSampFmt
, METH_VARARGS
, alc_SetSampFmt__doc__
},
617 {"GetSampFmt", (PyCFunction
)alc_GetSampFmt
, METH_VARARGS
, alc_GetSampFmt__doc__
},
618 {"SetChannels", (PyCFunction
)alc_SetChannels
, METH_VARARGS
, alc_SetChannels__doc__
},
619 {"GetChannels", (PyCFunction
)alc_GetChannels
, METH_VARARGS
, alc_GetChannels__doc__
},
620 {"SetFloatMax", (PyCFunction
)alc_SetFloatMax
, METH_VARARGS
, alc_SetFloatMax__doc__
},
621 {"GetFloatMax", (PyCFunction
)alc_GetFloatMax
, METH_VARARGS
, alc_GetFloatMax__doc__
},
622 {"SetDevice", (PyCFunction
)alc_SetDevice
, METH_VARARGS
, alc_SetDevice__doc__
},
623 {"GetDevice", (PyCFunction
)alc_GetDevice
, METH_VARARGS
, alc_GetDevice__doc__
},
624 {"SetQueueSize", (PyCFunction
)alc_SetQueueSize
, METH_VARARGS
, alc_SetQueueSize__doc__
},
625 {"GetQueueSize", (PyCFunction
)alc_GetQueueSize
, METH_VARARGS
, alc_GetQueueSize__doc__
},
626 #endif /* AL_NO_ELEM */
627 {"getqueuesize", (PyCFunction
)alc_getqueuesize
, METH_VARARGS
},
628 {"setqueuesize", (PyCFunction
)alc_setqueuesize
, METH_VARARGS
},
629 {"getwidth", (PyCFunction
)alc_getwidth
, METH_VARARGS
},
630 {"setwidth", (PyCFunction
)alc_setwidth
, METH_VARARGS
},
631 {"getchannels", (PyCFunction
)alc_getchannels
, METH_VARARGS
},
632 {"setchannels", (PyCFunction
)alc_setchannels
, METH_VARARGS
},
634 {"getsampfmt", (PyCFunction
)alc_getsampfmt
, METH_VARARGS
},
635 {"setsampfmt", (PyCFunction
)alc_setsampfmt
, METH_VARARGS
},
636 {"getfloatmax", (PyCFunction
)alc_getfloatmax
, METH_VARARGS
},
637 {"setfloatmax", (PyCFunction
)alc_setfloatmax
, METH_VARARGS
},
640 {NULL
, NULL
} /* sentinel */
647 newalcobject(ALconfig config
)
651 self
= PyObject_NEW(alcobject
, &Alctype
);
654 /* XXXX Add your own initializers here */
655 self
->config
= config
;
656 return (PyObject
*) self
;
664 /* XXXX Add your own cleanup code here */
665 #ifdef AL_NO_ELEM /* IRIX 6 */
666 (void) alFreeConfig(self
->config
); /* ignore errors */
668 (void) ALfreeconfig(self
->config
); /* ignore errors */
674 alc_getattr(self
, name
)
678 /* XXXX Add your own getattr code here */
679 return Py_FindMethod(alc_methods
, (PyObject
*)self
, name
);
682 static char Alctype__doc__
[] =
686 static PyTypeObject Alctype
= {
687 PyObject_HEAD_INIT(&PyType_Type
)
689 "config", /*tp_name*/
690 sizeof(alcobject
), /*tp_basicsize*/
693 (destructor
)alc_dealloc
, /*tp_dealloc*/
694 (printfunc
)0, /*tp_print*/
695 (getattrfunc
)alc_getattr
, /*tp_getattr*/
696 (setattrfunc
)0, /*tp_setattr*/
697 (cmpfunc
)0, /*tp_compare*/
698 (reprfunc
)0, /*tp_repr*/
700 0, /*tp_as_sequence*/
702 (hashfunc
)0, /*tp_hash*/
703 (ternaryfunc
)0, /*tp_call*/
704 (reprfunc
)0, /*tp_str*/
706 /* Space for future expansion */
708 Alctype__doc__
/* Documentation string */
711 /* End of code for config objects */
712 /* ---------------------------------------------------------------- */
714 #ifdef AL_NO_ELEM /* IRIX 6 */
716 static char alp_SetConfig__doc__
[] =
717 "alSetConfig: set the ALconfig of an audio ALport."
721 alp_SetConfig(self
, args
)
726 if (!PyArg_ParseTuple(args
, "O!", &Alctype
, &config
))
728 if (alSetConfig(self
->port
, config
->config
) < 0)
735 static char alp_GetConfig__doc__
[] =
736 "alGetConfig: get the ALconfig of an audio ALport."
740 alp_GetConfig(self
, args
)
745 if (!PyArg_ParseTuple(args
, ""))
747 if ((config
= alGetConfig(self
->port
)) == NULL
)
749 return newalcobject(config
);
753 static char alp_GetResource__doc__
[] =
754 "alGetResource: get the resource associated with an audio port."
758 alp_GetResource(self
, args
)
764 if (!PyArg_ParseTuple(args
, ""))
766 if ((resource
= alGetResource(self
->port
)) == 0)
768 return PyInt_FromLong((long) resource
);
772 static char alp_GetFD__doc__
[] =
773 "alGetFD: get the file descriptor for an audio port."
777 alp_GetFD(self
, args
)
783 if (!PyArg_ParseTuple(args
, ""))
786 if ((fd
= alGetFD(self
->port
)) < 0)
789 return PyInt_FromLong((long) fd
);
793 static char alp_GetFilled__doc__
[] =
794 "alGetFilled: return the number of filled sample frames in an audio port."
798 alp_GetFilled(self
, args
)
804 if (!PyArg_ParseTuple(args
, ""))
806 if ((filled
= alGetFilled(self
->port
)) < 0)
808 return PyInt_FromLong((long) filled
);
812 static char alp_GetFillable__doc__
[] =
813 "alGetFillable: report the number of unfilled sample frames in an audio port."
817 alp_GetFillable(self
, args
)
823 if (!PyArg_ParseTuple(args
, ""))
825 if ((fillable
= alGetFillable(self
->port
)) < 0)
827 return PyInt_FromLong((long) fillable
);
831 static char alp_ReadFrames__doc__
[] =
832 "alReadFrames: read sample frames from an audio port."
836 alp_ReadFrames(self
, args
)
847 if (!PyArg_ParseTuple(args
, "i", &framecount
))
849 if (framecount
< 0) {
850 PyErr_SetString(ErrorObject
, "negative framecount");
853 c
= alGetConfig(self
->port
);
854 switch (alGetSampFmt(c
)) {
855 case AL_SAMPFMT_TWOSCOMP
:
856 switch (alGetWidth(c
)) {
867 PyErr_SetString(ErrorObject
, "can't determine width");
872 case AL_SAMPFMT_FLOAT
:
875 case AL_SAMPFMT_DOUBLE
:
879 PyErr_SetString(ErrorObject
, "can't determine format");
883 ch
= alGetChannels(c
);
886 PyErr_SetString(ErrorObject
, "can't determine # of channels");
890 v
= PyString_FromStringAndSize((char *) NULL
, size
* framecount
);
894 Py_BEGIN_ALLOW_THREADS
895 alReadFrames(self
->port
, (void *) PyString_AS_STRING(v
), framecount
);
902 static char alp_DiscardFrames__doc__
[] =
903 "alDiscardFrames: discard audio from an audio port."
907 alp_DiscardFrames(self
, args
)
913 if (!PyArg_ParseTuple(args
, "i", &framecount
))
916 Py_BEGIN_ALLOW_THREADS
917 framecount
= alDiscardFrames(self
->port
, framecount
);
923 return PyInt_FromLong((long) framecount
);
927 static char alp_ZeroFrames__doc__
[] =
928 "alZeroFrames: write zero-valued sample frames to an audio port."
932 alp_ZeroFrames(self
, args
)
938 if (!PyArg_ParseTuple(args
, "i", &framecount
))
941 if (framecount
< 0) {
942 PyErr_SetString(ErrorObject
, "negative framecount");
946 Py_BEGIN_ALLOW_THREADS
947 alZeroFrames(self
->port
, framecount
);
955 static char alp_SetFillPoint__doc__
[] =
956 "alSetFillPoint: set low- or high-water mark for an audio port."
960 alp_SetFillPoint(self
, args
)
966 if (!PyArg_ParseTuple(args
, "i", &fillpoint
))
969 if (alSetFillPoint(self
->port
, fillpoint
) < 0)
977 static char alp_GetFillPoint__doc__
[] =
978 "alGetFillPoint: get low- or high-water mark for an audio port."
982 alp_GetFillPoint(self
, args
)
988 if (!PyArg_ParseTuple(args
, ""))
991 if ((fillpoint
= alGetFillPoint(self
->port
)) < 0)
994 return PyInt_FromLong((long) fillpoint
);
998 static char alp_GetFrameNumber__doc__
[] =
999 "alGetFrameNumber: get the absolute sample frame number associated with a port."
1003 alp_GetFrameNumber(self
, args
)
1009 if (!PyArg_ParseTuple(args
, ""))
1012 if (alGetFrameNumber(self
->port
, &fnum
) < 0)
1015 return PyLong_FromLongLong((long long) fnum
);
1019 static char alp_GetFrameTime__doc__
[] =
1020 "alGetFrameTime: get the time at which a sample frame came in or will go out."
1024 alp_GetFrameTime(self
, args
)
1029 PyObject
*ret
, *v0
, *v1
;
1031 if (!PyArg_ParseTuple(args
, ""))
1033 if (alGetFrameTime(self
->port
, &fnum
, &time
) < 0)
1035 v0
= PyLong_FromLongLong((long long) fnum
);
1036 v1
= PyLong_FromLongLong((long long) time
);
1037 if (PyErr_Occurred()) {
1042 ret
= Py_BuildValue("(OO)", v0
, v1
);
1049 static char alp_WriteFrames__doc__
[] =
1050 "alWriteFrames: write sample frames to an audio port."
1054 alp_WriteFrames(self
, args
)
1063 if (!PyArg_ParseTuple(args
, "s#", &samples
, &length
))
1065 c
= alGetConfig(self
->port
);
1066 switch (alGetSampFmt(c
)) {
1067 case AL_SAMPFMT_TWOSCOMP
:
1068 switch (alGetWidth(c
)) {
1079 PyErr_SetString(ErrorObject
, "can't determine width");
1084 case AL_SAMPFMT_FLOAT
:
1087 case AL_SAMPFMT_DOUBLE
:
1091 PyErr_SetString(ErrorObject
, "can't determine format");
1095 ch
= alGetChannels(c
);
1098 PyErr_SetString(ErrorObject
, "can't determine # of channels");
1102 if (length
% size
!= 0) {
1103 PyErr_SetString(ErrorObject
,
1104 "buffer length not whole number of frames");
1108 Py_BEGIN_ALLOW_THREADS
1109 alWriteFrames(self
->port
, (void *) samples
, length
/ size
);
1110 Py_END_ALLOW_THREADS
1117 static char alp_ClosePort__doc__
[] =
1118 "alClosePort: close an audio port."
1122 alp_ClosePort(self
, args
)
1126 if (!PyArg_ParseTuple(args
, ""))
1128 if (alClosePort(self
->port
) < 0)
1135 #endif /* AL_NO_ELEM */
1137 #ifdef OLD_INTERFACE
1139 alp_closeport(self
, args
)
1143 if (!PyArg_ParseTuple(args
, ""))
1145 if (ALcloseport(self
->port
) < 0)
1153 alp_getfd (self
, args
)
1159 if (!PyArg_ParseTuple(args
, ""))
1161 if ((fd
= ALgetfd(self
-> port
)) == -1)
1163 return PyInt_FromLong(fd
);
1167 alp_getfilled(self
, args
)
1173 if (!PyArg_ParseTuple(args
, ""))
1175 if ((count
= ALgetfilled(self
-> port
)) == -1)
1177 return PyInt_FromLong(count
);
1181 alp_getfillable(self
, args
)
1187 if (!PyArg_ParseTuple(args
, ""))
1189 if ((count
= ALgetfillable(self
-> port
)) == -1)
1191 return PyInt_FromLong (count
);
1195 alp_readsamps(self
, args
)
1205 if (!PyArg_ParseTuple(args
, "l", &count
))
1209 PyErr_SetString(ErrorObject
, "al.readsamps : arg <= 0");
1213 c
= ALgetconfig(self
->port
);
1215 width
= ALgetsampfmt(c
);
1216 if (width
== AL_SAMPFMT_FLOAT
)
1217 width
= sizeof(float);
1218 else if (width
== AL_SAMPFMT_DOUBLE
)
1219 width
= sizeof(double);
1221 width
= ALgetwidth(c
);
1223 width
= ALgetwidth(c
);
1226 v
= PyString_FromStringAndSize((char *)NULL
, width
* count
);
1230 Py_BEGIN_ALLOW_THREADS
1231 ret
= ALreadsamps(self
->port
, (void *) PyString_AsString(v
), count
);
1232 Py_END_ALLOW_THREADS
1242 alp_writesamps(self
, args
)
1251 if (!PyArg_ParseTuple(args
, "s#", &buf
, &size
))
1254 c
= ALgetconfig(self
->port
);
1256 width
= ALgetsampfmt(c
);
1257 if (width
== AL_SAMPFMT_FLOAT
)
1258 width
= sizeof(float);
1259 else if (width
== AL_SAMPFMT_DOUBLE
)
1260 width
= sizeof(double);
1262 width
= ALgetwidth(c
);
1264 width
= ALgetwidth(c
);
1267 Py_BEGIN_ALLOW_THREADS
1268 ret
= ALwritesamps (self
->port
, (void *) buf
, (long) size
/ width
);
1269 Py_END_ALLOW_THREADS
1278 alp_getfillpoint(self
, args
)
1284 if (!PyArg_ParseTuple(args
, ""))
1286 if ((count
= ALgetfillpoint(self
->port
)) == -1)
1288 return PyInt_FromLong(count
);
1292 alp_setfillpoint (self
, args
)
1298 if (!PyArg_ParseTuple(args
, "l", &count
))
1300 if (ALsetfillpoint(self
->port
, count
) == -1)
1307 alp_setconfig(self
, args
)
1313 if (!PyArg_ParseTuple(args
, "O!", &Alctype
, &config
))
1315 if (ALsetconfig(self
->port
, config
->config
) == -1)
1322 alp_getconfig(self
, args
)
1328 if (!PyArg_ParseTuple(args
, ""))
1330 config
= ALgetconfig(self
->port
);
1333 return newalcobject(config
);
1338 alp_getstatus(self
, args
)
1347 if (!PyArg_Parse(args
, "O!", &PyList_Type
, &list
))
1349 length
= PyList_Size(list
);
1350 PVbuffer
= PyMem_NEW(long, length
);
1351 if (PVbuffer
== NULL
)
1352 return PyErr_NoMemory();
1353 for (i
= 0; i
< length
; i
++) {
1354 v
= PyList_GetItem(list
, i
);
1355 if (!PyInt_Check(v
)) {
1356 PyMem_DEL(PVbuffer
);
1357 PyErr_BadArgument();
1360 PVbuffer
[i
] = PyInt_AsLong(v
);
1363 if (ALgetstatus(self
->port
, PVbuffer
, length
) == -1)
1366 for (i
= 0; i
< length
; i
++)
1367 PyList_SetItem(list
, i
, PyInt_FromLong(PVbuffer
[i
]));
1369 PyMem_DEL(PVbuffer
);
1376 #endif /* OLD_INTERFACE */
1378 static struct PyMethodDef alp_methods
[] = {
1379 #ifdef AL_NO_ELEM /* IRIX 6 */
1380 {"SetConfig", (PyCFunction
)alp_SetConfig
, METH_VARARGS
, alp_SetConfig__doc__
},
1381 {"GetConfig", (PyCFunction
)alp_GetConfig
, METH_VARARGS
, alp_GetConfig__doc__
},
1382 {"GetResource", (PyCFunction
)alp_GetResource
, METH_VARARGS
, alp_GetResource__doc__
},
1383 {"GetFD", (PyCFunction
)alp_GetFD
, METH_VARARGS
, alp_GetFD__doc__
},
1384 {"GetFilled", (PyCFunction
)alp_GetFilled
, METH_VARARGS
, alp_GetFilled__doc__
},
1385 {"GetFillable", (PyCFunction
)alp_GetFillable
, METH_VARARGS
, alp_GetFillable__doc__
},
1386 {"ReadFrames", (PyCFunction
)alp_ReadFrames
, METH_VARARGS
, alp_ReadFrames__doc__
},
1387 {"DiscardFrames", (PyCFunction
)alp_DiscardFrames
, METH_VARARGS
, alp_DiscardFrames__doc__
},
1388 {"ZeroFrames", (PyCFunction
)alp_ZeroFrames
, METH_VARARGS
, alp_ZeroFrames__doc__
},
1389 {"SetFillPoint", (PyCFunction
)alp_SetFillPoint
, METH_VARARGS
, alp_SetFillPoint__doc__
},
1390 {"GetFillPoint", (PyCFunction
)alp_GetFillPoint
, METH_VARARGS
, alp_GetFillPoint__doc__
},
1391 {"GetFrameNumber", (PyCFunction
)alp_GetFrameNumber
, METH_VARARGS
, alp_GetFrameNumber__doc__
},
1392 {"GetFrameTime", (PyCFunction
)alp_GetFrameTime
, METH_VARARGS
, alp_GetFrameTime__doc__
},
1393 {"WriteFrames", (PyCFunction
)alp_WriteFrames
, METH_VARARGS
, alp_WriteFrames__doc__
},
1394 {"ClosePort", (PyCFunction
)alp_ClosePort
, METH_VARARGS
, alp_ClosePort__doc__
},
1395 #endif /* AL_NO_ELEM */
1396 #ifdef OLD_INTERFACE
1397 {"closeport", (PyCFunction
)alp_closeport
, METH_VARARGS
},
1398 {"getfd", (PyCFunction
)alp_getfd
, METH_VARARGS
},
1399 {"fileno", (PyCFunction
)alp_getfd
, METH_VARARGS
},
1400 {"getfilled", (PyCFunction
)alp_getfilled
, METH_VARARGS
},
1401 {"getfillable", (PyCFunction
)alp_getfillable
, METH_VARARGS
},
1402 {"readsamps", (PyCFunction
)alp_readsamps
, METH_VARARGS
},
1403 {"writesamps", (PyCFunction
)alp_writesamps
, METH_VARARGS
},
1404 {"setfillpoint", (PyCFunction
)alp_setfillpoint
, METH_VARARGS
},
1405 {"getfillpoint", (PyCFunction
)alp_getfillpoint
, METH_VARARGS
},
1406 {"setconfig", (PyCFunction
)alp_setconfig
, METH_VARARGS
},
1407 {"getconfig", (PyCFunction
)alp_getconfig
, METH_VARARGS
},
1409 {"getstatus", (PyCFunction
)alp_getstatus
, METH_VARARGS
},
1411 #endif /* OLD_INTERFACE */
1413 {NULL
, NULL
} /* sentinel */
1420 newalpobject(ALport port
)
1424 self
= PyObject_NEW(alpobject
, &Alptype
);
1427 /* XXXX Add your own initializers here */
1429 return (PyObject
*) self
;
1437 /* XXXX Add your own cleanup code here */
1439 #ifdef AL_NO_ELEM /* IRIX 6 */
1440 alClosePort(self
->port
);
1442 ALcloseport(self
->port
);
1449 alp_getattr(self
, name
)
1453 /* XXXX Add your own getattr code here */
1454 if (self
->port
== NULL
) {
1455 PyErr_SetString(ErrorObject
, "port already closed");
1458 return Py_FindMethod(alp_methods
, (PyObject
*)self
, name
);
1461 static char Alptype__doc__
[] =
1465 static PyTypeObject Alptype
= {
1466 PyObject_HEAD_INIT(&PyType_Type
)
1469 sizeof(alpobject
), /*tp_basicsize*/
1472 (destructor
)alp_dealloc
, /*tp_dealloc*/
1473 (printfunc
)0, /*tp_print*/
1474 (getattrfunc
)alp_getattr
, /*tp_getattr*/
1475 (setattrfunc
)0, /*tp_setattr*/
1476 (cmpfunc
)0, /*tp_compare*/
1477 (reprfunc
)0, /*tp_repr*/
1479 0, /*tp_as_sequence*/
1480 0, /*tp_as_mapping*/
1481 (hashfunc
)0, /*tp_hash*/
1482 (ternaryfunc
)0, /*tp_call*/
1483 (reprfunc
)0, /*tp_str*/
1485 /* Space for future expansion */
1487 Alptype__doc__
/* Documentation string */
1490 /* End of code for port objects */
1491 /* -------------------------------------------------------- */
1494 #ifdef AL_NO_ELEM /* IRIX 6 */
1496 static char al_NewConfig__doc__
[] =
1497 "alNewConfig: create and initialize an audio ALconfig structure."
1501 al_NewConfig(self
, args
)
1502 PyObject
*self
; /* Not used */
1507 if (!PyArg_ParseTuple(args
, ""))
1509 if ((config
= alNewConfig()) == NULL
)
1511 return newalcobject(config
);
1514 static char al_OpenPort__doc__
[] =
1515 "alOpenPort: open an audio port."
1519 al_OpenPort(self
, args
)
1520 PyObject
*self
; /* Not used */
1525 alcobject
*config
= NULL
;
1527 if (!PyArg_ParseTuple(args
, "ss|O!", &name
, &dir
, &Alctype
, &config
))
1529 if ((port
= alOpenPort(name
, dir
, config
? config
->config
: NULL
)) == NULL
)
1531 return newalpobject(port
);
1534 static char al_Connect__doc__
[] =
1535 "alConnect: connect two audio I/O resources."
1539 al_Connect(self
, args
)
1540 PyObject
*self
; /* Not used */
1543 int source
, dest
, nprops
= 0, id
, i
;
1545 ALparamInfo
*propinfo
= NULL
;
1546 PyObject
*propobj
= NULL
;
1548 if (!PyArg_ParseTuple(args
, "ii|O!", &source
, &dest
, &PyList_Type
, &propobj
))
1550 if (propobj
!= NULL
) {
1551 nprops
= python2params(source
, dest
, propobj
, &props
, &propinfo
);
1556 id
= alConnect(source
, dest
, props
, nprops
);
1559 for (i
= 0; i
< nprops
; i
++) {
1560 switch (propinfo
[i
].valueType
) {
1563 PyMem_DEL(props
[i
].value
.ptr
);
1568 PyMem_DEL(propinfo
);
1573 return PyInt_FromLong((long) id
);
1576 static char al_Disconnect__doc__
[] =
1577 "alDisconnect: delete a connection between two audio I/O resources."
1581 al_Disconnect(self
, args
)
1582 PyObject
*self
; /* Not used */
1587 if (!PyArg_ParseTuple(args
, "i", &res
))
1589 if (alDisconnect(res
) < 0)
1595 static char al_GetParams__doc__
[] =
1596 "alGetParams: get the values of audio resource parameters."
1600 al_GetParams(self
, args
)
1601 PyObject
*self
; /* Not used */
1605 PyObject
*pvslist
, *item
= NULL
, *v
= NULL
;
1610 if (!PyArg_ParseTuple(args
, "iO!", &resource
, &PyList_Type
, &pvslist
))
1612 npvs
= PyList_Size(pvslist
);
1613 pvs
= PyMem_NEW(ALpv
, npvs
);
1614 pinfo
= PyMem_NEW(ALparamInfo
, npvs
);
1615 for (i
= 0; i
< npvs
; i
++) {
1616 item
= PyList_GetItem(pvslist
, i
);
1617 if (!PyInt_Check(item
)) {
1619 PyErr_SetString(ErrorObject
, "list of integers expected");
1622 pvs
[i
].param
= (int) PyInt_AsLong(item
);
1623 item
= NULL
; /* not needed anymore */
1624 if (alGetParamInfo(resource
, pvs
[i
].param
, &pinfo
[i
]) < 0)
1626 switch (pinfo
[i
].valueType
) {
1630 pinfo
[i
].maxElems
*= pinfo
[i
].maxElems2
;
1635 switch (pinfo
[i
].elementType
) {
1637 case AL_RESOURCE_ELEM
:
1639 pvs
[i
].value
.ptr
= PyMem_NEW(int, pinfo
[i
].maxElems
);
1640 pvs
[i
].sizeIn
= pinfo
[i
].maxElems
;
1644 pvs
[i
].value
.ptr
= PyMem_NEW(long long, pinfo
[i
].maxElems
);
1645 pvs
[i
].sizeIn
= pinfo
[i
].maxElems
;
1648 pvs
[i
].value
.ptr
= PyMem_NEW(char, 32);
1654 PyErr_SetString(ErrorObject
, "internal error");
1661 PyErr_SetString(ErrorObject
, "internal error");
1664 if (pinfo
[i
].valueType
== AL_MATRIX_VAL
) {
1665 pinfo
[i
].maxElems
/= pinfo
[i
].maxElems2
;
1666 pvs
[i
].sizeIn
/= pinfo
[i
].maxElems2
;
1667 pvs
[i
].size2In
= pinfo
[i
].maxElems2
;
1670 if (alGetParams(resource
, pvs
, npvs
) < 0)
1672 v
= PyList_New(npvs
);
1673 for (i
= 0; i
< npvs
; i
++) {
1674 if (pvs
[i
].sizeOut
< 0) {
1676 sprintf(buf
, "problem with param %d", i
);
1677 PyErr_SetString(ErrorObject
, buf
);
1680 switch (pinfo
[i
].valueType
) {
1686 item
= PyString_FromString(pvs
[i
].value
.ptr
);
1687 PyMem_DEL(pvs
[i
].value
.ptr
);
1690 /* XXXX this is not right */
1691 pvs
[i
].sizeOut
*= pvs
[i
].size2Out
;
1695 item
= PyList_New(pvs
[i
].sizeOut
);
1696 for (j
= 0; j
< pvs
[i
].sizeOut
; j
++) {
1697 switch (pinfo
[i
].elementType
) {
1699 case AL_RESOURCE_ELEM
:
1701 PyList_SetItem(item
, j
, PyInt_FromLong((long) ((int *) pvs
[i
].value
.ptr
)[j
]));
1704 PyList_SetItem(item
, j
, PyLong_FromLongLong(((long long *) pvs
[i
].value
.ptr
)[j
]));
1707 PyList_SetItem(item
, j
, PyFloat_FromDouble(alFixedToDouble(((long long *) pvs
[i
].value
.ptr
)[j
])));
1710 PyErr_SetString(ErrorObject
, "internal error");
1714 PyMem_DEL(pvs
[i
].value
.ptr
);
1717 item
= param2python(resource
, pvs
[i
].param
, pvs
[i
].value
, &pinfo
[i
]);
1720 if (PyErr_Occurred() ||
1721 PyList_SetItem(v
, i
, Py_BuildValue("(iO)", pvs
[i
].param
,
1741 static char al_SetParams__doc__
[] =
1742 "alSetParams: set the values of audio resource parameters."
1746 al_SetParams(self
, args
)
1747 PyObject
*self
; /* Not used */
1751 PyObject
*pvslist
, *item
;
1756 if (!PyArg_ParseTuple(args
, "iO!", &resource
, &PyList_Type
, &pvslist
))
1758 npvs
= python2params(resource
, -1, pvslist
, &pvs
, &pinfo
);
1762 if (alSetParams(resource
, pvs
, npvs
) < 0)
1766 for (i
= 0; i
< npvs
; i
++) {
1767 switch (pinfo
[i
].valueType
) {
1770 PyMem_DEL(pvs
[i
].value
.ptr
);
1781 /* XXXX we should clean up everything */
1789 static char al_QueryValues__doc__
[] =
1790 "alQueryValues: get the set of possible values for a parameter."
1794 al_QueryValues(self
, args
)
1795 PyObject
*self
; /* Not used */
1798 int resource
, param
;
1799 ALvalue
*return_set
= NULL
;
1800 int setsize
= 32, qualsize
= 0, nvals
, i
;
1803 ALparamInfo
*qualinfo
= NULL
;
1804 PyObject
*qualobj
= NULL
;
1805 PyObject
*res
= NULL
, *item
;
1807 if (!PyArg_ParseTuple(args
, "ii|O!", &resource
, ¶m
,
1808 &PyList_Type
, &qualobj
))
1810 if (qualobj
!= NULL
) {
1811 qualsize
= python2params(resource
, param
, qualobj
, &quals
, &qualinfo
);
1816 return_set
= PyMem_NEW(ALvalue
, setsize
);
1817 if (return_set
== NULL
) {
1823 nvals
= alQueryValues(resource
, param
, return_set
, setsize
, quals
, qualsize
);
1826 if (nvals
> setsize
) {
1828 PyMem_RESIZE(return_set
, ALvalue
, setsize
);
1829 if (return_set
== NULL
) {
1836 if (alGetParamInfo(resource
, param
, &pinfo
) < 0)
1839 res
= PyList_New(nvals
);
1842 for (i
= 0; i
< nvals
; i
++) {
1843 item
= param2python(resource
, param
, return_set
[i
], &pinfo
);
1845 PyList_SetItem(res
, i
, item
) < 0) {
1854 PyMem_DEL(return_set
);
1856 for (i
= 0; i
< qualsize
; i
++) {
1857 switch (qualinfo
[i
].valueType
) {
1860 PyMem_DEL(quals
[i
].value
.ptr
);
1865 PyMem_DEL(qualinfo
);
1871 static char al_GetParamInfo__doc__
[] =
1872 "alGetParamInfo: get information about a parameter on a particular audio resource."
1876 al_GetParamInfo(self
, args
)
1877 PyObject
*self
; /* Not used */
1882 PyObject
*v
, *item
;;
1884 if (!PyArg_ParseTuple(args
, "ii", &res
, ¶m
))
1886 if (alGetParamInfo(res
, param
, &pinfo
) < 0)
1890 item
= PyInt_FromLong((long) pinfo
.resource
);
1891 PyDict_SetItemString(v
, "resource", item
);
1894 item
= PyInt_FromLong((long) pinfo
.param
);
1895 PyDict_SetItemString(v
, "param", item
);
1898 item
= PyInt_FromLong((long) pinfo
.valueType
);
1899 PyDict_SetItemString(v
, "valueType", item
);
1902 if (pinfo
.valueType
!= AL_NO_VAL
&& pinfo
.valueType
!= AL_SCALAR_VAL
) {
1903 /* multiple values */
1904 item
= PyInt_FromLong((long) pinfo
.maxElems
);
1905 PyDict_SetItemString(v
, "maxElems", item
);
1908 if (pinfo
.valueType
== AL_MATRIX_VAL
) {
1910 item
= PyInt_FromLong((long) pinfo
.maxElems2
);
1911 PyDict_SetItemString(v
, "maxElems2", item
);
1916 item
= PyInt_FromLong((long) pinfo
.elementType
);
1917 PyDict_SetItemString(v
, "elementType", item
);
1920 item
= PyString_FromString(pinfo
.name
);
1921 PyDict_SetItemString(v
, "name", item
);
1924 item
= param2python(res
, param
, pinfo
.initial
, &pinfo
);
1925 PyDict_SetItemString(v
, "initial", item
);
1928 if (pinfo
.elementType
!= AL_ENUM_ELEM
&&
1929 pinfo
.elementType
!= AL_RESOURCE_ELEM
&&
1930 pinfo
.elementType
!= AL_CHAR_ELEM
) {
1932 item
= param2python(res
, param
, pinfo
.min
, &pinfo
);
1933 PyDict_SetItemString(v
, "min", item
);
1936 item
= param2python(res
, param
, pinfo
.max
, &pinfo
);
1937 PyDict_SetItemString(v
, "max", item
);
1940 item
= param2python(res
, param
, pinfo
.minDelta
, &pinfo
);
1941 PyDict_SetItemString(v
, "minDelta", item
);
1944 item
= param2python(res
, param
, pinfo
.maxDelta
, &pinfo
);
1945 PyDict_SetItemString(v
, "maxDelta", item
);
1948 item
= PyInt_FromLong((long) pinfo
.specialVals
);
1949 PyDict_SetItemString(v
, "specialVals", item
);
1956 static char al_GetResourceByName__doc__
[] =
1957 "alGetResourceByName: find an audio resource by name."
1961 al_GetResourceByName(self
, args
)
1962 PyObject
*self
; /* Not used */
1965 int res
, start_res
, type
;
1968 if (!PyArg_ParseTuple(args
, "isi", &start_res
, &name
, &type
))
1970 if ((res
= alGetResourceByName(start_res
, name
, type
)) == 0)
1972 return PyInt_FromLong((long) res
);
1975 static char al_IsSubtype__doc__
[] =
1976 "alIsSubtype: indicate if one resource type is a subtype of another."
1980 al_IsSubtype(self
, args
)
1981 PyObject
*self
; /* Not used */
1986 if (!PyArg_ParseTuple(args
, "ii", &type
, &subtype
))
1988 return PyInt_FromLong((long) alIsSubtype(type
, subtype
));
1991 static char al_SetErrorHandler__doc__
[] =
1996 al_SetErrorHandler(self
, args
)
1997 PyObject
*self
; /* Not used */
2001 if (!PyArg_ParseTuple(args
, ""))
2007 #endif /* AL_NO_ELEM */
2009 #ifdef OLD_INTERFACE
2012 al_openport(self
, args
)
2013 PyObject
*self
, *args
;
2017 alcobject
*config
= NULL
;
2019 if (!PyArg_ParseTuple(args
, "ss|O!", &name
, &dir
, &Alctype
, &config
))
2021 if ((port
= ALopenport(name
, dir
, config
? config
->config
: NULL
)) == NULL
)
2023 return newalpobject(port
);
2027 al_newconfig(self
, args
)
2028 PyObject
*self
, *args
;
2032 if (!PyArg_ParseTuple(args
, ""))
2034 if ((config
= ALnewconfig ()) == NULL
)
2036 return newalcobject(config
);
2040 al_queryparams(self
, args
)
2041 PyObject
*self
, *args
;
2050 if (!PyArg_ParseTuple(args
, "l", &device
))
2052 if ((length
= ALqueryparams(device
, PVdummy
, 2L)) == -1)
2054 if ((PVbuffer
= PyMem_NEW(long, length
)) == NULL
)
2055 return PyErr_NoMemory();
2056 if (ALqueryparams(device
, PVbuffer
, length
) >= 0 &&
2057 (v
= PyList_New((int)length
)) != NULL
) {
2058 for (i
= 0; i
< length
; i
++)
2059 PyList_SetItem(v
, i
, PyInt_FromLong(PVbuffer
[i
]));
2061 PyMem_DEL(PVbuffer
);
2066 doParams(args
, func
, modified
)
2068 int (*func
)(long, long *, long);
2077 if (!PyArg_ParseTuple(args
, "lO!", &device
, &PyList_Type
, &list
))
2079 length
= PyList_Size(list
);
2080 PVbuffer
= PyMem_NEW(long, length
);
2081 if (PVbuffer
== NULL
)
2082 return PyErr_NoMemory();
2083 for (i
= 0; i
< length
; i
++) {
2084 v
= PyList_GetItem(list
, i
);
2085 if (!PyInt_Check(v
)) {
2086 PyMem_DEL(PVbuffer
);
2087 PyErr_BadArgument();
2090 PVbuffer
[i
] = PyInt_AsLong(v
);
2093 if ((*func
)(device
, PVbuffer
, length
) == -1) {
2094 PyMem_DEL(PVbuffer
);
2099 for (i
= 0; i
< length
; i
++)
2100 PyList_SetItem(list
, i
, PyInt_FromLong(PVbuffer
[i
]));
2103 PyMem_DEL(PVbuffer
);
2110 al_getparams(self
, args
)
2111 PyObject
*self
, *args
;
2113 return doParams(args
, ALgetparams
, 1);
2117 al_setparams(self
, args
)
2118 PyObject
*self
, *args
;
2120 return doParams(args
, ALsetparams
, 0);
2124 al_getname(self
, args
)
2125 PyObject
*self
, *args
;
2127 long device
, descriptor
;
2130 if (!PyArg_ParseTuple(args
, "ll", &device
, &descriptor
))
2132 if ((name
= ALgetname(device
, descriptor
)) == NULL
)
2134 return PyString_FromString(name
);
2138 al_getdefault(self
, args
)
2139 PyObject
*self
, *args
;
2141 long device
, descriptor
, value
;
2143 if (!PyArg_ParseTuple(args
, "ll", &device
, &descriptor
))
2145 if ((value
= ALgetdefault(device
, descriptor
)) == -1)
2147 return PyLong_FromLong(value
);
2151 al_getminmax(self
, args
)
2152 PyObject
*self
, *args
;
2154 long device
, descriptor
, min
, max
;
2156 if (!PyArg_ParseTuple(args
, "ll", &device
, &descriptor
))
2160 if (ALgetminmax(device
, descriptor
, &min
, &max
) == -1)
2162 return Py_BuildValue("ll", min
, max
);
2165 #endif /* OLD_INTERFACE */
2167 /* List of methods defined in the module */
2169 static struct PyMethodDef al_methods
[] = {
2170 #ifdef AL_NO_ELEM /* IRIX 6 */
2171 {"NewConfig", (PyCFunction
)al_NewConfig
, METH_VARARGS
, al_NewConfig__doc__
},
2172 {"OpenPort", (PyCFunction
)al_OpenPort
, METH_VARARGS
, al_OpenPort__doc__
},
2173 {"Connect", (PyCFunction
)al_Connect
, METH_VARARGS
, al_Connect__doc__
},
2174 {"Disconnect", (PyCFunction
)al_Disconnect
, METH_VARARGS
, al_Disconnect__doc__
},
2175 {"GetParams", (PyCFunction
)al_GetParams
, METH_VARARGS
, al_GetParams__doc__
},
2176 {"SetParams", (PyCFunction
)al_SetParams
, METH_VARARGS
, al_SetParams__doc__
},
2177 {"QueryValues", (PyCFunction
)al_QueryValues
, METH_VARARGS
, al_QueryValues__doc__
},
2178 {"GetParamInfo", (PyCFunction
)al_GetParamInfo
, METH_VARARGS
, al_GetParamInfo__doc__
},
2179 {"GetResourceByName", (PyCFunction
)al_GetResourceByName
, METH_VARARGS
, al_GetResourceByName__doc__
},
2180 {"IsSubtype", (PyCFunction
)al_IsSubtype
, METH_VARARGS
, al_IsSubtype__doc__
},
2182 /* this one not supported */
2183 {"SetErrorHandler", (PyCFunction
)al_SetErrorHandler
, METH_VARARGS
, al_SetErrorHandler__doc__
},
2185 #endif /* AL_NO_ELEM */
2186 #ifdef OLD_INTERFACE
2187 {"openport", (PyCFunction
)al_openport
, METH_VARARGS
},
2188 {"newconfig", (PyCFunction
)al_newconfig
, METH_VARARGS
},
2189 {"queryparams", (PyCFunction
)al_queryparams
, METH_VARARGS
},
2190 {"getparams", (PyCFunction
)al_getparams
, METH_VARARGS
},
2191 {"setparams", (PyCFunction
)al_setparams
, METH_VARARGS
},
2192 {"getname", (PyCFunction
)al_getname
, METH_VARARGS
},
2193 {"getdefault", (PyCFunction
)al_getdefault
, METH_VARARGS
},
2194 {"getminmax", (PyCFunction
)al_getminmax
, METH_VARARGS
},
2195 #endif /* OLD_INTERFACE */
2197 {NULL
, (PyCFunction
)NULL
, 0, NULL
} /* sentinel */
2201 /* Initialization function for the module (*must* be called inital) */
2203 static char al_module_documentation
[] =
2210 PyObject
*m
, *d
, *x
;
2212 /* Create the module and add the functions */
2213 m
= Py_InitModule4("al", al_methods
,
2214 al_module_documentation
,
2215 (PyObject
*)NULL
,PYTHON_API_VERSION
);
2217 /* Add some symbolic constants to the module */
2218 d
= PyModule_GetDict(m
);
2219 ErrorObject
= PyString_FromString("al.error");
2220 PyDict_SetItemString(d
, "error", ErrorObject
);
2222 /* XXXX Add constants here */
2224 x
= PyInt_FromLong((long) AL_4CHANNEL
);
2225 if (x
== NULL
|| PyDict_SetItemString(d
, "FOURCHANNEL", x
) < 0)
2229 #ifdef AL_ADAT_IF_TYPE
2230 x
= PyInt_FromLong((long) AL_ADAT_IF_TYPE
);
2231 if (x
== NULL
|| PyDict_SetItemString(d
, "ADAT_IF_TYPE", x
) < 0)
2235 #ifdef AL_ADAT_MCLK_TYPE
2236 x
= PyInt_FromLong((long) AL_ADAT_MCLK_TYPE
);
2237 if (x
== NULL
|| PyDict_SetItemString(d
, "ADAT_MCLK_TYPE", x
) < 0)
2241 #ifdef AL_AES_IF_TYPE
2242 x
= PyInt_FromLong((long) AL_AES_IF_TYPE
);
2243 if (x
== NULL
|| PyDict_SetItemString(d
, "AES_IF_TYPE", x
) < 0)
2247 #ifdef AL_AES_MCLK_TYPE
2248 x
= PyInt_FromLong((long) AL_AES_MCLK_TYPE
);
2249 if (x
== NULL
|| PyDict_SetItemString(d
, "AES_MCLK_TYPE", x
) < 0)
2253 #ifdef AL_ANALOG_IF_TYPE
2254 x
= PyInt_FromLong((long) AL_ANALOG_IF_TYPE
);
2255 if (x
== NULL
|| PyDict_SetItemString(d
, "ANALOG_IF_TYPE", x
) < 0)
2260 x
= PyInt_FromLong((long) AL_ASSOCIATE
);
2261 if (x
== NULL
|| PyDict_SetItemString(d
, "ASSOCIATE", x
) < 0)
2265 #ifdef AL_BAD_BUFFER_NULL
2266 x
= PyInt_FromLong((long) AL_BAD_BUFFER_NULL
);
2267 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFER_NULL", x
) < 0)
2271 #ifdef AL_BAD_BUFFERLENGTH
2272 x
= PyInt_FromLong((long) AL_BAD_BUFFERLENGTH
);
2273 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH", x
) < 0)
2277 #ifdef AL_BAD_BUFFERLENGTH_NEG
2278 x
= PyInt_FromLong((long) AL_BAD_BUFFERLENGTH_NEG
);
2279 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH_NEG", x
) < 0)
2283 #ifdef AL_BAD_BUFFERLENGTH_ODD
2284 x
= PyInt_FromLong((long) AL_BAD_BUFFERLENGTH_ODD
);
2285 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH_ODD", x
) < 0)
2289 #ifdef AL_BAD_CHANNELS
2290 x
= PyInt_FromLong((long) AL_BAD_CHANNELS
);
2291 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_CHANNELS", x
) < 0)
2295 #ifdef AL_BAD_CONFIG
2296 x
= PyInt_FromLong((long) AL_BAD_CONFIG
);
2297 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_CONFIG", x
) < 0)
2301 #ifdef AL_BAD_COUNT_NEG
2302 x
= PyInt_FromLong((long) AL_BAD_COUNT_NEG
);
2303 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_COUNT_NEG", x
) < 0)
2307 #ifdef AL_BAD_DEVICE
2308 x
= PyInt_FromLong((long) AL_BAD_DEVICE
);
2309 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_DEVICE", x
) < 0)
2313 #ifdef AL_BAD_DEVICE_ACCESS
2314 x
= PyInt_FromLong((long) AL_BAD_DEVICE_ACCESS
);
2315 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_DEVICE_ACCESS", x
) < 0)
2319 #ifdef AL_BAD_DIRECTION
2320 x
= PyInt_FromLong((long) AL_BAD_DIRECTION
);
2321 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_DIRECTION", x
) < 0)
2325 #ifdef AL_BAD_FILLPOINT
2326 x
= PyInt_FromLong((long) AL_BAD_FILLPOINT
);
2327 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_FILLPOINT", x
) < 0)
2331 #ifdef AL_BAD_FLOATMAX
2332 x
= PyInt_FromLong((long) AL_BAD_FLOATMAX
);
2333 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_FLOATMAX", x
) < 0)
2337 #ifdef AL_BAD_ILLEGAL_STATE
2338 x
= PyInt_FromLong((long) AL_BAD_ILLEGAL_STATE
);
2339 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_ILLEGAL_STATE", x
) < 0)
2343 #ifdef AL_BAD_NO_PORTS
2344 x
= PyInt_FromLong((long) AL_BAD_NO_PORTS
);
2345 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NO_PORTS", x
) < 0)
2349 #ifdef AL_BAD_NOT_FOUND
2350 x
= PyInt_FromLong((long) AL_BAD_NOT_FOUND
);
2351 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NOT_FOUND", x
) < 0)
2355 #ifdef AL_BAD_NOT_IMPLEMENTED
2356 x
= PyInt_FromLong((long) AL_BAD_NOT_IMPLEMENTED
);
2357 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NOT_IMPLEMENTED", x
) < 0)
2361 #ifdef AL_BAD_OUT_OF_MEM
2362 x
= PyInt_FromLong((long) AL_BAD_OUT_OF_MEM
);
2363 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_OUT_OF_MEM", x
) < 0)
2368 x
= PyInt_FromLong((long) AL_BAD_PARAM
);
2369 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PARAM", x
) < 0)
2373 #ifdef AL_BAD_PERMISSIONS
2374 x
= PyInt_FromLong((long) AL_BAD_PERMISSIONS
);
2375 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PERMISSIONS", x
) < 0)
2380 x
= PyInt_FromLong((long) AL_BAD_PORT
);
2381 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PORT", x
) < 0)
2385 #ifdef AL_BAD_PORTSTYLE
2386 x
= PyInt_FromLong((long) AL_BAD_PORTSTYLE
);
2387 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PORTSTYLE", x
) < 0)
2391 #ifdef AL_BAD_PVBUFFER
2392 x
= PyInt_FromLong((long) AL_BAD_PVBUFFER
);
2393 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PVBUFFER", x
) < 0)
2398 x
= PyInt_FromLong((long) AL_BAD_QSIZE
);
2399 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_QSIZE", x
) < 0)
2404 x
= PyInt_FromLong((long) AL_BAD_RATE
);
2405 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_RATE", x
) < 0)
2409 #ifdef AL_BAD_RESOURCE
2410 x
= PyInt_FromLong((long) AL_BAD_RESOURCE
);
2411 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_RESOURCE", x
) < 0)
2415 #ifdef AL_BAD_SAMPFMT
2416 x
= PyInt_FromLong((long) AL_BAD_SAMPFMT
);
2417 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_SAMPFMT", x
) < 0)
2421 #ifdef AL_BAD_TRANSFER_SIZE
2422 x
= PyInt_FromLong((long) AL_BAD_TRANSFER_SIZE
);
2423 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_TRANSFER_SIZE", x
) < 0)
2428 x
= PyInt_FromLong((long) AL_BAD_WIDTH
);
2429 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_WIDTH", x
) < 0)
2433 #ifdef AL_CHANNEL_MODE
2434 x
= PyInt_FromLong((long) AL_CHANNEL_MODE
);
2435 if (x
== NULL
|| PyDict_SetItemString(d
, "CHANNEL_MODE", x
) < 0)
2440 x
= PyInt_FromLong((long) AL_CHANNELS
);
2441 if (x
== NULL
|| PyDict_SetItemString(d
, "CHANNELS", x
) < 0)
2446 x
= PyInt_FromLong((long) AL_CHAR_ELEM
);
2447 if (x
== NULL
|| PyDict_SetItemString(d
, "CHAR_ELEM", x
) < 0)
2452 x
= PyInt_FromLong((long) AL_CLOCK_GEN
);
2453 if (x
== NULL
|| PyDict_SetItemString(d
, "CLOCK_GEN", x
) < 0)
2457 #ifdef AL_CLOCKGEN_TYPE
2458 x
= PyInt_FromLong((long) AL_CLOCKGEN_TYPE
);
2459 if (x
== NULL
|| PyDict_SetItemString(d
, "CLOCKGEN_TYPE", x
) < 0)
2464 x
= PyInt_FromLong((long) AL_CONNECT
);
2465 if (x
== NULL
|| PyDict_SetItemString(d
, "CONNECT", x
) < 0)
2469 #ifdef AL_CONNECTION_TYPE
2470 x
= PyInt_FromLong((long) AL_CONNECTION_TYPE
);
2471 if (x
== NULL
|| PyDict_SetItemString(d
, "CONNECTION_TYPE", x
) < 0)
2475 #ifdef AL_CONNECTIONS
2476 x
= PyInt_FromLong((long) AL_CONNECTIONS
);
2477 if (x
== NULL
|| PyDict_SetItemString(d
, "CONNECTIONS", x
) < 0)
2481 #ifdef AL_CRYSTAL_MCLK_TYPE
2482 x
= PyInt_FromLong((long) AL_CRYSTAL_MCLK_TYPE
);
2483 if (x
== NULL
|| PyDict_SetItemString(d
, "CRYSTAL_MCLK_TYPE", x
) < 0)
2487 #ifdef AL_DEFAULT_DEVICE
2488 x
= PyInt_FromLong((long) AL_DEFAULT_DEVICE
);
2489 if (x
== NULL
|| PyDict_SetItemString(d
, "DEFAULT_DEVICE", x
) < 0)
2493 #ifdef AL_DEFAULT_INPUT
2494 x
= PyInt_FromLong((long) AL_DEFAULT_INPUT
);
2495 if (x
== NULL
|| PyDict_SetItemString(d
, "DEFAULT_INPUT", x
) < 0)
2499 #ifdef AL_DEFAULT_OUTPUT
2500 x
= PyInt_FromLong((long) AL_DEFAULT_OUTPUT
);
2501 if (x
== NULL
|| PyDict_SetItemString(d
, "DEFAULT_OUTPUT", x
) < 0)
2506 x
= PyInt_FromLong((long) AL_DEST
);
2507 if (x
== NULL
|| PyDict_SetItemString(d
, "DEST", x
) < 0)
2511 #ifdef AL_DEVICE_TYPE
2512 x
= PyInt_FromLong((long) AL_DEVICE_TYPE
);
2513 if (x
== NULL
|| PyDict_SetItemString(d
, "DEVICE_TYPE", x
) < 0)
2518 x
= PyInt_FromLong((long) AL_DEVICES
);
2519 if (x
== NULL
|| PyDict_SetItemString(d
, "DEVICES", x
) < 0)
2523 #ifdef AL_DIGITAL_IF_TYPE
2524 x
= PyInt_FromLong((long) AL_DIGITAL_IF_TYPE
);
2525 if (x
== NULL
|| PyDict_SetItemString(d
, "DIGITAL_IF_TYPE", x
) < 0)
2529 #ifdef AL_DIGITAL_INPUT_RATE
2530 x
= PyInt_FromLong((long) AL_DIGITAL_INPUT_RATE
);
2531 if (x
== NULL
|| PyDict_SetItemString(d
, "DIGITAL_INPUT_RATE", x
) < 0)
2535 #ifdef AL_DISCONNECT
2536 x
= PyInt_FromLong((long) AL_DISCONNECT
);
2537 if (x
== NULL
|| PyDict_SetItemString(d
, "DISCONNECT", x
) < 0)
2542 x
= PyInt_FromLong((long) AL_ENUM_ELEM
);
2543 if (x
== NULL
|| PyDict_SetItemString(d
, "ENUM_ELEM", x
) < 0)
2547 #ifdef AL_ENUM_VALUE
2548 x
= PyInt_FromLong((long) AL_ENUM_VALUE
);
2549 if (x
== NULL
|| PyDict_SetItemString(d
, "ENUM_VALUE", x
) < 0)
2553 #ifdef AL_ERROR_INPUT_OVERFLOW
2554 x
= PyInt_FromLong((long) AL_ERROR_INPUT_OVERFLOW
);
2555 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_INPUT_OVERFLOW", x
) < 0)
2559 #ifdef AL_ERROR_LENGTH
2560 x
= PyInt_FromLong((long) AL_ERROR_LENGTH
);
2561 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_LENGTH", x
) < 0)
2565 #ifdef AL_ERROR_LOCATION_LSP
2566 x
= PyInt_FromLong((long) AL_ERROR_LOCATION_LSP
);
2567 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_LOCATION_LSP", x
) < 0)
2571 #ifdef AL_ERROR_LOCATION_MSP
2572 x
= PyInt_FromLong((long) AL_ERROR_LOCATION_MSP
);
2573 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_LOCATION_MSP", x
) < 0)
2577 #ifdef AL_ERROR_NUMBER
2578 x
= PyInt_FromLong((long) AL_ERROR_NUMBER
);
2579 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_NUMBER", x
) < 0)
2583 #ifdef AL_ERROR_OUTPUT_UNDERFLOW
2584 x
= PyInt_FromLong((long) AL_ERROR_OUTPUT_UNDERFLOW
);
2585 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_OUTPUT_UNDERFLOW", x
) < 0)
2589 #ifdef AL_ERROR_TYPE
2590 x
= PyInt_FromLong((long) AL_ERROR_TYPE
);
2591 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_TYPE", x
) < 0)
2595 #ifdef AL_FIXED_ELEM
2596 x
= PyInt_FromLong((long) AL_FIXED_ELEM
);
2597 if (x
== NULL
|| PyDict_SetItemString(d
, "FIXED_ELEM", x
) < 0)
2601 #ifdef AL_FIXED_MCLK_TYPE
2602 x
= PyInt_FromLong((long) AL_FIXED_MCLK_TYPE
);
2603 if (x
== NULL
|| PyDict_SetItemString(d
, "FIXED_MCLK_TYPE", x
) < 0)
2608 x
= PyInt_FromLong((long) AL_GAIN
);
2609 if (x
== NULL
|| PyDict_SetItemString(d
, "GAIN", x
) < 0)
2614 x
= PyInt_FromLong((long) AL_GAIN_REF
);
2615 if (x
== NULL
|| PyDict_SetItemString(d
, "GAIN_REF", x
) < 0)
2620 x
= PyInt_FromLong((long) AL_HRB_TYPE
);
2621 if (x
== NULL
|| PyDict_SetItemString(d
, "HRB_TYPE", x
) < 0)
2625 #ifdef AL_INPUT_COUNT
2626 x
= PyInt_FromLong((long) AL_INPUT_COUNT
);
2627 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_COUNT", x
) < 0)
2631 #ifdef AL_INPUT_DEVICE_TYPE
2632 x
= PyInt_FromLong((long) AL_INPUT_DEVICE_TYPE
);
2633 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_DEVICE_TYPE", x
) < 0)
2637 #ifdef AL_INPUT_DIGITAL
2638 x
= PyInt_FromLong((long) AL_INPUT_DIGITAL
);
2639 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_DIGITAL", x
) < 0)
2643 #ifdef AL_INPUT_HRB_TYPE
2644 x
= PyInt_FromLong((long) AL_INPUT_HRB_TYPE
);
2645 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_HRB_TYPE", x
) < 0)
2649 #ifdef AL_INPUT_LINE
2650 x
= PyInt_FromLong((long) AL_INPUT_LINE
);
2651 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_LINE", x
) < 0)
2656 x
= PyInt_FromLong((long) AL_INPUT_MIC
);
2657 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_MIC", x
) < 0)
2661 #ifdef AL_INPUT_PORT_TYPE
2662 x
= PyInt_FromLong((long) AL_INPUT_PORT_TYPE
);
2663 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_PORT_TYPE", x
) < 0)
2667 #ifdef AL_INPUT_RATE
2668 x
= PyInt_FromLong((long) AL_INPUT_RATE
);
2669 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_RATE", x
) < 0)
2673 #ifdef AL_INPUT_SOURCE
2674 x
= PyInt_FromLong((long) AL_INPUT_SOURCE
);
2675 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_SOURCE", x
) < 0)
2679 #ifdef AL_INT32_ELEM
2680 x
= PyInt_FromLong((long) AL_INT32_ELEM
);
2681 if (x
== NULL
|| PyDict_SetItemString(d
, "INT32_ELEM", x
) < 0)
2685 #ifdef AL_INT64_ELEM
2686 x
= PyInt_FromLong((long) AL_INT64_ELEM
);
2687 if (x
== NULL
|| PyDict_SetItemString(d
, "INT64_ELEM", x
) < 0)
2692 x
= PyInt_FromLong((long) AL_INTERFACE
);
2693 if (x
== NULL
|| PyDict_SetItemString(d
, "INTERFACE", x
) < 0)
2697 #ifdef AL_INTERFACE_TYPE
2698 x
= PyInt_FromLong((long) AL_INTERFACE_TYPE
);
2699 if (x
== NULL
|| PyDict_SetItemString(d
, "INTERFACE_TYPE", x
) < 0)
2703 #ifdef AL_INVALID_PARAM
2704 x
= PyInt_FromLong((long) AL_INVALID_PARAM
);
2705 if (x
== NULL
|| PyDict_SetItemString(d
, "INVALID_PARAM", x
) < 0)
2709 #ifdef AL_INVALID_VALUE
2710 x
= PyInt_FromLong((long) AL_INVALID_VALUE
);
2711 if (x
== NULL
|| PyDict_SetItemString(d
, "INVALID_VALUE", x
) < 0)
2716 x
= PyInt_FromLong((long) AL_JITTER
);
2717 if (x
== NULL
|| PyDict_SetItemString(d
, "JITTER", x
) < 0)
2722 x
= PyInt_FromLong((long) AL_LABEL
);
2723 if (x
== NULL
|| PyDict_SetItemString(d
, "LABEL", x
) < 0)
2727 #ifdef AL_LEFT_INPUT_ATTEN
2728 x
= PyInt_FromLong((long) AL_LEFT_INPUT_ATTEN
);
2729 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT_INPUT_ATTEN", x
) < 0)
2733 #ifdef AL_LEFT_MONITOR_ATTEN
2734 x
= PyInt_FromLong((long) AL_LEFT_MONITOR_ATTEN
);
2735 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT_MONITOR_ATTEN", x
) < 0)
2739 #ifdef AL_LEFT_SPEAKER_GAIN
2740 x
= PyInt_FromLong((long) AL_LEFT_SPEAKER_GAIN
);
2741 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT_SPEAKER_GAIN", x
) < 0)
2745 #ifdef AL_LEFT1_INPUT_ATTEN
2746 x
= PyInt_FromLong((long) AL_LEFT1_INPUT_ATTEN
);
2747 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT1_INPUT_ATTEN", x
) < 0)
2751 #ifdef AL_LEFT2_INPUT_ATTEN
2752 x
= PyInt_FromLong((long) AL_LEFT2_INPUT_ATTEN
);
2753 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT2_INPUT_ATTEN", x
) < 0)
2757 #ifdef AL_LINE_IF_TYPE
2758 x
= PyInt_FromLong((long) AL_LINE_IF_TYPE
);
2759 if (x
== NULL
|| PyDict_SetItemString(d
, "LINE_IF_TYPE", x
) < 0)
2763 #ifdef AL_MASTER_CLOCK
2764 x
= PyInt_FromLong((long) AL_MASTER_CLOCK
);
2765 if (x
== NULL
|| PyDict_SetItemString(d
, "MASTER_CLOCK", x
) < 0)
2769 #ifdef AL_MATRIX_VAL
2770 x
= PyInt_FromLong((long) AL_MATRIX_VAL
);
2771 if (x
== NULL
|| PyDict_SetItemString(d
, "MATRIX_VAL", x
) < 0)
2776 x
= PyInt_FromLong((long) AL_MAX_ERROR
);
2777 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_ERROR", x
) < 0)
2781 #ifdef AL_MAX_EVENT_PARAM
2782 x
= PyInt_FromLong((long) AL_MAX_EVENT_PARAM
);
2783 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_EVENT_PARAM", x
) < 0)
2787 #ifdef AL_MAX_PBUFSIZE
2788 x
= PyInt_FromLong((long) AL_MAX_PBUFSIZE
);
2789 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_PBUFSIZE", x
) < 0)
2794 x
= PyInt_FromLong((long) AL_MAX_PORTS
);
2795 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_PORTS", x
) < 0)
2799 #ifdef AL_MAX_RESOURCE_ID
2800 x
= PyInt_FromLong((long) AL_MAX_RESOURCE_ID
);
2801 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_RESOURCE_ID", x
) < 0)
2805 #ifdef AL_MAX_SETSIZE
2806 x
= PyInt_FromLong((long) AL_MAX_SETSIZE
);
2807 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_SETSIZE", x
) < 0)
2811 #ifdef AL_MAX_STRLEN
2812 x
= PyInt_FromLong((long) AL_MAX_STRLEN
);
2813 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_STRLEN", x
) < 0)
2818 x
= PyInt_FromLong((long) AL_MCLK_TYPE
);
2819 if (x
== NULL
|| PyDict_SetItemString(d
, "MCLK_TYPE", x
) < 0)
2823 #ifdef AL_MIC_IF_TYPE
2824 x
= PyInt_FromLong((long) AL_MIC_IF_TYPE
);
2825 if (x
== NULL
|| PyDict_SetItemString(d
, "MIC_IF_TYPE", x
) < 0)
2829 #ifdef AL_MONITOR_CTL
2830 x
= PyInt_FromLong((long) AL_MONITOR_CTL
);
2831 if (x
== NULL
|| PyDict_SetItemString(d
, "MONITOR_CTL", x
) < 0)
2835 #ifdef AL_MONITOR_OFF
2836 x
= PyInt_FromLong((long) AL_MONITOR_OFF
);
2837 if (x
== NULL
|| PyDict_SetItemString(d
, "MONITOR_OFF", x
) < 0)
2841 #ifdef AL_MONITOR_ON
2842 x
= PyInt_FromLong((long) AL_MONITOR_ON
);
2843 if (x
== NULL
|| PyDict_SetItemString(d
, "MONITOR_ON", x
) < 0)
2848 x
= PyInt_FromLong((long) AL_MONO
);
2849 if (x
== NULL
|| PyDict_SetItemString(d
, "MONO", x
) < 0)
2854 x
= PyInt_FromLong((long) AL_MUTE
);
2855 if (x
== NULL
|| PyDict_SetItemString(d
, "MUTE", x
) < 0)
2860 x
= PyInt_FromLong((long) AL_NAME
);
2861 if (x
== NULL
|| PyDict_SetItemString(d
, "NAME", x
) < 0)
2865 #ifdef AL_NEG_INFINITY
2866 x
= PyInt_FromLong((long) AL_NEG_INFINITY
);
2867 if (x
== NULL
|| PyDict_SetItemString(d
, "NEG_INFINITY", x
) < 0)
2871 #ifdef AL_NEG_INFINITY_BIT
2872 x
= PyInt_FromLong((long) AL_NEG_INFINITY_BIT
);
2873 if (x
== NULL
|| PyDict_SetItemString(d
, "NEG_INFINITY_BIT", x
) < 0)
2878 x
= PyInt_FromLong((long) AL_NO_CHANGE
);
2879 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_CHANGE", x
) < 0)
2883 #ifdef AL_NO_CHANGE_BIT
2884 x
= PyInt_FromLong((long) AL_NO_CHANGE_BIT
);
2885 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_CHANGE_BIT", x
) < 0)
2890 x
= PyInt_FromLong((long) AL_NO_ELEM
);
2891 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_ELEM", x
) < 0)
2896 x
= PyInt_FromLong((long) AL_NO_ERRORS
);
2897 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_ERRORS", x
) < 0)
2902 x
= PyInt_FromLong((long) AL_NO_OP
);
2903 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_OP", x
) < 0)
2908 x
= PyInt_FromLong((long) AL_NO_VAL
);
2909 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_VAL", x
) < 0)
2913 #ifdef AL_NULL_RESOURCE
2914 x
= PyInt_FromLong((long) AL_NULL_RESOURCE
);
2915 if (x
== NULL
|| PyDict_SetItemString(d
, "NULL_RESOURCE", x
) < 0)
2919 #ifdef AL_OUTPUT_COUNT
2920 x
= PyInt_FromLong((long) AL_OUTPUT_COUNT
);
2921 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_COUNT", x
) < 0)
2925 #ifdef AL_OUTPUT_DEVICE_TYPE
2926 x
= PyInt_FromLong((long) AL_OUTPUT_DEVICE_TYPE
);
2927 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_DEVICE_TYPE", x
) < 0)
2931 #ifdef AL_OUTPUT_HRB_TYPE
2932 x
= PyInt_FromLong((long) AL_OUTPUT_HRB_TYPE
);
2933 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_HRB_TYPE", x
) < 0)
2937 #ifdef AL_OUTPUT_PORT_TYPE
2938 x
= PyInt_FromLong((long) AL_OUTPUT_PORT_TYPE
);
2939 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_PORT_TYPE", x
) < 0)
2943 #ifdef AL_OUTPUT_RATE
2944 x
= PyInt_FromLong((long) AL_OUTPUT_RATE
);
2945 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_RATE", x
) < 0)
2950 x
= PyInt_FromLong((long) AL_PARAM_BIT
);
2951 if (x
== NULL
|| PyDict_SetItemString(d
, "PARAM_BIT", x
) < 0)
2956 x
= PyInt_FromLong((long) AL_PARAMS
);
2957 if (x
== NULL
|| PyDict_SetItemString(d
, "PARAMS", x
) < 0)
2961 #ifdef AL_PORT_COUNT
2962 x
= PyInt_FromLong((long) AL_PORT_COUNT
);
2963 if (x
== NULL
|| PyDict_SetItemString(d
, "PORT_COUNT", x
) < 0)
2968 x
= PyInt_FromLong((long) AL_PORT_TYPE
);
2969 if (x
== NULL
|| PyDict_SetItemString(d
, "PORT_TYPE", x
) < 0)
2974 x
= PyInt_FromLong((long) AL_PORTS
);
2975 if (x
== NULL
|| PyDict_SetItemString(d
, "PORTS", x
) < 0)
2979 #ifdef AL_PORTSTYLE_DIRECT
2980 x
= PyInt_FromLong((long) AL_PORTSTYLE_DIRECT
);
2981 if (x
== NULL
|| PyDict_SetItemString(d
, "PORTSTYLE_DIRECT", x
) < 0)
2985 #ifdef AL_PORTSTYLE_SERIAL
2986 x
= PyInt_FromLong((long) AL_PORTSTYLE_SERIAL
);
2987 if (x
== NULL
|| PyDict_SetItemString(d
, "PORTSTYLE_SERIAL", x
) < 0)
2991 #ifdef AL_PRINT_ERRORS
2992 x
= PyInt_FromLong((long) AL_PRINT_ERRORS
);
2993 if (x
== NULL
|| PyDict_SetItemString(d
, "PRINT_ERRORS", x
) < 0)
2998 x
= PyInt_FromLong((long) AL_PTR_ELEM
);
2999 if (x
== NULL
|| PyDict_SetItemString(d
, "PTR_ELEM", x
) < 0)
3003 #ifdef AL_RANGE_VALUE
3004 x
= PyInt_FromLong((long) AL_RANGE_VALUE
);
3005 if (x
== NULL
|| PyDict_SetItemString(d
, "RANGE_VALUE", x
) < 0)
3010 x
= PyInt_FromLong((long) AL_RATE
);
3011 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE", x
) < 0)
3015 #ifdef AL_RATE_11025
3016 x
= PyInt_FromLong((long) AL_RATE_11025
);
3017 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_11025", x
) < 0)
3021 #ifdef AL_RATE_16000
3022 x
= PyInt_FromLong((long) AL_RATE_16000
);
3023 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_16000", x
) < 0)
3027 #ifdef AL_RATE_22050
3028 x
= PyInt_FromLong((long) AL_RATE_22050
);
3029 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_22050", x
) < 0)
3033 #ifdef AL_RATE_32000
3034 x
= PyInt_FromLong((long) AL_RATE_32000
);
3035 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_32000", x
) < 0)
3039 #ifdef AL_RATE_44100
3040 x
= PyInt_FromLong((long) AL_RATE_44100
);
3041 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_44100", x
) < 0)
3045 #ifdef AL_RATE_48000
3046 x
= PyInt_FromLong((long) AL_RATE_48000
);
3047 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_48000", x
) < 0)
3052 x
= PyInt_FromLong((long) AL_RATE_8000
);
3053 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_8000", x
) < 0)
3057 #ifdef AL_RATE_AES_1
3058 x
= PyInt_FromLong((long) AL_RATE_AES_1
);
3059 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_1", x
) < 0)
3063 #ifdef AL_RATE_AES_1s
3064 x
= PyInt_FromLong((long) AL_RATE_AES_1s
);
3065 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_1s", x
) < 0)
3069 #ifdef AL_RATE_AES_2
3070 x
= PyInt_FromLong((long) AL_RATE_AES_2
);
3071 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_2", x
) < 0)
3075 #ifdef AL_RATE_AES_3
3076 x
= PyInt_FromLong((long) AL_RATE_AES_3
);
3077 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_3", x
) < 0)
3081 #ifdef AL_RATE_AES_4
3082 x
= PyInt_FromLong((long) AL_RATE_AES_4
);
3083 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_4", x
) < 0)
3087 #ifdef AL_RATE_AES_6
3088 x
= PyInt_FromLong((long) AL_RATE_AES_6
);
3089 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_6", x
) < 0)
3093 #ifdef AL_RATE_FRACTION_D
3094 x
= PyInt_FromLong((long) AL_RATE_FRACTION_D
);
3095 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_FRACTION_D", x
) < 0)
3099 #ifdef AL_RATE_FRACTION_N
3100 x
= PyInt_FromLong((long) AL_RATE_FRACTION_N
);
3101 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_FRACTION_N", x
) < 0)
3105 #ifdef AL_RATE_INPUTRATE
3106 x
= PyInt_FromLong((long) AL_RATE_INPUTRATE
);
3107 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_INPUTRATE", x
) < 0)
3111 #ifdef AL_RATE_NO_DIGITAL_INPUT
3112 x
= PyInt_FromLong((long) AL_RATE_NO_DIGITAL_INPUT
);
3113 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_NO_DIGITAL_INPUT", x
) < 0)
3117 #ifdef AL_RATE_UNACQUIRED
3118 x
= PyInt_FromLong((long) AL_RATE_UNACQUIRED
);
3119 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_UNACQUIRED", x
) < 0)
3123 #ifdef AL_RATE_UNDEFINED
3124 x
= PyInt_FromLong((long) AL_RATE_UNDEFINED
);
3125 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_UNDEFINED", x
) < 0)
3130 x
= PyInt_FromLong((long) AL_REF_0DBV
);
3131 if (x
== NULL
|| PyDict_SetItemString(d
, "REF_0DBV", x
) < 0)
3136 x
= PyInt_FromLong((long) AL_REF_NONE
);
3137 if (x
== NULL
|| PyDict_SetItemString(d
, "REF_NONE", x
) < 0)
3141 #ifdef AL_RESERVED1_TYPE
3142 x
= PyInt_FromLong((long) AL_RESERVED1_TYPE
);
3143 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED1_TYPE", x
) < 0)
3147 #ifdef AL_RESERVED2_TYPE
3148 x
= PyInt_FromLong((long) AL_RESERVED2_TYPE
);
3149 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED2_TYPE", x
) < 0)
3153 #ifdef AL_RESERVED3_TYPE
3154 x
= PyInt_FromLong((long) AL_RESERVED3_TYPE
);
3155 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED3_TYPE", x
) < 0)
3159 #ifdef AL_RESERVED4_TYPE
3160 x
= PyInt_FromLong((long) AL_RESERVED4_TYPE
);
3161 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED4_TYPE", x
) < 0)
3166 x
= PyInt_FromLong((long) AL_RESOURCE
);
3167 if (x
== NULL
|| PyDict_SetItemString(d
, "RESOURCE", x
) < 0)
3171 #ifdef AL_RESOURCE_ELEM
3172 x
= PyInt_FromLong((long) AL_RESOURCE_ELEM
);
3173 if (x
== NULL
|| PyDict_SetItemString(d
, "RESOURCE_ELEM", x
) < 0)
3177 #ifdef AL_RESOURCE_TYPE
3178 x
= PyInt_FromLong((long) AL_RESOURCE_TYPE
);
3179 if (x
== NULL
|| PyDict_SetItemString(d
, "RESOURCE_TYPE", x
) < 0)
3183 #ifdef AL_RIGHT_INPUT_ATTEN
3184 x
= PyInt_FromLong((long) AL_RIGHT_INPUT_ATTEN
);
3185 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT_INPUT_ATTEN", x
) < 0)
3189 #ifdef AL_RIGHT_MONITOR_ATTEN
3190 x
= PyInt_FromLong((long) AL_RIGHT_MONITOR_ATTEN
);
3191 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT_MONITOR_ATTEN", x
) < 0)
3195 #ifdef AL_RIGHT_SPEAKER_GAIN
3196 x
= PyInt_FromLong((long) AL_RIGHT_SPEAKER_GAIN
);
3197 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT_SPEAKER_GAIN", x
) < 0)
3201 #ifdef AL_RIGHT1_INPUT_ATTEN
3202 x
= PyInt_FromLong((long) AL_RIGHT1_INPUT_ATTEN
);
3203 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT1_INPUT_ATTEN", x
) < 0)
3207 #ifdef AL_RIGHT2_INPUT_ATTEN
3208 x
= PyInt_FromLong((long) AL_RIGHT2_INPUT_ATTEN
);
3209 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT2_INPUT_ATTEN", x
) < 0)
3213 #ifdef AL_SAMPFMT_DOUBLE
3214 x
= PyInt_FromLong((long) AL_SAMPFMT_DOUBLE
);
3215 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPFMT_DOUBLE", x
) < 0)
3219 #ifdef AL_SAMPFMT_FLOAT
3220 x
= PyInt_FromLong((long) AL_SAMPFMT_FLOAT
);
3221 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPFMT_FLOAT", x
) < 0)
3225 #ifdef AL_SAMPFMT_TWOSCOMP
3226 x
= PyInt_FromLong((long) AL_SAMPFMT_TWOSCOMP
);
3227 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPFMT_TWOSCOMP", x
) < 0)
3232 x
= PyInt_FromLong((long) AL_SAMPLE_16
);
3233 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLE_16", x
) < 0)
3238 x
= PyInt_FromLong((long) AL_SAMPLE_24
);
3239 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLE_24", x
) < 0)
3244 x
= PyInt_FromLong((long) AL_SAMPLE_8
);
3245 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLE_8", x
) < 0)
3249 #ifdef AL_SCALAR_VAL
3250 x
= PyInt_FromLong((long) AL_SCALAR_VAL
);
3251 if (x
== NULL
|| PyDict_SetItemString(d
, "SCALAR_VAL", x
) < 0)
3256 x
= PyInt_FromLong((long) AL_SET_VAL
);
3257 if (x
== NULL
|| PyDict_SetItemString(d
, "SET_VAL", x
) < 0)
3261 #ifdef AL_SHORT_NAME
3262 x
= PyInt_FromLong((long) AL_SHORT_NAME
);
3263 if (x
== NULL
|| PyDict_SetItemString(d
, "SHORT_NAME", x
) < 0)
3268 x
= PyInt_FromLong((long) AL_SOURCE
);
3269 if (x
== NULL
|| PyDict_SetItemString(d
, "SOURCE", x
) < 0)
3273 #ifdef AL_SPEAKER_IF_TYPE
3274 x
= PyInt_FromLong((long) AL_SPEAKER_IF_TYPE
);
3275 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_IF_TYPE", x
) < 0)
3279 #ifdef AL_SPEAKER_MUTE_CTL
3280 x
= PyInt_FromLong((long) AL_SPEAKER_MUTE_CTL
);
3281 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_MUTE_CTL", x
) < 0)
3285 #ifdef AL_SPEAKER_MUTE_OFF
3286 x
= PyInt_FromLong((long) AL_SPEAKER_MUTE_OFF
);
3287 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_MUTE_OFF", x
) < 0)
3291 #ifdef AL_SPEAKER_MUTE_ON
3292 x
= PyInt_FromLong((long) AL_SPEAKER_MUTE_ON
);
3293 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_MUTE_ON", x
) < 0)
3297 #ifdef AL_SPEAKER_PLUS_LINE_IF_TYPE
3298 x
= PyInt_FromLong((long) AL_SPEAKER_PLUS_LINE_IF_TYPE
);
3299 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_PLUS_LINE_IF_TYPE", x
) < 0)
3304 x
= PyInt_FromLong((long) AL_STEREO
);
3305 if (x
== NULL
|| PyDict_SetItemString(d
, "STEREO", x
) < 0)
3309 #ifdef AL_STRING_VAL
3310 x
= PyInt_FromLong((long) AL_STRING_VAL
);
3311 if (x
== NULL
|| PyDict_SetItemString(d
, "STRING_VAL", x
) < 0)
3316 x
= PyInt_FromLong((long) AL_SUBSYSTEM
);
3317 if (x
== NULL
|| PyDict_SetItemString(d
, "SUBSYSTEM", x
) < 0)
3321 #ifdef AL_SUBSYSTEM_TYPE
3322 x
= PyInt_FromLong((long) AL_SUBSYSTEM_TYPE
);
3323 if (x
== NULL
|| PyDict_SetItemString(d
, "SUBSYSTEM_TYPE", x
) < 0)
3327 #ifdef AL_SYNC_INPUT_TO_AES
3328 x
= PyInt_FromLong((long) AL_SYNC_INPUT_TO_AES
);
3329 if (x
== NULL
|| PyDict_SetItemString(d
, "SYNC_INPUT_TO_AES", x
) < 0)
3333 #ifdef AL_SYNC_OUTPUT_TO_AES
3334 x
= PyInt_FromLong((long) AL_SYNC_OUTPUT_TO_AES
);
3335 if (x
== NULL
|| PyDict_SetItemString(d
, "SYNC_OUTPUT_TO_AES", x
) < 0)
3340 x
= PyInt_FromLong((long) AL_SYSTEM
);
3341 if (x
== NULL
|| PyDict_SetItemString(d
, "SYSTEM", x
) < 0)
3345 #ifdef AL_SYSTEM_TYPE
3346 x
= PyInt_FromLong((long) AL_SYSTEM_TYPE
);
3347 if (x
== NULL
|| PyDict_SetItemString(d
, "SYSTEM_TYPE", x
) < 0)
3351 #ifdef AL_TEST_IF_TYPE
3352 x
= PyInt_FromLong((long) AL_TEST_IF_TYPE
);
3353 if (x
== NULL
|| PyDict_SetItemString(d
, "TEST_IF_TYPE", x
) < 0)
3358 x
= PyInt_FromLong((long) AL_TYPE
);
3359 if (x
== NULL
|| PyDict_SetItemString(d
, "TYPE", x
) < 0)
3364 x
= PyInt_FromLong((long) AL_TYPE_BIT
);
3365 if (x
== NULL
|| PyDict_SetItemString(d
, "TYPE_BIT", x
) < 0)
3369 #ifdef AL_UNUSED_COUNT
3370 x
= PyInt_FromLong((long) AL_UNUSED_COUNT
);
3371 if (x
== NULL
|| PyDict_SetItemString(d
, "UNUSED_COUNT", x
) < 0)
3375 #ifdef AL_UNUSED_PORTS
3376 x
= PyInt_FromLong((long) AL_UNUSED_PORTS
);
3377 if (x
== NULL
|| PyDict_SetItemString(d
, "UNUSED_PORTS", x
) < 0)
3381 #ifdef AL_VARIABLE_MCLK_TYPE
3382 x
= PyInt_FromLong((long) AL_VARIABLE_MCLK_TYPE
);
3383 if (x
== NULL
|| PyDict_SetItemString(d
, "VARIABLE_MCLK_TYPE", x
) < 0)
3387 #ifdef AL_VECTOR_VAL
3388 x
= PyInt_FromLong((long) AL_VECTOR_VAL
);
3389 if (x
== NULL
|| PyDict_SetItemString(d
, "VECTOR_VAL", x
) < 0)
3393 #ifdef AL_VIDEO_MCLK_TYPE
3394 x
= PyInt_FromLong((long) AL_VIDEO_MCLK_TYPE
);
3395 if (x
== NULL
|| PyDict_SetItemString(d
, "VIDEO_MCLK_TYPE", x
) < 0)
3400 x
= PyInt_FromLong((long) AL_WORDSIZE
);
3401 if (x
== NULL
|| PyDict_SetItemString(d
, "WORDSIZE", x
) < 0)
3406 #ifdef AL_NO_ELEM /* IRIX 6 */
3407 (void) alSetErrorHandler(ErrorHandler
);
3408 #endif /* AL_NO_ELEM */
3409 #ifdef OLD_INTERFACE
3410 (void) ALseterrorhandler(ErrorHandler
);
3411 #endif /* OLD_INTERFACE */
3413 /* Check for errors */
3414 if (PyErr_Occurred()) {
3416 Py_FatalError("can't initialize module al");