XnStatus GeneratorWatcher::Watch() { XnStatus nRetVal = XN_STATUS_OK; nRetVal = NodeWatcher::Watch(); XN_IS_STATUS_OK(nRetVal); XnUInt64 nCurrentTimeStamp = m_generator.GetTimestamp(); XnUInt32 nCurrentFrameID = m_generator.GetFrameID(); // check if timestamp has changed since last time. // Note that the first frame might have a timestamp of zero, so also make sure frame ID changes if ((nCurrentTimeStamp > m_nLastDataTimeStamp) || (nCurrentFrameID > m_nLastDataFrameID)) { m_nLastDataTimeStamp = nCurrentTimeStamp; m_nLastDataFrameID = nCurrentFrameID; const void* pData = GetCurrentData(); if (pData != NULL) { nRetVal = m_notifications.OnNodeNewData(m_pCookie, m_generator.GetName(), nCurrentTimeStamp, m_generator.GetFrameID(), pData, m_generator.GetDataSize()); XN_IS_STATUS_OK(nRetVal); } } return XN_STATUS_OK; }
XnStatus GeneratorWatcher::Watch() { XnStatus nRetVal = XN_STATUS_OK; nRetVal = NodeWatcher::Watch(); XN_IS_STATUS_OK(nRetVal); XnUInt64 nCurrentTimeStamp = m_generator.GetTimestamp(); if ((nCurrentTimeStamp > m_nLastDataTimeStamp) || ((nCurrentTimeStamp == 0) && (m_generator.GetFrameID() > 0))) { m_nLastDataTimeStamp = nCurrentTimeStamp; const void* pData = GetCurrentData(); if (pData != NULL) { nRetVal = m_notifications.OnNodeNewData(m_pCookie, m_generator.GetName(), nCurrentTimeStamp, m_generator.GetFrameID(), pData, m_generator.GetDataSize()); XN_IS_STATUS_OK(nRetVal); } } return XN_STATUS_OK; }
void makeCurrent(Context *context, egl::Display *display, egl::Surface *surface) { Current *current = GetCurrentData(); current->context = context; current->display = display; if (context && display && surface) { context->makeCurrent(surface); } }
/** * Init the clipboard. * 1- Save the current clipboard * 2- Call copy from the active window * 3- Save what ever info was returned * 4- Restore the clipboard * * @param none * @return none */ void Clipboard::Init( CWnd* mainWnd ) { // the current clipboard data V_CF clipboard_format; // the copied data made for this call. V_CF clipboard_format_new; try { // save all the current clipboard data // we use our current window, (NULL), for the work. GetCurrentData(NULL, clipboard_format); // then copy the data from the previous foreground window. CopyDataFromForgroundWindow(mainWnd); // empty all the data we might have from previous calls. ResetClipBoardData(); // ok, so now we can get this window data GetCurrentData(mainWnd, clipboard_format_new); // now that we have a brand new array of clipboards simply // add as much info as possible to our structure // that way we can choose what we actually want to use. ParseClipboard( clipboard_format_new ); // finally that we have saved that we need to restore the clipboard to the sate it was in b4. RestoreClipboard( NULL, clipboard_format ); } catch(...) { ASSERT(0); // something bad has happened. } // clear everything ResetClipboardFormats( clipboard_format); ResetClipboardFormats( clipboard_format_new); }
void RegisterIO::Run() { io_provider->Init(); /* Initial Device Configuration */ SetUpdateRateHz(this->update_rate_hz); GetConfiguration(); /* IO Loop */ while (!stop) { if ( board_state.update_rate_hz != this->update_rate_hz ) { SetUpdateRateHz(this->update_rate_hz); } GetCurrentData(); delayMillis(1000.0/this->update_rate_hz); } }
void PathListWin::Sort() { const PathList::Data* curr = GetCurrentData(); m_dataList.Sort(); if (curr) { const unicode_t* sel = curr->name.data(); for (int i = 0; i < m_dataList.GetCount(); i++) { if (!PathList::Compare(sel, m_dataList.GetData(i)->name.data(), true)) { SetCurrent(i); Invalidate(); break; } } } }
EGLint getCurrentError() { Current *current = GetCurrentData(); return current->error; }
void setCurrentError(EGLint error) { Current *current = GetCurrentData(); current->error = error; }
Surface *GetGlobalDrawSurface() { Current *current = GetCurrentData(); return current->drawSurface; }
void setCurrentReadSurface(EGLSurface surface) { Current *current = GetCurrentData(); current->readSurface = surface; }
void setCurrentDrawSurface(EGLSurface surface) { Current *current = GetCurrentData(); current->drawSurface = surface; }
void setCurrentDisplay(EGLDisplay dpy) { Current *current = GetCurrentData(); current->display = dpy; }
void SetGlobalThread(Thread *thread) { Current *current = GetCurrentData(); current->kdThread = thread; }
KDint32 GetGlobalError() { Current *current = GetCurrentData(); return current->kdError; }
void SetGlobalError(const Error &error) { Current *current = GetCurrentData(); current->kdError = error.getCode(); }
gl::Context *GetGlobalContext() { Current *current = GetCurrentData(); return current->context; }
void SetGlobalContext(gl::Context *context) { Current *current = GetCurrentData(); current->context = context; }
Surface *GetGlobalReadSurface() { Current *current = GetCurrentData(); return current->readSurface; }
void SetGlobalReadSurface(Surface *surface) { Current *current = GetCurrentData(); current->readSurface = surface; }
void setCurrentAPI(EGLenum API) { Current *current = GetCurrentData(); current->API = API; }
EGLenum getCurrentAPI() { Current *current = GetCurrentData(); return current->API; }
Thread *GetGlobalThread() { Current *current = GetCurrentData(); return current->kdThread; }
EGLDisplay getCurrentDisplay() { Current *current = GetCurrentData(); return current->display; }
void SetGlobalTLS(void *tls) { Current *current = GetCurrentData(); current->kdTLS = tls; }
EGLSurface getCurrentDrawSurface() { Current *current = GetCurrentData(); return current->drawSurface; }
Display *GetGlobalDisplay() { Current *current = GetCurrentData(); return current->display; }
EGLSurface getCurrentReadSurface() { Current *current = GetCurrentData(); return current->readSurface; }
void recordError(const Error &error) { Current *current = GetCurrentData(); current->error = error.getCode(); }
void *GetGlobalTLS() { Current *current = GetCurrentData(); return current->kdTLS; }
void SetGlobalDrawSurface(Surface *surface) { Current *current = GetCurrentData(); current->drawSurface = surface; }