Exemplo n.º 1
0
void CDlgRemotePanel::UpdateComponents()
{
	CRect	rcClient;
	GetClientRect(&rcClient);
	if (rcClient.IsRectEmpty())		return;

	CRect	rcVideo;
	rcVideo.SetRect(rcClient.left+VIDEO_WINDOW_BORDER_WIDTH, 0, rcClient.right-VIDEO_WINDOW_BORDER_WIDTH, rcClient.bottom-VIDEO_WINDOW_BORDER_WIDTH);
	__MOVE_WINDOW(pDlgVideo, rcVideo);
}
Exemplo n.º 2
0
void CDlgPanel::UpdateComponents()
{
	CRect	rcClient;
	GetClientRect(&rcClient);
	if (rcClient.IsRectEmpty())		return;

	int nTop = rcClient.top;
	int nLeft = rcClient.left;
	int nBottom = rcClient.bottom-30;
	int nRight = rcClient.right;
// 	//拉升视频窗口比例调整
// 	double dbWScale = (double)16/9;
// 	double dbHScale = (double)4/3;
// 	double dbRealScale = ((double)(rcClient.right-rcClient.left)/(double)(rcClient.bottom-30-rcClient.top));
// 	if (dbRealScale>dbWScale)
// 	{
// 		int nRealWidth = dbWScale*(rcClient.bottom-30-rcClient.top);
// 		nLeft = ((rcClient.right-rcClient.left)-nRealWidth)/2;
// 		nRight =  nRealWidth+nLeft;
// 	}
// 	else if (dbRealScale<dbHScale)
// 	{
// 		int nRealHeight = (rcClient.right-rcClient.left)/dbHScale;
// 		nTop = ((rcClient.bottom-30-rcClient.top)-nRealHeight)/2;
// 		nBottom =  nRealHeight+nTop;
// 	}
	CRect	rcVideo;
	rcVideo.SetRect(nLeft, nTop, nRight, nBottom);

	__MOVE_WINDOW(pDlgVideo, rcVideo);
	if (pDlgVideo)
	{
		pDlgVideo->Invalidate(FALSE);
	}
	int nStartH = rcClient.bottom-30;
	CRect rcCtrl;
	//类型选择
	rcCtrl.SetRect(30, nStartH+5, 30+60,  nStartH+5+25);
	__MOVE_WINDOW(m_pCmbType, rcCtrl);
	if (m_pCmbType)
	{
		m_pCmbType->SetFocus();
	}

	//源类型选择
	rcCtrl.SetRect(80+10, nStartH+5, 80+10+125,  nStartH+5+25);
	__MOVE_WINDOW(m_pCmbSourceType, rcCtrl);
	if (m_pCmbSourceType)
	{
		m_pCmbSourceType->SetFocus();
	}

	//Rtsp流地址
	rcCtrl.SetRect(180+40, nStartH+5, rcClient.right-42,  nStartH+5+25);
	__MOVE_WINDOW(m_pEdtRtspStream, rcCtrl);
	if (m_pEdtRtspStream)
	{
		m_pEdtRtspStream->SetFocus();
	}

	int nCmbWidth = (rcClient.right-10-215-42)/2;
	//Camera
	rcCtrl.SetRect(215+10, nStartH+5, 215+10+nCmbWidth,  nStartH+5+25);
	__MOVE_WINDOW(m_pCmbCamera, rcCtrl);
	if (m_pCmbCamera)
	{
		m_pCmbCamera->SetFocus();
	}
	//Capture Screen
	rcCtrl.SetRect(215+10, nStartH+5, 215+10+nCmbWidth,  nStartH+5+25);
	__MOVE_WINDOW(m_pCmbScreenMode, rcCtrl);
	if (m_pCmbScreenMode)
	{
		m_pCmbScreenMode->SetFocus();
	}
	
	//Mic
	rcCtrl.SetRect(215+10+nCmbWidth+5, nStartH+5, rcClient.right-42,  nStartH+5+25);
	__MOVE_WINDOW(m_pCmbMic, rcCtrl);
	if (m_pCmbMic)
	{
		m_pCmbMic->SetFocus();
	}

	rcCtrl.SetRect(rcClient.right-41, nStartH+3, rcClient.right-2,  nStartH+3+24);
	if (m_btnStart.GetSafeHwnd())
	{
		m_btnStart.MoveWindow(rcCtrl);
	}

// 	//EasyDarwin服务器推送参数设置
// 	//IP
// 	rcCtrl.SetRect(10+150, nStartH+36, rcClient.right-200,  nStartH+36+25);
// 	__MOVE_WINDOW(m_pEdtServerIP, rcCtrl);
// 
// 	//Port
// 	rcCtrl.SetRect(rcClient.right-200+36, nStartH+40, rcClient.right-200+80,  nStartH+36+25);
// 	__MOVE_WINDOW(m_pEdtServerPort, rcCtrl);
// 	//Stream
// 	rcCtrl.SetRect(rcClient.right-200+130, nStartH+36, rcClient.right-10,  nStartH+36+25);
// 	__MOVE_WINDOW(m_pEdtServerStream, rcCtrl);

	Invalidate(FALSE);

}
Exemplo n.º 3
0
//´°¿ÚŲ¶¯Î»ÖÃ
void	CEasyClientDlg::UpdateComponents()
{

	CRect	rcClient;
	GetClientRect(&rcClient);
	if (rcClient.IsRectEmpty())		
		return;	
	
	CComboBox* pComboxMediaSource = (CComboBox*)GetDlgItem(IDC_COMBO_SOURCE);
	CComboBox* pVideoCombo = (CComboBox*)GetDlgItem(IDC_COMBO_CAMERA) ;
	CComboBox* pComboxAudioSource = (CComboBox*)GetDlgItem(IDC_COMBO_MIC) ;
	CEdit* pEdtRtspSource = (CEdit*)GetDlgItem(IDC_EDIT_SREAM_URL);



	CStatic* pStcServerIp = (CStatic*)GetDlgItem(IDC_STC_SERVER_IP);
	CStatic* pStcServerPort = (CStatic*)GetDlgItem(IDC_STC_SERVER_PORT);
	CStatic* pStcStreanName = (CStatic*)GetDlgItem(IDC_STC_STREAM_NAME);
	CStatic* pStcDebugInfo = (CStatic*)GetDlgItem(IDC_STC_DEBUG_INFO);
	CStatic* pStcVersionInfo = (CStatic*)GetDlgItem(IDC_STC_VERSION);

	
	
	CEdit* pIP = (CEdit*)GetDlgItem(IDC_EDIT_SERVER_IP);
	CEdit* pPort = (CEdit*)GetDlgItem(IDC_EDIT_SERVER_PORT);
	CEdit* pName = (CEdit*)GetDlgItem(IDC_EDIT_PUSH_NAME);

	CButton* pBtnCapture = (CButton*)GetDlgItem(IDC_BTN_CAPTURE);
	CButton* pBtnPush = (CButton*)GetDlgItem(IDC_BTN_PUSH);
	CButton* pBtnPlay = (CButton*)GetDlgItem(IDC_BTN_PLAY);

	CEdit* pEdtShowLog = (CEdit*)GetDlgItem(IDC_EDIT_SHOWLOG);


	CRect rcPosition;

	int nWidth = rcClient.Width();
	int nHeight = rcClient.Height();
	int nStartX = (nWidth-210*3-140*2)/2;


	rcPosition.SetRect(nStartX , nHeight-280+15, nStartX + 100, nHeight-280+15+24 );
	__MOVE_WINDOW(pStcServerIp, rcPosition);
	rcPosition.SetRect(nStartX + 100 + 5, nHeight-280+15, nStartX + 210, nHeight-280+15+24 );
	__MOVE_WINDOW(pIP, rcPosition);

	rcPosition.SetRect(nStartX +210 +140, nHeight-280+15, nStartX + 210+140+100, nHeight-280+15+24 );
	__MOVE_WINDOW(pStcServerPort, rcPosition);
	rcPosition.SetRect(nStartX +210 +140 + 90 +5, nHeight-280+15, nStartX +210+140 + 210, nHeight-280+15+24 );
	__MOVE_WINDOW(pPort, rcPosition);

	rcPosition.SetRect(nStartX + (210 +140)*2+40, nHeight-280+15, nStartX + (210 +140)*2+100, nHeight-280+15+24 );
	__MOVE_WINDOW(pStcStreanName, rcPosition);
	rcPosition.SetRect(nStartX + (210 +140)*2 + 90+5, nHeight-280+15, nStartX + (210 +140)*2 + 210, nHeight-280+15+24 );
	__MOVE_WINDOW(pName, rcPosition);

	int nBtnStartX =  (rcClient.Width()-74*3-200*2)/2;
	rcPosition.SetRect(nBtnStartX , nHeight-280+24+25, nBtnStartX + 74, nHeight-280+25+24+24 );
	__MOVE_WINDOW(pBtnCapture, rcPosition);

	rcPosition.SetRect(nBtnStartX+74+200 , nHeight-280+24+25, nBtnStartX+74+200 + 74, nHeight-280+25+24+24 );
	__MOVE_WINDOW(pBtnPush, rcPosition);
	
	rcPosition.SetRect(nBtnStartX+(74+200)*2 , nHeight-280+24+25, nBtnStartX+(74+200)*2  + 74, nHeight-280+25+24+24 );
	__MOVE_WINDOW(pBtnPlay, rcPosition);


	rcPosition.SetRect(10, nHeight-280+24+25+20, 100, nHeight-280+24+25+20+24 );
	__MOVE_WINDOW(pStcDebugInfo, rcPosition);
	
	rcPosition.SetRect(10 , nHeight-280+24+25+44,  nWidth-10, nHeight-30 );
	__MOVE_WINDOW(pEdtShowLog, rcPosition);

	
	rcPosition.SetRect(nWidth-420 , nHeight-25,  nWidth, nHeight );
	__MOVE_WINDOW(pStcVersionInfo, rcPosition);

	int iPanelWidth = ((rcClient.Width()) / 2);


	CRect	rcLocalPanel;
	rcLocalPanel.SetRect(rcClient.left, rcClient.top+65, rcClient.left+iPanelWidth, rcClient.bottom-280);
	__MOVE_WINDOW(easyVideoPanelObj.pDlgLocalPanel, rcLocalPanel);

	CRect	rcRemotePanel;
	rcRemotePanel.SetRect(rcLocalPanel.right, rcLocalPanel.top, rcClient.right, rcLocalPanel.bottom);
	__MOVE_WINDOW(easyVideoPanelObj.pDlgRemotePanel, rcRemotePanel);
	Invalidate();
}