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
= Py_BuildValue("(OO)", 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 v
= PyList_New(npvs
);
1486 for (i
= 0; i
< npvs
; i
++) {
1487 if (pvs
[i
].sizeOut
< 0) {
1489 PyOS_snprintf(buf
, sizeof(buf
),
1490 "problem with param %d", i
);
1491 PyErr_SetString(ErrorObject
, buf
);
1494 switch (pinfo
[i
].valueType
) {
1500 item
= PyString_FromString(pvs
[i
].value
.ptr
);
1501 PyMem_DEL(pvs
[i
].value
.ptr
);
1504 /* XXXX this is not right */
1505 pvs
[i
].sizeOut
*= pvs
[i
].size2Out
;
1509 item
= PyList_New(pvs
[i
].sizeOut
);
1510 for (j
= 0; j
< pvs
[i
].sizeOut
; j
++) {
1511 switch (pinfo
[i
].elementType
) {
1513 case AL_RESOURCE_ELEM
:
1515 PyList_SetItem(item
, j
, PyInt_FromLong((long) ((int *) pvs
[i
].value
.ptr
)[j
]));
1518 PyList_SetItem(item
, j
, PyLong_FromLongLong(((long long *) pvs
[i
].value
.ptr
)[j
]));
1521 PyList_SetItem(item
, j
, PyFloat_FromDouble(alFixedToDouble(((long long *) pvs
[i
].value
.ptr
)[j
])));
1524 PyErr_SetString(ErrorObject
, "internal error");
1528 PyMem_DEL(pvs
[i
].value
.ptr
);
1531 item
= param2python(resource
, pvs
[i
].param
, pvs
[i
].value
, &pinfo
[i
]);
1534 if (PyErr_Occurred() ||
1535 PyList_SetItem(v
, i
, Py_BuildValue("(iO)", pvs
[i
].param
,
1555 PyDoc_STRVAR(al_SetParams__doc__
,
1556 "alSetParams: set the values of audio resource parameters.");
1559 al_SetParams(PyObject
*self
, PyObject
*args
)
1567 if (!PyArg_ParseTuple(args
, "iO!:SetParams", &resource
, &PyList_Type
, &pvslist
))
1569 npvs
= python2params(resource
, -1, pvslist
, &pvs
, &pinfo
);
1573 if (alSetParams(resource
, pvs
, npvs
) < 0)
1577 for (i
= 0; i
< npvs
; i
++) {
1578 switch (pinfo
[i
].valueType
) {
1581 PyMem_DEL(pvs
[i
].value
.ptr
);
1592 /* XXXX we should clean up everything */
1600 PyDoc_STRVAR(al_QueryValues__doc__
,
1601 "alQueryValues: get the set of possible values for a parameter.");
1604 al_QueryValues(PyObject
*self
, PyObject
*args
)
1606 int resource
, param
;
1607 ALvalue
*return_set
= NULL
;
1608 int setsize
= 32, qualsize
= 0, nvals
, i
;
1611 ALparamInfo
*qualinfo
= NULL
;
1612 PyObject
*qualobj
= NULL
;
1613 PyObject
*res
= NULL
, *item
;
1615 if (!PyArg_ParseTuple(args
, "ii|O!:QueryValues", &resource
, ¶m
,
1616 &PyList_Type
, &qualobj
))
1618 if (qualobj
!= NULL
) {
1619 qualsize
= python2params(resource
, param
, qualobj
, &quals
, &qualinfo
);
1624 return_set
= PyMem_NEW(ALvalue
, setsize
);
1625 if (return_set
== NULL
) {
1631 nvals
= alQueryValues(resource
, param
, return_set
, setsize
, quals
, qualsize
);
1634 if (nvals
> setsize
) {
1636 PyMem_RESIZE(return_set
, ALvalue
, setsize
);
1637 if (return_set
== NULL
) {
1644 if (alGetParamInfo(resource
, param
, &pinfo
) < 0)
1647 res
= PyList_New(nvals
);
1650 for (i
= 0; i
< nvals
; i
++) {
1651 item
= param2python(resource
, param
, return_set
[i
], &pinfo
);
1653 PyList_SetItem(res
, i
, item
) < 0) {
1662 PyMem_DEL(return_set
);
1664 for (i
= 0; i
< qualsize
; i
++) {
1665 switch (qualinfo
[i
].valueType
) {
1668 PyMem_DEL(quals
[i
].value
.ptr
);
1673 PyMem_DEL(qualinfo
);
1679 PyDoc_STRVAR(al_GetParamInfo__doc__
,
1680 "alGetParamInfo: get information about a parameter on "
1681 "a particular audio resource.");
1684 al_GetParamInfo(PyObject
*self
, PyObject
*args
)
1688 PyObject
*v
, *item
;;
1690 if (!PyArg_ParseTuple(args
, "ii:GetParamInfo", &res
, ¶m
))
1692 if (alGetParamInfo(res
, param
, &pinfo
) < 0)
1696 item
= PyInt_FromLong((long) pinfo
.resource
);
1697 PyDict_SetItemString(v
, "resource", item
);
1700 item
= PyInt_FromLong((long) pinfo
.param
);
1701 PyDict_SetItemString(v
, "param", item
);
1704 item
= PyInt_FromLong((long) pinfo
.valueType
);
1705 PyDict_SetItemString(v
, "valueType", item
);
1708 if (pinfo
.valueType
!= AL_NO_VAL
&& pinfo
.valueType
!= AL_SCALAR_VAL
) {
1709 /* multiple values */
1710 item
= PyInt_FromLong((long) pinfo
.maxElems
);
1711 PyDict_SetItemString(v
, "maxElems", item
);
1714 if (pinfo
.valueType
== AL_MATRIX_VAL
) {
1716 item
= PyInt_FromLong((long) pinfo
.maxElems2
);
1717 PyDict_SetItemString(v
, "maxElems2", item
);
1722 item
= PyInt_FromLong((long) pinfo
.elementType
);
1723 PyDict_SetItemString(v
, "elementType", item
);
1726 item
= PyString_FromString(pinfo
.name
);
1727 PyDict_SetItemString(v
, "name", item
);
1730 item
= param2python(res
, param
, pinfo
.initial
, &pinfo
);
1731 PyDict_SetItemString(v
, "initial", item
);
1734 if (pinfo
.elementType
!= AL_ENUM_ELEM
&&
1735 pinfo
.elementType
!= AL_RESOURCE_ELEM
&&
1736 pinfo
.elementType
!= AL_CHAR_ELEM
) {
1738 item
= param2python(res
, param
, pinfo
.min
, &pinfo
);
1739 PyDict_SetItemString(v
, "min", item
);
1742 item
= param2python(res
, param
, pinfo
.max
, &pinfo
);
1743 PyDict_SetItemString(v
, "max", item
);
1746 item
= param2python(res
, param
, pinfo
.minDelta
, &pinfo
);
1747 PyDict_SetItemString(v
, "minDelta", item
);
1750 item
= param2python(res
, param
, pinfo
.maxDelta
, &pinfo
);
1751 PyDict_SetItemString(v
, "maxDelta", item
);
1754 item
= PyInt_FromLong((long) pinfo
.specialVals
);
1755 PyDict_SetItemString(v
, "specialVals", item
);
1762 PyDoc_STRVAR(al_GetResourceByName__doc__
,
1763 "alGetResourceByName: find an audio resource by name.");
1766 al_GetResourceByName(PyObject
*self
, PyObject
*args
)
1768 int res
, start_res
, type
;
1771 if (!PyArg_ParseTuple(args
, "isi:GetResourceByName", &start_res
, &name
, &type
))
1773 if ((res
= alGetResourceByName(start_res
, name
, type
)) == 0)
1775 return PyInt_FromLong((long) res
);
1778 PyDoc_STRVAR(al_IsSubtype__doc__
,
1779 "alIsSubtype: indicate if one resource type is a subtype of another.");
1782 al_IsSubtype(PyObject
*self
, PyObject
*args
)
1786 if (!PyArg_ParseTuple(args
, "ii:IsSubtype", &type
, &subtype
))
1788 return PyInt_FromLong((long) alIsSubtype(type
, subtype
));
1791 PyDoc_STRVAR(al_SetErrorHandler__doc__
, "");
1794 al_SetErrorHandler(PyObject
*self
, PyObject
*args
)
1797 if (!PyArg_ParseTuple(args
, ":SetErrorHandler"))
1803 #endif /* AL_NO_ELEM */
1805 #ifdef OLD_INTERFACE
1808 al_openport(PyObject
*self
, PyObject
*args
)
1812 alcobject
*config
= NULL
;
1814 if (!PyArg_ParseTuple(args
, "ss|O!:OpenPort", &name
, &dir
, &Alctype
, &config
))
1816 if ((port
= ALopenport(name
, dir
, config
? config
->config
: NULL
)) == NULL
)
1818 return newalpobject(port
);
1822 al_newconfig(PyObject
*self
, PyObject
*args
)
1826 if (!PyArg_ParseTuple(args
, ":NewConfig"))
1828 if ((config
= ALnewconfig ()) == NULL
)
1830 return newalcobject(config
);
1834 al_queryparams(PyObject
*self
, PyObject
*args
)
1843 if (!PyArg_ParseTuple(args
, "l:queryparams", &device
))
1845 if ((length
= ALqueryparams(device
, PVdummy
, 2L)) == -1)
1847 if ((PVbuffer
= PyMem_NEW(long, length
)) == NULL
)
1848 return PyErr_NoMemory();
1849 if (ALqueryparams(device
, PVbuffer
, length
) >= 0 &&
1850 (v
= PyList_New((int)length
)) != NULL
) {
1851 for (i
= 0; i
< length
; i
++)
1852 PyList_SetItem(v
, i
, PyInt_FromLong(PVbuffer
[i
]));
1854 PyMem_DEL(PVbuffer
);
1859 doParams(PyObject
*args
, int (*func
)(long, long *, long), int modified
)
1867 if (!PyArg_ParseTuple(args
, "lO!", &device
, &PyList_Type
, &list
))
1869 length
= PyList_Size(list
);
1870 PVbuffer
= PyMem_NEW(long, length
);
1871 if (PVbuffer
== NULL
)
1872 return PyErr_NoMemory();
1873 for (i
= 0; i
< length
; i
++) {
1874 v
= PyList_GetItem(list
, i
);
1875 if (!PyInt_Check(v
)) {
1876 PyMem_DEL(PVbuffer
);
1877 PyErr_BadArgument();
1880 PVbuffer
[i
] = PyInt_AsLong(v
);
1883 if ((*func
)(device
, PVbuffer
, length
) == -1) {
1884 PyMem_DEL(PVbuffer
);
1889 for (i
= 0; i
< length
; i
++)
1890 PyList_SetItem(list
, i
, PyInt_FromLong(PVbuffer
[i
]));
1893 PyMem_DEL(PVbuffer
);
1900 al_getparams(PyObject
*self
, PyObject
*args
)
1902 return doParams(args
, ALgetparams
, 1);
1906 al_setparams(PyObject
*self
, PyObject
*args
)
1908 return doParams(args
, ALsetparams
, 0);
1912 al_getname(PyObject
*self
, PyObject
*args
)
1914 long device
, descriptor
;
1917 if (!PyArg_ParseTuple(args
, "ll:getname", &device
, &descriptor
))
1919 if ((name
= ALgetname(device
, descriptor
)) == NULL
)
1921 return PyString_FromString(name
);
1925 al_getdefault(PyObject
*self
, PyObject
*args
)
1927 long device
, descriptor
, value
;
1929 if (!PyArg_ParseTuple(args
, "ll:getdefault", &device
, &descriptor
))
1931 if ((value
= ALgetdefault(device
, descriptor
)) == -1)
1933 return PyLong_FromLong(value
);
1937 al_getminmax(PyObject
*self
, PyObject
*args
)
1939 long device
, descriptor
, min
, max
;
1941 if (!PyArg_ParseTuple(args
, "ll:getminmax", &device
, &descriptor
))
1945 if (ALgetminmax(device
, descriptor
, &min
, &max
) == -1)
1947 return Py_BuildValue("ll", min
, max
);
1950 #endif /* OLD_INTERFACE */
1952 /* List of methods defined in the module */
1954 static struct PyMethodDef al_methods
[] = {
1955 #ifdef AL_NO_ELEM /* IRIX 6 */
1956 {"NewConfig", (PyCFunction
)al_NewConfig
, METH_VARARGS
, al_NewConfig__doc__
},
1957 {"OpenPort", (PyCFunction
)al_OpenPort
, METH_VARARGS
, al_OpenPort__doc__
},
1958 {"Connect", (PyCFunction
)al_Connect
, METH_VARARGS
, al_Connect__doc__
},
1959 {"Disconnect", (PyCFunction
)al_Disconnect
, METH_VARARGS
, al_Disconnect__doc__
},
1960 {"GetParams", (PyCFunction
)al_GetParams
, METH_VARARGS
, al_GetParams__doc__
},
1961 {"SetParams", (PyCFunction
)al_SetParams
, METH_VARARGS
, al_SetParams__doc__
},
1962 {"QueryValues", (PyCFunction
)al_QueryValues
, METH_VARARGS
, al_QueryValues__doc__
},
1963 {"GetParamInfo", (PyCFunction
)al_GetParamInfo
, METH_VARARGS
, al_GetParamInfo__doc__
},
1964 {"GetResourceByName", (PyCFunction
)al_GetResourceByName
, METH_VARARGS
, al_GetResourceByName__doc__
},
1965 {"IsSubtype", (PyCFunction
)al_IsSubtype
, METH_VARARGS
, al_IsSubtype__doc__
},
1967 /* this one not supported */
1968 {"SetErrorHandler", (PyCFunction
)al_SetErrorHandler
, METH_VARARGS
, al_SetErrorHandler__doc__
},
1970 #endif /* AL_NO_ELEM */
1971 #ifdef OLD_INTERFACE
1972 {"openport", (PyCFunction
)al_openport
, METH_VARARGS
},
1973 {"newconfig", (PyCFunction
)al_newconfig
, METH_VARARGS
},
1974 {"queryparams", (PyCFunction
)al_queryparams
, METH_VARARGS
},
1975 {"getparams", (PyCFunction
)al_getparams
, METH_VARARGS
},
1976 {"setparams", (PyCFunction
)al_setparams
, METH_VARARGS
},
1977 {"getname", (PyCFunction
)al_getname
, METH_VARARGS
},
1978 {"getdefault", (PyCFunction
)al_getdefault
, METH_VARARGS
},
1979 {"getminmax", (PyCFunction
)al_getminmax
, METH_VARARGS
},
1980 #endif /* OLD_INTERFACE */
1982 {NULL
, (PyCFunction
)NULL
, 0, NULL
} /* sentinel */
1986 /* Initialization function for the module (*must* be called inital) */
1988 PyDoc_STRVAR(al_module_documentation
, "");
1993 PyObject
*m
, *d
, *x
;
1995 /* Create the module and add the functions */
1996 m
= Py_InitModule4("al", al_methods
,
1997 al_module_documentation
,
1998 (PyObject
*)NULL
,PYTHON_API_VERSION
);
2000 /* Add some symbolic constants to the module */
2001 d
= PyModule_GetDict(m
);
2002 ErrorObject
= PyErr_NewException("al.error", NULL
, NULL
);
2003 PyDict_SetItemString(d
, "error", ErrorObject
);
2005 /* XXXX Add constants here */
2007 x
= PyInt_FromLong((long) AL_4CHANNEL
);
2008 if (x
== NULL
|| PyDict_SetItemString(d
, "FOURCHANNEL", x
) < 0)
2012 #ifdef AL_ADAT_IF_TYPE
2013 x
= PyInt_FromLong((long) AL_ADAT_IF_TYPE
);
2014 if (x
== NULL
|| PyDict_SetItemString(d
, "ADAT_IF_TYPE", x
) < 0)
2018 #ifdef AL_ADAT_MCLK_TYPE
2019 x
= PyInt_FromLong((long) AL_ADAT_MCLK_TYPE
);
2020 if (x
== NULL
|| PyDict_SetItemString(d
, "ADAT_MCLK_TYPE", x
) < 0)
2024 #ifdef AL_AES_IF_TYPE
2025 x
= PyInt_FromLong((long) AL_AES_IF_TYPE
);
2026 if (x
== NULL
|| PyDict_SetItemString(d
, "AES_IF_TYPE", x
) < 0)
2030 #ifdef AL_AES_MCLK_TYPE
2031 x
= PyInt_FromLong((long) AL_AES_MCLK_TYPE
);
2032 if (x
== NULL
|| PyDict_SetItemString(d
, "AES_MCLK_TYPE", x
) < 0)
2036 #ifdef AL_ANALOG_IF_TYPE
2037 x
= PyInt_FromLong((long) AL_ANALOG_IF_TYPE
);
2038 if (x
== NULL
|| PyDict_SetItemString(d
, "ANALOG_IF_TYPE", x
) < 0)
2043 x
= PyInt_FromLong((long) AL_ASSOCIATE
);
2044 if (x
== NULL
|| PyDict_SetItemString(d
, "ASSOCIATE", x
) < 0)
2048 #ifdef AL_BAD_BUFFER_NULL
2049 x
= PyInt_FromLong((long) AL_BAD_BUFFER_NULL
);
2050 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFER_NULL", x
) < 0)
2054 #ifdef AL_BAD_BUFFERLENGTH
2055 x
= PyInt_FromLong((long) AL_BAD_BUFFERLENGTH
);
2056 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH", x
) < 0)
2060 #ifdef AL_BAD_BUFFERLENGTH_NEG
2061 x
= PyInt_FromLong((long) AL_BAD_BUFFERLENGTH_NEG
);
2062 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH_NEG", x
) < 0)
2066 #ifdef AL_BAD_BUFFERLENGTH_ODD
2067 x
= PyInt_FromLong((long) AL_BAD_BUFFERLENGTH_ODD
);
2068 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH_ODD", x
) < 0)
2072 #ifdef AL_BAD_CHANNELS
2073 x
= PyInt_FromLong((long) AL_BAD_CHANNELS
);
2074 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_CHANNELS", x
) < 0)
2078 #ifdef AL_BAD_CONFIG
2079 x
= PyInt_FromLong((long) AL_BAD_CONFIG
);
2080 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_CONFIG", x
) < 0)
2084 #ifdef AL_BAD_COUNT_NEG
2085 x
= PyInt_FromLong((long) AL_BAD_COUNT_NEG
);
2086 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_COUNT_NEG", x
) < 0)
2090 #ifdef AL_BAD_DEVICE
2091 x
= PyInt_FromLong((long) AL_BAD_DEVICE
);
2092 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_DEVICE", x
) < 0)
2096 #ifdef AL_BAD_DEVICE_ACCESS
2097 x
= PyInt_FromLong((long) AL_BAD_DEVICE_ACCESS
);
2098 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_DEVICE_ACCESS", x
) < 0)
2102 #ifdef AL_BAD_DIRECTION
2103 x
= PyInt_FromLong((long) AL_BAD_DIRECTION
);
2104 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_DIRECTION", x
) < 0)
2108 #ifdef AL_BAD_FILLPOINT
2109 x
= PyInt_FromLong((long) AL_BAD_FILLPOINT
);
2110 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_FILLPOINT", x
) < 0)
2114 #ifdef AL_BAD_FLOATMAX
2115 x
= PyInt_FromLong((long) AL_BAD_FLOATMAX
);
2116 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_FLOATMAX", x
) < 0)
2120 #ifdef AL_BAD_ILLEGAL_STATE
2121 x
= PyInt_FromLong((long) AL_BAD_ILLEGAL_STATE
);
2122 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_ILLEGAL_STATE", x
) < 0)
2126 #ifdef AL_BAD_NO_PORTS
2127 x
= PyInt_FromLong((long) AL_BAD_NO_PORTS
);
2128 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NO_PORTS", x
) < 0)
2132 #ifdef AL_BAD_NOT_FOUND
2133 x
= PyInt_FromLong((long) AL_BAD_NOT_FOUND
);
2134 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NOT_FOUND", x
) < 0)
2138 #ifdef AL_BAD_NOT_IMPLEMENTED
2139 x
= PyInt_FromLong((long) AL_BAD_NOT_IMPLEMENTED
);
2140 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NOT_IMPLEMENTED", x
) < 0)
2144 #ifdef AL_BAD_OUT_OF_MEM
2145 x
= PyInt_FromLong((long) AL_BAD_OUT_OF_MEM
);
2146 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_OUT_OF_MEM", x
) < 0)
2151 x
= PyInt_FromLong((long) AL_BAD_PARAM
);
2152 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PARAM", x
) < 0)
2156 #ifdef AL_BAD_PERMISSIONS
2157 x
= PyInt_FromLong((long) AL_BAD_PERMISSIONS
);
2158 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PERMISSIONS", x
) < 0)
2163 x
= PyInt_FromLong((long) AL_BAD_PORT
);
2164 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PORT", x
) < 0)
2168 #ifdef AL_BAD_PORTSTYLE
2169 x
= PyInt_FromLong((long) AL_BAD_PORTSTYLE
);
2170 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PORTSTYLE", x
) < 0)
2174 #ifdef AL_BAD_PVBUFFER
2175 x
= PyInt_FromLong((long) AL_BAD_PVBUFFER
);
2176 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PVBUFFER", x
) < 0)
2181 x
= PyInt_FromLong((long) AL_BAD_QSIZE
);
2182 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_QSIZE", x
) < 0)
2187 x
= PyInt_FromLong((long) AL_BAD_RATE
);
2188 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_RATE", x
) < 0)
2192 #ifdef AL_BAD_RESOURCE
2193 x
= PyInt_FromLong((long) AL_BAD_RESOURCE
);
2194 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_RESOURCE", x
) < 0)
2198 #ifdef AL_BAD_SAMPFMT
2199 x
= PyInt_FromLong((long) AL_BAD_SAMPFMT
);
2200 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_SAMPFMT", x
) < 0)
2204 #ifdef AL_BAD_TRANSFER_SIZE
2205 x
= PyInt_FromLong((long) AL_BAD_TRANSFER_SIZE
);
2206 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_TRANSFER_SIZE", x
) < 0)
2211 x
= PyInt_FromLong((long) AL_BAD_WIDTH
);
2212 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_WIDTH", x
) < 0)
2216 #ifdef AL_CHANNEL_MODE
2217 x
= PyInt_FromLong((long) AL_CHANNEL_MODE
);
2218 if (x
== NULL
|| PyDict_SetItemString(d
, "CHANNEL_MODE", x
) < 0)
2223 x
= PyInt_FromLong((long) AL_CHANNELS
);
2224 if (x
== NULL
|| PyDict_SetItemString(d
, "CHANNELS", x
) < 0)
2229 x
= PyInt_FromLong((long) AL_CHAR_ELEM
);
2230 if (x
== NULL
|| PyDict_SetItemString(d
, "CHAR_ELEM", x
) < 0)
2235 x
= PyInt_FromLong((long) AL_CLOCK_GEN
);
2236 if (x
== NULL
|| PyDict_SetItemString(d
, "CLOCK_GEN", x
) < 0)
2240 #ifdef AL_CLOCKGEN_TYPE
2241 x
= PyInt_FromLong((long) AL_CLOCKGEN_TYPE
);
2242 if (x
== NULL
|| PyDict_SetItemString(d
, "CLOCKGEN_TYPE", x
) < 0)
2247 x
= PyInt_FromLong((long) AL_CONNECT
);
2248 if (x
== NULL
|| PyDict_SetItemString(d
, "CONNECT", x
) < 0)
2252 #ifdef AL_CONNECTION_TYPE
2253 x
= PyInt_FromLong((long) AL_CONNECTION_TYPE
);
2254 if (x
== NULL
|| PyDict_SetItemString(d
, "CONNECTION_TYPE", x
) < 0)
2258 #ifdef AL_CONNECTIONS
2259 x
= PyInt_FromLong((long) AL_CONNECTIONS
);
2260 if (x
== NULL
|| PyDict_SetItemString(d
, "CONNECTIONS", x
) < 0)
2264 #ifdef AL_CRYSTAL_MCLK_TYPE
2265 x
= PyInt_FromLong((long) AL_CRYSTAL_MCLK_TYPE
);
2266 if (x
== NULL
|| PyDict_SetItemString(d
, "CRYSTAL_MCLK_TYPE", x
) < 0)
2270 #ifdef AL_DEFAULT_DEVICE
2271 x
= PyInt_FromLong((long) AL_DEFAULT_DEVICE
);
2272 if (x
== NULL
|| PyDict_SetItemString(d
, "DEFAULT_DEVICE", x
) < 0)
2276 #ifdef AL_DEFAULT_INPUT
2277 x
= PyInt_FromLong((long) AL_DEFAULT_INPUT
);
2278 if (x
== NULL
|| PyDict_SetItemString(d
, "DEFAULT_INPUT", x
) < 0)
2282 #ifdef AL_DEFAULT_OUTPUT
2283 x
= PyInt_FromLong((long) AL_DEFAULT_OUTPUT
);
2284 if (x
== NULL
|| PyDict_SetItemString(d
, "DEFAULT_OUTPUT", x
) < 0)
2289 x
= PyInt_FromLong((long) AL_DEST
);
2290 if (x
== NULL
|| PyDict_SetItemString(d
, "DEST", x
) < 0)
2294 #ifdef AL_DEVICE_TYPE
2295 x
= PyInt_FromLong((long) AL_DEVICE_TYPE
);
2296 if (x
== NULL
|| PyDict_SetItemString(d
, "DEVICE_TYPE", x
) < 0)
2301 x
= PyInt_FromLong((long) AL_DEVICES
);
2302 if (x
== NULL
|| PyDict_SetItemString(d
, "DEVICES", x
) < 0)
2306 #ifdef AL_DIGITAL_IF_TYPE
2307 x
= PyInt_FromLong((long) AL_DIGITAL_IF_TYPE
);
2308 if (x
== NULL
|| PyDict_SetItemString(d
, "DIGITAL_IF_TYPE", x
) < 0)
2312 #ifdef AL_DIGITAL_INPUT_RATE
2313 x
= PyInt_FromLong((long) AL_DIGITAL_INPUT_RATE
);
2314 if (x
== NULL
|| PyDict_SetItemString(d
, "DIGITAL_INPUT_RATE", x
) < 0)
2318 #ifdef AL_DISCONNECT
2319 x
= PyInt_FromLong((long) AL_DISCONNECT
);
2320 if (x
== NULL
|| PyDict_SetItemString(d
, "DISCONNECT", x
) < 0)
2325 x
= PyInt_FromLong((long) AL_ENUM_ELEM
);
2326 if (x
== NULL
|| PyDict_SetItemString(d
, "ENUM_ELEM", x
) < 0)
2330 #ifdef AL_ENUM_VALUE
2331 x
= PyInt_FromLong((long) AL_ENUM_VALUE
);
2332 if (x
== NULL
|| PyDict_SetItemString(d
, "ENUM_VALUE", x
) < 0)
2336 #ifdef AL_ERROR_INPUT_OVERFLOW
2337 x
= PyInt_FromLong((long) AL_ERROR_INPUT_OVERFLOW
);
2338 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_INPUT_OVERFLOW", x
) < 0)
2342 #ifdef AL_ERROR_LENGTH
2343 x
= PyInt_FromLong((long) AL_ERROR_LENGTH
);
2344 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_LENGTH", x
) < 0)
2348 #ifdef AL_ERROR_LOCATION_LSP
2349 x
= PyInt_FromLong((long) AL_ERROR_LOCATION_LSP
);
2350 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_LOCATION_LSP", x
) < 0)
2354 #ifdef AL_ERROR_LOCATION_MSP
2355 x
= PyInt_FromLong((long) AL_ERROR_LOCATION_MSP
);
2356 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_LOCATION_MSP", x
) < 0)
2360 #ifdef AL_ERROR_NUMBER
2361 x
= PyInt_FromLong((long) AL_ERROR_NUMBER
);
2362 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_NUMBER", x
) < 0)
2366 #ifdef AL_ERROR_OUTPUT_UNDERFLOW
2367 x
= PyInt_FromLong((long) AL_ERROR_OUTPUT_UNDERFLOW
);
2368 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_OUTPUT_UNDERFLOW", x
) < 0)
2372 #ifdef AL_ERROR_TYPE
2373 x
= PyInt_FromLong((long) AL_ERROR_TYPE
);
2374 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_TYPE", x
) < 0)
2378 #ifdef AL_FIXED_ELEM
2379 x
= PyInt_FromLong((long) AL_FIXED_ELEM
);
2380 if (x
== NULL
|| PyDict_SetItemString(d
, "FIXED_ELEM", x
) < 0)
2384 #ifdef AL_FIXED_MCLK_TYPE
2385 x
= PyInt_FromLong((long) AL_FIXED_MCLK_TYPE
);
2386 if (x
== NULL
|| PyDict_SetItemString(d
, "FIXED_MCLK_TYPE", x
) < 0)
2391 x
= PyInt_FromLong((long) AL_GAIN
);
2392 if (x
== NULL
|| PyDict_SetItemString(d
, "GAIN", x
) < 0)
2397 x
= PyInt_FromLong((long) AL_GAIN_REF
);
2398 if (x
== NULL
|| PyDict_SetItemString(d
, "GAIN_REF", x
) < 0)
2403 x
= PyInt_FromLong((long) AL_HRB_TYPE
);
2404 if (x
== NULL
|| PyDict_SetItemString(d
, "HRB_TYPE", x
) < 0)
2408 #ifdef AL_INPUT_COUNT
2409 x
= PyInt_FromLong((long) AL_INPUT_COUNT
);
2410 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_COUNT", x
) < 0)
2414 #ifdef AL_INPUT_DEVICE_TYPE
2415 x
= PyInt_FromLong((long) AL_INPUT_DEVICE_TYPE
);
2416 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_DEVICE_TYPE", x
) < 0)
2420 #ifdef AL_INPUT_DIGITAL
2421 x
= PyInt_FromLong((long) AL_INPUT_DIGITAL
);
2422 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_DIGITAL", x
) < 0)
2426 #ifdef AL_INPUT_HRB_TYPE
2427 x
= PyInt_FromLong((long) AL_INPUT_HRB_TYPE
);
2428 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_HRB_TYPE", x
) < 0)
2432 #ifdef AL_INPUT_LINE
2433 x
= PyInt_FromLong((long) AL_INPUT_LINE
);
2434 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_LINE", x
) < 0)
2439 x
= PyInt_FromLong((long) AL_INPUT_MIC
);
2440 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_MIC", x
) < 0)
2444 #ifdef AL_INPUT_PORT_TYPE
2445 x
= PyInt_FromLong((long) AL_INPUT_PORT_TYPE
);
2446 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_PORT_TYPE", x
) < 0)
2450 #ifdef AL_INPUT_RATE
2451 x
= PyInt_FromLong((long) AL_INPUT_RATE
);
2452 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_RATE", x
) < 0)
2456 #ifdef AL_INPUT_SOURCE
2457 x
= PyInt_FromLong((long) AL_INPUT_SOURCE
);
2458 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_SOURCE", x
) < 0)
2462 #ifdef AL_INT32_ELEM
2463 x
= PyInt_FromLong((long) AL_INT32_ELEM
);
2464 if (x
== NULL
|| PyDict_SetItemString(d
, "INT32_ELEM", x
) < 0)
2468 #ifdef AL_INT64_ELEM
2469 x
= PyInt_FromLong((long) AL_INT64_ELEM
);
2470 if (x
== NULL
|| PyDict_SetItemString(d
, "INT64_ELEM", x
) < 0)
2475 x
= PyInt_FromLong((long) AL_INTERFACE
);
2476 if (x
== NULL
|| PyDict_SetItemString(d
, "INTERFACE", x
) < 0)
2480 #ifdef AL_INTERFACE_TYPE
2481 x
= PyInt_FromLong((long) AL_INTERFACE_TYPE
);
2482 if (x
== NULL
|| PyDict_SetItemString(d
, "INTERFACE_TYPE", x
) < 0)
2486 #ifdef AL_INVALID_PARAM
2487 x
= PyInt_FromLong((long) AL_INVALID_PARAM
);
2488 if (x
== NULL
|| PyDict_SetItemString(d
, "INVALID_PARAM", x
) < 0)
2492 #ifdef AL_INVALID_VALUE
2493 x
= PyInt_FromLong((long) AL_INVALID_VALUE
);
2494 if (x
== NULL
|| PyDict_SetItemString(d
, "INVALID_VALUE", x
) < 0)
2499 x
= PyInt_FromLong((long) AL_JITTER
);
2500 if (x
== NULL
|| PyDict_SetItemString(d
, "JITTER", x
) < 0)
2505 x
= PyInt_FromLong((long) AL_LABEL
);
2506 if (x
== NULL
|| PyDict_SetItemString(d
, "LABEL", x
) < 0)
2510 #ifdef AL_LEFT_INPUT_ATTEN
2511 x
= PyInt_FromLong((long) AL_LEFT_INPUT_ATTEN
);
2512 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT_INPUT_ATTEN", x
) < 0)
2516 #ifdef AL_LEFT_MONITOR_ATTEN
2517 x
= PyInt_FromLong((long) AL_LEFT_MONITOR_ATTEN
);
2518 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT_MONITOR_ATTEN", x
) < 0)
2522 #ifdef AL_LEFT_SPEAKER_GAIN
2523 x
= PyInt_FromLong((long) AL_LEFT_SPEAKER_GAIN
);
2524 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT_SPEAKER_GAIN", x
) < 0)
2528 #ifdef AL_LEFT1_INPUT_ATTEN
2529 x
= PyInt_FromLong((long) AL_LEFT1_INPUT_ATTEN
);
2530 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT1_INPUT_ATTEN", x
) < 0)
2534 #ifdef AL_LEFT2_INPUT_ATTEN
2535 x
= PyInt_FromLong((long) AL_LEFT2_INPUT_ATTEN
);
2536 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT2_INPUT_ATTEN", x
) < 0)
2540 #ifdef AL_LINE_IF_TYPE
2541 x
= PyInt_FromLong((long) AL_LINE_IF_TYPE
);
2542 if (x
== NULL
|| PyDict_SetItemString(d
, "LINE_IF_TYPE", x
) < 0)
2547 x
= PyInt_FromLong((long) AL_LOCKED
);
2548 if (x
== NULL
|| PyDict_SetItemString(d
, "LOCKED", x
) < 0)
2552 #ifdef AL_MASTER_CLOCK
2553 x
= PyInt_FromLong((long) AL_MASTER_CLOCK
);
2554 if (x
== NULL
|| PyDict_SetItemString(d
, "MASTER_CLOCK", x
) < 0)
2558 #ifdef AL_MATRIX_VAL
2559 x
= PyInt_FromLong((long) AL_MATRIX_VAL
);
2560 if (x
== NULL
|| PyDict_SetItemString(d
, "MATRIX_VAL", x
) < 0)
2565 x
= PyInt_FromLong((long) AL_MAX_ERROR
);
2566 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_ERROR", x
) < 0)
2570 #ifdef AL_MAX_EVENT_PARAM
2571 x
= PyInt_FromLong((long) AL_MAX_EVENT_PARAM
);
2572 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_EVENT_PARAM", x
) < 0)
2576 #ifdef AL_MAX_PBUFSIZE
2577 x
= PyInt_FromLong((long) AL_MAX_PBUFSIZE
);
2578 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_PBUFSIZE", x
) < 0)
2583 x
= PyInt_FromLong((long) AL_MAX_PORTS
);
2584 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_PORTS", x
) < 0)
2588 #ifdef AL_MAX_RESOURCE_ID
2589 x
= PyInt_FromLong((long) AL_MAX_RESOURCE_ID
);
2590 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_RESOURCE_ID", x
) < 0)
2594 #ifdef AL_MAX_SETSIZE
2595 x
= PyInt_FromLong((long) AL_MAX_SETSIZE
);
2596 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_SETSIZE", x
) < 0)
2600 #ifdef AL_MAX_STRLEN
2601 x
= PyInt_FromLong((long) AL_MAX_STRLEN
);
2602 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_STRLEN", x
) < 0)
2607 x
= PyInt_FromLong((long) AL_MCLK_TYPE
);
2608 if (x
== NULL
|| PyDict_SetItemString(d
, "MCLK_TYPE", x
) < 0)
2612 #ifdef AL_MIC_IF_TYPE
2613 x
= PyInt_FromLong((long) AL_MIC_IF_TYPE
);
2614 if (x
== NULL
|| PyDict_SetItemString(d
, "MIC_IF_TYPE", x
) < 0)
2618 #ifdef AL_MONITOR_CTL
2619 x
= PyInt_FromLong((long) AL_MONITOR_CTL
);
2620 if (x
== NULL
|| PyDict_SetItemString(d
, "MONITOR_CTL", x
) < 0)
2624 #ifdef AL_MONITOR_OFF
2625 x
= PyInt_FromLong((long) AL_MONITOR_OFF
);
2626 if (x
== NULL
|| PyDict_SetItemString(d
, "MONITOR_OFF", x
) < 0)
2630 #ifdef AL_MONITOR_ON
2631 x
= PyInt_FromLong((long) AL_MONITOR_ON
);
2632 if (x
== NULL
|| PyDict_SetItemString(d
, "MONITOR_ON", x
) < 0)
2637 x
= PyInt_FromLong((long) AL_MONO
);
2638 if (x
== NULL
|| PyDict_SetItemString(d
, "MONO", x
) < 0)
2643 x
= PyInt_FromLong((long) AL_MUTE
);
2644 if (x
== NULL
|| PyDict_SetItemString(d
, "MUTE", x
) < 0)
2649 x
= PyInt_FromLong((long) AL_NAME
);
2650 if (x
== NULL
|| PyDict_SetItemString(d
, "NAME", x
) < 0)
2654 #ifdef AL_NEG_INFINITY
2655 x
= PyInt_FromLong((long) AL_NEG_INFINITY
);
2656 if (x
== NULL
|| PyDict_SetItemString(d
, "NEG_INFINITY", x
) < 0)
2660 #ifdef AL_NEG_INFINITY_BIT
2661 x
= PyInt_FromLong((long) AL_NEG_INFINITY_BIT
);
2662 if (x
== NULL
|| PyDict_SetItemString(d
, "NEG_INFINITY_BIT", x
) < 0)
2667 x
= PyInt_FromLong((long) AL_NO_CHANGE
);
2668 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_CHANGE", x
) < 0)
2672 #ifdef AL_NO_CHANGE_BIT
2673 x
= PyInt_FromLong((long) AL_NO_CHANGE_BIT
);
2674 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_CHANGE_BIT", x
) < 0)
2679 x
= PyInt_FromLong((long) AL_NO_ELEM
);
2680 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_ELEM", x
) < 0)
2685 x
= PyInt_FromLong((long) AL_NO_ERRORS
);
2686 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_ERRORS", x
) < 0)
2691 x
= PyInt_FromLong((long) AL_NO_OP
);
2692 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_OP", x
) < 0)
2697 x
= PyInt_FromLong((long) AL_NO_VAL
);
2698 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_VAL", x
) < 0)
2702 #ifdef AL_NULL_INTERFACE
2703 x
= PyInt_FromLong((long) AL_NULL_INTERFACE
);
2704 if (x
== NULL
|| PyDict_SetItemString(d
, "NULL_INTERFACE", x
) < 0)
2708 #ifdef AL_NULL_RESOURCE
2709 x
= PyInt_FromLong((long) AL_NULL_RESOURCE
);
2710 if (x
== NULL
|| PyDict_SetItemString(d
, "NULL_RESOURCE", x
) < 0)
2714 #ifdef AL_OPTICAL_IF_TYPE
2715 x
= PyInt_FromLong((long) AL_OPTICAL_IF_TYPE
);
2716 if (x
== NULL
|| PyDict_SetItemString(d
, "OPTICAL_IF_TYPE", x
) < 0)
2720 #ifdef AL_OUTPUT_COUNT
2721 x
= PyInt_FromLong((long) AL_OUTPUT_COUNT
);
2722 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_COUNT", x
) < 0)
2726 #ifdef AL_OUTPUT_DEVICE_TYPE
2727 x
= PyInt_FromLong((long) AL_OUTPUT_DEVICE_TYPE
);
2728 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_DEVICE_TYPE", x
) < 0)
2732 #ifdef AL_OUTPUT_HRB_TYPE
2733 x
= PyInt_FromLong((long) AL_OUTPUT_HRB_TYPE
);
2734 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_HRB_TYPE", x
) < 0)
2738 #ifdef AL_OUTPUT_PORT_TYPE
2739 x
= PyInt_FromLong((long) AL_OUTPUT_PORT_TYPE
);
2740 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_PORT_TYPE", x
) < 0)
2744 #ifdef AL_OUTPUT_RATE
2745 x
= PyInt_FromLong((long) AL_OUTPUT_RATE
);
2746 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_RATE", x
) < 0)
2751 x
= PyInt_FromLong((long) AL_PARAM_BIT
);
2752 if (x
== NULL
|| PyDict_SetItemString(d
, "PARAM_BIT", x
) < 0)
2757 x
= PyInt_FromLong((long) AL_PARAMS
);
2758 if (x
== NULL
|| PyDict_SetItemString(d
, "PARAMS", x
) < 0)
2762 #ifdef AL_PORT_COUNT
2763 x
= PyInt_FromLong((long) AL_PORT_COUNT
);
2764 if (x
== NULL
|| PyDict_SetItemString(d
, "PORT_COUNT", x
) < 0)
2769 x
= PyInt_FromLong((long) AL_PORT_TYPE
);
2770 if (x
== NULL
|| PyDict_SetItemString(d
, "PORT_TYPE", x
) < 0)
2775 x
= PyInt_FromLong((long) AL_PORTS
);
2776 if (x
== NULL
|| PyDict_SetItemString(d
, "PORTS", x
) < 0)
2780 #ifdef AL_PORTSTYLE_DIRECT
2781 x
= PyInt_FromLong((long) AL_PORTSTYLE_DIRECT
);
2782 if (x
== NULL
|| PyDict_SetItemString(d
, "PORTSTYLE_DIRECT", x
) < 0)
2786 #ifdef AL_PORTSTYLE_SERIAL
2787 x
= PyInt_FromLong((long) AL_PORTSTYLE_SERIAL
);
2788 if (x
== NULL
|| PyDict_SetItemString(d
, "PORTSTYLE_SERIAL", x
) < 0)
2792 #ifdef AL_PRINT_ERRORS
2793 x
= PyInt_FromLong((long) AL_PRINT_ERRORS
);
2794 if (x
== NULL
|| PyDict_SetItemString(d
, "PRINT_ERRORS", x
) < 0)
2799 x
= PyInt_FromLong((long) AL_PTR_ELEM
);
2800 if (x
== NULL
|| PyDict_SetItemString(d
, "PTR_ELEM", x
) < 0)
2804 #ifdef AL_RANGE_VALUE
2805 x
= PyInt_FromLong((long) AL_RANGE_VALUE
);
2806 if (x
== NULL
|| PyDict_SetItemString(d
, "RANGE_VALUE", x
) < 0)
2811 x
= PyInt_FromLong((long) AL_RATE
);
2812 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE", x
) < 0)
2816 #ifdef AL_RATE_11025
2817 x
= PyInt_FromLong((long) AL_RATE_11025
);
2818 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_11025", x
) < 0)
2822 #ifdef AL_RATE_16000
2823 x
= PyInt_FromLong((long) AL_RATE_16000
);
2824 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_16000", x
) < 0)
2828 #ifdef AL_RATE_22050
2829 x
= PyInt_FromLong((long) AL_RATE_22050
);
2830 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_22050", x
) < 0)
2834 #ifdef AL_RATE_32000
2835 x
= PyInt_FromLong((long) AL_RATE_32000
);
2836 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_32000", x
) < 0)
2840 #ifdef AL_RATE_44100
2841 x
= PyInt_FromLong((long) AL_RATE_44100
);
2842 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_44100", x
) < 0)
2846 #ifdef AL_RATE_48000
2847 x
= PyInt_FromLong((long) AL_RATE_48000
);
2848 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_48000", x
) < 0)
2853 x
= PyInt_FromLong((long) AL_RATE_8000
);
2854 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_8000", x
) < 0)
2858 #ifdef AL_RATE_AES_1
2859 x
= PyInt_FromLong((long) AL_RATE_AES_1
);
2860 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_1", x
) < 0)
2864 #ifdef AL_RATE_AES_1s
2865 x
= PyInt_FromLong((long) AL_RATE_AES_1s
);
2866 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_1s", x
) < 0)
2870 #ifdef AL_RATE_AES_2
2871 x
= PyInt_FromLong((long) AL_RATE_AES_2
);
2872 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_2", x
) < 0)
2876 #ifdef AL_RATE_AES_3
2877 x
= PyInt_FromLong((long) AL_RATE_AES_3
);
2878 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_3", x
) < 0)
2882 #ifdef AL_RATE_AES_4
2883 x
= PyInt_FromLong((long) AL_RATE_AES_4
);
2884 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_4", x
) < 0)
2888 #ifdef AL_RATE_AES_6
2889 x
= PyInt_FromLong((long) AL_RATE_AES_6
);
2890 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_6", x
) < 0)
2894 #ifdef AL_RATE_FRACTION_D
2895 x
= PyInt_FromLong((long) AL_RATE_FRACTION_D
);
2896 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_FRACTION_D", x
) < 0)
2900 #ifdef AL_RATE_FRACTION_N
2901 x
= PyInt_FromLong((long) AL_RATE_FRACTION_N
);
2902 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_FRACTION_N", x
) < 0)
2906 #ifdef AL_RATE_INPUTRATE
2907 x
= PyInt_FromLong((long) AL_RATE_INPUTRATE
);
2908 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_INPUTRATE", x
) < 0)
2912 #ifdef AL_RATE_NO_DIGITAL_INPUT
2913 x
= PyInt_FromLong((long) AL_RATE_NO_DIGITAL_INPUT
);
2914 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_NO_DIGITAL_INPUT", x
) < 0)
2918 #ifdef AL_RATE_UNACQUIRED
2919 x
= PyInt_FromLong((long) AL_RATE_UNACQUIRED
);
2920 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_UNACQUIRED", x
) < 0)
2924 #ifdef AL_RATE_UNDEFINED
2925 x
= PyInt_FromLong((long) AL_RATE_UNDEFINED
);
2926 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_UNDEFINED", x
) < 0)
2931 x
= PyInt_FromLong((long) AL_REF_0DBV
);
2932 if (x
== NULL
|| PyDict_SetItemString(d
, "REF_0DBV", x
) < 0)
2937 x
= PyInt_FromLong((long) AL_REF_NONE
);
2938 if (x
== NULL
|| PyDict_SetItemString(d
, "REF_NONE", x
) < 0)
2942 #ifdef AL_RESERVED1_TYPE
2943 x
= PyInt_FromLong((long) AL_RESERVED1_TYPE
);
2944 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED1_TYPE", x
) < 0)
2948 #ifdef AL_RESERVED2_TYPE
2949 x
= PyInt_FromLong((long) AL_RESERVED2_TYPE
);
2950 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED2_TYPE", x
) < 0)
2954 #ifdef AL_RESERVED3_TYPE
2955 x
= PyInt_FromLong((long) AL_RESERVED3_TYPE
);
2956 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED3_TYPE", x
) < 0)
2960 #ifdef AL_RESERVED4_TYPE
2961 x
= PyInt_FromLong((long) AL_RESERVED4_TYPE
);
2962 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED4_TYPE", x
) < 0)
2967 x
= PyInt_FromLong((long) AL_RESOURCE
);
2968 if (x
== NULL
|| PyDict_SetItemString(d
, "RESOURCE", x
) < 0)
2972 #ifdef AL_RESOURCE_ELEM
2973 x
= PyInt_FromLong((long) AL_RESOURCE_ELEM
);
2974 if (x
== NULL
|| PyDict_SetItemString(d
, "RESOURCE_ELEM", x
) < 0)
2978 #ifdef AL_RESOURCE_TYPE
2979 x
= PyInt_FromLong((long) AL_RESOURCE_TYPE
);
2980 if (x
== NULL
|| PyDict_SetItemString(d
, "RESOURCE_TYPE", x
) < 0)
2984 #ifdef AL_RIGHT_INPUT_ATTEN
2985 x
= PyInt_FromLong((long) AL_RIGHT_INPUT_ATTEN
);
2986 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT_INPUT_ATTEN", x
) < 0)
2990 #ifdef AL_RIGHT_MONITOR_ATTEN
2991 x
= PyInt_FromLong((long) AL_RIGHT_MONITOR_ATTEN
);
2992 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT_MONITOR_ATTEN", x
) < 0)
2996 #ifdef AL_RIGHT_SPEAKER_GAIN
2997 x
= PyInt_FromLong((long) AL_RIGHT_SPEAKER_GAIN
);
2998 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT_SPEAKER_GAIN", x
) < 0)
3002 #ifdef AL_RIGHT1_INPUT_ATTEN
3003 x
= PyInt_FromLong((long) AL_RIGHT1_INPUT_ATTEN
);
3004 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT1_INPUT_ATTEN", x
) < 0)
3008 #ifdef AL_RIGHT2_INPUT_ATTEN
3009 x
= PyInt_FromLong((long) AL_RIGHT2_INPUT_ATTEN
);
3010 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT2_INPUT_ATTEN", x
) < 0)
3014 #ifdef AL_SAMPFMT_DOUBLE
3015 x
= PyInt_FromLong((long) AL_SAMPFMT_DOUBLE
);
3016 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPFMT_DOUBLE", x
) < 0)
3020 #ifdef AL_SAMPFMT_FLOAT
3021 x
= PyInt_FromLong((long) AL_SAMPFMT_FLOAT
);
3022 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPFMT_FLOAT", x
) < 0)
3026 #ifdef AL_SAMPFMT_TWOSCOMP
3027 x
= PyInt_FromLong((long) AL_SAMPFMT_TWOSCOMP
);
3028 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPFMT_TWOSCOMP", x
) < 0)
3033 x
= PyInt_FromLong((long) AL_SAMPLE_16
);
3034 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLE_16", x
) < 0)
3039 x
= PyInt_FromLong((long) AL_SAMPLE_24
);
3040 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLE_24", x
) < 0)
3045 x
= PyInt_FromLong((long) AL_SAMPLE_8
);
3046 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLE_8", x
) < 0)
3050 #ifdef AL_SCALAR_VAL
3051 x
= PyInt_FromLong((long) AL_SCALAR_VAL
);
3052 if (x
== NULL
|| PyDict_SetItemString(d
, "SCALAR_VAL", x
) < 0)
3057 x
= PyInt_FromLong((long) AL_SET_VAL
);
3058 if (x
== NULL
|| PyDict_SetItemString(d
, "SET_VAL", x
) < 0)
3062 #ifdef AL_SHORT_NAME
3063 x
= PyInt_FromLong((long) AL_SHORT_NAME
);
3064 if (x
== NULL
|| PyDict_SetItemString(d
, "SHORT_NAME", x
) < 0)
3068 #ifdef AL_SMPTE272M_IF_TYPE
3069 x
= PyInt_FromLong((long) AL_SMPTE272M_IF_TYPE
);
3070 if (x
== NULL
|| PyDict_SetItemString(d
, "SMPTE272M_IF_TYPE", x
) < 0)
3075 x
= PyInt_FromLong((long) AL_SOURCE
);
3076 if (x
== NULL
|| PyDict_SetItemString(d
, "SOURCE", x
) < 0)
3080 #ifdef AL_SPEAKER_IF_TYPE
3081 x
= PyInt_FromLong((long) AL_SPEAKER_IF_TYPE
);
3082 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_IF_TYPE", x
) < 0)
3086 #ifdef AL_SPEAKER_MUTE_CTL
3087 x
= PyInt_FromLong((long) AL_SPEAKER_MUTE_CTL
);
3088 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_MUTE_CTL", x
) < 0)
3092 #ifdef AL_SPEAKER_MUTE_OFF
3093 x
= PyInt_FromLong((long) AL_SPEAKER_MUTE_OFF
);
3094 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_MUTE_OFF", x
) < 0)
3098 #ifdef AL_SPEAKER_MUTE_ON
3099 x
= PyInt_FromLong((long) AL_SPEAKER_MUTE_ON
);
3100 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_MUTE_ON", x
) < 0)
3104 #ifdef AL_SPEAKER_PLUS_LINE_IF_TYPE
3105 x
= PyInt_FromLong((long) AL_SPEAKER_PLUS_LINE_IF_TYPE
);
3106 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_PLUS_LINE_IF_TYPE", x
) < 0)
3111 x
= PyInt_FromLong((long) AL_STEREO
);
3112 if (x
== NULL
|| PyDict_SetItemString(d
, "STEREO", x
) < 0)
3116 #ifdef AL_STRING_VAL
3117 x
= PyInt_FromLong((long) AL_STRING_VAL
);
3118 if (x
== NULL
|| PyDict_SetItemString(d
, "STRING_VAL", x
) < 0)
3123 x
= PyInt_FromLong((long) AL_SUBSYSTEM
);
3124 if (x
== NULL
|| PyDict_SetItemString(d
, "SUBSYSTEM", x
) < 0)
3128 #ifdef AL_SUBSYSTEM_TYPE
3129 x
= PyInt_FromLong((long) AL_SUBSYSTEM_TYPE
);
3130 if (x
== NULL
|| PyDict_SetItemString(d
, "SUBSYSTEM_TYPE", x
) < 0)
3134 #ifdef AL_SYNC_INPUT_TO_AES
3135 x
= PyInt_FromLong((long) AL_SYNC_INPUT_TO_AES
);
3136 if (x
== NULL
|| PyDict_SetItemString(d
, "SYNC_INPUT_TO_AES", x
) < 0)
3140 #ifdef AL_SYNC_OUTPUT_TO_AES
3141 x
= PyInt_FromLong((long) AL_SYNC_OUTPUT_TO_AES
);
3142 if (x
== NULL
|| PyDict_SetItemString(d
, "SYNC_OUTPUT_TO_AES", x
) < 0)
3147 x
= PyInt_FromLong((long) AL_SYSTEM
);
3148 if (x
== NULL
|| PyDict_SetItemString(d
, "SYSTEM", x
) < 0)
3152 #ifdef AL_SYSTEM_TYPE
3153 x
= PyInt_FromLong((long) AL_SYSTEM_TYPE
);
3154 if (x
== NULL
|| PyDict_SetItemString(d
, "SYSTEM_TYPE", x
) < 0)
3158 #ifdef AL_TEST_IF_TYPE
3159 x
= PyInt_FromLong((long) AL_TEST_IF_TYPE
);
3160 if (x
== NULL
|| PyDict_SetItemString(d
, "TEST_IF_TYPE", x
) < 0)
3165 x
= PyInt_FromLong((long) AL_TYPE
);
3166 if (x
== NULL
|| PyDict_SetItemString(d
, "TYPE", x
) < 0)
3171 x
= PyInt_FromLong((long) AL_TYPE_BIT
);
3172 if (x
== NULL
|| PyDict_SetItemString(d
, "TYPE_BIT", x
) < 0)
3176 #ifdef AL_UNUSED_COUNT
3177 x
= PyInt_FromLong((long) AL_UNUSED_COUNT
);
3178 if (x
== NULL
|| PyDict_SetItemString(d
, "UNUSED_COUNT", x
) < 0)
3182 #ifdef AL_UNUSED_PORTS
3183 x
= PyInt_FromLong((long) AL_UNUSED_PORTS
);
3184 if (x
== NULL
|| PyDict_SetItemString(d
, "UNUSED_PORTS", x
) < 0)
3188 #ifdef AL_VARIABLE_MCLK_TYPE
3189 x
= PyInt_FromLong((long) AL_VARIABLE_MCLK_TYPE
);
3190 if (x
== NULL
|| PyDict_SetItemString(d
, "VARIABLE_MCLK_TYPE", x
) < 0)
3194 #ifdef AL_VECTOR_VAL
3195 x
= PyInt_FromLong((long) AL_VECTOR_VAL
);
3196 if (x
== NULL
|| PyDict_SetItemString(d
, "VECTOR_VAL", x
) < 0)
3200 #ifdef AL_VIDEO_MCLK_TYPE
3201 x
= PyInt_FromLong((long) AL_VIDEO_MCLK_TYPE
);
3202 if (x
== NULL
|| PyDict_SetItemString(d
, "VIDEO_MCLK_TYPE", x
) < 0)
3207 x
= PyInt_FromLong((long) AL_WORDSIZE
);
3208 if (x
== NULL
|| PyDict_SetItemString(d
, "WORDSIZE", x
) < 0)
3213 #ifdef AL_NO_ELEM /* IRIX 6 */
3214 (void) alSetErrorHandler(ErrorHandler
);
3215 #endif /* AL_NO_ELEM */
3216 #ifdef OLD_INTERFACE
3217 (void) ALseterrorhandler(ErrorHandler
);
3218 #endif /* OLD_INTERFACE */