/// <summary>
        ///     Creates a new Audio endpoint volume
        /// </summary>
        /// <param name="realEndpointVolume">IAudioEndpointVolume COM interface</param>
        internal AudioEndpointVolume(IAudioEndpointVolume realEndpointVolume)
        {
            uint hardwareSupp;

            audioEndPointVolume = realEndpointVolume;
            channels = new AudioEndpointVolumeChannels(audioEndPointVolume);
            stepInformation = new AudioEndpointVolumeStepInformation(audioEndPointVolume);
            Marshal.ThrowExceptionForHR(audioEndPointVolume.QueryHardwareSupport(out hardwareSupp));
            hardwareSupport = (EndpointHardwareSupport) hardwareSupp;
            volumeRange = new AudioEndpointVolumeVolumeRange(audioEndPointVolume);
            callBack = new AudioEndpointVolumeCallback(this);
            Marshal.ThrowExceptionForHR(audioEndPointVolume.RegisterControlChangeNotify(callBack));
        }
示例#2
0
        /// <summary>
        ///     Creates a new Audio endpoint volume
        /// </summary>
        /// <param name="realEndpointVolume">IAudioEndpointVolume COM interface</param>
        internal AudioEndpointVolume(IAudioEndpointVolume realEndpointVolume)
        {
            uint hardwareSupp;

            audioEndPointVolume = realEndpointVolume;
            channels            = new AudioEndpointVolumeChannels(audioEndPointVolume);
            stepInformation     = new AudioEndpointVolumeStepInformation(audioEndPointVolume);
            Marshal.ThrowExceptionForHR(audioEndPointVolume.QueryHardwareSupport(out hardwareSupp));
            hardwareSupport = (EndpointHardwareSupport)hardwareSupp;
            volumeRange     = new AudioEndpointVolumeVolumeRange(audioEndPointVolume);
            callBack        = new AudioEndpointVolumeCallback(this);
            Marshal.ThrowExceptionForHR(audioEndPointVolume.RegisterControlChangeNotify(callBack));
        }