virtual ~MusicRenderCache() { ClearEvents(); for (auto it = _events.begin(); it != _events.end(); ++it) { delete *it; } _events.clear(); };
void CVision::DoProcessing() { // Check memory boundaries. CVisBufferManager::Instance()->CheckMemoryBoundaries(); // Clear all events ClearEvents(); // Propagate Time m_compDemoSorterClassifier.SetCurrentImageTime( m_unCurrentImageTime ); // Grab the frame m_compFrameGrabber.DoProcessing(); m_compClip.DoProcessing(); // Distinguish whether we're in idle, service, calibration or classification mode. switch ( m_vmMode ) { case VM_IDLE: break; case VM_SERVICE: break; case VM_CALIBRATION: m_compModelVisualizer.DoProcessing(); break; case VM_CLASSIFICATION: m_compRGBToGray.DoProcessing(); m_compThreshold.DoProcessing(); /* m_compMorphology.DoProcessing(); m_compKeypointsCut.DoProcessing(); */ m_compLabel.DoProcessing(); m_compColorPick.DoProcessing(); m_compDemoSorterClassifier.DoProcessing(); #ifdef _WINDOWS m_compLabelVisualizer.DoProcessing(); m_compColorVisualizer.DoProcessing(); #endif // Generate events, if there were objects. if ( m_compDemoSorterClassifier.GetNumObjectsFound() > 0 ) SetEvent( VE_OBJECTS_FOUND ); break; } #ifdef _WINDOWS_ m_compModelVisualizer.DoProcessing(); #endif }
void CEventManager::Shutdown() { ClearEvents(); EventIter pIter = m_cListeners.begin(); while(pIter != m_cListeners.end()) { MMDELEVENT(pIter->second); ++pIter; } m_cListeners.clear(); }
CEventMgr::~CEventMgr() { try { m_pUserData = NULL; m_fnEventCallBack = NULL; StopEventProcess(); ClearEvents(); DESTROY_MUTEX(m_MutexEventQueue); } catch (...) { } }//lint !e1579
bool OnSipTapi::Connect(LoginInfo& loginInfo,ConnectionError* ce) { Logger::log_debug(_T("OnSipTapi::Connect enter")); // Clear out any current events and state ClearEvents(); // Async call *ce = Start(loginInfo); if ( *ce != ConnNoError ) { Logger::log_error( _T("OnSipTapi::Connect exiting, error connect=%d"), ce ); // TODO: Set reason why? Invalid Logon? etc?? return false; } Logger::log_debug(_T("OnSipTapi::Connect exit success")); return true; }
VOID TDIH_Unload( IN PDRIVER_OBJECT DriverObject ) { PDEVICE_OBJECT DeviceObject; PDEVICE_OBJECT OldDeviceObject; PTDIH_DeviceExtension pTDIH_DeviceExtension; DBGPRINT("DriverEntry unLoading...\n"); DeviceObject = DriverObject->DeviceObject; //卸载信息输出模块 DebugPrintClose(); while (DeviceObject != NULL) { OldDeviceObject = DeviceObject; pTDIH_DeviceExtension = (PTDIH_DeviceExtension )DeviceObject->DeviceExtension; if( pTDIH_DeviceExtension->NodeType == TDIH_NODE_TYPE_TCP_FILTER_DEVICE ) { TCPFilter_Detach( DeviceObject ); } else if(pTDIH_DeviceExtension->NodeType == TDIH_NODE_TYPE_UDP_FILTER_DEVICE ) { UDPFilter_Detach( DeviceObject ); } else { IoDeleteDevice(OldDeviceObject); } DeviceObject = DeviceObject->NextDevice; } //删除事件链表缓冲区 ClearEvents(); }
void AIBrainState::EndState( AIBrainState* nextState ) { CustomEndState( nextState ); ClearEvents(); }
//------------------------------------------------------------ myTimer::~myTimer() { Debug deb("~myTimer()"); ClearEvents(); }
CDisplayOutput::~CDisplayOutput() { ClearEvents(); }
//************************************************************************************ bool CCreditsScreen::SetForActivate() //Called before screen is activated and first paint. // //Returns: //True if activation should continue, false if not. { HideCursor(); //Return to title screen when done. g_pTheSM->ClearReturnScreens(); g_pTheSM->InsertReturnScreen(SCR_Title); g_pTheSound->PlaySong(SONGID_CREDITS); //Fix up scrolling text widget state in case screen was activated before. this->pScrollingText->SetBackground(this->images[0]); this->pScrollingText->ClearText(); this->pScrollingText->ScrollAbsolute(0,0); this->pScrollingText->Show(); //For face image display preparation. CFaceWidget *pFaceWidget = new CFaceWidget(0, 0, 0, CX_FACE, CY_FACE); AddWidget(pFaceWidget, true); //Add some text to the scrolling text widget. # define A_TEXT(mid) \ this->pScrollingText->AddText(g_pTheDB->GetMessageText(mid), F_CreditsText);\ this->pScrollingText->AddText(wszCRLF, F_CreditsText) //Add a contributor header. # define A_CONTRIBUTOR_NAMEONLY(midName) \ this->pScrollingText->AddText(g_pTheDB->GetMessageText(midName), F_CreditsHeader, CLabelWidget::TA_CenterGroup) \ # define A_CONTRIBUTOR(midName, midC) \ this->pScrollingText->AddText(g_pTheDB->GetMessageText(midName), F_CreditsHeader, CLabelWidget::TA_CenterGroup); \ this->pScrollingText->AddText(g_pTheDB->GetMessageText(midC), F_CreditsSubheader, CLabelWidget::TA_CenterGroup) \ //Add optional face image below name. # define A_FACEIMAGE(eSpeaker) { \ SDL_Surface *pFaceSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, CX_FACE, CY_FACE, g_pTheBM->BITS_PER_PIXEL, 0, 0, 0, 0); \ pFaceWidget->SetDestSurface(pFaceSurface); \ pFaceWidget->SetCharacter(eSpeaker, false); \ pFaceWidget->Paint(); \ CImageWidget *pImage = new CImageWidget(0, (this->pScrollingText->GetW()-CX_FACE)/2, 0, pFaceSurface); \ this->pScrollingText->Add(pImage); } A_TEXT(MID_CreditsIntro); A_CONTRIBUTOR(MID_ErikH, MID_ErikH_C); A_FACEIMAGE(Speaker_Beethro); A_TEXT(MID_ErikH_Text); A_CONTRIBUTOR(MID_MikeR, MID_MikeR_C); A_FACEIMAGE(Speaker_Halph); A_TEXT(MID_MikeR_Text); A_CONTRIBUTOR(MID_MattS, MID_MattS_C); A_FACEIMAGE(Speaker_Stalwart); A_TEXT(MID_MattS_Text); A_CONTRIBUTOR(MID_JacobG, MID_JacobG_C); A_FACEIMAGE(Speaker_RockGiant); A_TEXT(MID_JacobG_Text); A_CONTRIBUTOR(MID_TerenceF, MID_TerenceF_C); A_FACEIMAGE(Speaker_Brain); A_TEXT(MID_TerenceF_Text); A_CONTRIBUTOR(MID_LarryM_HenriK, MID_LarryM_HenriK_C); A_FACEIMAGE(Speaker_Aumtlich); A_TEXT(MID_LarryM_HenriK_Text); A_CONTRIBUTOR(MID_JonS, MID_JonS_C); A_FACEIMAGE(Speaker_RockGolem); A_TEXT(MID_JonS_Text); A_CONTRIBUTOR(MID_GerryJ, MID_GerryJ_C); A_FACEIMAGE(Speaker_GoblinKing); A_TEXT(MID_GerryJ_Text); A_CONTRIBUTOR(MID_LoganW, MID_LoganW_C); A_FACEIMAGE(Speaker_Gunthro); A_TEXT(MID_LoganW_Text); A_CONTRIBUTOR(MID_EytanZ, MID_EytanZ_C); A_FACEIMAGE(Speaker_TarTechnician); A_TEXT(MID_EytanZ_Text); A_CONTRIBUTOR(MID_NeilF, MID_NeilF_C); A_FACEIMAGE(Speaker_Citizen2); A_TEXT(MID_NeilF_Text); A_CONTRIBUTOR(MID_BrettB, MID_BrettB_C); A_FACEIMAGE(Speaker_Citizen3); A_TEXT(MID_BrettB_Text); A_CONTRIBUTOR(MID_WaiL, MID_WaiL_C); A_FACEIMAGE(Speaker_Citizen1); A_TEXT(MID_WaiL_Text); A_CONTRIBUTOR(MID_JenniferL, MID_JenniferL_C); A_FACEIMAGE(Speaker_Citizen4); A_TEXT(MID_JenniferL_Text); A_CONTRIBUTOR_NAMEONLY(MID_VoiceTalent); A_FACEIMAGE(Speaker_Negotiator); A_TEXT(MID_VoiceTalent_Text); A_CONTRIBUTOR(MID_LevelDescriptionWriters, MID_LevelDescriptionWriters_C); A_FACEIMAGE(Speaker_Citizen); A_TEXT(MID_LevelDescriptionWriters_Text); A_CONTRIBUTOR(MID_Testers, MID_Testers_C); A_FACEIMAGE(Speaker_Slayer2); A_TEXT(MID_Testers_Text); A_TEXT(MID_CreditsLastWords); A_TEXT(MID_CreditsTheEnd); #undef A_TEXT #undef A_CONTRIBUTOR #undef A_FACEIMAGE RemoveWidget(pFaceWidget); ClearEvents(); //don't let an extra keypress during transition cause quick exit return true; }
// Connect and do initialize of the IniStateMachine, e.g. full connect, authorize, and enable call events. // Returns false if error. // loginInfo = login information // hDevStop = event handle to check if to exit immediately // stateType = return state type of initialize state machine, specifies whether error due to disconnected, fatal (e.g. authorize), etc. bool OnSipTapi::InitOnSipTapi(LoginInfo& loginInfo,HANDLE hDevStop,OnSipInitStatesType::InitStatesType* stateType) { *stateType = OnSipInitStatesType::NOTSET; // Try first Connect to XMPP ConnectionError ce; if ( !Connect(loginInfo,&ce) ) { // See if fatal type of error, such as authorize, etc. // Else, assume just normal DISCONNECT error if ( ce == ConnAuthenticationFailed || ce == ConnOutOfMemory ) *stateType = OnSipInitStatesType::FATAL; else *stateType = OnSipInitStatesType::DISCONNECTED; // Signal OpenDevice thread that we have done our initial connect Logger::log_error(_T("OnSipTapi::InitOnSipTapi Connect error, exiting. ce=%d. stateType=%s"),ce, OnSipInitStatesType::InitStatesTypeToString(*stateType)); return false; } Logger::log_debug(_T("OnSipTapi::ConnectionThread poll for init")); // Wait for initial connect... while ( true ) { // See if requested to exit by main thread if ( WaitForSingleObject(hDevStop, 0) != WAIT_TIMEOUT ) { *stateType = OnSipInitStatesType::FATAL; Logger::log_error(_T("OnSipTapi::InitOnSipTapi Poll Init SIGNAL stop") ); return false; } // Poll to keep the state machine going and process XMPP events if ( !Poll() ) { Logger::log_error(_T("OnSipTapi::InitOnSipTapi Poll error exiting")); *stateType = OnSipInitStatesType::DISCONNECTED; return false; } // Shouldn't require a sleep, the Poll does this some, but have anyway Sleep(50); // Get the current state and state type OnSipInitStates::InitStates curState = GetInitStateMachineState(); *stateType = OnSipInitStatesType::GetInitStatesType( curState ); Logger::log_debug(_T("OnSipTapi::InitOnSipTapi Poll Init state=%s stateType=%s"), OnSipInitStates::InitStatesToString(curState), OnSipInitStatesType::InitStatesTypeToString( *stateType ) ); // See if error type of state if ( *stateType == OnSipInitStatesType::DISCONNECTED || *stateType == OnSipInitStatesType::FATAL ) { Logger::log_error(_T("OnSipTapi::InitOnSipTapi Poll init error, state=%s stateType=%s, exiting"), OnSipInitStates::InitStatesToString(curState), OnSipInitStatesType::InitStatesTypeToString( *stateType ) ); return false; } // See if initialized if ( *stateType == OnSipInitStatesType::OK ) { Logger::log_debug(_T("OnSipTapi::InitOnSipTapi Poll Init OK" )); break; } } // Clear all events that occurred during the initialization ClearEvents(); return true; }
UserEvents() : EventCollection<UserEventID::Type>() { ClearEvents(); }
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { RECT rect; NMHDR *hdr; switch (message) { case WM_CREATE: hMainMenu = GetMenu(hWnd); break; case WM_NOTIFY: switch (((LPNMHDR)lParam)->code) { case NM_DBLCLK : hdr = (NMHDR FAR*)lParam; if (hdr->hwndFrom == hwndListView) { LPNMITEMACTIVATE lpnmitem = (LPNMITEMACTIVATE)lParam; if (lpnmitem->iItem != -1) { DialogBox(hInst, MAKEINTRESOURCE(IDD_EVENTPROPERTIES), hWnd, EventDetails); } } break; } break; case WM_COMMAND: // Parse the menu selections: if ((LOWORD(wParam) >= ID_FIRST_LOG) && (LOWORD(wParam) <= ID_FIRST_LOG + dwNumLogs)) { if (LogNames[LOWORD(wParam) - ID_FIRST_LOG]) { if (QueryEventMessages(lpComputerName, LogNames[LOWORD(wParam) - ID_FIRST_LOG])) { CheckMenuRadioItem(GetMenu(hWnd), ID_FIRST_LOG, ID_FIRST_LOG + dwNumLogs, LOWORD(wParam), MF_BYCOMMAND); } } } else switch (LOWORD(wParam)) { case IDM_SAVE_PROTOCOL: SaveProtocol(); break; case IDM_CLEAR_EVENTS: if (ClearEvents()) { Refresh(); } break; case IDM_REFRESH: Refresh(); break; case IDM_ABOUT: DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); break; case IDM_HELP: MessageBoxW(hwndMainWindow, L"Help not implemented yet!", L"Event Log", MB_OK | MB_ICONINFORMATION); break; case IDM_EXIT: DestroyWindow(hWnd); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_SIZE: // Gets the window rectangle GetClientRect(hWnd, &rect); // Relocate the listview MoveWindow(hwndListView, 0, 0, rect.right, rect.bottom - 20, 1); // Resize the statusbar; SendMessage(hwndStatus, message, wParam, lParam); break; case WM_DESTROY: FreeRecords(); FreeLogList(); PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; }
void EventManager::Clear() { ClearEvents(); ClearListeners(); }