MATLAB IMAGE ACQUISITION TOOLBOX - RELEASE NOTES Guide de l'utilisateur Page 130

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 172
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 129
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.
Vue de la page 129
1 2 ... 125 126 127 128 129 130 131 132 133 134 135 ... 171 172

Commentaires sur ces manuels

Pas de commentaire