*.iml
.gradle
+.project
.idea
/local.properties
/.idea/libraries
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>gr2control</name>
+ <comment>Project gr2control created by Buildship.</comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.buildship.core.gradleprojectbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+arguments=
+auto.sync=false
+build.scans.enabled=false
+connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
+connection.project.dir=
+eclipse.preferences.version=1
+gradle.user.home=
+java.home=C\:/Program Files/Java/jdk1.8.0_112
+jvm.arguments=
+offline.mode=false
+override.workspace.settings=true
+show.console.view=true
+show.executions.view=true
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
+ <classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
+ <classpathentry kind="output" path="bin/default"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>app</name>
+ <comment>Project app created by Buildship.</comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.buildship.core.gradleprojectbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+connection.project.dir=..
+eclipse.preferences.version=1
--- /dev/null
+package net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.messages;
+
+
+
+import androidx.annotation.NonNull;
+
+import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.IFujiXCommandCallback;
+import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.IFujiXMessages;
+
+public class GetScreenNail extends FujiXCommandBase
+{
+ private final IFujiXCommandCallback callback;
+ private final byte lower;
+ private final byte upper;
+ private final byte data0;
+ private final byte data1;
+ private final byte data2;
+ private final byte data3;
+
+ public GetScreenNail(int indexNumber, int imageSize, @NonNull IFujiXCommandCallback callback)
+ {
+ this.lower = ((byte) (0x000000ff & indexNumber));
+ this.upper = ((byte)((0x0000ff00 & indexNumber) >> 8));
+
+ data0 = ((byte) (0x000000ff & imageSize));
+ data1 = ((byte)((0x0000ff00 & imageSize) >> 8));
+ data2 = ((byte)((0x00ff0000 & imageSize) >> 16));
+ data3 = ((byte)((0xff000000 & imageSize) >> 24));
+ this.callback = callback;
+ }
+
+ @Override
+ public IFujiXCommandCallback responseCallback()
+ {
+ return (callback);
+ }
+
+ @Override
+ public int getId()
+ {
+ return (IFujiXMessages.SEQ_FULL_IMAGE);
+ }
+
+ @Override
+ public byte[] commandBody()
+ {
+ return (new byte[] {
+
+ // message_header.index : uint16 (0: terminate, 2: two_part_message, 1: other)
+ (byte)0x01, (byte)0x00,
+
+ // message_header.type : full_image (0x101b)
+ (byte)0x1b, (byte)0x10,
+
+ // sequence number
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+
+ // data ... (index number)
+ lower, upper, (byte)0x00, (byte)0x00,
+
+ // 現物合わせ1 : 0~
+ (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+
+ // 現物合わせ2 : ~0x01000000 bytes
+ data0, data1, data2, data3,
+ });
+ }
+ @Override
+ public boolean dumpLog()
+ {
+ return (false);
+ }
+}
package net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.playback;
import android.app.Activity;
+import android.content.SharedPreferences;
import android.util.Log;
import android.util.SparseArray;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.preference.PreferenceManager;
import net.osdn.gokigen.gr2control.camera.ICameraFileInfo;
import net.osdn.gokigen.gr2control.camera.ICameraStatus;
import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.IFujiXCommandPublisher;
import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.messages.GetFullImage;
import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.messages.GetImageInfo;
+import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.messages.GetScreenNail;
import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.messages.GetThumbNail;
+import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.messages.SetPropertyValue;
import net.osdn.gokigen.gr2control.camera.playback.ICameraContent;
import net.osdn.gokigen.gr2control.camera.playback.IContentInfoCallback;
import net.osdn.gokigen.gr2control.camera.playback.IDownloadContentCallback;
import net.osdn.gokigen.gr2control.camera.playback.ICameraContentListCallback;
import net.osdn.gokigen.gr2control.camera.playback.IDownloadThumbnailImageCallback;
import net.osdn.gokigen.gr2control.camera.playback.IPlaybackControl;
+import net.osdn.gokigen.gr2control.preference.IPreferencePropertyAccessor;
import java.util.ArrayList;
import java.util.List;
@Override
public void downloadContentScreennail(@Nullable String path, @NonNull String name, @NonNull IDownloadThumbnailImageCallback callback)
{
- // Thumbnail と同じ画像を表示する
- downloadContentThumbnail(path, name, callback);
+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
+ boolean useSmallImage = preferences.getBoolean(IPreferencePropertyAccessor.FUJI_X_GET_SCREENNAIL_AS_SMALL_PICTURE, false);
+ if (useSmallImage)
+ {
+ // small image を表示する
+ downloadContentScreennailImpl(path, name, callback);
+ }
+ else
+ {
+ // Thumbnail と同じ画像を表示する
+ downloadContentThumbnail(path, name, callback);
+ }
+ }
+
+ private void downloadContentScreennailImpl(@Nullable String path, @NonNull String name, @NonNull IDownloadThumbnailImageCallback callback)
+ {
+ try
+ {
+ Log.v(TAG, " ----- downloadContentScreennailImpl() ");
+ int start = 0;
+ if (name.indexOf("/") == 0)
+ {
+ start = 1;
+ }
+ Log.v(TAG, " downloadContentThumbnail() : " + path + " " + name);
+ int index = getIndexNumber(start, name);
+ if ((index > 0)&&(index <= imageContentInfo.size()))
+ {
+ IFujiXCommandPublisher publisher = provider.getCommandPublisher();
+ FujiXImageContentInfo contentInfo = imageContentInfo.get(index);
+ if (contentInfo.isReceived())
+ {
+ if (!contentInfo.isMovie())
+ {
+ // スモール画像を取得する (たぶんこのシーケンスでいけるはず...)
+ publisher.enqueueCommand(new SetPropertyValue(new FujiXReplyReceiver(), 0xd226, 2, 0x0001));
+ publisher.enqueueCommand(new SetPropertyValue(new FujiXReplyReceiver(), 0xd227, 2, 0x0001));
+ publisher.enqueueCommand(new GetScreenNail(index, 0x00800000, new FujiXThumbnailImageReceiver(activity, callback)));
+ publisher.enqueueCommand(new SetPropertyValue(new FujiXReplyReceiver(), 0xd226, 2, 0x0000));
+ publisher.enqueueCommand(new SetPropertyValue(new FujiXReplyReceiver(), 0xd227, 2, 0x0001));
+ }
+ else
+ {
+ // movieの時は、Small画像を使えないのでThumbnailで代用する。
+ publisher.enqueueCommand(new GetThumbNail(index, new FujiXThumbnailImageReceiver(activity, callback)));
+ }
+ }
+ else
+ {
+ // まだ、ファイル情報を受信していない場合は、サムネイルの情報を流用する
+ publisher.enqueueCommand(new GetImageInfo(index, index, contentInfo));
+ publisher.enqueueCommand(new GetThumbNail(index, new FujiXThumbnailImageReceiver(activity, callback)));
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
}
@Override
--- /dev/null
+package net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.playback;
+
+import android.util.Log;
+
+import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.IFujiXCommandCallback;
+import net.osdn.gokigen.gr2control.camera.utils.SimpleLogDumper;
+
+public class FujiXReplyReceiver implements IFujiXCommandCallback
+{
+ private final String TAG = toString();
+
+ @Override
+ public void receivedMessage(int id, byte[] rx_body)
+ {
+ try
+ {
+ SimpleLogDumper.dump_bytes(" RECV : ", rx_body);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void onReceiveProgress(int currentBytes, int totalBytes, byte[] rx_body)
+ {
+ Log.v(TAG, " " + currentBytes + "/" + totalBytes);
+ }
+
+ @Override
+ public boolean isReceiveMulti()
+ {
+ return (false);
+ }
+}
if (!items.containsKey(IPreferencePropertyAccessor.FUJI_X_COMMAND_POLLING_WAIT)) {
editor.putString(IPreferencePropertyAccessor.FUJI_X_COMMAND_POLLING_WAIT, IPreferencePropertyAccessor.FUJI_X_COMMAND_POLLING_WAIT_DEFAULT_VALUE);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.FUJI_X_GET_SCREENNAIL_AS_SMALL_PICTURE)) {
+ editor.putBoolean(IPreferencePropertyAccessor.FUJI_X_GET_SCREENNAIL_AS_SMALL_PICTURE, false);
+ }
editor.apply();
}
catch (Exception e)
String FUJI_X_COMMAND_POLLING_WAIT = "fujix_command_polling_wait";
String FUJI_X_COMMAND_POLLING_WAIT_DEFAULT_VALUE = "500";
+ String FUJI_X_GET_SCREENNAIL_AS_SMALL_PICTURE = "fujix_get_screennail_as_small_picture";
/*
//String GR2_DISPLAY_MODE = "gr2_display_mode";
if (!items.containsKey(IPreferencePropertyAccessor.FUJI_X_COMMAND_POLLING_WAIT)) {
editor.putString(IPreferencePropertyAccessor.FUJI_X_COMMAND_POLLING_WAIT, IPreferencePropertyAccessor.FUJI_X_COMMAND_POLLING_WAIT_DEFAULT_VALUE);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.FUJI_X_GET_SCREENNAIL_AS_SMALL_PICTURE)) {
+ editor.putBoolean(IPreferencePropertyAccessor.FUJI_X_GET_SCREENNAIL_AS_SMALL_PICTURE, false);
+ }
editor.apply();
}
catch (Exception e)
Log.v(TAG, " DISPLAY CAMERA VIEW : " + key + " , " + value);
break;
+ case IPreferencePropertyAccessor.FUJI_X_GET_SCREENNAIL_AS_SMALL_PICTURE:
+ value = preferences.getBoolean(key, false);
+ Log.v(TAG, " SMALL IMAGE AS SCREENNAIL : " + key + " , " + value);
+ break;
+
case IPreferencePropertyAccessor.SHARE_AFTER_SAVE:
value = preferences.getBoolean(key, false);
Log.v(TAG, " SHARE AFTER SAVE : " + key + " , " + value);
setBooleanPreference(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, defaultValue);
setBooleanPreference(IPreferencePropertyAccessor.USE_PLAYBACK_MENU, IPreferencePropertyAccessor.USE_PLAYBACK_MENU, defaultValue);
setBooleanPreference(IPreferencePropertyAccessor.FUJI_X_DISPLAY_CAMERA_VIEW, IPreferencePropertyAccessor.FUJI_X_DISPLAY_CAMERA_VIEW, false);
+ setBooleanPreference(IPreferencePropertyAccessor.FUJI_X_GET_SCREENNAIL_AS_SMALL_PICTURE, IPreferencePropertyAccessor.FUJI_X_GET_SCREENNAIL_AS_SMALL_PICTURE, false);
setBooleanPreference(IPreferencePropertyAccessor.SHARE_AFTER_SAVE, IPreferencePropertyAccessor.SHARE_AFTER_SAVE, defaultValue);
}
catch (Exception e)
if (!items.containsKey(IPreferencePropertyAccessor.FUJI_X_COMMAND_POLLING_WAIT)) {
editor.putString(IPreferencePropertyAccessor.FUJI_X_COMMAND_POLLING_WAIT, IPreferencePropertyAccessor.FUJI_X_COMMAND_POLLING_WAIT_DEFAULT_VALUE);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.FUJI_X_GET_SCREENNAIL_AS_SMALL_PICTURE)) {
+ editor.putBoolean(IPreferencePropertyAccessor.FUJI_X_GET_SCREENNAIL_AS_SMALL_PICTURE, false);
+ }
editor.apply();
}
if (!items.containsKey(IPreferencePropertyAccessor.FUJI_X_COMMAND_POLLING_WAIT)) {
editor.putString(IPreferencePropertyAccessor.FUJI_X_COMMAND_POLLING_WAIT, IPreferencePropertyAccessor.FUJI_X_COMMAND_POLLING_WAIT_DEFAULT_VALUE);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.FUJI_X_GET_SCREENNAIL_AS_SMALL_PICTURE)) {
+ editor.putBoolean(IPreferencePropertyAccessor.FUJI_X_GET_SCREENNAIL_AS_SMALL_PICTURE, false);
+ }
editor.apply();
}
catch (Exception e)
<string name="pref_fuji_x_exit_only">アプリ終了 (FUJI)</string>
<string name="pref_opc_exit_power_off">アプリ終了 (OPC)</string>
<string name="pref_ricoh_exit_power_off">アプリ終了 (RICOH)</string>
+
+ <string name="pref_fujix_get_screennail_as_small_picture">表示画像はスモール画像を使用</string>
+ <string name="pref_summary_fujix_get_screennail_as_small_picture">すこし時間がかかりますが、画像表示にスモール画像を使用します。</string>
</resources>
<string name="pref_fuji_x_exit_only">Exit Application (FUJI)</string>
<string name="pref_opc_exit_power_off">Exit Application (OPC)</string>
<string name="pref_ricoh_exit_power_off">Exit Application (RICOH)</string>
+
+ <string name="pref_fujix_get_screennail_as_small_picture">Use small image as detail screen</string>
+ <string name="pref_summary_fujix_get_screennail_as_small_picture">Use small size image for detail screen.</string>
</resources>
android:defaultValue="80"
android:summary="@string/pref_summary_fujix_liveview_wait" />
+ <CheckBoxPreference
+ android:key="fujix_get_screennail_as_small_picture"
+ android:title="@string/pref_fujix_get_screennail_as_small_picture"
+ android:summary="@string/pref_summary_fujix_get_screennail_as_small_picture" />
</PreferenceCategory>
<!--
<PreferenceCategory