Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv5234/Modules Modified Files: ossaudiodev.c Log Message: Rename some mixer methods: * channels() -> devices() * stereochannels() -> stereodevices() * recchannels() -> recdevices() * getvol() -> get() * setvol() -> set() This is for (slightly) more consistency with the OSS ioctl names (READ_DEVMASK, READ_RECMASK, READ_STEREODEVS). Also make sure the C function names correspond more closely to the Python method names for mixer methods. Index: ossaudiodev.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/ossaudiodev.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ossaudiodev.c 30 Dec 2002 02:29:28 -0000 1.10 --- ossaudiodev.c 30 Dec 2002 02:43:36 -0000 1.11 *************** *** 680,710 **** static PyObject * ! oss_mixer_channels (oss_mixer_t *self, PyObject *args) { ! return _do_ioctl_1_internal(self->fd, args, "channels", SOUND_MIXER_READ_DEVMASK); } static PyObject * ! oss_mixer_stereo_channels (oss_mixer_t *self, PyObject *args) { ! return _do_ioctl_1_internal(self->fd, args, "stereochannels", SOUND_MIXER_READ_STEREODEVS); } static PyObject * ! oss_mixer_rec_channels (oss_mixer_t *self, PyObject *args) { ! return _do_ioctl_1_internal(self->fd, args, "recchannels", SOUND_MIXER_READ_RECMASK); } static PyObject * ! oss_mixer_getvol (oss_mixer_t *self, PyObject *args) { int channel, volume; /* Can't use _do_ioctl_1 because of encoded arg thingy. */ ! if (!PyArg_ParseTuple (args, "i:getvol", &channel)) return NULL; --- 680,710 ---- static PyObject * ! oss_mixer_devices (oss_mixer_t *self, PyObject *args) { ! return _do_ioctl_1_internal(self->fd, args, "devices", SOUND_MIXER_READ_DEVMASK); } static PyObject * ! oss_mixer_stereodevices (oss_mixer_t *self, PyObject *args) { ! return _do_ioctl_1_internal(self->fd, args, "stereodevices", SOUND_MIXER_READ_STEREODEVS); } static PyObject * ! oss_mixer_recdevices (oss_mixer_t *self, PyObject *args) { ! return _do_ioctl_1_internal(self->fd, args, "recdevices", SOUND_MIXER_READ_RECMASK); } static PyObject * ! oss_mixer_get (oss_mixer_t *self, PyObject *args) { int channel, volume; /* Can't use _do_ioctl_1 because of encoded arg thingy. */ ! if (!PyArg_ParseTuple (args, "i:get", &channel)) return NULL; *************** *** 721,730 **** static PyObject * ! oss_mixer_setvol (oss_mixer_t *self, PyObject *args) { int channel, volume, leftVol, rightVol; /* Can't use _do_ioctl_1 because of encoded arg thingy. */ ! if (!PyArg_ParseTuple (args, "i(ii):setvol", &channel, &leftVol, &rightVol)) return NULL; --- 721,730 ---- static PyObject * ! oss_mixer_set (oss_mixer_t *self, PyObject *args) { int channel, volume, leftVol, rightVol; /* Can't use _do_ioctl_1 because of encoded arg thingy. */ ! if (!PyArg_ParseTuple (args, "i(ii):set", &channel, &leftVol, &rightVol)) return NULL; *************** *** 799,807 **** /* Simple ioctl wrappers */ ! { "channels", (PyCFunction)oss_mixer_channels, METH_VARARGS }, ! { "stereochannels", (PyCFunction)oss_mixer_stereo_channels, METH_VARARGS}, ! { "recchannels", (PyCFunction)oss_mixer_rec_channels, METH_VARARGS}, ! { "getvol", (PyCFunction)oss_mixer_getvol, METH_VARARGS }, ! { "setvol", (PyCFunction)oss_mixer_setvol, METH_VARARGS }, { "getrecsrc", (PyCFunction)oss_mixer_getrecsrc, METH_VARARGS }, { "setrecsrc", (PyCFunction)oss_mixer_setrecsrc, METH_VARARGS }, --- 799,807 ---- /* Simple ioctl wrappers */ ! { "devices", (PyCFunction)oss_mixer_devices, METH_VARARGS }, ! { "stereodevices", (PyCFunction)oss_mixer_stereodevices, METH_VARARGS}, ! { "recdevices", (PyCFunction)oss_mixer_recdevices, METH_VARARGS}, ! { "get", (PyCFunction)oss_mixer_get, METH_VARARGS }, ! { "set", (PyCFunction)oss_mixer_set, METH_VARARGS }, { "getrecsrc", (PyCFunction)oss_mixer_getrecsrc, METH_VARARGS }, { "setrecsrc", (PyCFunction)oss_mixer_setrecsrc, METH_VARARGS }, *************** *** 901,905 **** _EXPORT_INT(m, AFMT_S16_NE); ! /* Expose the sound mixer channels. */ _EXPORT_INT(m, SOUND_MIXER_NRDEVICES); _EXPORT_INT(m, SOUND_MIXER_VOLUME); --- 901,905 ---- _EXPORT_INT(m, AFMT_S16_NE); ! /* Expose the sound mixer device numbers. */ _EXPORT_INT(m, SOUND_MIXER_NRDEVICES); _EXPORT_INT(m, SOUND_MIXER_VOLUME);
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4