//----------------------------设定音量--------------------------------------- bool GetVolumeControl(HMIXER hmixer ,long componentType,long ctrlType,MIXERCONTROL* mxc) { MIXERLINECONTROLS mxlc; MIXERLINE mxl; mxl.cbStruct = sizeof(mxl); mxl.dwComponentType = componentType; if(!mixerGetLineInfo((HMIXEROBJ)hmixer, &mxl, MIXER_GETLINEINFOF_COMPONENTTYPE)) { mxlc.cbStruct = sizeof(mxlc); mxlc.dwLineID = mxl.dwLineID; mxlc.dwControlType = ctrlType; mxlc.cControls = 1; mxlc.cbmxctrl = sizeof(MIXERCONTROL); mxlc.pamxctrl = mxc; if(mixerGetLineControls((HMIXEROBJ)hmixer,&mxlc,MIXER_GETLINECONTROLSF_ONEBYTYPE)) return 0; else return 1; } return 0; } //--------------------------------------------------------------------------- long GetMuteValue(HMIXER hmixer ,MIXERCONTROL *mxc) { MIXERCONTROLDETAILS mxcd; MIXERCONTROLDETAILS_BOOLEAN mxcdMute; mxcd.hwndOwner = 0; mxcd.cbStruct = sizeof(mxcd); mxcd.dwControlID = mxc->dwControlID; mxcd.cbDetails = sizeof(mxcdMute); mxcd.paDetails = &mxcdMute; mxcd.cChannels = 1; mxcd.cMultipleItems = 0; if (mixerGetControlDetails((HMIXEROBJ)hmixer, &mxcd,MIXER_OBJECTF_HMIXER|MIXER_GETCONTROLDETAILSF_VALUE)) return -1; return mxcdMute.fValue; } //--------------------------------------