// 埋め込むシーケンス番号の位置
int embeddedSequenceNumberIndex3();
+ // 予定している受信データのサイズ
+ int estimatedReceiveDataSize();
+
// 送信するメッセージボディ
byte[] commandBody();
private boolean receive_from_camera(@NonNull IPtpIpCommand command)
{
IPtpIpCommandCallback callback = command.responseCallback();
+ int delayMs = command.receiveDelayMs();
+ if ((delayMs < 0)||(delayMs > COMMAND_SEND_RECEIVE_DURATION_MAX))
+ {
+ delayMs = COMMAND_SEND_RECEIVE_DURATION_MS;
+ }
if ((callback != null)&&(callback.isReceiveMulti()))
{
// 受信したら逐次「受信したよ」と応答するパターン
- return (receive_multi(command));
+ return (receive_multi(command, delayMs));
}
// 受信した後、すべてをまとめて「受信したよ」と応答するパターン
- return (receive_single(command));
+ return (receive_single(command, delayMs));
}
- private boolean receive_single(@NonNull IPtpIpCommand command)
+ private boolean receive_single(@NonNull IPtpIpCommand command, int delayMs)
{
boolean isDumpReceiveLog = command.dumpLog();
int id = command.getId();
IPtpIpCommandCallback callback = command.responseCallback();
- int delayMs = command.receiveDelayMs();
- if ((delayMs < 0)||(delayMs > COMMAND_SEND_RECEIVE_DURATION_MAX))
- {
- delayMs = COMMAND_SEND_RECEIVE_DURATION_MS;
- }
-
try
{
int receive_message_buffer_size = BUFFER_SIZE;
private void receivedAllMessage(boolean isDumpReceiveLog, int id, byte[] body, IPtpIpCommandCallback callback)
{
- if (isDumpReceiveLog)
+ Log.v(TAG, "receivedAllMessage() : " + ((body == null) ? 0 : body.length) + " bytes.");
+ if ((isDumpReceiveLog)&&(body != null))
{
// ログに受信メッセージを出力する
- Log.v(TAG, "receivedAllMessage() : " + body.length + " bytes.");
dump_bytes("RECV[" + body.length + "] ", body);
}
if (callback != null)
}
}
- private boolean receive_multi(@NonNull IPtpIpCommand command)
+ private boolean receive_multi(@NonNull IPtpIpCommand command, int delayMs)
{
+ int estimatedSize = command.estimatedReceiveDataSize();
int id = command.getId();
IPtpIpCommandCallback callback = command.responseCallback();
- int delayMs = command.receiveDelayMs();
- if ((delayMs < 0)||(delayMs > COMMAND_SEND_RECEIVE_DURATION_MAX))
- {
- delayMs = COMMAND_SEND_RECEIVE_DURATION_MS;
- }
try
{
if (read_bytes < 0)
{
// リトライオーバー...
- Log.v(TAG, " RECEIVE : RETRY OVER...");
+ Log.v(TAG, " RECEIVE : RETRY OVER......");
return (true);
}
read_bytes = is.read(byte_array, 0, receive_message_buffer_size);
if (read_bytes <= 0)
{
- Log.v(TAG, " RECEIVED MESSAGE FINISHED (" + read_bytes + ")");
+ Log.v(TAG, " RECEIVED MESSAGE FINISHED (" + read_bytes + ")");
break;
}
received_length = received_length + read_bytes;
//Log.v(TAG, " --- CALL : read_bytes : "+ read_bytes + " total_read : " + received_length + " : total_length : " + target_length + " buffer SIZE : " + byte_array.length);
callback.onReceiveProgress(received_length, target_length, Arrays.copyOfRange(byte_array, 0, read_bytes));
}
-
//byteStream.write(byte_array, 0, read_bytes);
- sleep(delayMs);
- read_bytes = is.available();
+
+ do
+ {
+ sleep(delayMs);
+ read_bytes = is.available();
+ Log.v(TAG, " is.available() read_bytes : " + read_bytes + " " + received_length + " < " + estimatedSize);
+ } while ((read_bytes == 0)&&(estimatedSize > 0)&&(received_length < estimatedSize));
}
//ByteArrayOutputStream outputStream = cutHeader(byteStream);
//receivedMessage(isDumpReceiveLog, id, outputStream.toByteArray(), callback);
// 終了報告...一時的?
if (callback != null)
{
+ Log.v(TAG, " --- receive_multi : receivedMessage() : " + id + " (" + read_bytes + ") [" + estimatedSize + "] " + receive_message_buffer_size + " (" + received_length + ")");
callback.receivedMessage(id, null);
}
System.gc();
}
@Override
+ public int estimatedReceiveDataSize()
+ {
+ return (-1);
+ }
+
+ @Override
public byte[] commandBody()
{
return (new byte[12]);
--- /dev/null
+package net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages;
+
+import androidx.annotation.NonNull;
+
+import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.IPtpIpCommandCallback;
+
+public class PtpIpCommandCanonGetPartialObject extends PtpIpCommandBase
+{
+ private final IPtpIpCommandCallback callback;
+ private final boolean isDumpLog;
+ private final int id;
+ private final int holdId;
+ private final int estimatedObjectSize;
+
+ private final byte data0;
+ private final byte data1;
+ private final byte data2;
+ private final byte data3;
+
+ private final byte data4;
+ private final byte data5;
+ private final byte data6;
+ private final byte data7;
+
+ private final byte data8;
+ private final byte data9;
+ private final byte dataA;
+ private final byte dataB;
+
+ public PtpIpCommandCanonGetPartialObject(@NonNull IPtpIpCommandCallback callback, int id, boolean isDumpLog, int holdId, int value, int value2, int value3, int estimatedObjectSize)
+ {
+ this.callback = callback;
+ this.isDumpLog = isDumpLog;
+ this.estimatedObjectSize = estimatedObjectSize;
+
+ this.id = id;
+ this.holdId = holdId;
+
+ data0 = ((byte) (0x000000ff & value));
+ data1 = ((byte)((0x0000ff00 & value) >> 8));
+ data2 = ((byte)((0x00ff0000 & value) >> 16));
+ data3 = ((byte)((0xff000000 & value) >> 24));
+
+ data4 = ((byte) (0x000000ff & value2));
+ data5 = ((byte)((0x0000ff00 & value2) >> 8));
+ data6 = ((byte)((0x00ff0000 & value2) >> 16));
+ data7 = ((byte)((0xff000000 & value2) >> 24));
+
+ data8 = ((byte) (0x000000ff & value3));
+ data9 = ((byte)((0x0000ff00 & value3) >> 8));
+ dataA = ((byte)((0x00ff0000 & value3) >> 16));
+ dataB = ((byte)((0xff000000 & value3) >> 24));
+ }
+
+ @Override
+ public IPtpIpCommandCallback responseCallback()
+ {
+ return (callback);
+ }
+
+ @Override
+ public int estimatedReceiveDataSize()
+ {
+ return (estimatedObjectSize);
+ }
+
+ @Override
+ public int getId()
+ {
+ return (id);
+ }
+
+ @Override
+ public int receiveDelayMs()
+ {
+ return (20);
+ }
+
+ @Override
+ public byte[] commandBody()
+ {
+ return (new byte[]{
+ // packet type
+ (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+
+ // data phase info
+ (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+
+ // operation code
+ (byte) 0x07, (byte) 0x91,
+
+ // sequence number
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+
+ // data ...
+ data0, data1, data2, data3,
+ data4, data5, data6, data7,
+ data8, data9, dataA, dataB,
+ });
+ }
+
+ @Override
+ public int getHoldId()
+ {
+ return (holdId);
+ }
+
+ @Override
+ public boolean dumpLog()
+ {
+ return (isDumpLog);
+ }
+
+}
private final int bodySize;
private final int id;
private final int holdId;
+ private final int estimatedObjectSize;
private final byte opCode0;
private final byte opCode1;
this.callback = callback;
this.bodySize = 0;
this.isDumpLog = isDumpLog;
+ this.estimatedObjectSize = -1;
this.id = id;
this.holdId = holdId;
this.callback = callback;
this.bodySize = bodySize;
this.isDumpLog = isDumpLog;
+ this.estimatedObjectSize = -1;
this.id = id;
this.holdId = holdId;
this.callback = callback;
this.bodySize = bodySize;
this.isDumpLog = isDumpLog;
+ this.estimatedObjectSize = -1;
this.id = id;
this.holdId = holdId;
this.callback = callback;
this.bodySize = bodySize;
this.isDumpLog = isDumpLog;
+ this.estimatedObjectSize = -1;
this.id = id;
this.holdId = holdId;
this.callback = callback;
this.bodySize = bodySize;
this.isDumpLog = isDumpLog;
+ this.estimatedObjectSize = -1;
this.id = id;
this.holdId = holdId;
}
@Override
+ public int estimatedReceiveDataSize()
+ {
+ return (estimatedObjectSize);
+ }
+
+ @Override
public byte[] commandBody()
{
if (bodySize == 2)
import net.osdn.gokigen.pkremote.camera.interfaces.playback.IProgressEvent;
import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.IPtpIpCommandCallback;
import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.IPtpIpCommandPublisher;
+import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.PtpIpCommandCanonGetPartialObject;
import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.PtpIpCommandGeneric;
import java.io.ByteArrayOutputStream;
private final IPtpIpCommandPublisher publisher;
private IDownloadContentCallback callback = null;
+ private boolean isReceiveMulti = true;
private int objectId = 0;
private int received_total_bytes = 0;
this.callback = callback;
this.objectId = objectId;
this.target_image_size = imageSize;
+ this.isReceiveMulti = true;
Log.v(TAG, " getPartialObject (id : " + objectId + ", size:" + imageSize + ")");
- publisher.enqueueCommand(new PtpIpCommandGeneric(this, (objectId + 1), false, objectId, 0x9107, 12, objectId, 0x00, imageSize)); // 0x9107 : GetPartialObject
+ publisher.enqueueCommand(new PtpIpCommandCanonGetPartialObject(this, (objectId + 1), false, objectId, objectId, 0x00, imageSize, imageSize)); // 0x9107 : GetPartialObject
}
@Override
@Override
public boolean isReceiveMulti()
{
- return (true);
+ return (isReceiveMulti);
}
private void getPartialObjectFinished()
{
// すべてのデータを受信した後に...終わりを送信する
Log.v(TAG, " getPartialObjectFinished(), id : " + objectId + " (size : " + target_image_size + ")");
+ isReceiveMulti = false;
publisher.enqueueCommand(new PtpIpCommandGeneric(this, (objectId + 2), false, objectId, 0x9117, 4,0x01)); // 0x9117 : TransferComplete
}
catch (Throwable t)
private final PtpIpFullImageReceiver fullImageReceiver;
private final PtpIpSmallImageReceiver smallImageReciever;
private String raw_suffix = "CR2";
+ private boolean use_screennail_image = false;
private CanonImageObjectReceiver canonImageObjectReceiver;
public PtpIpPlaybackControl(Activity activity, PtpIpInterfaceProvider provider)
{
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
raw_suffix = preferences.getString(IPreferencePropertyAccessor.CANON_RAW_SUFFIX, IPreferencePropertyAccessor.CANON_RAW_SUFFIX_DEFAULT_VALUE);
+ use_screennail_image = preferences.getBoolean(IPreferencePropertyAccessor.CANON_USE_SCREENNAIL_AS_SMALL, false);
}
catch (Exception e)
{
{
Log.v(TAG, " downloadContentScreennail() " + path);
- // Thumbnail と同じ画像を表示する
- //downloadContentThumbnail(path, callback);
+ if (!use_screennail_image)
+ {
+ // Thumbnail と同じ画像を表示する
+ downloadContentThumbnail(path, callback);
+ return;
+ }
try
{
import android.graphics.BitmapFactory;
import android.util.Log;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import net.osdn.gokigen.pkremote.camera.interfaces.playback.IDownloadThumbnailImageCallback;
import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.specific.CanonGetPartialObject;
import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.specific.CanonRequestInnerDevelopEnd;
-public class PtpIpScreennailImageReceiver implements IPtpIpCommandCallback
+public class PtpIpScreennailImageReceiver implements IPtpIpCommandCallback
{
private static final String TAG = PtpIpScreennailImageReceiver.class.getSimpleName();
this.publisher = publisher;
this.objectId = objectId;
Log.v(TAG, "PtpIpScreennailImageReceiver CREATED : " + objectId);
-
}
@Override
{
try
{
+ /*
if (rx_body != null)
{
Log.v(TAG, " receivedMessage() : " + id + " " + rx_body.length + " bytes.");
{
Log.v(TAG, " receivedMessage() : " + id + " NULL.");
}
+ */
if (id == objectId)
{
getRequestStatusEvent(rx_body);
}
else if (id == objectId + 4)
{
- Log.v(TAG, " RECEIVED : " + id);
+ Log.v(TAG, " GET SCREEN NAIL COMPLETED : " + id);
}
else if (id == objectId + 5)
{
{
pictureLength = 0x02000;
}
- publisher.enqueueCommand(new CanonGetPartialObject(this, (objectId + 1), true, objectId, 0, pictureLength));
+ publisher.enqueueCommand(new CanonGetPartialObject(this, (objectId + 1), false, objectId, 0, pictureLength));
}
private void getRequestStatusEvent(byte[] rx_body)
{
Log.v(TAG, " getRequestStatusEvent : " + objectId);
- publisher.enqueueCommand(new PtpIpCommandGeneric(this, (objectId + 5), true, objectId, 0x9116));
+ publisher.enqueueCommand(new PtpIpCommandGeneric(this, (objectId + 5), false, objectId, 0x9116));
}
- private void getPartialObject(byte[] rx_body)
+ private void getPartialObject(@NonNull byte[] rx_body)
{
try
{
Log.v(TAG, " getPartialObject(), id : " + objectId + " size: " + rx_body.length);
-
BitmapFactory.Options opt = new BitmapFactory.Options();
try
{
catch (Throwable ex)
{
ex.printStackTrace();
- Log.v(TAG, " LENGTH : " + ((rx_body != null) ? rx_body.length : 0));
+ Log.v(TAG, " LENGTH : " + (rx_body.length));
System.gc();
}
// 画像の縮小サイズを決定する (縦幅、横幅の小さいほうにあわせる)
catch (Throwable t)
{
t.printStackTrace();
- Log.v(TAG, " LENGTH : " + ((rx_body != null) ? rx_body.length : 0));
+ Log.v(TAG, " LENGTH : " + (rx_body.length));
System.gc();
}
- publisher.enqueueCommand(new PtpIpCommandGeneric(this, (objectId + 2), true, objectId, 0x9117, 4,0x01)); // 0x9117 : TransferComplete
+ publisher.enqueueCommand(new PtpIpCommandGeneric(this, (objectId + 2), false, objectId, 0x9117, 4,0x01)); // 0x9117 : TransferComplete
// ファイルにバイナリデータをダンプする
// binaryOutputToFile(activity, objectId + "_", rx_body);
private void requestInnerDevelopEnd()
{
Log.v(TAG, " requestInnerDevelopEnd() : " + objectId);
- publisher.enqueueCommand(new CanonRequestInnerDevelopEnd(this, (objectId + 3), true, objectId)); // 0x9143 : RequestInnerDevelopEnd
+ publisher.enqueueCommand(new CanonRequestInnerDevelopEnd(this, (objectId + 3), false, objectId)); // 0x9143 : RequestInnerDevelopEnd
}
private void finishedGetScreeennail()
import net.osdn.gokigen.pkremote.camera.utils.SimpleLogDumper;
import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.IPtpIpCommandCallback;
import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.IPtpIpCommandPublisher;
+import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.PtpIpCommandCanonGetPartialObject;
import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.PtpIpCommandGeneric;
import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.specific.CanonRequestInnerDevelopEnd;
import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.specific.CanonRequestInnerDevelopStart;
@Override
public void receivedMessage(int id, byte[] rx_body) {
Log.v(TAG, " getRequestStatusEvent : " + objectId + " " + ((rx_body != null) ? rx_body.length : 0));
- publisher.enqueueCommand(new PtpIpCommandGeneric(mine, (objectId + 5), true, objectId, 0x9116));
+ publisher.enqueueCommand(new PtpIpCommandGeneric(mine, (objectId + 5), false, objectId, 0x9116));
}
@Override
public void onReceiveProgress(int currentBytes, int totalBytes, byte[] rx_body) {
-
}
@Override
public boolean isReceiveMulti() {
return (false);
}
- }, objectId, true, objectId, objectId)); // 0x9141 : RequestInnerDevelopStart
+ }, objectId, false, objectId, objectId)); // 0x9141 : RequestInnerDevelopStart
}
@Override
{
try
{
- if (rx_body != null)
- {
- Log.v(TAG, " receivedMessage() : " + id + " " + rx_body.length + " bytes.");
- }
- else
- {
- Log.v(TAG, " receivedMessage() : " + id + " NULL.");
- }
if (id == objectId + 1)
{
sendTransferComplete(rx_body);
else if (id == objectId + 2)
{
Log.v(TAG, " requestInnerDevelopEnd() : " + objectId);
- publisher.enqueueCommand(new CanonRequestInnerDevelopEnd(this, (objectId + 3), true, objectId)); // 0x9143 : RequestInnerDevelopEnd
+ publisher.enqueueCommand(new CanonRequestInnerDevelopEnd(this, (objectId + 3), false, objectId)); // 0x9143 : RequestInnerDevelopEnd
}
else if (id == objectId + 3)
{
- Log.v(TAG, " --- SMALL IMAGE RECV FINISHED. : " + objectId + " --- ");
+ //Log.v(TAG, " --- COMMAND RESET : " + objectId + " --- ");
// リセットコマンドを送ってみる
publisher.enqueueCommand(new PtpIpCommandGeneric(this, (objectId + 4), false, objectId, 0x902f));
else if (id == objectId + 4)
{
// 画像取得終了
- Log.v(TAG, " RECEIVED : " + id);
+ Log.v(TAG, " ----- SMALL IMAGE RECEIVE SEQUENCE FINISHED : " + objectId);
callback.onCompleted();
this.objectId = 0;
this.callback = null;
}
else if (id == objectId + 5)
{
- Log.v(TAG, " RECEIVED STATUS EVENT : " + id);
requestGetPartialObject(rx_body);
}
else
}
else if (received_remain_bytes > 0)
{
-
- Log.v(TAG, " >>> [ remain_bytes : " + received_remain_bytes + "] ( length : " + length + ") " + data_position);
- SimpleLogDumper.dump_bytes("[zzz]", Arrays.copyOfRange(rx_body, data_position, (data_position + 160)));
+ //Log.v(TAG, " >>> [ remain_bytes : " + received_remain_bytes + "] ( length : " + length + ") " + data_position);
+ //SimpleLogDumper.dump_bytes("[zzz]", Arrays.copyOfRange(rx_body, data_position, (data_position + 160)));
// データの読み込みが途中だった場合...
if (length < received_remain_bytes)
if (body_size <= 12)
{
Log.v(TAG, " BODY SIZE IS SMALL : " + data_position + " (" + body_size + ") [" + received_remain_bytes + "] " + rx_body.length + " ");
-
- int startpos = (data_position > 48) ? (data_position - 48) : 0;
- SimpleLogDumper.dump_bytes("[xxx]", Arrays.copyOfRange(rx_body, startpos, (data_position + 48)));
-
+ //int startpos = (data_position > 48) ? (data_position - 48) : 0;
+ //SimpleLogDumper.dump_bytes("[xxx]", Arrays.copyOfRange(rx_body, startpos, (data_position + 48)));
break;
}
- Log.v(TAG, " RX DATA : " + data_position + " (" + body_size + ") [" + received_remain_bytes + "] (" + received_total_bytes + ")");
- SimpleLogDumper.dump_bytes("[yyy] " + data_position + ": ", Arrays.copyOfRange(rx_body, data_position, (data_position + 64)));
-
-
+ // Log.v(TAG, " RX DATA : " + data_position + " (" + body_size + ") [" + received_remain_bytes + "] (" + received_total_bytes + ")");
+ //SimpleLogDumper.dump_bytes("[yyy] " + data_position + ": ", Arrays.copyOfRange(rx_body, data_position, (data_position + 64)));
if ((data_position + body_size) > length)
{
// データがすべてバッファ内になかったときは、バッファすべてコピーして残ったサイズを記憶しておく。
byteStream.write(rx_body, (data_position + 12), copysize);
received_remain_bytes = body_size - copysize - 12; // マイナス12は、ヘッダ分
received_total_bytes = received_total_bytes + copysize;
- Log.v(TAG, " --- copy : " + (data_position + 12) + " " + copysize + " remain : " + received_remain_bytes + " body size : " + body_size);
+ // Log.v(TAG, " --- copy : " + (data_position + 12) + " " + copysize + " remain : " + received_remain_bytes + " body size : " + body_size);
break;
}
try
byteStream.write(rx_body, (data_position + 12), (body_size - 12));
data_position = data_position + body_size;
received_total_bytes = received_total_bytes + 12;
- Log.v(TAG, " --- COPY : " + (data_position + 12) + " " + (body_size - 12) + " remain : " + received_remain_bytes);
-
+ //Log.v(TAG, " --- COPY : " + (data_position + 12) + " " + (body_size - 12) + " remain : " + received_remain_bytes);
}
catch (Exception e)
{
{
pictureLength = 0x020000;
}
- publisher.enqueueCommand(new PtpIpCommandGeneric(this, (objectId + 1), true, objectId, 0x9107, 12, 0x01, 0x00, pictureLength));
+ publisher.enqueueCommand(new PtpIpCommandCanonGetPartialObject(this, (objectId + 1), false, objectId, 0x01, 0x00, pictureLength, pictureLength));
}
private void sendTransferComplete(byte[] rx_body)
{
Log.v(TAG, " sendTransferComplete(), id : " + objectId + " size: " + ((rx_body != null) ? rx_body.length : 0));
- publisher.enqueueCommand(new PtpIpCommandGeneric(this, (objectId + 2), true, objectId, 0x9117, 4,0x01)); // 0x9117 : TransferComplete
+ publisher.enqueueCommand(new PtpIpCommandGeneric(this, (objectId + 2), false, objectId, 0x9117, 4,0x01)); // 0x9117 : TransferComplete
isReceiveMulti = false;
}
}
String CANON_RAW_SUFFIX = "canon_raw_suffix";
String CANON_RAW_SUFFIX_DEFAULT_VALUE = "CR2";
+ String CANON_USE_SCREENNAIL_AS_SMALL = "canon_get_screennail_as_small_picture";
+
/*
//String GR2_DISPLAY_MODE = "gr2_display_mode";
//String GR2_DISPLAY_MODE_DEFAULT_VALUE = "0";
package net.osdn.gokigen.pkremote.preference.canon;
- import android.content.Context;
- import android.content.SharedPreferences;
- import android.os.Bundle;
- import android.util.Log;
-
- import java.util.Map;
-
- import androidx.annotation.NonNull;
- import androidx.appcompat.app.AppCompatActivity;
- import androidx.fragment.app.FragmentActivity;
- import androidx.preference.CheckBoxPreference;
- import androidx.preference.ListPreference;
- import androidx.preference.Preference;
- import androidx.preference.PreferenceFragmentCompat;
- import androidx.preference.PreferenceManager;
-
- import net.osdn.gokigen.pkremote.R;
- import net.osdn.gokigen.pkremote.camera.vendor.ptpip.operation.PtpIpCameraPowerOff;
- import net.osdn.gokigen.pkremote.logcat.LogCatViewer;
- import net.osdn.gokigen.pkremote.preference.IPreferencePropertyAccessor;
- import net.osdn.gokigen.pkremote.scene.IChangeScene;
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.util.Log;
+
+import java.util.Map;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.fragment.app.FragmentActivity;
+import androidx.preference.CheckBoxPreference;
+import androidx.preference.ListPreference;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceFragmentCompat;
+import androidx.preference.PreferenceManager;
+
+import net.osdn.gokigen.pkremote.R;
+import net.osdn.gokigen.pkremote.camera.vendor.ptpip.operation.PtpIpCameraPowerOff;
+import net.osdn.gokigen.pkremote.logcat.LogCatViewer;
+import net.osdn.gokigen.pkremote.preference.IPreferencePropertyAccessor;
+import net.osdn.gokigen.pkremote.scene.IChangeScene;
/**
*
if (!items.containsKey(IPreferencePropertyAccessor.CANON_RAW_SUFFIX)) {
editor.putString(IPreferencePropertyAccessor.CANON_RAW_SUFFIX, IPreferencePropertyAccessor.CANON_RAW_SUFFIX_DEFAULT_VALUE);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.CANON_USE_SCREENNAIL_AS_SMALL)) {
+ editor.putBoolean(IPreferencePropertyAccessor.CANON_USE_SCREENNAIL_AS_SMALL, false);
+ }
editor.apply();
}
catch (Exception e)
Log.v(TAG, " " + key + " , " + value);
break;
+ case IPreferencePropertyAccessor.CANON_USE_SCREENNAIL_AS_SMALL:
+ value = preferences.getBoolean(key, false);
+ Log.v(TAG, " " + key + " , " + value);
+ break;
+
default:
String strValue = preferences.getString(key, "");
setListPreference(key, key, strValue);
{
super.onResume();
Log.v(TAG, "onResume() Start");
-
try
{
synchronizedProperty();
{
e.printStackTrace();
}
-
Log.v(TAG, "onResume() End");
-
}
/**
// Preferenceの画面に反映させる
setBooleanPreference(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, true);
setBooleanPreference(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, true);
+ setBooleanPreference(IPreferencePropertyAccessor.CANON_USE_SCREENNAIL_AS_SMALL, IPreferencePropertyAccessor.CANON_USE_SCREENNAIL_AS_SMALL, false);
}
catch (Exception e)
{
});
}
}
-
}
<string name="canon_connect_connecting4">接続中…(4/5)</string>
<string name="canon_connect_connecting5">接続中…(5/5)</string>
+
+ <string name="pref_canon_get_screennail_as_small_picture">表示画像はスモール画像を使用</string>
+ <string name="pref_summary_canon_get_screennail_as_small_picture">すこし時間がかかりますが、画像表示にスモール画像を使用します。</string>
</resources>
<string name="canon_connect_connecting4">Connecting…(4/5)</string>
<string name="canon_connect_connecting5">Connecting…(5/5)</string>
+ <string name="pref_canon_get_screennail_as_small_picture">Use small image as screen nail</string>
+ <string name="pref_summary_canon_get_screennail_as_small_picture">Use small size image as </string>
</resources>
<PreferenceCategory
android:title="@string/pref_cat_camera">
+ <CheckBoxPreference
+ android:key="canon_get_screennail_as_small_picture"
+ android:title="@string/pref_canon_get_screennail_as_small_picture"
+ android:summary="@string/pref_summary_canon_get_screennail_as_small_picture" />
<EditTextPreference
android:key="canon_raw_suffix"