Last reviewed: 3/23/2024 9:08:14 AM
C++Builder VCL and FireMonkey Applications
Develop C++ applications that manage movement using your favorite version of C++Builder.
The following sections describe the steps for integrating KinesicsKit with C++Builder VCL and FireMonkey applications.
KinesicsKit Header Files
KinesicsKit includes C++ header files comprised of the C++Builder classes that manage grammars and automatically load and unload the runtime DLL.
To access the KinesicsKit C++Builder classes within your application, first add a project reference to the C++Builder header include files:
- Within your C++Builder project, select Project Options.
- Select the C++Builder compiler options.
- Add Include path reference to the KinesicsKit header files directory: C:\Program Files\Chant\KinesicsKit 8\CBuilder\include.
- For 64-bit apps, add Win64 as a conditional to the compiler options.
To access the KinesicsKit C++Builder classes within your application, add a reference to the Chant shared and KinesicsKit header files in your C++Builder application header file.
#include "Chant.Shared.h"
#include "Chant.KinesicsKit.h"
Add a reference in your C++Builder application source file to the Chant shared and KinesicsKit code needed to dynamically load and unload the runtime DLL.
#include "Chant.Shared.cpp"
#include "Chant.KinesicsKit.cpp"
Object Instantiation
Declare a global variable for the KinesicsKit class, instantiate an instance, set the credentials, and set the event handlers.
Add the following to your application header file:
public: // User declarations
CKinesicsKit* _KinesicsKit;
CChantKinectSensor* _Sensor;
};
// Event handlers
void CALLBACK MultiSourceFrameArrived(void* Sender, CMultiSourceFrameArrivedEventArgs* Args);
Add the following to your application source file:
// Instantiate KinesicsKit object
_KinesicsKit = new CKinesicsKit();
if (_KinesicsKit != NULL)
{
// Set credentials
_KinesicsKit->SetCredentials("Credentials");
// Create sensor
_Sensor = _KinesicsKit->CreateKinectSensor();
if (_Sensor != NULL)
{
// Register Event Handlers
_Sensor->SetMultiSourceFrameArrived(MultiSourceFrameArrived);
}
}
KinesicsKit applications require the KinesicsKit library (CKinesicsKit.dll or CKinesicsKitX64.dll) and the applicable KinesicsKit API library in the same directory as the application .exe.
Speech API | KinesicsKit Speech API class | KinesicsKit Speech API library |
---|---|---|
Microsoft Kinect 2.0 | CKinectSensor | CKinesicsKit.Kinect.dll or CKinesicsKitX64.Kinect.dll |
Event Callbacks
Event callbacks are the mechanism in which the class object sends information back to the application such as compilation is complete or there was an error.
void CALLBACK MultiSourceFrameArrived(void* Sender, CMultiSourceFrameArrivedEventArgs* Args)
{
CMultiSourceFrameReference* pMultiSourceFrameReference = Args->GetFrameReference();
if (pMultiSourceFrameReference != NULL)
{
CMultiSourceFrame* pMultiSourceFrame = pMultiSourceFrameReference->AcquireFrame();
if (pMultiSourceFrame != NULL)
{
...
delete pMultiSourceFrame;
}
delete pMultiSourceFrameReference;
}
}
Development and Deployment Checklist
When developing and deploying C++Builder VCL and FireMonkey applications, ensure you have a valid license, bundle the correct Chant class library, and configure your installation properly on the target system. Review the following checklist before developing and deploying your applications:
- Develop and deploy C++Builder VCL and FireMonkey applications to any system with a valid license from Chant. See the section License for more information about licensing Chant software.
- Copy CKinesicsKit.dll to the target system and place in the same directory with your application.
- Copy CKinesicsKit.Kinect.dll to the target system.
- Deploy C++Builder VCL and FireMonkey applications to any system with a valid license from Chant. See the section License for more information about licensing Chant software.
- Copy CKinesicsKitX64.dll to the target system and place in the same directory with your application.
- Copy CKinesicsKitX64.Kinect.dll to the target system.
Sample Projects
C++Builder VCL and FireMonkey sample projects are installed at the following location:
- Documents\Chant\KinesicsKit 8\CBuilder.