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 staticforward PyTypeObject Alptype
;
31 /* ---------------------------------------------------------------- */
33 /* Declarations for objects of type config */
37 /* XXXX Add your own stuff here */
41 staticforward 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 static char alc_SetWidth__doc__
[] =
276 "alSetWidth: set the wordsize for integer audio data."
280 alc_SetWidth(alcobject
*self
, PyObject
*args
)
282 return SetConfig(self
, args
, alSetWidth
);
286 static char alc_GetWidth__doc__
[] =
287 "alGetWidth: get the wordsize for integer audio data."
291 alc_GetWidth(alcobject
*self
, PyObject
*args
)
293 return GetConfig(self
, args
, alGetWidth
);
297 static char alc_SetSampFmt__doc__
[] =
298 "alSetSampFmt: set the sample format setting in an audio ALconfig structure."
302 alc_SetSampFmt(alcobject
*self
, PyObject
*args
)
304 return SetConfig(self
, args
, alSetSampFmt
);
308 static char alc_GetSampFmt__doc__
[] =
309 "alGetSampFmt: get the sample format setting in an audio ALconfig structure."
313 alc_GetSampFmt(alcobject
*self
, PyObject
*args
)
315 return GetConfig(self
, args
, alGetSampFmt
);
319 static char alc_SetChannels__doc__
[] =
320 "alSetChannels: set the channel settings in an audio ALconfig."
324 alc_SetChannels(alcobject
*self
, PyObject
*args
)
326 return SetConfig(self
, args
, alSetChannels
);
330 static char alc_GetChannels__doc__
[] =
331 "alGetChannels: get the channel settings in an audio ALconfig."
335 alc_GetChannels(alcobject
*self
, PyObject
*args
)
337 return GetConfig(self
, args
, alGetChannels
);
341 static char alc_SetFloatMax__doc__
[] =
342 "alSetFloatMax: set the maximum value of floating point sample data."
346 alc_SetFloatMax(alcobject
*self
, PyObject
*args
)
348 double maximum_value
;
350 if (!PyArg_ParseTuple(args
, "d:SetFloatMax", &maximum_value
))
352 if (alSetFloatMax(self
->config
, maximum_value
) < 0)
359 static char alc_GetFloatMax__doc__
[] =
360 "alGetFloatMax: get the maximum value of floating point sample data."
364 alc_GetFloatMax(alcobject
*self
, PyObject
*args
)
366 double maximum_value
;
368 if (!PyArg_ParseTuple(args
, ":GetFloatMax"))
370 if ((maximum_value
= alGetFloatMax(self
->config
)) == 0)
372 return PyFloat_FromDouble(maximum_value
);
376 static char alc_SetDevice__doc__
[] =
377 "alSetDevice: set the device setting in an audio ALconfig structure."
381 alc_SetDevice(alcobject
*self
, PyObject
*args
)
383 return SetConfig(self
, args
, alSetDevice
);
387 static char alc_GetDevice__doc__
[] =
388 "alGetDevice: get the device setting in an audio ALconfig structure."
392 alc_GetDevice(alcobject
*self
, PyObject
*args
)
394 return GetConfig(self
, args
, alGetDevice
);
398 static char alc_SetQueueSize__doc__
[] =
399 "alSetQueueSize: set audio port buffer size."
403 alc_SetQueueSize(alcobject
*self
, PyObject
*args
)
405 return SetConfig(self
, args
, alSetQueueSize
);
409 static char alc_GetQueueSize__doc__
[] =
410 "alGetQueueSize: get audio port buffer size."
414 alc_GetQueueSize(alcobject
*self
, PyObject
*args
)
416 return GetConfig(self
, args
, alGetQueueSize
);
419 #endif /* AL_NO_ELEM */
422 setconfig(alcobject
*self
, PyObject
*args
, int (*func
)(ALconfig
, long))
426 if (!PyArg_ParseTuple(args
, "l:SetConfig", &par
))
429 if ((*func
)(self
->config
, par
) == -1)
437 getconfig(alcobject
*self
, PyObject
*args
, long (*func
)(ALconfig
))
441 if (!PyArg_ParseTuple(args
, ":GetConfig"))
444 if ((par
= (*func
)(self
->config
)) == -1)
447 return PyInt_FromLong((long) par
);
451 alc_setqueuesize (alcobject
*self
, PyObject
*args
)
453 return setconfig(self
, args
, ALsetqueuesize
);
457 alc_getqueuesize (alcobject
*self
, PyObject
*args
)
459 return getconfig(self
, args
, ALgetqueuesize
);
463 alc_setwidth (alcobject
*self
, PyObject
*args
)
465 return setconfig(self
, args
, ALsetwidth
);
469 alc_getwidth (alcobject
*self
, PyObject
*args
)
471 return getconfig(self
, args
, ALgetwidth
);
475 alc_getchannels (alcobject
*self
, PyObject
*args
)
477 return getconfig(self
, args
, ALgetchannels
);
481 alc_setchannels (alcobject
*self
, PyObject
*args
)
483 return setconfig(self
, args
, ALsetchannels
);
489 alc_getsampfmt (alcobject
*self
, PyObject
*args
)
491 return getconfig(self
, args
, ALgetsampfmt
);
495 alc_setsampfmt (alcobject
*self
, PyObject
*args
)
497 return setconfig(self
, args
, ALsetsampfmt
);
501 alc_getfloatmax(alcobject
*self
, PyObject
*args
)
505 if (!PyArg_ParseTuple(args
, ":GetFloatMax"))
507 if ((arg
= ALgetfloatmax(self
->config
)) == 0)
509 return PyFloat_FromDouble(arg
);
513 alc_setfloatmax(alcobject
*self
, PyObject
*args
)
517 if (!PyArg_ParseTuple(args
, "d:SetFloatMax", &arg
))
519 if (ALsetfloatmax(self
->config
, arg
) == -1)
526 static struct PyMethodDef alc_methods
[] = {
527 #ifdef AL_NO_ELEM /* IRIX 6 */
528 {"SetWidth", (PyCFunction
)alc_SetWidth
, METH_VARARGS
, alc_SetWidth__doc__
},
529 {"GetWidth", (PyCFunction
)alc_GetWidth
, METH_VARARGS
, alc_GetWidth__doc__
},
530 {"SetSampFmt", (PyCFunction
)alc_SetSampFmt
, METH_VARARGS
, alc_SetSampFmt__doc__
},
531 {"GetSampFmt", (PyCFunction
)alc_GetSampFmt
, METH_VARARGS
, alc_GetSampFmt__doc__
},
532 {"SetChannels", (PyCFunction
)alc_SetChannels
, METH_VARARGS
, alc_SetChannels__doc__
},
533 {"GetChannels", (PyCFunction
)alc_GetChannels
, METH_VARARGS
, alc_GetChannels__doc__
},
534 {"SetFloatMax", (PyCFunction
)alc_SetFloatMax
, METH_VARARGS
, alc_SetFloatMax__doc__
},
535 {"GetFloatMax", (PyCFunction
)alc_GetFloatMax
, METH_VARARGS
, alc_GetFloatMax__doc__
},
536 {"SetDevice", (PyCFunction
)alc_SetDevice
, METH_VARARGS
, alc_SetDevice__doc__
},
537 {"GetDevice", (PyCFunction
)alc_GetDevice
, METH_VARARGS
, alc_GetDevice__doc__
},
538 {"SetQueueSize", (PyCFunction
)alc_SetQueueSize
, METH_VARARGS
, alc_SetQueueSize__doc__
},
539 {"GetQueueSize", (PyCFunction
)alc_GetQueueSize
, METH_VARARGS
, alc_GetQueueSize__doc__
},
540 #endif /* AL_NO_ELEM */
541 {"getqueuesize", (PyCFunction
)alc_getqueuesize
, METH_VARARGS
},
542 {"setqueuesize", (PyCFunction
)alc_setqueuesize
, METH_VARARGS
},
543 {"getwidth", (PyCFunction
)alc_getwidth
, METH_VARARGS
},
544 {"setwidth", (PyCFunction
)alc_setwidth
, METH_VARARGS
},
545 {"getchannels", (PyCFunction
)alc_getchannels
, METH_VARARGS
},
546 {"setchannels", (PyCFunction
)alc_setchannels
, METH_VARARGS
},
548 {"getsampfmt", (PyCFunction
)alc_getsampfmt
, METH_VARARGS
},
549 {"setsampfmt", (PyCFunction
)alc_setsampfmt
, METH_VARARGS
},
550 {"getfloatmax", (PyCFunction
)alc_getfloatmax
, METH_VARARGS
},
551 {"setfloatmax", (PyCFunction
)alc_setfloatmax
, METH_VARARGS
},
554 {NULL
, NULL
} /* sentinel */
561 newalcobject(ALconfig config
)
565 self
= PyObject_New(alcobject
, &Alctype
);
568 /* XXXX Add your own initializers here */
569 self
->config
= config
;
570 return (PyObject
*) self
;
575 alc_dealloc(alcobject
*self
)
577 /* XXXX Add your own cleanup code here */
578 #ifdef AL_NO_ELEM /* IRIX 6 */
579 (void) alFreeConfig(self
->config
); /* ignore errors */
581 (void) ALfreeconfig(self
->config
); /* ignore errors */
587 alc_getattr(alcobject
*self
, char *name
)
589 /* XXXX Add your own getattr code here */
590 return Py_FindMethod(alc_methods
, (PyObject
*)self
, name
);
593 static char Alctype__doc__
[] =
597 static PyTypeObject Alctype
= {
598 PyObject_HEAD_INIT(&PyType_Type
)
600 "config", /*tp_name*/
601 sizeof(alcobject
), /*tp_basicsize*/
604 (destructor
)alc_dealloc
, /*tp_dealloc*/
605 (printfunc
)0, /*tp_print*/
606 (getattrfunc
)alc_getattr
, /*tp_getattr*/
607 (setattrfunc
)0, /*tp_setattr*/
608 (cmpfunc
)0, /*tp_compare*/
609 (reprfunc
)0, /*tp_repr*/
611 0, /*tp_as_sequence*/
613 (hashfunc
)0, /*tp_hash*/
614 (ternaryfunc
)0, /*tp_call*/
615 (reprfunc
)0, /*tp_str*/
617 /* Space for future expansion */
619 Alctype__doc__
/* Documentation string */
622 /* End of code for config objects */
623 /* ---------------------------------------------------------------- */
625 #ifdef AL_NO_ELEM /* IRIX 6 */
627 static char alp_SetConfig__doc__
[] =
628 "alSetConfig: set the ALconfig of an audio ALport."
632 alp_SetConfig(alpobject
*self
, PyObject
*args
)
635 if (!PyArg_ParseTuple(args
, "O!:SetConfig", &Alctype
, &config
))
637 if (alSetConfig(self
->port
, config
->config
) < 0)
644 static char alp_GetConfig__doc__
[] =
645 "alGetConfig: get the ALconfig of an audio ALport."
649 alp_GetConfig(alpobject
*self
, PyObject
*args
)
652 if (!PyArg_ParseTuple(args
, ":GetConfig"))
654 if ((config
= alGetConfig(self
->port
)) == NULL
)
656 return newalcobject(config
);
660 static char alp_GetResource__doc__
[] =
661 "alGetResource: get the resource associated with an audio port."
665 alp_GetResource(alpobject
*self
, PyObject
*args
)
669 if (!PyArg_ParseTuple(args
, ":GetResource"))
671 if ((resource
= alGetResource(self
->port
)) == 0)
673 return PyInt_FromLong((long) resource
);
677 static char alp_GetFD__doc__
[] =
678 "alGetFD: get the file descriptor for an audio port."
682 alp_GetFD(alpobject
*self
, PyObject
*args
)
686 if (!PyArg_ParseTuple(args
, ":GetFD"))
689 if ((fd
= alGetFD(self
->port
)) < 0)
692 return PyInt_FromLong((long) fd
);
696 static char alp_GetFilled__doc__
[] =
697 "alGetFilled: return the number of filled sample frames in an audio port."
701 alp_GetFilled(alpobject
*self
, PyObject
*args
)
705 if (!PyArg_ParseTuple(args
, ":GetFilled"))
707 if ((filled
= alGetFilled(self
->port
)) < 0)
709 return PyInt_FromLong((long) filled
);
713 static char alp_GetFillable__doc__
[] =
714 "alGetFillable: report the number of unfilled sample frames in an audio port."
718 alp_GetFillable(alpobject
*self
, PyObject
*args
)
722 if (!PyArg_ParseTuple(args
, ":GetFillable"))
724 if ((fillable
= alGetFillable(self
->port
)) < 0)
726 return PyInt_FromLong((long) fillable
);
730 static char alp_ReadFrames__doc__
[] =
731 "alReadFrames: read sample frames from an audio port."
735 alp_ReadFrames(alpobject
*self
, PyObject
*args
)
744 if (!PyArg_ParseTuple(args
, "i:ReadFrames", &framecount
))
746 if (framecount
< 0) {
747 PyErr_SetString(ErrorObject
, "negative framecount");
750 c
= alGetConfig(self
->port
);
751 switch (alGetSampFmt(c
)) {
752 case AL_SAMPFMT_TWOSCOMP
:
753 switch (alGetWidth(c
)) {
764 PyErr_SetString(ErrorObject
, "can't determine width");
769 case AL_SAMPFMT_FLOAT
:
772 case AL_SAMPFMT_DOUBLE
:
776 PyErr_SetString(ErrorObject
, "can't determine format");
780 ch
= alGetChannels(c
);
783 PyErr_SetString(ErrorObject
, "can't determine # of channels");
787 v
= PyString_FromStringAndSize((char *) NULL
, size
* framecount
);
791 Py_BEGIN_ALLOW_THREADS
792 alReadFrames(self
->port
, (void *) PyString_AS_STRING(v
), framecount
);
799 static char alp_DiscardFrames__doc__
[] =
800 "alDiscardFrames: discard audio from an audio port."
804 alp_DiscardFrames(alpobject
*self
, PyObject
*args
)
808 if (!PyArg_ParseTuple(args
, "i:DiscardFrames", &framecount
))
811 Py_BEGIN_ALLOW_THREADS
812 framecount
= alDiscardFrames(self
->port
, framecount
);
818 return PyInt_FromLong((long) framecount
);
822 static char alp_ZeroFrames__doc__
[] =
823 "alZeroFrames: write zero-valued sample frames to an audio port."
827 alp_ZeroFrames(alpobject
*self
, PyObject
*args
)
831 if (!PyArg_ParseTuple(args
, "i:ZeroFrames", &framecount
))
834 if (framecount
< 0) {
835 PyErr_SetString(ErrorObject
, "negative framecount");
839 Py_BEGIN_ALLOW_THREADS
840 alZeroFrames(self
->port
, framecount
);
848 static char alp_SetFillPoint__doc__
[] =
849 "alSetFillPoint: set low- or high-water mark for an audio port."
853 alp_SetFillPoint(alpobject
*self
, PyObject
*args
)
857 if (!PyArg_ParseTuple(args
, "i:SetFillPoint", &fillpoint
))
860 if (alSetFillPoint(self
->port
, fillpoint
) < 0)
868 static char alp_GetFillPoint__doc__
[] =
869 "alGetFillPoint: get low- or high-water mark for an audio port."
873 alp_GetFillPoint(alpobject
*self
, PyObject
*args
)
877 if (!PyArg_ParseTuple(args
, ":GetFillPoint"))
880 if ((fillpoint
= alGetFillPoint(self
->port
)) < 0)
883 return PyInt_FromLong((long) fillpoint
);
887 static char alp_GetFrameNumber__doc__
[] =
888 "alGetFrameNumber: get the absolute sample frame number associated with a port."
892 alp_GetFrameNumber(alpobject
*self
, PyObject
*args
)
896 if (!PyArg_ParseTuple(args
, ":GetFrameNumber"))
899 if (alGetFrameNumber(self
->port
, &fnum
) < 0)
902 return PyLong_FromLongLong((long long) fnum
);
906 static char alp_GetFrameTime__doc__
[] =
907 "alGetFrameTime: get the time at which a sample frame came in or will go out."
911 alp_GetFrameTime(alpobject
*self
, PyObject
*args
)
914 PyObject
*ret
, *v0
, *v1
;
916 if (!PyArg_ParseTuple(args
, ":GetFrameTime"))
918 if (alGetFrameTime(self
->port
, &fnum
, &time
) < 0)
920 v0
= PyLong_FromLongLong((long long) fnum
);
921 v1
= PyLong_FromLongLong((long long) time
);
922 if (PyErr_Occurred()) {
927 ret
= Py_BuildValue("(OO)", v0
, v1
);
934 static char alp_WriteFrames__doc__
[] =
935 "alWriteFrames: write sample frames to an audio port."
939 alp_WriteFrames(alpobject
*self
, PyObject
*args
)
946 if (!PyArg_ParseTuple(args
, "s#:WriteFrames", &samples
, &length
))
948 c
= alGetConfig(self
->port
);
949 switch (alGetSampFmt(c
)) {
950 case AL_SAMPFMT_TWOSCOMP
:
951 switch (alGetWidth(c
)) {
962 PyErr_SetString(ErrorObject
, "can't determine width");
967 case AL_SAMPFMT_FLOAT
:
970 case AL_SAMPFMT_DOUBLE
:
974 PyErr_SetString(ErrorObject
, "can't determine format");
978 ch
= alGetChannels(c
);
981 PyErr_SetString(ErrorObject
, "can't determine # of channels");
985 if (length
% size
!= 0) {
986 PyErr_SetString(ErrorObject
,
987 "buffer length not whole number of frames");
991 Py_BEGIN_ALLOW_THREADS
992 alWriteFrames(self
->port
, (void *) samples
, length
/ size
);
1000 static char alp_ClosePort__doc__
[] =
1001 "alClosePort: close an audio port."
1005 alp_ClosePort(alpobject
*self
, PyObject
*args
)
1007 if (!PyArg_ParseTuple(args
, ":ClosePort"))
1009 if (alClosePort(self
->port
) < 0)
1016 #endif /* AL_NO_ELEM */
1018 #ifdef OLD_INTERFACE
1020 alp_closeport(alpobject
*self
, PyObject
*args
)
1022 if (!PyArg_ParseTuple(args
, ":ClosePort"))
1024 if (ALcloseport(self
->port
) < 0)
1032 alp_getfd(alpobject
*self
, PyObject
*args
)
1036 if (!PyArg_ParseTuple(args
, ":GetFD"))
1038 if ((fd
= ALgetfd(self
-> port
)) == -1)
1040 return PyInt_FromLong(fd
);
1044 alp_getfilled(alpobject
*self
, PyObject
*args
)
1048 if (!PyArg_ParseTuple(args
, ":GetFilled"))
1050 if ((count
= ALgetfilled(self
-> port
)) == -1)
1052 return PyInt_FromLong(count
);
1056 alp_getfillable(alpobject
*self
, PyObject
*args
)
1060 if (!PyArg_ParseTuple(args
, ":GetFillable"))
1062 if ((count
= ALgetfillable(self
-> port
)) == -1)
1064 return PyInt_FromLong (count
);
1068 alp_readsamps(alpobject
*self
, PyObject
*args
)
1076 if (!PyArg_ParseTuple(args
, "l:readsamps", &count
))
1080 PyErr_SetString(ErrorObject
, "al.readsamps : arg <= 0");
1084 c
= ALgetconfig(self
->port
);
1086 width
= ALgetsampfmt(c
);
1087 if (width
== AL_SAMPFMT_FLOAT
)
1088 width
= sizeof(float);
1089 else if (width
== AL_SAMPFMT_DOUBLE
)
1090 width
= sizeof(double);
1092 width
= ALgetwidth(c
);
1094 width
= ALgetwidth(c
);
1097 v
= PyString_FromStringAndSize((char *)NULL
, width
* count
);
1101 Py_BEGIN_ALLOW_THREADS
1102 ret
= ALreadsamps(self
->port
, (void *) PyString_AsString(v
), count
);
1103 Py_END_ALLOW_THREADS
1113 alp_writesamps(alpobject
*self
, PyObject
*args
)
1120 if (!PyArg_ParseTuple(args
, "s#:writesamps", &buf
, &size
))
1123 c
= ALgetconfig(self
->port
);
1125 width
= ALgetsampfmt(c
);
1126 if (width
== AL_SAMPFMT_FLOAT
)
1127 width
= sizeof(float);
1128 else if (width
== AL_SAMPFMT_DOUBLE
)
1129 width
= sizeof(double);
1131 width
= ALgetwidth(c
);
1133 width
= ALgetwidth(c
);
1136 Py_BEGIN_ALLOW_THREADS
1137 ret
= ALwritesamps (self
->port
, (void *) buf
, (long) size
/ width
);
1138 Py_END_ALLOW_THREADS
1147 alp_getfillpoint(alpobject
*self
, PyObject
*args
)
1151 if (!PyArg_ParseTuple(args
, ":GetFillPoint"))
1153 if ((count
= ALgetfillpoint(self
->port
)) == -1)
1155 return PyInt_FromLong(count
);
1159 alp_setfillpoint(alpobject
*self
, PyObject
*args
)
1163 if (!PyArg_ParseTuple(args
, "l:SetFillPoint", &count
))
1165 if (ALsetfillpoint(self
->port
, count
) == -1)
1172 alp_setconfig(alpobject
*self
, PyObject
*args
)
1176 if (!PyArg_ParseTuple(args
, "O!:SetConfig", &Alctype
, &config
))
1178 if (ALsetconfig(self
->port
, config
->config
) == -1)
1185 alp_getconfig(alpobject
*self
, PyObject
*args
)
1189 if (!PyArg_ParseTuple(args
, ":GetConfig"))
1191 config
= ALgetconfig(self
->port
);
1194 return newalcobject(config
);
1199 alp_getstatus(alpobject
*self
, PyObject
*args
)
1206 if (!PyArg_Parse(args
, "O!", &PyList_Type
, &list
))
1208 length
= PyList_Size(list
);
1209 PVbuffer
= PyMem_NEW(long, length
);
1210 if (PVbuffer
== NULL
)
1211 return PyErr_NoMemory();
1212 for (i
= 0; i
< length
; i
++) {
1213 v
= PyList_GetItem(list
, i
);
1214 if (!PyInt_Check(v
)) {
1215 PyMem_DEL(PVbuffer
);
1216 PyErr_BadArgument();
1219 PVbuffer
[i
] = PyInt_AsLong(v
);
1222 if (ALgetstatus(self
->port
, PVbuffer
, length
) == -1)
1225 for (i
= 0; i
< length
; i
++)
1226 PyList_SetItem(list
, i
, PyInt_FromLong(PVbuffer
[i
]));
1228 PyMem_DEL(PVbuffer
);
1235 #endif /* OLD_INTERFACE */
1237 static struct PyMethodDef alp_methods
[] = {
1238 #ifdef AL_NO_ELEM /* IRIX 6 */
1239 {"SetConfig", (PyCFunction
)alp_SetConfig
, METH_VARARGS
, alp_SetConfig__doc__
},
1240 {"GetConfig", (PyCFunction
)alp_GetConfig
, METH_VARARGS
, alp_GetConfig__doc__
},
1241 {"GetResource", (PyCFunction
)alp_GetResource
, METH_VARARGS
, alp_GetResource__doc__
},
1242 {"GetFD", (PyCFunction
)alp_GetFD
, METH_VARARGS
, alp_GetFD__doc__
},
1243 {"GetFilled", (PyCFunction
)alp_GetFilled
, METH_VARARGS
, alp_GetFilled__doc__
},
1244 {"GetFillable", (PyCFunction
)alp_GetFillable
, METH_VARARGS
, alp_GetFillable__doc__
},
1245 {"ReadFrames", (PyCFunction
)alp_ReadFrames
, METH_VARARGS
, alp_ReadFrames__doc__
},
1246 {"DiscardFrames", (PyCFunction
)alp_DiscardFrames
, METH_VARARGS
, alp_DiscardFrames__doc__
},
1247 {"ZeroFrames", (PyCFunction
)alp_ZeroFrames
, METH_VARARGS
, alp_ZeroFrames__doc__
},
1248 {"SetFillPoint", (PyCFunction
)alp_SetFillPoint
, METH_VARARGS
, alp_SetFillPoint__doc__
},
1249 {"GetFillPoint", (PyCFunction
)alp_GetFillPoint
, METH_VARARGS
, alp_GetFillPoint__doc__
},
1250 {"GetFrameNumber", (PyCFunction
)alp_GetFrameNumber
, METH_VARARGS
, alp_GetFrameNumber__doc__
},
1251 {"GetFrameTime", (PyCFunction
)alp_GetFrameTime
, METH_VARARGS
, alp_GetFrameTime__doc__
},
1252 {"WriteFrames", (PyCFunction
)alp_WriteFrames
, METH_VARARGS
, alp_WriteFrames__doc__
},
1253 {"ClosePort", (PyCFunction
)alp_ClosePort
, METH_VARARGS
, alp_ClosePort__doc__
},
1254 #endif /* AL_NO_ELEM */
1255 #ifdef OLD_INTERFACE
1256 {"closeport", (PyCFunction
)alp_closeport
, METH_VARARGS
},
1257 {"getfd", (PyCFunction
)alp_getfd
, METH_VARARGS
},
1258 {"fileno", (PyCFunction
)alp_getfd
, METH_VARARGS
},
1259 {"getfilled", (PyCFunction
)alp_getfilled
, METH_VARARGS
},
1260 {"getfillable", (PyCFunction
)alp_getfillable
, METH_VARARGS
},
1261 {"readsamps", (PyCFunction
)alp_readsamps
, METH_VARARGS
},
1262 {"writesamps", (PyCFunction
)alp_writesamps
, METH_VARARGS
},
1263 {"setfillpoint", (PyCFunction
)alp_setfillpoint
, METH_VARARGS
},
1264 {"getfillpoint", (PyCFunction
)alp_getfillpoint
, METH_VARARGS
},
1265 {"setconfig", (PyCFunction
)alp_setconfig
, METH_VARARGS
},
1266 {"getconfig", (PyCFunction
)alp_getconfig
, METH_VARARGS
},
1268 {"getstatus", (PyCFunction
)alp_getstatus
, METH_VARARGS
},
1270 #endif /* OLD_INTERFACE */
1272 {NULL
, NULL
} /* sentinel */
1279 newalpobject(ALport port
)
1283 self
= PyObject_New(alpobject
, &Alptype
);
1286 /* XXXX Add your own initializers here */
1288 return (PyObject
*) self
;
1293 alp_dealloc(alpobject
*self
)
1295 /* XXXX Add your own cleanup code here */
1297 #ifdef AL_NO_ELEM /* IRIX 6 */
1298 alClosePort(self
->port
);
1300 ALcloseport(self
->port
);
1307 alp_getattr(alpobject
*self
, char *name
)
1309 /* XXXX Add your own getattr code here */
1310 if (self
->port
== NULL
) {
1311 PyErr_SetString(ErrorObject
, "port already closed");
1314 return Py_FindMethod(alp_methods
, (PyObject
*)self
, name
);
1317 static char Alptype__doc__
[] =
1321 static PyTypeObject Alptype
= {
1322 PyObject_HEAD_INIT(&PyType_Type
)
1325 sizeof(alpobject
), /*tp_basicsize*/
1328 (destructor
)alp_dealloc
, /*tp_dealloc*/
1329 (printfunc
)0, /*tp_print*/
1330 (getattrfunc
)alp_getattr
, /*tp_getattr*/
1331 (setattrfunc
)0, /*tp_setattr*/
1332 (cmpfunc
)0, /*tp_compare*/
1333 (reprfunc
)0, /*tp_repr*/
1335 0, /*tp_as_sequence*/
1336 0, /*tp_as_mapping*/
1337 (hashfunc
)0, /*tp_hash*/
1338 (ternaryfunc
)0, /*tp_call*/
1339 (reprfunc
)0, /*tp_str*/
1341 /* Space for future expansion */
1343 Alptype__doc__
/* Documentation string */
1346 /* End of code for port objects */
1347 /* -------------------------------------------------------- */
1350 #ifdef AL_NO_ELEM /* IRIX 6 */
1352 static char al_NewConfig__doc__
[] =
1353 "alNewConfig: create and initialize an audio ALconfig structure."
1357 al_NewConfig(PyObject
*self
, PyObject
*args
)
1361 if (!PyArg_ParseTuple(args
, ":NewConfig"))
1363 if ((config
= alNewConfig()) == NULL
)
1365 return newalcobject(config
);
1368 static char al_OpenPort__doc__
[] =
1369 "alOpenPort: open an audio port."
1373 al_OpenPort(PyObject
*self
, PyObject
*args
)
1377 alcobject
*config
= NULL
;
1379 if (!PyArg_ParseTuple(args
, "ss|O!:OpenPort", &name
, &dir
, &Alctype
, &config
))
1381 if ((port
= alOpenPort(name
, dir
, config
? config
->config
: NULL
)) == NULL
)
1383 return newalpobject(port
);
1386 static char al_Connect__doc__
[] =
1387 "alConnect: connect two audio I/O resources."
1391 al_Connect(PyObject
*self
, PyObject
*args
)
1393 int source
, dest
, nprops
= 0, id
, i
;
1395 ALparamInfo
*propinfo
= NULL
;
1396 PyObject
*propobj
= NULL
;
1398 if (!PyArg_ParseTuple(args
, "ii|O!:Connect", &source
, &dest
, &PyList_Type
, &propobj
))
1400 if (propobj
!= NULL
) {
1401 nprops
= python2params(source
, dest
, propobj
, &props
, &propinfo
);
1406 id
= alConnect(source
, dest
, props
, nprops
);
1409 for (i
= 0; i
< nprops
; i
++) {
1410 switch (propinfo
[i
].valueType
) {
1413 PyMem_DEL(props
[i
].value
.ptr
);
1418 PyMem_DEL(propinfo
);
1423 return PyInt_FromLong((long) id
);
1426 static char al_Disconnect__doc__
[] =
1427 "alDisconnect: delete a connection between two audio I/O resources."
1431 al_Disconnect(PyObject
*self
, PyObject
*args
)
1435 if (!PyArg_ParseTuple(args
, "i:Disconnect", &res
))
1437 if (alDisconnect(res
) < 0)
1443 static char al_GetParams__doc__
[] =
1444 "alGetParams: get the values of audio resource parameters."
1448 al_GetParams(PyObject
*self
, PyObject
*args
)
1451 PyObject
*pvslist
, *item
= NULL
, *v
= NULL
;
1456 if (!PyArg_ParseTuple(args
, "iO!:GetParams", &resource
, &PyList_Type
, &pvslist
))
1458 npvs
= PyList_Size(pvslist
);
1459 pvs
= PyMem_NEW(ALpv
, npvs
);
1460 pinfo
= PyMem_NEW(ALparamInfo
, npvs
);
1461 for (i
= 0; i
< npvs
; i
++) {
1462 item
= PyList_GetItem(pvslist
, i
);
1463 if (!PyInt_Check(item
)) {
1465 PyErr_SetString(ErrorObject
, "list of integers expected");
1468 pvs
[i
].param
= (int) PyInt_AsLong(item
);
1469 item
= NULL
; /* not needed anymore */
1470 if (alGetParamInfo(resource
, pvs
[i
].param
, &pinfo
[i
]) < 0)
1472 switch (pinfo
[i
].valueType
) {
1476 pinfo
[i
].maxElems
*= pinfo
[i
].maxElems2
;
1481 switch (pinfo
[i
].elementType
) {
1483 case AL_RESOURCE_ELEM
:
1485 pvs
[i
].value
.ptr
= PyMem_NEW(int, pinfo
[i
].maxElems
);
1486 pvs
[i
].sizeIn
= pinfo
[i
].maxElems
;
1490 pvs
[i
].value
.ptr
= PyMem_NEW(long long, pinfo
[i
].maxElems
);
1491 pvs
[i
].sizeIn
= pinfo
[i
].maxElems
;
1494 pvs
[i
].value
.ptr
= PyMem_NEW(char, 32);
1500 PyErr_SetString(ErrorObject
, "internal error");
1507 PyErr_SetString(ErrorObject
, "internal error");
1510 if (pinfo
[i
].valueType
== AL_MATRIX_VAL
) {
1511 pinfo
[i
].maxElems
/= pinfo
[i
].maxElems2
;
1512 pvs
[i
].sizeIn
/= pinfo
[i
].maxElems2
;
1513 pvs
[i
].size2In
= pinfo
[i
].maxElems2
;
1516 if (alGetParams(resource
, pvs
, npvs
) < 0)
1518 v
= PyList_New(npvs
);
1519 for (i
= 0; i
< npvs
; i
++) {
1520 if (pvs
[i
].sizeOut
< 0) {
1522 sprintf(buf
, "problem with param %d", i
);
1523 PyErr_SetString(ErrorObject
, buf
);
1526 switch (pinfo
[i
].valueType
) {
1532 item
= PyString_FromString(pvs
[i
].value
.ptr
);
1533 PyMem_DEL(pvs
[i
].value
.ptr
);
1536 /* XXXX this is not right */
1537 pvs
[i
].sizeOut
*= pvs
[i
].size2Out
;
1541 item
= PyList_New(pvs
[i
].sizeOut
);
1542 for (j
= 0; j
< pvs
[i
].sizeOut
; j
++) {
1543 switch (pinfo
[i
].elementType
) {
1545 case AL_RESOURCE_ELEM
:
1547 PyList_SetItem(item
, j
, PyInt_FromLong((long) ((int *) pvs
[i
].value
.ptr
)[j
]));
1550 PyList_SetItem(item
, j
, PyLong_FromLongLong(((long long *) pvs
[i
].value
.ptr
)[j
]));
1553 PyList_SetItem(item
, j
, PyFloat_FromDouble(alFixedToDouble(((long long *) pvs
[i
].value
.ptr
)[j
])));
1556 PyErr_SetString(ErrorObject
, "internal error");
1560 PyMem_DEL(pvs
[i
].value
.ptr
);
1563 item
= param2python(resource
, pvs
[i
].param
, pvs
[i
].value
, &pinfo
[i
]);
1566 if (PyErr_Occurred() ||
1567 PyList_SetItem(v
, i
, Py_BuildValue("(iO)", pvs
[i
].param
,
1587 static char al_SetParams__doc__
[] =
1588 "alSetParams: set the values of audio resource parameters."
1592 al_SetParams(PyObject
*self
, PyObject
*args
)
1595 PyObject
*pvslist
, *item
;
1600 if (!PyArg_ParseTuple(args
, "iO!:SetParams", &resource
, &PyList_Type
, &pvslist
))
1602 npvs
= python2params(resource
, -1, pvslist
, &pvs
, &pinfo
);
1606 if (alSetParams(resource
, pvs
, npvs
) < 0)
1610 for (i
= 0; i
< npvs
; i
++) {
1611 switch (pinfo
[i
].valueType
) {
1614 PyMem_DEL(pvs
[i
].value
.ptr
);
1625 /* XXXX we should clean up everything */
1633 static char al_QueryValues__doc__
[] =
1634 "alQueryValues: get the set of possible values for a parameter."
1638 al_QueryValues(PyObject
*self
, PyObject
*args
)
1640 int resource
, param
;
1641 ALvalue
*return_set
= NULL
;
1642 int setsize
= 32, qualsize
= 0, nvals
, i
;
1645 ALparamInfo
*qualinfo
= NULL
;
1646 PyObject
*qualobj
= NULL
;
1647 PyObject
*res
= NULL
, *item
;
1649 if (!PyArg_ParseTuple(args
, "ii|O!:QueryValues", &resource
, ¶m
,
1650 &PyList_Type
, &qualobj
))
1652 if (qualobj
!= NULL
) {
1653 qualsize
= python2params(resource
, param
, qualobj
, &quals
, &qualinfo
);
1658 return_set
= PyMem_NEW(ALvalue
, setsize
);
1659 if (return_set
== NULL
) {
1665 nvals
= alQueryValues(resource
, param
, return_set
, setsize
, quals
, qualsize
);
1668 if (nvals
> setsize
) {
1670 PyMem_RESIZE(return_set
, ALvalue
, setsize
);
1671 if (return_set
== NULL
) {
1678 if (alGetParamInfo(resource
, param
, &pinfo
) < 0)
1681 res
= PyList_New(nvals
);
1684 for (i
= 0; i
< nvals
; i
++) {
1685 item
= param2python(resource
, param
, return_set
[i
], &pinfo
);
1687 PyList_SetItem(res
, i
, item
) < 0) {
1696 PyMem_DEL(return_set
);
1698 for (i
= 0; i
< qualsize
; i
++) {
1699 switch (qualinfo
[i
].valueType
) {
1702 PyMem_DEL(quals
[i
].value
.ptr
);
1707 PyMem_DEL(qualinfo
);
1713 static char al_GetParamInfo__doc__
[] =
1714 "alGetParamInfo: get information about a parameter on a particular audio resource."
1718 al_GetParamInfo(PyObject
*self
, PyObject
*args
)
1722 PyObject
*v
, *item
;;
1724 if (!PyArg_ParseTuple(args
, "ii:GetParamInfo", &res
, ¶m
))
1726 if (alGetParamInfo(res
, param
, &pinfo
) < 0)
1730 item
= PyInt_FromLong((long) pinfo
.resource
);
1731 PyDict_SetItemString(v
, "resource", item
);
1734 item
= PyInt_FromLong((long) pinfo
.param
);
1735 PyDict_SetItemString(v
, "param", item
);
1738 item
= PyInt_FromLong((long) pinfo
.valueType
);
1739 PyDict_SetItemString(v
, "valueType", item
);
1742 if (pinfo
.valueType
!= AL_NO_VAL
&& pinfo
.valueType
!= AL_SCALAR_VAL
) {
1743 /* multiple values */
1744 item
= PyInt_FromLong((long) pinfo
.maxElems
);
1745 PyDict_SetItemString(v
, "maxElems", item
);
1748 if (pinfo
.valueType
== AL_MATRIX_VAL
) {
1750 item
= PyInt_FromLong((long) pinfo
.maxElems2
);
1751 PyDict_SetItemString(v
, "maxElems2", item
);
1756 item
= PyInt_FromLong((long) pinfo
.elementType
);
1757 PyDict_SetItemString(v
, "elementType", item
);
1760 item
= PyString_FromString(pinfo
.name
);
1761 PyDict_SetItemString(v
, "name", item
);
1764 item
= param2python(res
, param
, pinfo
.initial
, &pinfo
);
1765 PyDict_SetItemString(v
, "initial", item
);
1768 if (pinfo
.elementType
!= AL_ENUM_ELEM
&&
1769 pinfo
.elementType
!= AL_RESOURCE_ELEM
&&
1770 pinfo
.elementType
!= AL_CHAR_ELEM
) {
1772 item
= param2python(res
, param
, pinfo
.min
, &pinfo
);
1773 PyDict_SetItemString(v
, "min", item
);
1776 item
= param2python(res
, param
, pinfo
.max
, &pinfo
);
1777 PyDict_SetItemString(v
, "max", item
);
1780 item
= param2python(res
, param
, pinfo
.minDelta
, &pinfo
);
1781 PyDict_SetItemString(v
, "minDelta", item
);
1784 item
= param2python(res
, param
, pinfo
.maxDelta
, &pinfo
);
1785 PyDict_SetItemString(v
, "maxDelta", item
);
1788 item
= PyInt_FromLong((long) pinfo
.specialVals
);
1789 PyDict_SetItemString(v
, "specialVals", item
);
1796 static char al_GetResourceByName__doc__
[] =
1797 "alGetResourceByName: find an audio resource by name."
1801 al_GetResourceByName(PyObject
*self
, PyObject
*args
)
1803 int res
, start_res
, type
;
1806 if (!PyArg_ParseTuple(args
, "isi:GetResourceByName", &start_res
, &name
, &type
))
1808 if ((res
= alGetResourceByName(start_res
, name
, type
)) == 0)
1810 return PyInt_FromLong((long) res
);
1813 static char al_IsSubtype__doc__
[] =
1814 "alIsSubtype: indicate if one resource type is a subtype of another."
1818 al_IsSubtype(PyObject
*self
, PyObject
*args
)
1822 if (!PyArg_ParseTuple(args
, "ii:IsSubtype", &type
, &subtype
))
1824 return PyInt_FromLong((long) alIsSubtype(type
, subtype
));
1827 static char al_SetErrorHandler__doc__
[] =
1832 al_SetErrorHandler(PyObject
*self
, PyObject
*args
)
1835 if (!PyArg_ParseTuple(args
, ":SetErrorHandler"))
1841 #endif /* AL_NO_ELEM */
1843 #ifdef OLD_INTERFACE
1846 al_openport(PyObject
*self
, PyObject
*args
)
1850 alcobject
*config
= NULL
;
1852 if (!PyArg_ParseTuple(args
, "ss|O!:OpenPort", &name
, &dir
, &Alctype
, &config
))
1854 if ((port
= ALopenport(name
, dir
, config
? config
->config
: NULL
)) == NULL
)
1856 return newalpobject(port
);
1860 al_newconfig(PyObject
*self
, PyObject
*args
)
1864 if (!PyArg_ParseTuple(args
, ":NewConfig"))
1866 if ((config
= ALnewconfig ()) == NULL
)
1868 return newalcobject(config
);
1872 al_queryparams(PyObject
*self
, PyObject
*args
)
1881 if (!PyArg_ParseTuple(args
, "l:queryparams", &device
))
1883 if ((length
= ALqueryparams(device
, PVdummy
, 2L)) == -1)
1885 if ((PVbuffer
= PyMem_NEW(long, length
)) == NULL
)
1886 return PyErr_NoMemory();
1887 if (ALqueryparams(device
, PVbuffer
, length
) >= 0 &&
1888 (v
= PyList_New((int)length
)) != NULL
) {
1889 for (i
= 0; i
< length
; i
++)
1890 PyList_SetItem(v
, i
, PyInt_FromLong(PVbuffer
[i
]));
1892 PyMem_DEL(PVbuffer
);
1897 doParams(PyObject
*args
, int (*func
)(long, long *, long), int modified
)
1905 if (!PyArg_ParseTuple(args
, "lO!", &device
, &PyList_Type
, &list
))
1907 length
= PyList_Size(list
);
1908 PVbuffer
= PyMem_NEW(long, length
);
1909 if (PVbuffer
== NULL
)
1910 return PyErr_NoMemory();
1911 for (i
= 0; i
< length
; i
++) {
1912 v
= PyList_GetItem(list
, i
);
1913 if (!PyInt_Check(v
)) {
1914 PyMem_DEL(PVbuffer
);
1915 PyErr_BadArgument();
1918 PVbuffer
[i
] = PyInt_AsLong(v
);
1921 if ((*func
)(device
, PVbuffer
, length
) == -1) {
1922 PyMem_DEL(PVbuffer
);
1927 for (i
= 0; i
< length
; i
++)
1928 PyList_SetItem(list
, i
, PyInt_FromLong(PVbuffer
[i
]));
1931 PyMem_DEL(PVbuffer
);
1938 al_getparams(PyObject
*self
, PyObject
*args
)
1940 return doParams(args
, ALgetparams
, 1);
1944 al_setparams(PyObject
*self
, PyObject
*args
)
1946 return doParams(args
, ALsetparams
, 0);
1950 al_getname(PyObject
*self
, PyObject
*args
)
1952 long device
, descriptor
;
1955 if (!PyArg_ParseTuple(args
, "ll:getname", &device
, &descriptor
))
1957 if ((name
= ALgetname(device
, descriptor
)) == NULL
)
1959 return PyString_FromString(name
);
1963 al_getdefault(PyObject
*self
, PyObject
*args
)
1965 long device
, descriptor
, value
;
1967 if (!PyArg_ParseTuple(args
, "ll:getdefault", &device
, &descriptor
))
1969 if ((value
= ALgetdefault(device
, descriptor
)) == -1)
1971 return PyLong_FromLong(value
);
1975 al_getminmax(PyObject
*self
, PyObject
*args
)
1977 long device
, descriptor
, min
, max
;
1979 if (!PyArg_ParseTuple(args
, "ll:getminmax", &device
, &descriptor
))
1983 if (ALgetminmax(device
, descriptor
, &min
, &max
) == -1)
1985 return Py_BuildValue("ll", min
, max
);
1988 #endif /* OLD_INTERFACE */
1990 /* List of methods defined in the module */
1992 static struct PyMethodDef al_methods
[] = {
1993 #ifdef AL_NO_ELEM /* IRIX 6 */
1994 {"NewConfig", (PyCFunction
)al_NewConfig
, METH_VARARGS
, al_NewConfig__doc__
},
1995 {"OpenPort", (PyCFunction
)al_OpenPort
, METH_VARARGS
, al_OpenPort__doc__
},
1996 {"Connect", (PyCFunction
)al_Connect
, METH_VARARGS
, al_Connect__doc__
},
1997 {"Disconnect", (PyCFunction
)al_Disconnect
, METH_VARARGS
, al_Disconnect__doc__
},
1998 {"GetParams", (PyCFunction
)al_GetParams
, METH_VARARGS
, al_GetParams__doc__
},
1999 {"SetParams", (PyCFunction
)al_SetParams
, METH_VARARGS
, al_SetParams__doc__
},
2000 {"QueryValues", (PyCFunction
)al_QueryValues
, METH_VARARGS
, al_QueryValues__doc__
},
2001 {"GetParamInfo", (PyCFunction
)al_GetParamInfo
, METH_VARARGS
, al_GetParamInfo__doc__
},
2002 {"GetResourceByName", (PyCFunction
)al_GetResourceByName
, METH_VARARGS
, al_GetResourceByName__doc__
},
2003 {"IsSubtype", (PyCFunction
)al_IsSubtype
, METH_VARARGS
, al_IsSubtype__doc__
},
2005 /* this one not supported */
2006 {"SetErrorHandler", (PyCFunction
)al_SetErrorHandler
, METH_VARARGS
, al_SetErrorHandler__doc__
},
2008 #endif /* AL_NO_ELEM */
2009 #ifdef OLD_INTERFACE
2010 {"openport", (PyCFunction
)al_openport
, METH_VARARGS
},
2011 {"newconfig", (PyCFunction
)al_newconfig
, METH_VARARGS
},
2012 {"queryparams", (PyCFunction
)al_queryparams
, METH_VARARGS
},
2013 {"getparams", (PyCFunction
)al_getparams
, METH_VARARGS
},
2014 {"setparams", (PyCFunction
)al_setparams
, METH_VARARGS
},
2015 {"getname", (PyCFunction
)al_getname
, METH_VARARGS
},
2016 {"getdefault", (PyCFunction
)al_getdefault
, METH_VARARGS
},
2017 {"getminmax", (PyCFunction
)al_getminmax
, METH_VARARGS
},
2018 #endif /* OLD_INTERFACE */
2020 {NULL
, (PyCFunction
)NULL
, 0, NULL
} /* sentinel */
2024 /* Initialization function for the module (*must* be called inital) */
2026 static char al_module_documentation
[] =
2033 PyObject
*m
, *d
, *x
;
2035 /* Create the module and add the functions */
2036 m
= Py_InitModule4("al", al_methods
,
2037 al_module_documentation
,
2038 (PyObject
*)NULL
,PYTHON_API_VERSION
);
2040 /* Add some symbolic constants to the module */
2041 d
= PyModule_GetDict(m
);
2042 ErrorObject
= PyErr_NewException("al.error", NULL
, NULL
);
2043 PyDict_SetItemString(d
, "error", ErrorObject
);
2045 /* XXXX Add constants here */
2047 x
= PyInt_FromLong((long) AL_4CHANNEL
);
2048 if (x
== NULL
|| PyDict_SetItemString(d
, "FOURCHANNEL", x
) < 0)
2052 #ifdef AL_ADAT_IF_TYPE
2053 x
= PyInt_FromLong((long) AL_ADAT_IF_TYPE
);
2054 if (x
== NULL
|| PyDict_SetItemString(d
, "ADAT_IF_TYPE", x
) < 0)
2058 #ifdef AL_ADAT_MCLK_TYPE
2059 x
= PyInt_FromLong((long) AL_ADAT_MCLK_TYPE
);
2060 if (x
== NULL
|| PyDict_SetItemString(d
, "ADAT_MCLK_TYPE", x
) < 0)
2064 #ifdef AL_AES_IF_TYPE
2065 x
= PyInt_FromLong((long) AL_AES_IF_TYPE
);
2066 if (x
== NULL
|| PyDict_SetItemString(d
, "AES_IF_TYPE", x
) < 0)
2070 #ifdef AL_AES_MCLK_TYPE
2071 x
= PyInt_FromLong((long) AL_AES_MCLK_TYPE
);
2072 if (x
== NULL
|| PyDict_SetItemString(d
, "AES_MCLK_TYPE", x
) < 0)
2076 #ifdef AL_ANALOG_IF_TYPE
2077 x
= PyInt_FromLong((long) AL_ANALOG_IF_TYPE
);
2078 if (x
== NULL
|| PyDict_SetItemString(d
, "ANALOG_IF_TYPE", x
) < 0)
2083 x
= PyInt_FromLong((long) AL_ASSOCIATE
);
2084 if (x
== NULL
|| PyDict_SetItemString(d
, "ASSOCIATE", x
) < 0)
2088 #ifdef AL_BAD_BUFFER_NULL
2089 x
= PyInt_FromLong((long) AL_BAD_BUFFER_NULL
);
2090 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFER_NULL", x
) < 0)
2094 #ifdef AL_BAD_BUFFERLENGTH
2095 x
= PyInt_FromLong((long) AL_BAD_BUFFERLENGTH
);
2096 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH", x
) < 0)
2100 #ifdef AL_BAD_BUFFERLENGTH_NEG
2101 x
= PyInt_FromLong((long) AL_BAD_BUFFERLENGTH_NEG
);
2102 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH_NEG", x
) < 0)
2106 #ifdef AL_BAD_BUFFERLENGTH_ODD
2107 x
= PyInt_FromLong((long) AL_BAD_BUFFERLENGTH_ODD
);
2108 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH_ODD", x
) < 0)
2112 #ifdef AL_BAD_CHANNELS
2113 x
= PyInt_FromLong((long) AL_BAD_CHANNELS
);
2114 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_CHANNELS", x
) < 0)
2118 #ifdef AL_BAD_CONFIG
2119 x
= PyInt_FromLong((long) AL_BAD_CONFIG
);
2120 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_CONFIG", x
) < 0)
2124 #ifdef AL_BAD_COUNT_NEG
2125 x
= PyInt_FromLong((long) AL_BAD_COUNT_NEG
);
2126 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_COUNT_NEG", x
) < 0)
2130 #ifdef AL_BAD_DEVICE
2131 x
= PyInt_FromLong((long) AL_BAD_DEVICE
);
2132 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_DEVICE", x
) < 0)
2136 #ifdef AL_BAD_DEVICE_ACCESS
2137 x
= PyInt_FromLong((long) AL_BAD_DEVICE_ACCESS
);
2138 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_DEVICE_ACCESS", x
) < 0)
2142 #ifdef AL_BAD_DIRECTION
2143 x
= PyInt_FromLong((long) AL_BAD_DIRECTION
);
2144 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_DIRECTION", x
) < 0)
2148 #ifdef AL_BAD_FILLPOINT
2149 x
= PyInt_FromLong((long) AL_BAD_FILLPOINT
);
2150 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_FILLPOINT", x
) < 0)
2154 #ifdef AL_BAD_FLOATMAX
2155 x
= PyInt_FromLong((long) AL_BAD_FLOATMAX
);
2156 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_FLOATMAX", x
) < 0)
2160 #ifdef AL_BAD_ILLEGAL_STATE
2161 x
= PyInt_FromLong((long) AL_BAD_ILLEGAL_STATE
);
2162 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_ILLEGAL_STATE", x
) < 0)
2166 #ifdef AL_BAD_NO_PORTS
2167 x
= PyInt_FromLong((long) AL_BAD_NO_PORTS
);
2168 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NO_PORTS", x
) < 0)
2172 #ifdef AL_BAD_NOT_FOUND
2173 x
= PyInt_FromLong((long) AL_BAD_NOT_FOUND
);
2174 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NOT_FOUND", x
) < 0)
2178 #ifdef AL_BAD_NOT_IMPLEMENTED
2179 x
= PyInt_FromLong((long) AL_BAD_NOT_IMPLEMENTED
);
2180 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NOT_IMPLEMENTED", x
) < 0)
2184 #ifdef AL_BAD_OUT_OF_MEM
2185 x
= PyInt_FromLong((long) AL_BAD_OUT_OF_MEM
);
2186 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_OUT_OF_MEM", x
) < 0)
2191 x
= PyInt_FromLong((long) AL_BAD_PARAM
);
2192 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PARAM", x
) < 0)
2196 #ifdef AL_BAD_PERMISSIONS
2197 x
= PyInt_FromLong((long) AL_BAD_PERMISSIONS
);
2198 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PERMISSIONS", x
) < 0)
2203 x
= PyInt_FromLong((long) AL_BAD_PORT
);
2204 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PORT", x
) < 0)
2208 #ifdef AL_BAD_PORTSTYLE
2209 x
= PyInt_FromLong((long) AL_BAD_PORTSTYLE
);
2210 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PORTSTYLE", x
) < 0)
2214 #ifdef AL_BAD_PVBUFFER
2215 x
= PyInt_FromLong((long) AL_BAD_PVBUFFER
);
2216 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PVBUFFER", x
) < 0)
2221 x
= PyInt_FromLong((long) AL_BAD_QSIZE
);
2222 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_QSIZE", x
) < 0)
2227 x
= PyInt_FromLong((long) AL_BAD_RATE
);
2228 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_RATE", x
) < 0)
2232 #ifdef AL_BAD_RESOURCE
2233 x
= PyInt_FromLong((long) AL_BAD_RESOURCE
);
2234 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_RESOURCE", x
) < 0)
2238 #ifdef AL_BAD_SAMPFMT
2239 x
= PyInt_FromLong((long) AL_BAD_SAMPFMT
);
2240 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_SAMPFMT", x
) < 0)
2244 #ifdef AL_BAD_TRANSFER_SIZE
2245 x
= PyInt_FromLong((long) AL_BAD_TRANSFER_SIZE
);
2246 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_TRANSFER_SIZE", x
) < 0)
2251 x
= PyInt_FromLong((long) AL_BAD_WIDTH
);
2252 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_WIDTH", x
) < 0)
2256 #ifdef AL_CHANNEL_MODE
2257 x
= PyInt_FromLong((long) AL_CHANNEL_MODE
);
2258 if (x
== NULL
|| PyDict_SetItemString(d
, "CHANNEL_MODE", x
) < 0)
2263 x
= PyInt_FromLong((long) AL_CHANNELS
);
2264 if (x
== NULL
|| PyDict_SetItemString(d
, "CHANNELS", x
) < 0)
2269 x
= PyInt_FromLong((long) AL_CHAR_ELEM
);
2270 if (x
== NULL
|| PyDict_SetItemString(d
, "CHAR_ELEM", x
) < 0)
2275 x
= PyInt_FromLong((long) AL_CLOCK_GEN
);
2276 if (x
== NULL
|| PyDict_SetItemString(d
, "CLOCK_GEN", x
) < 0)
2280 #ifdef AL_CLOCKGEN_TYPE
2281 x
= PyInt_FromLong((long) AL_CLOCKGEN_TYPE
);
2282 if (x
== NULL
|| PyDict_SetItemString(d
, "CLOCKGEN_TYPE", x
) < 0)
2287 x
= PyInt_FromLong((long) AL_CONNECT
);
2288 if (x
== NULL
|| PyDict_SetItemString(d
, "CONNECT", x
) < 0)
2292 #ifdef AL_CONNECTION_TYPE
2293 x
= PyInt_FromLong((long) AL_CONNECTION_TYPE
);
2294 if (x
== NULL
|| PyDict_SetItemString(d
, "CONNECTION_TYPE", x
) < 0)
2298 #ifdef AL_CONNECTIONS
2299 x
= PyInt_FromLong((long) AL_CONNECTIONS
);
2300 if (x
== NULL
|| PyDict_SetItemString(d
, "CONNECTIONS", x
) < 0)
2304 #ifdef AL_CRYSTAL_MCLK_TYPE
2305 x
= PyInt_FromLong((long) AL_CRYSTAL_MCLK_TYPE
);
2306 if (x
== NULL
|| PyDict_SetItemString(d
, "CRYSTAL_MCLK_TYPE", x
) < 0)
2310 #ifdef AL_DEFAULT_DEVICE
2311 x
= PyInt_FromLong((long) AL_DEFAULT_DEVICE
);
2312 if (x
== NULL
|| PyDict_SetItemString(d
, "DEFAULT_DEVICE", x
) < 0)
2316 #ifdef AL_DEFAULT_INPUT
2317 x
= PyInt_FromLong((long) AL_DEFAULT_INPUT
);
2318 if (x
== NULL
|| PyDict_SetItemString(d
, "DEFAULT_INPUT", x
) < 0)
2322 #ifdef AL_DEFAULT_OUTPUT
2323 x
= PyInt_FromLong((long) AL_DEFAULT_OUTPUT
);
2324 if (x
== NULL
|| PyDict_SetItemString(d
, "DEFAULT_OUTPUT", x
) < 0)
2329 x
= PyInt_FromLong((long) AL_DEST
);
2330 if (x
== NULL
|| PyDict_SetItemString(d
, "DEST", x
) < 0)
2334 #ifdef AL_DEVICE_TYPE
2335 x
= PyInt_FromLong((long) AL_DEVICE_TYPE
);
2336 if (x
== NULL
|| PyDict_SetItemString(d
, "DEVICE_TYPE", x
) < 0)
2341 x
= PyInt_FromLong((long) AL_DEVICES
);
2342 if (x
== NULL
|| PyDict_SetItemString(d
, "DEVICES", x
) < 0)
2346 #ifdef AL_DIGITAL_IF_TYPE
2347 x
= PyInt_FromLong((long) AL_DIGITAL_IF_TYPE
);
2348 if (x
== NULL
|| PyDict_SetItemString(d
, "DIGITAL_IF_TYPE", x
) < 0)
2352 #ifdef AL_DIGITAL_INPUT_RATE
2353 x
= PyInt_FromLong((long) AL_DIGITAL_INPUT_RATE
);
2354 if (x
== NULL
|| PyDict_SetItemString(d
, "DIGITAL_INPUT_RATE", x
) < 0)
2358 #ifdef AL_DISCONNECT
2359 x
= PyInt_FromLong((long) AL_DISCONNECT
);
2360 if (x
== NULL
|| PyDict_SetItemString(d
, "DISCONNECT", x
) < 0)
2365 x
= PyInt_FromLong((long) AL_ENUM_ELEM
);
2366 if (x
== NULL
|| PyDict_SetItemString(d
, "ENUM_ELEM", x
) < 0)
2370 #ifdef AL_ENUM_VALUE
2371 x
= PyInt_FromLong((long) AL_ENUM_VALUE
);
2372 if (x
== NULL
|| PyDict_SetItemString(d
, "ENUM_VALUE", x
) < 0)
2376 #ifdef AL_ERROR_INPUT_OVERFLOW
2377 x
= PyInt_FromLong((long) AL_ERROR_INPUT_OVERFLOW
);
2378 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_INPUT_OVERFLOW", x
) < 0)
2382 #ifdef AL_ERROR_LENGTH
2383 x
= PyInt_FromLong((long) AL_ERROR_LENGTH
);
2384 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_LENGTH", x
) < 0)
2388 #ifdef AL_ERROR_LOCATION_LSP
2389 x
= PyInt_FromLong((long) AL_ERROR_LOCATION_LSP
);
2390 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_LOCATION_LSP", x
) < 0)
2394 #ifdef AL_ERROR_LOCATION_MSP
2395 x
= PyInt_FromLong((long) AL_ERROR_LOCATION_MSP
);
2396 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_LOCATION_MSP", x
) < 0)
2400 #ifdef AL_ERROR_NUMBER
2401 x
= PyInt_FromLong((long) AL_ERROR_NUMBER
);
2402 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_NUMBER", x
) < 0)
2406 #ifdef AL_ERROR_OUTPUT_UNDERFLOW
2407 x
= PyInt_FromLong((long) AL_ERROR_OUTPUT_UNDERFLOW
);
2408 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_OUTPUT_UNDERFLOW", x
) < 0)
2412 #ifdef AL_ERROR_TYPE
2413 x
= PyInt_FromLong((long) AL_ERROR_TYPE
);
2414 if (x
== NULL
|| PyDict_SetItemString(d
, "ERROR_TYPE", x
) < 0)
2418 #ifdef AL_FIXED_ELEM
2419 x
= PyInt_FromLong((long) AL_FIXED_ELEM
);
2420 if (x
== NULL
|| PyDict_SetItemString(d
, "FIXED_ELEM", x
) < 0)
2424 #ifdef AL_FIXED_MCLK_TYPE
2425 x
= PyInt_FromLong((long) AL_FIXED_MCLK_TYPE
);
2426 if (x
== NULL
|| PyDict_SetItemString(d
, "FIXED_MCLK_TYPE", x
) < 0)
2431 x
= PyInt_FromLong((long) AL_GAIN
);
2432 if (x
== NULL
|| PyDict_SetItemString(d
, "GAIN", x
) < 0)
2437 x
= PyInt_FromLong((long) AL_GAIN_REF
);
2438 if (x
== NULL
|| PyDict_SetItemString(d
, "GAIN_REF", x
) < 0)
2443 x
= PyInt_FromLong((long) AL_HRB_TYPE
);
2444 if (x
== NULL
|| PyDict_SetItemString(d
, "HRB_TYPE", x
) < 0)
2448 #ifdef AL_INPUT_COUNT
2449 x
= PyInt_FromLong((long) AL_INPUT_COUNT
);
2450 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_COUNT", x
) < 0)
2454 #ifdef AL_INPUT_DEVICE_TYPE
2455 x
= PyInt_FromLong((long) AL_INPUT_DEVICE_TYPE
);
2456 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_DEVICE_TYPE", x
) < 0)
2460 #ifdef AL_INPUT_DIGITAL
2461 x
= PyInt_FromLong((long) AL_INPUT_DIGITAL
);
2462 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_DIGITAL", x
) < 0)
2466 #ifdef AL_INPUT_HRB_TYPE
2467 x
= PyInt_FromLong((long) AL_INPUT_HRB_TYPE
);
2468 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_HRB_TYPE", x
) < 0)
2472 #ifdef AL_INPUT_LINE
2473 x
= PyInt_FromLong((long) AL_INPUT_LINE
);
2474 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_LINE", x
) < 0)
2479 x
= PyInt_FromLong((long) AL_INPUT_MIC
);
2480 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_MIC", x
) < 0)
2484 #ifdef AL_INPUT_PORT_TYPE
2485 x
= PyInt_FromLong((long) AL_INPUT_PORT_TYPE
);
2486 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_PORT_TYPE", x
) < 0)
2490 #ifdef AL_INPUT_RATE
2491 x
= PyInt_FromLong((long) AL_INPUT_RATE
);
2492 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_RATE", x
) < 0)
2496 #ifdef AL_INPUT_SOURCE
2497 x
= PyInt_FromLong((long) AL_INPUT_SOURCE
);
2498 if (x
== NULL
|| PyDict_SetItemString(d
, "INPUT_SOURCE", x
) < 0)
2502 #ifdef AL_INT32_ELEM
2503 x
= PyInt_FromLong((long) AL_INT32_ELEM
);
2504 if (x
== NULL
|| PyDict_SetItemString(d
, "INT32_ELEM", x
) < 0)
2508 #ifdef AL_INT64_ELEM
2509 x
= PyInt_FromLong((long) AL_INT64_ELEM
);
2510 if (x
== NULL
|| PyDict_SetItemString(d
, "INT64_ELEM", x
) < 0)
2515 x
= PyInt_FromLong((long) AL_INTERFACE
);
2516 if (x
== NULL
|| PyDict_SetItemString(d
, "INTERFACE", x
) < 0)
2520 #ifdef AL_INTERFACE_TYPE
2521 x
= PyInt_FromLong((long) AL_INTERFACE_TYPE
);
2522 if (x
== NULL
|| PyDict_SetItemString(d
, "INTERFACE_TYPE", x
) < 0)
2526 #ifdef AL_INVALID_PARAM
2527 x
= PyInt_FromLong((long) AL_INVALID_PARAM
);
2528 if (x
== NULL
|| PyDict_SetItemString(d
, "INVALID_PARAM", x
) < 0)
2532 #ifdef AL_INVALID_VALUE
2533 x
= PyInt_FromLong((long) AL_INVALID_VALUE
);
2534 if (x
== NULL
|| PyDict_SetItemString(d
, "INVALID_VALUE", x
) < 0)
2539 x
= PyInt_FromLong((long) AL_JITTER
);
2540 if (x
== NULL
|| PyDict_SetItemString(d
, "JITTER", x
) < 0)
2545 x
= PyInt_FromLong((long) AL_LABEL
);
2546 if (x
== NULL
|| PyDict_SetItemString(d
, "LABEL", x
) < 0)
2550 #ifdef AL_LEFT_INPUT_ATTEN
2551 x
= PyInt_FromLong((long) AL_LEFT_INPUT_ATTEN
);
2552 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT_INPUT_ATTEN", x
) < 0)
2556 #ifdef AL_LEFT_MONITOR_ATTEN
2557 x
= PyInt_FromLong((long) AL_LEFT_MONITOR_ATTEN
);
2558 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT_MONITOR_ATTEN", x
) < 0)
2562 #ifdef AL_LEFT_SPEAKER_GAIN
2563 x
= PyInt_FromLong((long) AL_LEFT_SPEAKER_GAIN
);
2564 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT_SPEAKER_GAIN", x
) < 0)
2568 #ifdef AL_LEFT1_INPUT_ATTEN
2569 x
= PyInt_FromLong((long) AL_LEFT1_INPUT_ATTEN
);
2570 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT1_INPUT_ATTEN", x
) < 0)
2574 #ifdef AL_LEFT2_INPUT_ATTEN
2575 x
= PyInt_FromLong((long) AL_LEFT2_INPUT_ATTEN
);
2576 if (x
== NULL
|| PyDict_SetItemString(d
, "LEFT2_INPUT_ATTEN", x
) < 0)
2580 #ifdef AL_LINE_IF_TYPE
2581 x
= PyInt_FromLong((long) AL_LINE_IF_TYPE
);
2582 if (x
== NULL
|| PyDict_SetItemString(d
, "LINE_IF_TYPE", x
) < 0)
2586 #ifdef AL_MASTER_CLOCK
2587 x
= PyInt_FromLong((long) AL_MASTER_CLOCK
);
2588 if (x
== NULL
|| PyDict_SetItemString(d
, "MASTER_CLOCK", x
) < 0)
2592 #ifdef AL_MATRIX_VAL
2593 x
= PyInt_FromLong((long) AL_MATRIX_VAL
);
2594 if (x
== NULL
|| PyDict_SetItemString(d
, "MATRIX_VAL", x
) < 0)
2599 x
= PyInt_FromLong((long) AL_MAX_ERROR
);
2600 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_ERROR", x
) < 0)
2604 #ifdef AL_MAX_EVENT_PARAM
2605 x
= PyInt_FromLong((long) AL_MAX_EVENT_PARAM
);
2606 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_EVENT_PARAM", x
) < 0)
2610 #ifdef AL_MAX_PBUFSIZE
2611 x
= PyInt_FromLong((long) AL_MAX_PBUFSIZE
);
2612 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_PBUFSIZE", x
) < 0)
2617 x
= PyInt_FromLong((long) AL_MAX_PORTS
);
2618 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_PORTS", x
) < 0)
2622 #ifdef AL_MAX_RESOURCE_ID
2623 x
= PyInt_FromLong((long) AL_MAX_RESOURCE_ID
);
2624 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_RESOURCE_ID", x
) < 0)
2628 #ifdef AL_MAX_SETSIZE
2629 x
= PyInt_FromLong((long) AL_MAX_SETSIZE
);
2630 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_SETSIZE", x
) < 0)
2634 #ifdef AL_MAX_STRLEN
2635 x
= PyInt_FromLong((long) AL_MAX_STRLEN
);
2636 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_STRLEN", x
) < 0)
2641 x
= PyInt_FromLong((long) AL_MCLK_TYPE
);
2642 if (x
== NULL
|| PyDict_SetItemString(d
, "MCLK_TYPE", x
) < 0)
2646 #ifdef AL_MIC_IF_TYPE
2647 x
= PyInt_FromLong((long) AL_MIC_IF_TYPE
);
2648 if (x
== NULL
|| PyDict_SetItemString(d
, "MIC_IF_TYPE", x
) < 0)
2652 #ifdef AL_MONITOR_CTL
2653 x
= PyInt_FromLong((long) AL_MONITOR_CTL
);
2654 if (x
== NULL
|| PyDict_SetItemString(d
, "MONITOR_CTL", x
) < 0)
2658 #ifdef AL_MONITOR_OFF
2659 x
= PyInt_FromLong((long) AL_MONITOR_OFF
);
2660 if (x
== NULL
|| PyDict_SetItemString(d
, "MONITOR_OFF", x
) < 0)
2664 #ifdef AL_MONITOR_ON
2665 x
= PyInt_FromLong((long) AL_MONITOR_ON
);
2666 if (x
== NULL
|| PyDict_SetItemString(d
, "MONITOR_ON", x
) < 0)
2671 x
= PyInt_FromLong((long) AL_MONO
);
2672 if (x
== NULL
|| PyDict_SetItemString(d
, "MONO", x
) < 0)
2677 x
= PyInt_FromLong((long) AL_MUTE
);
2678 if (x
== NULL
|| PyDict_SetItemString(d
, "MUTE", x
) < 0)
2683 x
= PyInt_FromLong((long) AL_NAME
);
2684 if (x
== NULL
|| PyDict_SetItemString(d
, "NAME", x
) < 0)
2688 #ifdef AL_NEG_INFINITY
2689 x
= PyInt_FromLong((long) AL_NEG_INFINITY
);
2690 if (x
== NULL
|| PyDict_SetItemString(d
, "NEG_INFINITY", x
) < 0)
2694 #ifdef AL_NEG_INFINITY_BIT
2695 x
= PyInt_FromLong((long) AL_NEG_INFINITY_BIT
);
2696 if (x
== NULL
|| PyDict_SetItemString(d
, "NEG_INFINITY_BIT", x
) < 0)
2701 x
= PyInt_FromLong((long) AL_NO_CHANGE
);
2702 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_CHANGE", x
) < 0)
2706 #ifdef AL_NO_CHANGE_BIT
2707 x
= PyInt_FromLong((long) AL_NO_CHANGE_BIT
);
2708 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_CHANGE_BIT", x
) < 0)
2713 x
= PyInt_FromLong((long) AL_NO_ELEM
);
2714 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_ELEM", x
) < 0)
2719 x
= PyInt_FromLong((long) AL_NO_ERRORS
);
2720 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_ERRORS", x
) < 0)
2725 x
= PyInt_FromLong((long) AL_NO_OP
);
2726 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_OP", x
) < 0)
2731 x
= PyInt_FromLong((long) AL_NO_VAL
);
2732 if (x
== NULL
|| PyDict_SetItemString(d
, "NO_VAL", x
) < 0)
2736 #ifdef AL_NULL_RESOURCE
2737 x
= PyInt_FromLong((long) AL_NULL_RESOURCE
);
2738 if (x
== NULL
|| PyDict_SetItemString(d
, "NULL_RESOURCE", x
) < 0)
2742 #ifdef AL_OUTPUT_COUNT
2743 x
= PyInt_FromLong((long) AL_OUTPUT_COUNT
);
2744 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_COUNT", x
) < 0)
2748 #ifdef AL_OUTPUT_DEVICE_TYPE
2749 x
= PyInt_FromLong((long) AL_OUTPUT_DEVICE_TYPE
);
2750 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_DEVICE_TYPE", x
) < 0)
2754 #ifdef AL_OUTPUT_HRB_TYPE
2755 x
= PyInt_FromLong((long) AL_OUTPUT_HRB_TYPE
);
2756 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_HRB_TYPE", x
) < 0)
2760 #ifdef AL_OUTPUT_PORT_TYPE
2761 x
= PyInt_FromLong((long) AL_OUTPUT_PORT_TYPE
);
2762 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_PORT_TYPE", x
) < 0)
2766 #ifdef AL_OUTPUT_RATE
2767 x
= PyInt_FromLong((long) AL_OUTPUT_RATE
);
2768 if (x
== NULL
|| PyDict_SetItemString(d
, "OUTPUT_RATE", x
) < 0)
2773 x
= PyInt_FromLong((long) AL_PARAM_BIT
);
2774 if (x
== NULL
|| PyDict_SetItemString(d
, "PARAM_BIT", x
) < 0)
2779 x
= PyInt_FromLong((long) AL_PARAMS
);
2780 if (x
== NULL
|| PyDict_SetItemString(d
, "PARAMS", x
) < 0)
2784 #ifdef AL_PORT_COUNT
2785 x
= PyInt_FromLong((long) AL_PORT_COUNT
);
2786 if (x
== NULL
|| PyDict_SetItemString(d
, "PORT_COUNT", x
) < 0)
2791 x
= PyInt_FromLong((long) AL_PORT_TYPE
);
2792 if (x
== NULL
|| PyDict_SetItemString(d
, "PORT_TYPE", x
) < 0)
2797 x
= PyInt_FromLong((long) AL_PORTS
);
2798 if (x
== NULL
|| PyDict_SetItemString(d
, "PORTS", x
) < 0)
2802 #ifdef AL_PORTSTYLE_DIRECT
2803 x
= PyInt_FromLong((long) AL_PORTSTYLE_DIRECT
);
2804 if (x
== NULL
|| PyDict_SetItemString(d
, "PORTSTYLE_DIRECT", x
) < 0)
2808 #ifdef AL_PORTSTYLE_SERIAL
2809 x
= PyInt_FromLong((long) AL_PORTSTYLE_SERIAL
);
2810 if (x
== NULL
|| PyDict_SetItemString(d
, "PORTSTYLE_SERIAL", x
) < 0)
2814 #ifdef AL_PRINT_ERRORS
2815 x
= PyInt_FromLong((long) AL_PRINT_ERRORS
);
2816 if (x
== NULL
|| PyDict_SetItemString(d
, "PRINT_ERRORS", x
) < 0)
2821 x
= PyInt_FromLong((long) AL_PTR_ELEM
);
2822 if (x
== NULL
|| PyDict_SetItemString(d
, "PTR_ELEM", x
) < 0)
2826 #ifdef AL_RANGE_VALUE
2827 x
= PyInt_FromLong((long) AL_RANGE_VALUE
);
2828 if (x
== NULL
|| PyDict_SetItemString(d
, "RANGE_VALUE", x
) < 0)
2833 x
= PyInt_FromLong((long) AL_RATE
);
2834 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE", x
) < 0)
2838 #ifdef AL_RATE_11025
2839 x
= PyInt_FromLong((long) AL_RATE_11025
);
2840 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_11025", x
) < 0)
2844 #ifdef AL_RATE_16000
2845 x
= PyInt_FromLong((long) AL_RATE_16000
);
2846 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_16000", x
) < 0)
2850 #ifdef AL_RATE_22050
2851 x
= PyInt_FromLong((long) AL_RATE_22050
);
2852 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_22050", x
) < 0)
2856 #ifdef AL_RATE_32000
2857 x
= PyInt_FromLong((long) AL_RATE_32000
);
2858 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_32000", x
) < 0)
2862 #ifdef AL_RATE_44100
2863 x
= PyInt_FromLong((long) AL_RATE_44100
);
2864 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_44100", x
) < 0)
2868 #ifdef AL_RATE_48000
2869 x
= PyInt_FromLong((long) AL_RATE_48000
);
2870 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_48000", x
) < 0)
2875 x
= PyInt_FromLong((long) AL_RATE_8000
);
2876 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_8000", x
) < 0)
2880 #ifdef AL_RATE_AES_1
2881 x
= PyInt_FromLong((long) AL_RATE_AES_1
);
2882 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_1", x
) < 0)
2886 #ifdef AL_RATE_AES_1s
2887 x
= PyInt_FromLong((long) AL_RATE_AES_1s
);
2888 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_1s", x
) < 0)
2892 #ifdef AL_RATE_AES_2
2893 x
= PyInt_FromLong((long) AL_RATE_AES_2
);
2894 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_2", x
) < 0)
2898 #ifdef AL_RATE_AES_3
2899 x
= PyInt_FromLong((long) AL_RATE_AES_3
);
2900 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_3", x
) < 0)
2904 #ifdef AL_RATE_AES_4
2905 x
= PyInt_FromLong((long) AL_RATE_AES_4
);
2906 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_4", x
) < 0)
2910 #ifdef AL_RATE_AES_6
2911 x
= PyInt_FromLong((long) AL_RATE_AES_6
);
2912 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_AES_6", x
) < 0)
2916 #ifdef AL_RATE_FRACTION_D
2917 x
= PyInt_FromLong((long) AL_RATE_FRACTION_D
);
2918 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_FRACTION_D", x
) < 0)
2922 #ifdef AL_RATE_FRACTION_N
2923 x
= PyInt_FromLong((long) AL_RATE_FRACTION_N
);
2924 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_FRACTION_N", x
) < 0)
2928 #ifdef AL_RATE_INPUTRATE
2929 x
= PyInt_FromLong((long) AL_RATE_INPUTRATE
);
2930 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_INPUTRATE", x
) < 0)
2934 #ifdef AL_RATE_NO_DIGITAL_INPUT
2935 x
= PyInt_FromLong((long) AL_RATE_NO_DIGITAL_INPUT
);
2936 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_NO_DIGITAL_INPUT", x
) < 0)
2940 #ifdef AL_RATE_UNACQUIRED
2941 x
= PyInt_FromLong((long) AL_RATE_UNACQUIRED
);
2942 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_UNACQUIRED", x
) < 0)
2946 #ifdef AL_RATE_UNDEFINED
2947 x
= PyInt_FromLong((long) AL_RATE_UNDEFINED
);
2948 if (x
== NULL
|| PyDict_SetItemString(d
, "RATE_UNDEFINED", x
) < 0)
2953 x
= PyInt_FromLong((long) AL_REF_0DBV
);
2954 if (x
== NULL
|| PyDict_SetItemString(d
, "REF_0DBV", x
) < 0)
2959 x
= PyInt_FromLong((long) AL_REF_NONE
);
2960 if (x
== NULL
|| PyDict_SetItemString(d
, "REF_NONE", x
) < 0)
2964 #ifdef AL_RESERVED1_TYPE
2965 x
= PyInt_FromLong((long) AL_RESERVED1_TYPE
);
2966 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED1_TYPE", x
) < 0)
2970 #ifdef AL_RESERVED2_TYPE
2971 x
= PyInt_FromLong((long) AL_RESERVED2_TYPE
);
2972 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED2_TYPE", x
) < 0)
2976 #ifdef AL_RESERVED3_TYPE
2977 x
= PyInt_FromLong((long) AL_RESERVED3_TYPE
);
2978 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED3_TYPE", x
) < 0)
2982 #ifdef AL_RESERVED4_TYPE
2983 x
= PyInt_FromLong((long) AL_RESERVED4_TYPE
);
2984 if (x
== NULL
|| PyDict_SetItemString(d
, "RESERVED4_TYPE", x
) < 0)
2989 x
= PyInt_FromLong((long) AL_RESOURCE
);
2990 if (x
== NULL
|| PyDict_SetItemString(d
, "RESOURCE", x
) < 0)
2994 #ifdef AL_RESOURCE_ELEM
2995 x
= PyInt_FromLong((long) AL_RESOURCE_ELEM
);
2996 if (x
== NULL
|| PyDict_SetItemString(d
, "RESOURCE_ELEM", x
) < 0)
3000 #ifdef AL_RESOURCE_TYPE
3001 x
= PyInt_FromLong((long) AL_RESOURCE_TYPE
);
3002 if (x
== NULL
|| PyDict_SetItemString(d
, "RESOURCE_TYPE", x
) < 0)
3006 #ifdef AL_RIGHT_INPUT_ATTEN
3007 x
= PyInt_FromLong((long) AL_RIGHT_INPUT_ATTEN
);
3008 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT_INPUT_ATTEN", x
) < 0)
3012 #ifdef AL_RIGHT_MONITOR_ATTEN
3013 x
= PyInt_FromLong((long) AL_RIGHT_MONITOR_ATTEN
);
3014 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT_MONITOR_ATTEN", x
) < 0)
3018 #ifdef AL_RIGHT_SPEAKER_GAIN
3019 x
= PyInt_FromLong((long) AL_RIGHT_SPEAKER_GAIN
);
3020 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT_SPEAKER_GAIN", x
) < 0)
3024 #ifdef AL_RIGHT1_INPUT_ATTEN
3025 x
= PyInt_FromLong((long) AL_RIGHT1_INPUT_ATTEN
);
3026 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT1_INPUT_ATTEN", x
) < 0)
3030 #ifdef AL_RIGHT2_INPUT_ATTEN
3031 x
= PyInt_FromLong((long) AL_RIGHT2_INPUT_ATTEN
);
3032 if (x
== NULL
|| PyDict_SetItemString(d
, "RIGHT2_INPUT_ATTEN", x
) < 0)
3036 #ifdef AL_SAMPFMT_DOUBLE
3037 x
= PyInt_FromLong((long) AL_SAMPFMT_DOUBLE
);
3038 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPFMT_DOUBLE", x
) < 0)
3042 #ifdef AL_SAMPFMT_FLOAT
3043 x
= PyInt_FromLong((long) AL_SAMPFMT_FLOAT
);
3044 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPFMT_FLOAT", x
) < 0)
3048 #ifdef AL_SAMPFMT_TWOSCOMP
3049 x
= PyInt_FromLong((long) AL_SAMPFMT_TWOSCOMP
);
3050 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPFMT_TWOSCOMP", x
) < 0)
3055 x
= PyInt_FromLong((long) AL_SAMPLE_16
);
3056 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLE_16", x
) < 0)
3061 x
= PyInt_FromLong((long) AL_SAMPLE_24
);
3062 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLE_24", x
) < 0)
3067 x
= PyInt_FromLong((long) AL_SAMPLE_8
);
3068 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLE_8", x
) < 0)
3072 #ifdef AL_SCALAR_VAL
3073 x
= PyInt_FromLong((long) AL_SCALAR_VAL
);
3074 if (x
== NULL
|| PyDict_SetItemString(d
, "SCALAR_VAL", x
) < 0)
3079 x
= PyInt_FromLong((long) AL_SET_VAL
);
3080 if (x
== NULL
|| PyDict_SetItemString(d
, "SET_VAL", x
) < 0)
3084 #ifdef AL_SHORT_NAME
3085 x
= PyInt_FromLong((long) AL_SHORT_NAME
);
3086 if (x
== NULL
|| PyDict_SetItemString(d
, "SHORT_NAME", x
) < 0)
3091 x
= PyInt_FromLong((long) AL_SOURCE
);
3092 if (x
== NULL
|| PyDict_SetItemString(d
, "SOURCE", x
) < 0)
3096 #ifdef AL_SPEAKER_IF_TYPE
3097 x
= PyInt_FromLong((long) AL_SPEAKER_IF_TYPE
);
3098 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_IF_TYPE", x
) < 0)
3102 #ifdef AL_SPEAKER_MUTE_CTL
3103 x
= PyInt_FromLong((long) AL_SPEAKER_MUTE_CTL
);
3104 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_MUTE_CTL", x
) < 0)
3108 #ifdef AL_SPEAKER_MUTE_OFF
3109 x
= PyInt_FromLong((long) AL_SPEAKER_MUTE_OFF
);
3110 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_MUTE_OFF", x
) < 0)
3114 #ifdef AL_SPEAKER_MUTE_ON
3115 x
= PyInt_FromLong((long) AL_SPEAKER_MUTE_ON
);
3116 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_MUTE_ON", x
) < 0)
3120 #ifdef AL_SPEAKER_PLUS_LINE_IF_TYPE
3121 x
= PyInt_FromLong((long) AL_SPEAKER_PLUS_LINE_IF_TYPE
);
3122 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEAKER_PLUS_LINE_IF_TYPE", x
) < 0)
3127 x
= PyInt_FromLong((long) AL_STEREO
);
3128 if (x
== NULL
|| PyDict_SetItemString(d
, "STEREO", x
) < 0)
3132 #ifdef AL_STRING_VAL
3133 x
= PyInt_FromLong((long) AL_STRING_VAL
);
3134 if (x
== NULL
|| PyDict_SetItemString(d
, "STRING_VAL", x
) < 0)
3139 x
= PyInt_FromLong((long) AL_SUBSYSTEM
);
3140 if (x
== NULL
|| PyDict_SetItemString(d
, "SUBSYSTEM", x
) < 0)
3144 #ifdef AL_SUBSYSTEM_TYPE
3145 x
= PyInt_FromLong((long) AL_SUBSYSTEM_TYPE
);
3146 if (x
== NULL
|| PyDict_SetItemString(d
, "SUBSYSTEM_TYPE", x
) < 0)
3150 #ifdef AL_SYNC_INPUT_TO_AES
3151 x
= PyInt_FromLong((long) AL_SYNC_INPUT_TO_AES
);
3152 if (x
== NULL
|| PyDict_SetItemString(d
, "SYNC_INPUT_TO_AES", x
) < 0)
3156 #ifdef AL_SYNC_OUTPUT_TO_AES
3157 x
= PyInt_FromLong((long) AL_SYNC_OUTPUT_TO_AES
);
3158 if (x
== NULL
|| PyDict_SetItemString(d
, "SYNC_OUTPUT_TO_AES", x
) < 0)
3163 x
= PyInt_FromLong((long) AL_SYSTEM
);
3164 if (x
== NULL
|| PyDict_SetItemString(d
, "SYSTEM", x
) < 0)
3168 #ifdef AL_SYSTEM_TYPE
3169 x
= PyInt_FromLong((long) AL_SYSTEM_TYPE
);
3170 if (x
== NULL
|| PyDict_SetItemString(d
, "SYSTEM_TYPE", x
) < 0)
3174 #ifdef AL_TEST_IF_TYPE
3175 x
= PyInt_FromLong((long) AL_TEST_IF_TYPE
);
3176 if (x
== NULL
|| PyDict_SetItemString(d
, "TEST_IF_TYPE", x
) < 0)
3181 x
= PyInt_FromLong((long) AL_TYPE
);
3182 if (x
== NULL
|| PyDict_SetItemString(d
, "TYPE", x
) < 0)
3187 x
= PyInt_FromLong((long) AL_TYPE_BIT
);
3188 if (x
== NULL
|| PyDict_SetItemString(d
, "TYPE_BIT", x
) < 0)
3192 #ifdef AL_UNUSED_COUNT
3193 x
= PyInt_FromLong((long) AL_UNUSED_COUNT
);
3194 if (x
== NULL
|| PyDict_SetItemString(d
, "UNUSED_COUNT", x
) < 0)
3198 #ifdef AL_UNUSED_PORTS
3199 x
= PyInt_FromLong((long) AL_UNUSED_PORTS
);
3200 if (x
== NULL
|| PyDict_SetItemString(d
, "UNUSED_PORTS", x
) < 0)
3204 #ifdef AL_VARIABLE_MCLK_TYPE
3205 x
= PyInt_FromLong((long) AL_VARIABLE_MCLK_TYPE
);
3206 if (x
== NULL
|| PyDict_SetItemString(d
, "VARIABLE_MCLK_TYPE", x
) < 0)
3210 #ifdef AL_VECTOR_VAL
3211 x
= PyInt_FromLong((long) AL_VECTOR_VAL
);
3212 if (x
== NULL
|| PyDict_SetItemString(d
, "VECTOR_VAL", x
) < 0)
3216 #ifdef AL_VIDEO_MCLK_TYPE
3217 x
= PyInt_FromLong((long) AL_VIDEO_MCLK_TYPE
);
3218 if (x
== NULL
|| PyDict_SetItemString(d
, "VIDEO_MCLK_TYPE", x
) < 0)
3223 x
= PyInt_FromLong((long) AL_WORDSIZE
);
3224 if (x
== NULL
|| PyDict_SetItemString(d
, "WORDSIZE", x
) < 0)
3229 #ifdef AL_NO_ELEM /* IRIX 6 */
3230 (void) alSetErrorHandler(ErrorHandler
);
3231 #endif /* AL_NO_ELEM */
3232 #ifdef OLD_INTERFACE
3233 (void) ALseterrorhandler(ErrorHandler
);
3234 #endif /* OLD_INTERFACE */