private void tbMicVolume_ValueChanged(object sender, EventArgs e) { var volume = tbMicVolume.Value; if (0 == volume) { if (ErrorNumberEnum.PLCM_SAMPLE_OK == WrapperProxy.MuteMic(_call.CallHandle, true)) { this.btnMic.Image = Properties.Resources.mic_mute; } } else { if (ErrorNumberEnum.PLCM_SAMPLE_OK == WrapperProxy.MuteMic(_call.CallHandle, false)) { this.btnMic.Image = Properties.Resources.mic; } } if (ErrorNumberEnum.PLCM_SAMPLE_OK != WrapperProxy.SetMicVolume(volume)) { Action okAction = () => { volume = WrapperProxy.GetMicVolume(); this.tbMicVolume.Value = volume; }; UXMessageMask.ShowMessage(this, false, "设置麦克风音量失败!", MessageBoxButtonsType.OK, MessageBoxIcon.Error , okAction); } }
private void CallWindow_Load(object sender, EventArgs e) { #region Device Init if (null != deviceManager.CurrentAudioInputDevice) { this.btnMic.Enabled = true; this.btnMic.Image = Properties.Resources.mic; var volume = WrapperProxy.GetMicVolume(); this.tbMicVolume.Value = volume; this.tbMicVolume.LostFocus += (obj, args) => { this.tbMicVolume.Hide(); }; } else { this.btnMic.Enabled = false; this.btnMic.Image = Properties.Resources.mic_mute; this.tbMicVolume.Value = 0; } if (null != deviceManager.CurrentAudioOutputDevice) { this.btnSpeaker.Enabled = true; this.btnSpeaker.Image = Properties.Resources.speaker; var volume = WrapperProxy.GetSpeakerVolume(); this.tbSpeakerVolume.Value = volume; this.tbSpeakerVolume.LostFocus += (obj, args) => { this.tbSpeakerVolume.Hide(); }; } else { this.btnSpeaker.Enabled = false; this.btnSpeaker.Image = Properties.Resources.speaker_mute; this.tbSpeakerVolume.Value = 0; } if (null != deviceManager.CurrentVideoInputDevice) { this.btnCamera.Enabled = true; switch (_call.CallMode) { case CallModeEnum.PLCM_MFW_AUDIOVIDEO_CALL: { this.btnCamera.Image = Properties.Resources.camera; if (_call.IsContentSupported) { this.btnShare.Enabled = true; this.btnShare.Image = Properties.Resources.share; } else { this.btnShare.Enabled = false; this.btnShare.Image = Properties.Resources.share_mute; } } break; case CallModeEnum.PLCM_MFW_AUDIO_CALL: { this.btnCamera.Image = Properties.Resources.camera_mute; this.btnShare.Enabled = false; this.btnShare.Image = Properties.Resources.share_mute; } break; } } else { this.btnCamera.Enabled = false; this.btnCamera.Image = Properties.Resources.camera_mute; this.btnShare.Enabled = false; this.btnShare.Image = Properties.Resources.share_mute; } #endregion var localChannel = new Channel(this._call, 0, ChannelType.Local, false) { ChannelName = "本地视频", IsAudio = false, IsVideo = false }; this._call.AddChannel(localChannel); _muteCamera = true; btnCamera.Image = Properties.Resources.camera_mute; WrapperProxy.GetApplicationInfo(); }