Commit Graph

11 Commits

Author SHA1 Message Date
Greg Ward 37897c2672 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.
2002-12-30 02:43:36 +00:00
Greg Ward 7b43c68162 Remove 'x_' prefix from oss_t and oss_mixer_t struct members.
(It added nothing, and served no obvious purpose.)

Export SOUND_MIXER_NRDEVICES constant.
2002-12-30 02:29:28 +00:00
Greg Ward b69bb3d019 Typo fix. 2002-12-12 17:35:45 +00:00
Greg Ward 3d9994d3b0 Add OSS mixer interface (from Nicholas FitzRoy-Dale <wzdd@lardcave.net>):
* add oss_mixer_t and OSSMixerType
  * add newossmixerobject(), oss_mixer_dealloc(), ossopenmixer()
  * add _do_ioctl_1_internal() to support mixer ioctls
  * add mixer methods: oss_mixer_{close,fileno,channels,stereo_channels,
    rec_channels,getvol,setvol,getrecsrc,setrecsrc}()
  * add oss_mixer_methods list
  * add oss_mixer_getattr() (why?!)
  * export SOUND_MIXER_* constants from soundcard.h
2002-12-11 15:12:01 +00:00
Greg Ward da9f853b49 Prepare for the coming mixer support patch: change _do_ioctl_0() and
_do_ioctl_1() so they take a file descriptor rather than an oss_t
pointer.
2002-12-11 14:49:59 +00:00
Greg Ward 8c6b6a9f1e Finish expunging the 'linuxaudiodev' name:
* rename oss_t to lad_t, Ladtype to OSSType,
  * rename lad_*() methods to oss_*()
  * rename lad_methods list to oss_methods
Patch and impetus supplied by Nicholas FitzRoy-Dale <wzdd@lardcave.net>.
2002-12-11 14:43:13 +00:00
Greg Ward 9a568eb245 Expunge any remaining mentions of linuxaudiodev -- it's ossaudiodev now! 2002-11-30 23:20:09 +00:00
Greg Ward 97708bc6f8 Rename LinuxAudioError to OSSAudioError ('ossaudiodev.error').
Use OSSAudioError much less frequently -- all real I/O errors (ie. any
time open(), read(), write(), ioctl(), or select() return an error)
become IOError.  OSSAudioError is only used now for bad open() mode.
2002-11-30 23:17:10 +00:00
Greg Ward 1e0f57d0bb Added mode 'rw' for full-duplex (play and record at the same time) mode.
Added _EXPORT_INT macro to export an integer constant to Python-space.
Use it for all the AFMT_* constants, and update the list of AFMT_*
constants to match what's in Linux 2.4: add AFMT_{QUERY,IMA_ADPCM,
MPEG,AC3}.  This should probably be tested with older versions of OSS,
eg. with Linux 2.2 and 2.0.

Export all SNDCTL_* ioctl numbers (where "all" is the set found in
/usr/include/linux/soundcard.h on my Debian 3.0 system -- again
Linux 2.4).  Again needs to be tested with older OSS versions.
2002-11-30 23:05:26 +00:00
Greg Ward 131bce035a * Don't put the device in non-blocking mode at open() time; this makes
it impossible to access blocking mode!

* Rename write() to writeall(), and add a write() method that just
  does one write().

* Rearrange/simplify writeall(): in particular, don't supply a timeout
  to select().  Let it block forever if it has to.

* Add a bunch of simple ioctl() wrappers: nonblock(), setfmt(),
  getfmts(), channels(), speed(), sync(), reset(), post().  These
  wrap, respectively, SNDCTL_DSP_NONBLOCK, SNDCTL_DSP_SETFMT,
  SNDCTL_DSP_GETFMTS, etc.

* Reduce flush() (which was a wrapper for the SNDCTL_DSP_SYNC ioctl) to
  an alias for sync().

* Rearrange the lad_methods list to reflect the order in which the
  methods are defined, and add some grouping comments.
2002-11-30 22:56:44 +00:00
Greg Ward 04613a9308 ossaudiodev -- Python interface to the OSS (Open Sound System) API.
This module is a replacement for linuxaudiodev, which will eventually
be deprecated.

Initial revision is rev 2.20 of linuxaudiodev.c, with a rewritten
header comment.
2002-11-30 22:47:45 +00:00