This patch adds implementation of OSS-based sound mixer device. This
allows applications to change the sound playing volume.
NOTE: Currently, the recording volume cannot be changed.
Signed-off-by: Takashi Yano
---
winsup/cygwin/Makefile.am |1 +
winsup/cygwin/devices.cc| 1390 ---
winsup/cygwin/devices.in|1 +
winsup/cygwin/dtable.cc |3 +
winsup/cygwin/fhandler/mixer.cc | 152 +++
winsup/cygwin/local_includes/devices.h |1 +
winsup/cygwin/local_includes/fhandler.h | 29 +
winsup/cygwin/release/3.5.0 |2 +
8 files changed, 892 insertions(+), 687 deletions(-)
create mode 100644 winsup/cygwin/fhandler/mixer.cc
diff --git a/winsup/cygwin/Makefile.am b/winsup/cygwin/Makefile.am
index bfb5ead10..9912b5399 100644
--- a/winsup/cygwin/Makefile.am
+++ b/winsup/cygwin/Makefile.am
@@ -89,6 +89,7 @@ FHANDLER_FILES= \
fhandler/dsp.cc \
fhandler/fifo.cc \
fhandler/floppy.cc \
+ fhandler/mixer.cc \
fhandler/mqueue.cc \
fhandler/netdrive.cc \
fhandler/nodevice.cc \
diff --git a/winsup/cygwin/devices.cc b/winsup/cygwin/devices.cc
index 72c83d6e6..acdc54412 100644
--- a/winsup/cygwin/devices.cc
+++ b/winsup/cygwin/devices.cc
@@ -341,6 +341,7 @@ const _RDATA _device dev_storage[] =
{"/dev/fd14", BRACK(FHDEV(DEV_FLOPPY_MAJOR, 14)), "\\Device\\Floppy14",
exists_ntdev, S_IFBLK, true},
{"/dev/fd15", BRACK(FHDEV(DEV_FLOPPY_MAJOR, 15)), "\\Device\\Floppy15",
exists_ntdev, S_IFBLK, true},
{"/dev/full", BRACK(FH_FULL), "\\Device\\Null", exists_ntdev, S_IFCHR, true},
+ {"/dev/mixer", BRACK(FH_OSS_MIXER), "\\Device\\Null", exists_ntdev, S_IFCHR,
true},
{"/dev/nst0", BRACK(FHDEV(DEV_TAPE_MAJOR, 128)), "\\Device\\Tape0",
exists_ntdev, S_IFCHR, true},
{"/dev/nst1", BRACK(FHDEV(DEV_TAPE_MAJOR, 129)), "\\Device\\Tape1",
exists_ntdev, S_IFCHR, true},
{"/dev/nst2", BRACK(FHDEV(DEV_TAPE_MAJOR, 130)), "\\Device\\Tape2",
exists_ntdev, S_IFCHR, true},
@@ -1029,9 +1030,9 @@ const _RDATA _device dev_storage[] =
const _device *cons_dev = dev_storage + 20;
const _device *console_dev = dev_storage + 148;
-const _device *ptym_dev = dev_storage + 724;
-const _device *ptys_dev = dev_storage + 298;
-const _device *urandom_dev = dev_storage + 719;
+const _device *ptym_dev = dev_storage + 725;
+const _device *ptys_dev = dev_storage + 299;
+const _device *urandom_dev = dev_storage + 720;
static KR_device_t KR_find_keyword (const char *KR_keyword, int KR_length)
@@ -1061,7 +1062,7 @@ returnNULL;
if (strncmp (KR_keyword, ":pipe", 5) == 0)
{
{
-return dev_storage + 723;
+return dev_storage + 724;
}
}
@@ -1076,7 +1077,7 @@ returnNULL;
if (strncmp (KR_keyword, ":fifo", 5) == 0)
{
{
-return dev_storage + 722;
+return dev_storage + 723;
}
}
@@ -1100,7 +1101,7 @@ returnNULL;
if (strncmp (KR_keyword, ":ptym9", 6) == 0)
{
{
-return dev_storage + 733;
+return dev_storage + 734;
}
}
@@ -1115,7 +1116,7 @@ returnNULL;
if (strncmp (KR_keyword, ":ptym8", 6) == 0)
{
{
-return dev_storage + 732;
+return dev_storage + 733;
}
}
@@ -1130,7 +1131,7 @@ returnNULL;
if (strncmp (KR_keyword, ":ptym7", 6) == 0)
{
{
-return dev_storage + 731;
+return dev_storage + 732;
}
}
@@ -1145,7 +1146,7 @@ returnNULL;
if (strncmp (KR_keyword, ":ptym6", 6) == 0)
{
{
-return dev_storage + 730;
+return dev_storage + 731;
}
}
@@ -1160,7 +1161,7 @@ returnNULL;
if (strncmp (KR_keyword, ":ptym5", 6) == 0)
{
{
-return dev_storage + 729;
+return dev_storage + 730;
}
}
@@ -1175,7 +1176,7 @@ returnNULL;
if (strncmp (KR_keyword, ":ptym4", 6) == 0)
{
{
-return dev_storage + 728;
+return dev_storage + 729;
}
}
@@ -1190,7 +1191,7 @@ returnNULL;
if (strncmp (KR_keyword, ":ptym3", 6) == 0)
{
{
-return dev_storage + 727;
+return dev_storage + 728;
}
}
@@ -1205,7 +1206,7 @@ returnNULL;
if (strncmp (KR_keyword, ":ptym2", 6) == 0)
{
{
-return dev_storage + 726;
+return dev_storage + 727;
}
}
@@ -1220,7 +1221,7 @@ returnNULL;
if (strncmp (KR_keyword, ":ptym1", 6) == 0)
{
{
-return dev_storage + 725;
+return dev_storage + 726;
}
}
@@ -1235,7 +1236,7 @@ returnNULL;
if (strncmp (KR_keyword, ":ptym0", 6) == 0)
{
{
-return dev_storage + 724;
+return dev_storage + 725;
}
}
@@ -1277,7 +1278,7 @@ returnNULL;
if (strncmp (KR_keyword, ":ptym99", 7) == 0)
{
{
-return dev_storage + 823;
+return dev_storage + 824;
}
}
@@ -1292,7