Advertisement
Guest User

Nick Brooks

a guest
Oct 13th, 2009
1,266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.95 KB | None | 0 0
  1.  
  2. // !!!!!!!!!! function which changes the volume :
  3.  
  4. void VoodooHDADevice::gmixerSetDefaults(PcmDevice *pcmDevice, UInt16 newVolInt)
  5. {
  6.  
  7. logMsg("gmixer setting defaults");
  8. for (int n = 0; n < SOUND_MIXER_NRDEVICES; n++){
  9. audioCtlOssMixerSet(pcmDevice, n, newVolInt, newVolInt);
  10. logMsg("Control integer::%p\n",n);
  11. }
  12. //if (audioCtlOssMixerSetRecSrc(pcmDevice, SOUND_MASK_MIC) == 0)
  13. //errorMsg("warning: couldn't set recording source to microphone\n");
  14. }
  15.  
  16. //  !!!!!!!!!  volume change handler :
  17.  
  18. IOReturn VoodooHDAEngine::volumeChanged(IOAudioControl *volumeControl, SInt32 oldValue, SInt32 newValue)
  19. {
  20.  
  21. IOLog("VoodooHDAEngine0.1[%p]::volumeChanged(%p, %ld, %ld)\n", this, volumeControl, oldValue, newValue);
  22.  
  23. int ossDev = ( getEngineDirection() == kIOAudioStreamDirectionOutput) ? SOUND_MIXER_VOLUME:
  24. SOUND_MIXER_MIC;
  25.  
  26. PcmDevice *pcmDevice = mChannel->pcmDevice;
  27.  
  28.  
  29. mDevice->gmixerSetDefaults(pcmDevice,newValue);
  30.  
  31. return kIOReturnSuccess;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement