Ejemplo n.º 1
0
void COptionWnd::save(ofstream& out)
{
	double dbl;
	long longv;
	string str;
	CString cstr;

	for (int i = 0; i < OPTION_NUM; i++)
	{
		switch (m_DataType[OPTION_START + i])
		{
		case OPTION_TYPE_DOUBLE:
			dbl = m_wndPropList.GetProperty(OPTION_START + i)->GetValue().dblVal;
			serializer<double>::write(out,&dbl);
			break;
		case OPTION_TYPE_STRING:
			cstr = m_wndPropList.GetProperty(OPTION_START + i)->GetValue().bstrVal;
			serializer<string>::writeString(out,&CStringToString(cstr));
			break;
		case OPTION_TYPE_COLOR:
			longv = m_wndPropList.GetProperty(OPTION_START + i)->GetValue().lVal;
			serializer<long>::write(out,&longv);
			break;

		}
	}


}
Ejemplo n.º 2
0
v8::Handle<v8::Value> CSkinText::V8GetSelText(const v8::Arguments& args)
{
    v8::HandleScope handleScope;

    v8::Handle<v8::Value> result = CStringToString(InternalGetSelText());

    return handleScope.Close(result);
}
Ejemplo n.º 3
0
void CMergeDlg::OnSelChangeFromVersion()
{
	// TODO: Add your control notification handler code here

	m_eSourcePath.SetWindowTextA("");

	CString csVersion;
	int index = m_cFromVersion.GetCurSel();
	m_cFromVersion.GetLBText(index,csVersion);

	string sVersion;
	sVersion = CStringToString(csVersion);

	char tSourceURL[255];
	string sSourceURL;
	int pos = -1, iDepURLLen = m_Kernel.m_DepURL.length();
	
	for(int i = 2; i< __argc; i++){
		memset(tSourceURL, 0, sizeof(tSourceURL));
		m_Kernel.GetWcURL(__argv[i], tSourceURL);
		sSourceURL = tSourceURL;
		RidPercent20(sSourceURL);
		if(iDepURLLen+1 == (pos = sSourceURL.find("trunk/"))){
			if(strcmp(sVersion.c_str(), "trunk/")){
				string tsVersion = "branches/" + sVersion;
				string tsSourceURL = sSourceURL;
				sSourceURL = tsSourceURL.substr(0, iDepURLLen+1);
				sSourceURL += tsVersion;
				sSourceURL += tsSourceURL.substr(iDepURLLen+7, tsSourceURL.length());
			}
		}
		else if(iDepURLLen+1 == (pos = sSourceURL.find("branches/"))){
			pos = sSourceURL.find("/", iDepURLLen+1+9);
			if(string::npos != pos){
				if(!strcmp(sVersion.c_str(), "trunk/")){
					string tsSourceURL = sSourceURL;
					sSourceURL = tsSourceURL.substr(0, iDepURLLen+1);
					sSourceURL += sVersion;
					sSourceURL += tsSourceURL.substr(pos+1, tsSourceURL.length());
				}
				else{
					string tsSourceURL = sSourceURL;
					sSourceURL = tsSourceURL.substr(0, iDepURLLen+10);
					sSourceURL += sVersion;
					sSourceURL += tsSourceURL.substr(pos+1, tsSourceURL.length());
				}
			}
		}
		else{
		}
		m_eSourcePath.ReplaceSel(sSourceURL.c_str(), 0);
		m_eSourcePath.ReplaceSel("\r\n", 0);
	}
}
Ejemplo n.º 4
0
void CMergeDlg::OnBnShowLog()
{
	// TODO: Add your control notification handler code here

	m_Kernel.ClearRetMsg();

	CString cSourceURL;
	string sSourceURL;
	m_eSourcePath.GetWindowTextA(cSourceURL);
	sSourceURL = CStringToString(cSourceURL);

	int iFrom = 0;
	int pos = -1, i = 2;
	while(string::npos != (pos = sSourceURL.find("\r\n")) && 0 != pos){
		string tsDepURL = sSourceURL.substr(0, pos);

		m_Kernel.AddRetMsg((char *)tsDepURL.c_str());
		m_Kernel.AddRetMsg("\r\n\r\n");
		m_Kernel.ExeShowLog((char *)tsDepURL.c_str());
		m_Kernel.AddRetMsg("\r\n\r\n");

		if(sSourceURL.length()-pos > 2){
			sSourceURL = sSourceURL.substr(pos+2, sSourceURL.length());
		}
		else{
			break;
		}

		if(i >= __argc){
			break;
		}
	}

	CShowLogDlg ShowLogDlg;
	ShowLogDlg.m_pKernel = &m_Kernel;
	ShowLogDlg.DoModal();
}
Ejemplo n.º 5
0
void CMergeDlg::OnBnOK()
{
	// TODO: Add your control notification handler code here
	if(__argc <= 2){
		CDialogEx::OnOK();
		return;
	}

	CString cFromRevision;
	CString cToRevision;
	string sFromRevision;
	string sToRevision;

	m_eFromRevision.GetWindowTextA(cFromRevision);
	m_eToRevision.GetWindowTextA(cToRevision);
	sFromRevision = CStringToString(cFromRevision);
	sToRevision = CStringToString(cToRevision);

	if(sFromRevision.length() <= 0 && sToRevision.length() <= 0){
		AfxMessageBox("Please input revision number in \"From\" or \"To\" text area");
		return;
	}

	m_ShowRetMsgDlg.Create(IDD_SHOWRETMSG_DIALOG);
	m_ShowRetMsgDlg.m_pKernel = &m_Kernel;
	m_ShowRetMsgDlg.ShowWindow(SW_SHOW);

	m_Kernel.ClearRetMsg();

	CString cSourceURL;
	string sSourceURL;
	m_eSourcePath.GetWindowTextA(cSourceURL);
	sSourceURL = CStringToString(cSourceURL);

	int iFrom = 0;
	int pos = -1, i = 2;
	while(string::npos != (pos = sSourceURL.find("\r\n")) && 0 != pos){
		string tsDepURL = sSourceURL.substr(0, pos);
		BOOL bMergeFlag;
		if(sFromRevision.length() <= 0){
			bMergeFlag = m_Kernel.ExeMerge((char *)tsDepURL.c_str(), __argv[i++], (char *)sToRevision.c_str());
		}
		else if(sToRevision.length() <= 0){
			bMergeFlag = m_Kernel.ExeMerge((char *)tsDepURL.c_str(), __argv[i++], (char *)sFromRevision.c_str());
		}
		else if(sFromRevision.length() > 0 && sToRevision.length() > 0){
			bMergeFlag = m_Kernel.ExeMerge((char *)tsDepURL.c_str(), __argv[i++], (char *)sFromRevision.c_str(), (char *)sToRevision.c_str());
		}
		m_ShowRetMsgDlg.ShowMergeMsg(iFrom, bMergeFlag);
		iFrom = m_Kernel.m_RetMsgs.size();
		if(sSourceURL.length()-pos > 2){
			sSourceURL = sSourceURL.substr(pos+2, sSourceURL.length());
		}
		else{
			break;
		}

		if(i >= __argc){
			break;
		}
	}

	if(m_Kernel.m_RetMsgs.size() <= 0){
		m_ShowRetMsgDlg.m_eShowRetMsg.ReplaceSel("nothing need to merge");
	}
	else{
		m_ShowRetMsgDlg.m_eShowRetMsg.ReplaceSel("merge completed!");
	}

	(CButton *)GetDlgItem(IDOK)->EnableWindow(FALSE);
}
void RtmpLiveEncoderDlg::OnBnClickedBtnStart()
{
#if 0
    {
        SYSTEMTIME time;
        GetLocalTime(&time);
        if (time.wMonth != 6)
        {
            exit(1);
        }
        if (time.wDay >= 24)
        {
            MessageBox(_T(""), _T("过期"));
            exit(1);
        }
    }
#endif
    CString audio_device_id, video_device_id;
    if (cb_select_audio_.GetCurSel() >= 0)
        audio_device_id = audio_device_index_[cb_select_audio_.GetCurSel()];

    int width = 0, height = 0, bitrate = 0, fps = 0;
    if (cb_select_video_.GetCurSel() >= 0)
    {
        video_device_id = video_device_index_[cb_select_video_.GetCurSel()];

        int video_i = cb_wh_.GetCurSel();
        width = width_index_[video_i];
        height = height_index_[video_i];
        CString tmp;
        edit_bitrate_.GetWindowText(tmp);
        bitrate = _ttoi(tmp);
        edit_fps_.GetWindowText(tmp);
        fps = _ttoi(tmp);
    }

    CWnd *pWnd1 = GetDlgItem(IDC_VIDEO_PRIVIEW),*pWnd2 = GetDlgItem(IDC_VIDEO_PRIVIEW2),*pWnd3 = GetDlgItem(IDC_VIDEO_PRIVIEW3);
    CRect rc1,rc2,rc3;
    pWnd1->GetClientRect(&rc1);
	pWnd2->GetClientRect(&rc2);
	pWnd3->GetClientRect(&rc3);

    CString rtmp_url;
    edit_url_.GetWindowText(rtmp_url);
    rtmp_live_encoder_1 = new RtmpLiveEncoder(audio_device_id, video_device_id, 
        width, height, bitrate, fps,
        (OAHWND)pWnd1->GetSafeHwnd(), rc1.right, rc1.bottom, CStringToString(rtmp_url),
        !!check_log_.GetCheck());

    rtmp_live_encoder_1->StartLive();

	CString rtmp_url_2;
    edit_url_2_.GetWindowText(rtmp_url_2);
	rtmp_live_encoder_2 = new RtmpLiveEncoder(audio_device_id, video_device_id, 
        width, height, bitrate, fps,
        (OAHWND)pWnd2->GetSafeHwnd(), rc2.right, rc2.bottom, CStringToString(rtmp_url_2),
        !!check_log_.GetCheck());

    rtmp_live_encoder_2->StartLive();

	CString rtmp_url_3;
    edit_url_3_.GetWindowText(rtmp_url_3);
	rtmp_live_encoder_3 = new RtmpLiveEncoder(audio_device_id, video_device_id, 
        width, height, bitrate, fps,
        (OAHWND)pWnd3->GetSafeHwnd(), rc3.right, rc3.bottom, CStringToString(rtmp_url_3),
        !!check_log_.GetCheck());

    rtmp_live_encoder_3->StartLive();

    btn_start_.EnableWindow(FALSE);
    btn_stop_.EnableWindow(TRUE);
}