// Exposes the library's ability to set the gesture timeout
 public void SetGestureTimeout(long timeout, string gestureName = null)
 {
     if (gestureName != null)
     {
         lastGesture = GetGesture(gestureName);
     }
     lastGesture.timeout = timeout;
 }
 // Exposes the library's ability to add a gesture
 public void AddGesture(string gestureName)
 {
     lastGesture = new GestureParser.GestureSequences()
     {
         gesture = gestureName
     };
     gestureProcessor.Gestures.Add(lastGesture);
 }
 // Exposes the library's ability to set a gesture step's failure relationship
 public void SetGestureStepFailureRelationship(string gestureName, int stepNumber, int conditionNumber, KinectJoint actor, KinectJointRelationship relationship, string relative, int deviation = 0)
 {
     lastGesture = GetGesture(gestureName);
     lastStep    = stepNumber;
     lastGesture.steps.ElementAt(stepNumber).FailureConditions.ElementAt(conditionNumber).actor     = (Microsoft.Kinect.JointType)actor;
     lastGesture.steps.ElementAt(stepNumber).FailureConditions.ElementAt(conditionNumber).relation  = (GestureParser.Relationship)relationship;
     lastGesture.steps.ElementAt(stepNumber).FailureConditions.ElementAt(conditionNumber).relative  = relative;
     lastGesture.steps.ElementAt(stepNumber).FailureConditions.ElementAt(conditionNumber).deviation = deviation;
 }
 // Exposes the library's ability to add a gesture step
 public int AddGestureStep(string gestureName = null)
 {
     if (gestureName != null)
     {
         lastGesture = GetGesture(gestureName);
     }
     GestureParser.GestureSequenceStep gs = new GestureParser.GestureSequenceStep();
     lastGesture.steps.Add(new GestureParser.GestureSequenceStep());
     lastStep = (lastGesture.steps.Count - 1);
     return(lastStep);
 }
 // Exposes the library's ability to add a gesture step's failure condition
 public int AddGestureStepFailureRelationship(KinectJoint actor, KinectJointRelationship relationship, string relative, int deviation, int stepNumber = -1, string gestureName = null)
 {
     if (gestureName != null)
     {
         lastGesture = GetGesture(gestureName);
     }
     if (stepNumber != -1)
     {
         lastStep = stepNumber;
     }
     GestureParser.JointRelationship jr = new GestureParser.JointRelationship()
     {
         actor     = (Microsoft.Kinect.JointType)actor,
         relation  = (GestureParser.Relationship)relationship,
         relative  = relative,
         deviation = deviation
     };
     lastGesture.steps.ElementAt(lastStep).FailureConditions.Add(jr);
     lastFailureCondition = (lastGesture.steps.ElementAt(lastStep).FailureConditions.Count - 1);
     return(lastFailureCondition);
 }