applicationId "net.osdn.gokigen.gr2control"
minSdkVersion 14
targetSdkVersion 28
- versionCode 1001001
- versionName "1.1.1"
+ versionCode 1001002
+ versionName "1.1.2"
}
buildTypes {
release {
private final RicohGr2MovieShotControl movieShotControl;
private final ICameraStatus cameraStatus;
private final boolean useGrCommand;
+ private final boolean captureAfterAf;
/**
*
*
*/
- public RicohGr2CameraCaptureControl(boolean useGrCommand, @NonNull IAutoFocusFrameDisplay frameDisplayer, @NonNull ICameraStatus cameraStatus)
+ public RicohGr2CameraCaptureControl(boolean useGrCommand, boolean captureAfterAf, @NonNull IAutoFocusFrameDisplay frameDisplayer, @NonNull ICameraStatus cameraStatus)
{
this.useGrCommand = useGrCommand;
+ this.captureAfterAf = captureAfterAf;
this.cameraStatus = cameraStatus;
singleShotControl = new RicohGr2SingleShotControl(frameDisplayer);
movieShotControl = new RicohGr2MovieShotControl(frameDisplayer);
}
else
{
- singleShotControl.singleShot(useGrCommand);
+ singleShotControl.singleShot(useGrCommand, captureAfterAf);
}
}
catch (Exception e)
*
*
*/
- public void singleShot(final boolean isCamera)
+ public void singleShot(final boolean isCamera, final boolean isDriveAutoFocus)
{
Log.v(TAG, "singleShot()");
try
{
try
{
- //String postData = (isCamera) ? "af=camera" : "af=on";
- String postData = (isCamera) ? "af=camera" : "";
+ String postData = "";
+ if ((isCamera)&&(isDriveAutoFocus))
+ {
+ // RICOH GR II
+ postData = "af=camera";
+ }
+ else if ((!isCamera)&&(isDriveAutoFocus))
+ {
+ // PENTAX DSLR
+ postData = "af=on";
+ }
String result = SimpleHttpClient.httpPost(shootUrl, postData, timeoutMs);
if ((result == null)||(result.length() < 1))
{
private final RicohGr2HardwareStatus hardwareStatus;
private final RicohGr2RunMode runMode;
private final boolean useGrCommand;
+ private final boolean pentaxCaptureAfterAf;
private RicohGr2LiveViewControl liveViewControl;
private RicohGr2CameraCaptureControl captureControl;
{
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
useGrCommand = preferences.getBoolean(IPreferencePropertyAccessor.USE_GR2_SPECIAL_COMMAND, true);
+ pentaxCaptureAfterAf = preferences.getBoolean(IPreferencePropertyAccessor.PENTAX_CAPTURE_AFTER_AF, false);
//this.activity = context;
//this.provider = provider;
{
Log.v(TAG, "injectDisplay()");
focusControl = new RicohGr2CameraFocusControl(useGrCommand, frameDisplayer, indicator);
- captureControl = new RicohGr2CameraCaptureControl(useGrCommand, frameDisplayer, statusChecker);
+ captureControl = new RicohGr2CameraCaptureControl(useGrCommand, pentaxCaptureAfterAf, frameDisplayer, statusChecker);
}
@Override
String USE_GR2_SPECIAL_COMMAND = "use_gr2_special_command";
+ String PENTAX_CAPTURE_AFTER_AF = "pentax_capture_after_auto_focus";
+
String DIGITAL_ZOOM_LEVEL = "digital_zoom_level";
String DIGITAL_ZOOM_LEVEL_DEFAULT_VALUE = "1.0";
if (!items.containsKey(IPreferencePropertyAccessor.USE_GR2_SPECIAL_COMMAND)) {
editor.putBoolean(IPreferencePropertyAccessor.USE_GR2_SPECIAL_COMMAND, true);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.PENTAX_CAPTURE_AFTER_AF)) {
+ editor.putBoolean(IPreferencePropertyAccessor.PENTAX_CAPTURE_AFTER_AF, false);
+ }
editor.apply();
}
if (!items.containsKey(IPreferencePropertyAccessor.USE_GR2_SPECIAL_COMMAND)) {
editor.putBoolean(IPreferencePropertyAccessor.USE_GR2_SPECIAL_COMMAND, true);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.PENTAX_CAPTURE_AFTER_AF)) {
+ editor.putBoolean(IPreferencePropertyAccessor.PENTAX_CAPTURE_AFTER_AF, false);
+ }
editor.apply();
}
catch (Exception e)
Log.v(TAG, " " + key + " , " + value);
break;
+ case IPreferencePropertyAccessor.PENTAX_CAPTURE_AFTER_AF:
+ value = preferences.getBoolean(key, false);
+ Log.v(TAG, " " + key + " , " + value);
+ break;
+
default:
String strValue = preferences.getString(key, "");
setListPreference(key, key, strValue);
setBooleanPreference(IPreferencePropertyAccessor.GR2_LCD_SLEEP, IPreferencePropertyAccessor.GR2_LCD_SLEEP, defaultValue);
setBooleanPreference(IPreferencePropertyAccessor.SHARE_AFTER_SAVE, IPreferencePropertyAccessor.SHARE_AFTER_SAVE, defaultValue);
setBooleanPreference(IPreferencePropertyAccessor.USE_GR2_SPECIAL_COMMAND, IPreferencePropertyAccessor.USE_GR2_SPECIAL_COMMAND, defaultValue);
+ setBooleanPreference(IPreferencePropertyAccessor.PENTAX_CAPTURE_AFTER_AF, IPreferencePropertyAccessor.PENTAX_CAPTURE_AFTER_AF, false);
}
catch (Exception e)
{
<string name="pref_gr2_display_mode">ディスプレイモード</string>
<string name="pref_gr2_display_camera_view">ディスプレイミラーモード</string>
<string name="pref_gr2_display_camera_view_summary">カメラのLCD画面をそのまま表示します。</string>
+ <string name="pref_pentax_capture_after_auto_focus">AF動作後に撮影(PENTAX)</string>
+ <string name="summary_pentax_capture_after_auto_focus">AF動作後に撮影します。(PENTAX DSLR, 再起動が必要)</string>
<string name="pref_gr2_lcd_sleep">接続時にカメラのLCDをオフにする</string>
<string name="pref_cat_camera">カメラ設定</string>
<string name="pref_cat_initialize">起動時設定</string>
<string name="pref_use_gr2_special_command">Use GR2 Special Command</string>
<string name="summary_use_gr2_special_command">Use some GR2 special command.</string>
+ <string name="pref_pentax_capture_after_auto_focus">Capture after AF(PENTAX)</string>
+ <string name="summary_pentax_capture_after_auto_focus">Capture after AF.(for PENTAX DSLR, need restart)</string>
+
<string name="dialog_confirm_title_output_log">Share debug log</string>
<string name="dialog_confirm_message_output_log">Share the debug log, OK?</string>
android:title="@string/pref_use_gr2_special_command"
android:summary="@string/summary_use_gr2_special_command"
/>
+
+ <CheckBoxPreference
+ android:key="pentax_capture_after_auto_focus"
+ android:title="@string/pref_pentax_capture_after_auto_focus"
+ android:summary="@string/summary_pentax_capture_after_auto_focus"
+ />
+
</PreferenceCategory>
<PreferenceCategory