//this.provider = provider;
olympusPenConnection = new OlympusPenConnection(context, provider);
buttonControl = new OlympusPenButtonControl();
- playbackControl = new OlympusPenPlaybackControl(communicationTimeoutMs);
+ playbackControl = new OlympusPenPlaybackControl(context, communicationTimeoutMs);
hardwareStatus = new OlympusPenHardwareStatus();
runMode = new OlympusPenRunMode();
}
package net.osdn.gokigen.pkremote.camera.vendor.olympuspen.wrapper.playback;
+import android.app.Activity;
+import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.util.Log;
import net.osdn.gokigen.pkremote.camera.interfaces.playback.IPlaybackControl;
import net.osdn.gokigen.pkremote.camera.playback.ProgressEvent;
import net.osdn.gokigen.pkremote.camera.utils.SimpleHttpClient;
+import net.osdn.gokigen.pkremote.preference.IPreferencePropertyAccessor;
import java.util.HashMap;
import java.util.Map;
import androidx.annotation.NonNull;
+import androidx.preference.PreferenceManager;
/**
*
{
private final String TAG = toString();
private static final int DEFAULT_TIMEOUT = 3000;
+ private final Activity activity;
private final int timeoutValue;
private OlympusPenObjectDataHolder imageListHolder = new OlympusPenObjectDataHolder();
- public OlympusPenPlaybackControl(int timeoutMs)
+ public OlympusPenPlaybackControl(@NonNull Activity activity, int timeoutMs)
{
Log.v(TAG, "OlympusPenPlaybackControl()");
+ this.activity = activity;
this.timeoutValue = (timeoutMs < DEFAULT_TIMEOUT) ? DEFAULT_TIMEOUT : timeoutMs;
}
String url;
if ((isSmallSize)&&(path.contains(".JPG")))
{
+ String smallSize = "1600";
+ try
+ {
+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
+ smallSize = preferences.getString(IPreferencePropertyAccessor.PEN_SMALL_PICTURE_SIZE, IPreferencePropertyAccessor.PEN_SMALL_PICTURE_SIZE_DEFAULT_VALUE);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
// 縮小サイズで画像をとる
- url = "http://192.168.0.10/get_resizeimg.cgi?DIR=" + path + "&size=" + "1600";
+ url = "http://192.168.0.10/get_resizeimg.cgi?DIR=" + path + "&size=" + smallSize;
}
else
{
String SMALL_PICTURE_SIZE = "download_small_picture_size";
String SMALL_PICTURE_SIZE_DEFAULT_VALUE = "1600";
+ String PEN_SMALL_PICTURE_SIZE = "pen_download_small_picture_size";
+ String PEN_SMALL_PICTURE_SIZE_DEFAULT_VALUE = "1600";
+
+
String CAMERAKIT_VERSION = "camerakit_version";
String SHOW_GRID_STATUS = "show_grid";
if (!items.containsKey(IPreferencePropertyAccessor.SMALL_PICTURE_SIZE)) {
editor.putString(IPreferencePropertyAccessor.SMALL_PICTURE_SIZE, IPreferencePropertyAccessor.SMALL_PICTURE_SIZE_DEFAULT_VALUE);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.PEN_SMALL_PICTURE_SIZE)) {
+ editor.putString(IPreferencePropertyAccessor.PEN_SMALL_PICTURE_SIZE, IPreferencePropertyAccessor.PEN_SMALL_PICTURE_SIZE_DEFAULT_VALUE);
+ }
editor.apply();
}
if (!items.containsKey(IPreferencePropertyAccessor.CONNECTION_METHOD)) {
editor.putString(IPreferencePropertyAccessor.CONNECTION_METHOD, IPreferencePropertyAccessor.CONNECTION_METHOD_DEFAULT_VALUE);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.PEN_SMALL_PICTURE_SIZE)) {
+ editor.putString(IPreferencePropertyAccessor.PEN_SMALL_PICTURE_SIZE, IPreferencePropertyAccessor.PEN_SMALL_PICTURE_SIZE_DEFAULT_VALUE);
+ }
editor.apply();
}
catch (Exception e)
});
connectionMethod.setSummary(connectionMethod.getValue() + " ");
+ ListPreference smallPictureSize = findPreference(IPreferencePropertyAccessor.PEN_SMALL_PICTURE_SIZE);
+ smallPictureSize.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ preference.setSummary(newValue + " ");
+ return (true);
+ }
+ });
+ smallPictureSize.setSummary(smallPictureSize.getValue() + " ");
+
findPreference("exit_application").setOnPreferenceClickListener(powerOffController);
findPreference("debug_info").setOnPreferenceClickListener(logCatViewer);
}
<PreferenceCategory
android:title="@string/pref_cat_camera">
- <!--
-
- <PreferenceScreen
- android:key="sony_api_list"
- android:title="@string/pref_sony_api_list"
- android:summary="@string/pref_summary_sony_api_list" />
-
- <CheckBoxPreference
- android:key="use_smartphone_transfer_mode"
- android:title="@string/pref_sony_use_smartphone_transfer"
- android:summary="@string/pref_summary_sony_use_smartphone_transfer" />
-
- <CheckBoxPreference
- android:key="get_small_picture_as_vga"
- android:title="@string/pref_get_small_picture_as_vga"
- android:summary="@string/pref_summary_get_small_picture_as_vga" />
+ <ListPreference
+ android:title="@string/pref_download_small_picture_size"
+ android:entryValues="@array/pen_picture_quality_value"
+ android:entries="@array/pen_picture_quality"
+ android:key="pen_download_small_picture_size"
+ android:defaultValue="1600"/>
- <CheckBoxPreference
- android:key="capture_both_camera_and_live_view"
- android:title="@string/pref_capture_both_camera_and_live_view" />
- -->
</PreferenceCategory>
<PreferenceCategory