MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / setPlaybackSpeed

Function setPlaybackSpeed

Samples/NiViewer/Device.cpp:616–631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

614}
615
616void setPlaybackSpeed(int ratioDiff)
617{
618 if (g_Player.IsValid())
619 {
620 XnDouble dNewSpeed = g_Player.GetPlaybackSpeed() * pow(2.0, (XnDouble)ratioDiff);
621 XnStatus nRetVal = g_Player.SetPlaybackSpeed(dNewSpeed);
622 if (nRetVal != XN_STATUS_OK)
623 {
624 displayMessage("Failed to set playback speed: %s", xnGetStatusString(nRetVal));
625 }
626 }
627 else
628 {
629 displayMessage("Can't set playback speed - input is not a recording!");
630 }
631}
632
633XnDouble getPlaybackSpeed()
634{

Callers

nothing calls this directly

Calls 5

displayMessageFunction · 0.85
xnGetStatusStringFunction · 0.85
IsValidMethod · 0.45
GetPlaybackSpeedMethod · 0.45
SetPlaybackSpeedMethod · 0.45

Tested by

no test coverage detected