public VideoChatRecorder(IMultimediaManager mgr, DynamicCameraConnector friend, CameraConnector myself)
        {
            this.multimediaManager             = mgr;
            this.dynamicCameraConnector2Friend = friend;
            this.cameraConnector2Myself        = myself;

            //混音器。将自己和对方的声音混成一路。
            this.audioInOutMixer             = new AudioInOutMixer();
            this.audioInOutMixer.AudioMixed += new CbGeneric <byte[]>(audioInOutMixer_AudioMixed);
        }
Example #2
0
 /// <summary>
 /// 设置摄像头与白板控件
 /// </summary>
 /// <param name="CameraConnector"></param>
 /// <param name="WhiteBoardControl"></param>
 public void SetControl(CameraConnector CameraConnector = null, WhiteBoardConnector WhiteBoardControl = null)
 {
     this.CameraControl     = CameraConnector;
     this.WhiteBoardControl = WhiteBoardControl;
     if (CameraControl != null)
     {
         CameraControl.ConnectEnded += OnConnectEnded;
     }
     if (WhiteBoardControl != null)
     {
         WhiteBoardControl.ConnectEnded += OnConnectEnded;
     }
 }
Example #3
0
 public ChatContainer(IMultimediaManager multimediaManager, CameraConnector CameraConnector = null, WhiteBoardConnector WhiteBoardControl = null)
 {
     this.multimediaManager = multimediaManager;
     this.CameraControl     = CameraConnector;
     this.WhiteBoardControl = WhiteBoardControl;
     if (CameraControl != null)
     {
         CameraControl.ConnectEnded += OnConnectEnded;
     }
     if (WhiteBoardControl != null)
     {
         WhiteBoardControl.ConnectEnded += OnConnectEnded;
     }
 }
 public void ConnectOMCS(string serverIP, int serverPort, CameraConnector CameraConnector = null, WhiteBoardConnector WhiteBoardControl = null)
 {
     if (UserInfo.UserState == UserState.未登录)
     {
         throw new Exception("未登录用户申请初始化");
     }
     if (callOMCS != null)//登录成功 实例CallOMCS
     {
         callOMCS.Dispose();
     }
     if (UserInfo.IsPrerogative)
     {
         callOMCS = new TeacherCallOMCS();
     }
     else
     {
         callOMCS = new StudentCallOMCS();
     }
     callOMCS.Initialize(UserInfo.UserId, "", serverIP, serverPort);
     callOMCS.SetControl(CameraConnector, WhiteBoardControl);
     callOMCS.ConnectEnded += a => { ConnectEnded?.Invoke(a); };
     callOMCS.SomeoneExit  += a => { SomeoneExit?.Invoke(a.GetUserId); };
     callOMCS.SomeoneJoin  += a => { SomeoneJoin?.Invoke(a.GetUserId); };
 }
Example #5
0
 /// <summary>
 /// Creates instances of the EmotiveConnector and CameraConnector.
 /// </summary>
 private void InitializeComponentConnectors()
 {
     emoConnector = new EmotivConnector(this);
     camConnector = new CameraConnector();
 }
 /// <summary>
 /// 设置摄像头与白板控件
 /// </summary>
 /// <param name="CameraConnector"></param>
 /// <param name="WhiteBoardControl"></param>
 public void SetControl(CameraConnector CameraConnector = null, WhiteBoardConnector WhiteBoardControl = null)
 {
     chatContainer.SetControl(CameraConnector, WhiteBoardControl);
 }
        public IAsyncResult BeginConnectOMCS(AsyncCallback callback, string serverIP, int serverPort, CameraConnector CameraConnector = null, WhiteBoardConnector WhiteBoardControl = null, object state = null)
        {
            var asyncResult = new NCAsyncResult(callback, state);
            var thr         = new Thread(() =>
            {
                try
                {
                    ConnectOMCS(serverIP, serverPort, CameraConnector, WhiteBoardControl);
                    asyncResult.SetCompleted(baseResult.Successful);
                }
                catch (Exception e)
                {
                    asyncResult.SetCompleted(baseResult.Faild, e.Message);
                }
            });

            thr.IsBackground = true;
            thr.Start();
            return(asyncResult);
        }