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
)
66 if (alGetParamInfo(resource
, param
, &info
) < 0)
69 switch (pinfo
->elementType
) {
71 /* XXXX don't know how to handle this */
76 case AL_RESOURCE_ELEM
:
78 return PyInt_FromLong((long) value
.i
);
80 return PyLong_FromLongLong(value
.ll
);
82 return PyFloat_FromDouble(alFixedToDouble(value
.ll
));
84 if (value
.ptr
== NULL
) {
88 return PyString_FromString((char *) value
.ptr
);
90 PyErr_SetString(ErrorObject
, "unknown element type");
96 python2elem(PyObject
*item
, void *ptr
, int elementType
)
98 switch (elementType
) {
100 case AL_RESOURCE_ELEM
:
102 if (!PyInt_Check(item
)) {
106 *((int *) ptr
) = PyInt_AsLong(item
);
109 if (PyInt_Check(item
))
110 *((long long *) ptr
) = PyInt_AsLong(item
);
111 else if (PyLong_Check(item
))
112 *((long long *) ptr
) = PyLong_AsLongLong(item
);
119 if (PyInt_Check(item
))
120 *((long long *) ptr
) = alDoubleToFixed((double) PyInt_AsLong(item
));
121 else if (PyFloat_Check(item
))
122 *((long long *) ptr
) = alDoubleToFixed(PyFloat_AsDouble(item
));
129 PyErr_SetString(ErrorObject
, "unknown element type");
136 python2param(int resource
, ALpv
*param
, PyObject
*value
, ALparamInfo
*pinfo
)
144 if (alGetParamInfo(resource
, param
->param
, &info
) < 0)
147 switch (pinfo
->valueType
) {
149 if (pinfo
->elementType
!= AL_CHAR_ELEM
) {
150 PyErr_SetString(ErrorObject
, "unknown element type");
153 if (!PyString_Check(value
)) {
157 param
->value
.ptr
= PyString_AS_STRING(value
);
158 param
->sizeIn
= PyString_GET_SIZE(value
)+1; /*account for NUL*/
162 if (!PyList_Check(value
) && !PyTuple_Check(value
)) {
166 switch (pinfo
->elementType
) {
168 case AL_RESOURCE_ELEM
:
170 param
->sizeIn
= PySequence_Size(value
);
171 param
->value
.ptr
= PyMem_NEW(int, param
->sizeIn
);
172 stepsize
= sizeof(int);
176 param
->sizeIn
= PySequence_Size(value
);
177 param
->value
.ptr
= PyMem_NEW(long long, param
->sizeIn
);
178 stepsize
= sizeof(long long);
181 for (i
= 0; i
< param
->sizeIn
; i
++) {
182 item
= PySequence_GetItem(value
, i
);
183 if (python2elem(item
, (void *) ((char *) param
->value
.ptr
+ i
*stepsize
), pinfo
->elementType
) < 0) {
184 PyMem_DEL(param
->value
.ptr
);
190 switch (pinfo
->elementType
) {
192 case AL_RESOURCE_ELEM
:
194 return python2elem(value
, (void *) ¶m
->value
.i
,
198 return python2elem(value
, (void *) ¶m
->value
.ll
,
201 PyErr_SetString(ErrorObject
, "unknown element type");
209 python2params(int resource1
, int resource2
, PyObject
*list
, ALpv
**pvsp
, ALparamInfo
**pinfop
)
216 npvs
= PyList_Size(list
);
217 pvs
= PyMem_NEW(ALpv
, npvs
);
218 pinfo
= PyMem_NEW(ALparamInfo
, npvs
);
219 for (i
= 0; i
< npvs
; i
++) {
220 item
= PyList_GetItem(list
, i
);
221 if (!PyArg_ParseTuple(item
, "iO", &pvs
[i
].param
, &item
))
223 if (alGetParamInfo(resource1
, pvs
[i
].param
, &pinfo
[i
]) < 0 &&
224 alGetParamInfo(resource2
, pvs
[i
].param
, &pinfo
[i
]) < 0)
226 if (python2param(resource1
, &pvs
[i
], item
, &pinfo
[i
]) < 0)
235 /* XXXX we should clean up everything */
243 /* -------------------------------------------------------- */
247 SetConfig(alcobject
*self
, PyObject
*args
, int (*func
)(ALconfig
, int))
251 if (!PyArg_ParseTuple(args
, "i:SetConfig", &par
))
254 if ((*func
)(self
->config
, par
) == -1)
262 GetConfig(alcobject
*self
, PyObject
*args
, int (*func
)(ALconfig
))
266 if (!PyArg_ParseTuple(args
, ":GetConfig"))
269 if ((par
= (*func
)(self
->config
)) == -1)
272 return PyInt_FromLong((long) par
);
275 PyDoc_STRVAR(alc_SetWidth__doc__
,
276 "alSetWidth: set the wordsize for integer audio data.");
279 alc_SetWidth(alcobject
*self
, PyObject
*args
)
281 return SetConfig(self
, args
, alSetWidth
);
285 PyDoc_STRVAR(alc_GetWidth__doc__
,
286 "alGetWidth: get the wordsize for integer audio data.");
289 alc_GetWidth(alcobject
*self
, PyObject
*args
)
291 return GetConfig(self
, args
, alGetWidth
);
295 PyDoc_STRVAR(alc_SetSampFmt__doc__
,
296 "alSetSampFmt: set the sample format setting in an audio ALconfig "
300 alc_SetSampFmt(alcobject
*self
, PyObject
*args
)
302 return SetConfig(self
, args
, alSetSampFmt
);
306 PyDoc_STRVAR(alc_GetSampFmt__doc__
,
307 "alGetSampFmt: get the sample format setting in an audio ALconfig "
311 alc_GetSampFmt(alcobject
*self
, PyObject
*args
)
313 return GetConfig(self
, args
, alGetSampFmt
);
317 PyDoc_STRVAR(alc_SetChannels__doc__
,
318 "alSetChannels: set the channel settings in an audio ALconfig.");
321 alc_SetChannels(alcobject
*self
, PyObject
*args
)
323 return SetConfig(self
, args
, alSetChannels
);
327 PyDoc_STRVAR(alc_GetChannels__doc__
,
328 "alGetChannels: get the channel settings in an audio ALconfig.");
331 alc_GetChannels(alcobject
*self
, PyObject
*args
)
333 return GetConfig(self
, args
, alGetChannels
);
337 PyDoc_STRVAR(alc_SetFloatMax__doc__
,
338 "alSetFloatMax: set the maximum value of floating point sample data.");
341 alc_SetFloatMax(alcobject
*self
, PyObject
*args
)
343 double maximum_value
;
345 if (!PyArg_ParseTuple(args
, "d:SetFloatMax", &maximum_value
))
347 if (alSetFloatMax(self
->config
, maximum_value
) < 0)
354 PyDoc_STRVAR(alc_GetFloatMax__doc__
,
355 "alGetFloatMax: get the maximum value of floating point sample data.");
358 alc_GetFloatMax(alcobject
*self
, PyObject
*args
)
360 double maximum_value
;
362 if (!PyArg_ParseTuple(args
, ":GetFloatMax"))
364 if ((maximum_value
= alGetFloatMax(self
->config
)) == 0)
366 return PyFloat_FromDouble(maximum_value
);
370 PyDoc_STRVAR(alc_SetDevice__doc__
,
371 "alSetDevice: set the device setting in an audio ALconfig structure.");
374 alc_SetDevice(alcobject
*self
, PyObject
*args
)
376 return SetConfig(self
, args
, alSetDevice
);
380 PyDoc_STRVAR(alc_GetDevice__doc__
,
381 "alGetDevice: get the device setting in an audio ALconfig structure.");
384 alc_GetDevice(alcobject
*self
, PyObject
*args
)
386 return GetConfig(self
, args
, alGetDevice
);
390 PyDoc_STRVAR(alc_SetQueueSize__doc__
,
391 "alSetQueueSize: set audio port buffer size.");
394 alc_SetQueueSize(alcobject
*self
, PyObject
*args
)
396 return SetConfig(self
, args
, alSetQueueSize
);
400 PyDoc_STRVAR(alc_GetQueueSize__doc__
,
401 "alGetQueueSize: get audio port buffer size.");
404 alc_GetQueueSize(alcobject
*self
, PyObject
*args
)
406 return GetConfig(self
, args
, alGetQueueSize
);
409 #endif /* AL_NO_ELEM */
412 setconfig(alcobject
*self
, PyObject
*args
, int (*func
)(ALconfig
, long))
416 if (!PyArg_ParseTuple(args
, "l:SetConfig", &par
))
419 if ((*func
)(self
->config
, par
) == -1)
427 getconfig(alcobject
*self
, PyObject
*args
, long (*func
)(ALconfig
))
431 if (!PyArg_ParseTuple(args
, ":GetConfig"))
434 if ((par
= (*func
)(self
->config
)) == -1)
437 return PyInt_FromLong((long) par
);
441 alc_setqueuesize (alcobject
*self
, PyObject
*args
)
443 return setconfig(self
, args
, ALsetqueuesize
);
447 alc_getqueuesize (alcobject
*self
, PyObject
*args
)
449 return getconfig(self
, args
, ALgetqueuesize
);
453 alc_setwidth (alcobject
*self
, PyObject
*args
)
455 return setconfig(self
, args
, ALsetwidth
);
459 alc_getwidth (alcobject
*self
, PyObject
*args
)
461 return getconfig(self
, args
, ALgetwidth
);
465 alc_getchannels (alcobject
*self
, PyObject
*args
)
467 return getconfig(self
, args
, ALgetchannels
);
471 alc_setchannels (alcobject
*self
, PyObject
*args
)
473 return setconfig(self
, args
, ALsetchannels
);
479 alc_getsampfmt (alcobject
*self
, PyObject
*args
)
481 return getconfig(self
, args
, ALgetsampfmt
);
485 alc_setsampfmt (alcobject
*self
, PyObject
*args
)
487 return setconfig(self
, args
, ALsetsampfmt
);
491 alc_getfloatmax(alcobject
*self
, PyObject
*args
)
495 if (!PyArg_ParseTuple(args
, ":GetFloatMax"))
497 if ((arg
= ALgetfloatmax(self
->config
)) == 0)
499 return PyFloat_FromDouble(arg
);
503 alc_setfloatmax(alcobject
*self
, PyObject
*args
)
507 if (!PyArg_ParseTuple(args
, "d:SetFloatMax", &arg
))
509 if (ALsetfloatmax(self
->config
, arg
) == -1)
516 static struct PyMethodDef alc_methods
[] = {
517 #ifdef AL_NO_ELEM /* IRIX 6 */
518 {"SetWidth", (PyCFunction
)alc_SetWidth
, METH_VARARGS
, alc_SetWidth__doc__
},
519 {"GetWidth", (PyCFunction
)alc_GetWidth
, METH_VARARGS
, alc_GetWidth__doc__
},
520 {"SetSampFmt", (PyCFunction
)alc_SetSampFmt
, METH_VARARGS
, alc_SetSampFmt__doc__
},
521 {"GetSampFmt", (PyCFunction
)alc_GetSampFmt
, METH_VARARGS
, alc_GetSampFmt__doc__
},
522 {"SetChannels", (PyCFunction
)alc_SetChannels
, METH_VARARGS
, alc_SetChannels__doc__
},
523 {"GetChannels", (PyCFunction
)alc_GetChannels
, METH_VARARGS
, alc_GetChannels__doc__
},
524 {"SetFloatMax", (PyCFunction
)alc_SetFloatMax
, METH_VARARGS
, alc_SetFloatMax__doc__
},
525 {"GetFloatMax", (PyCFunction
)alc_GetFloatMax
, METH_VARARGS
, alc_GetFloatMax__doc__
},
526 {"SetDevice", (PyCFunction
)alc_SetDevice
, METH_VARARGS
, alc_SetDevice__doc__
},
527 {"GetDevice", (PyCFunction
)alc_GetDevice
, METH_VARARGS
, alc_GetDevice__doc__
},
528 {"SetQueueSize", (PyCFunction
)alc_SetQueueSize
, METH_VARARGS
, alc_SetQueueSize__doc__
},
529 {"GetQueueSize", (PyCFunction
)alc_GetQueueSize
, METH_VARARGS
, alc_GetQueueSize__doc__
},
530 #endif /* AL_NO_ELEM */
531 {"getqueuesize", (PyCFunction
)alc_getqueuesize
, METH_VARARGS
},
532 {"setqueuesize", (PyCFunction
)alc_setqueuesize
, METH_VARARGS
},
533 {"getwidth", (PyCFunction
)alc_getwidth
, METH_VARARGS
},
534 {"setwidth", (PyCFunction
)alc_setwidth
, METH_VARARGS
},
535 {"getchannels", (PyCFunction
)alc_getchannels
, METH_VARARGS
},
536 {"setchannels", (PyCFunction
)alc_setchannels
, METH_VARARGS
},
538 {"getsampfmt", (PyCFunction
)alc_getsampfmt
, METH_VARARGS
},
539 {"setsampfmt", (PyCFunction
)alc_setsampfmt
, METH_VARARGS
},
540 {"getfloatmax", (PyCFunction
)alc_getfloatmax
, METH_VARARGS
},
541 {"setfloatmax", (PyCFunction
)alc_setfloatmax
, METH_VARARGS
},
544 {NULL
, NULL
} /* sentinel */
551 newalcobject(ALconfig config
)
555 self
= PyObject_New(alcobject
, &Alctype
);
558 /* XXXX Add your own initializers here */
559 self
->config
= config
;
560 return (PyObject
*) self
;
565 alc_dealloc(alcobject
*self
)
567 /* XXXX Add your own cleanup code here */
568 #ifdef AL_NO_ELEM /* IRIX 6 */
569 (void) alFreeConfig(self
->config
); /* ignore errors */
571 (void) ALfreeconfig(self
->config
); /* ignore errors */
577 alc_getattr(alcobject
*self
, char *name
)
579 /* XXXX Add your own getattr code here */
580 return Py_FindMethod(alc_methods
, (PyObject
*)self
, name
);
583 PyDoc_STRVAR(Alctype__doc__
, "");
585 static PyTypeObject Alctype
= {
586 PyObject_HEAD_INIT(&PyType_Type
)
588 "al.config", /*tp_name*/
589 sizeof(alcobject
), /*tp_basicsize*/
592 (destructor
)alc_dealloc
, /*tp_dealloc*/
593 (printfunc
)0, /*tp_print*/
594 (getattrfunc
)alc_getattr
, /*tp_getattr*/
595 (setattrfunc
)0, /*tp_setattr*/
596 (cmpfunc
)0, /*tp_compare*/
597 (reprfunc
)0, /*tp_repr*/
599 0, /*tp_as_sequence*/
601 (hashfunc
)0, /*tp_hash*/
602 (ternaryfunc
)0, /*tp_call*/
603 (reprfunc
)0, /*tp_str*/
605 /* Space for future expansion */
607 Alctype__doc__
/* Documentation string */
610 /* End of code for config objects */
611 /* ---------------------------------------------------------------- */
613 #ifdef AL_NO_ELEM /* IRIX 6 */
615 PyDoc_STRVAR(alp_SetConfig__doc__
,
616 "alSetConfig: set the ALconfig of an audio ALport.");
619 alp_SetConfig(alpobject
*self
, PyObject
*args
)
622 if (!PyArg_ParseTuple(args
, "O!:SetConfig", &Alctype
, &config
))
624 if (alSetConfig(self
->port
, config
->config
) < 0)
631 PyDoc_STRVAR(alp_GetConfig__doc__
,
632 "alGetConfig: get the ALconfig of an audio ALport.");
635 alp_GetConfig(alpobject
*self
, PyObject
*args
)
638 if (!PyArg_ParseTuple(args
, ":GetConfig"))
640 if ((config
= alGetConfig(self
->port
)) == NULL
)
642 return newalcobject(config
);
646 PyDoc_STRVAR(alp_GetResource__doc__
,
647 "alGetResource: get the resource associated with an audio port.");
650 alp_GetResource(alpobject
*self
, PyObject
*args
)
654 if (!PyArg_ParseTuple(args
, ":GetResource"))
656 if ((resource
= alGetResource(self
->port
)) == 0)
658 return PyInt_FromLong((long) resource
);
662 PyDoc_STRVAR(alp_GetFD__doc__
,
663 "alGetFD: get the file descriptor for an audio port.");
666 alp_GetFD(alpobject
*self
, PyObject
*args
)
670 if (!PyArg_ParseTuple(args
, ":GetFD"))
673 if ((fd
= alGetFD(self
->port
)) < 0)
676 return PyInt_FromLong((long) fd
);
680 PyDoc_STRVAR(alp_GetFilled__doc__
,
681 "alGetFilled: return the number of filled sample frames in "
685 alp_GetFilled(alpobject
*self
, PyObject
*args
)
689 if (!PyArg_ParseTuple(args
, ":GetFilled"))
691 if ((filled
= alGetFilled(self
->port
)) < 0)
693 return PyInt_FromLong((long) filled
);
697 PyDoc_STRVAR(alp_GetFillable__doc__
,
698 "alGetFillable: report the number of unfilled sample frames "
699 "in an audio port.");
702 alp_GetFillable(alpobject
*self
, PyObject
*args
)
706 if (!PyArg_ParseTuple(args
, ":GetFillable"))
708 if ((fillable
= alGetFillable(self
->port
)) < 0)
710 return PyInt_FromLong((long) fillable
);
714 PyDoc_STRVAR(alp_ReadFrames__doc__
,
715 "alReadFrames: read sample frames from an audio port.");
718 alp_ReadFrames(alpobject
*self
, PyObject
*args
)
727 if (!PyArg_ParseTuple(args
, "i:ReadFrames", &framecount
))
729 if (framecount
< 0) {
730 PyErr_SetString(ErrorObject
, "negative framecount");
733 c
= alGetConfig(self
->port
);
734 switch (alGetSampFmt(c
)) {
735 case AL_SAMPFMT_TWOSCOMP
:
736 switch (alGetWidth(c
)) {
747 PyErr_SetString(ErrorObject
, "can't determine width");
752 case AL_SAMPFMT_FLOAT
:
755 case AL_SAMPFMT_DOUBLE
:
759 PyErr_SetString(ErrorObject
, "can't determine format");
763 ch
= alGetChannels(c
);
766 PyErr_SetString(ErrorObject
, "can't determine # of channels");
770 v
= PyString_FromStringAndSize((char *) NULL
, size
* framecount
);
774 Py_BEGIN_ALLOW_THREADS
775 alReadFrames(self
->port
, (void *) PyString_AS_STRING(v
), framecount
);
782 PyDoc_STRVAR(alp_DiscardFrames__doc__
,
783 "alDiscardFrames: discard audio from an audio port.");
786 alp_DiscardFrames(alpobject
*self
, PyObject
*args
)
790 if (!PyArg_ParseTuple(args
, "i:DiscardFrames", &framecount
))
793 Py_BEGIN_ALLOW_THREADS
794 framecount
= alDiscardFrames(self
->port
, framecount
);
800 return PyInt_FromLong((long) framecount
);
804 PyDoc_STRVAR(alp_ZeroFrames__doc__
,
805 "alZeroFrames: write zero-valued sample frames to an audio port.");
808 alp_ZeroFrames(alpobject
*self
, PyObject
*args
)
812 if (!PyArg_ParseTuple(args
, "i:ZeroFrames", &framecount
))
815 if (framecount
< 0) {
816 PyErr_SetString(ErrorObject
, "negative framecount");
820 Py_BEGIN_ALLOW_THREADS
821 alZeroFrames(self
->port
, framecount
);
829 PyDoc_STRVAR(alp_SetFillPoint__doc__
,
830 "alSetFillPoint: set low- or high-water mark for an audio port.");
833 alp_SetFillPoint(alpobject
*self
, PyObject
*args
)
837 if (!PyArg_ParseTuple(args
, "i:SetFillPoint", &fillpoint
))
840 if (alSetFillPoint(self
->port
, fillpoint
) < 0)
848 PyDoc_STRVAR(alp_GetFillPoint__doc__
,
849 "alGetFillPoint: get low- or high-water mark for an audio port.");
852 alp_GetFillPoint(alpobject
*self
, PyObject
*args
)
856 if (!PyArg_ParseTuple(args
, ":GetFillPoint"))
859 if ((fillpoint
= alGetFillPoint(self
->port
)) < 0)
862 return PyInt_FromLong((long) fillpoint
);
866 PyDoc_STRVAR(alp_GetFrameNumber__doc__
,
867 "alGetFrameNumber: get the absolute sample frame number "
868 "associated with a port.");
871 alp_GetFrameNumber(alpobject
*self
, PyObject
*args
)
875 if (!PyArg_ParseTuple(args
, ":GetFrameNumber"))
878 if (alGetFrameNumber(self
->port
, &fnum
) < 0)
881 return PyLong_FromLongLong((long long) fnum
);
885 PyDoc_STRVAR(alp_GetFrameTime__doc__
,
886 "alGetFrameTime: get the time at which a sample frame came "
887 "in or will go out.");
890 alp_GetFrameTime(alpobject
*self
, PyObject
*args
)
893 PyObject
*ret
, *v0
, *v1
;
895 if (!PyArg_ParseTuple(args
, ":GetFrameTime"))
897 if (alGetFrameTime(self
->port
, &fnum
, &time
) < 0)
899 v0
= PyLong_FromLongLong((long long) fnum
);
900 v1
= PyLong_FromLongLong((long long) time
);
901 if (PyErr_Occurred()) {
906 ret
= Py_BuildValue("(OO)", v0
, v1
);
913 PyDoc_STRVAR(alp_WriteFrames__doc__
,
914 "alWriteFrames: write sample frames to an audio port.");
917 alp_WriteFrames(alpobject
*self
, PyObject
*args
)
924 if (!PyArg_ParseTuple(args
, "s#:WriteFrames", &samples
, &length
))
926 c
= alGetConfig(self
->port
);
927 switch (alGetSampFmt(c
)) {
928 case AL_SAMPFMT_TWOSCOMP
:
929 switch (alGetWidth(c
)) {
940 PyErr_SetString(ErrorObject
, "can't determine width");
945 case AL_SAMPFMT_FLOAT
:
948 case AL_SAMPFMT_DOUBLE
:
952 PyErr_SetString(ErrorObject
, "can't determine format");
956 ch
= alGetChannels(c
);
959 PyErr_SetString(ErrorObject
, "can't determine # of channels");
963 if (length
% size
!= 0) {
964 PyErr_SetString(ErrorObject
,
965 "buffer length not whole number of frames");
969 Py_BEGIN_ALLOW_THREADS
970 alWriteFrames(self
->port
, (void *) samples
, length
/ size
);
978 PyDoc_STRVAR(alp_ClosePort__doc__
, "alClosePort: close an audio port.");
981 alp_ClosePort(alpobject
*self
, PyObject
*args
)
983 if (!PyArg_ParseTuple(args
, ":ClosePort"))
985 if (alClosePort(self
->port
) < 0)
992 #endif /* AL_NO_ELEM */
996 alp_closeport(alpobject
*self
, PyObject
*args
)
998 if (!PyArg_ParseTuple(args
, ":ClosePort"))
1000 if (ALcloseport(self
->port
) < 0)
1008 alp_getfd(alpobject
*self
, PyObject
*args
)
1012 if (!PyArg_ParseTuple(args
, ":GetFD"))
1014 if ((fd
= ALgetfd(self
-> port
)) == -1)
1016 return PyInt_FromLong(fd
);
1020 alp_getfilled(alpobject
*self
, PyObject
*args
)
1024 if (!PyArg_ParseTuple(args
, ":GetFilled"))
1026 if ((count
= ALgetfilled(self
-> port
)) == -1)
1028 return PyInt_FromLong(count
);
1032 alp_getfillable(alpobject
*self
, PyObject
*args
)
1036 if (!PyArg_ParseTuple(args
, ":GetFillable"))
1038 if ((count
= ALgetfillable(self
-> port
)) == -1)
1040 return PyInt_FromLong (count
);
1044 alp_readsamps(alpobject
*self
, PyObject
*args
)
1052 if (!PyArg_ParseTuple(args
, "l:readsamps", &count
))
1056 PyErr_SetString(ErrorObject
, "al.readsamps : arg <= 0");
1060 c
= ALgetconfig(self
->port
);
1062 width
= ALgetsampfmt(c
);
1063 if (width
== AL_SAMPFMT_FLOAT
)
1064 width
= sizeof(float);
1065 else if (width
== AL_SAMPFMT_DOUBLE
)
1066 width
= sizeof(double);
1068 width
= ALgetwidth(c
);
1070 width
= ALgetwidth(c
);
1073 v
= PyString_FromStringAndSize((char *)NULL
, width
* count
);
1077 Py_BEGIN_ALLOW_THREADS
1078 ret
= ALreadsamps(self
->port
, (void *) PyString_AsString(v
), count
);
1079 Py_END_ALLOW_THREADS
1089 alp_writesamps(alpobject
*self
, PyObject
*args
)
1096 if (!PyArg_ParseTuple(args
, "s#:writesamps", &buf
, &size
))
1099 c
= ALgetconfig(self
->port
);
1101 width
= ALgetsampfmt(c
);
1102 if (width
== AL_SAMPFMT_FLOAT
)
1103 width
= sizeof(float);
1104 else if (width
== AL_SAMPFMT_DOUBLE
)
1105 width
= sizeof(double);
1107 width
= ALgetwidth(c
);
1109 width
= ALgetwidth(c
);
1112 Py_BEGIN_ALLOW_THREADS
1113 ret
= ALwritesamps (self
->port
, (void *) buf
, (long) size
/ width
);
1114 Py_END_ALLOW_THREADS
1123 alp_getfillpoint(alpobject
*self
, PyObject
*args
)
1127 if (!PyArg_ParseTuple(args
, ":GetFillPoint"))
1129 if ((count
= ALgetfillpoint(self
->port
)) == -1)
1131 return PyInt_FromLong(count
);
1135 alp_setfillpoint(alpobject
*self
, PyObject
*args
)
1139 if (!PyArg_ParseTuple(args
, "l:SetFillPoint", &count
))
1141 if (ALsetfillpoint(self
->port
, count
) == -1)
1148 alp_setconfig(alpobject
*self
, PyObject
*args
)
1152 if (!PyArg_ParseTuple(args
, "O!:SetConfig", &Alctype
, &config
))
1154 if (ALsetconfig(self
->port
, config
->config
) == -1)
1161 alp_getconfig(alpobject
*self
, PyObject
*args
)
1165 if (!PyArg_ParseTuple(args
, ":GetConfig"))
1167 config
= ALgetconfig(self
->port
);
1170 return newalcobject(config
);
1175 alp_getstatus(alpobject
*self
, PyObject
*args
)
1182 if (!PyArg_ParseTuple(args
, "O!", &PyList_Type
, &list
))
1184 length
= PyList_Size(list
);
1185 PVbuffer
= PyMem_NEW(long, length
);
1186 if (PVbuffer
== NULL
)
1187 return PyErr_NoMemory();
1188 for (i
= 0; i
< length
; i
++) {
1189 v
= PyList_GetItem(list
, i
);
1190 if (!PyInt_Check(v
)) {
1191 PyMem_DEL(PVbuffer
);
1192 PyErr_BadArgument();
1195 PVbuffer
[i
] = PyInt_AsLong(v
);
1198 if (ALgetstatus(self
->port
, PVbuffer
, length
) == -1)
1201 for (i
= 0; i
< length
; i
++)
1202 PyList_SetItem(list
, i
, PyInt_FromLong(PVbuffer
[i
]));
1204 PyMem_DEL(PVbuffer
);
1211 #endif /* OLD_INTERFACE */
1213 static struct PyMethodDef alp_methods
[] = {
1214 #ifdef AL_NO_ELEM /* IRIX 6 */
1215 {"SetConfig", (PyCFunction
)alp_SetConfig
, METH_VARARGS
, alp_SetConfig__doc__
},
1216 {"GetConfig", (PyCFunction
)alp_GetConfig
, METH_VARARGS
, alp_GetConfig__doc__
},
1217 {"GetResource", (PyCFunction
)alp_GetResource
, METH_VARARGS
, alp_GetResource__doc__
},
1218 {"GetFD", (PyCFunction
)alp_GetFD
, METH_VARARGS
, alp_GetFD__doc__
},
1219 {"GetFilled", (PyCFunction
)alp_GetFilled
, METH_VARARGS
, alp_GetFilled__doc__
},
1220 {"GetFillable", (PyCFunction
)alp_GetFillable
, METH_VARARGS
, alp_GetFillable__doc__
},
1221 {"ReadFrames", (PyCFunction
)alp_ReadFrames
, METH_VARARGS
, alp_ReadFrames__doc__
},
1222 {"DiscardFrames", (PyCFunction
)alp_DiscardFrames
, METH_VARARGS
, alp_DiscardFrames__doc__
},
1223 {"ZeroFrames", (PyCFunction
)alp_ZeroFrames
, METH_VARARGS
, alp_ZeroFrames__doc__
},
1224 {"SetFillPoint", (PyCFunction
)alp_SetFillPoint
, METH_VARARGS
, alp_SetFillPoint__doc__
},
1225 {"GetFillPoint", (PyCFunction
)alp_GetFillPoint
, METH_VARARGS
, alp_GetFillPoint__doc__
},
1226 {"GetFrameNumber", (PyCFunction
)alp_GetFrameNumber
, METH_VARARGS
, alp_GetFrameNumber__doc__
},
1227 {"GetFrameTime", (PyCFunction
)alp_GetFrameTime
, METH_VARARGS
, alp_GetFrameTime__doc__
},
1228 {"WriteFrames", (PyCFunction
)alp_WriteFrames
, METH_VARARGS
, alp_WriteFrames__doc__
},
1229 {"ClosePort", (PyCFunction
)alp_ClosePort
, METH_VARARGS
, alp_ClosePort__doc__
},
1230 #endif /* AL_NO_ELEM */
1231 #ifdef OLD_INTERFACE
1232 {"closeport", (PyCFunction
)alp_closeport
, METH_VARARGS
},
1233 {"getfd", (PyCFunction
)alp_getfd
, METH_VARARGS
},
1234 {"fileno", (PyCFunction
)alp_getfd
, METH_VARARGS
},
1235 {"getfilled", (PyCFunction
)alp_getfilled
, METH_VARARGS
},
1236 {"getfillable", (PyCFunction
)alp_getfillable
, METH_VARARGS
},
1237 {"readsamps", (PyCFunction
)alp_readsamps
, METH_VARARGS
},
1238 {"writesamps", (PyCFunction
)alp_writesamps
, METH_VARARGS
},
1239 {"setfillpoint", (PyCFunction
)alp_setfillpoint
, METH_VARARGS
},
1240 {"getfillpoint", (PyCFunction
)alp_getfillpoint
, METH_VARARGS
},
1241 {"setconfig", (PyCFunction
)alp_setconfig
, METH_VARARGS
},
1242 {"getconfig", (PyCFunction
)alp_getconfig
, METH_VARARGS
},
1244 {"getstatus", (PyCFunction
)alp_getstatus
, METH_VARARGS
},
1246 #endif /* OLD_INTERFACE */
1248 {NULL
, NULL
} /* sentinel */
1255 newalpobject(ALport port
)
1259 self
= PyObject_New(alpobject
, &Alptype
);
1262 /* XXXX Add your own initializers here */
1264 return (PyObject
*) self
;
1269 alp_dealloc(alpobject
*self
)
1271 /* XXXX Add your own cleanup code here */
1273 #ifdef AL_NO_ELEM /* IRIX 6 */
1274 alClosePort(self
->port
);
1276 ALcloseport(self
->port
);
1283 alp_getattr(alpobject
*self
, char *name
)
1285 /* XXXX Add your own getattr code here */
1286 if (self
->port
== NULL
) {
1287 PyErr_SetString(ErrorObject
, "port already closed");
1290 return Py_FindMethod(alp_methods
, (PyObject
*)self
, name
);
1293 PyDoc_STRVAR(Alptype__doc__
, "");
1295 static PyTypeObject Alptype
= {
1296 PyObject_HEAD_INIT(&PyType_Type
)
1298 "al.port", /*tp_name*/
1299 sizeof(alpobject
), /*tp_basicsize*/
1302 (destructor
)alp_dealloc
, /*tp_dealloc*/
1303 (printfunc
)0, /*tp_print*/
1304 (getattrfunc
)alp_getattr
, /*tp_getattr*/
1305 (setattrfunc
)0, /*tp_setattr*/
1306 (cmpfunc
)0, /*tp_compare*/
1307 (reprfunc
)0, /*tp_repr*/
1309 0, /*tp_as_sequence*/
1310 0, /*tp_as_mapping*/
1311 (hashfunc
)0, /*tp_hash*/
1312 (ternaryfunc
)0, /*tp_call*/
1313 (reprfunc
)0, /*tp_str*/
1315 /* Space for future expansion */
1317 Alptype__doc__
/* Documentation string */
1320 /* End of code for port objects */
1321 /* -------------------------------------------------------- */
1324 #ifdef AL_NO_ELEM /* IRIX 6 */
1326 PyDoc_STRVAR(al_NewConfig__doc__
,
1327 "alNewConfig: create and initialize an audio ALconfig structure.");
1330 al_NewConfig(PyObject
*self
, PyObject
*args
)
1334 if (!PyArg_ParseTuple(args
, ":NewConfig"))
1336 if ((config
= alNewConfig()) == NULL
)
1338 return newalcobject(config
);
1341 PyDoc_STRVAR(al_OpenPort__doc__
,
1342 "alOpenPort: open an audio port.");
1345 al_OpenPort(PyObject
*self
, PyObject
*args
)
1349 alcobject
*config
= NULL
;
1351 if (!PyArg_ParseTuple(args
, "ss|O!:OpenPort", &name
, &dir
, &Alctype
, &config
))
1353 if ((port
= alOpenPort(name
, dir
, config
? config
->config
: NULL
)) == NULL
)
1355 return newalpobject(port
);
1358 PyDoc_STRVAR(al_Connect__doc__
,
1359 "alConnect: connect two audio I/O resources.");
1362 al_Connect(PyObject
*self
, PyObject
*args
)
1364 int source
, dest
, nprops
= 0, id
, i
;
1366 ALparamInfo
*propinfo
= NULL
;
1367 PyObject
*propobj
= NULL
;
1369 if (!PyArg_ParseTuple(args
, "ii|O!:Connect", &source
, &dest
, &PyList_Type
, &propobj
))
1371 if (propobj
!= NULL
) {
1372 nprops
= python2params(source
, dest
, propobj
, &props
, &propinfo
);
1377 id
= alConnect(source
, dest
, props
, nprops
);
1380 for (i
= 0; i
< nprops
; i
++) {
1381 switch (propinfo
[i
].valueType
) {
1384 PyMem_DEL(props
[i
].value
.ptr
);
1389 PyMem_DEL(propinfo
);
1394 return PyInt_FromLong((long) id
);
1397 PyDoc_STRVAR(al_Disconnect__doc__
,
1398 "alDisconnect: delete a connection between two audio I/O resources.");
1401 al_Disconnect(PyObject
*self
, PyObject
*args
)
1405 if (!PyArg_ParseTuple(args
, "i:Disconnect", &res
))
1407 if (alDisconnect(res
) < 0)
1413 PyDoc_STRVAR(al_GetParams__doc__
,
1414 "alGetParams: get the values of audio resource parameters.");
1417 al_GetParams(PyObject
*self
, PyObject
*args
)
1420 PyObject
*pvslist
, *item
= NULL
, *v
= NULL
;
1425 if (!PyArg_ParseTuple(args
, "iO!:GetParams", &resource
, &PyList_Type
, &pvslist
))
1427 npvs
= PyList_Size(pvslist
);
1428 pvs
= PyMem_NEW(ALpv
, npvs
);
1429 pinfo
= PyMem_NEW(ALparamInfo
, npvs
);
1430 for (i
= 0; i
< npvs
; i
++) {
1431 item
= PyList_GetItem(pvslist
, i
);
1432 if (!PyInt_Check(item
)) {
1434 PyErr_SetString(ErrorObject
, "list of integers expected");
1437 pvs
[i
].param
= (int) PyInt_AsLong(item
);
1438 item
= NULL
; /* not needed anymore */
1439 if (alGetParamInfo(resource
, pvs
[i
].param
, &pinfo
[i
]) < 0)
1441 switch (pinfo
[i
].valueType
) {
1445 pinfo
[i
].maxElems
*= pinfo
[i
].maxElems2
;
1450 switch (pinfo
[i
].elementType
) {
1452 case AL_RESOURCE_ELEM
:
1454 pvs
[i
].value
.ptr
= PyMem_NEW(int, pinfo
[i
].maxElems
);
1455 pvs
[i
].sizeIn
= pinfo
[i
].maxElems
;
1459 pvs
[i
].value
.ptr
= PyMem_NEW(long long, pinfo
[i
].maxElems
);
1460 pvs
[i
].sizeIn
= pinfo
[i
].maxElems
;
1463 pvs
[i
].value
.ptr
= PyMem_NEW(char, 32);
1469 PyErr_SetString(ErrorObject
, "internal error");
1476 PyErr_SetString(ErrorObject
, "internal error");
1479 if (pinfo
[i
].valueType
== AL_MATRIX_VAL
) {
1480 pinfo
[i
].maxElems
/= pinfo
[i
].maxElems2
;
1481 pvs
[i
].sizeIn
/= pinfo
[i
].maxElems2
;
1482 pvs
[i
].size2In
= pinfo
[i
].maxElems2
;
1485 if (alGetParams(resource
, pvs
, npvs
) < 0)
1487 v
= PyList_New(npvs
);
1488 for (i
= 0; i
< npvs
; i
++) {
1489 if (pvs
[i
].sizeOut
< 0) {
1491 PyOS_snprintf(buf
, sizeof(buf
),
1492 "problem with param %d", i
);
1493 PyErr_SetString(ErrorObject
, buf
);
1496 switch (pinfo
[i
].valueType
) {
1502 item
= PyString_FromString(pvs
[i
].value
.ptr
);
1503 PyMem_DEL(pvs
[i
].value
.ptr
);
1506 /* XXXX this is not right */
1507 pvs
[i
].sizeOut
*= pvs
[i
].size2Out
;
1511 item
= PyList_New(pvs
[i
].sizeOut
);
1512 for (j
= 0; j
< pvs
[i
].sizeOut
; j
++) {
1513 switch (pinfo
[i
].elementType
) {
1515 case AL_RESOURCE_ELEM
:
1517 PyList_SetItem(item
, j
, PyInt_FromLong((long) ((int *) pvs
[i
].value
.ptr
)[j
]));
1520 PyList_SetItem(item
, j
, PyLong_FromLongLong(((long long *) pvs
[i
].value
.ptr
)[j
]));
1523 PyList_SetItem(item
, j
, PyFloat_FromDouble(alFixedToDouble(((long long *) pvs
[i
].value
.ptr
)[j
])));
1526 PyErr_SetString(ErrorObject
, "internal error");
1530 PyMem_DEL(pvs
[i
].value
.ptr
);
1533 item
= param2python(resource
, pvs
[i
].param
, pvs
[i
].value
, &pinfo
[i
]);
1536 if (PyErr_Occurred() ||
1537 PyList_SetItem(v
, i
, Py_BuildValue("(iO)", pvs
[i
].param
,
1557 PyDoc_STRVAR(al_SetParams__doc__
,
1558 "alSetParams: set the values of audio resource parameters.");
1561 al_SetParams(PyObject
*self
, PyObject
*args
)
1564 PyObject
*pvslist
, *item
;
1569 if (!PyArg_ParseTuple(args
, "iO!:SetParams", &resource
, &PyList_Type
, &pvslist
))
1571 npvs
= python2params(resource
, -1, pvslist
, &pvs
, &pinfo
);
1575 if (alSetParams(resource
, pvs
, npvs
) < 0)
1579 for (i
= 0; i
< npvs
; i
++) {
1580 switch (pinfo
[i
].valueType
) {
1583 PyMem_DEL(pvs
[i
].value
.ptr
);
1594 /* XXXX we should clean up everything */
1602 PyDoc_STRVAR(al_QueryValues__doc__
,
1603 "alQueryValues: get the set of possible values for a parameter.");
1606 al_QueryValues(PyObject
*self
, PyObject
*args
)
1608 int resource
, param
;
1609 ALvalue
*return_set
= NULL
;
1610 int setsize
= 32, qualsize
= 0, nvals
, i
;
1613 ALparamInfo
*qualinfo
= NULL
;
1614 PyObject
*qualobj
= NULL
;
1615 PyObject
*res
= NULL
, *item
;
1617 if (!PyArg_ParseTuple(args
, "ii|O!:QueryValues", &resource
, ¶m
,
1618 &PyList_Type
, &qualobj
))
1620 if (qualobj
!= NULL
) {
1621 qualsize
= python2params(resource
, param
, qualobj
, &quals
, &qualinfo
);
1626 return_set
= PyMem_NEW(ALvalue
, setsize
);
1627 if (return_set
== NULL
) {
1633 nvals
= alQueryValues(resource
, param
, return_set
, setsize
, quals
, qualsize
);
1636 if (nvals
> setsize
) {
1638 PyMem_RESIZE(return_set
, ALvalue
, setsize
);
1639 if (return_set
== NULL
) {
1646 if (alGetParamInfo(resource
, param
, &pinfo
) < 0)
1649 res
= PyList_New(nvals
);
1652 for (i
= 0; i
< nvals
; i
++) {
1653 item
= param2python(resource
, param
, return_set
[i
], &pinfo
);
1655 PyList_SetItem(res
, i
, item
) < 0) {
1664 PyMem_DEL(return_set
);
1666 for (i
= 0; i
< qualsize
; i
++) {
1667 switch (qualinfo
[i
].valueType
) {
1670 PyMem_DEL(quals
[i
].value
.ptr
);
1675 PyMem_DEL(qualinfo
);
1681 PyDoc_STRVAR(al_GetParamInfo__doc__
,
1682 "alGetParamInfo: get information about a parameter on "
1683 "a particular audio resource.");
1686 al_GetParamInfo(PyObject
*self
, PyObject
*args
)
1690 PyObject
*v
, *item
;;
1692 if (!PyArg_ParseTuple(args
, "ii:GetParamInfo", &res
, ¶m
))
1694 if (alGetParamInfo(res
, param
, &pinfo
) < 0)
1698 item
= PyInt_FromLong((long) pinfo
.resource
);
1699 PyDict_SetItemString(v
, "resource", item
);
1702 item
= PyInt_FromLong((long) pinfo
.param
);
1703 PyDict_SetItemString(v
, "param", item
);
1706 item
= PyInt_FromLong((long) pinfo
.valueType
);
1707 PyDict_SetItemString(v
, "valueType", item
);
1710 if (pinfo
.valueType
!= AL_NO_VAL
&& pinfo
.valueType
!= AL_SCALAR_VAL
) {
1711 /* multiple values */
1712 item
= PyInt_FromLong((long) pinfo
.maxElems
);
1713 PyDict_SetItemString(v
, "maxElems", item
);
1716 if (pinfo
.valueType
== AL_MATRIX_VAL
) {
1718 item
= PyInt_FromLong((long) pinfo
.maxElems2
);
1719 PyDict_SetItemString(v
, "maxElems2", item
);
1724 item
= PyInt_FromLong((long) pinfo
.elementType
);
1725 PyDict_SetItemString(v
, "elementType", item
);
1728 item
= PyString_FromString(pinfo
.name
);
1729 PyDict_SetItemString(v
, "name", item
);
1732 item
= param2python(res
, param
, pinfo
.initial
, &pinfo
);
1733 PyDict_SetItemString(v
, "initial", item
);
1736 if (pinfo
.elementType
!= AL_ENUM_ELEM
&&
1737 pinfo
.elementType
!= AL_RESOURCE_ELEM
&&
1738 pinfo
.elementType
!= AL_CHAR_ELEM
) {
1740 item
= param2python(res
, param
, pinfo
.min
, &pinfo
);
1741 PyDict_SetItemString(v
, "min", item
);
1744 item
= param2python(res
, param
, pinfo
.max
, &pinfo
);
1745 PyDict_SetItemString(v
, "max", item
);
1748 item
= param2python(res
, param
, pinfo
.minDelta
, &pinfo
);
1749 PyDict_SetItemString(v
, "minDelta", item
);
1752 item
= param2python(res
, param
, pinfo
.maxDelta
, &pinfo
);
1753 PyDict_SetItemString(v
, "maxDelta", item
);
1756 item
= PyInt_FromLong((long) pinfo
.specialVals
);
1757 PyDict_SetItemString(v
, "specialVals", item
);
1764 PyDoc_STRVAR(al_GetResourceByName__doc__
,
1765 "alGetResourceByName: find an audio resource by name.");
1768 al_GetResourceByName(PyObject
*self
, PyObject
*args
)
1770 int res
, start_res
, type
;
1773 if (!PyArg_ParseTuple(args
, "isi:GetResourceByName", &start_res
, &name
, &type
))
1775 if ((res
= alGetResourceByName(start_res
, name
, type
)) == 0)
1777 return PyInt_FromLong((long) res
);
1780 PyDoc_STRVAR(al_IsSubtype__doc__
,
1781 "alIsSubtype: indicate if one resource type is a subtype of another.");
1784 al_IsSubtype(PyObject
*self
, PyObject
*args
)
1788 if (!PyArg_ParseTuple(args
, "ii:IsSubtype", &type
, &subtype
))
1790 return PyInt_FromLong((long) alIsSubtype(type
, subtype
));
1793 PyDoc_STRVAR(al_SetErrorHandler__doc__
, "");
1796 al_SetErrorHandler(PyObject
*self
, PyObject
*args
)
1799 if (!PyArg_ParseTuple(args
, ":SetErrorHandler"))
1805 #endif /* AL_NO_ELEM */
1807 #ifdef OLD_INTERFACE
1810 al_openport(PyObject
*self
, PyObject
*args
)
1814 alcobject
*config
= NULL
;
1816 if (!PyArg_ParseTuple(args
, "ss|O!:OpenPort", &name
, &dir
, &Alctype
, &config
))
1818 if ((port
= ALopenport(name
, dir
, config
? config
->config
: NULL
)) == NULL
)
1820 return newalpobject(port
);
1824 al_newconfig(PyObject
*self
, PyObject
*args
)
1828 if (!PyArg_ParseTuple(args
, ":NewConfig"))
1830 if ((config
= ALnewconfig ()) == NULL
)
1832 return newalcobject(config
);
1836 al_queryparams(PyObject
*self
, PyObject
*args
)
1845 if (!PyArg_ParseTuple(args
, "l:queryparams", &device
))
1847 if ((length
= ALqueryparams(device
, PVdummy
, 2L)) == -1)
1849 if ((PVbuffer
= PyMem_NEW(long, length
)) == NULL
)
1850 return PyErr_NoMemory();
1851 if (ALqueryparams(device
, PVbuffer
, length
) >= 0 &&
1852 (v
= PyList_New((int)length
)) != NULL
) {
1853 for (i
= 0; i
< length
; i
++)
1854 PyList_SetItem(v
, i
, PyInt_FromLong(PVbuffer
[i
]));
1856 PyMem_DEL(PVbuffer
);
1861 doParams(PyObject
*args
, int (*func
)(long, long *, long), int modified
)
1869 if (!PyArg_ParseTuple(args
, "lO!", &device
, &PyList_Type
, &list
))
1871 length
= PyList_Size(list
);
1872 PVbuffer
= PyMem_NEW(long, length
);
1873 if (PVbuffer
== NULL
)
1874 return PyErr_NoMemory();
1875 for (i
= 0; i
< length
; i
++) {
1876 v
= PyList_GetItem(list
, i
);
1877 if (!PyInt_Check(v
)) {
1878 PyMem_DEL(PVbuffer
);
1879 PyErr_BadArgument();
1882 PVbuffer
[i
] = PyInt_AsLong(v
);
1885 if ((*func
)(device
, PVbuffer
, length
) == -1) {
1886 PyMem_DEL(PVbuffer
);
1891 for (i
= 0; i
< length
; i
++)
1892 PyList_SetItem(list
, i
, PyInt_FromLong(PVbuffer
[i
]));
1895 PyMem_DEL(PVbuffer
);
1902 al_getparams(PyObject
*self
, PyObject
*args
)
1904 return doParams(args
, ALgetparams
, 1);
1908 al_setparams(PyObject
*self
, PyObject
*args
)
1910 return doParams(args
, ALsetparams
, 0);
1914 al_getname(PyObject
*self
, PyObject
*args
)
1916 long device
, descriptor
;
1919 if (!PyArg_ParseTuple(args
, "ll:getname", &device
, &descriptor
))
1921 if ((name
= ALgetname(device
, descriptor
)) == NULL
)
1923 return PyString_FromString(name
);
1927 al_getdefault(PyObject
*self
, PyObject
*args
)
1929 long device
, descriptor
, value
;
1931 if (!PyArg_ParseTuple(args
, "ll:getdefault", &device
, &descriptor
))
1933 if ((value
= ALgetdefault(device
, descriptor
)) == -1)
1935 return PyLong_FromLong(value
);
1939 al_getminmax(PyObject
*self
, PyObject
*args
)
1941 long device
, descriptor
, min
, max
;
1943 if (!PyArg_ParseTuple(args
, "ll:getminmax", &device
, &descriptor
))
1947 if (ALgetminmax(device
, descriptor
, &min
, &max
) == -1)
1949 return Py_BuildValue("ll", min
, max
);
1952 #endif /* OLD_INTERFACE */
1954 /* List of methods defined in the module */
1956 static struct PyMethodDef al_methods
[] = {
1957 #ifdef AL_NO_ELEM /* IRIX 6 */
1958 {"NewConfig", (PyCFunction
)al_NewConfig
, METH_VARARGS
, al_NewConfig__doc__
},
1959 {"OpenPort", (PyCFunction
)al_OpenPort
, METH_VARARGS
, al_OpenPort__doc__
},
1960 {"Connect", (PyCFunction
)al_Connect
, METH_VARARGS
, al_Connect__doc__
},
1961 {"Disconnect", (PyCFunction
)al_Disconnect
, METH_VARARGS
, al_Disconnect__doc__
},
1962 {"GetParams", (PyCFunction
)al_GetParams
, METH_VARARGS
, al_GetParams__doc__
},
1963 {"SetParams", (PyCFunction
)al_SetParams
, METH_VARARGS
, al_SetParams__doc__
},
1964 {"QueryValues", (PyCFunction
)al_QueryValues
, METH_VARARGS
, al_QueryValues__doc__
},
1965 {"GetParamInfo", (PyCFunction
)al_GetParamInfo
, METH_VARARGS
, al_GetParamInfo__doc__
},
1966 {"GetResourceByName", (PyCFunction
)al_GetResourceByName
, METH_VARARGS
, al_GetResourceByName__doc__
},
1967 {"IsSubtype", (PyCFunction
)al_IsSubtype
, METH_VARARGS
, al_IsSubtype__doc__
},
1969 /* this one not supported */
1970 {"SetErrorHandler", (PyCFunction
)al_SetErrorHandler
, METH_VARARGS
, al_SetErrorHandler__doc__
},
1972 #endif /* AL_NO_ELEM */
1973 #ifdef OLD_INTERFACE
1974 {"openport", (PyCFunction
)al_openport
, METH_VARARGS
},
1975 {"newconfig", (PyCFunction
)al_newconfig
, METH_VARARGS
},
1976 {"queryparams", (PyCFunction
)al_queryparams
, METH_VARARGS
},
1977 {"getparams", (PyCFunction
)al_getparams
, METH_VARARGS
},
1978 {"setparams", (PyCFunction
)al_setparams
, METH_VARARGS
},
1979 {"getname", (PyCFunction
)al_getname
, METH_VARARGS
},
1980 {"getdefault", (PyCFunction
)al_getdefault
, METH_VARARGS
},
1981 {"getminmax", (PyCFunction
)al_getminmax
, METH_VARARGS
},
1982 #endif /* OLD_INTERFACE */
1984 {NULL
, (PyCFunction
)NULL
, 0, NULL
} /* sentinel */
1988 /* Initialization function for the module (*must* be called inital) */
1990 PyDoc_STRVAR(al_module_documentation
, "");
1995 PyObject
*m
, *d
, *x
;
1997 /* Create the module and add the functions */
1998 m
= Py_InitModule4("al", al_methods
,
1999 al_module_documentation
,
2000 (PyObject
*)NULL
,PYTHON_API_VERSION
);
2002 /* Add some symbolic constants to the module */
2003 d
= PyModule_GetDict(m
);
2004 ErrorObject
= PyErr_NewException("al.error", NULL
, NULL
);
2005 PyDict_SetItemString(d
, "error", ErrorObject
);
2007 /* XXXX Add constants here */
2009 x
= PyInt_FromLong((long) AL_4CHANNEL
);
2010 if (x
== NULL
|| PyDict_SetItemString(d
, "FOURCHANNEL", x
) < 0)
2014 #ifdef AL_ADAT_IF_TYPE
2015 x
= PyInt_FromLong((long) AL_ADAT_IF_TYPE
);
2016 if (x
== NULL
|| PyDict_SetItemString(d
, "ADAT_IF_TYPE", x
) < 0)
2020 #ifdef AL_ADAT_MCLK_TYPE
2021 x
= PyInt_FromLong((long) AL_ADAT_MCLK_TYPE
);
2022 if (x
== NULL
|| PyDict_SetItemString(d
, "ADAT_MCLK_TYPE", x
) < 0)
2026 #ifdef AL_AES_IF_TYPE
2027 x
= PyInt_FromLong((long) AL_AES_IF_TYPE
);
2028 if (x
== NULL
|| PyDict_SetItemString(d
, "AES_IF_TYPE", x
) < 0)
2032 #ifdef AL_AES_MCLK_TYPE
2033 x
= PyInt_FromLong((long) AL_AES_MCLK_TYPE
);
2034 if (x
== NULL
|| PyDict_SetItemString(d
, "AES_MCLK_TYPE", x
) < 0)
2038 #ifdef AL_ANALOG_IF_TYPE
2039 x
= PyInt_FromLong((long) AL_ANALOG_IF_TYPE
);
2040 if (x
== NULL
|| PyDict_SetItemString(d
, "ANALOG_IF_TYPE", x
) < 0)
2045 x
= PyInt_FromLong((long) AL_ASSOCIATE
);
2046 if (x
== NULL
|| PyDict_SetItemString(d
, "ASSOCIATE", x
) < 0)
2050 #ifdef AL_BAD_BUFFER_NULL
2051 x
= PyInt_FromLong((long) AL_BAD_BUFFER_NULL
);
2052 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFER_NULL", x
) < 0)
2056 #ifdef AL_BAD_BUFFERLENGTH
2057 x
= PyInt_FromLong((long) AL_BAD_BUFFERLENGTH
);
2058 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH", x
) < 0)
2062 #ifdef AL_BAD_BUFFERLENGTH_NEG
2063 x
= PyInt_FromLong((long) AL_BAD_BUFFERLENGTH_NEG
);
2064 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH_NEG", x
) < 0)
2068 #ifdef AL_BAD_BUFFERLENGTH_ODD
2069 x
= PyInt_FromLong((long) AL_BAD_BUFFERLENGTH_ODD
);
2070 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH_ODD", x
) < 0)
2074 #ifdef AL_BAD_CHANNELS
2075 x
= PyInt_FromLong((long) AL_BAD_CHANNELS
);
2076 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_CHANNELS", x
) < 0)
2080 #ifdef AL_BAD_CONFIG
2081 x
= PyInt_FromLong((long) AL_BAD_CONFIG
);
2082 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_CONFIG", x
) < 0)
2086 #ifdef AL_BAD_COUNT_NEG
2087 x
= PyInt_FromLong((long) AL_BAD_COUNT_NEG
);
2088 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_COUNT_NEG", x
) < 0)
2092 #ifdef AL_BAD_DEVICE
2093 x
= PyInt_FromLong((long) AL_BAD_DEVICE
);
2094 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_DEVICE", x
) < 0)
2098 #ifdef AL_BAD_DEVICE_ACCESS
2099 x
= PyInt_FromLong((long) AL_BAD_DEVICE_ACCESS
);
2100 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_DEVICE_ACCESS", x
) < 0)
2104 #ifdef AL_BAD_DIRECTION
2105 x
= PyInt_FromLong((long) AL_BAD_DIRECTION
);
2106 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_DIRECTION", x
) < 0)
2110 #ifdef AL_BAD_FILLPOINT
2111 x
= PyInt_FromLong((long) AL_BAD_FILLPOINT
);
2112 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_FILLPOINT", x
) < 0)
2116 #ifdef AL_BAD_FLOATMAX
2117 x
= PyInt_FromLong((long) AL_BAD_FLOATMAX
);
2118 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_FLOATMAX", x
) < 0)
2122 #ifdef AL_BAD_ILLEGAL_STATE
2123 x
= PyInt_FromLong((long) AL_BAD_ILLEGAL_STATE
);
2124 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_ILLEGAL_STATE", x
) < 0)
2128 #ifdef AL_BAD_NO_PORTS
2129 x
= PyInt_FromLong((long) AL_BAD_NO_PORTS
);
2130 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NO_PORTS", x
) < 0)
2134 #ifdef AL_BAD_NOT_FOUND
2135 x
= PyInt_FromLong((long) AL_BAD_NOT_FOUND
);
2136 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NOT_FOUND", x
) < 0)
2140 #ifdef AL_BAD_NOT_IMPLEMENTED
2141 x
= PyInt_FromLong((long) AL_BAD_NOT_IMPLEMENTED
);
2142 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NOT_IMPLEMENTED", x
) < 0)
2146 #ifdef AL_BAD_OUT_OF_MEM
2147 x
= PyInt_FromLong((long) AL_BAD_OUT_OF_MEM
);
2148 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_OUT_OF_MEM", x
) < 0)
2153 x
= PyInt_FromLong((long) AL_BAD_PARAM
);
2154 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PARAM", x
) < 0)
2158 #ifdef AL_BAD_PERMISSIONS
2159 x
= PyInt_FromLong((long) AL_BAD_PERMISSIONS
);
2160 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PERMISSIONS", x
) < 0)
2165 x
= PyInt_FromLong((long) AL_BAD_PORT
);
2166 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PORT", x
) < 0)
2170 #ifdef AL_BAD_PORTSTYLE
2171 x
= PyInt_FromLong((long) AL_BAD_PORTSTYLE
);
2172 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PORTSTYLE", x
) < 0)
2176 #ifdef AL_BAD_PVBUFFER
2177 x
= PyInt_FromLong((long) AL_BAD_PVBUFFER
);
2178 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PVBUFFER", x
) < 0)
2183 x
= PyInt_FromLong((long) AL_BAD_QSIZE
);
2184 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_QSIZE", x
) < 0)
2189 x
= PyInt_FromLong((long) AL_BAD_RATE
);
2190 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_RATE", x
) < 0)
2194 #ifdef AL_BAD_RESOURCE
2195 x
= PyInt_FromLong((long) AL_BAD_RESOURCE
);
2196 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_RESOURCE", x
) < 0)
2200 #ifdef AL_BAD_SAMPFMT
2201 x
= PyInt_FromLong((long) AL_BAD_SAMPFMT
);
2202 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_SAMPFMT", x
) < 0)
2206 #ifdef AL_BAD_TRANSFER_SIZE
2207 x
= PyInt_FromLong((long) AL_BAD_TRANSFER_SIZE
);
2208 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_TRANSFER_SIZE", x
) < 0)
2213 x
= PyInt_FromLong((long) AL_BAD_WIDTH
);
2214 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_WIDTH", x
) < 0)
2218 #ifdef AL_CHANNEL_MODE
2219 x
= PyInt_FromLong((long) AL_CHANNEL_MODE
);
2220 if (x
== NULL
|| PyDict_SetItemString(d
, "CHANNEL_MODE", x
) < 0)
2225 x
= PyInt_FromLong((long) AL_CHANNELS
);
2226 if (x
== NULL
|| PyDict_SetItemString(d
, "CHANNELS", x
) < 0)
2231 x
= PyInt_FromLong((long) AL_CHAR_ELEM
);
2232 if (x
== NULL
|| PyDict_SetItemString(d
, "CHAR_ELEM", x
) < 0)
2237 x
= PyInt_FromLong((long) AL_CLOCK_GEN
);
2238 if (x
== NULL
|| PyDict_SetItemString(d
, "CLOCK_GEN", x
) < 0)
2242 #ifdef AL_CLOCKGEN_TYPE
2243 x
= PyInt_FromLong((long) AL_CLOCKGEN_TYPE
);
2244 if (x
== NULL
|| PyDict_SetItemString(d
, "CLOCKGEN_TYPE", x
) < 0)
2249 x
= PyInt_FromLong((long) AL_CONNECT
);
2250 if (x
== NULL
|| PyDict_SetItemString(d
, "CONNECT", x
) < 0)
2254 #ifdef AL_CONNECTION_TYPE
2255 x
= PyInt_FromLong((long) AL_CONNECTION_TYPE
);
2256 if (x
== NULL
|| PyDict_SetItemString(d
, "CONNECTION_TYPE", x
) < 0)
2260 #ifdef AL_CONNECTIONS
2261 x
= PyInt_FromLong((long) AL_CONNECTIONS
);
2262 if (x
== NULL
|| PyDict_SetItemString(d
, "CONNECTIONS", x
) < 0)
2266 #ifdef AL_CRYSTAL_MCLK_TYPE
2267 x
= PyInt_FromLong((long) AL_CRYSTAL_MCLK_TYPE
);
2268 if (x
== NULL
|| PyDict_SetItemString(d
, "CRYSTAL_MCLK_TYPE", x
) < 0)
2272 #ifdef AL_DEFAULT_DEVICE
2273 x
= PyInt_FromLong((long) AL_DEFAULT_DEVICE
);
2274 if (x
== NULL
|| PyDict_SetItemString(d
, "DEFAULT_DEVICE", x
) < 0)
2278 #ifdef AL_DEFAULT_INPUT
2279 x
= PyInt_FromLong((long) AL_DEFAULT_INPUT
);
2280 if (x
== NULL
|| PyDict_SetItemString(d
, "DEFAULT_INPUT", x
) < 0)
2284 #ifdef AL_DEFAULT_OUTPUT
2285 x
= PyInt_FromLong((long) AL_DEFAULT_OUTPUT
);
2286 if (x
== NULL
|| PyDict_SetItemString(d
, "DEFAULT_OUTPUT", x
) < 0)
2291 x
= PyInt_FromLong((long) AL_DEST
);
2292 if (x
== NULL
|| PyDict_SetItemString(d
, "DEST", x
) < 0)
2296 #ifdef AL_DEVICE_TYPE
2297 x
= PyInt_FromLong((long) AL_DEVICE_TYPE
);
2298 if (x
== NULL
|| PyDict_SetItemString(d
, "DEVICE_TYPE", x
) < 0)
2303 x
= PyInt_FromLong((long) AL_DEVICES
);
2304 if (x
== NULL
|| PyDict_SetItemString(d
, "DEVICES", x
) < 0)
2308 #ifdef AL_DIGITAL_IF_TYPE
2309 x
= PyInt_FromLong((long) AL_DIGITAL_IF_TYPE
);
2310 if (x
== NULL
|| PyDict_SetItemString(d
, "DIGITAL_IF_TYPE", x
) < 0)
2314 #ifdef AL_DIGITAL_INPUT_RATE
2315 x
= PyInt_FromLong((long) AL_DIGITAL_INPUT_RATE
);
2316 if (x
== NULL
|| PyDict_SetItemString(d
, "DIGITAL_INPUT_RATE", x
) < 0)
2320 #ifdef AL_DISCONNECT
2321 x
= PyInt_FromLong((long) AL_DISCONNECT
);
2322 if (x
== NULL
|| PyDict_SetItemString(d
, "DISCONNECT", x
) < 0)
2327 x
= PyInt_FromLong((long) AL_ENUM_ELEM
);
2328 if (x
== NULL
|| PyDict_SetItemString(d
, "ENUM_ELEM", x
) < 0)
2332 #ifdef AL_ENUM_VALUE
2333 x
= PyInt_FromLong((long) AL_ENUM_VALUE
);
2334 if (x
== NULL
|| PyDict_SetItemString(d
, "ENUM_VALUE", x
) < 0)
2338 #ifdef AL_ERROR_INPUT_OVERFLOW
2339 x
= PyInt_FromLong((long) AL_ERROR_INPUT_OVERFLOW
);
2340 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_INPUT_OVERFLOW", x
) < 0)
2344 #ifdef AL_ERROR_LENGTH
2345 x
= PyInt_FromLong((long) AL_ERROR_LENGTH
);
2346 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_LENGTH", x
) < 0)
2350 #ifdef AL_ERROR_LOCATION_LSP
2351 x
= PyInt_FromLong((long) AL_ERROR_LOCATION_LSP
);
2352 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_LOCATION_LSP", x
) < 0)
2356 #ifdef AL_ERROR_LOCATION_MSP
2357 x
= PyInt_FromLong((long) AL_ERROR_LOCATION_MSP
);
2358 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_LOCATION_MSP", x
) < 0)
2362 #ifdef AL_ERROR_NUMBER
2363 x
= PyInt_FromLong((long) AL_ERROR_NUMBER
);
2364 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_NUMBER", x
) < 0)
2368 #ifdef AL_ERROR_OUTPUT_UNDERFLOW
2369 x
= PyInt_FromLong((long) AL_ERROR_OUTPUT_UNDERFLOW
);
2370 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_OUTPUT_UNDERFLOW", x
) < 0)
2374 #ifdef AL_ERROR_TYPE
2375 x
= PyInt_FromLong((long) AL_ERROR_TYPE
);
2376 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_TYPE", x
) < 0)
2380 #ifdef AL_FIXED_ELEM
2381 x
= PyInt_FromLong((long) AL_FIXED_ELEM
);
2382 if (x
== NULL
|| PyDict_SetItemString(d
, "FIXED_ELEM", x
) < 0)
2386 #ifdef AL_FIXED_MCLK_TYPE
2387 x
= PyInt_FromLong((long) AL_FIXED_MCLK_TYPE
);
2388 if (x
== NULL
|| PyDict_SetItemString(d
, "FIXED_MCLK_TYPE", x
) < 0)
2393 x
= PyInt_FromLong((long) AL_GAIN
);
2394 if (x
== NULL
|| PyDict_SetItemString(d
, "GAIN", x
) < 0)
2399 x
= PyInt_FromLong((long) AL_GAIN_REF
);
2400 if (x
== NULL
|| PyDict_SetItemString(d
, "GAIN_REF", x
) < 0)
2405 x
= PyInt_FromLong((long) AL_HRB_TYPE
);
2406 if (x
== NULL
|| PyDict_SetItemString(d
, "HRB_TYPE", x
) < 0)
2410 #ifdef AL_INPUT_COUNT
2411 x
= PyInt_FromLong((long) AL_INPUT_COUNT
);
2412 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_COUNT", x
) < 0)
2416 #ifdef AL_INPUT_DEVICE_TYPE
2417 x
= PyInt_FromLong((long) AL_INPUT_DEVICE_TYPE
);
2418 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_DEVICE_TYPE", x
) < 0)
2422 #ifdef AL_INPUT_DIGITAL
2423 x
= PyInt_FromLong((long) AL_INPUT_DIGITAL
);
2424 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_DIGITAL", x
) < 0)
2428 #ifdef AL_INPUT_HRB_TYPE
2429 x
= PyInt_FromLong((long) AL_INPUT_HRB_TYPE
);
2430 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_HRB_TYPE", x
) < 0)
2434 #ifdef AL_INPUT_LINE
2435 x
= PyInt_FromLong((long) AL_INPUT_LINE
);
2436 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_LINE", x
) < 0)
2441 x
= PyInt_FromLong((long) AL_INPUT_MIC
);
2442 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_MIC", x
) < 0)
2446 #ifdef AL_INPUT_PORT_TYPE
2447 x
= PyInt_FromLong((long) AL_INPUT_PORT_TYPE
);
2448 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_PORT_TYPE", x
) < 0)
2452 #ifdef AL_INPUT_RATE
2453 x
= PyInt_FromLong((long) AL_INPUT_RATE
);
2454 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_RATE", x
) < 0)
2458 #ifdef AL_INPUT_SOURCE
2459 x
= PyInt_FromLong((long) AL_INPUT_SOURCE
);
2460 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_SOURCE", x
) < 0)
2464 #ifdef AL_INT32_ELEM
2465 x
= PyInt_FromLong((long) AL_INT32_ELEM
);
2466 if (x
== NULL
|| PyDict_SetItemString(d
, "INT32_ELEM", x
) < 0)
2470 #ifdef AL_INT64_ELEM
2471 x
= PyInt_FromLong((long) AL_INT64_ELEM
);
2472 if (x
== NULL
|| PyDict_SetItemString(d
, "INT64_ELEM", x
) < 0)
2477 x
= PyInt_FromLong((long) AL_INTERFACE
);
2478 if (x
== NULL
|| PyDict_SetItemString(d
, "INTERFACE", x
) < 0)
2482 #ifdef AL_INTERFACE_TYPE
2483 x
= PyInt_FromLong((long) AL_INTERFACE_TYPE
);
2484 if (x
== NULL
|| PyDict_SetItemString(d
, "INTERFACE_TYPE", x
) < 0)
2488 #ifdef AL_INVALID_PARAM
2489 x
= PyInt_FromLong((long) AL_INVALID_PARAM
);
2490 if (x
== NULL
|| PyDict_SetItemString(d
, "INVALID_PARAM", x
) < 0)
2494 #ifdef AL_INVALID_VALUE
2495 x
= PyInt_FromLong((long) AL_INVALID_VALUE
);
2496 if (x
== NULL
|| PyDict_SetItemString(d
, "INVALID_VALUE", x
) < 0)
2501 x
= PyInt_FromLong((long) AL_JITTER
);
2502 if (x
== NULL
|| PyDict_SetItemString(d
, "JITTER", x
) < 0)
2507 x
= PyInt_FromLong((long) AL_LABEL
);
2508 if (x
== NULL
|| PyDict_SetItemString(d
, "LABEL", x
) < 0)
2512 #ifdef AL_LEFT_INPUT_ATTEN
2513 x
= PyInt_FromLong((long) AL_LEFT_INPUT_ATTEN
);
2514 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT_INPUT_ATTEN", x
) < 0)
2518 #ifdef AL_LEFT_MONITOR_ATTEN
2519 x
= PyInt_FromLong((long) AL_LEFT_MONITOR_ATTEN
);
2520 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT_MONITOR_ATTEN", x
) < 0)
2524 #ifdef AL_LEFT_SPEAKER_GAIN
2525 x
= PyInt_FromLong((long) AL_LEFT_SPEAKER_GAIN
);
2526 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT_SPEAKER_GAIN", x
) < 0)
2530 #ifdef AL_LEFT1_INPUT_ATTEN
2531 x
= PyInt_FromLong((long) AL_LEFT1_INPUT_ATTEN
);
2532 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT1_INPUT_ATTEN", x
) < 0)
2536 #ifdef AL_LEFT2_INPUT_ATTEN
2537 x
= PyInt_FromLong((long) AL_LEFT2_INPUT_ATTEN
);
2538 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT2_INPUT_ATTEN", x
) < 0)
2542 #ifdef AL_LINE_IF_TYPE
2543 x
= PyInt_FromLong((long) AL_LINE_IF_TYPE
);
2544 if (x
== NULL
|| PyDict_SetItemString(d
, "LINE_IF_TYPE", x
) < 0)
2548 #ifdef AL_MASTER_CLOCK
2549 x
= PyInt_FromLong((long) AL_MASTER_CLOCK
);
2550 if (x
== NULL
|| PyDict_SetItemString(d
, "MASTER_CLOCK", x
) < 0)
2554 #ifdef AL_MATRIX_VAL
2555 x
= PyInt_FromLong((long) AL_MATRIX_VAL
);
2556 if (x
== NULL
|| PyDict_SetItemString(d
, "MATRIX_VAL", x
) < 0)
2561 x
= PyInt_FromLong((long) AL_MAX_ERROR
);
2562 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_ERROR", x
) < 0)
2566 #ifdef AL_MAX_EVENT_PARAM
2567 x
= PyInt_FromLong((long) AL_MAX_EVENT_PARAM
);
2568 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_EVENT_PARAM", x
) < 0)
2572 #ifdef AL_MAX_PBUFSIZE
2573 x
= PyInt_FromLong((long) AL_MAX_PBUFSIZE
);
2574 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_PBUFSIZE", x
) < 0)
2579 x
= PyInt_FromLong((long) AL_MAX_PORTS
);
2580 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_PORTS", x
) < 0)
2584 #ifdef AL_MAX_RESOURCE_ID
2585 x
= PyInt_FromLong((long) AL_MAX_RESOURCE_ID
);
2586 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_RESOURCE_ID", x
) < 0)
2590 #ifdef AL_MAX_SETSIZE
2591 x
= PyInt_FromLong((long) AL_MAX_SETSIZE
);
2592 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_SETSIZE", x
) < 0)
2596 #ifdef AL_MAX_STRLEN
2597 x
= PyInt_FromLong((long) AL_MAX_STRLEN
);
2598 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_STRLEN", x
) < 0)
2603 x
= PyInt_FromLong((long) AL_MCLK_TYPE
);
2604 if (x
== NULL
|| PyDict_SetItemString(d
, "MCLK_TYPE", x
) < 0)
2608 #ifdef AL_MIC_IF_TYPE
2609 x
= PyInt_FromLong((long) AL_MIC_IF_TYPE
);
2610 if (x
== NULL
|| PyDict_SetItemString(d
, "MIC_IF_TYPE", x
) < 0)
2614 #ifdef AL_MONITOR_CTL
2615 x
= PyInt_FromLong((long) AL_MONITOR_CTL
);
2616 if (x
== NULL
|| PyDict_SetItemString(d
, "MONITOR_CTL", x
) < 0)
2620 #ifdef AL_MONITOR_OFF
2621 x
= PyInt_FromLong((long) AL_MONITOR_OFF
);
2622 if (x
== NULL
|| PyDict_SetItemString(d
, "MONITOR_OFF", x
) < 0)
2626 #ifdef AL_MONITOR_ON
2627 x
= PyInt_FromLong((long) AL_MONITOR_ON
);
2628 if (x
== NULL
|| PyDict_SetItemString(d
, "MONITOR_ON", x
) < 0)
2633 x
= PyInt_FromLong((long) AL_MONO
);
2634 if (x
== NULL
|| PyDict_SetItemString(d
, "MONO", x
) < 0)
2639 x
= PyInt_FromLong((long) AL_MUTE
);
2640 if (x
== NULL
|| PyDict_SetItemString(d
, "MUTE", x
) < 0)
2645 x
= PyInt_FromLong((long) AL_NAME
);
2646 if (x
== NULL
|| PyDict_SetItemString(d
, "NAME", x
) < 0)
2650 #ifdef AL_NEG_INFINITY
2651 x
= PyInt_FromLong((long) AL_NEG_INFINITY
);
2652 if (x
== NULL
|| PyDict_SetItemString(d
, "NEG_INFINITY", x
) < 0)
2656 #ifdef AL_NEG_INFINITY_BIT
2657 x
= PyInt_FromLong((long) AL_NEG_INFINITY_BIT
);
2658 if (x
== NULL
|| PyDict_SetItemString(d
, "NEG_INFINITY_BIT", x
) < 0)
2663 x
= PyInt_FromLong((long) AL_NO_CHANGE
);
2664 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_CHANGE", x
) < 0)
2668 #ifdef AL_NO_CHANGE_BIT
2669 x
= PyInt_FromLong((long) AL_NO_CHANGE_BIT
);
2670 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_CHANGE_BIT", x
) < 0)
2675 x
= PyInt_FromLong((long) AL_NO_ELEM
);
2676 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_ELEM", x
) < 0)
2681 x
= PyInt_FromLong((long) AL_NO_ERRORS
);
2682 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_ERRORS", x
) < 0)
2687 x
= PyInt_FromLong((long) AL_NO_OP
);
2688 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_OP", x
) < 0)
2693 x
= PyInt_FromLong((long) AL_NO_VAL
);
2694 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_VAL", x
) < 0)
2698 #ifdef AL_NULL_RESOURCE
2699 x
= PyInt_FromLong((long) AL_NULL_RESOURCE
);
2700 if (x
== NULL
|| PyDict_SetItemString(d
, "NULL_RESOURCE", x
) < 0)
2704 #ifdef AL_OUTPUT_COUNT
2705 x
= PyInt_FromLong((long) AL_OUTPUT_COUNT
);
2706 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_COUNT", x
) < 0)
2710 #ifdef AL_OUTPUT_DEVICE_TYPE
2711 x
= PyInt_FromLong((long) AL_OUTPUT_DEVICE_TYPE
);
2712 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_DEVICE_TYPE", x
) < 0)
2716 #ifdef AL_OUTPUT_HRB_TYPE
2717 x
= PyInt_FromLong((long) AL_OUTPUT_HRB_TYPE
);
2718 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_HRB_TYPE", x
) < 0)
2722 #ifdef AL_OUTPUT_PORT_TYPE
2723 x
= PyInt_FromLong((long) AL_OUTPUT_PORT_TYPE
);
2724 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_PORT_TYPE", x
) < 0)
2728 #ifdef AL_OUTPUT_RATE
2729 x
= PyInt_FromLong((long) AL_OUTPUT_RATE
);
2730 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_RATE", x
) < 0)
2735 x
= PyInt_FromLong((long) AL_PARAM_BIT
);
2736 if (x
== NULL
|| PyDict_SetItemString(d
, "PARAM_BIT", x
) < 0)
2741 x
= PyInt_FromLong((long) AL_PARAMS
);
2742 if (x
== NULL
|| PyDict_SetItemString(d
, "PARAMS", x
) < 0)
2746 #ifdef AL_PORT_COUNT
2747 x
= PyInt_FromLong((long) AL_PORT_COUNT
);
2748 if (x
== NULL
|| PyDict_SetItemString(d
, "PORT_COUNT", x
) < 0)
2753 x
= PyInt_FromLong((long) AL_PORT_TYPE
);
2754 if (x
== NULL
|| PyDict_SetItemString(d
, "PORT_TYPE", x
) < 0)
2759 x
= PyInt_FromLong((long) AL_PORTS
);
2760 if (x
== NULL
|| PyDict_SetItemString(d
, "PORTS", x
) < 0)
2764 #ifdef AL_PORTSTYLE_DIRECT
2765 x
= PyInt_FromLong((long) AL_PORTSTYLE_DIRECT
);
2766 if (x
== NULL
|| PyDict_SetItemString(d
, "PORTSTYLE_DIRECT", x
) < 0)
2770 #ifdef AL_PORTSTYLE_SERIAL
2771 x
= PyInt_FromLong((long) AL_PORTSTYLE_SERIAL
);
2772 if (x
== NULL
|| PyDict_SetItemString(d
, "PORTSTYLE_SERIAL", x
) < 0)
2776 #ifdef AL_PRINT_ERRORS
2777 x
= PyInt_FromLong((long) AL_PRINT_ERRORS
);
2778 if (x
== NULL
|| PyDict_SetItemString(d
, "PRINT_ERRORS", x
) < 0)
2783 x
= PyInt_FromLong((long) AL_PTR_ELEM
);
2784 if (x
== NULL
|| PyDict_SetItemString(d
, "PTR_ELEM", x
) < 0)
2788 #ifdef AL_RANGE_VALUE
2789 x
= PyInt_FromLong((long) AL_RANGE_VALUE
);
2790 if (x
== NULL
|| PyDict_SetItemString(d
, "RANGE_VALUE", x
) < 0)
2795 x
= PyInt_FromLong((long) AL_RATE
);
2796 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE", x
) < 0)
2800 #ifdef AL_RATE_11025
2801 x
= PyInt_FromLong((long) AL_RATE_11025
);
2802 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_11025", x
) < 0)
2806 #ifdef AL_RATE_16000
2807 x
= PyInt_FromLong((long) AL_RATE_16000
);
2808 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_16000", x
) < 0)
2812 #ifdef AL_RATE_22050
2813 x
= PyInt_FromLong((long) AL_RATE_22050
);
2814 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_22050", x
) < 0)
2818 #ifdef AL_RATE_32000
2819 x
= PyInt_FromLong((long) AL_RATE_32000
);
2820 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_32000", x
) < 0)
2824 #ifdef AL_RATE_44100
2825 x
= PyInt_FromLong((long) AL_RATE_44100
);
2826 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_44100", x
) < 0)
2830 #ifdef AL_RATE_48000
2831 x
= PyInt_FromLong((long) AL_RATE_48000
);
2832 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_48000", x
) < 0)
2837 x
= PyInt_FromLong((long) AL_RATE_8000
);
2838 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_8000", x
) < 0)
2842 #ifdef AL_RATE_AES_1
2843 x
= PyInt_FromLong((long) AL_RATE_AES_1
);
2844 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_1", x
) < 0)
2848 #ifdef AL_RATE_AES_1s
2849 x
= PyInt_FromLong((long) AL_RATE_AES_1s
);
2850 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_1s", x
) < 0)
2854 #ifdef AL_RATE_AES_2
2855 x
= PyInt_FromLong((long) AL_RATE_AES_2
);
2856 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_2", x
) < 0)
2860 #ifdef AL_RATE_AES_3
2861 x
= PyInt_FromLong((long) AL_RATE_AES_3
);
2862 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_3", x
) < 0)
2866 #ifdef AL_RATE_AES_4
2867 x
= PyInt_FromLong((long) AL_RATE_AES_4
);
2868 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_4", x
) < 0)
2872 #ifdef AL_RATE_AES_6
2873 x
= PyInt_FromLong((long) AL_RATE_AES_6
);
2874 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_6", x
) < 0)
2878 #ifdef AL_RATE_FRACTION_D
2879 x
= PyInt_FromLong((long) AL_RATE_FRACTION_D
);
2880 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_FRACTION_D", x
) < 0)
2884 #ifdef AL_RATE_FRACTION_N
2885 x
= PyInt_FromLong((long) AL_RATE_FRACTION_N
);
2886 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_FRACTION_N", x
) < 0)
2890 #ifdef AL_RATE_INPUTRATE
2891 x
= PyInt_FromLong((long) AL_RATE_INPUTRATE
);
2892 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_INPUTRATE", x
) < 0)
2896 #ifdef AL_RATE_NO_DIGITAL_INPUT
2897 x
= PyInt_FromLong((long) AL_RATE_NO_DIGITAL_INPUT
);
2898 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_NO_DIGITAL_INPUT", x
) < 0)
2902 #ifdef AL_RATE_UNACQUIRED
2903 x
= PyInt_FromLong((long) AL_RATE_UNACQUIRED
);
2904 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_UNACQUIRED", x
) < 0)
2908 #ifdef AL_RATE_UNDEFINED
2909 x
= PyInt_FromLong((long) AL_RATE_UNDEFINED
);
2910 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_UNDEFINED", x
) < 0)
2915 x
= PyInt_FromLong((long) AL_REF_0DBV
);
2916 if (x
== NULL
|| PyDict_SetItemString(d
, "REF_0DBV", x
) < 0)
2921 x
= PyInt_FromLong((long) AL_REF_NONE
);
2922 if (x
== NULL
|| PyDict_SetItemString(d
, "REF_NONE", x
) < 0)
2926 #ifdef AL_RESERVED1_TYPE
2927 x
= PyInt_FromLong((long) AL_RESERVED1_TYPE
);
2928 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED1_TYPE", x
) < 0)
2932 #ifdef AL_RESERVED2_TYPE
2933 x
= PyInt_FromLong((long) AL_RESERVED2_TYPE
);
2934 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED2_TYPE", x
) < 0)
2938 #ifdef AL_RESERVED3_TYPE
2939 x
= PyInt_FromLong((long) AL_RESERVED3_TYPE
);
2940 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED3_TYPE", x
) < 0)
2944 #ifdef AL_RESERVED4_TYPE
2945 x
= PyInt_FromLong((long) AL_RESERVED4_TYPE
);
2946 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED4_TYPE", x
) < 0)
2951 x
= PyInt_FromLong((long) AL_RESOURCE
);
2952 if (x
== NULL
|| PyDict_SetItemString(d
, "RESOURCE", x
) < 0)
2956 #ifdef AL_RESOURCE_ELEM
2957 x
= PyInt_FromLong((long) AL_RESOURCE_ELEM
);
2958 if (x
== NULL
|| PyDict_SetItemString(d
, "RESOURCE_ELEM", x
) < 0)
2962 #ifdef AL_RESOURCE_TYPE
2963 x
= PyInt_FromLong((long) AL_RESOURCE_TYPE
);
2964 if (x
== NULL
|| PyDict_SetItemString(d
, "RESOURCE_TYPE", x
) < 0)
2968 #ifdef AL_RIGHT_INPUT_ATTEN
2969 x
= PyInt_FromLong((long) AL_RIGHT_INPUT_ATTEN
);
2970 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT_INPUT_ATTEN", x
) < 0)
2974 #ifdef AL_RIGHT_MONITOR_ATTEN
2975 x
= PyInt_FromLong((long) AL_RIGHT_MONITOR_ATTEN
);
2976 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT_MONITOR_ATTEN", x
) < 0)
2980 #ifdef AL_RIGHT_SPEAKER_GAIN
2981 x
= PyInt_FromLong((long) AL_RIGHT_SPEAKER_GAIN
);
2982 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT_SPEAKER_GAIN", x
) < 0)
2986 #ifdef AL_RIGHT1_INPUT_ATTEN
2987 x
= PyInt_FromLong((long) AL_RIGHT1_INPUT_ATTEN
);
2988 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT1_INPUT_ATTEN", x
) < 0)
2992 #ifdef AL_RIGHT2_INPUT_ATTEN
2993 x
= PyInt_FromLong((long) AL_RIGHT2_INPUT_ATTEN
);
2994 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT2_INPUT_ATTEN", x
) < 0)
2998 #ifdef AL_SAMPFMT_DOUBLE
2999 x
= PyInt_FromLong((long) AL_SAMPFMT_DOUBLE
);
3000 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPFMT_DOUBLE", x
) < 0)
3004 #ifdef AL_SAMPFMT_FLOAT
3005 x
= PyInt_FromLong((long) AL_SAMPFMT_FLOAT
);
3006 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPFMT_FLOAT", x
) < 0)
3010 #ifdef AL_SAMPFMT_TWOSCOMP
3011 x
= PyInt_FromLong((long) AL_SAMPFMT_TWOSCOMP
);
3012 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPFMT_TWOSCOMP", x
) < 0)
3017 x
= PyInt_FromLong((long) AL_SAMPLE_16
);
3018 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLE_16", x
) < 0)
3023 x
= PyInt_FromLong((long) AL_SAMPLE_24
);
3024 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLE_24", x
) < 0)
3029 x
= PyInt_FromLong((long) AL_SAMPLE_8
);
3030 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLE_8", x
) < 0)
3034 #ifdef AL_SCALAR_VAL
3035 x
= PyInt_FromLong((long) AL_SCALAR_VAL
);
3036 if (x
== NULL
|| PyDict_SetItemString(d
, "SCALAR_VAL", x
) < 0)
3041 x
= PyInt_FromLong((long) AL_SET_VAL
);
3042 if (x
== NULL
|| PyDict_SetItemString(d
, "SET_VAL", x
) < 0)
3046 #ifdef AL_SHORT_NAME
3047 x
= PyInt_FromLong((long) AL_SHORT_NAME
);
3048 if (x
== NULL
|| PyDict_SetItemString(d
, "SHORT_NAME", x
) < 0)
3053 x
= PyInt_FromLong((long) AL_SOURCE
);
3054 if (x
== NULL
|| PyDict_SetItemString(d
, "SOURCE", x
) < 0)
3058 #ifdef AL_SPEAKER_IF_TYPE
3059 x
= PyInt_FromLong((long) AL_SPEAKER_IF_TYPE
);
3060 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_IF_TYPE", x
) < 0)
3064 #ifdef AL_SPEAKER_MUTE_CTL
3065 x
= PyInt_FromLong((long) AL_SPEAKER_MUTE_CTL
);
3066 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_MUTE_CTL", x
) < 0)
3070 #ifdef AL_SPEAKER_MUTE_OFF
3071 x
= PyInt_FromLong((long) AL_SPEAKER_MUTE_OFF
);
3072 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_MUTE_OFF", x
) < 0)
3076 #ifdef AL_SPEAKER_MUTE_ON
3077 x
= PyInt_FromLong((long) AL_SPEAKER_MUTE_ON
);
3078 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_MUTE_ON", x
) < 0)
3082 #ifdef AL_SPEAKER_PLUS_LINE_IF_TYPE
3083 x
= PyInt_FromLong((long) AL_SPEAKER_PLUS_LINE_IF_TYPE
);
3084 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_PLUS_LINE_IF_TYPE", x
) < 0)
3089 x
= PyInt_FromLong((long) AL_STEREO
);
3090 if (x
== NULL
|| PyDict_SetItemString(d
, "STEREO", x
) < 0)
3094 #ifdef AL_STRING_VAL
3095 x
= PyInt_FromLong((long) AL_STRING_VAL
);
3096 if (x
== NULL
|| PyDict_SetItemString(d
, "STRING_VAL", x
) < 0)
3101 x
= PyInt_FromLong((long) AL_SUBSYSTEM
);
3102 if (x
== NULL
|| PyDict_SetItemString(d
, "SUBSYSTEM", x
) < 0)
3106 #ifdef AL_SUBSYSTEM_TYPE
3107 x
= PyInt_FromLong((long) AL_SUBSYSTEM_TYPE
);
3108 if (x
== NULL
|| PyDict_SetItemString(d
, "SUBSYSTEM_TYPE", x
) < 0)
3112 #ifdef AL_SYNC_INPUT_TO_AES
3113 x
= PyInt_FromLong((long) AL_SYNC_INPUT_TO_AES
);
3114 if (x
== NULL
|| PyDict_SetItemString(d
, "SYNC_INPUT_TO_AES", x
) < 0)
3118 #ifdef AL_SYNC_OUTPUT_TO_AES
3119 x
= PyInt_FromLong((long) AL_SYNC_OUTPUT_TO_AES
);
3120 if (x
== NULL
|| PyDict_SetItemString(d
, "SYNC_OUTPUT_TO_AES", x
) < 0)
3125 x
= PyInt_FromLong((long) AL_SYSTEM
);
3126 if (x
== NULL
|| PyDict_SetItemString(d
, "SYSTEM", x
) < 0)
3130 #ifdef AL_SYSTEM_TYPE
3131 x
= PyInt_FromLong((long) AL_SYSTEM_TYPE
);
3132 if (x
== NULL
|| PyDict_SetItemString(d
, "SYSTEM_TYPE", x
) < 0)
3136 #ifdef AL_TEST_IF_TYPE
3137 x
= PyInt_FromLong((long) AL_TEST_IF_TYPE
);
3138 if (x
== NULL
|| PyDict_SetItemString(d
, "TEST_IF_TYPE", x
) < 0)
3143 x
= PyInt_FromLong((long) AL_TYPE
);
3144 if (x
== NULL
|| PyDict_SetItemString(d
, "TYPE", x
) < 0)
3149 x
= PyInt_FromLong((long) AL_TYPE_BIT
);
3150 if (x
== NULL
|| PyDict_SetItemString(d
, "TYPE_BIT", x
) < 0)
3154 #ifdef AL_UNUSED_COUNT
3155 x
= PyInt_FromLong((long) AL_UNUSED_COUNT
);
3156 if (x
== NULL
|| PyDict_SetItemString(d
, "UNUSED_COUNT", x
) < 0)
3160 #ifdef AL_UNUSED_PORTS
3161 x
= PyInt_FromLong((long) AL_UNUSED_PORTS
);
3162 if (x
== NULL
|| PyDict_SetItemString(d
, "UNUSED_PORTS", x
) < 0)
3166 #ifdef AL_VARIABLE_MCLK_TYPE
3167 x
= PyInt_FromLong((long) AL_VARIABLE_MCLK_TYPE
);
3168 if (x
== NULL
|| PyDict_SetItemString(d
, "VARIABLE_MCLK_TYPE", x
) < 0)
3172 #ifdef AL_VECTOR_VAL
3173 x
= PyInt_FromLong((long) AL_VECTOR_VAL
);
3174 if (x
== NULL
|| PyDict_SetItemString(d
, "VECTOR_VAL", x
) < 0)
3178 #ifdef AL_VIDEO_MCLK_TYPE
3179 x
= PyInt_FromLong((long) AL_VIDEO_MCLK_TYPE
);
3180 if (x
== NULL
|| PyDict_SetItemString(d
, "VIDEO_MCLK_TYPE", x
) < 0)
3185 x
= PyInt_FromLong((long) AL_WORDSIZE
);
3186 if (x
== NULL
|| PyDict_SetItemString(d
, "WORDSIZE", x
) < 0)
3191 #ifdef AL_NO_ELEM /* IRIX 6 */
3192 (void) alSetErrorHandler(ErrorHandler
);
3193 #endif /* AL_NO_ELEM */
3194 #ifdef OLD_INTERFACE
3195 (void) ALseterrorhandler(ErrorHandler
);
3196 #endif /* OLD_INTERFACE */