Changeset 3177:7576b55416ad in roaraudio


Ignore:
Timestamp:
01/15/10 21:25:08 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added OSSv4 SNDCTL_DSP_GETPLAYVOL/SNDCTL_DSP_SETPLAYVOL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroaross/libroaross.c

    r3176 r3177  
    568568 switch (req) { 
    569569  case SOUND_MIXER_READ_VOLUME:    o_w = 0; o_sid = _mix_settings.sid.volume;   break; 
    570   case SOUND_MIXER_READ_PCM:       o_w = 0; o_sid = _mix_settings.sid.pcm;      break; 
    571570  case SOUND_MIXER_READ_LINE:      o_w = 0; o_sid = _mix_settings.sid.line;     break; 
    572571  case SOUND_MIXER_READ_LINE1:     o_w = 0; o_sid = _mix_settings.sid.line1;    break; 
     
    579578#endif 
    580579  case SOUND_MIXER_WRITE_VOLUME:   o_w = 1; o_sid = _mix_settings.sid.volume;   break; 
    581   case SOUND_MIXER_WRITE_PCM:      o_w = 1; o_sid = _mix_settings.sid.pcm;      break; 
    582580  case SOUND_MIXER_WRITE_LINE:     o_w = 1; o_sid = _mix_settings.sid.line;     break; 
    583581  case SOUND_MIXER_WRITE_LINE1:    o_w = 1; o_sid = _mix_settings.sid.line1;    break; 
     
    589587  case SOUND_MIXER_WRITE_DIGITAL3: o_w = 1; o_sid = _mix_settings.sid.digital3; break; 
    590588#endif 
     589  // we handle PCM seperatly as we want to be abled to abled to handle it on a stream (not mixer), too: 
     590  case SOUND_MIXER_READ_PCM: 
     591    o_w = 0; 
     592    if ( handle->type == HT_STREAM ) { 
     593     o_sid = roar_stream_get_id(&(handle->stream)); 
     594    } else { 
     595     o_sid = _mix_settings.sid.pcm; 
     596    } 
     597   break; 
     598  case SOUND_MIXER_WRITE_PCM: 
     599    o_w = 1; 
     600    if ( handle->type == HT_STREAM ) { 
     601     o_sid = roar_stream_get_id(&(handle->stream)); 
     602    } else { 
     603     o_sid = _mix_settings.sid.pcm; 
     604    } 
     605   break; 
    591606 } 
    592607 if ( o_sid != -1 ) { 
     
    830845        return 0; 
    831846       break; 
     847#ifdef SNDCTL_DSP_GETPLAYVOL 
     848      case SNDCTL_DSP_GETPLAYVOL: 
     849        return _ioctl_mixer(handle, SOUND_MIXER_READ_PCM, argp); 
     850       break; 
     851#endif 
     852#ifdef SNDCTL_DSP_SETPLAYVOL 
     853      case SNDCTL_DSP_SETPLAYVOL: 
     854        return _ioctl_mixer(handle, SOUND_MIXER_WRITE_PCM, argp); 
     855       break; 
     856#endif 
    832857      default: 
    833858        ROAR_DBG("ioctl(__fd=%i, __request=%lu) = -1 // errno = ENOSYS", __fd, (long unsigned int) __request); 
Note: See TracChangeset for help on using the changeset viewer.