void InitPlant(void) { // Init Influent InitInfluent(); // Init Headworks InitHeadworks(); // Init valve between Headworks and Activated Sludge Process InitHeadworksOutputValve(); // Init Activated Sludge Process InitAsp(); // Init valve between Activated Sludge Process and Filters InitAspOutputValve(); // Init Filters InitFilters(); // Init valve between Filters and Disinfection InitFilterOutputValve(); // Init Disinfection InitDisinfection(); // Init valve to Discharge and Reject Storage InitDisinfectionOutputValve(); // Init Effluent InitEffluent(); }
void LoomEnterProcess() { fprintf(stderr, "***** LoomEnterProcess *****\n"); pthread_atfork(NULL, NULL, LoomEnterForkedProcess); atexit(LoomExitProcess); pthread_rwlock_init(&LoomUpdateLock, NULL); memset((void *)LoomWait, 0, sizeof(LoomWait)); memset((void *)LoomCounter, 0, sizeof(LoomCounter)); memset((void *)LoomOperations, 0, sizeof(LoomOperations)); memset((void *)LoomSwitches, 0, sizeof(LoomSwitches)); InitFilters(); if (StartDaemon() == -1) { fprintf(stderr, "failed to start the loom daemon. abort...\n"); exit(1); } LoomEnterThread(); }
bool EventList::SearchInContact(MCONTACT hContact, TCHAR *strFind, ComparatorInterface* compFun) { InitFilters(); if (useImportedMessages) { std::vector<IImport::ExternalMessage> messages; { mir_cslock lck(csEventList); std::map<MCONTACT, EventList::ImportDiscData>::iterator it = contactFileMap.find(hContact); if (it != contactFileMap.end()) { ExportManager imp(hWnd, hContact, 1); imp.SetAutoImport(it->second.file); if (!imp.Import(it->second.type, messages, NULL)) messages.clear(); } } for (int i = 0; i < (int)importedMessages.size(); ++i) if (compFun->Compare((importedMessages[i].flags & DBEF_SENT) != 0, importedMessages[i].message, strFind)) return true; } std::list<EventTempIndex> tempList; GetTempList(tempList, false, true, hContact); EventIndex ei; EventData ed; TCHAR str[MAXSELECTSTR + 8]; // for safety reason for (std::list<EventTempIndex>::iterator itL = tempList.begin(); itL != tempList.end(); ++itL) { ei.isExternal = itL->isExternal; ei.hEvent = itL->hEvent; if (GetEventData(ei, ed)) { GetEventMessage(ei, str); if (compFun->Compare(ed.isMe, str, strFind)) return true; } } return false; }
Unpack::~Unpack() { if (Window!=NULL && !ExternalWindow) delete[] Window; InitFilters(); }
Unpack::~Unpack() { if (Window!=NULL && !ExternalWindow) rarfree( Window ); InitFilters(); }
HRESULT FMPlayerDShow::LoadMedia(const tchar* pFileName, IMediaOptions* pOptions) { USES_CONVERSION; HRESULT hr = E_FAIL; if (m_FourCC == "divx" && m_StreamFormat == "divx") { Init(m_hWndParent, m_pNotify); } if (m_FilterGraph == NULL) return E_FAIL; m_MediaControl->Stop(); if (m_FileSource) { m_FilterGraph->RemoveFilter(m_FileSource); m_FileSource.Release(); } else { /* CComQIPtr<IGraphBuilder> pGraphBuilder = m_FilterGraph; if (SUCCEEDED(pGraphBuilder->RenderFile(T2OLE(pFileName), NULL))) { hr = Start(); return hr; } */ if (SUCCEEDED(DetermineVideoType(pFileName))) { InitFilters(pFileName); } else { _DBGAlertM("FMPlayerDShow: PlayVideo: **Unable to determine file format.\n"); return E_FAIL; } } _DBGAlertM("FMPlayerDShow: Starting playback: %s; offset = %I64d\n", pFileName, pOptions->rtOffset); CComQIPtr<IGraphBuilder> pGraphBuilder = m_FilterGraph; hr = pGraphBuilder->AddSourceFilter(T2OLE(pFileName), T2OLE(pFileName), &m_FileSource); if (SUCCEEDED(hr)) { CComPtr<IPin> PinSourceOut = GetOutPin(m_FileSource, 0); CComPtr<IPin> PinSplitterIn = GetInPin(m_AviSplitter, 0); if (PinSourceOut && PinSplitterIn) { PinSplitterIn->Disconnect(); hr = m_FilterGraph->ConnectDirect(PinSourceOut, PinSplitterIn, NULL); if (FAILED(hr)) _DBGAlertM("FMediaMgr: **Connect SourceOut to SplitterIn: %s\n", GetErrorDescription(hr)); } else _DBGAlertM("FMediaMgr: **PinSourceOut or PinSourceIn is NULL\n"); hr = BuildTheGraph(); if (SUCCEEDED(hr)) { m_FileName = pFileName; m_Offset = pOptions->rtOffset; hr = Start(); if (FAILED(hr)) _DBGAlertM("FMPlayerDShow: **Start() failed: %s\n", GetErrorDescription(hr)); else { SetVideoRect(m_VideoRect); } } else _DBGAlertM("FMPlayerDShow: **Cannot Start(): %s\n", GetErrorDescription(hr)); } else _DBGAlertM("FMPlayerDShow: **AddSourceFilter() failed: %s\n", GetErrorDescription(hr)); _DBGAlertM("FMPlayerDShow: StartPlayback() exiting: %s\n", GetErrorDescription(hr)); return hr; }
void EventList::RefreshEventList() { InitNames(); InitFilters(); if (useImportedMessages) { std::vector<IImport::ExternalMessage> messages; { mir_cslock lck(csEventList); std::map<MCONTACT, EventList::ImportDiscData>::iterator it = contactFileMap.find(hContact); if (it != contactFileMap.end()) { ExportManager imp(hWnd, hContact, 1); imp.SetAutoImport(it->second.file); if (!imp.Import(it->second.type, messages, NULL)) messages.clear(); } } ImportMessages(messages); } std::list<EventTempIndex> tempList; GetTempList(tempList, false, false, hContact); std::list<EventTempIndex> revTempList; std::list<EventTempIndex>& nrTempList = tempList; bool isNewOnTop = Options::instance->groupNewOnTop; if (isNewOnTop) { revTempList.insert(revTempList.begin(), tempList.rbegin(), tempList.rend()); nrTempList = revTempList; } eventList.clear(); eventList.push_back(std::deque<EventIndex>()); DWORD lastTime = MAXDWORD; DWORD groupTime = Options::instance->groupTime * 60 * 60; int maxMess = Options::instance->groupMessagesNumber; int limitator = 0; EventIndex ei; for (std::list<EventTempIndex>::iterator itL = nrTempList.begin(); itL != nrTempList.end(); ++itL) { DWORD tm = isNewOnTop ? lastTime - itL->timestamp : itL->timestamp - lastTime; if (isFlat || tm < groupTime && limitator < maxMess) { lastTime = itL->timestamp; ei.isExternal = itL->isExternal; ei.hEvent = itL->hEvent; if (isNewOnTop) eventList.back().push_front(ei); else eventList.back().push_back(ei); ++limitator; } else { limitator = 0; lastTime = itL->timestamp; if (!eventList.back().empty()) { ei = eventList.back().front(); AddGroup(ei); eventList.push_back(std::deque<EventIndex>()); } ei.isExternal = itL->isExternal; ei.hEvent = itL->hEvent; eventList.back().push_front(ei); } } if (!eventList.back().empty()) { ei = eventList.back().front(); AddGroup(ei); } }
Unpack::~Unpack() { delete[] Window; InitFilters(); }
////////////////////////////////////////////////////////////////////////// //COSPServiceMgr COSPServiceMgr::COSPServiceMgr() { InitFilters(); }