Ejemplo n.º 1
0
        public void SetMute(MixerInfo mi, bool mute)
        {
            MIXERCONTROLDETAILS mcd = new MIXERCONTROLDETAILS();

            mcd.cbStruct       = (uint)Marshal.SizeOf(typeof(MIXERCONTROLDETAILS));
            mcd.dwControlID    = mi.muteCtl;
            mcd.cMultipleItems = 0;
            mcd.cChannels      = 1;
            mcd.cbDetails      = 4;
            mcd.paDetails      = Marshal.AllocHGlobal((int)mcd.cbDetails);

            Marshal.WriteInt32(mcd.paDetails, mute ? 1 : 0);

            WinMNWarpConstants.mixerSetControlDetails(IntPtr.Zero, ref mcd, MIXER.GETCONTROLDETAILSF_VALUE | MIXER.OBJECTF_MIXER);

            Marshal.FreeHGlobal(mcd.paDetails);
        }
Ejemplo n.º 2
0
        public void SetVolume(MixerInfo mi, VOLUME volume)
        {
            MIXERCONTROLDETAILS mcd = new MIXERCONTROLDETAILS();

            mcd.cbStruct       = (uint)Marshal.SizeOf(typeof(MIXERCONTROLDETAILS));
            mcd.dwControlID    = mi.volumeCtl;
            mcd.cMultipleItems = 0;
            mcd.cChannels      = 2;
            mcd.cbDetails      = (uint)Marshal.SizeOf(typeof(int));
            mcd.paDetails      = Marshal.AllocHGlobal((int)mcd.cbDetails);

            Marshal.StructureToPtr(volume, mcd.paDetails, false);

            WinMNWarpConstants.mixerSetControlDetails(IntPtr.Zero, ref mcd, MIXER.GETCONTROLDETAILSF_VALUE | MIXER.OBJECTF_MIXER);

            Marshal.FreeHGlobal(mcd.paDetails);
        }