use of javax.microedition.amms.control.camera.ExposureControl in project CodenameOne by codenameone.
the class AdvancedMultimediaManager method setExposure.
public void setExposure(Controllable player) {
ExposureControl exposureControl = (ExposureControl) getControl(player, "javax.microedition.amms.control.camera.ExposureControl");
if (exposureControl != null) {
int[] supportedISOs = exposureControl.getSupportedISOs();
if (supportedISOs != null && supportedISOs.length > 0) {
int maxISO = Integer.MIN_VALUE;
for (int i = 0; i < supportedISOs.length; i++) {
if (supportedISOs[i] > maxISO) {
maxISO = supportedISOs[i];
}
}
try {
exposureControl.setISO(maxISO);
} catch (MediaException me) {
// continue
}
}
String[] supportedMeterings = exposureControl.getSupportedLightMeterings();
if (supportedMeterings != null) {
for (int i = 0; i < supportedMeterings.length; i++) {
if (DESIRED_METERING.equals(supportedMeterings[i])) {
exposureControl.setLightMetering(DESIRED_METERING);
break;
}
}
}
}
}
use of javax.microedition.amms.control.camera.ExposureControl in project CodenameOne by codenameone.
the class AdvancedMultimediaManager method setExposure.
public void setExposure(Controllable player) {
ExposureControl exposureControl = (ExposureControl) getControl(player, "javax.microedition.amms.control.camera.ExposureControl");
if (exposureControl != null) {
int[] supportedISOs = exposureControl.getSupportedISOs();
if (supportedISOs != null && supportedISOs.length > 0) {
int maxISO = Integer.MIN_VALUE;
for (int i = 0; i < supportedISOs.length; i++) {
if (supportedISOs[i] > maxISO) {
maxISO = supportedISOs[i];
}
}
try {
exposureControl.setISO(maxISO);
} catch (MediaException me) {
// continue
}
}
String[] supportedMeterings = exposureControl.getSupportedLightMeterings();
if (supportedMeterings != null) {
for (int i = 0; i < supportedMeterings.length; i++) {
if (DESIRED_METERING.equals(supportedMeterings[i])) {
exposureControl.setLightMetering(DESIRED_METERING);
break;
}
}
}
}
}
Aggregations