OSDN Git Service

* fhandler_dsp.cc (fhandler_dev_dsp::ioctl): Add implementation
authorcorinna <corinna>
Mon, 5 Apr 2004 08:30:38 +0000 (08:30 +0000)
committercorinna <corinna>
Mon, 5 Apr 2004 08:30:38 +0000 (08:30 +0000)
for ioctl codes SNDCTL_DSP_CHANNELS and SNDCTL_DSP_GETCAPS.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler_dsp.cc

index 5f12dc8..2aaad0f 100644 (file)
@@ -1,6 +1,12 @@
+2004-04-04  Gerd Spalink  <Gerd.Spalink@t-online.de>
+
+       * fhandler_dsp.cc (fhandler_dev_dsp::ioctl): Add implementation
+       for ioctl codes SNDCTL_DSP_CHANNELS and SNDCTL_DSP_GETCAPS.
+
 2004-04-03  Christopher Faylor  <cgf@redhat.com>
 
-       * child_info.h (child_info::cygheap_reserve_sz): Rename from cygheap_alloc_sz.
+       * child_info.h (child_info::cygheap_reserve_sz): Rename from
+       cygheap_alloc_sz.
        * cygheap.cc: Rename alloc_sz to reserve_sz throughout.
 
 2004-04-03  Corinna Vinschen  <corinna@vinschen.de>
index b614ede..d9ce7d7 100644 (file)
@@ -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)
       {