DlgSettings.cpp
上传用户:gnaf34
上传日期:2022-04-22
资源大小:1657k
文件大小:16k
源码类别:

IP电话/视频会议

开发平台:

Visual C++

  1. // DlgSettings.cpp : implementation file
  2. //
  3. #include <string.h>
  4. #include "stdafx.h"
  5. #include "BeaconClient.h"
  6. #include "DlgSettings.h"
  7. #include "ConfigurePlots.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. extern CString consoleStr;
  14. char testsFolderPath[MAX_PATH];
  15. char exeFolderPath[MAX_PATH];
  16. CString strTmpPath;
  17. extern CString laG,laA,laU,loG,loA,loU,jiG,jiA,jiU;
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CDlgSettings dialog
  20. CDlgSettings::CDlgSettings(CWnd* pParent /*=NULL*/)
  21. : CDialog(CDlgSettings::IDD, pParent)
  22. {
  23. //{{AFX_DATA_INIT(CDlgSettings)
  24. m_strFolderPath = _T("");
  25. m_silenceDetection = FALSE;
  26. m_testSave = FALSE;
  27. m_Png = FALSE;
  28. m_Bmp = FALSE;
  29. //}}AFX_DATA_INIT
  30. }
  31. void CDlgSettings::DoDataExchange(CDataExchange* pDX)
  32. {
  33. CDialog::DoDataExchange(pDX);
  34. //{{AFX_DATA_MAP(CDlgSettings)
  35. DDX_Control(pDX, IDC_AUDIOCODEC, m_audioCodec);
  36. DDX_Text(pDX, IDC_OUTFILEPATH, m_strFolderPath);
  37. DDX_Check(pDX, IDC_SILENCEDETECTION, m_silenceDetection);
  38. DDX_Check(pDX, IDC_TESTSAVE, m_testSave);
  39. //DDX_Check(pDX, IDC_PNG, m_Png);
  40. //DDX_Check(pDX, IDC_BMP, m_Bmp);
  41. //}}AFX_DATA_MAP
  42. }
  43. BEGIN_MESSAGE_MAP(CDlgSettings, CDialog)
  44. //{{AFX_MSG_MAP(CDlgSettings)
  45. ON_BN_CLICKED(IDC_APPLYSETTINGS, OnApplysettings)
  46. ON_BN_CLICKED(IDC_DEFAULTSETTINGS, OnDefaultsettings)
  47. ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
  48. ON_BN_CLICKED(IDC_QUALITYMARKERS, OnQualitymarkers)
  49. ON_EN_KILLFOCUS(IDC_JITTERBUFFER, OnKillfocusJitterbuffer)
  50. //}}AFX_MSG_MAP
  51. END_MESSAGE_MAP()
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CDlgSettings message handlers
  54. void CDlgSettings::OnApplysettings() 
  55. {
  56. // TODO: Add your control notification handler code here
  57. CString folderHolder;
  58. CString text;
  59. CWnd* handle;
  60. FILE *fp;
  61. int t;
  62. // int t;
  63. //Save the file options to the Settings.conf file
  64. //Get the Path to the folder from where the beaconclient.exe is being executed
  65. char file[MAX_PATH];
  66. char exeFilePath[MAX_PATH]; //a string for GetModuleFileName() to store exe Path
  67. GetModuleFileName( NULL,&exeFilePath[0],sizeof (exeFilePath));
  68. //Extract path by copying without exe string..
  69. for(int i=0; i < abs(strlen(exeFilePath)-16); i++){
  70. file[i] = exeFilePath[i];
  71. }
  72. file[i] = '';
  73. //strcpy(file,exeFolderPath);
  74. strcat(file,"S.conf");
  75. fp = fopen(file,"w");
  76. //Call_options
  77. fprintf(fp,"Call_Optionsn");
  78. t=IsDlgButtonChecked(IDC_FASTSTART);
  79. fprintf(fp,"FASTSTARTt%dn",t);
  80. t=IsDlgButtonChecked(IDC_TUNNEL);
  81. fprintf(fp,"TUNNELt%dn",t);
  82. t=IsDlgButtonChecked(IDC_SETUP);
  83. fprintf(fp,"SETUPt%dnn",t);
  84. //Output_File_path
  85. fprintf(fp,"Output_File_pathn");
  86. CWnd* pFolder = (CWnd*)GetDlgItem(IDC_OUTFILEPATH);
  87. pFolder->GetWindowText(folderHolder);
  88. fprintf(fp,"OUTPUTFILEPATHt%snn",folderHolder);
  89. strcpy(testsFolderPath,folderHolder);
  90. //Ports
  91. fprintf(fp,"Ports_Optionsn");
  92. handle = (CWnd*)GetDlgItem(IDC_TCPBASE);
  93. handle->GetWindowText(text);
  94. fprintf(fp,"TCPBASEt%sn",text);
  95. handle = (CWnd*)GetDlgItem(IDC_TCPMAX);
  96. handle->GetWindowText(text);
  97. fprintf(fp,"TCPMAXt%sn",text);
  98. handle = (CWnd*)GetDlgItem(IDC_UDPBASE);
  99. handle->GetWindowText(text);
  100. fprintf(fp,"UDPBASEt%sn",text);
  101. handle = (CWnd*)GetDlgItem(IDC_UDPMAX);
  102. handle->GetWindowText(text);
  103. fprintf(fp,"UDPMAXt%sn",text);
  104. handle = (CWnd*)GetDlgItem(IDC_RTPBASE);
  105. handle->GetWindowText(text);
  106. fprintf(fp,"RTPPBASEt%sn",text);
  107. handle = (CWnd*)GetDlgItem(IDC_RTPMAX);
  108. handle->GetWindowText(text);
  109. fprintf(fp,"RTPMAXt%snn",text);
  110. //Test Results
  111. fprintf(fp,"Test_Resultsn");
  112. t=IsDlgButtonChecked(IDC_TESTSAVE);
  113. fprintf(fp,"TESTSAVEt%dnn",t);
  114. // t=IsDlgButtonChecked(IDC_PNG);
  115. // fprintf(fp,"PNGt%dn",t);
  116. // t=IsDlgButtonChecked(IDC_BMP);
  117. // fprintf(fp,"BMPt%dnn",t);
  118. //Audio options
  119. fprintf(fp,"Audio_Optionsn");
  120. t=IsDlgButtonChecked(IDC_SILENCEDETECTION);
  121. fprintf(fp,"SILENCEDETECTIONt%dn",t);
  122. handle = (CWnd*)GetDlgItem(IDC_AUDIOCODEC);
  123. handle->GetWindowText(text);
  124. fprintf(fp,"AUDIOCODECt%sn",text);
  125. handle = (CWnd*)GetDlgItem(IDC_JITTERBUFFER);
  126. handle->GetWindowText(text);
  127. fprintf(fp,"JITTERBUFFER(ms)t%snn",text);
  128. //Video options
  129. fprintf(fp,"Video_Optionsn");
  130. handle = (CWnd*)GetDlgItem(IDC_VIDEODEVICE);
  131. handle->GetWindowText(text);
  132. fprintf(fp,"VIDEODEVICEt%sn",text);
  133. handle = (CWnd*)GetDlgItem(IDC_FORMAT);
  134. handle->GetWindowText(text);
  135. fprintf(fp,"FORMATt%sn",text);
  136.     t=IsDlgButtonChecked(IDC_TRNONE);
  137. fprintf(fp,"TRNONEt%dn",t);
  138. t=IsDlgButtonChecked(IDC_TRSMALL);
  139. fprintf(fp,"TRSMALLt%dn",t);
  140. t=IsDlgButtonChecked(IDC_TRLARGE);
  141. fprintf(fp,"TRLARGEt%dnn",t);
  142. //Configure_QualityMarkers_in plots
  143. //Configure_options
  144. fprintf(fp,"Configure_Optionsn");
  145. fprintf(fp,"LATENCY_GOODt%sn",laG);
  146. fprintf(fp,"LATENCY_ACCt%sn",laA);
  147. fprintf(fp,"LATENCY_UNACCt%snn",laU);
  148. fprintf(fp,"LOSS_GOODt%sn",loG);
  149. fprintf(fp,"LOSS_ACCt%sn",loA);
  150. fprintf(fp,"LOSS_UNACCt%snn",loU);
  151. fprintf(fp,"JITTER_GOODt%sn",jiG);
  152. fprintf(fp,"JITTER_ACCt%sn",jiA);
  153. fprintf(fp,"JITTER_UNACCt%snn",jiU);
  154. fclose(fp);
  155. //It has been saved to the file
  156. //To add "\" to path so that gnuplot understands.. 
  157. //Gnuplot understands C:\Beacon and not C:Beacon
  158. //char *appendSlash;
  159. //char tmpAppend[MAX_PATH];
  160. //int jj=0;
  161. //if the last character is not a trailing  then add one.
  162. if(testsFolderPath[abs(strlen(testsFolderPath))-1]=='\'){
  163. //it is there do nothing.
  164. }
  165. else{
  166. strcat(testsFolderPath,"\");
  167. }
  168. SetFldrPath();
  169. /* appendSlash = testsFolderPath;
  170. for (int ii=0; ii < abs(strlen(testsFolderPath)); ii++)
  171. {
  172. tmpAppend[jj] = testsFolderPath[ii];
  173. if(*appendSlash == '\')
  174. {
  175. jj++;
  176. tmpAppend[jj] = '\';
  177. }
  178. jj++;
  179. appendSlash++;
  180. }
  181. tmpAppend[jj] = '';
  182. strcpy(testsFolderPath,tmpAppend);
  183. */
  184. //SetDlgItemText(IDC_OUTFILEPATH,testsFolderPath);
  185. }
  186. void CDlgSettings::OnDefaultsettings() 
  187. {
  188. // TODO: Add your control notification handler code here
  189. char file[MAX_PATH];
  190. char exeFilePath[MAX_PATH]; //a string for GetModuleFileName() to store exe Path
  191. GetModuleFileName( NULL,&exeFilePath[0],sizeof (exeFilePath));
  192. //Extract path by copying without exe string..
  193. for(int i=0; i < abs(strlen(exeFilePath)-16); i++){
  194. file[i] = exeFilePath[i];
  195. }
  196. file[i] = '';
  197. //strcpy(file,exeFolderPath);
  198. strcat(file,"SD.conf");
  199. SetSettingsFromFile(file);
  200. }
  201. BOOL CDlgSettings::OnInitDialog() 
  202. {
  203. CDialog::OnInitDialog();
  204. CDlgSettings dlg;
  205. char file[MAX_PATH];
  206. char exeFilePath[MAX_PATH]; //a string for GetModuleFileName() to store exe Path
  207. GetModuleFileName( NULL,&exeFilePath[0],sizeof (exeFilePath));
  208. //Extract path by copying without exe string..
  209. for(int i=0; i < abs(strlen(exeFilePath)-16); i++){
  210. file[i] = exeFilePath[i];
  211. }
  212. file[i] = '';
  213. //strcpy(file,exeFolderPath);
  214. strcat(file,"S.conf");
  215. //Set the settings from file Settings.conf
  216. SetSettingsFromFile(file);
  217. return TRUE;  // return TRUE unless you set the focus to a control
  218.               // EXCEPTION: OCX Property Pages should return FALSE
  219. }
  220. //Code to implement "Browse" functionality to set the Test results folder path
  221. int CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
  222. {
  223. TCHAR szDir[MAX_PATH];
  224. switch(uMsg){
  225. case BFFM_INITIALIZED:
  226. if (lpData){
  227. strcpy(szDir, strTmpPath.GetBuffer(strTmpPath.GetLength()));
  228. SendMessage(hwnd,BFFM_SETSELECTION,TRUE,(LPARAM)szDir);
  229. }
  230. break;
  231. case BFFM_SELCHANGED: {
  232.    if (SHGetPathFromIDList((LPITEMIDLIST) lParam ,szDir)){
  233.   SendMessage(hwnd,BFFM_SETSTATUSTEXT,0,(LPARAM)szDir);
  234.    }
  235.    break;
  236. }
  237. default:
  238.    break;
  239. }
  240.          
  241. return 0;
  242. }
  243. BOOL GetFolder(CString* strSelectedFolder,
  244.    const char* lpszTitle,
  245.    const HWND hwndOwner, 
  246.    const char* strRootFolder, 
  247.    const char* strStartFolder)
  248. {
  249. char pszDisplayName[MAX_PATH];
  250. LPITEMIDLIST lpID;
  251. BROWSEINFOA bi;
  252. bi.hwndOwner = hwndOwner;
  253. if (strRootFolder == NULL){
  254. bi.pidlRoot = NULL;
  255. }else{
  256.    LPITEMIDLIST  pIdl = NULL;
  257.    IShellFolder* pDesktopFolder;
  258.    char          szPath[MAX_PATH];
  259.    OLECHAR       olePath[MAX_PATH];
  260.    ULONG         chEaten;
  261.    ULONG         dwAttributes;
  262.    strcpy(szPath, (LPCTSTR)strRootFolder);
  263.    if (SUCCEEDED(SHGetDesktopFolder(&pDesktopFolder)))
  264.    {
  265.    MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szPath, -1, olePath, MAX_PATH);
  266.    pDesktopFolder->ParseDisplayName(NULL, NULL, olePath, &chEaten, &pIdl, &dwAttributes);
  267.    pDesktopFolder->Release();
  268.    }
  269.    bi.pidlRoot = pIdl;
  270. }
  271. bi.pszDisplayName = pszDisplayName;
  272. bi.lpszTitle = lpszTitle;
  273. bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT;
  274. bi.lpfn = BrowseCallbackProc;
  275. if (strStartFolder == NULL){
  276. bi.lParam = FALSE;
  277. }else{
  278. strTmpPath.Format("%s", strStartFolder);
  279. bi.lParam = TRUE;
  280. }
  281. bi.iImage = NULL;
  282. lpID = SHBrowseForFolderA(&bi);
  283. if (lpID != NULL){
  284. BOOL b = SHGetPathFromIDList(lpID, pszDisplayName);
  285. if (b == TRUE){
  286. strSelectedFolder->Format("%s",pszDisplayName);
  287. return TRUE;
  288. }
  289. }else{
  290. strSelectedFolder->Empty();
  291. }
  292. return FALSE;
  293. }
  294. void CDlgSettings::OnBrowse() 
  295. {
  296. // TODO: Add your control notification handler code here
  297. CString strFolderPath;
  298. if (GetFolder(&strFolderPath, "Please choose the folder location to save your H.323 Beacon test session results...", this->m_hWnd, NULL, NULL)){
  299. if (!strFolderPath.IsEmpty()){
  300. m_strFolderPath = strFolderPath;
  301. UpdateData(FALSE);
  302. }
  303. }
  304. }
  305. void CDlgSettings::SetFldrPath()
  306. {
  307. char *appendSlash;
  308. char tmpAppend[MAX_PATH];
  309. int jj=0;
  310. appendSlash = testsFolderPath;
  311. if(testsFolderPath[abs(strlen(testsFolderPath))-1]=='\'){
  312. //it is there do nothing.
  313. }
  314. else{
  315. strcat(testsFolderPath,"\");
  316. }
  317. //testing if the last word in the directory path is 'Tests'
  318. int testsexsist=0;
  319. char tempPath[MAX_PATH],*lbone;
  320. strcpy(tempPath,testsFolderPath);
  321. //while((last= strtok(tempPath,'\'))!=''){
  322. //lbone=last;
  323. //}
  324. lbone=strstr(tempPath,"Tests");
  325. if(lbone!=NULL)
  326. testsexsist=1;
  327. //add  for every ,gnuplot only understands //
  328. for (int ii=0; ii < abs(strlen(testsFolderPath)); ii++)
  329. {
  330. tmpAppend[jj] = testsFolderPath[ii];
  331. if(*appendSlash == '\')
  332. {
  333. jj++;
  334. tmpAppend[jj] = '\';
  335. }
  336. jj++;
  337. appendSlash++;
  338. }
  339. tmpAppend[jj] = '';
  340. strcpy(testsFolderPath,tmpAppend);
  341. //strcpy(exeFolderPath,testsFolderPath);
  342. //Add "Tests" string to Path, if testsexsist=0
  343. if(testsexsist==0){
  344. strcat(testsFolderPath,"Tests");
  345. }
  346. else{
  347. int len=abs(strlen(testsFolderPath));
  348. testsFolderPath[len-2]=NULL;
  349. }
  350. //SetDlgItemText(IDC_OUTFILEPATH,testsFolderPath);
  351. }
  352. void CDlgSettings::SetDefaultTestsFldrPath()
  353. {
  354. //Get the Path to the folder from where the beaconclient.exe is being executed
  355. char exeFilePath[MAX_PATH]; //a string for GetModuleFileName() to store exe Path
  356. GetModuleFileName( NULL,&exeFilePath[0],sizeof (exeFilePath));
  357. //Extract path by copying without exe string..
  358. for(int i=0; i < abs(strlen(exeFilePath)-16); i++){
  359. testsFolderPath[i] = exeFilePath[i];
  360. }
  361. testsFolderPath[i] = '';
  362. //To add "\" to path so that gnuplot understands.. 
  363. //Gnuplot understands C:\Beacon and not C:Beacon
  364. char *appendSlash;
  365. char tmpAppend[MAX_PATH];
  366. char toDisp[MAX_PATH];
  367. strcpy(toDisp,testsFolderPath);
  368. int jj=0;
  369. appendSlash = testsFolderPath;
  370. for (int ii=0; ii < abs(strlen(testsFolderPath)); ii++)
  371. {
  372. tmpAppend[jj] = testsFolderPath[ii];
  373. if(*appendSlash == '\')
  374. {
  375. jj++;
  376. tmpAppend[jj] = '\';
  377. }
  378. jj++;
  379. appendSlash++;
  380. }
  381. tmpAppend[jj] = '';
  382. strcpy(testsFolderPath,tmpAppend);
  383. strcpy(exeFolderPath,testsFolderPath);
  384. //Add "Tests" string to Path
  385. strcat(testsFolderPath,"Tests");
  386. strcat(toDisp,"Tests");
  387. SetDlgItemText(IDC_OUTFILEPATH,toDisp);
  388. }
  389.  
  390. void CDlgSettings::SetSettingsFromFile(CString SettingsFile)
  391. {
  392. CString lp;
  393. FILE *fp;
  394. int t=10;
  395. fp = fopen(SettingsFile,"r");
  396. //Call Options
  397. fscanf(fp,"%s",lp); //for CCall_Options
  398. fscanf(fp,"%s",lp);
  399. fscanf(fp,"%s",lp);
  400. t=atoi(lp);
  401. CheckDlgButton(IDC_FASTSTART,t);
  402. fscanf(fp,"%s",lp);
  403. fscanf(fp,"%s",lp);
  404.     t=atoi(lp);
  405. CheckDlgButton(IDC_TUNNEL,t);
  406. fscanf(fp,"%s",lp);
  407. fscanf(fp,"%s",lp);
  408.     t=atoi(lp);
  409. CheckDlgButton(IDC_SETUP,t);
  410. //Output File Path
  411. fscanf(fp,"%s",lp);//for Output_File_Path
  412. fscanf(fp,"%s",lp);
  413. fseek(fp,sizeof(char),SEEK_CUR);
  414. //fscanf(fp,"%s ",lp);
  415. char filepath[MAX_PATH];
  416. fgets(filepath,MAX_PATH,fp);
  417. filepath[abs(strlen(filepath))-1]='';
  418. //strcpy((char [])lp,filepath);
  419. //lp=(LPCSTR)filepath;
  420. //lp=filepath;
  421. //MessageBox(lp);
  422. SetDlgItemText(IDC_OUTFILEPATH,filepath);
  423. if(strcmp(filepath,"default")==0){
  424. SetDefaultTestsFldrPath();
  425. }
  426. else{
  427. strcpy(testsFolderPath,filepath);
  428. SetFldrPath();
  429. }
  430. //Port Options
  431. fscanf(fp,"%s",lp); //for Ports_Options
  432. fscanf(fp,"%s",lp);
  433. fscanf(fp,"%s",lp);
  434. SetDlgItemText(IDC_TCPBASE, lp);
  435. fscanf(fp,"%s",lp);
  436. fscanf(fp,"%s",lp);
  437. SetDlgItemText(IDC_TCPMAX, lp);
  438. fscanf(fp,"%s",lp);
  439. fscanf(fp,"%s",lp);
  440. SetDlgItemText(IDC_UDPBASE, lp);
  441. fscanf(fp,"%s",lp);
  442. fscanf(fp,"%s",lp);
  443. SetDlgItemText(IDC_UDPMAX, lp);
  444. fscanf(fp,"%s",lp);
  445. fscanf(fp,"%s",lp);
  446. SetDlgItemText(IDC_RTPBASE, lp);
  447. fscanf(fp,"%s",lp);
  448. fscanf(fp,"%s",lp);
  449. SetDlgItemText(IDC_RTPMAX, lp);
  450. //Test Save Results
  451. fscanf(fp,"%s",lp); //for Test_Save_Results
  452. fscanf(fp,"%s",lp);
  453. fscanf(fp,"%s",lp);
  454.     t=atoi(lp);
  455. CheckDlgButton(IDC_TESTSAVE,t);
  456. //Audio Options
  457. fscanf(fp,"%s",lp); //for Audio_options
  458. fscanf(fp,"%s",lp);
  459. fscanf(fp,"%s",lp);
  460.     t=atoi(lp);
  461. CheckDlgButton(IDC_SILENCEDETECTION,t);
  462. fscanf(fp,"%s",lp);
  463. fscanf(fp,"%s",lp);
  464. SetDlgItemText(IDC_AUDIOCODEC, lp);
  465. fscanf(fp,"%s",lp);
  466. fscanf(fp,"%s",lp);
  467. SetDlgItemText(IDC_JITTERBUFFER, lp);
  468. //Video Options
  469. fscanf(fp,"%s",lp); //for Video_options
  470. fscanf(fp,"%s",lp);
  471. fscanf(fp,"%s",lp);
  472. SetDlgItemText(IDC_VIDEODEVICE, lp);
  473. fscanf(fp,"%s",lp);
  474. fscanf(fp,"%s",lp);
  475. SetDlgItemText(IDC_FORMAT, lp);
  476. fscanf(fp,"%s",lp);
  477. fscanf(fp,"%s",lp);
  478.     t=atoi(lp);
  479. if(t==1){
  480. CheckRadioButton(IDC_TRNONE,IDC_TRLARGE,IDC_TRNONE);
  481. fscanf(fp,"%s",lp);
  482. fscanf(fp,"%s",lp);
  483. }
  484. else{
  485. fscanf(fp,"%s",lp);
  486. fscanf(fp,"%s",lp);
  487. t=atoi(lp);
  488. if(t==1){
  489. CheckRadioButton(IDC_TRNONE,IDC_TRLARGE,IDC_TRSMALL);
  490. }
  491. else{
  492. CheckRadioButton(IDC_TRNONE,IDC_TRLARGE,IDC_TRLARGE);
  493. }
  494. }
  495. fscanf(fp,"%s",lp);
  496. fscanf(fp,"%s",lp);//these 2 for the last radio button which we dont read
  497. fscanf(fp,"%s",lp);//Configure_Plots
  498. fscanf(fp,"%s",lp);
  499. fscanf(fp,"%s",lp);
  500. laG=CString(lp);
  501. fscanf(fp,"%s",lp);
  502. fscanf(fp,"%s",lp);
  503. laA=CString(lp);
  504. fscanf(fp,"%s",lp);
  505. fscanf(fp,"%s",lp);
  506. laU=CString(lp);
  507. fscanf(fp,"%s",lp);
  508. fscanf(fp,"%s",lp);
  509. loG=CString(lp);
  510. fscanf(fp,"%s",lp);
  511. fscanf(fp,"%s",lp);
  512. loA=CString(lp);
  513. fscanf(fp,"%s",lp);
  514. fscanf(fp,"%s",lp);
  515. loU=CString(lp);
  516. fscanf(fp,"%s",lp);
  517. fscanf(fp,"%s",lp);
  518. jiG=CString(lp);
  519. fscanf(fp,"%s",lp);
  520. fscanf(fp,"%s",lp);
  521. jiA=CString(lp);
  522. fscanf(fp,"%s",lp);
  523. fscanf(fp,"%s",lp);
  524. jiU=CString(lp);
  525. fclose(fp);
  526. }
  527. void CDlgSettings::OnQualitymarkers() 
  528. {
  529. // TODO: Add your control notification handler code here
  530.     CDialog * configDlg = new CConfigurePlots();
  531. configDlg->Create( IDD_CONFIGURE_PLOTS , NULL );
  532.     configDlg->ModifyStyleEx( 0 , WS_EX_APPWINDOW );
  533.     configDlg->ShowWindow( SW_SHOW );
  534. }
  535. void CDlgSettings::OnKillfocusJitterbuffer() 
  536. {
  537. // TODO: Add your control notification handler code here
  538. CString lp;
  539. GetDlgItemText(IDC_JITTERBUFFER, lp);
  540. int t=atoi(lp);
  541. if(t<20){
  542. MessageBox("Jitter Buffer should have a value between 20ms to 1s");
  543.         SetDlgItemText(IDC_JITTERBUFFER, "20");
  544. }
  545. else if (t>1000){
  546. MessageBox("Jitter Buffer should have a value between 20ms to 1s");
  547. SetDlgItemText(IDC_JITTERBUFFER, "20");
  548. }
  549. }