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

Function toggleStream

Samples/NiViewer/Device.cpp:387–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385}
386
387void toggleStream(Generator& generator, XnProductionNodeType type, bool* bIsOn)
388{
389 XnStatus nRetVal = XN_STATUS_OK;
390
391 if (!generator.IsValid())
392 {
393 createStream(generator, type);
394 }
395
396 if (!generator.IsValid())
397 {
398 // failed creating the stream
399 return;
400 }
401
402 if (generator.IsGenerating())
403 {
404 generator.StopGenerating();
405 }
406 else
407 {
408 nRetVal = generator.StartGenerating();
409 if (nRetVal != XN_STATUS_OK)
410 {
411 displayMessage("Failed to turn on %s: %s", generator.GetInfo().GetInstanceName(), xnGetStatusString(nRetVal));
412 return;
413 }
414 }
415
416 *bIsOn = (generator.IsGenerating() == TRUE);
417}
418
419void toggleDepthState(int )
420{

Callers 4

toggleDepthStateFunction · 0.85
toggleImageStateFunction · 0.85
toggleIRStateFunction · 0.85
toggleAudioStateFunction · 0.85

Calls 9

createStreamFunction · 0.85
displayMessageFunction · 0.85
xnGetStatusStringFunction · 0.85
GetInstanceNameMethod · 0.80
IsValidMethod · 0.45
IsGeneratingMethod · 0.45
StopGeneratingMethod · 0.45
StartGeneratingMethod · 0.45
GetInfoMethod · 0.45

Tested by

no test coverage detected