Exemple #1
0
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;
}
Exemple #2
0
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;
}
Exemple #3
0
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);
    }
}
Exemple #4
0
/**
 * 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);
}
Exemple #5
0
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);
    }
}
Exemple #6
0
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;
}
Exemple #9
0
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;
}
Exemple #13
0
void SetGlobalThread(Thread *thread)
{
    Current *current = GetCurrentData();

    current->kdThread = thread;
}
Exemple #14
0
KDint32 GetGlobalError()
{
    Current *current = GetCurrentData();

    return current->kdError;
}
Exemple #15
0
void SetGlobalError(const Error &error)
{
    Current *current = GetCurrentData();

    current->kdError = error.getCode();
}
Exemple #16
0
gl::Context *GetGlobalContext()
{
    Current *current = GetCurrentData();

    return current->context;
}
Exemple #17
0
void SetGlobalContext(gl::Context *context)
{
    Current *current = GetCurrentData();

    current->context = context;
}
Exemple #18
0
Surface *GetGlobalReadSurface()
{
    Current *current = GetCurrentData();

    return current->readSurface;
}
Exemple #19
0
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;
}
Exemple #22
0
Thread *GetGlobalThread()
{
    Current *current = GetCurrentData();

    return current->kdThread;
}
EGLDisplay getCurrentDisplay()
{
    Current *current = GetCurrentData();

    return current->display;
}
Exemple #24
0
void SetGlobalTLS(void *tls)
{
    Current *current = GetCurrentData();

    current->kdTLS = tls;
}
EGLSurface getCurrentDrawSurface()
{
    Current *current = GetCurrentData();

    return current->drawSurface;
}
Exemple #26
0
Display *GetGlobalDisplay()
{
    Current *current = GetCurrentData();

    return current->display;
}
EGLSurface getCurrentReadSurface()
{
    Current *current = GetCurrentData();

    return current->readSurface;
}
Exemple #28
0
void recordError(const Error &error)
{
    Current *current = GetCurrentData();

    current->error = error.getCode();
}
Exemple #29
0
void *GetGlobalTLS()
{
    Current *current = GetCurrentData();

    return current->kdTLS;
}
Exemple #30
0
void SetGlobalDrawSurface(Surface *surface)
{
    Current *current = GetCurrentData();

    current->drawSurface = surface;
}