Beispiel #1
0
 public CallOMCS()
 {
     multimediaManager                    = MultimediaManagerFactory.GetSingleton();
     multimediaManager.ChannelMode        = ChannelMode.P2PDisabled;
     multimediaManager.SecurityLogEnabled = false;
     multimediaManager.SpeakerIndex       = 0;
 }
Beispiel #2
0
        public void StartOMCSClient(UserDto CurrentUser, string roomId)
        {
            try
            {
                multimediaManager = MultimediaManagerFactory.GetSingleton();
                multimediaManager.CameraVideoSize = new Size(320, 240);
                multimediaManager.AutoAdjustCameraEncodeQuality = false;
                multimediaManager.ChannelMode           = ChannelMode.P2PDisabled;
                multimediaManager.SecurityLogEnabled    = false;
                multimediaManager.CameraDeviceIndex     = 0;
                multimediaManager.MicrophoneDeviceIndex = ConfigEntity.MicrophoneIndex;
                multimediaManager.SpeakerIndex          = ConfigEntity.SpeakerIndex;
                multimediaManager.DesktopEncodeQuality  = 3;
                multimediaManager.AutoReconnect         = true;
                multimediaManager.Initialize(CurrentUser.UserName, "", ConfigEntity.SocketServerIp, ConfigEntity.AudioPort);


                this.chatGroup              = this.multimediaManager.ChatGroupEntrance.Join(ChatType.Audio, roomId);
                this.chatGroup.SomeoneJoin += chatGroup_SomeoneJoin;
                this.chatGroup.SomeoneExit += chatGroup_SomeoneExit;
                foreach (IChatUnit unit in this.chatGroup.GetOtherMembers())
                {
                    unit.MicrophoneConnector.BeginConnect(unit.MemberID);
                }

                if (multimediaManager.Available)
                {
                    DisplayMsg("语音服务已经连接成功.");
                }
            }
            catch (Exception ex)
            {
                DisplayMessage(ex.Message);
            }
        }
Beispiel #3
0
        private void btnClose_Click(object sender, EventArgs e)
        {
            try
            {
                bool autoStartChanged = (this.skinCheckBox_autoRun.Checked != SystemSettings.Singleton.AutoRun);
                SystemSettings.Singleton.AutoRun = this.skinCheckBox_autoRun.Checked;
                SystemSettings.Singleton.ExitWhenCloseMainForm           = !this.skinRadioButton_hide.Checked;
                SystemSettings.Singleton.AutoLogin                       = this.skinCheckBox_autoLogin.Checked;
                SystemSettings.Singleton.PlayAudio4Message               = this.skinCheckBox_ring.Checked;
                SystemSettings.Singleton.LoadLastWordsWhenChatFormOpened = this.skinCheckBox_lastWords.Checked;
                MultimediaManagerFactory.GetSingleton().CameraDeviceIndex = SystemSettings.Singleton.WebcamIndex;
                SystemSettings.Singleton.Save();

                if (autoStartChanged)
                {
                    string name = "GGTalk.exe";
                    string args = string.Format("{0} {1}", name, SystemSettings.Singleton.AutoRun.ToString());
                    Process.Start(AppDomain.CurrentDomain.BaseDirectory + "AutoStart.exe", args);
                }

                //操作注册表,需要使用管理员身份启动程序。
                //ESBasic.Helpers.WindowsHelper.RunWhenStart_usingReg(this.skinCheckBox_autoRun.Checked, "GG2013", Application.ExecutablePath);
                this.Close();
            }
            catch (Exception ee)
            {
                MessageBoxEx.Show(ee.Message);
            }
        }
