TAPs 0.7.7.3
TAPsSensAble_hduRecord.cpp File Reference
#include "TAPsSensAble_hduRecord.hpp"
#include <iostream>
#include <HDU/hduRecord.h>
#include <HDU/hduVector.h>
#include <HD/hdCompilerConfig.h>
#include <HD/hdScheduler.h>
#include <HD/hdDevice.h>
Include dependency graph for TAPsSensAble_hduRecord.cpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SensAble_hduRecorderPacket
class  SensAble_hduRecorder

Functions

BEGIN_NAMESPACE_TAPs__Haptic
HDCallbackCode HDCALLBACK 
SensAble_RecordLoopCallback (void *SensAble_hduRecorder)
thread_rv SensAble_RecordWriteCallback (void *data)
HDSchedulerHandle SensAble_hduStartRecord (FILE *file, HDURecordCallback pCallback, void *pCallbackData, unsigned int nData)

Function Documentation

HDSchedulerHandle SensAble_hduStartRecord ( FILE *  file,
HDURecordCallback  pCallback,
void *  pCallbackData,
unsigned int  nData 
)

Definition at line 275 of file TAPsSensAble_hduRecord.cpp.

References SensAble_hduRecorder::GetShedulerHandle(), and SensAble_hduRecorder::Start().

{
    if ( !file ) {
        return false;
    }
    //-------------------------------------------
    SensAble_hduRecorder * pRecord = 
        new SensAble_hduRecorder(
                file,
                *pCallback,
                pCallbackData,
                nData );
    //-------------------------------------------
    if ( pRecord->Start() ) {
        return pRecord->GetShedulerHandle();
    }
    else {
        delete pRecord;
        return 0;
    }
}

Here is the call graph for this function:

HDCallbackCode HDCALLBACK SensAble_RecordLoopCallback ( void *  SensAble_hduRecorder)

Definition at line 223 of file TAPsSensAble_hduRecord.cpp.

References SensAble_hduRecorder::AddData(), and SensAble_RecordWriteCallback().

Referenced by SensAble_hduRecorder::Start().

{
    SensAble_hduRecorder * pRecord = 
        ( SensAble_hduRecorder * ) _SensAble_hduRecorder;
    HDboolean bDone = pRecord->AddData();
    //---------------------------------------------------------------
    // If done, then create another thread to write out the data.
    if ( bDone ) {
#if defined( WIN32 )
        _beginthread( SensAble_RecordWriteCallback, 0, pRecord );
#elif defined(linux) || defined(__APPLE__)
        pthread_create( NULL, NULL, SensAble_RecordWriteCallback, pRecord );
#endif
        return HD_CALLBACK_DONE;
    }
    //---------------------------------------------------------------
    return HD_CALLBACK_CONTINUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

thread_rv SensAble_RecordWriteCallback ( void *  data)

Definition at line 164 of file TAPsSensAble_hduRecord.cpp.

References SensAble_hduRecorder::WriteDataToFile().

Referenced by SensAble_RecordLoopCallback().

{
    SensAble_hduRecorder * pRecord = ( SensAble_hduRecorder * ) data;
    pRecord->WriteDataToFile();
    delete pRecord;
}

Here is the call graph for this function:

Here is the caller graph for this function:

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines