{
e.printStackTrace();
}
+ int maxCount = 3000; // デフォルトは 3000枚 とする
+ try
+ {
+ maxCount = Integer.parseInt(preferences.getString(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_MAX_COUNT, IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_MAX_COUNT_DEFAULT_VALUE));
+ if (maxCount < 300)
+ {
+ maxCount = 300; // 最小値は 300枚とする。
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
//this.activity = context;
//this.provider = provider;
zoomControl = new RicohGr2CameraZoomLensControl();
buttonControl = new RicohGr2CameraButtonControl();
statusChecker = new RicohGr2StatusChecker(500, useGrCommand);
- playbackControl = new RicohGr2PlaybackControl(statusChecker, useGrCommand, communicationTimeoutMs);
+ playbackControl = new RicohGr2PlaybackControl(statusChecker, useGrCommand, communicationTimeoutMs, maxCount);
hardwareStatus = new RicohGr2HardwareStatus();
runMode = new RicohGr2RunMode();
}
private final String getPhotoUrl = "http://192.168.0.1/v1/photos/";
private final RicohGr2StatusChecker statusChecker;
private static final int DEFAULT_TIMEOUT = 3000;
+ private static final int DEFAULT_MAX_COUNT = 300;
private final boolean useGrCommand;
private final int timeoutValue;
-
-
+ private final int maxCount;
/*****
[操作メモ]
動画をダウンロードする : http://192.168.0.1/v1/photos/yyyRICOH/R0000xxx.MOV?size=full
*****/
- RicohGr2PlaybackControl(RicohGr2StatusChecker statusChecker, boolean useGrCommand, int timeoutMs)
+ RicohGr2PlaybackControl(RicohGr2StatusChecker statusChecker, boolean useGrCommand, int timeoutMs, int maxCount)
{
this.statusChecker = statusChecker;
this.useGrCommand = useGrCommand;
this.timeoutValue = (timeoutMs < DEFAULT_TIMEOUT) ? DEFAULT_TIMEOUT : timeoutMs;
+ this.maxCount = (maxCount < DEFAULT_MAX_COUNT) ? DEFAULT_MAX_COUNT : maxCount;
}
@Override
public void downloadContentList(@NonNull IDownloadContentListCallback callback)
{
List<ICameraFileInfo> fileList = new ArrayList<>();
- String imageListurl = "http://192.168.0.1/v1/photos?limit=3000";
+ String imageListurl = "http://192.168.0.1/v1/photos?" + maxCount;
String contentList;
try
{
private void getCameraContentListImpl(ICameraContentListCallback callback)
{
List<ICameraContent> fileList = new ArrayList<>();
- String imageListurl = "http://192.168.0.1/v1/photos?limit=3000";
+ String imageListurl = "http://192.168.0.1/v1/photos?limit=" + maxCount;
String contentList;
try
{
String RICOH_GET_PICS_LIST_TIMEOUT = "ricoh_get_pics_list_timeout";
String RICOH_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE = "10";
-/*
+
+ String RICOH_GET_PICS_LIST_MAX_COUNT = "ricoh_get_pics_list_max_count";
+ String RICOH_GET_PICS_LIST_MAX_COUNT_DEFAULT_VALUE = "3000";
+
+
+ /*
//String GR2_DISPLAY_MODE = "gr2_display_mode";
//String GR2_DISPLAY_MODE_DEFAULT_VALUE = "0";
if (!items.containsKey(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT)) {
editor.putString(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_MAX_COUNT)) {
+ editor.putString(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_MAX_COUNT, IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_MAX_COUNT_DEFAULT_VALUE);
+ }
editor.apply();
}
catch (Exception e)
<string name="pref_ricoh_get_pics_list_timeout">撮影画像一覧取得時のタイムアウト(単位:秒)</string>
<string name="pref_summary_ricoh_get_pics_list_timeout">カメラ内の画像が多い場合は数を増やしてください。</string>
+
+ <string name="pref_ricoh_get_pics_list_max_count">撮影画像一覧で取得する最大枚数</string>
+ <string name="pref_summary_ricoh_get_pics_list_max_count">カメラ内の画像が多い場合は数を増やしてください。</string>
+
</resources>
<string name="pref_ricoh_get_pics_list_timeout">Get Pics List Timeout(unit: sec.)</string>
<string name="pref_summary_ricoh_get_pics_list_timeout">If the camera has many number of Pics, increase number.</string>
+ <string name="pref_ricoh_get_pics_list_max_count">Max Pics List Count</string>
+ <string name="pref_summary_ricoh_get_pics_list_max_count">If the camera has many number of Pics, increase number.</string>
</resources>
android:inputType="number"
android:summary="@string/pref_summary_ricoh_get_pics_list_timeout" />
+ <EditTextPreference
+ android:key="ricoh_get_pics_list_max_count"
+ android:title="@string/pref_ricoh_get_pics_list_max_count"
+ android:defaultValue="3000"
+ android:inputType="number"
+ android:summary="@string/pref_summary_ricoh_get_pics_list_max_count" />
+
</PreferenceCategory>
<PreferenceCategory