* origin | Meaning of the nFrameOffset parameter |
*
XN_PLAYER_SEEK_SET | nFrameOffset specifies the total number of frames since the beginning of the node's recording. Note that nFrameOffset will be case to XnUInt64 in this case. |
*
XN_PLAYER_SEEK_CUR | nFrameOffset specifies the number of frames to move, relative to the current frame of the specifies node. A positive value means move forward, and a negative value means move backwards. |
*
XN_PLAYER_SEEK_END | nFrameOffset specifies the number of frames to move, relative to the end of the node's recording. This must be a negative value. |
*
*
* @note You can get different results using this function for different values of strNodeName, because the frame numbers of different nodes are not necessarily in sync.
*/
XN_C_API XnStatus XN_C_DECL xnSeekPlayerToFrame(XnNodeHandle hPlayer, const XnChar* strNodeName, XnInt32 nFrameOffset, XnPlayerSeekOrigin origin);
/**
* @brief Reports the current timestamp of a player, i.e. the amount of time passed since the beginning of the recording.
*
* @param hPlayer [in] A handle to the player.
* @param pnTimestamp [out] A pointer to the retrieved timestamp in microseconds.
*/
XN_C_API XnStatus XN_C_DECL xnTellPlayerTimestamp(XnNodeHandle hPlayer, XnUInt64* pnTimestamp);
/**
* @brief Reports the current frame number of a specific node played by a player.
*
* @param hPlayer [in] A handle to the player.
* @param strNodeName [in] The name of the node for which to report the frame number.
* @param pnFrame [out] A pointer to the reported frame number.
*
* @remark Different nodes that belong to the player can have different frame numbers, because the nodes are not necessarily in sync.
*/
XN_C_API XnStatus XN_C_DECL xnTellPlayerFrame(XnNodeHandle hPlayer, const XnChar* strNodeName, XnUInt32* pnFrame);
/**
* @brief Retrieves the number of frames of a specific node played by a player.
*
* @param hPlayer [in] A handle to the player.
* @param strNodeName [in] The name of the node for which to retrieve the number of frames.
* @param pnFrames [out] A pointer to the retrieved number of frames.
*/
XN_C_API XnStatus XN_C_DECL xnGetPlayerNumFrames(XnNodeHandle hPlayer, const XnChar* strNodeName, XnUInt32* pnFrames);
/**
* @brief Gets the name of the format supported by a player.
*
* @param hPlayer [in] A handle to the player.
* @returns The name of the format supported by the player, or NULL if hPlayer is NULL.
*/
XN_C_API const XnChar* XN_C_DECL xnGetPlayerSupportedFormat(XnNodeHandle hPlayer);
/**
* @brief Retrieves a list of the nodes played by a player.
*
* @param hPlayer [in] A handle to the player.
* @param ppList [out] A pointer to the retrieved list of nodes.
*
* @remark This function fills the pointer that is pointed to by ppList with a newly allocated node info list
* of the played nodes. This list must later be freed by the caller with @ref xnNodeInfoListFree().
*/
XN_C_API XnStatus XN_C_DECL xnEnumeratePlayerNodes(XnNodeHandle hPlayer, XnNodeInfoList** ppList);
/**
* @brief Checks whether the player is at the end-of-file marker.
* @note In the built-in ONI player, this function will never return TRUE for a player that is in repeat mode, although the event registered with @ref xnRegisterToEndOfFileReached() will be fired.
*
* @param hPlayer [in] A handle to the player.
*
* @sa xnSetPlayerRepeat()
*/
XN_C_API XnBool XN_C_DECL xnIsPlayerAtEOF(XnNodeHandle hPlayer);
/**
* @brief Registers a callback function to be called when end-of-file is reached.
*
* @param hPlayer [in] A handle to the player.
* @param handler [in] A pointer to a function that will be called.
* @param pCookie [in] A user cookie that will be passed to the callback function.
* @param phCallback [out] Will be filled with a handle to be passed to @ref xnUnregisterFromEndOfFileReached().
*
* @sa xnSetPlayerRepeat()
*/
XN_C_API XnStatus XN_C_DECL xnRegisterToEndOfFileReached
(XnNodeHandle hPlayer, XnStateChangedHandler handler,
void* pCookie, XnCallbackHandle* phCallback);
/**
* @brief Unregisters a callback function which was registered using @ref xnRegisterToEndOfFileReached().
*
* @param hInstance [in] A handle to the player.
* @param hCallback [in] The handle to the callback returned from @ref xnRegisterToEndOfFileReached().
*/
XN_C_API void XN_C_DECL xnUnregisterFromEndOfFileReached
(XnNodeHandle hInstance, XnCallbackHandle hCallback);
/**
* @brief Sets the playback speed, as a ratio of the time passed in the recording.
* A value of 1.0 means the player will try to output frames in the rate they were recorded (according to
* their timestamps).
* A value bigger than 1.0 means fast-forward, and a value between 0.0 and 1.0 means slow-motion.
* The special value of XN_PLAYBACK_SPEED_FASTEST (0.0) means there will be no delay, and that frames will
* be returned as soon as asked for.
*
* @param hInstance [in] A handle to the player.
* @param dSpeed [in] The speed ratio (see function description).
*/
XN_C_API XnStatus XN_C_DECL xnSetPlaybackSpeed(XnNodeHandle hInstance, XnDouble dSpeed);
/**
* @brief Gets the playback speed. see @ref xnSetPlaybackSpeed() for more details.
*
* @param hInstance [in] A handle to the player.
* @returns speed ratio, or -1.0 if this node is not a player.
*/
XN_C_API XnDouble XN_C_DECL xnGetPlaybackSpeed(XnNodeHandle hInstance);
/** @} */
//---------------------------------------------------------------------------
// ScriptNode
//---------------------------------------------------------------------------
/**
* @ingroup prd_node
* @defgroup script_node Script Node
* A Script node is a @ref node that allows running scripts, and acts as a lifetime manager for nodes created
* by that script.
* @{
*/
XN_C_API XnStatus XN_C_DECL xnCreateScriptNode(XnContext* pContext, const XnChar* strFormat, XnNodeHandle* phScript);
XN_C_API const XnChar* XN_C_DECL xnScriptNodeGetSupportedFormat(XnNodeHandle hScript);
XN_C_API XnStatus XN_C_DECL xnLoadScriptFromFile(XnNodeHandle hScript, const XnChar* strFileName);
XN_C_API XnStatus XN_C_DECL xnLoadScriptFromString(XnNodeHandle hScript, const XnChar* strScript);
XN_C_API XnStatus XN_C_DECL xnScriptNodeRun(XnNodeHandle hScript, XnEnumerationErrors* pErrors);
/** @} */
#endif // __XN_PRD_NODE_H__