void CRunMapExpertDlg::AddCommand(int iIndex, PCCOMMAND pCommand)
{
	// add a command to the list at the index specified in iIndex (-1 to add
	//  at end of list.) 
	CString str;
	str.Format("%s %s", GetCmdString(pCommand), pCommand->szParms);
	iIndex = m_cCommandList.InsertString(iIndex, str);
	m_cCommandList.SetItemDataPtr(iIndex, PVOID(pCommand));
}
Esempio n. 2
0
void CCustomCommandDialog::ReloadCmdStrings() 
{
	CWMouseXPDlg* wmxp = CWMouseXPDlg::curInstance;

	m_Num1.SetWindowText( GetCmdString(wmxp->iNumpadCmdMap[ENum1],wmxp->iNumpadModifiers[ENum1]) ) ;
	m_Num2.SetWindowText( GetCmdString(wmxp->iNumpadCmdMap[ENum2],wmxp->iNumpadModifiers[ENum2]) ) ;
	m_Num3.SetWindowText( GetCmdString(wmxp->iNumpadCmdMap[ENum3],wmxp->iNumpadModifiers[ENum3]) ) ;
	m_Num4.SetWindowText( GetCmdString(wmxp->iNumpadCmdMap[ENum4],wmxp->iNumpadModifiers[ENum4]) ) ;
	m_Num5.SetWindowText( GetCmdString(wmxp->iNumpadCmdMap[ENum5],wmxp->iNumpadModifiers[ENum5]) ) ;
	m_Num6.SetWindowText( GetCmdString(wmxp->iNumpadCmdMap[ENum6],wmxp->iNumpadModifiers[ENum6]) ) ;
	m_Num7.SetWindowText( GetCmdString(wmxp->iNumpadCmdMap[ENum7],wmxp->iNumpadModifiers[ENum7]) ) ;
	m_Num8.SetWindowText( GetCmdString(wmxp->iNumpadCmdMap[ENum8],wmxp->iNumpadModifiers[ENum8]) ) ;
	m_Num9.SetWindowText( GetCmdString(wmxp->iNumpadCmdMap[ENum9],wmxp->iNumpadModifiers[ENum9]) ) ;
	m_NumStar.SetWindowText( GetCmdString(wmxp->iNumpadCmdMap[ENumStar],wmxp->iNumpadModifiers[ENumStar]) ) ;
	m_Num0.SetWindowText( GetCmdString(wmxp->iNumpadCmdMap[ENum0],wmxp->iNumpadModifiers[ENum0]) ) ;
	m_NumHash.SetWindowText( GetCmdString(wmxp->iNumpadCmdMap[ENumHash],wmxp->iNumpadModifiers[ENumHash]) ) ;
}
Esempio n. 3
0
BOOL MfcIssueCmd(int inst_no, MFC_CODECMODE codec_mode, MFC_COMMAND mfc_cmd)
{
	unsigned int intr_reason;

	vir_pMFC_SFR->RUN_INDEX     = inst_no;

	if (codec_mode == H263_DEC) {
		vir_pMFC_SFR->RUN_COD_STD	= MP4_DEC;
	} else if (codec_mode == H263_ENC) {
		vir_pMFC_SFR->RUN_COD_STD	= MP4_ENC;
	} else {
		vir_pMFC_SFR->RUN_COD_STD   = codec_mode;
	}
		
	switch (mfc_cmd) 
	{
	case PIC_RUN:

		vir_pMFC_SFR->RUN_CMD       = mfc_cmd;

		intr_reason = WaitInterruptNotification();
		if (intr_reason == WAIT_INT_NOTI_TIMEOUT) {
			LOG_MSG(LOG_ERROR, "LOG_ERROR", "MfcIssueCmd CMD = %s, WaitInterruptNotification returns TIMEOUT.\n", GetCmdString(mfc_cmd));
			return FALSE;
		}
		if (intr_reason & 0xC000) {
			LOG_MSG(LOG_ERROR, "LOG_ERROR", "MfcIssueCmd CMD = %s, BUFFER EMPTY interrupt was raised.\n", GetCmdString(mfc_cmd));
			return FALSE;
		}
		break;

	case SEQ_INIT:
		vir_pMFC_SFR->RUN_CMD       = mfc_cmd;

		intr_reason = WaitInterruptNotification();
		if (intr_reason == WAIT_INT_NOTI_TIMEOUT) {
			LOG_MSG(LOG_ERROR, "LOG_ERROR", "MfcIssueCmd CMD = %s, WaitInterruptNotification returns TIMEOUT.\n", GetCmdString(mfc_cmd));
			return FALSE;
		}
		if (intr_reason & 0xC000) {
			LOG_MSG(LOG_ERROR, "LOG_ERROR", "MfcIssueCmd CMD = %s, BUFFER EMPTY interrupt was raised.\n", GetCmdString(mfc_cmd));
			return FALSE;
		}
		break;

	
	case SEQ_END:
		vir_pMFC_SFR->RUN_CMD       = mfc_cmd;
		
		intr_reason = WaitInterruptNotification();
		if (intr_reason == WAIT_INT_NOTI_TIMEOUT) {
			LOG_MSG(LOG_ERROR, "LOG_ERROR", "MfcIssueCmd CMD = %s, WaitInterruptNotification returns TIMEOUT.\n", GetCmdString(mfc_cmd));
			return FALSE;
		}
		if (intr_reason & 0xC000) {
			LOG_MSG(LOG_ERROR, "LOG_ERROR", "MfcIssueCmd CMD = %s, BUFFER EMPTY interrupt was raised.\n", GetCmdString(mfc_cmd));
			return FALSE;
		}
		break;
		
	default:
		if (WaitForReady() == FALSE) {
			LOG_MSG(LOG_ERROR, "LOG_ERROR", "MfcIssueCmd CMD = %s, BitProcessor is busy before issuing the command.\n", GetCmdString(mfc_cmd));
			return FALSE;
		}

		vir_pMFC_SFR->RUN_CMD       = mfc_cmd;
	
		WaitForReady();
			
	} 

	return TRUE;
}
void CRunMapExpertDlg::OnSelchangeCommandlist() 
{
	int iIndex = -1;

	// change the selection in the command list - update the command
	//  and parameters edit boxes
	PCCOMMAND pCommand = GetCommandAtIndex(&iIndex);
	
	// enable/disable controls
	BOOL bEnable = pCommand ? TRUE : FALSE;
	int iEnableCmds[] =
	{
		// edit fields:
		IDC_COMMAND,
		IDC_PARAMETERS,
		IDC_ENSUREFN,

		// checkboxes/buttons:
		IDC_ENSURECHECK,
		IDC_USEPROCESSWND,
		IDC_INSERTPARM,
		IDC_BROWSECOMMAND,

		-1
	};

	m_bNoUpdateCmd = TRUE;
	for(int i = 0; iEnableCmds[i] != -1; i++)
	{
		CWnd *pWnd = GetDlgItem(iEnableCmds[i]);
		pWnd->EnableWindow(bEnable);
		if(bEnable == FALSE)
		{
		// ensure fields are cleared if we're disabling them
			if(i < 3)
				pWnd->SetWindowText("");
			else
				((CButton*)pWnd)->SetCheck(0);
		}
	}
	m_bNoUpdateCmd = FALSE;

	if(!pCommand)
		return;

	// set moveup/movedown buttons
	m_cMoveUp.EnableWindow(iIndex != 0);
	m_cMoveDown.EnableWindow(iIndex != m_cCommandList.GetCount() - 1);
	
	m_bNoUpdateCmd = TRUE;

	m_cCommand.SetWindowText(GetCmdString(pCommand));
	m_cParameters.SetWindowText(pCommand->szParms);
	m_cEnsureCheck.SetCheck(pCommand->bEnsureCheck);
	m_cEnsureFn.SetWindowText(pCommand->szEnsureFn);		
	m_cUseProcessWnd.SetCheck(pCommand->bUseProcessWnd);
	// don't forget to call this:
		OnEnsurecheck();

	m_bNoUpdateCmd = FALSE;
}