Example #1
0
XnDouble getPlaybackSpeed()
{
	if (g_Player.IsValid())
	{
		return g_Player.GetPlaybackSpeed();
	}
	else
	{
		return 1.0;
	}
}
Example #2
0
void setPlaybackSpeed(int ratioDiff)
{
	if (g_Player.IsValid())
	{
		XnDouble dNewSpeed = g_Player.GetPlaybackSpeed() * pow(2.0, (XnDouble)ratioDiff);
		XnStatus nRetVal = g_Player.SetPlaybackSpeed(dNewSpeed);
		if (nRetVal != XN_STATUS_OK)
		{
			displayMessage("Failed to set playback speed: %s", xnGetStatusString(nRetVal));
		}
	}
	else
	{
		displayMessage("Can't set playback speed - input is not a recording!");
	}
}
Example #3
0
//----------------------------------------------------
// プレイヤーの初期化
//----------------------------------------------------
void playerInit(void){
	XnStatus rc;

	rc = g_context.Init();
	rc = g_context.OpenFileRecording(PLAYER_RECORDE_PATH, g_player);
	errorCheck(rc, "OpenFileRecording");		// エラーチェック

	rc = g_context.FindExistingNode(XN_NODE_TYPE_PLAYER, g_player);
	errorCheck(rc, "FindExistingNode_player");

	// サポートされるフォーマットの取得
	cout << "SupportedFormat:" <<
		g_player.GetSupportedFormat() << endl;

	// 再生速度の取得
	cout << "PlaybackSpeed:" << g_player.GetPlaybackSpeed() << endl;
}