public static extern int mixerGetControlDetails( int hmxobj, ref MIXERCONTROLDETAILS pmxcd, int fdwDetails );
private int GetValue(int controlid) { IntPtr volumes=Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(int))*2); Marshal.WriteInt32(volumes,0); CSS.IM.Library.AV.MIXERCONTROLDETAILS details=new MIXERCONTROLDETAILS(); details.cbStruct=Marshal.SizeOf(details); details.cChannels=1; details.cbDetails=4; details.cMultipleItems=0; details.dwControlID=controlid; details.paDetails=(int)volumes; Mixer.mixerGetControlDetails(mixer.Handle,ref details,0); int ret=Marshal.ReadInt32(volumes); Marshal.FreeCoTaskMem(volumes); return ret; }
private void SetValue(int controlid,int value) { IntPtr volumes=Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(int))*2); Marshal.WriteInt32(volumes,value); CSS.IM.Library.AV.MIXERCONTROLDETAILS details=new MIXERCONTROLDETAILS(); details.cbStruct=Marshal.SizeOf(details); details.cChannels=1; details.cbDetails=4; details.cMultipleItems=0; details.dwControlID=controlid; details.paDetails=(int)volumes; int r=Mixer.mixerSetControlDetails(mixer.Handle,ref details,0); System.Diagnostics.Trace.WriteLine(r.ToString()); int ret=Marshal.ReadInt32(volumes); System.Diagnostics.Trace.WriteLine(ret.ToString()); Marshal.FreeCoTaskMem(volumes); }
public static extern int mixerSetControlDetails( IntPtr hmxobj, ref MIXERCONTROLDETAILS pmxcd, uint fdwDetails );