2 #define OLD_INTERFACE /* define for pre-Irix 6 interface */
5 #include "stringobject.h"
12 #endif /* OLD_INTERFACE */
13 #endif /* AL_NO_ELEM */
15 static PyObject
*ErrorObject
;
17 /* ----------------------------------------------------- */
19 /* Declarations for objects of type port */
23 /* XXXX Add your own stuff here */
27 static PyTypeObject Alptype
;
31 /* ---------------------------------------------------------------- */
33 /* Declarations for objects of type config */
37 /* XXXX Add your own stuff here */
41 static PyTypeObject Alctype
;
45 ErrorHandler(long code
, const char *fmt
, ...)
51 vsprintf(buf
, fmt
, args
);
53 PyErr_SetString(ErrorObject
, buf
);
56 #ifdef AL_NO_ELEM /* IRIX 6 */
59 param2python(int resource
, int param
, ALvalue value
, ALparamInfo
*pinfo
)
65 if (alGetParamInfo(resource
, param
, &info
) < 0)
68 switch (pinfo
->elementType
) {
70 /* XXXX don't know how to handle this */
75 case AL_RESOURCE_ELEM
:
77 return PyInt_FromLong((long) value
.i
);
79 return PyLong_FromLongLong(value
.ll
);
81 return PyFloat_FromDouble(alFixedToDouble(value
.ll
));
83 if (value
.ptr
== NULL
) {
87 return PyString_FromString((char *) value
.ptr
);
89 PyErr_SetString(ErrorObject
, "unknown element type");
95 python2elem(PyObject
*item
, void *ptr
, int elementType
)
97 switch (elementType
) {
99 case AL_RESOURCE_ELEM
:
101 if (!PyInt_Check(item
)) {
105 *((int *) ptr
) = PyInt_AsLong(item
);
108 if (PyInt_Check(item
))
109 *((long long *) ptr
) = PyInt_AsLong(item
);
110 else if (PyLong_Check(item
))
111 *((long long *) ptr
) = PyLong_AsLongLong(item
);
118 if (PyInt_Check(item
))
119 *((long long *) ptr
) = alDoubleToFixed((double) PyInt_AsLong(item
));
120 else if (PyFloat_Check(item
))
121 *((long long *) ptr
) = alDoubleToFixed(PyFloat_AsDouble(item
));
128 PyErr_SetString(ErrorObject
, "unknown element type");
135 python2param(int resource
, ALpv
*param
, PyObject
*value
, ALparamInfo
*pinfo
)
143 if (alGetParamInfo(resource
, param
->param
, &info
) < 0)
146 switch (pinfo
->valueType
) {
148 if (pinfo
->elementType
!= AL_CHAR_ELEM
) {
149 PyErr_SetString(ErrorObject
, "unknown element type");
152 if (!PyString_Check(value
)) {
156 param
->value
.ptr
= PyString_AS_STRING(value
);
157 param
->sizeIn
= PyString_GET_SIZE(value
)+1; /*account for NUL*/
161 if (!PyList_Check(value
) && !PyTuple_Check(value
)) {
165 switch (pinfo
->elementType
) {
167 case AL_RESOURCE_ELEM
:
169 param
->sizeIn
= PySequence_Size(value
);
170 param
->value
.ptr
= PyMem_NEW(int, param
->sizeIn
);
171 stepsize
= sizeof(int);
175 param
->sizeIn
= PySequence_Size(value
);
176 param
->value
.ptr
= PyMem_NEW(long long, param
->sizeIn
);
177 stepsize
= sizeof(long long);
180 for (i
= 0; i
< param
->sizeIn
; i
++) {
181 item
= PySequence_GetItem(value
, i
);
182 if (python2elem(item
, (void *) ((char *) param
->value
.ptr
+ i
*stepsize
), pinfo
->elementType
) < 0) {
183 PyMem_DEL(param
->value
.ptr
);
189 switch (pinfo
->elementType
) {
191 case AL_RESOURCE_ELEM
:
193 return python2elem(value
, (void *) ¶m
->value
.i
,
197 return python2elem(value
, (void *) ¶m
->value
.ll
,
200 PyErr_SetString(ErrorObject
, "unknown element type");
208 python2params(int resource1
, int resource2
, PyObject
*list
, ALpv
**pvsp
, ALparamInfo
**pinfop
)
215 npvs
= PyList_Size(list
);
216 pvs
= PyMem_NEW(ALpv
, npvs
);
217 pinfo
= PyMem_NEW(ALparamInfo
, npvs
);
218 for (i
= 0; i
< npvs
; i
++) {
219 item
= PyList_GetItem(list
, i
);
220 if (!PyArg_ParseTuple(item
, "iO", &pvs
[i
].param
, &item
))
222 if (alGetParamInfo(resource1
, pvs
[i
].param
, &pinfo
[i
]) < 0 &&
223 alGetParamInfo(resource2
, pvs
[i
].param
, &pinfo
[i
]) < 0)
225 if (python2param(resource1
, &pvs
[i
], item
, &pinfo
[i
]) < 0)
234 /* XXXX we should clean up everything */
242 /* -------------------------------------------------------- */
246 SetConfig(alcobject
*self
, PyObject
*args
, int (*func
)(ALconfig
, int))
250 if (!PyArg_ParseTuple(args
, "i:SetConfig", &par
))
253 if ((*func
)(self
->config
, par
) == -1)
261 GetConfig(alcobject
*self
, PyObject
*args
, int (*func
)(ALconfig
))
265 if (!PyArg_ParseTuple(args
, ":GetConfig"))
268 if ((par
= (*func
)(self
->config
)) == -1)
271 return PyInt_FromLong((long) par
);
274 PyDoc_STRVAR(alc_SetWidth__doc__
,
275 "alSetWidth: set the wordsize for integer audio data.");
278 alc_SetWidth(alcobject
*self
, PyObject
*args
)
280 return SetConfig(self
, args
, alSetWidth
);
284 PyDoc_STRVAR(alc_GetWidth__doc__
,
285 "alGetWidth: get the wordsize for integer audio data.");
288 alc_GetWidth(alcobject
*self
, PyObject
*args
)
290 return GetConfig(self
, args
, alGetWidth
);
294 PyDoc_STRVAR(alc_SetSampFmt__doc__
,
295 "alSetSampFmt: set the sample format setting in an audio ALconfig "
299 alc_SetSampFmt(alcobject
*self
, PyObject
*args
)
301 return SetConfig(self
, args
, alSetSampFmt
);
305 PyDoc_STRVAR(alc_GetSampFmt__doc__
,
306 "alGetSampFmt: get the sample format setting in an audio ALconfig "
310 alc_GetSampFmt(alcobject
*self
, PyObject
*args
)
312 return GetConfig(self
, args
, alGetSampFmt
);
316 PyDoc_STRVAR(alc_SetChannels__doc__
,
317 "alSetChannels: set the channel settings in an audio ALconfig.");
320 alc_SetChannels(alcobject
*self
, PyObject
*args
)
322 return SetConfig(self
, args
, alSetChannels
);
326 PyDoc_STRVAR(alc_GetChannels__doc__
,
327 "alGetChannels: get the channel settings in an audio ALconfig.");
330 alc_GetChannels(alcobject
*self
, PyObject
*args
)
332 return GetConfig(self
, args
, alGetChannels
);
336 PyDoc_STRVAR(alc_SetFloatMax__doc__
,
337 "alSetFloatMax: set the maximum value of floating point sample data.");
340 alc_SetFloatMax(alcobject
*self
, PyObject
*args
)
342 double maximum_value
;
344 if (!PyArg_ParseTuple(args
, "d:SetFloatMax", &maximum_value
))
346 if (alSetFloatMax(self
->config
, maximum_value
) < 0)
353 PyDoc_STRVAR(alc_GetFloatMax__doc__
,
354 "alGetFloatMax: get the maximum value of floating point sample data.");
357 alc_GetFloatMax(alcobject
*self
, PyObject
*args
)
359 double maximum_value
;
361 if (!PyArg_ParseTuple(args
, ":GetFloatMax"))
363 if ((maximum_value
= alGetFloatMax(self
->config
)) == 0)
365 return PyFloat_FromDouble(maximum_value
);
369 PyDoc_STRVAR(alc_SetDevice__doc__
,
370 "alSetDevice: set the device setting in an audio ALconfig structure.");
373 alc_SetDevice(alcobject
*self
, PyObject
*args
)
375 return SetConfig(self
, args
, alSetDevice
);
379 PyDoc_STRVAR(alc_GetDevice__doc__
,
380 "alGetDevice: get the device setting in an audio ALconfig structure.");
383 alc_GetDevice(alcobject
*self
, PyObject
*args
)
385 return GetConfig(self
, args
, alGetDevice
);
389 PyDoc_STRVAR(alc_SetQueueSize__doc__
,
390 "alSetQueueSize: set audio port buffer size.");
393 alc_SetQueueSize(alcobject
*self
, PyObject
*args
)
395 return SetConfig(self
, args
, alSetQueueSize
);
399 PyDoc_STRVAR(alc_GetQueueSize__doc__
,
400 "alGetQueueSize: get audio port buffer size.");
403 alc_GetQueueSize(alcobject
*self
, PyObject
*args
)
405 return GetConfig(self
, args
, alGetQueueSize
);
408 #endif /* AL_NO_ELEM */
411 setconfig(alcobject
*self
, PyObject
*args
, int (*func
)(ALconfig
, long))
415 if (!PyArg_ParseTuple(args
, "l:SetConfig", &par
))
418 if ((*func
)(self
->config
, par
) == -1)
426 getconfig(alcobject
*self
, PyObject
*args
, long (*func
)(ALconfig
))
430 if (!PyArg_ParseTuple(args
, ":GetConfig"))
433 if ((par
= (*func
)(self
->config
)) == -1)
436 return PyInt_FromLong((long) par
);
440 alc_setqueuesize (alcobject
*self
, PyObject
*args
)
442 return setconfig(self
, args
, ALsetqueuesize
);
446 alc_getqueuesize (alcobject
*self
, PyObject
*args
)
448 return getconfig(self
, args
, ALgetqueuesize
);
452 alc_setwidth (alcobject
*self
, PyObject
*args
)
454 return setconfig(self
, args
, ALsetwidth
);
458 alc_getwidth (alcobject
*self
, PyObject
*args
)
460 return getconfig(self
, args
, ALgetwidth
);
464 alc_getchannels (alcobject
*self
, PyObject
*args
)
466 return getconfig(self
, args
, ALgetchannels
);
470 alc_setchannels (alcobject
*self
, PyObject
*args
)
472 return setconfig(self
, args
, ALsetchannels
);
478 alc_getsampfmt (alcobject
*self
, PyObject
*args
)
480 return getconfig(self
, args
, ALgetsampfmt
);
484 alc_setsampfmt (alcobject
*self
, PyObject
*args
)
486 return setconfig(self
, args
, ALsetsampfmt
);
490 alc_getfloatmax(alcobject
*self
, PyObject
*args
)
494 if (!PyArg_ParseTuple(args
, ":GetFloatMax"))
496 if ((arg
= ALgetfloatmax(self
->config
)) == 0)
498 return PyFloat_FromDouble(arg
);
502 alc_setfloatmax(alcobject
*self
, PyObject
*args
)
506 if (!PyArg_ParseTuple(args
, "d:SetFloatMax", &arg
))
508 if (ALsetfloatmax(self
->config
, arg
) == -1)
515 static struct PyMethodDef alc_methods
[] = {
516 #ifdef AL_NO_ELEM /* IRIX 6 */
517 {"SetWidth", (PyCFunction
)alc_SetWidth
, METH_VARARGS
, alc_SetWidth__doc__
},
518 {"GetWidth", (PyCFunction
)alc_GetWidth
, METH_VARARGS
, alc_GetWidth__doc__
},
519 {"SetSampFmt", (PyCFunction
)alc_SetSampFmt
, METH_VARARGS
, alc_SetSampFmt__doc__
},
520 {"GetSampFmt", (PyCFunction
)alc_GetSampFmt
, METH_VARARGS
, alc_GetSampFmt__doc__
},
521 {"SetChannels", (PyCFunction
)alc_SetChannels
, METH_VARARGS
, alc_SetChannels__doc__
},
522 {"GetChannels", (PyCFunction
)alc_GetChannels
, METH_VARARGS
, alc_GetChannels__doc__
},
523 {"SetFloatMax", (PyCFunction
)alc_SetFloatMax
, METH_VARARGS
, alc_SetFloatMax__doc__
},
524 {"GetFloatMax", (PyCFunction
)alc_GetFloatMax
, METH_VARARGS
, alc_GetFloatMax__doc__
},
525 {"SetDevice", (PyCFunction
)alc_SetDevice
, METH_VARARGS
, alc_SetDevice__doc__
},
526 {"GetDevice", (PyCFunction
)alc_GetDevice
, METH_VARARGS
, alc_GetDevice__doc__
},
527 {"SetQueueSize", (PyCFunction
)alc_SetQueueSize
, METH_VARARGS
, alc_SetQueueSize__doc__
},
528 {"GetQueueSize", (PyCFunction
)alc_GetQueueSize
, METH_VARARGS
, alc_GetQueueSize__doc__
},
529 #endif /* AL_NO_ELEM */
530 {"getqueuesize", (PyCFunction
)alc_getqueuesize
, METH_VARARGS
},
531 {"setqueuesize", (PyCFunction
)alc_setqueuesize
, METH_VARARGS
},
532 {"getwidth", (PyCFunction
)alc_getwidth
, METH_VARARGS
},
533 {"setwidth", (PyCFunction
)alc_setwidth
, METH_VARARGS
},
534 {"getchannels", (PyCFunction
)alc_getchannels
, METH_VARARGS
},
535 {"setchannels", (PyCFunction
)alc_setchannels
, METH_VARARGS
},
537 {"getsampfmt", (PyCFunction
)alc_getsampfmt
, METH_VARARGS
},
538 {"setsampfmt", (PyCFunction
)alc_setsampfmt
, METH_VARARGS
},
539 {"getfloatmax", (PyCFunction
)alc_getfloatmax
, METH_VARARGS
},
540 {"setfloatmax", (PyCFunction
)alc_setfloatmax
, METH_VARARGS
},
543 {NULL
, NULL
} /* sentinel */
550 newalcobject(ALconfig config
)
554 self
= PyObject_New(alcobject
, &Alctype
);
557 /* XXXX Add your own initializers here */
558 self
->config
= config
;
559 return (PyObject
*) self
;
564 alc_dealloc(alcobject
*self
)
566 /* XXXX Add your own cleanup code here */
567 #ifdef AL_NO_ELEM /* IRIX 6 */
568 (void) alFreeConfig(self
->config
); /* ignore errors */
570 (void) ALfreeconfig(self
->config
); /* ignore errors */
576 alc_getattr(alcobject
*self
, char *name
)
578 /* XXXX Add your own getattr code here */
579 return Py_FindMethod(alc_methods
, (PyObject
*)self
, name
);
582 PyDoc_STRVAR(Alctype__doc__
, "");
584 static PyTypeObject Alctype
= {
585 PyObject_HEAD_INIT(&PyType_Type
)
587 "al.config", /*tp_name*/
588 sizeof(alcobject
), /*tp_basicsize*/
591 (destructor
)alc_dealloc
, /*tp_dealloc*/
592 (printfunc
)0, /*tp_print*/
593 (getattrfunc
)alc_getattr
, /*tp_getattr*/
594 (setattrfunc
)0, /*tp_setattr*/
595 (cmpfunc
)0, /*tp_compare*/
596 (reprfunc
)0, /*tp_repr*/
598 0, /*tp_as_sequence*/
600 (hashfunc
)0, /*tp_hash*/
601 (ternaryfunc
)0, /*tp_call*/
602 (reprfunc
)0, /*tp_str*/
604 /* Space for future expansion */
606 Alctype__doc__
/* Documentation string */
609 /* End of code for config objects */
610 /* ---------------------------------------------------------------- */
612 #ifdef AL_NO_ELEM /* IRIX 6 */
614 PyDoc_STRVAR(alp_SetConfig__doc__
,
615 "alSetConfig: set the ALconfig of an audio ALport.");
618 alp_SetConfig(alpobject
*self
, PyObject
*args
)
621 if (!PyArg_ParseTuple(args
, "O!:SetConfig", &Alctype
, &config
))
623 if (alSetConfig(self
->port
, config
->config
) < 0)
630 PyDoc_STRVAR(alp_GetConfig__doc__
,
631 "alGetConfig: get the ALconfig of an audio ALport.");
634 alp_GetConfig(alpobject
*self
, PyObject
*args
)
637 if (!PyArg_ParseTuple(args
, ":GetConfig"))
639 if ((config
= alGetConfig(self
->port
)) == NULL
)
641 return newalcobject(config
);
645 PyDoc_STRVAR(alp_GetResource__doc__
,
646 "alGetResource: get the resource associated with an audio port.");
649 alp_GetResource(alpobject
*self
, PyObject
*args
)
653 if (!PyArg_ParseTuple(args
, ":GetResource"))
655 if ((resource
= alGetResource(self
->port
)) == 0)
657 return PyInt_FromLong((long) resource
);
661 PyDoc_STRVAR(alp_GetFD__doc__
,
662 "alGetFD: get the file descriptor for an audio port.");
665 alp_GetFD(alpobject
*self
, PyObject
*args
)
669 if (!PyArg_ParseTuple(args
, ":GetFD"))
672 if ((fd
= alGetFD(self
->port
)) < 0)
675 return PyInt_FromLong((long) fd
);
679 PyDoc_STRVAR(alp_GetFilled__doc__
,
680 "alGetFilled: return the number of filled sample frames in "
684 alp_GetFilled(alpobject
*self
, PyObject
*args
)
688 if (!PyArg_ParseTuple(args
, ":GetFilled"))
690 if ((filled
= alGetFilled(self
->port
)) < 0)
692 return PyInt_FromLong((long) filled
);
696 PyDoc_STRVAR(alp_GetFillable__doc__
,
697 "alGetFillable: report the number of unfilled sample frames "
698 "in an audio port.");
701 alp_GetFillable(alpobject
*self
, PyObject
*args
)
705 if (!PyArg_ParseTuple(args
, ":GetFillable"))
707 if ((fillable
= alGetFillable(self
->port
)) < 0)
709 return PyInt_FromLong((long) fillable
);
713 PyDoc_STRVAR(alp_ReadFrames__doc__
,
714 "alReadFrames: read sample frames from an audio port.");
717 alp_ReadFrames(alpobject
*self
, PyObject
*args
)
725 if (!PyArg_ParseTuple(args
, "i:ReadFrames", &framecount
))
727 if (framecount
< 0) {
728 PyErr_SetString(ErrorObject
, "negative framecount");
731 c
= alGetConfig(self
->port
);
732 switch (alGetSampFmt(c
)) {
733 case AL_SAMPFMT_TWOSCOMP
:
734 switch (alGetWidth(c
)) {
745 PyErr_SetString(ErrorObject
, "can't determine width");
750 case AL_SAMPFMT_FLOAT
:
753 case AL_SAMPFMT_DOUBLE
:
757 PyErr_SetString(ErrorObject
, "can't determine format");
761 ch
= alGetChannels(c
);
764 PyErr_SetString(ErrorObject
, "can't determine # of channels");
768 v
= PyString_FromStringAndSize((char *) NULL
, size
* framecount
);
772 Py_BEGIN_ALLOW_THREADS
773 alReadFrames(self
->port
, (void *) PyString_AS_STRING(v
), framecount
);
780 PyDoc_STRVAR(alp_DiscardFrames__doc__
,
781 "alDiscardFrames: discard audio from an audio port.");
784 alp_DiscardFrames(alpobject
*self
, PyObject
*args
)
788 if (!PyArg_ParseTuple(args
, "i:DiscardFrames", &framecount
))
791 Py_BEGIN_ALLOW_THREADS
792 framecount
= alDiscardFrames(self
->port
, framecount
);
798 return PyInt_FromLong((long) framecount
);
802 PyDoc_STRVAR(alp_ZeroFrames__doc__
,
803 "alZeroFrames: write zero-valued sample frames to an audio port.");
806 alp_ZeroFrames(alpobject
*self
, PyObject
*args
)
810 if (!PyArg_ParseTuple(args
, "i:ZeroFrames", &framecount
))
813 if (framecount
< 0) {
814 PyErr_SetString(ErrorObject
, "negative framecount");
818 Py_BEGIN_ALLOW_THREADS
819 alZeroFrames(self
->port
, framecount
);
827 PyDoc_STRVAR(alp_SetFillPoint__doc__
,
828 "alSetFillPoint: set low- or high-water mark for an audio port.");
831 alp_SetFillPoint(alpobject
*self
, PyObject
*args
)
835 if (!PyArg_ParseTuple(args
, "i:SetFillPoint", &fillpoint
))
838 if (alSetFillPoint(self
->port
, fillpoint
) < 0)
846 PyDoc_STRVAR(alp_GetFillPoint__doc__
,
847 "alGetFillPoint: get low- or high-water mark for an audio port.");
850 alp_GetFillPoint(alpobject
*self
, PyObject
*args
)
854 if (!PyArg_ParseTuple(args
, ":GetFillPoint"))
857 if ((fillpoint
= alGetFillPoint(self
->port
)) < 0)
860 return PyInt_FromLong((long) fillpoint
);
864 PyDoc_STRVAR(alp_GetFrameNumber__doc__
,
865 "alGetFrameNumber: get the absolute sample frame number "
866 "associated with a port.");
869 alp_GetFrameNumber(alpobject
*self
, PyObject
*args
)
873 if (!PyArg_ParseTuple(args
, ":GetFrameNumber"))
876 if (alGetFrameNumber(self
->port
, &fnum
) < 0)
879 return PyLong_FromLongLong((long long) fnum
);
883 PyDoc_STRVAR(alp_GetFrameTime__doc__
,
884 "alGetFrameTime: get the time at which a sample frame came "
885 "in or will go out.");
888 alp_GetFrameTime(alpobject
*self
, PyObject
*args
)
891 PyObject
*ret
, *v0
, *v1
;
893 if (!PyArg_ParseTuple(args
, ":GetFrameTime"))
895 if (alGetFrameTime(self
->port
, &fnum
, &time
) < 0)
897 v0
= PyLong_FromLongLong((long long) fnum
);
898 v1
= PyLong_FromLongLong((long long) time
);
899 if (PyErr_Occurred()) {
904 ret
= PyTuple_Pack(2, v0
, v1
);
911 PyDoc_STRVAR(alp_WriteFrames__doc__
,
912 "alWriteFrames: write sample frames to an audio port.");
915 alp_WriteFrames(alpobject
*self
, PyObject
*args
)
922 if (!PyArg_ParseTuple(args
, "s#:WriteFrames", &samples
, &length
))
924 c
= alGetConfig(self
->port
);
925 switch (alGetSampFmt(c
)) {
926 case AL_SAMPFMT_TWOSCOMP
:
927 switch (alGetWidth(c
)) {
938 PyErr_SetString(ErrorObject
, "can't determine width");
943 case AL_SAMPFMT_FLOAT
:
946 case AL_SAMPFMT_DOUBLE
:
950 PyErr_SetString(ErrorObject
, "can't determine format");
954 ch
= alGetChannels(c
);
957 PyErr_SetString(ErrorObject
, "can't determine # of channels");
961 if (length
% size
!= 0) {
962 PyErr_SetString(ErrorObject
,
963 "buffer length not whole number of frames");
967 Py_BEGIN_ALLOW_THREADS
968 alWriteFrames(self
->port
, (void *) samples
, length
/ size
);
976 PyDoc_STRVAR(alp_ClosePort__doc__
, "alClosePort: close an audio port.");
979 alp_ClosePort(alpobject
*self
, PyObject
*args
)
981 if (!PyArg_ParseTuple(args
, ":ClosePort"))
983 if (alClosePort(self
->port
) < 0)
990 #endif /* AL_NO_ELEM */
994 alp_closeport(alpobject
*self
, PyObject
*args
)
996 if (!PyArg_ParseTuple(args
, ":ClosePort"))
998 if (ALcloseport(self
->port
) < 0)
1006 alp_getfd(alpobject
*self
, PyObject
*args
)
1010 if (!PyArg_ParseTuple(args
, ":GetFD"))
1012 if ((fd
= ALgetfd(self
-> port
)) == -1)
1014 return PyInt_FromLong(fd
);
1018 alp_getfilled(alpobject
*self
, PyObject
*args
)
1022 if (!PyArg_ParseTuple(args
, ":GetFilled"))
1024 if ((count
= ALgetfilled(self
-> port
)) == -1)
1026 return PyInt_FromLong(count
);
1030 alp_getfillable(alpobject
*self
, PyObject
*args
)
1034 if (!PyArg_ParseTuple(args
, ":GetFillable"))
1036 if ((count
= ALgetfillable(self
-> port
)) == -1)
1038 return PyInt_FromLong (count
);
1042 alp_readsamps(alpobject
*self
, PyObject
*args
)
1050 if (!PyArg_ParseTuple(args
, "l:readsamps", &count
))
1054 PyErr_SetString(ErrorObject
, "al.readsamps : arg <= 0");
1058 c
= ALgetconfig(self
->port
);
1060 width
= ALgetsampfmt(c
);
1061 if (width
== AL_SAMPFMT_FLOAT
)
1062 width
= sizeof(float);
1063 else if (width
== AL_SAMPFMT_DOUBLE
)
1064 width
= sizeof(double);
1066 width
= ALgetwidth(c
);
1068 width
= ALgetwidth(c
);
1071 v
= PyString_FromStringAndSize((char *)NULL
, width
* count
);
1075 Py_BEGIN_ALLOW_THREADS
1076 ret
= ALreadsamps(self
->port
, (void *) PyString_AsString(v
), count
);
1077 Py_END_ALLOW_THREADS
1087 alp_writesamps(alpobject
*self
, PyObject
*args
)
1094 if (!PyArg_ParseTuple(args
, "s#:writesamps", &buf
, &size
))
1097 c
= ALgetconfig(self
->port
);
1099 width
= ALgetsampfmt(c
);
1100 if (width
== AL_SAMPFMT_FLOAT
)
1101 width
= sizeof(float);
1102 else if (width
== AL_SAMPFMT_DOUBLE
)
1103 width
= sizeof(double);
1105 width
= ALgetwidth(c
);
1107 width
= ALgetwidth(c
);
1110 Py_BEGIN_ALLOW_THREADS
1111 ret
= ALwritesamps (self
->port
, (void *) buf
, (long) size
/ width
);
1112 Py_END_ALLOW_THREADS
1121 alp_getfillpoint(alpobject
*self
, PyObject
*args
)
1125 if (!PyArg_ParseTuple(args
, ":GetFillPoint"))
1127 if ((count
= ALgetfillpoint(self
->port
)) == -1)
1129 return PyInt_FromLong(count
);
1133 alp_setfillpoint(alpobject
*self
, PyObject
*args
)
1137 if (!PyArg_ParseTuple(args
, "l:SetFillPoint", &count
))
1139 if (ALsetfillpoint(self
->port
, count
) == -1)
1146 alp_setconfig(alpobject
*self
, PyObject
*args
)
1150 if (!PyArg_ParseTuple(args
, "O!:SetConfig", &Alctype
, &config
))
1152 if (ALsetconfig(self
->port
, config
->config
) == -1)
1159 alp_getconfig(alpobject
*self
, PyObject
*args
)
1163 if (!PyArg_ParseTuple(args
, ":GetConfig"))
1165 config
= ALgetconfig(self
->port
);
1168 return newalcobject(config
);
1173 alp_getstatus(alpobject
*self
, PyObject
*args
)
1180 if (!PyArg_ParseTuple(args
, "O!", &PyList_Type
, &list
))
1182 length
= PyList_Size(list
);
1183 PVbuffer
= PyMem_NEW(long, length
);
1184 if (PVbuffer
== NULL
)
1185 return PyErr_NoMemory();
1186 for (i
= 0; i
< length
; i
++) {
1187 v
= PyList_GetItem(list
, i
);
1188 if (!PyInt_Check(v
)) {
1189 PyMem_DEL(PVbuffer
);
1190 PyErr_BadArgument();
1193 PVbuffer
[i
] = PyInt_AsLong(v
);
1196 if (ALgetstatus(self
->port
, PVbuffer
, length
) == -1)
1199 for (i
= 0; i
< length
; i
++)
1200 PyList_SetItem(list
, i
, PyInt_FromLong(PVbuffer
[i
]));
1202 PyMem_DEL(PVbuffer
);
1209 #endif /* OLD_INTERFACE */
1211 static struct PyMethodDef alp_methods
[] = {
1212 #ifdef AL_NO_ELEM /* IRIX 6 */
1213 {"SetConfig", (PyCFunction
)alp_SetConfig
, METH_VARARGS
, alp_SetConfig__doc__
},
1214 {"GetConfig", (PyCFunction
)alp_GetConfig
, METH_VARARGS
, alp_GetConfig__doc__
},
1215 {"GetResource", (PyCFunction
)alp_GetResource
, METH_VARARGS
, alp_GetResource__doc__
},
1216 {"GetFD", (PyCFunction
)alp_GetFD
, METH_VARARGS
, alp_GetFD__doc__
},
1217 {"GetFilled", (PyCFunction
)alp_GetFilled
, METH_VARARGS
, alp_GetFilled__doc__
},
1218 {"GetFillable", (PyCFunction
)alp_GetFillable
, METH_VARARGS
, alp_GetFillable__doc__
},
1219 {"ReadFrames", (PyCFunction
)alp_ReadFrames
, METH_VARARGS
, alp_ReadFrames__doc__
},
1220 {"DiscardFrames", (PyCFunction
)alp_DiscardFrames
, METH_VARARGS
, alp_DiscardFrames__doc__
},
1221 {"ZeroFrames", (PyCFunction
)alp_ZeroFrames
, METH_VARARGS
, alp_ZeroFrames__doc__
},
1222 {"SetFillPoint", (PyCFunction
)alp_SetFillPoint
, METH_VARARGS
, alp_SetFillPoint__doc__
},
1223 {"GetFillPoint", (PyCFunction
)alp_GetFillPoint
, METH_VARARGS
, alp_GetFillPoint__doc__
},
1224 {"GetFrameNumber", (PyCFunction
)alp_GetFrameNumber
, METH_VARARGS
, alp_GetFrameNumber__doc__
},
1225 {"GetFrameTime", (PyCFunction
)alp_GetFrameTime
, METH_VARARGS
, alp_GetFrameTime__doc__
},
1226 {"WriteFrames", (PyCFunction
)alp_WriteFrames
, METH_VARARGS
, alp_WriteFrames__doc__
},
1227 {"ClosePort", (PyCFunction
)alp_ClosePort
, METH_VARARGS
, alp_ClosePort__doc__
},
1228 #endif /* AL_NO_ELEM */
1229 #ifdef OLD_INTERFACE
1230 {"closeport", (PyCFunction
)alp_closeport
, METH_VARARGS
},
1231 {"getfd", (PyCFunction
)alp_getfd
, METH_VARARGS
},
1232 {"fileno", (PyCFunction
)alp_getfd
, METH_VARARGS
},
1233 {"getfilled", (PyCFunction
)alp_getfilled
, METH_VARARGS
},
1234 {"getfillable", (PyCFunction
)alp_getfillable
, METH_VARARGS
},
1235 {"readsamps", (PyCFunction
)alp_readsamps
, METH_VARARGS
},
1236 {"writesamps", (PyCFunction
)alp_writesamps
, METH_VARARGS
},
1237 {"setfillpoint", (PyCFunction
)alp_setfillpoint
, METH_VARARGS
},
1238 {"getfillpoint", (PyCFunction
)alp_getfillpoint
, METH_VARARGS
},
1239 {"setconfig", (PyCFunction
)alp_setconfig
, METH_VARARGS
},
1240 {"getconfig", (PyCFunction
)alp_getconfig
, METH_VARARGS
},
1242 {"getstatus", (PyCFunction
)alp_getstatus
, METH_VARARGS
},
1244 #endif /* OLD_INTERFACE */
1246 {NULL
, NULL
} /* sentinel */
1253 newalpobject(ALport port
)
1257 self
= PyObject_New(alpobject
, &Alptype
);
1260 /* XXXX Add your own initializers here */
1262 return (PyObject
*) self
;
1267 alp_dealloc(alpobject
*self
)
1269 /* XXXX Add your own cleanup code here */
1271 #ifdef AL_NO_ELEM /* IRIX 6 */
1272 alClosePort(self
->port
);
1274 ALcloseport(self
->port
);
1281 alp_getattr(alpobject
*self
, char *name
)
1283 /* XXXX Add your own getattr code here */
1284 if (self
->port
== NULL
) {
1285 PyErr_SetString(ErrorObject
, "port already closed");
1288 return Py_FindMethod(alp_methods
, (PyObject
*)self
, name
);
1291 PyDoc_STRVAR(Alptype__doc__
, "");
1293 static PyTypeObject Alptype
= {
1294 PyObject_HEAD_INIT(&PyType_Type
)
1296 "al.port", /*tp_name*/
1297 sizeof(alpobject
), /*tp_basicsize*/
1300 (destructor
)alp_dealloc
, /*tp_dealloc*/
1301 (printfunc
)0, /*tp_print*/
1302 (getattrfunc
)alp_getattr
, /*tp_getattr*/
1303 (setattrfunc
)0, /*tp_setattr*/
1304 (cmpfunc
)0, /*tp_compare*/
1305 (reprfunc
)0, /*tp_repr*/
1307 0, /*tp_as_sequence*/
1308 0, /*tp_as_mapping*/
1309 (hashfunc
)0, /*tp_hash*/
1310 (ternaryfunc
)0, /*tp_call*/
1311 (reprfunc
)0, /*tp_str*/
1313 /* Space for future expansion */
1315 Alptype__doc__
/* Documentation string */
1318 /* End of code for port objects */
1319 /* -------------------------------------------------------- */
1322 #ifdef AL_NO_ELEM /* IRIX 6 */
1324 PyDoc_STRVAR(al_NewConfig__doc__
,
1325 "alNewConfig: create and initialize an audio ALconfig structure.");
1328 al_NewConfig(PyObject
*self
, PyObject
*args
)
1332 if (!PyArg_ParseTuple(args
, ":NewConfig"))
1334 if ((config
= alNewConfig()) == NULL
)
1336 return newalcobject(config
);
1339 PyDoc_STRVAR(al_OpenPort__doc__
,
1340 "alOpenPort: open an audio port.");
1343 al_OpenPort(PyObject
*self
, PyObject
*args
)
1347 alcobject
*config
= NULL
;
1349 if (!PyArg_ParseTuple(args
, "ss|O!:OpenPort", &name
, &dir
, &Alctype
, &config
))
1351 if ((port
= alOpenPort(name
, dir
, config
? config
->config
: NULL
)) == NULL
)
1353 return newalpobject(port
);
1356 PyDoc_STRVAR(al_Connect__doc__
,
1357 "alConnect: connect two audio I/O resources.");
1360 al_Connect(PyObject
*self
, PyObject
*args
)
1362 int source
, dest
, nprops
= 0, id
, i
;
1364 ALparamInfo
*propinfo
= NULL
;
1365 PyObject
*propobj
= NULL
;
1367 if (!PyArg_ParseTuple(args
, "ii|O!:Connect", &source
, &dest
, &PyList_Type
, &propobj
))
1369 if (propobj
!= NULL
) {
1370 nprops
= python2params(source
, dest
, propobj
, &props
, &propinfo
);
1375 id
= alConnect(source
, dest
, props
, nprops
);
1378 for (i
= 0; i
< nprops
; i
++) {
1379 switch (propinfo
[i
].valueType
) {
1382 PyMem_DEL(props
[i
].value
.ptr
);
1387 PyMem_DEL(propinfo
);
1392 return PyInt_FromLong((long) id
);
1395 PyDoc_STRVAR(al_Disconnect__doc__
,
1396 "alDisconnect: delete a connection between two audio I/O resources.");
1399 al_Disconnect(PyObject
*self
, PyObject
*args
)
1403 if (!PyArg_ParseTuple(args
, "i:Disconnect", &res
))
1405 if (alDisconnect(res
) < 0)
1411 PyDoc_STRVAR(al_GetParams__doc__
,
1412 "alGetParams: get the values of audio resource parameters.");
1415 al_GetParams(PyObject
*self
, PyObject
*args
)
1418 PyObject
*pvslist
, *item
= NULL
, *v
= NULL
;
1423 if (!PyArg_ParseTuple(args
, "iO!:GetParams", &resource
, &PyList_Type
, &pvslist
))
1425 npvs
= PyList_Size(pvslist
);
1426 pvs
= PyMem_NEW(ALpv
, npvs
);
1427 pinfo
= PyMem_NEW(ALparamInfo
, npvs
);
1428 for (i
= 0; i
< npvs
; i
++) {
1429 item
= PyList_GetItem(pvslist
, i
);
1430 if (!PyInt_Check(item
)) {
1432 PyErr_SetString(ErrorObject
, "list of integers expected");
1435 pvs
[i
].param
= (int) PyInt_AsLong(item
);
1436 item
= NULL
; /* not needed anymore */
1437 if (alGetParamInfo(resource
, pvs
[i
].param
, &pinfo
[i
]) < 0)
1439 switch (pinfo
[i
].valueType
) {
1443 pinfo
[i
].maxElems
*= pinfo
[i
].maxElems2
;
1448 switch (pinfo
[i
].elementType
) {
1450 case AL_RESOURCE_ELEM
:
1452 pvs
[i
].value
.ptr
= PyMem_NEW(int, pinfo
[i
].maxElems
);
1453 pvs
[i
].sizeIn
= pinfo
[i
].maxElems
;
1457 pvs
[i
].value
.ptr
= PyMem_NEW(long long, pinfo
[i
].maxElems
);
1458 pvs
[i
].sizeIn
= pinfo
[i
].maxElems
;
1461 pvs
[i
].value
.ptr
= PyMem_NEW(char, 32);
1467 PyErr_SetString(ErrorObject
, "internal error");
1474 PyErr_SetString(ErrorObject
, "internal error");
1477 if (pinfo
[i
].valueType
== AL_MATRIX_VAL
) {
1478 pinfo
[i
].maxElems
/= pinfo
[i
].maxElems2
;
1479 pvs
[i
].sizeIn
/= pinfo
[i
].maxElems2
;
1480 pvs
[i
].size2In
= pinfo
[i
].maxElems2
;
1483 if (alGetParams(resource
, pvs
, npvs
) < 0)
1485 if (!(v
= PyList_New(npvs
)))
1487 for (i
= 0; i
< npvs
; i
++) {
1488 if (pvs
[i
].sizeOut
< 0) {
1490 PyOS_snprintf(buf
, sizeof(buf
),
1491 "problem with param %d", i
);
1492 PyErr_SetString(ErrorObject
, buf
);
1495 switch (pinfo
[i
].valueType
) {
1501 item
= PyString_FromString(pvs
[i
].value
.ptr
);
1502 PyMem_DEL(pvs
[i
].value
.ptr
);
1505 /* XXXX this is not right */
1506 pvs
[i
].sizeOut
*= pvs
[i
].size2Out
;
1510 item
= PyList_New(pvs
[i
].sizeOut
);
1511 for (j
= 0; j
< pvs
[i
].sizeOut
; j
++) {
1512 switch (pinfo
[i
].elementType
) {
1514 case AL_RESOURCE_ELEM
:
1516 PyList_SetItem(item
, j
, PyInt_FromLong((long) ((int *) pvs
[i
].value
.ptr
)[j
]));
1519 PyList_SetItem(item
, j
, PyLong_FromLongLong(((long long *) pvs
[i
].value
.ptr
)[j
]));
1522 PyList_SetItem(item
, j
, PyFloat_FromDouble(alFixedToDouble(((long long *) pvs
[i
].value
.ptr
)[j
])));
1525 PyErr_SetString(ErrorObject
, "internal error");
1529 PyMem_DEL(pvs
[i
].value
.ptr
);
1532 item
= param2python(resource
, pvs
[i
].param
, pvs
[i
].value
, &pinfo
[i
]);
1535 if (PyErr_Occurred() ||
1536 PyList_SetItem(v
, i
, Py_BuildValue("(iO)", pvs
[i
].param
,
1556 PyDoc_STRVAR(al_SetParams__doc__
,
1557 "alSetParams: set the values of audio resource parameters.");
1560 al_SetParams(PyObject
*self
, PyObject
*args
)
1568 if (!PyArg_ParseTuple(args
, "iO!:SetParams", &resource
, &PyList_Type
, &pvslist
))
1570 npvs
= python2params(resource
, -1, pvslist
, &pvs
, &pinfo
);
1574 if (alSetParams(resource
, pvs
, npvs
) < 0)
1578 for (i
= 0; i
< npvs
; i
++) {
1579 switch (pinfo
[i
].valueType
) {
1582 PyMem_DEL(pvs
[i
].value
.ptr
);
1593 /* XXXX we should clean up everything */
1601 PyDoc_STRVAR(al_QueryValues__doc__
,
1602 "alQueryValues: get the set of possible values for a parameter.");
1605 al_QueryValues(PyObject
*self
, PyObject
*args
)
1607 int resource
, param
;
1608 ALvalue
*return_set
= NULL
;
1609 int setsize
= 32, qualsize
= 0, nvals
, i
;
1612 ALparamInfo
*qualinfo
= NULL
;
1613 PyObject
*qualobj
= NULL
;
1614 PyObject
*res
= NULL
, *item
;
1616 if (!PyArg_ParseTuple(args
, "ii|O!:QueryValues", &resource
, ¶m
,
1617 &PyList_Type
, &qualobj
))
1619 if (qualobj
!= NULL
) {
1620 qualsize
= python2params(resource
, param
, qualobj
, &quals
, &qualinfo
);
1625 return_set
= PyMem_NEW(ALvalue
, setsize
);
1626 if (return_set
== NULL
) {
1632 nvals
= alQueryValues(resource
, param
, return_set
, setsize
, quals
, qualsize
);
1635 if (nvals
> setsize
) {
1636 ALvalue
*old_return_set
= return_set
;
1638 PyMem_RESIZE(return_set
, ALvalue
, setsize
);
1639 if (return_set
== NULL
) {
1640 return_set
= old_return_set
;
1647 if (alGetParamInfo(resource
, param
, &pinfo
) < 0)
1650 res
= PyList_New(nvals
);
1653 for (i
= 0; i
< nvals
; i
++) {
1654 item
= param2python(resource
, param
, return_set
[i
], &pinfo
);
1656 PyList_SetItem(res
, i
, item
) < 0) {
1665 PyMem_DEL(return_set
);
1667 for (i
= 0; i
< qualsize
; i
++) {
1668 switch (qualinfo
[i
].valueType
) {
1671 PyMem_DEL(quals
[i
].value
.ptr
);
1676 PyMem_DEL(qualinfo
);
1682 PyDoc_STRVAR(al_GetParamInfo__doc__
,
1683 "alGetParamInfo: get information about a parameter on "
1684 "a particular audio resource.");
1687 al_GetParamInfo(PyObject
*self
, PyObject
*args
)
1693 if (!PyArg_ParseTuple(args
, "ii:GetParamInfo", &res
, ¶m
))
1695 if (alGetParamInfo(res
, param
, &pinfo
) < 0)
1698 if (!v
) return NULL
;
1700 item
= PyInt_FromLong((long) pinfo
.resource
);
1701 PyDict_SetItemString(v
, "resource", item
);
1704 item
= PyInt_FromLong((long) pinfo
.param
);
1705 PyDict_SetItemString(v
, "param", item
);
1708 item
= PyInt_FromLong((long) pinfo
.valueType
);
1709 PyDict_SetItemString(v
, "valueType", item
);
1712 if (pinfo
.valueType
!= AL_NO_VAL
&& pinfo
.valueType
!= AL_SCALAR_VAL
) {
1713 /* multiple values */
1714 item
= PyInt_FromLong((long) pinfo
.maxElems
);
1715 PyDict_SetItemString(v
, "maxElems", item
);
1718 if (pinfo
.valueType
== AL_MATRIX_VAL
) {
1720 item
= PyInt_FromLong((long) pinfo
.maxElems2
);
1721 PyDict_SetItemString(v
, "maxElems2", item
);
1726 item
= PyInt_FromLong((long) pinfo
.elementType
);
1727 PyDict_SetItemString(v
, "elementType", item
);
1730 item
= PyString_FromString(pinfo
.name
);
1731 PyDict_SetItemString(v
, "name", item
);
1734 item
= param2python(res
, param
, pinfo
.initial
, &pinfo
);
1735 PyDict_SetItemString(v
, "initial", item
);
1738 if (pinfo
.elementType
!= AL_ENUM_ELEM
&&
1739 pinfo
.elementType
!= AL_RESOURCE_ELEM
&&
1740 pinfo
.elementType
!= AL_CHAR_ELEM
) {
1742 item
= param2python(res
, param
, pinfo
.min
, &pinfo
);
1743 PyDict_SetItemString(v
, "min", item
);
1746 item
= param2python(res
, param
, pinfo
.max
, &pinfo
);
1747 PyDict_SetItemString(v
, "max", item
);
1750 item
= param2python(res
, param
, pinfo
.minDelta
, &pinfo
);
1751 PyDict_SetItemString(v
, "minDelta", item
);
1754 item
= param2python(res
, param
, pinfo
.maxDelta
, &pinfo
);
1755 PyDict_SetItemString(v
, "maxDelta", item
);
1758 item
= PyInt_FromLong((long) pinfo
.specialVals
);
1759 PyDict_SetItemString(v
, "specialVals", item
);
1766 PyDoc_STRVAR(al_GetResourceByName__doc__
,
1767 "alGetResourceByName: find an audio resource by name.");
1770 al_GetResourceByName(PyObject
*self
, PyObject
*args
)
1772 int res
, start_res
, type
;
1775 if (!PyArg_ParseTuple(args
, "isi:GetResourceByName", &start_res
, &name
, &type
))
1777 if ((res
= alGetResourceByName(start_res
, name
, type
)) == 0)
1779 return PyInt_FromLong((long) res
);
1782 PyDoc_STRVAR(al_IsSubtype__doc__
,
1783 "alIsSubtype: indicate if one resource type is a subtype of another.");
1786 al_IsSubtype(PyObject
*self
, PyObject
*args
)
1790 if (!PyArg_ParseTuple(args
, "ii:IsSubtype", &type
, &subtype
))
1792 return PyInt_FromLong((long) alIsSubtype(type
, subtype
));
1795 PyDoc_STRVAR(al_SetErrorHandler__doc__
, "");
1798 al_SetErrorHandler(PyObject
*self
, PyObject
*args
)
1801 if (!PyArg_ParseTuple(args
, ":SetErrorHandler"))
1807 #endif /* AL_NO_ELEM */
1809 #ifdef OLD_INTERFACE
1812 al_openport(PyObject
*self
, PyObject
*args
)
1816 alcobject
*config
= NULL
;
1818 if (!PyArg_ParseTuple(args
, "ss|O!:OpenPort", &name
, &dir
, &Alctype
, &config
))
1820 if ((port
= ALopenport(name
, dir
, config
? config
->config
: NULL
)) == NULL
)
1822 return newalpobject(port
);
1826 al_newconfig(PyObject
*self
, PyObject
*args
)
1830 if (!PyArg_ParseTuple(args
, ":NewConfig"))
1832 if ((config
= ALnewconfig ()) == NULL
)
1834 return newalcobject(config
);
1838 al_queryparams(PyObject
*self
, PyObject
*args
)
1847 if (!PyArg_ParseTuple(args
, "l:queryparams", &device
))
1849 if ((length
= ALqueryparams(device
, PVdummy
, 2L)) == -1)
1851 if ((PVbuffer
= PyMem_NEW(long, length
)) == NULL
)
1852 return PyErr_NoMemory();
1853 if (ALqueryparams(device
, PVbuffer
, length
) >= 0 &&
1854 (v
= PyList_New((int)length
)) != NULL
) {
1855 for (i
= 0; i
< length
; i
++)
1856 PyList_SetItem(v
, i
, PyInt_FromLong(PVbuffer
[i
]));
1858 PyMem_DEL(PVbuffer
);
1863 doParams(PyObject
*args
, int (*func
)(long, long *, long), int modified
)
1871 if (!PyArg_ParseTuple(args
, "lO!", &device
, &PyList_Type
, &list
))
1873 length
= PyList_Size(list
);
1874 PVbuffer
= PyMem_NEW(long, length
);
1875 if (PVbuffer
== NULL
)
1876 return PyErr_NoMemory();
1877 for (i
= 0; i
< length
; i
++) {
1878 v
= PyList_GetItem(list
, i
);
1879 if (!PyInt_Check(v
)) {
1880 PyMem_DEL(PVbuffer
);
1881 PyErr_BadArgument();
1884 PVbuffer
[i
] = PyInt_AsLong(v
);
1887 if ((*func
)(device
, PVbuffer
, length
) == -1) {
1888 PyMem_DEL(PVbuffer
);
1893 for (i
= 0; i
< length
; i
++)
1894 PyList_SetItem(list
, i
, PyInt_FromLong(PVbuffer
[i
]));
1897 PyMem_DEL(PVbuffer
);
1904 al_getparams(PyObject
*self
, PyObject
*args
)
1906 return doParams(args
, ALgetparams
, 1);
1910 al_setparams(PyObject
*self
, PyObject
*args
)
1912 return doParams(args
, ALsetparams
, 0);
1916 al_getname(PyObject
*self
, PyObject
*args
)
1918 long device
, descriptor
;
1921 if (!PyArg_ParseTuple(args
, "ll:getname", &device
, &descriptor
))
1923 if ((name
= ALgetname(device
, descriptor
)) == NULL
)
1925 return PyString_FromString(name
);
1929 al_getdefault(PyObject
*self
, PyObject
*args
)
1931 long device
, descriptor
, value
;
1933 if (!PyArg_ParseTuple(args
, "ll:getdefault", &device
, &descriptor
))
1935 if ((value
= ALgetdefault(device
, descriptor
)) == -1)
1937 return PyLong_FromLong(value
);
1941 al_getminmax(PyObject
*self
, PyObject
*args
)
1943 long device
, descriptor
, min
, max
;
1945 if (!PyArg_ParseTuple(args
, "ll:getminmax", &device
, &descriptor
))
1949 if (ALgetminmax(device
, descriptor
, &min
, &max
) == -1)
1951 return Py_BuildValue("ll", min
, max
);
1954 #endif /* OLD_INTERFACE */
1956 /* List of methods defined in the module */
1958 static struct PyMethodDef al_methods
[] = {
1959 #ifdef AL_NO_ELEM /* IRIX 6 */
1960 {"NewConfig", (PyCFunction
)al_NewConfig
, METH_VARARGS
, al_NewConfig__doc__
},
1961 {"OpenPort", (PyCFunction
)al_OpenPort
, METH_VARARGS
, al_OpenPort__doc__
},
1962 {"Connect", (PyCFunction
)al_Connect
, METH_VARARGS
, al_Connect__doc__
},
1963 {"Disconnect", (PyCFunction
)al_Disconnect
, METH_VARARGS
, al_Disconnect__doc__
},
1964 {"GetParams", (PyCFunction
)al_GetParams
, METH_VARARGS
, al_GetParams__doc__
},
1965 {"SetParams", (PyCFunction
)al_SetParams
, METH_VARARGS
, al_SetParams__doc__
},
1966 {"QueryValues", (PyCFunction
)al_QueryValues
, METH_VARARGS
, al_QueryValues__doc__
},
1967 {"GetParamInfo", (PyCFunction
)al_GetParamInfo
, METH_VARARGS
, al_GetParamInfo__doc__
},
1968 {"GetResourceByName", (PyCFunction
)al_GetResourceByName
, METH_VARARGS
, al_GetResourceByName__doc__
},
1969 {"IsSubtype", (PyCFunction
)al_IsSubtype
, METH_VARARGS
, al_IsSubtype__doc__
},
1971 /* this one not supported */
1972 {"SetErrorHandler", (PyCFunction
)al_SetErrorHandler
, METH_VARARGS
, al_SetErrorHandler__doc__
},
1974 #endif /* AL_NO_ELEM */
1975 #ifdef OLD_INTERFACE
1976 {"openport", (PyCFunction
)al_openport
, METH_VARARGS
},
1977 {"newconfig", (PyCFunction
)al_newconfig
, METH_VARARGS
},
1978 {"queryparams", (PyCFunction
)al_queryparams
, METH_VARARGS
},
1979 {"getparams", (PyCFunction
)al_getparams
, METH_VARARGS
},
1980 {"setparams", (PyCFunction
)al_setparams
, METH_VARARGS
},
1981 {"getname", (PyCFunction
)al_getname
, METH_VARARGS
},
1982 {"getdefault", (PyCFunction
)al_getdefault
, METH_VARARGS
},
1983 {"getminmax", (PyCFunction
)al_getminmax
, METH_VARARGS
},
1984 #endif /* OLD_INTERFACE */
1986 {NULL
, (PyCFunction
)NULL
, 0, NULL
} /* sentinel */
1990 /* Initialization function for the module (*must* be called inital) */
1992 PyDoc_STRVAR(al_module_documentation
, "");
1997 PyObject
*m
, *d
, *x
;
1999 if (PyErr_WarnPy3k("the al module has been removed in "
2000 "Python 3.0", 2) < 0)
2003 /* Create the module and add the functions */
2004 m
= Py_InitModule4("al", al_methods
,
2005 al_module_documentation
,
2006 (PyObject
*)NULL
,PYTHON_API_VERSION
);
2010 /* Add some symbolic constants to the module */
2011 d
= PyModule_GetDict(m
);
2012 ErrorObject
= PyErr_NewException("al.error", NULL
, NULL
);
2013 PyDict_SetItemString(d
, "error", ErrorObject
);
2015 /* XXXX Add constants here */
2017 x
= PyInt_FromLong((long) AL_4CHANNEL
);
2018 if (x
== NULL
|| PyDict_SetItemString(d
, "FOURCHANNEL", x
) < 0)
2022 #ifdef AL_ADAT_IF_TYPE
2023 x
= PyInt_FromLong((long) AL_ADAT_IF_TYPE
);
2024 if (x
== NULL
|| PyDict_SetItemString(d
, "ADAT_IF_TYPE", x
) < 0)
2028 #ifdef AL_ADAT_MCLK_TYPE
2029 x
= PyInt_FromLong((long) AL_ADAT_MCLK_TYPE
);
2030 if (x
== NULL
|| PyDict_SetItemString(d
, "ADAT_MCLK_TYPE", x
) < 0)
2034 #ifdef AL_AES_IF_TYPE
2035 x
= PyInt_FromLong((long) AL_AES_IF_TYPE
);
2036 if (x
== NULL
|| PyDict_SetItemString(d
, "AES_IF_TYPE", x
) < 0)
2040 #ifdef AL_AES_MCLK_TYPE
2041 x
= PyInt_FromLong((long) AL_AES_MCLK_TYPE
);
2042 if (x
== NULL
|| PyDict_SetItemString(d
, "AES_MCLK_TYPE", x
) < 0)
2046 #ifdef AL_ANALOG_IF_TYPE
2047 x
= PyInt_FromLong((long) AL_ANALOG_IF_TYPE
);
2048 if (x
== NULL
|| PyDict_SetItemString(d
, "ANALOG_IF_TYPE", x
) < 0)
2053 x
= PyInt_FromLong((long) AL_ASSOCIATE
);
2054 if (x
== NULL
|| PyDict_SetItemString(d
, "ASSOCIATE", x
) < 0)
2058 #ifdef AL_BAD_BUFFER_NULL
2059 x
= PyInt_FromLong((long) AL_BAD_BUFFER_NULL
);
2060 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFER_NULL", x
) < 0)
2064 #ifdef AL_BAD_BUFFERLENGTH
2065 x
= PyInt_FromLong((long) AL_BAD_BUFFERLENGTH
);
2066 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH", x
) < 0)
2070 #ifdef AL_BAD_BUFFERLENGTH_NEG
2071 x
= PyInt_FromLong((long) AL_BAD_BUFFERLENGTH_NEG
);
2072 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH_NEG", x
) < 0)
2076 #ifdef AL_BAD_BUFFERLENGTH_ODD
2077 x
= PyInt_FromLong((long) AL_BAD_BUFFERLENGTH_ODD
);
2078 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH_ODD", x
) < 0)
2082 #ifdef AL_BAD_CHANNELS
2083 x
= PyInt_FromLong((long) AL_BAD_CHANNELS
);
2084 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_CHANNELS", x
) < 0)
2088 #ifdef AL_BAD_CONFIG
2089 x
= PyInt_FromLong((long) AL_BAD_CONFIG
);
2090 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_CONFIG", x
) < 0)
2094 #ifdef AL_BAD_COUNT_NEG
2095 x
= PyInt_FromLong((long) AL_BAD_COUNT_NEG
);
2096 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_COUNT_NEG", x
) < 0)
2100 #ifdef AL_BAD_DEVICE
2101 x
= PyInt_FromLong((long) AL_BAD_DEVICE
);
2102 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_DEVICE", x
) < 0)
2106 #ifdef AL_BAD_DEVICE_ACCESS
2107 x
= PyInt_FromLong((long) AL_BAD_DEVICE_ACCESS
);
2108 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_DEVICE_ACCESS", x
) < 0)
2112 #ifdef AL_BAD_DIRECTION
2113 x
= PyInt_FromLong((long) AL_BAD_DIRECTION
);
2114 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_DIRECTION", x
) < 0)
2118 #ifdef AL_BAD_FILLPOINT
2119 x
= PyInt_FromLong((long) AL_BAD_FILLPOINT
);
2120 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_FILLPOINT", x
) < 0)
2124 #ifdef AL_BAD_FLOATMAX
2125 x
= PyInt_FromLong((long) AL_BAD_FLOATMAX
);
2126 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_FLOATMAX", x
) < 0)
2130 #ifdef AL_BAD_ILLEGAL_STATE
2131 x
= PyInt_FromLong((long) AL_BAD_ILLEGAL_STATE
);
2132 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_ILLEGAL_STATE", x
) < 0)
2136 #ifdef AL_BAD_NO_PORTS
2137 x
= PyInt_FromLong((long) AL_BAD_NO_PORTS
);
2138 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NO_PORTS", x
) < 0)
2142 #ifdef AL_BAD_NOT_FOUND
2143 x
= PyInt_FromLong((long) AL_BAD_NOT_FOUND
);
2144 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NOT_FOUND", x
) < 0)
2148 #ifdef AL_BAD_NOT_IMPLEMENTED
2149 x
= PyInt_FromLong((long) AL_BAD_NOT_IMPLEMENTED
);
2150 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NOT_IMPLEMENTED", x
) < 0)
2154 #ifdef AL_BAD_OUT_OF_MEM
2155 x
= PyInt_FromLong((long) AL_BAD_OUT_OF_MEM
);
2156 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_OUT_OF_MEM", x
) < 0)
2161 x
= PyInt_FromLong((long) AL_BAD_PARAM
);
2162 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PARAM", x
) < 0)
2166 #ifdef AL_BAD_PERMISSIONS
2167 x
= PyInt_FromLong((long) AL_BAD_PERMISSIONS
);
2168 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PERMISSIONS", x
) < 0)
2173 x
= PyInt_FromLong((long) AL_BAD_PORT
);
2174 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PORT", x
) < 0)
2178 #ifdef AL_BAD_PORTSTYLE
2179 x
= PyInt_FromLong((long) AL_BAD_PORTSTYLE
);
2180 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PORTSTYLE", x
) < 0)
2184 #ifdef AL_BAD_PVBUFFER
2185 x
= PyInt_FromLong((long) AL_BAD_PVBUFFER
);
2186 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PVBUFFER", x
) < 0)
2191 x
= PyInt_FromLong((long) AL_BAD_QSIZE
);
2192 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_QSIZE", x
) < 0)
2197 x
= PyInt_FromLong((long) AL_BAD_RATE
);
2198 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_RATE", x
) < 0)
2202 #ifdef AL_BAD_RESOURCE
2203 x
= PyInt_FromLong((long) AL_BAD_RESOURCE
);
2204 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_RESOURCE", x
) < 0)
2208 #ifdef AL_BAD_SAMPFMT
2209 x
= PyInt_FromLong((long) AL_BAD_SAMPFMT
);
2210 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_SAMPFMT", x
) < 0)
2214 #ifdef AL_BAD_TRANSFER_SIZE
2215 x
= PyInt_FromLong((long) AL_BAD_TRANSFER_SIZE
);
2216 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_TRANSFER_SIZE", x
) < 0)
2221 x
= PyInt_FromLong((long) AL_BAD_WIDTH
);
2222 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_WIDTH", x
) < 0)
2226 #ifdef AL_CHANNEL_MODE
2227 x
= PyInt_FromLong((long) AL_CHANNEL_MODE
);
2228 if (x
== NULL
|| PyDict_SetItemString(d
, "CHANNEL_MODE", x
) < 0)
2233 x
= PyInt_FromLong((long) AL_CHANNELS
);
2234 if (x
== NULL
|| PyDict_SetItemString(d
, "CHANNELS", x
) < 0)
2239 x
= PyInt_FromLong((long) AL_CHAR_ELEM
);
2240 if (x
== NULL
|| PyDict_SetItemString(d
, "CHAR_ELEM", x
) < 0)
2245 x
= PyInt_FromLong((long) AL_CLOCK_GEN
);
2246 if (x
== NULL
|| PyDict_SetItemString(d
, "CLOCK_GEN", x
) < 0)
2250 #ifdef AL_CLOCKGEN_TYPE
2251 x
= PyInt_FromLong((long) AL_CLOCKGEN_TYPE
);
2252 if (x
== NULL
|| PyDict_SetItemString(d
, "CLOCKGEN_TYPE", x
) < 0)
2257 x
= PyInt_FromLong((long) AL_CONNECT
);
2258 if (x
== NULL
|| PyDict_SetItemString(d
, "CONNECT", x
) < 0)
2262 #ifdef AL_CONNECTION_TYPE
2263 x
= PyInt_FromLong((long) AL_CONNECTION_TYPE
);
2264 if (x
== NULL
|| PyDict_SetItemString(d
, "CONNECTION_TYPE", x
) < 0)
2268 #ifdef AL_CONNECTIONS
2269 x
= PyInt_FromLong((long) AL_CONNECTIONS
);
2270 if (x
== NULL
|| PyDict_SetItemString(d
, "CONNECTIONS", x
) < 0)
2274 #ifdef AL_CRYSTAL_MCLK_TYPE
2275 x
= PyInt_FromLong((long) AL_CRYSTAL_MCLK_TYPE
);
2276 if (x
== NULL
|| PyDict_SetItemString(d
, "CRYSTAL_MCLK_TYPE", x
) < 0)
2280 #ifdef AL_DEFAULT_DEVICE
2281 x
= PyInt_FromLong((long) AL_DEFAULT_DEVICE
);
2282 if (x
== NULL
|| PyDict_SetItemString(d
, "DEFAULT_DEVICE", x
) < 0)
2286 #ifdef AL_DEFAULT_INPUT
2287 x
= PyInt_FromLong((long) AL_DEFAULT_INPUT
);
2288 if (x
== NULL
|| PyDict_SetItemString(d
, "DEFAULT_INPUT", x
) < 0)
2292 #ifdef AL_DEFAULT_OUTPUT
2293 x
= PyInt_FromLong((long) AL_DEFAULT_OUTPUT
);
2294 if (x
== NULL
|| PyDict_SetItemString(d
, "DEFAULT_OUTPUT", x
) < 0)
2299 x
= PyInt_FromLong((long) AL_DEST
);
2300 if (x
== NULL
|| PyDict_SetItemString(d
, "DEST", x
) < 0)
2304 #ifdef AL_DEVICE_TYPE
2305 x
= PyInt_FromLong((long) AL_DEVICE_TYPE
);
2306 if (x
== NULL
|| PyDict_SetItemString(d
, "DEVICE_TYPE", x
) < 0)
2311 x
= PyInt_FromLong((long) AL_DEVICES
);
2312 if (x
== NULL
|| PyDict_SetItemString(d
, "DEVICES", x
) < 0)
2316 #ifdef AL_DIGITAL_IF_TYPE
2317 x
= PyInt_FromLong((long) AL_DIGITAL_IF_TYPE
);
2318 if (x
== NULL
|| PyDict_SetItemString(d
, "DIGITAL_IF_TYPE", x
) < 0)
2322 #ifdef AL_DIGITAL_INPUT_RATE
2323 x
= PyInt_FromLong((long) AL_DIGITAL_INPUT_RATE
);
2324 if (x
== NULL
|| PyDict_SetItemString(d
, "DIGITAL_INPUT_RATE", x
) < 0)
2328 #ifdef AL_DISCONNECT
2329 x
= PyInt_FromLong((long) AL_DISCONNECT
);
2330 if (x
== NULL
|| PyDict_SetItemString(d
, "DISCONNECT", x
) < 0)
2335 x
= PyInt_FromLong((long) AL_ENUM_ELEM
);
2336 if (x
== NULL
|| PyDict_SetItemString(d
, "ENUM_ELEM", x
) < 0)
2340 #ifdef AL_ENUM_VALUE
2341 x
= PyInt_FromLong((long) AL_ENUM_VALUE
);
2342 if (x
== NULL
|| PyDict_SetItemString(d
, "ENUM_VALUE", x
) < 0)
2346 #ifdef AL_ERROR_INPUT_OVERFLOW
2347 x
= PyInt_FromLong((long) AL_ERROR_INPUT_OVERFLOW
);
2348 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_INPUT_OVERFLOW", x
) < 0)
2352 #ifdef AL_ERROR_LENGTH
2353 x
= PyInt_FromLong((long) AL_ERROR_LENGTH
);
2354 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_LENGTH", x
) < 0)
2358 #ifdef AL_ERROR_LOCATION_LSP
2359 x
= PyInt_FromLong((long) AL_ERROR_LOCATION_LSP
);
2360 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_LOCATION_LSP", x
) < 0)
2364 #ifdef AL_ERROR_LOCATION_MSP
2365 x
= PyInt_FromLong((long) AL_ERROR_LOCATION_MSP
);
2366 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_LOCATION_MSP", x
) < 0)
2370 #ifdef AL_ERROR_NUMBER
2371 x
= PyInt_FromLong((long) AL_ERROR_NUMBER
);
2372 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_NUMBER", x
) < 0)
2376 #ifdef AL_ERROR_OUTPUT_UNDERFLOW
2377 x
= PyInt_FromLong((long) AL_ERROR_OUTPUT_UNDERFLOW
);
2378 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_OUTPUT_UNDERFLOW", x
) < 0)
2382 #ifdef AL_ERROR_TYPE
2383 x
= PyInt_FromLong((long) AL_ERROR_TYPE
);
2384 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_TYPE", x
) < 0)
2388 #ifdef AL_FIXED_ELEM
2389 x
= PyInt_FromLong((long) AL_FIXED_ELEM
);
2390 if (x
== NULL
|| PyDict_SetItemString(d
, "FIXED_ELEM", x
) < 0)
2394 #ifdef AL_FIXED_MCLK_TYPE
2395 x
= PyInt_FromLong((long) AL_FIXED_MCLK_TYPE
);
2396 if (x
== NULL
|| PyDict_SetItemString(d
, "FIXED_MCLK_TYPE", x
) < 0)
2401 x
= PyInt_FromLong((long) AL_GAIN
);
2402 if (x
== NULL
|| PyDict_SetItemString(d
, "GAIN", x
) < 0)
2407 x
= PyInt_FromLong((long) AL_GAIN_REF
);
2408 if (x
== NULL
|| PyDict_SetItemString(d
, "GAIN_REF", x
) < 0)
2413 x
= PyInt_FromLong((long) AL_HRB_TYPE
);
2414 if (x
== NULL
|| PyDict_SetItemString(d
, "HRB_TYPE", x
) < 0)
2418 #ifdef AL_INPUT_COUNT
2419 x
= PyInt_FromLong((long) AL_INPUT_COUNT
);
2420 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_COUNT", x
) < 0)
2424 #ifdef AL_INPUT_DEVICE_TYPE
2425 x
= PyInt_FromLong((long) AL_INPUT_DEVICE_TYPE
);
2426 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_DEVICE_TYPE", x
) < 0)
2430 #ifdef AL_INPUT_DIGITAL
2431 x
= PyInt_FromLong((long) AL_INPUT_DIGITAL
);
2432 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_DIGITAL", x
) < 0)
2436 #ifdef AL_INPUT_HRB_TYPE
2437 x
= PyInt_FromLong((long) AL_INPUT_HRB_TYPE
);
2438 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_HRB_TYPE", x
) < 0)
2442 #ifdef AL_INPUT_LINE
2443 x
= PyInt_FromLong((long) AL_INPUT_LINE
);
2444 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_LINE", x
) < 0)
2449 x
= PyInt_FromLong((long) AL_INPUT_MIC
);
2450 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_MIC", x
) < 0)
2454 #ifdef AL_INPUT_PORT_TYPE
2455 x
= PyInt_FromLong((long) AL_INPUT_PORT_TYPE
);
2456 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_PORT_TYPE", x
) < 0)
2460 #ifdef AL_INPUT_RATE
2461 x
= PyInt_FromLong((long) AL_INPUT_RATE
);
2462 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_RATE", x
) < 0)
2466 #ifdef AL_INPUT_SOURCE
2467 x
= PyInt_FromLong((long) AL_INPUT_SOURCE
);
2468 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_SOURCE", x
) < 0)
2472 #ifdef AL_INT32_ELEM
2473 x
= PyInt_FromLong((long) AL_INT32_ELEM
);
2474 if (x
== NULL
|| PyDict_SetItemString(d
, "INT32_ELEM", x
) < 0)
2478 #ifdef AL_INT64_ELEM
2479 x
= PyInt_FromLong((long) AL_INT64_ELEM
);
2480 if (x
== NULL
|| PyDict_SetItemString(d
, "INT64_ELEM", x
) < 0)
2485 x
= PyInt_FromLong((long) AL_INTERFACE
);
2486 if (x
== NULL
|| PyDict_SetItemString(d
, "INTERFACE", x
) < 0)
2490 #ifdef AL_INTERFACE_TYPE
2491 x
= PyInt_FromLong((long) AL_INTERFACE_TYPE
);
2492 if (x
== NULL
|| PyDict_SetItemString(d
, "INTERFACE_TYPE", x
) < 0)
2496 #ifdef AL_INVALID_PARAM
2497 x
= PyInt_FromLong((long) AL_INVALID_PARAM
);
2498 if (x
== NULL
|| PyDict_SetItemString(d
, "INVALID_PARAM", x
) < 0)
2502 #ifdef AL_INVALID_VALUE
2503 x
= PyInt_FromLong((long) AL_INVALID_VALUE
);
2504 if (x
== NULL
|| PyDict_SetItemString(d
, "INVALID_VALUE", x
) < 0)
2509 x
= PyInt_FromLong((long) AL_JITTER
);
2510 if (x
== NULL
|| PyDict_SetItemString(d
, "JITTER", x
) < 0)
2515 x
= PyInt_FromLong((long) AL_LABEL
);
2516 if (x
== NULL
|| PyDict_SetItemString(d
, "LABEL", x
) < 0)
2520 #ifdef AL_LEFT_INPUT_ATTEN
2521 x
= PyInt_FromLong((long) AL_LEFT_INPUT_ATTEN
);
2522 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT_INPUT_ATTEN", x
) < 0)
2526 #ifdef AL_LEFT_MONITOR_ATTEN
2527 x
= PyInt_FromLong((long) AL_LEFT_MONITOR_ATTEN
);
2528 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT_MONITOR_ATTEN", x
) < 0)
2532 #ifdef AL_LEFT_SPEAKER_GAIN
2533 x
= PyInt_FromLong((long) AL_LEFT_SPEAKER_GAIN
);
2534 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT_SPEAKER_GAIN", x
) < 0)
2538 #ifdef AL_LEFT1_INPUT_ATTEN
2539 x
= PyInt_FromLong((long) AL_LEFT1_INPUT_ATTEN
);
2540 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT1_INPUT_ATTEN", x
) < 0)
2544 #ifdef AL_LEFT2_INPUT_ATTEN
2545 x
= PyInt_FromLong((long) AL_LEFT2_INPUT_ATTEN
);
2546 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT2_INPUT_ATTEN", x
) < 0)
2550 #ifdef AL_LINE_IF_TYPE
2551 x
= PyInt_FromLong((long) AL_LINE_IF_TYPE
);
2552 if (x
== NULL
|| PyDict_SetItemString(d
, "LINE_IF_TYPE", x
) < 0)
2557 x
= PyInt_FromLong((long) AL_LOCKED
);
2558 if (x
== NULL
|| PyDict_SetItemString(d
, "LOCKED", x
) < 0)
2562 #ifdef AL_MASTER_CLOCK
2563 x
= PyInt_FromLong((long) AL_MASTER_CLOCK
);
2564 if (x
== NULL
|| PyDict_SetItemString(d
, "MASTER_CLOCK", x
) < 0)
2568 #ifdef AL_MATRIX_VAL
2569 x
= PyInt_FromLong((long) AL_MATRIX_VAL
);
2570 if (x
== NULL
|| PyDict_SetItemString(d
, "MATRIX_VAL", x
) < 0)
2575 x
= PyInt_FromLong((long) AL_MAX_ERROR
);
2576 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_ERROR", x
) < 0)
2580 #ifdef AL_MAX_EVENT_PARAM
2581 x
= PyInt_FromLong((long) AL_MAX_EVENT_PARAM
);
2582 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_EVENT_PARAM", x
) < 0)
2586 #ifdef AL_MAX_PBUFSIZE
2587 x
= PyInt_FromLong((long) AL_MAX_PBUFSIZE
);
2588 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_PBUFSIZE", x
) < 0)
2593 x
= PyInt_FromLong((long) AL_MAX_PORTS
);
2594 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_PORTS", x
) < 0)
2598 #ifdef AL_MAX_RESOURCE_ID
2599 x
= PyInt_FromLong((long) AL_MAX_RESOURCE_ID
);
2600 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_RESOURCE_ID", x
) < 0)
2604 #ifdef AL_MAX_SETSIZE
2605 x
= PyInt_FromLong((long) AL_MAX_SETSIZE
);
2606 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_SETSIZE", x
) < 0)
2610 #ifdef AL_MAX_STRLEN
2611 x
= PyInt_FromLong((long) AL_MAX_STRLEN
);
2612 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_STRLEN", x
) < 0)
2617 x
= PyInt_FromLong((long) AL_MCLK_TYPE
);
2618 if (x
== NULL
|| PyDict_SetItemString(d
, "MCLK_TYPE", x
) < 0)
2622 #ifdef AL_MIC_IF_TYPE
2623 x
= PyInt_FromLong((long) AL_MIC_IF_TYPE
);
2624 if (x
== NULL
|| PyDict_SetItemString(d
, "MIC_IF_TYPE", x
) < 0)
2628 #ifdef AL_MONITOR_CTL
2629 x
= PyInt_FromLong((long) AL_MONITOR_CTL
);
2630 if (x
== NULL
|| PyDict_SetItemString(d
, "MONITOR_CTL", x
) < 0)
2634 #ifdef AL_MONITOR_OFF
2635 x
= PyInt_FromLong((long) AL_MONITOR_OFF
);
2636 if (x
== NULL
|| PyDict_SetItemString(d
, "MONITOR_OFF", x
) < 0)
2640 #ifdef AL_MONITOR_ON
2641 x
= PyInt_FromLong((long) AL_MONITOR_ON
);
2642 if (x
== NULL
|| PyDict_SetItemString(d
, "MONITOR_ON", x
) < 0)
2647 x
= PyInt_FromLong((long) AL_MONO
);
2648 if (x
== NULL
|| PyDict_SetItemString(d
, "MONO", x
) < 0)
2653 x
= PyInt_FromLong((long) AL_MUTE
);
2654 if (x
== NULL
|| PyDict_SetItemString(d
, "MUTE", x
) < 0)
2659 x
= PyInt_FromLong((long) AL_NAME
);
2660 if (x
== NULL
|| PyDict_SetItemString(d
, "NAME", x
) < 0)
2664 #ifdef AL_NEG_INFINITY
2665 x
= PyInt_FromLong((long) AL_NEG_INFINITY
);
2666 if (x
== NULL
|| PyDict_SetItemString(d
, "NEG_INFINITY", x
) < 0)
2670 #ifdef AL_NEG_INFINITY_BIT
2671 x
= PyInt_FromLong((long) AL_NEG_INFINITY_BIT
);
2672 if (x
== NULL
|| PyDict_SetItemString(d
, "NEG_INFINITY_BIT", x
) < 0)
2677 x
= PyInt_FromLong((long) AL_NO_CHANGE
);
2678 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_CHANGE", x
) < 0)
2682 #ifdef AL_NO_CHANGE_BIT
2683 x
= PyInt_FromLong((long) AL_NO_CHANGE_BIT
);
2684 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_CHANGE_BIT", x
) < 0)
2689 x
= PyInt_FromLong((long) AL_NO_ELEM
);
2690 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_ELEM", x
) < 0)
2695 x
= PyInt_FromLong((long) AL_NO_ERRORS
);
2696 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_ERRORS", x
) < 0)
2701 x
= PyInt_FromLong((long) AL_NO_OP
);
2702 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_OP", x
) < 0)
2707 x
= PyInt_FromLong((long) AL_NO_VAL
);
2708 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_VAL", x
) < 0)
2712 #ifdef AL_NULL_INTERFACE
2713 x
= PyInt_FromLong((long) AL_NULL_INTERFACE
);
2714 if (x
== NULL
|| PyDict_SetItemString(d
, "NULL_INTERFACE", x
) < 0)
2718 #ifdef AL_NULL_RESOURCE
2719 x
= PyInt_FromLong((long) AL_NULL_RESOURCE
);
2720 if (x
== NULL
|| PyDict_SetItemString(d
, "NULL_RESOURCE", x
) < 0)
2724 #ifdef AL_OPTICAL_IF_TYPE
2725 x
= PyInt_FromLong((long) AL_OPTICAL_IF_TYPE
);
2726 if (x
== NULL
|| PyDict_SetItemString(d
, "OPTICAL_IF_TYPE", x
) < 0)
2730 #ifdef AL_OUTPUT_COUNT
2731 x
= PyInt_FromLong((long) AL_OUTPUT_COUNT
);
2732 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_COUNT", x
) < 0)
2736 #ifdef AL_OUTPUT_DEVICE_TYPE
2737 x
= PyInt_FromLong((long) AL_OUTPUT_DEVICE_TYPE
);
2738 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_DEVICE_TYPE", x
) < 0)
2742 #ifdef AL_OUTPUT_HRB_TYPE
2743 x
= PyInt_FromLong((long) AL_OUTPUT_HRB_TYPE
);
2744 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_HRB_TYPE", x
) < 0)
2748 #ifdef AL_OUTPUT_PORT_TYPE
2749 x
= PyInt_FromLong((long) AL_OUTPUT_PORT_TYPE
);
2750 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_PORT_TYPE", x
) < 0)
2754 #ifdef AL_OUTPUT_RATE
2755 x
= PyInt_FromLong((long) AL_OUTPUT_RATE
);
2756 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_RATE", x
) < 0)
2761 x
= PyInt_FromLong((long) AL_PARAM_BIT
);
2762 if (x
== NULL
|| PyDict_SetItemString(d
, "PARAM_BIT", x
) < 0)
2767 x
= PyInt_FromLong((long) AL_PARAMS
);
2768 if (x
== NULL
|| PyDict_SetItemString(d
, "PARAMS", x
) < 0)
2772 #ifdef AL_PORT_COUNT
2773 x
= PyInt_FromLong((long) AL_PORT_COUNT
);
2774 if (x
== NULL
|| PyDict_SetItemString(d
, "PORT_COUNT", x
) < 0)
2779 x
= PyInt_FromLong((long) AL_PORT_TYPE
);
2780 if (x
== NULL
|| PyDict_SetItemString(d
, "PORT_TYPE", x
) < 0)
2785 x
= PyInt_FromLong((long) AL_PORTS
);
2786 if (x
== NULL
|| PyDict_SetItemString(d
, "PORTS", x
) < 0)
2790 #ifdef AL_PORTSTYLE_DIRECT
2791 x
= PyInt_FromLong((long) AL_PORTSTYLE_DIRECT
);
2792 if (x
== NULL
|| PyDict_SetItemString(d
, "PORTSTYLE_DIRECT", x
) < 0)
2796 #ifdef AL_PORTSTYLE_SERIAL
2797 x
= PyInt_FromLong((long) AL_PORTSTYLE_SERIAL
);
2798 if (x
== NULL
|| PyDict_SetItemString(d
, "PORTSTYLE_SERIAL", x
) < 0)
2802 #ifdef AL_PRINT_ERRORS
2803 x
= PyInt_FromLong((long) AL_PRINT_ERRORS
);
2804 if (x
== NULL
|| PyDict_SetItemString(d
, "PRINT_ERRORS", x
) < 0)
2809 x
= PyInt_FromLong((long) AL_PTR_ELEM
);
2810 if (x
== NULL
|| PyDict_SetItemString(d
, "PTR_ELEM", x
) < 0)
2814 #ifdef AL_RANGE_VALUE
2815 x
= PyInt_FromLong((long) AL_RANGE_VALUE
);
2816 if (x
== NULL
|| PyDict_SetItemString(d
, "RANGE_VALUE", x
) < 0)
2821 x
= PyInt_FromLong((long) AL_RATE
);
2822 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE", x
) < 0)
2826 #ifdef AL_RATE_11025
2827 x
= PyInt_FromLong((long) AL_RATE_11025
);
2828 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_11025", x
) < 0)
2832 #ifdef AL_RATE_16000
2833 x
= PyInt_FromLong((long) AL_RATE_16000
);
2834 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_16000", x
) < 0)
2838 #ifdef AL_RATE_22050
2839 x
= PyInt_FromLong((long) AL_RATE_22050
);
2840 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_22050", x
) < 0)
2844 #ifdef AL_RATE_32000
2845 x
= PyInt_FromLong((long) AL_RATE_32000
);
2846 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_32000", x
) < 0)
2850 #ifdef AL_RATE_44100
2851 x
= PyInt_FromLong((long) AL_RATE_44100
);
2852 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_44100", x
) < 0)
2856 #ifdef AL_RATE_48000
2857 x
= PyInt_FromLong((long) AL_RATE_48000
);
2858 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_48000", x
) < 0)
2863 x
= PyInt_FromLong((long) AL_RATE_8000
);
2864 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_8000", x
) < 0)
2868 #ifdef AL_RATE_AES_1
2869 x
= PyInt_FromLong((long) AL_RATE_AES_1
);
2870 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_1", x
) < 0)
2874 #ifdef AL_RATE_AES_1s
2875 x
= PyInt_FromLong((long) AL_RATE_AES_1s
);
2876 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_1s", x
) < 0)
2880 #ifdef AL_RATE_AES_2
2881 x
= PyInt_FromLong((long) AL_RATE_AES_2
);
2882 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_2", x
) < 0)
2886 #ifdef AL_RATE_AES_3
2887 x
= PyInt_FromLong((long) AL_RATE_AES_3
);
2888 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_3", x
) < 0)
2892 #ifdef AL_RATE_AES_4
2893 x
= PyInt_FromLong((long) AL_RATE_AES_4
);
2894 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_4", x
) < 0)
2898 #ifdef AL_RATE_AES_6
2899 x
= PyInt_FromLong((long) AL_RATE_AES_6
);
2900 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_6", x
) < 0)
2904 #ifdef AL_RATE_FRACTION_D
2905 x
= PyInt_FromLong((long) AL_RATE_FRACTION_D
);
2906 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_FRACTION_D", x
) < 0)
2910 #ifdef AL_RATE_FRACTION_N
2911 x
= PyInt_FromLong((long) AL_RATE_FRACTION_N
);
2912 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_FRACTION_N", x
) < 0)
2916 #ifdef AL_RATE_INPUTRATE
2917 x
= PyInt_FromLong((long) AL_RATE_INPUTRATE
);
2918 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_INPUTRATE", x
) < 0)
2922 #ifdef AL_RATE_NO_DIGITAL_INPUT
2923 x
= PyInt_FromLong((long) AL_RATE_NO_DIGITAL_INPUT
);
2924 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_NO_DIGITAL_INPUT", x
) < 0)
2928 #ifdef AL_RATE_UNACQUIRED
2929 x
= PyInt_FromLong((long) AL_RATE_UNACQUIRED
);
2930 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_UNACQUIRED", x
) < 0)
2934 #ifdef AL_RATE_UNDEFINED
2935 x
= PyInt_FromLong((long) AL_RATE_UNDEFINED
);
2936 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_UNDEFINED", x
) < 0)
2941 x
= PyInt_FromLong((long) AL_REF_0DBV
);
2942 if (x
== NULL
|| PyDict_SetItemString(d
, "REF_0DBV", x
) < 0)
2947 x
= PyInt_FromLong((long) AL_REF_NONE
);
2948 if (x
== NULL
|| PyDict_SetItemString(d
, "REF_NONE", x
) < 0)
2952 #ifdef AL_RESERVED1_TYPE
2953 x
= PyInt_FromLong((long) AL_RESERVED1_TYPE
);
2954 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED1_TYPE", x
) < 0)
2958 #ifdef AL_RESERVED2_TYPE
2959 x
= PyInt_FromLong((long) AL_RESERVED2_TYPE
);
2960 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED2_TYPE", x
) < 0)
2964 #ifdef AL_RESERVED3_TYPE
2965 x
= PyInt_FromLong((long) AL_RESERVED3_TYPE
);
2966 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED3_TYPE", x
) < 0)
2970 #ifdef AL_RESERVED4_TYPE
2971 x
= PyInt_FromLong((long) AL_RESERVED4_TYPE
);
2972 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED4_TYPE", x
) < 0)
2977 x
= PyInt_FromLong((long) AL_RESOURCE
);
2978 if (x
== NULL
|| PyDict_SetItemString(d
, "RESOURCE", x
) < 0)
2982 #ifdef AL_RESOURCE_ELEM
2983 x
= PyInt_FromLong((long) AL_RESOURCE_ELEM
);
2984 if (x
== NULL
|| PyDict_SetItemString(d
, "RESOURCE_ELEM", x
) < 0)
2988 #ifdef AL_RESOURCE_TYPE
2989 x
= PyInt_FromLong((long) AL_RESOURCE_TYPE
);
2990 if (x
== NULL
|| PyDict_SetItemString(d
, "RESOURCE_TYPE", x
) < 0)
2994 #ifdef AL_RIGHT_INPUT_ATTEN
2995 x
= PyInt_FromLong((long) AL_RIGHT_INPUT_ATTEN
);
2996 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT_INPUT_ATTEN", x
) < 0)
3000 #ifdef AL_RIGHT_MONITOR_ATTEN
3001 x
= PyInt_FromLong((long) AL_RIGHT_MONITOR_ATTEN
);
3002 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT_MONITOR_ATTEN", x
) < 0)
3006 #ifdef AL_RIGHT_SPEAKER_GAIN
3007 x
= PyInt_FromLong((long) AL_RIGHT_SPEAKER_GAIN
);
3008 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT_SPEAKER_GAIN", x
) < 0)
3012 #ifdef AL_RIGHT1_INPUT_ATTEN
3013 x
= PyInt_FromLong((long) AL_RIGHT1_INPUT_ATTEN
);
3014 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT1_INPUT_ATTEN", x
) < 0)
3018 #ifdef AL_RIGHT2_INPUT_ATTEN
3019 x
= PyInt_FromLong((long) AL_RIGHT2_INPUT_ATTEN
);
3020 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT2_INPUT_ATTEN", x
) < 0)
3024 #ifdef AL_SAMPFMT_DOUBLE
3025 x
= PyInt_FromLong((long) AL_SAMPFMT_DOUBLE
);
3026 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPFMT_DOUBLE", x
) < 0)
3030 #ifdef AL_SAMPFMT_FLOAT
3031 x
= PyInt_FromLong((long) AL_SAMPFMT_FLOAT
);
3032 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPFMT_FLOAT", x
) < 0)
3036 #ifdef AL_SAMPFMT_TWOSCOMP
3037 x
= PyInt_FromLong((long) AL_SAMPFMT_TWOSCOMP
);
3038 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPFMT_TWOSCOMP", x
) < 0)
3043 x
= PyInt_FromLong((long) AL_SAMPLE_16
);
3044 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLE_16", x
) < 0)
3049 x
= PyInt_FromLong((long) AL_SAMPLE_24
);
3050 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLE_24", x
) < 0)
3055 x
= PyInt_FromLong((long) AL_SAMPLE_8
);
3056 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLE_8", x
) < 0)
3060 #ifdef AL_SCALAR_VAL
3061 x
= PyInt_FromLong((long) AL_SCALAR_VAL
);
3062 if (x
== NULL
|| PyDict_SetItemString(d
, "SCALAR_VAL", x
) < 0)
3067 x
= PyInt_FromLong((long) AL_SET_VAL
);
3068 if (x
== NULL
|| PyDict_SetItemString(d
, "SET_VAL", x
) < 0)
3072 #ifdef AL_SHORT_NAME
3073 x
= PyInt_FromLong((long) AL_SHORT_NAME
);
3074 if (x
== NULL
|| PyDict_SetItemString(d
, "SHORT_NAME", x
) < 0)
3078 #ifdef AL_SMPTE272M_IF_TYPE
3079 x
= PyInt_FromLong((long) AL_SMPTE272M_IF_TYPE
);
3080 if (x
== NULL
|| PyDict_SetItemString(d
, "SMPTE272M_IF_TYPE", x
) < 0)
3085 x
= PyInt_FromLong((long) AL_SOURCE
);
3086 if (x
== NULL
|| PyDict_SetItemString(d
, "SOURCE", x
) < 0)
3090 #ifdef AL_SPEAKER_IF_TYPE
3091 x
= PyInt_FromLong((long) AL_SPEAKER_IF_TYPE
);
3092 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_IF_TYPE", x
) < 0)
3096 #ifdef AL_SPEAKER_MUTE_CTL
3097 x
= PyInt_FromLong((long) AL_SPEAKER_MUTE_CTL
);
3098 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_MUTE_CTL", x
) < 0)
3102 #ifdef AL_SPEAKER_MUTE_OFF
3103 x
= PyInt_FromLong((long) AL_SPEAKER_MUTE_OFF
);
3104 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_MUTE_OFF", x
) < 0)
3108 #ifdef AL_SPEAKER_MUTE_ON
3109 x
= PyInt_FromLong((long) AL_SPEAKER_MUTE_ON
);
3110 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_MUTE_ON", x
) < 0)
3114 #ifdef AL_SPEAKER_PLUS_LINE_IF_TYPE
3115 x
= PyInt_FromLong((long) AL_SPEAKER_PLUS_LINE_IF_TYPE
);
3116 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_PLUS_LINE_IF_TYPE", x
) < 0)
3121 x
= PyInt_FromLong((long) AL_STEREO
);
3122 if (x
== NULL
|| PyDict_SetItemString(d
, "STEREO", x
) < 0)
3126 #ifdef AL_STRING_VAL
3127 x
= PyInt_FromLong((long) AL_STRING_VAL
);
3128 if (x
== NULL
|| PyDict_SetItemString(d
, "STRING_VAL", x
) < 0)
3133 x
= PyInt_FromLong((long) AL_SUBSYSTEM
);
3134 if (x
== NULL
|| PyDict_SetItemString(d
, "SUBSYSTEM", x
) < 0)
3138 #ifdef AL_SUBSYSTEM_TYPE
3139 x
= PyInt_FromLong((long) AL_SUBSYSTEM_TYPE
);
3140 if (x
== NULL
|| PyDict_SetItemString(d
, "SUBSYSTEM_TYPE", x
) < 0)
3144 #ifdef AL_SYNC_INPUT_TO_AES
3145 x
= PyInt_FromLong((long) AL_SYNC_INPUT_TO_AES
);
3146 if (x
== NULL
|| PyDict_SetItemString(d
, "SYNC_INPUT_TO_AES", x
) < 0)
3150 #ifdef AL_SYNC_OUTPUT_TO_AES
3151 x
= PyInt_FromLong((long) AL_SYNC_OUTPUT_TO_AES
);
3152 if (x
== NULL
|| PyDict_SetItemString(d
, "SYNC_OUTPUT_TO_AES", x
) < 0)
3157 x
= PyInt_FromLong((long) AL_SYSTEM
);
3158 if (x
== NULL
|| PyDict_SetItemString(d
, "SYSTEM", x
) < 0)
3162 #ifdef AL_SYSTEM_TYPE
3163 x
= PyInt_FromLong((long) AL_SYSTEM_TYPE
);
3164 if (x
== NULL
|| PyDict_SetItemString(d
, "SYSTEM_TYPE", x
) < 0)
3168 #ifdef AL_TEST_IF_TYPE
3169 x
= PyInt_FromLong((long) AL_TEST_IF_TYPE
);
3170 if (x
== NULL
|| PyDict_SetItemString(d
, "TEST_IF_TYPE", x
) < 0)
3175 x
= PyInt_FromLong((long) AL_TYPE
);
3176 if (x
== NULL
|| PyDict_SetItemString(d
, "TYPE", x
) < 0)
3181 x
= PyInt_FromLong((long) AL_TYPE_BIT
);
3182 if (x
== NULL
|| PyDict_SetItemString(d
, "TYPE_BIT", x
) < 0)
3186 #ifdef AL_UNUSED_COUNT
3187 x
= PyInt_FromLong((long) AL_UNUSED_COUNT
);
3188 if (x
== NULL
|| PyDict_SetItemString(d
, "UNUSED_COUNT", x
) < 0)
3192 #ifdef AL_UNUSED_PORTS
3193 x
= PyInt_FromLong((long) AL_UNUSED_PORTS
);
3194 if (x
== NULL
|| PyDict_SetItemString(d
, "UNUSED_PORTS", x
) < 0)
3198 #ifdef AL_VARIABLE_MCLK_TYPE
3199 x
= PyInt_FromLong((long) AL_VARIABLE_MCLK_TYPE
);
3200 if (x
== NULL
|| PyDict_SetItemString(d
, "VARIABLE_MCLK_TYPE", x
) < 0)
3204 #ifdef AL_VECTOR_VAL
3205 x
= PyInt_FromLong((long) AL_VECTOR_VAL
);
3206 if (x
== NULL
|| PyDict_SetItemString(d
, "VECTOR_VAL", x
) < 0)
3210 #ifdef AL_VIDEO_MCLK_TYPE
3211 x
= PyInt_FromLong((long) AL_VIDEO_MCLK_TYPE
);
3212 if (x
== NULL
|| PyDict_SetItemString(d
, "VIDEO_MCLK_TYPE", x
) < 0)
3217 x
= PyInt_FromLong((long) AL_WORDSIZE
);
3218 if (x
== NULL
|| PyDict_SetItemString(d
, "WORDSIZE", x
) < 0)
3223 #ifdef AL_NO_ELEM /* IRIX 6 */
3224 (void) alSetErrorHandler(ErrorHandler
);
3225 #endif /* AL_NO_ELEM */
3226 #ifdef OLD_INTERFACE
3227 (void) ALseterrorhandler(ErrorHandler
);
3228 #endif /* OLD_INTERFACE */