/// <summary>Retrieve mixer data</summary> public MixerControl LineControl(EMixerLineComponentType line_component_type, EMixerCtrlType ctrl_type) { uint mixer_data_size = (uint)Marshal.SizeOf(typeof(MixerControl)); MixerLine line = LineInfo(line_component_type); MixerLineControls line_ctrls = MixerLineControls.New; line_ctrls.pamxctrl = Marshal.AllocCoTaskMem((int)mixer_data_size); line_ctrls.dwLineID = line.dwLineID; line_ctrls.dwControlType = (uint)ctrl_type; line_ctrls.cControls = 1; line_ctrls.cbmxctrl = mixer_data_size; Check(mixerGetLineControlsA(Handle, ref line_ctrls, (uint)EMixerGetLineControlsFlag.ONEBYTYPE)); return((MixerControl?)Marshal.PtrToStructure(line_ctrls.pamxctrl, typeof(MixerControl)) ?? throw new NullReferenceException($"Null returned for WinMM MixerControl")); }
public static extern MixerError mixerGetLineControlsA(IntPtr handle, MixerLineControls mixerLineControls, MixerLineControlFlags flags);
/// <summary>The mixerGetLineControls function retrieves one or more controls associated with an audio line</summary> /// <param name="hmxobj">Handle to the mixer device object that is being queried</param> /// <param name="pmxlc">Pointer to a MIXERLINECONTROLS structure. This structure is used to reference one or more MIXERCONTROL structures to be filled with information about the controls associated with an audio line. The cbStruct member of the MIXERLINECONTROLS structure must always be initialized to be the size, in bytes, of the MIXERLINECONTROLS structure</param> /// <param name="fdwControls">Flags for retrieving information about one or more controls associated with an audio line</param> [DllImport("winmm.dll", CharSet = CharSet.Ansi)] public static extern int mixerGetLineControlsA(IntPtr hmxobj, ref MixerLineControls pmxlc, uint fdwControls);