C# Class KinectMenu.KinectPage

A generalized Page that is meant to make use of the Kinect's sensors (motion control, speech recognition,...) Extend this page to enable kinect controls on your Page.
Inheritance: System.Windows.Controls.Page
Afficher le fichier Open project: NUIC/2-Kinects-1-Machine

Protected Properties

Свойство Type Description
_handLeft double
_handTop double
_selectedButton System.Windows.Controls.Button
buttons List
inAction System.Boolean
kinectLeft Coding4Fun.Kinect.Wpf.Controls.HoverButton
kinectLeft1 Coding4Fun.Kinect.Wpf.Controls.HoverButton
kinectRight Coding4Fun.Kinect.Wpf.Controls.HoverButton
kinectRight1 Coding4Fun.Kinect.Wpf.Controls.HoverButton
liveVideo Image

Méthodes publiques

Méthode Description
IsCursorOverObject ( FrameworkElement hand, List

Checks to see if the kinect cursor is over an object.

IsHandsTogetherOnAButton ( FrameworkElement hand, FrameworkElement otherHand, List

Checks to see if both hands are together in a clapping motion over a button.

KinectPage ( ) : System
OnButtonLocationChanged ( Hands movingHand, int x, int y ) : void

The main method for handling motion. Checks for clapping or hover events.

SpeechRecognized ( object sender, SpeechRecognizedEventArgs args ) : void

The main method for speech recognition. If an utterance is recognised by the SpeechEngine, this handler is called with the command. The handler checks the button names for the matching button and calls its Click event.

SpeechRejected ( object sender, SpeechRecognitionRejectedEventArgs args ) : void

The main method for speech rejection. Used to notify the user of a rejected speech utterance.

Méthodes protégées

Méthode Description
InitializeButtons ( ) : void

Override this method. Allows the kinect page to "know" about any selectable buttons on the Page.

InitializeKinectHandIcons ( ) : void

Override this method. Attaches the kinect hand icons to the user's hands.

InitializeVideoImage ( ) : void

Override this method. Allows the kinect page to update the video image of the person moving.

Private Methods

Méthode Description
MainWindow_Loaded ( object sender, RoutedEventArgs e ) : void

A callback method for when the page is loaded. Set's up the buttons and live image for the current page. Initializes the motion and speech controls as well.

MainWindow_Unloaded ( object sender, RoutedEventArgs e ) : void

A callback method for when the page is unloaded. Remove's event handlers from the speech and motion modules. Reset's all of the referrences.

runtime_VideoFrameReady ( object sender, ColorImageFrameReadyEventArgs e ) : void

Method Details

InitializeButtons() protected méthode

Override this method. Allows the kinect page to "know" about any selectable buttons on the Page.
protected InitializeButtons ( ) : void
Résultat void

InitializeKinectHandIcons() protected méthode

Override this method. Attaches the kinect hand icons to the user's hands.
protected InitializeKinectHandIcons ( ) : void
Résultat void

InitializeVideoImage() protected méthode

Override this method. Allows the kinect page to update the video image of the person moving.
protected InitializeVideoImage ( ) : void
Résultat void

IsCursorOverObject() public static méthode

Checks to see if the kinect cursor is over an object.
public static IsCursorOverObject ( FrameworkElement hand, List
hand System.Windows.FrameworkElement The Kinect cursor
buttons List The list of buttons to check against
Résultat bool

IsHandsTogetherOnAButton() public static méthode

Checks to see if both hands are together in a clapping motion over a button.
public static IsHandsTogetherOnAButton ( FrameworkElement hand, FrameworkElement otherHand, List
hand System.Windows.FrameworkElement The first hand
otherHand System.Windows.FrameworkElement The second hand
buttons List The list of buttons to check against
Résultat bool

KinectPage() public méthode

public KinectPage ( ) : System
Résultat System

OnButtonLocationChanged() public static méthode

The main method for handling motion. Checks for clapping or hover events.
public static OnButtonLocationChanged ( Hands movingHand, int x, int y ) : void
movingHand Hands The hand that is currently moving
x int The moving hand's current x position
y int The moving hand's current y position
Résultat void

SpeechRecognized() public méthode

The main method for speech recognition. If an utterance is recognised by the SpeechEngine, this handler is called with the command. The handler checks the button names for the matching button and calls its Click event.
public SpeechRecognized ( object sender, SpeechRecognizedEventArgs args ) : void
sender object
args SpeechRecognizedEventArgs
Résultat void

SpeechRejected() public méthode

The main method for speech rejection. Used to notify the user of a rejected speech utterance.
public SpeechRejected ( object sender, SpeechRecognitionRejectedEventArgs args ) : void
sender object
args SpeechRecognitionRejectedEventArgs
Résultat void

Property Details

_handLeft protected_oe static_oe property

protected static double _handLeft
Résultat double

_handTop protected_oe static_oe property

protected static double _handTop
Résultat double

_selectedButton protected_oe static_oe property

protected static Button,System.Windows.Controls _selectedButton
Résultat System.Windows.Controls.Button

buttons protected_oe property

protected List
Résultat List

inAction protected_oe property

protected Boolean,System inAction
Résultat System.Boolean

kinectLeft protected_oe static_oe property

protected static HoverButton,Coding4Fun.Kinect.Wpf.Controls kinectLeft
Résultat Coding4Fun.Kinect.Wpf.Controls.HoverButton

kinectLeft1 protected_oe static_oe property

protected static HoverButton,Coding4Fun.Kinect.Wpf.Controls kinectLeft1
Résultat Coding4Fun.Kinect.Wpf.Controls.HoverButton

kinectRight protected_oe static_oe property

protected static HoverButton,Coding4Fun.Kinect.Wpf.Controls kinectRight
Résultat Coding4Fun.Kinect.Wpf.Controls.HoverButton

kinectRight1 protected_oe static_oe property

protected static HoverButton,Coding4Fun.Kinect.Wpf.Controls kinectRight1
Résultat Coding4Fun.Kinect.Wpf.Controls.HoverButton

liveVideo protected_oe property

protected Image liveVideo
Résultat Image