Exemplo n.º 1
0
        private void tbSpeakerVolume_ValueChanged(object sender, EventArgs e)
        {
            var volume = tbSpeakerVolume.Value;

            if (0 == volume)
            {
                if (ErrorNumberEnum.PLCM_SAMPLE_OK == WrapperProxy.MuteSpeaker(true))
                {
                    this.btnSpeaker.Image = Properties.Resources.speaker_mute;
                }
            }
            else
            {
                if (ErrorNumberEnum.PLCM_SAMPLE_OK == WrapperProxy.MuteSpeaker(false))
                {
                    this.btnSpeaker.Image = Properties.Resources.speaker;
                }
            }
            if (ErrorNumberEnum.PLCM_SAMPLE_OK != WrapperProxy.SetSpeakerVolume(volume))
            {
                if (MessageBox.Show(this, "设置麦克风音量失败!", "消息框", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
                {
                    volume = WrapperProxy.GetSpeakerVolume();
                    this.tbSpeakerVolume.Value = volume;
                }
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 private void btnCamera_Click(object sender, EventArgs e)
 {
     if (true == MuteCamera)
     {
         if (ErrorNumberEnum.PLCM_SAMPLE_OK == WrapperProxy.StartCamera())
         {
             MuteCamera = false;
         }
         else
         {
             UXMessageMask.ShowMessage(this, false, "启动摄像头失败!", MessageBoxButtonsType.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         if (ErrorNumberEnum.PLCM_SAMPLE_OK == WrapperProxy.StopCamera())
         {
             MuteCamera = true;
         }
         else
         {
             UXMessageMask.ShowMessage(this, false, "关闭摄像头失败!", MessageBoxButtonsType.OK, MessageBoxIcon.Error);
         }
     }
 }
Exemplo n.º 4
0
        private void btnShare_Click(object sender, EventArgs e)
        {
            var contentSelectWin = new ContentSelectPanel()
            {
                Monitors = deviceManager.GetDevicesByType(DeviceTypeEnum.DEV_MONITOR),
                Apps     = deviceManager.GetDevicesByType(DeviceTypeEnum.APPLICATIONS),
                OKAction = (type, format, monitor, app) => {
                    switch (type)
                    {
                    case "Monitor":
                    {
                        var errno = WrapperProxy.StartShareContent(_call.CallHandle, monitor, app);
                        if (errno != ErrorNumberEnum.PLCM_SAMPLE_OK)
                        {
                            MessageBox.Show(this, "共享内容失败!", "消息框", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return(false);
                        }
                    }
                    break;

                    case "BFCP":
                    {
                        var width  = Screen.PrimaryScreen.Bounds.Width;
                        var height = Screen.PrimaryScreen.Bounds.Height;
                        WrapperProxy.SetContentBuffer(format, width, height);
                        var errno = WrapperProxy.StartBFCPContent(_call.CallHandle);
                        if (errno != ErrorNumberEnum.PLCM_SAMPLE_OK)
                        {
                            MessageBox.Show(this, "共享内容失败!", "消息框", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return(false);
                        }
                    }
                    break;
                    }
                    return(true);
                },
                OnCancel = () => { }
            };

            UXMessageMask.ShowForm(this, contentSelectWin);
        }
Exemplo n.º 5
0
        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();
        }