Beispiel #4
0
        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                LoginForm loginForm = new LoginForm();
                if (loginForm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                IMultimediaManager multimediaManager = MultimediaManagerFactory.GetSingleton();
                multimediaManager.ImageConverterFactory = new ImageConverterFactory();// 图片转换器工厂,供OMCS内部将课件转换成图片的过程中使用。
                multimediaManager.CameraDeviceIndex     = 0;
                multimediaManager.MicrophoneDeviceIndex = 0;
                multimediaManager.CameraEncodeQuality   = 3;
                multimediaManager.ChannelMode           = ChannelMode.P2PChannelFirst;
                multimediaManager.Initialize(loginForm.CurrentUserID, "", ConfigurationManager.AppSettings["ServerIP"], int.Parse(ConfigurationManager.AppSettings["ServerPort"]));
                WhiteBoardForm mainForm = new WhiteBoardForm(loginForm.ClassRoomID, loginForm.IsTeacher);

                Application.Run(mainForm);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message + "," + ee.StackTrace);
            }
        }
Beispiel #5
0
        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                LoginForm loginForm = new LoginForm();
                if (loginForm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                IMultimediaManager multimediaManager = MultimediaManagerFactory.GetSingleton();

                multimediaManager.Advanced.AllowDiscardFrameWhenBroadcast = true; //正式部署使用时,建议设置为true。
                multimediaManager.Advanced.MaxInterval4CameraKeyFrame     = 30;   //本句自己添加
                multimediaManager.CameraVideoSize = new System.Drawing.Size(320, 240);
                multimediaManager.AutoAdjustCameraEncodeQuality = true;
                multimediaManager.ChannelMode           = ChannelMode.P2PDisabled;
                multimediaManager.SecurityLogEnabled    = false;
                multimediaManager.CameraDeviceIndex     = 0;
                multimediaManager.MicrophoneDeviceIndex = int.Parse(ConfigurationManager.AppSettings["MicrophoneIndex"]);
                multimediaManager.SpeakerIndex          = int.Parse(ConfigurationManager.AppSettings["SpeakerIndex"]);
                multimediaManager.DesktopEncodeQuality  = 3;
                multimediaManager.Initialize(loginForm.CurrentUserID, "", ConfigurationManager.AppSettings["ServerIP"], int.Parse(ConfigurationManager.AppSettings["ServerPort"]));

                MainForm mainForm = new MainForm(multimediaManager, loginForm.RoomID);
                Application.Run(mainForm);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }
Beispiel #6
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            IMultimediaManager multimediaManager = MultimediaManagerFactory.GetSingleton();

            multimediaManager.ChannelMode = OMCS.Passive.ChannelMode.P2PDisabled;
            Application.Run(new login(multimediaManager));
        }
Beispiel #7
0
        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                GlobalResourceManager.PreInitialize();

                //ESPlus.GlobalUtil.SetMaxLengthOfUserID(20);
                ESPlus.GlobalUtil.SetMaxLengthOfMessage(1024 * 1024 * 10);
                //OMCS.GlobalUtil.SetMaxLengthOfUserID(20);
                MainForm            mainForm      = new MainForm();
                IRapidPassiveEngine passiveEngine = RapidEngineFactory.CreatePassiveEngine();

                NDiskPassiveHandler     nDiskPassiveHandler = new NDiskPassiveHandler();                                  //V 2.0
                ComplexCustomizeHandler complexHandler      = new ComplexCustomizeHandler(nDiskPassiveHandler, mainForm); //V 2.0
                LoginForm loginForm = new LoginForm(passiveEngine, complexHandler);

                if (loginForm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                #region 初始化OMCS
                Program.MultimediaManager = MultimediaManagerFactory.GetSingleton();
                Program.MultimediaManager.CameraDeviceIndex     = SystemSettings.Singleton.WebcamIndex;
                Program.MultimediaManager.MicrophoneDeviceIndex = SystemSettings.Singleton.MicrophoneIndex;
                Size?okSize = OMCS.Tools.Camera.MatchCameraVideoSize(SystemSettings.Singleton.WebcamIndex, GlobalConsts.CommonQualityVideo);
                Program.MultimediaManager.CameraVideoSize     = okSize == null ? new Size(320, 240) : okSize.Value;
                Program.MultimediaManager.OmcsLogger          = GlobalResourceManager.Logger;
                Program.MultimediaManager.CameraEncodeQuality = 10;
                Program.MultimediaManager.Initialize(passiveEngine.CurrentUserID, "", ConfigurationManager.AppSettings["ServerIP"], int.Parse(ConfigurationManager.AppSettings["OmcsServerPort"]));
                #endregion

                nDiskPassiveHandler.Initialize(passiveEngine.FileOutter, null);
                mainForm.Initialize(passiveEngine, loginForm.LoginStatus, loginForm.StateImage);
                Application.Run(mainForm);
            }
            catch (Exception ee)
            {
                MessageBoxEx.Show(ee.Message);
                ee = ee;
            }
        }
        public DeviceSelectForm(IMultimediaManager mgr)
        {
            InitializeComponent();

            this.multimediaManager = mgr ?? MultimediaManagerFactory.GetSingleton();
            this.userID            = this.multimediaManager.CurrentUserID;
            this.ipe = this.multimediaManager.ServerIPE;

            this.multimediaManager.AudioCaptured       += new CbGeneric <byte[]>(multimediaManager_AudioCaptured);
            this.multimediaManager.DeviceErrorOccurred += new CbGeneric <MultimediaDeviceType, int, string>(multimediaManager_DeviceErrorOccurred);
            this.cameraConnector1.ConnectEnded         += new CbGeneric <ConnectResult>(cameraConnector1_ConnectEnded);
            this.microphoneConnector1.ConnectEnded     += new CbGeneric <ConnectResult>(microphoneConnector1_ConnectEnded);

            this.button_refresh_Click(this.button_refresh, new EventArgs());
            try
            {
                this.comboBox_camera.SelectedIndex  = this.multimediaManager.CameraDeviceIndex;
                this.comboBox_mic.SelectedIndex     = this.multimediaManager.MicrophoneDeviceIndex;
                this.comboBox_speaker.SelectedIndex = this.multimediaManager.SpeakerIndex;
            }
            catch { }
        }
