00001
00002
00003
00004 #include "stdafx.h"
00005 #include "TransClient.h"
00006 #include "ProfileDialog.h"
00007 #include "GlobalCon.h"
00008
00009 #ifdef _DEBUG
00010 #define new DEBUG_NEW
00011 #undef THIS_FILE
00012 static char THIS_FILE[] = __FILE__;
00013 #endif
00014
00016
00017
00018 CProfileDialog::CProfileDialog(CWnd* pParent , ClientProfile *profile)
00019 : CDialog(CProfileDialog::IDD, pParent)
00020 {
00021
00022 pProfile = profile;
00023 m_FrameSize = pProfile->FrameSize -2;
00024 m_Color = pProfile->color;
00025 m_FrameRate = pProfile->FrameRate;
00026 m_BitRate = pProfile->BitRate;
00027
00028
00029 }
00030
00031
00032 void CProfileDialog::DoDataExchange(CDataExchange* pDX)
00033 {
00034 CDialog::DoDataExchange(pDX);
00035
00036 DDX_Control(pDX, IDC_FR, m_FRCtrl);
00037 DDX_Radio(pDX, IDC_QCIF, m_FrameSize);
00038 DDX_Radio(pDX, IDC_COLOR, m_Color);
00039 DDX_Text(pDX, IDC_BITRATE, m_BitRate);
00040
00041 }
00042
00043
00044 BEGIN_MESSAGE_MAP(CProfileDialog, CDialog)
00045
00046
00047 END_MESSAGE_MAP()
00048
00050
00051
00052 void CProfileDialog::OnOK()
00053 {
00054
00055
00056 UpdateData(true);
00057 pProfile->FrameSize = m_FrameSize + 2;
00058 pProfile->color = (bool)m_Color;
00059 pProfile->BitRate = m_BitRate;
00060 switch(m_FRCtrl.GetCurSel())
00061 {
00062 case 0:
00063 pProfile->FrameRate = 5;
00064 break;
00065 case 1:
00066 pProfile->FrameRate = 10;
00067 break;
00068 case 2:
00069 pProfile->FrameRate = 15;
00070 break;
00071 case 3:
00072 pProfile->FrameRate = 20;
00073 break;
00074 case 4:
00075 pProfile->FrameRate = 25;
00076 break;
00077 case 5:
00078 pProfile->FrameRate = 30;
00079 break;
00080 default:
00081 pProfile->FrameRate = 30;
00082 break;
00083 }
00084
00085 CDialog::OnOK();
00086 }
00087
00088 BOOL CProfileDialog::OnInitDialog()
00089 {
00090 CDialog::OnInitDialog();
00091
00092
00093 switch (m_FrameRate)
00094 {
00095 case 5:
00096 m_FRCtrl.SetCurSel(0);
00097 break;
00098 case 10:
00099 m_FRCtrl.SetCurSel(1);
00100 break;
00101 case 15:
00102 m_FRCtrl.SetCurSel(2);
00103 break;
00104 case 20:
00105 m_FRCtrl.SetCurSel(3);
00106 break;
00107 case 25:
00108 m_FRCtrl.SetCurSel(4);
00109 break;
00110 case 30:
00111 m_FRCtrl.SetCurSel(5);
00112 break;
00113 default:
00114 m_FRCtrl.SetCurSel(-1);
00115 break;
00116 }
00117 return TRUE;
00118
00119 }
00120