Ignore:
Timestamp:
Jul 17, 2000, 8:37:33 PM (25 years ago)
Author:
sandervl
Message:

misc updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sbliveos2/trunk/lib32/sound.c

    r151 r152  
    451451//******************************************************************************
    452452//******************************************************************************
     453ULONG OSS32_StreamGetSpace(ULONG streamtype, ULONG streamid)
     454{
     455 struct inode   ossinode;
     456 struct file    ossfile;
     457 struct dentry  ossdentry;
     458 ULONG          ossid = streamtype & OSS_IDMASK;
     459 audio_buf_info info;
     460 char NEAR     *tmpbuf;
     461 ULONG          cmd;
     462 int            transferred;
     463
     464  ossinode.i_rdev = ossid;
     465  ossfile.private_data = (void *)streamid;
     466  ossfile.f_flags = 0;
     467  ossfile.f_dentry = &ossdentry;
     468  ossdentry.d_inode = &ossinode;
     469
     470  switch(streamtype) {
     471  case OSS_STREAM_WAVEOUT:
     472        ossfile.f_mode = FMODE_WRITE;
     473        cmd = SNDCTL_DSP_GETOSPACE;
     474        break;
     475  case OSS_STREAM_WAVEIN:
     476        ossfile.f_mode = FMODE_READ;
     477        cmd = SNDCTL_DSP_GETISPACE;
     478        break;
     479  case OSS_STREAM_MIDIOUT:
     480        ossfile.f_mode = FMODE_WRITE;
     481        break;
     482  case OSS_STREAM_MIDIIN:
     483        ossfile.f_mode = FMODE_READ;
     484        break;
     485  }
     486
     487  if(!oss_devices[ossid].write || !oss_devices[ossid].read || !oss_devices[ossid].ioctl) {
     488        return 0;
     489  }
     490  //check how much room is left in the circular dma buffer
     491#ifdef KEE
     492  tmpbuf = (char NEAR *)&info;
     493#else
     494  tmpbuf = (char NEAR *)__StackToFlat((ULONG)&info);
     495#endif
     496  if(oss_devices[ossid].ioctl(&ossinode, &ossfile, cmd, (ULONG)tmpbuf)) {
     497        return 0;
     498  }
     499  return info.bytes;
     500}
     501//******************************************************************************
     502//******************************************************************************
    453503ULONG OSS32_SetVolume(ULONG streamtype, ULONG streamid, ULONG cmd, ULONG volume)
    454504{
Note: See TracChangeset for help on using the changeset viewer.