Another static method is the vc::videoDevice::getIntegerControlString method. This will get the appropriate std::string name for an integer control, which are discussed in the Normal Methods section below.
The getValidIntegerControls will return a vector of integer controls that you can use on your device. You can then use getIntegerControlMinimum and getIntegerControlMaximum to find the range of the control, and getIntegerControlStep to find the effective step value for it.
1 try { 2 cout << "Brightness (min/max/cur): " 3 << device.getIntegerControlMinimum(vc::BRIGHTNESS) << "/" 4 << device.getIntegerControlMaximum(vc::BRIGHTNESS) << "/" 5 << device.getIntegerControlValue(vc::BRIGHTNESS) << endl; 6 } 7 catch(string s) { 8 cout << "Brightness Information Failed: " << s << endl; 9 exit(1); 10 }
With all this information in hand you can then get and set the control through the getIntegerControlValue and setIntegerControlValue methods.
1 try { 2 device.setIntegerControlValue(vc::BRIGHTNESS,5000); 3 cout << device.getIntegerControlValue(vc::BRIGHTNESS) << endl; 4 } 5 catch(string s) { 6 cout << "Brightness Change Failed: " << s << endl; 7 exit(1); 8 }
It may seem verbose, but it is very usable.
1.5.3