예제 #1
0
        public static int GetAudioVolume(this LibMWCapture.MWCAP_AUDIO_VOLUME audioStatus)
        {
            var volume      = audioStatus.asVolume.LastOrDefault();
            var volumeIndex = Array.IndexOf(AudioVolumes, volume);

            volumeIndex = Math.Min(Math.Max(volumeIndex, 0), AudioVolumes.Length - 1);
            return((int)(volumeIndex * 100.0 / AudioVolumes.Length));
        }
예제 #2
0
 public static void SetMute(this LibMWCapture.MWCAP_AUDIO_VOLUME audioStatus, IntPtr videoChannel, bool mute)
 {
     for (int i = 0; i < audioStatus.abMute.Length; i++)
     {
         audioStatus.abMute[i] = mute;
     }
     PInvokeTools.WriteStruct(audioStatus, ptr =>
                              LibMWCapture.MWSetAudioVolume(videoChannel, LibMWCapture.MWCAP_AUDIO_NODE.MWCAP_AUDIO_EMBEDDED_CAPTURE, ptr));
 }
예제 #3
0
        public static void SetAudioVolume(this LibMWCapture.MWCAP_AUDIO_VOLUME audioStatus, IntPtr videoChannel, int percent)
        {
            var volumeIndex = (int)(AudioVolumes.Length / 100.0 * percent);

            volumeIndex = Math.Min(Math.Max(volumeIndex, 0), AudioVolumes.Length - 1);
            var volume = AudioVolumes[volumeIndex];

            for (int i = 0; i < audioStatus.asVolume.Length; i++)
            {
                audioStatus.asVolume[i] = volume;
            }
            PInvokeTools.WriteStruct(audioStatus, ptr =>
                                     LibMWCapture.MWSetAudioVolume(videoChannel, LibMWCapture.MWCAP_AUDIO_NODE.MWCAP_AUDIO_EMBEDDED_CAPTURE, ptr));
        }
예제 #4
0
        public static bool GetMute(this LibMWCapture.MWCAP_AUDIO_VOLUME audioStatus)
        {
            var mute = audioStatus.abMute.LastOrDefault();

            return(mute);
        }