Main Page | File List

ProfileDialog.cpp

00001 // ProfileDialog.cpp : implementation file
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 // CProfileDialog dialog
00017 
00018 CProfileDialog::CProfileDialog(CWnd* pParent /*=NULL*/, ClientProfile *profile)
00019         : CDialog(CProfileDialog::IDD, pParent)
00020 {
00021         //{{AFX_DATA_INIT(CProfileDialog)
00022         pProfile = profile;
00023         m_FrameSize = pProfile->FrameSize -2; // 0 -- QCIF;  1 -- CIF;
00024         m_Color = pProfile->color;         // 0 -- No Color;   1 -- Color;
00025         m_FrameRate = pProfile->FrameRate; 
00026         m_BitRate = pProfile->BitRate;
00027         
00028         //}}AFX_DATA_INIT
00029 }
00030 
00031 
00032 void CProfileDialog::DoDataExchange(CDataExchange* pDX)
00033 {
00034         CDialog::DoDataExchange(pDX);
00035         //{{AFX_DATA_MAP(CProfileDialog)
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         //}}AFX_DATA_MAP
00041 }
00042 
00043 
00044 BEGIN_MESSAGE_MAP(CProfileDialog, CDialog)
00045         //{{AFX_MSG_MAP(CProfileDialog)
00046         //}}AFX_MSG_MAP
00047 END_MESSAGE_MAP()
00048 
00050 // CProfileDialog message handlers
00051 
00052 void CProfileDialog::OnOK() 
00053 {
00054         // TODO: Add extra validation here
00055         
00056         UpdateData(true);
00057         pProfile->FrameSize = m_FrameSize + 2; //2 -- QCIF, 3 -- CIF
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         // TODO: Add extra initialization here
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;  // return TRUE unless you set the focus to a control
00118                       // EXCEPTION: OCX Property Pages should return FALSE
00119 }
00120 

Generated on Mon May 8 22:27:08 2006 by  doxygen 1.3.9.1