Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2004-04-05 12:30:41 +0400
committerCorinna Vinschen <corinna@vinschen.de>2004-04-05 12:30:41 +0400
commit7e57d6d268a8a861603c82601231d12c61fa241e (patch)
tree97bf858a541c3f72b3baefd9d3563344e1d9700f /winsup/cygwin/fhandler_dsp.cc
parent63481100b18b8f79e83b063e0aa04eb983525137 (diff)
* fhandler_dsp.cc (fhandler_dev_dsp::ioctl): Add implementation
for ioctl codes SNDCTL_DSP_CHANNELS and SNDCTL_DSP_GETCAPS.
Diffstat (limited to 'winsup/cygwin/fhandler_dsp.cc')
-rw-r--r--winsup/cygwin/fhandler_dsp.cc39
1 files changed, 39 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler_dsp.cc b/winsup/cygwin/fhandler_dsp.cc
index b614ede73..d9ce7d7b4 100644
--- a/winsup/cygwin/fhandler_dsp.cc
+++ b/winsup/cygwin/fhandler_dsp.cc
@@ -1370,6 +1370,38 @@ fhandler_dev_dsp::ioctl (unsigned int cmd, void *ptr)
}
break;
+ CASE (SNDCTL_DSP_CHANNELS)
+ {
+ int nChannels = *intptr;
+
+ if (audio_out_)
+ {
+ RETURN_ERROR_WHEN_BUSY (audio_out_);
+ audio_out_->stop ();
+ if (audio_out_->query (audiofreq_, audiobits_, nChannels))
+ audiochannels_ = nChannels;
+ else
+ {
+ *intptr = audiochannels_;
+ return -1;
+ }
+ }
+ if (audio_in_)
+ {
+ RETURN_ERROR_WHEN_BUSY (audio_in_);
+ audio_in_->stop ();
+ if (audio_in_->query (audiofreq_, audiobits_, nChannels))
+ audiochannels_ = nChannels;
+ else
+ {
+ *intptr = audiochannels_;
+ return -1;
+ }
+ }
+ return 0;
+ }
+ break;
+
CASE (SNDCTL_DSP_GETOSPACE)
{
audio_buf_info *p = (audio_buf_info *) ptr;
@@ -1399,6 +1431,13 @@ fhandler_dev_dsp::ioctl (unsigned int cmd, void *ptr)
}
break;
+ CASE (SNDCTL_DSP_GETCAPS)
+ {
+ *intptr = DSP_CAP_BATCH | DSP_CAP_DUPLEX;
+ return 0;
+ }
+ break;
+
CASE (SNDCTL_DSP_POST)
CASE (SNDCTL_DSP_SYNC)
{