User`s guide
6 Defining Device-Specific Properties
6-18
getEngine()->getAdaptorPropContainer();
2
Add a set listener to a property in the container, using the IPropContainer object's
addListener() function. As arguments, specify the property name and a handle to
the listener object.
Note Because the toolbox deletes each instance of a listener object when a user
deletes the video input object, associate a new instance of a listener object with each
property.
The following example iterates through all properties in the adaptor property
container, associating a set listener object with each property:
void MyDeviceAdaptor::MyDeviceAdaptor()
{
// get a handle to the property container
IPropContainer* propContainer =
getEngine()->getAdaptorPropContainer();
// Determine the number of properties in the container.
int numDeviceProps = propContainer->getNumberProps();
// Retrieve the names of all the properties in the container
const char **devicePropNames = new const
char*[numDeviceProps];
propContainer->getPropNames(devicePropNames);
// Create a variable to point to a property listener object.
MyDevicePropSetListener* setListener;
// For each property in the container...
for (int i = 0; i < numDeviceProps; i++){
// Create a set listener object...
setListener = new MyDevicePropSetListener(this);
// and associate it with a specific property.
propContainer->addListener(devicePropNames[i], setListener);
}
// clean up the array of property names.