예제 #1
0
 private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (isRecord)
     {
         DialogResult dr = MessageBox.Show("µ±Ç°Â¼ÖƵĿμþδ±£´æ£¬ÊÇ·ñ±£´æºóÍ˳ö£¿", "Ìáʾ", MessageBoxButtons.YesNoCancel);
         if (dr == DialogResult.Yes)
         {
             RLog.ToDB("±£´æ¼ÖÆÎļþºóÍ˳ö");
             btnExit_Click(null, null);
         }
         else if (dr == DialogResult.No)
         {
             // ɾ³ýÒѾ­Â¼ÖƵÄÊÓƵºÍĿ¼
             RecordStop();
             DeleteFile();
             RLog.ToDB("δ±£´æ¼ÖÆÎļþÖ±½ÓÍ˳ö");
             this.Dispose(true);
             Application.Exit();
         }
         else if (dr == DialogResult.Cancel)
         {
             RLog.ToDB("È¡ÏûÍ˳ö");
             e.Cancel = true;
             return;
         }
     }
     else
     {
         RLog.ToDB("Í˳ö³ÌÐò");
     }
     CSAVFrameWork.uninitialize();
 }
예제 #2
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (isRecord)
     {
         DialogResult dr = MessageBox.Show("当前录制的课件未保存,是否保存后退出?", "提示", MessageBoxButtons.YesNoCancel);
         if (dr == DialogResult.Yes)
         {
             RLog.ToDB("保存录制文件后退出");
             btnExit_Click(null, null);
         }
         else if (dr == DialogResult.No)
         {
             // 删除已经录制的视频和目录
             RecordStop();
             DeleteFile();
             RLog.ToDB("未保存录制文件直接退出");
             this.Dispose(true);
             Application.Exit();
         }
         else if (dr == DialogResult.Cancel)
         {
             RLog.ToDB("取消退出");
             e.Cancel = true;
             return;
         }
     }
     else
     {
         RLog.ToDB("退出程序");
     }
     CSAVFrameWork.uninitialize();
 }
예제 #3
0
 private void Init()
 {
     // ³õʼ»¯
     if (!CSAVFrameWork.initialize())
     {
         MessageBox.Show("³õʼ»¯Ê§°Ü!");//avframework¿â³õʼ»¯Ê§°Ü!
         return;
     }
     // »ñÈ¡
     GetVideoInputCount();
     GetAudioInputCount();
     // ĬÈϼÒôÉ豸ÅäÖÃ
     audioName = CSAVFrameWork.getAudioDefaultInputDeviceName();
     if (string.IsNullOrEmpty(audioName))
     {
         MessageBox.Show("δÕÒµ½Ä¬ÈϼÒôÉ豸£¬²»ÄܼÖÆÉùÒô¡£");
         sbScrAudioInput.Value = false;
         sbStuAudioInput.Value = false;
         sbTeaAudioInput.Value = false;
     }
     // ¿ªÊ¼Ô¤ÀÀ
     StuPreviewer();
     TeaPreviewer();
     ScreenPreviewer();
 }
예제 #4
0
 void Preview()
 {
     m_csAVFrm = new CSAVFrameWork();
     CSAVFrameWork.initialize();
     audioName        = CSAVFrameWork.getAudioDefaultInputDeviceName();
     audioPreviewerId = m_csAVFrm.startPreview(IntPtr.Zero, emAVDType.emUSBMicroPhone, audioName);
     videoPreviewerId = m_csAVFrm.startPreview(btnRecordPause.Handle, emAVDType.emRtsp, rtspCam);
 }
예제 #5
0
 // 退出时保存录像
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (isRecord)
     {
         RecordStop();
     }
     CSAVFrameWork.uninitialize();
 }
예제 #6
0
 // 预览
 void Preview()
 {
     m_csAVFrm = new CSAVFrameWork();
     CSAVFrameWork.initialize();
     audioName = CSAVFrameWork.getAudioDefaultInputDeviceName();
     audioPreviewerId = m_csAVFrm.startPreview(IntPtr.Zero, emAVDType.emUSBMicroPhone, audioName);
     videoPreviewerId = m_csAVFrm.startPreview(plCamera.Handle, emAVDType.emRtsp, config.RTSPAddress);
 }
예제 #7
0
 // 退出时保存录像
 private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (isRecord)
     {
         Booth.fnStopRecord();
         this.Dispose(true);
         Application.Exit();
     }
     CSAVFrameWork.uninitialize();
 }
예제 #8
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     // 初始化
     if (!CSAVFrameWork.initialize())
     {
         MessageBox.Show("初始化失败!");//avframework库初始化失败!
         return;
     }
     // 获取
     GetVideoInputCount();
     GetAudioInputCount();
     // 默认录音设备配置
     audioName = CSAVFrameWork.getAudioDefaultInputDeviceName();
     // 开始预览
     StuPreviewer();
     TeaPreviewer();
     ScreenPreviewer();
 }