From b0a50cf34c1646ca943983d7a34c57360ce062c1 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 16 Apr 2001 03:27:16 +0000 Subject: * autoload.cc: Add winmm functions needed by fhandler_dsp.cc. * fhandler_dsp.cc: New file. Implements OSS like /dev/dsp. * include/sys/soundcard.h: New file. User land includes for OSS /dev/dsp. * fhandler.h: Add new class fhandler_dev_dsp and a FH_OSS_DSP definition. * dtable.cc (dtable::build_fhandler): Allow creation of the /dev/dsp device. * path.cc (windows_device_names): Add /dev/dsp into list of device names. * Makefile.in (DLL_OFILES): Add fhandler_dsp.o. --- winsup/cygwin/fhandler.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/fhandler.h') diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 32ccacc75..f99b0938e 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -88,7 +88,7 @@ enum FH_PIPEW = 0x0000000a, /* write end of a pipe */ FH_SOCKET = 0x0000000b, /* is a socket */ FH_WINDOWS = 0x0000000c, /* is a window */ - + FH_OSS_DSP = 0x0000000d, /* is the dsp audio device */ FH_SLOW = 0x00000010, /* "slow" device if below this */ /* Fast devices */ @@ -941,6 +941,29 @@ public: int ready_for_read (int fd, DWORD howlong, int ignra); }; +class fhandler_dev_dsp : public fhandler_base +{ +private: + int audioformat_; + int audiofreq_; + int audiobits_; + int audiochannels_; + bool setupwav(const char *pData, int nBytes); + +public: + fhandler_dev_dsp (const char *name = 0); + ~fhandler_dev_dsp(); + + int open (const char *path, int flags, mode_t mode = 0); + int write (const void *ptr, size_t len); + int read (void *ptr, size_t len); + int ioctl (unsigned int cmd, void *); + off_t lseek (off_t, int); + int close (void); + int dup (fhandler_base * child); + void dump (void); +}; + #if 0 /* You can't do this */ typedef union -- cgit v1.2.3