private MIXERLINE GetLine() { MIXERLINE ml = new MIXERLINE(); if (this.component_type == MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE) { MIXERLINE inLine = new MIXERLINE(); inLine.cbStruct = Marshal.SizeOf(inLine); inLine.dwComponentType = Mixer.MIXERLINE_COMPONENTTYPE_DST_WAVEIN; Mixer.mixerGetLineInfo((int)mixer.Handle, ref inLine, Mixer.MIXER_GETLINEINFOF_COMPONENTTYPE); for (int i = 0; i < inLine.cConnections; i++) { ml = new MIXERLINE(); ml.cbStruct = Marshal.SizeOf(ml); ml.dwSource = (uint)i; ml.dwDestination = inLine.dwDestination; Mixer.mixerGetLineInfo((int)mixer.Handle, ref ml, Mixer.MIXER_GETLINEINFOF_SOURCE); if (ml.dwComponentType == this.component_type) { break; } } } else { ml = new MIXERLINE(); ml.cbStruct = Marshal.SizeOf(ml); ml.dwComponentType = this.component_type; Mixer.mixerGetLineInfo((int)mixer.Handle, ref ml, Mixer.MIXER_OBJECTF_HMIXER | Mixer.MIXER_GETLINEINFOF_COMPONENTTYPE); } return(ml); }
private void Initialize() { MIXERLINE ml = this.GetLine(); this.lineid = ml.dwLineID; this.name = ml.szName; MIXERCONTROL ctl = this.GetLineControl(Mixer.MIXERCONTROL_CONTROLTYPE_VOLUME); this.min = ctl.Bounds.dwMinimum; this.max = ctl.Bounds.dwMaximum; this.volume_controlid = ctl.dwControlID; ctl = this.GetLineControl(Mixer.MIXERCONTROL_CONTROLTYPE_MUTE); this.mute_controlid = ctl.dwControlID; this.volume = this.GetValue(this.volume_controlid); this.mute = this.GetValue(this.mute_controlid) == 0; }
public static extern int mixerGetLineInfo( int hmxobj, ref MIXERLINE pmxl, uint fdwInfo );
public static extern int mixerGetLineInfo ( int hmxobj, ref MIXERLINE pmxl, uint fdwInfo );
private MIXERLINE GetLine() { MIXERLINE ml=new MIXERLINE(); if(this.component_type==MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE) { MIXERLINE inLine=new MIXERLINE(); inLine.cbStruct=Marshal.SizeOf(inLine); inLine.dwComponentType=Mixer.MIXERLINE_COMPONENTTYPE_DST_WAVEIN; Mixer.mixerGetLineInfo((int)mixer.Handle,ref inLine,Mixer.MIXER_GETLINEINFOF_COMPONENTTYPE); for(int i=0;i<inLine.cConnections;i++) { ml=new MIXERLINE(); ml.cbStruct=Marshal.SizeOf(ml); ml.dwSource=(uint)i; ml.dwDestination=inLine.dwDestination; Mixer.mixerGetLineInfo((int)mixer.Handle,ref ml,Mixer.MIXER_GETLINEINFOF_SOURCE); if(ml.dwComponentType==this.component_type)break; } } else { ml=new MIXERLINE(); ml.cbStruct=Marshal.SizeOf(ml); ml.dwComponentType=this.component_type; Mixer.mixerGetLineInfo((int)mixer.Handle,ref ml, Mixer.MIXER_OBJECTF_HMIXER|Mixer.MIXER_GETLINEINFOF_COMPONENTTYPE); } return ml; }