Search in sources :

Example 1 with FocusControl

use of javax.microedition.amms.control.camera.FocusControl in project CodenameOne by codenameone.

the class AdvancedMultimediaManager method setFocus.

public void setFocus(Controllable player) {
    FocusControl focusControl = (FocusControl) getControl(player, "javax.microedition.amms.control.camera.FocusControl");
    if (focusControl != null) {
        try {
            if (focusControl.isMacroSupported() && !focusControl.getMacro()) {
                focusControl.setMacro(true);
            }
            if (focusControl.isAutoFocusSupported()) {
                focusControl.setFocus(FocusControl.AUTO);
                try {
                    // let it focus...
                    Thread.sleep(FOCUS_TIME_MS);
                } catch (InterruptedException ie) {
                // continue
                }
                focusControl.setFocus(FocusControl.AUTO_LOCK);
            }
        } catch (MediaException me) {
        // continue
        }
    }
}
Also used : FocusControl(javax.microedition.amms.control.camera.FocusControl) MediaException(javax.microedition.media.MediaException)

Example 2 with FocusControl

use of javax.microedition.amms.control.camera.FocusControl in project CodenameOne by codenameone.

the class AdvancedMultimediaManager method setFocus.

public void setFocus(Controllable player) {
    FocusControl focusControl = (FocusControl) getControl(player, "javax.microedition.amms.control.camera.FocusControl");
    if (focusControl != null) {
        try {
            if (focusControl.isMacroSupported() && !focusControl.getMacro()) {
                focusControl.setMacro(true);
            }
            if (focusControl.isAutoFocusSupported()) {
                focusControl.setFocus(FocusControl.AUTO);
                try {
                    // let it focus...
                    Thread.sleep(FOCUS_TIME_MS);
                } catch (InterruptedException ie) {
                // continue
                }
                focusControl.setFocus(FocusControl.AUTO_LOCK);
            }
        } catch (MediaException me) {
        // continue
        }
    }
}
Also used : FocusControl(javax.microedition.amms.control.camera.FocusControl) MediaException(javax.microedition.media.MediaException)

Aggregations

FocusControl (javax.microedition.amms.control.camera.FocusControl)2 MediaException (javax.microedition.media.MediaException)2