void CMainFrame::OnClose() { if (IsIconic()) { OpenIcon(); } CString strInfo; strInfo.Format(LOAD_STRING(IDS_EXITQUESTION), theApp.GetCurCashier()->GetName()); CMsgBoxDlg dlg; dlg.SetText(strInfo); dlg.SetType(MB_OKCANCEL | MB_ICONQUESTION); if (dlg.DoModal() == IDOK) { CIBALog::GetInstance()->Write(_T("Goodbye, IBA!")); theApp.GetRealName()->UnInitRealName(); //theApp.GetIBAView()->SendMessage(WM_CHILDCLOSE, GetDlgCtrlID(), (LPARAM)theApp.GetIBAView()->m_hDodonewView); CBCGPFrameWnd::OnClose(); } CCashierHelper::UninitDiankaPlatform(); }
void CSetDlg::OnEnsure()//确定 { if (user->m_bConnect) { CString strbuff; CString strTemp[10], strBit[3]; CString strSampleRate, strBitRate,strInput, strlVolume, strrVolume; int ret = -1; int i = 0, nBitRate = 0, nFrameRate = 0, AudioInput = 0; int resolution = 0; UCHAR lVolume, rVolume; OutputVideoInfo inVideoInfo,outVideoInfo; AudioParam inAudioInfo,outAudioInfo; int AudioSampleRate =0; int AudioBitRate = 0; strTemp[0] = "Auto"; strTemp[1] = "1920X1080"; strTemp[2] = "1280X720"; strTemp[3] = "1400X1050"; strTemp[4] = "1366X768"; strTemp[5] = "1280X1024"; strTemp[6] = "1280X768"; strTemp[7] = "1024X768"; strTemp[8] = "720X480"; strTemp[9] = "352X288"; ret = sdkGetVideoparam(client_socket,&inVideoInfo); if(ret != 0) { TRACE("ERROR,the error id =0x%x\n",ret); } ret = sdkGetAudioParam(client_socket,&inAudioInfo); if(ret != 0) { TRACE("ERROR,the error id =0x%x\n",ret); } if (m_dlgFlag == 1) //设置视频参数 { vedio->GetDlgItemText(IDC_EDIT1,strbuff); //码率 nFrameRate = atoi(strbuff); if (nFrameRate < 128) { CMsgBoxDlg dlg; dlg.SetMsg(GetStringLanguage("MsgBox", "Caption1", "警告"), GetStringLanguage("MsgBox", "Tip6", "码率最小值为128")); dlg.DoModal(); return ; } else if (nFrameRate > 20000) { CMsgBoxDlg dlg; dlg.SetMsg(GetStringLanguage("MsgBox", "Caption1", "警告"), GetStringLanguage("MsgBox", "Tip7", "码率最大值为20000")); dlg.DoModal(); return ; } inVideoInfo.sBitrate = nFrameRate; vedio->GetDlgItemText(IDC_EDIT3,strbuff); //帧率 nBitRate = atoi(strbuff); if (nBitRate < 1 ) { CMsgBoxDlg dlg; dlg.SetMsg(GetStringLanguage("MsgBox", "Caption1", "警告"), GetStringLanguage("MsgBox", "Tip7", "码率最小值为1")); dlg.DoModal(); return; } else if (nBitRate >60) { CMsgBoxDlg dlg; dlg.SetMsg(GetStringLanguage("MsgBox", "Caption1", "警告"), GetStringLanguage("MsgBox", "Tip8", "帧率最大值为60")); dlg.DoModal(); return ; } inVideoInfo.nFrameRate = nBitRate; vedio->GetDlgItem(IDC_COMBO1)->GetWindowText(strbuff); for (i = 0; i < 10; i++) { if (strbuff == strTemp[i]) { resolution = i; break; } } inVideoInfo.resolution = resolution; ret = sdkSetVideoparam(client_socket, &inVideoInfo, &outVideoInfo); if (ret < 0) { TRACE("ret = %d\n",ret); } else { CMsgBoxDlg dlg; dlg.SetMsg(GetStringLanguage("MsgBox", "Caption2", "提示"), GetStringLanguage("MsgBox", "Tip4", "操作成功")); dlg.DoModal(); } } else if (m_dlgFlag == 2) //设置音频参数 { voice->GetDlgItem(IDC_COMBO1)->GetWindowText(strSampleRate); /*if (strSampleRate == "44.1KHz") { AudioSampleRate = 2; }*/ if (strSampleRate == "48KHz") { AudioSampleRate = 3; } voice->GetDlgItem(IDC_COMBO2)->GetWindowText(strBitRate); if (strBitRate == "64kbps") { AudioBitRate = 64000; } else if (strBitRate == "96kbps") { AudioBitRate = 96000; } else if (strBitRate == "128kbps") { AudioBitRate = 128000; } voice->GetDlgItem(IDC_COMBO3)->GetWindowText(strInput); if (strInput == "Line in") { AudioInput = 0; } else if (strInput == "Mic") { AudioInput = 1; } voice->GetDlgItem(IDC_COMBO4)->GetWindowText(strlVolume); lVolume = atoi(strlVolume); lVolume = transform(lVolume); voice->GetDlgItem(IDC_COMBO5)->GetWindowText(strrVolume); rVolume = atoi(strrVolume); rVolume = transform(rVolume); inAudioInfo.SampleRate = AudioSampleRate; inAudioInfo.BitRate = AudioBitRate; inAudioInfo.InputMode = AudioInput; inAudioInfo.LVolume = lVolume; inAudioInfo.RVolume = rVolume; ret = sdkSetAudioParam(client_socket, &inAudioInfo, &outAudioInfo); if (ret < 0) { TRACE("ret = %d\n",ret); } else { CMsgBoxDlg dlg; dlg.SetMsg(GetStringLanguage("MsgBox", "Caption2", "提示"), GetStringLanguage("MsgBox", "Tip4", "操作成功")); dlg.DoModal(); } } } }