Nick Brooks
By: a guest | Oct 13th, 2009 | Syntax:
C++ | Size: 0.95 KB | Hits: 938 | Expires: Never
// !!!!!!!!!! function which changes the volume :
void VoodooHDADevice::gmixerSetDefaults(PcmDevice *pcmDevice, UInt16 newVolInt)
{
logMsg("gmixer setting defaults");
for (int n = 0; n < SOUND_MIXER_NRDEVICES; n++){
audioCtlOssMixerSet(pcmDevice, n, newVolInt, newVolInt);
logMsg("Control integer::%p\n",n);
}
//if (audioCtlOssMixerSetRecSrc(pcmDevice, SOUND_MASK_MIC) == 0)
//errorMsg("warning: couldn't set recording source to microphone\n");
}
// !!!!!!!!! volume change handler :
IOReturn VoodooHDAEngine::volumeChanged(IOAudioControl *volumeControl, SInt32 oldValue, SInt32 newValue)
{
IOLog("VoodooHDAEngine0.1[%p]::volumeChanged(%p, %ld, %ld)\n", this, volumeControl, oldValue, newValue);
int ossDev = ( getEngineDirection() == kIOAudioStreamDirectionOutput) ? SOUND_MIXER_VOLUME:
SOUND_MIXER_MIC;
PcmDevice *pcmDevice = mChannel->pcmDevice;
mDevice->gmixerSetDefaults(pcmDevice,newValue);
return kIOReturnSuccess;
}