Beispiel #9
0
        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                LoginForm f1 = new LoginForm();
                if (f1.ShowDialog() != DialogResult.OK)//f1的button点击确定后值为ok,所以返回
                {
                    return;
                }
                OMCSConfiguration config = new OMCSConfiguration();
                //用于验证登录用户的帐密
                DefaultUserVerifier userVerifier = new DefaultUserVerifier();
                Program.MultimediaServer = MultimediaServerFactory.CreateMultimediaServer(int.Parse(ConfigurationManager.AppSettings["Port"]), userVerifier, config, bool.Parse(ConfigurationManager.AppSettings["SecurityLogEnabled"]));

                f1.sever2(Program.MultimediaServer);

                IMultimediaManager multimediaManager = MultimediaManagerFactory.GetSingleton();
                multimediaManager.Advanced.AllowDiscardFrameWhenBroadcast = false; //正式部署使用时,建议设置为true。
                multimediaManager.CameraVideoSize = new System.Drawing.Size(320, 240);
                multimediaManager.AutoAdjustCameraEncodeQuality = true;
                multimediaManager.ChannelMode           = ChannelMode.P2PDisabled;
                multimediaManager.SecurityLogEnabled    = false;
                multimediaManager.CameraDeviceIndex     = 0;
                multimediaManager.MicrophoneDeviceIndex = int.Parse(ConfigurationManager.AppSettings["MicrophoneIndex"]);
                multimediaManager.SpeakerIndex          = int.Parse(ConfigurationManager.AppSettings["SpeakerIndex"]);
                multimediaManager.DesktopEncodeQuality  = 3;
                multimediaManager.Initialize(f1.Bccount, f1.Cccount, ConfigurationManager.AppSettings["ServerIP"], int.Parse(ConfigurationManager.AppSettings["ServerPort"]));

                MainForm f3 = new MainForm(multimediaManager, f1.RoomID);
                Application.Run(f3);
            }
            catch (Exception ee)
            { MessageBox.Show(ee.Message); }
        }
 public void Initialize(string _ownerID)
 {
     this.currentOwnerID = _ownerID;
     MultimediaManagerFactory.GetSingleton().JitterBufferDepthChanged += new ESBasic.CbGeneric <string, int, int, int>(multimediaMonitor_BufferDepthChanged);
     this.DisplaySignal(1, 1, -1);
 }