diff -uNr pyalsaaudio.orig/alsaaudio.c pyalsaaudio.patch/alsaaudio.c --- pyalsaaudio.orig/alsaaudio.c 2009-09-16 14:43:18.000000000 +0200 +++ pyalsaaudio.patch/alsaaudio.c 2010-05-31 17:45:00.000000000 +0200 @@ -1411,6 +1411,34 @@ static PyObject * +alsamixer_setenum(alsamixer_t *self, PyObject * args) +{ + snd_mixer_elem_t *elem; + unsigned int value; + + if (!PyArg_ParseTuple(args,"i:setenum",&value)) + return NULL; + + + if (!self->handle) + { + PyErr_SetString(ALSAAudioError, "Mixer is closed"); + return NULL; + } + + elem = alsamixer_find_elem(self->handle,self->controlname,self->controlid); + snd_mixer_selem_set_enum_item(elem,0,value); + + return Py_None; + +} + +PyDoc_STRVAR(setenum_doc, +"Just sets current enumeraion value\n"); + + + +static PyObject * alsamixer_getenum(alsamixer_t *self, PyObject *args) { snd_mixer_elem_t *elem; @@ -1849,6 +1877,7 @@ getvolume_doc}, {"getrange", (PyCFunction)alsamixer_getrange, METH_VARARGS, getrange_doc}, {"getenum", (PyCFunction)alsamixer_getenum, METH_VARARGS, getenum_doc}, + {"setenum", (PyCFunction)alsamixer_setenum, METH_VARARGS, setenum_doc}, {"getmute", (PyCFunction)alsamixer_getmute, METH_VARARGS, getmute_doc}, {"getrec", (PyCFunction)alsamixer_getrec, METH_VARARGS, getrec_doc}, {"setvolume", (PyCFunction)alsamixer_setvolume, METH_VARARGS,