Controlling multiple sensor status changes
Controlling Kinect status changes is one of the key factors and essential for development. Initially in Chapter 3, Starting to Build Kinect Applications, we have discussed the Status
property of the KinectSensor
class and how we handle it using the StatusChanged
event handler in the Dealing with Kinect Status section.
To quickly recall how you can handle the status change, first of all you have to first register for the StatusChanged
event as shown below.
KinectSensor.KinectSensors.StatusChanged += KinectSensors_StatusChanged;
The StatusChanged
event is attached to the KinectSensor
class and raised when the KinectSensor.Status
property of a Kinect sensor in the collection changes.
Note
You really don't need to attach the event handler to each and every instance of the sensor, rather the KinectSensor
does a global event registration of the status change event for all the connected sensors.
Finally, whenever there is an event change the event handler...