From 65dba4463b4ea721c2463323d8a9ba9d394da20c Mon Sep 17 00:00:00 2001 From: MRSa Date: Thu, 30 Jan 2020 23:42:42 +0900 Subject: [PATCH] =?utf8?q?=E3=81=84=E3=81=A3=E3=81=9F=E3=82=93=E4=BF=9D?= =?utf8?q?=E7=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../connection/CanonCameraConnectSequence.java | 8 ++++++-- .../canon/wrapper/liveview/CanonLiveViewControl.java | 10 ++++++++-- .../canon/wrapper/status/CanonStatusWatcher.java | 6 ++++-- .../connection/NikonCameraConnectSequence.java | 2 +- .../nikon/wrapper/liveview/NikonLiveViewControl.java | 10 ++++++++-- .../ptpip/operation/PtpIpCameraCommandSendDialog.java | 2 +- .../camera/ptpip/wrapper/command/IPtpIpMessages.java | 1 + .../osdn/gokigen/a01d/liveview/LiveViewFragment.java | 19 +++++++++++++++++-- 8 files changed, 46 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/canon/wrapper/connection/CanonCameraConnectSequence.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/canon/wrapper/connection/CanonCameraConnectSequence.java index a134c35..f5d3f6a 100644 --- a/app/src/main/java/net/osdn/gokigen/a01d/camera/canon/wrapper/connection/CanonCameraConnectSequence.java +++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/canon/wrapper/connection/CanonCameraConnectSequence.java @@ -134,11 +134,15 @@ public class CanonCameraConnectSequence implements Runnable, IPtpIpCommandCallba case SEQ_CHANGE_REMOTE: interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.canon_connect_connecting4), false, false, 0); - commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_SET_EVENT_MODE, isDumpLog, 0, 0x902f, 4, 0x02)); + commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_SET_EVENT_MODE, isDumpLog, 0, 0x9115, 4, 0x02)); break; case SEQ_SET_EVENT_MODE: interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.canon_connect_connecting5), false, false, 0); + commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_GET_EVENT, isDumpLog, 0, 0x902f, 4, 0x02)); + break; + + case SEQ_GET_EVENT: interfaceProvider.getInformationReceiver().updateMessage(context.getString(R.string.connect_connect_finished), false, false, 0); connectFinished(); Log.v(TAG, "CHANGED PLAYBACK MODE : DONE."); @@ -169,7 +173,7 @@ public class CanonCameraConnectSequence implements Runnable, IPtpIpCommandCallba eventConnectionNumber = eventConnectionNumber + ((receiveData[10] & 0xff) << 16); eventConnectionNumber = eventConnectionNumber + ((receiveData[11] & 0xff) << 24); statusChecker.setEventConnectionNumber(eventConnectionNumber); - interfaceProvider.getCameraStatusWatcher().startStatusWatch(null); + interfaceProvider.getCameraStatusWatcher().startStatusWatch(interfaceProvider.getStatusListener()); commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_OPEN_SESSION, isDumpLog, 0, 0x1002, 4, 0x41)); } diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/canon/wrapper/liveview/CanonLiveViewControl.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/canon/wrapper/liveview/CanonLiveViewControl.java index a87a188..daf3b1f 100644 --- a/app/src/main/java/net/osdn/gokigen/a01d/camera/canon/wrapper/liveview/CanonLiveViewControl.java +++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/canon/wrapper/liveview/CanonLiveViewControl.java @@ -1,6 +1,7 @@ package net.osdn.gokigen.a01d.camera.canon.wrapper.liveview; import android.app.Activity; +import android.util.Log; import androidx.annotation.NonNull; @@ -11,6 +12,8 @@ import net.osdn.gokigen.a01d.liveview.liveviewlistener.ILiveViewListener; public class CanonLiveViewControl implements ILiveViewControl, ILiveViewListener, IPtpIpCommunication { + private final String TAG = this.toString(); + private final Activity context; private final String ipAddr; private final int portNo; @@ -36,12 +39,14 @@ public class CanonLiveViewControl implements ILiveViewControl, ILiveViewListener @Override public void startLiveView() { + Log.v(TAG, " startLiveView() "); } @Override public void stopLiveView() { + Log.v(TAG, " stopLiveView() "); } @@ -78,12 +83,13 @@ public class CanonLiveViewControl implements ILiveViewControl, ILiveViewListener @Override public boolean connect() { - return false; + Log.v(TAG, " connect() "); + return (true); } @Override public void disconnect() { - + Log.v(TAG, " disconnect() "); } } diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/canon/wrapper/status/CanonStatusWatcher.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/canon/wrapper/status/CanonStatusWatcher.java index 4cfa1c3..64a179b 100644 --- a/app/src/main/java/net/osdn/gokigen/a01d/camera/canon/wrapper/status/CanonStatusWatcher.java +++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/canon/wrapper/status/CanonStatusWatcher.java @@ -9,12 +9,14 @@ public class CanonStatusWatcher implements ICameraStatusWatcher { @Override - public void startStatusWatch(@NonNull ICameraStatusUpdateNotify notifier) { + public void startStatusWatch(@NonNull ICameraStatusUpdateNotify notifier) + { } @Override - public void stopStatusWatch() { + public void stopStatusWatch() + { } } diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/connection/NikonCameraConnectSequence.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/connection/NikonCameraConnectSequence.java index b7599dc..a4d4a94 100644 --- a/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/connection/NikonCameraConnectSequence.java +++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/connection/NikonCameraConnectSequence.java @@ -162,7 +162,7 @@ public class NikonCameraConnectSequence implements Runnable, IPtpIpCommandCallba eventConnectionNumber = eventConnectionNumber + ((receiveData[10] & 0xff) << 16); eventConnectionNumber = eventConnectionNumber + ((receiveData[11] & 0xff) << 24); statusChecker.setEventConnectionNumber(eventConnectionNumber); - interfaceProvider.getCameraStatusWatcher().startStatusWatch(null); + interfaceProvider.getCameraStatusWatcher().startStatusWatch(interfaceProvider.getStatusListener()); commandIssuer.enqueueCommand(new PtpIpCommandGeneric(this, SEQ_OPEN_SESSION, 50, isDumpLog, 0, 0x1002, 4, 0x41, 0, 0, 0)); } diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/liveview/NikonLiveViewControl.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/liveview/NikonLiveViewControl.java index 5df39c5..3d8cc17 100644 --- a/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/liveview/NikonLiveViewControl.java +++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/liveview/NikonLiveViewControl.java @@ -1,6 +1,7 @@ package net.osdn.gokigen.a01d.camera.nikon.wrapper.liveview; import android.app.Activity; +import android.util.Log; import androidx.annotation.NonNull; @@ -11,6 +12,8 @@ import net.osdn.gokigen.a01d.liveview.liveviewlistener.ILiveViewListener; public class NikonLiveViewControl implements ILiveViewControl, ILiveViewListener, IPtpIpCommunication { + private final String TAG = this.toString(); + private final Activity context; private final String ipAddr; private final int portNo; @@ -36,12 +39,14 @@ public class NikonLiveViewControl implements ILiveViewControl, ILiveViewListener @Override public void startLiveView() { + Log.v(TAG, " startLiveView() "); } @Override public void stopLiveView() { + Log.v(TAG, " stopLiveView() "); } @@ -78,12 +83,13 @@ public class NikonLiveViewControl implements ILiveViewControl, ILiveViewListener @Override public boolean connect() { - return false; + Log.v(TAG, " connect() "); + return (true); } @Override public void disconnect() { - + Log.v(TAG, " disconnect() "); } } diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/ptpip/operation/PtpIpCameraCommandSendDialog.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/ptpip/operation/PtpIpCameraCommandSendDialog.java index bbf3387..16e0e2b 100644 --- a/app/src/main/java/net/osdn/gokigen/a01d/camera/ptpip/operation/PtpIpCameraCommandSendDialog.java +++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ptpip/operation/PtpIpCameraCommandSendDialog.java @@ -32,7 +32,7 @@ public class PtpIpCameraCommandSendDialog extends DialogFragment private IPtpIpCommandPublisher commandPublisher = null; private PtpIpCameraCommandResponse responseReceiver = null; private SparseArrayCompat commandNameIndexArray; - private boolean isDumpLog = false; + private boolean isDumpLog = true; private int selectedCommandIdPosition = 0; private int selectedBodyLengthPosition = 0; diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/ptpip/wrapper/command/IPtpIpMessages.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/ptpip/wrapper/command/IPtpIpMessages.java index e1120bb..b57ad4b 100644 --- a/app/src/main/java/net/osdn/gokigen/a01d/camera/ptpip/wrapper/command/IPtpIpMessages.java +++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ptpip/wrapper/command/IPtpIpMessages.java @@ -9,6 +9,7 @@ public interface IPtpIpMessages int SEQ_INIT_SESSION = 4; int SEQ_CHANGE_REMOTE = 5; int SEQ_SET_EVENT_MODE = 6; + int SEQ_GET_EVENT = 7; int SEQ_STATUS_REQUEST = 9; diff --git a/app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewFragment.java b/app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewFragment.java index abae8fc..597d0c2 100644 --- a/app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewFragment.java +++ b/app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewFragment.java @@ -819,8 +819,23 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo @Override public void run() { - activity.findViewById(R.id.btn_zoomin).setVisibility(View.INVISIBLE); - activity.findViewById(R.id.btn_zoomout).setVisibility(View.INVISIBLE); + try + { + View zoomin = activity.findViewById(R.id.btn_zoomin); + if (zoomin != null) + { + zoomin.setVisibility(View.INVISIBLE); + } + View zoomout = activity.findViewById(R.id.btn_zoomout); + if (zoomout != null) + { + zoomout.setVisibility(View.INVISIBLE); + } + } + catch (Exception e) + { + e.printStackTrace(); + } } }); } -- 2.11.0