Ejemplo n.º 1
0
            /// <summary>Return the info for a mixer line component</summary>
            public MixerLine LineInfo(EMixerLineComponentType line_component_type)
            {
                MixerLine line = MixerLine.New; line.dwComponentType = (uint)line_component_type;

                Check(mixerGetLineInfoA(Handle, ref line, (uint)EMixerGetLineInfoFlag.COMPONENTTYPE));
                return(line);
            }
Ejemplo n.º 2
0
            /// <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"));
            }