OSDN Git Service

いったん保管
authorMRSa <mrsa@myad.jp>
Thu, 30 Jan 2020 14:42:42 +0000 (23:42 +0900)
committerMRSa <mrsa@myad.jp>
Thu, 30 Jan 2020 14:42:42 +0000 (23:42 +0900)
app/src/main/java/net/osdn/gokigen/a01d/camera/canon/wrapper/connection/CanonCameraConnectSequence.java
app/src/main/java/net/osdn/gokigen/a01d/camera/canon/wrapper/liveview/CanonLiveViewControl.java
app/src/main/java/net/osdn/gokigen/a01d/camera/canon/wrapper/status/CanonStatusWatcher.java
app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/connection/NikonCameraConnectSequence.java
app/src/main/java/net/osdn/gokigen/a01d/camera/nikon/wrapper/liveview/NikonLiveViewControl.java
app/src/main/java/net/osdn/gokigen/a01d/camera/ptpip/operation/PtpIpCameraCommandSendDialog.java
app/src/main/java/net/osdn/gokigen/a01d/camera/ptpip/wrapper/command/IPtpIpMessages.java
app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewFragment.java

index a134c35..f5d3f6a 100644 (file)
@@ -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));
         }
index a87a188..daf3b1f 100644 (file)
@@ -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() ");
     }
 }
index 4cfa1c3..64a179b 100644 (file)
@@ -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()
+    {
 
     }
 }
index b7599dc..a4d4a94 100644 (file)
@@ -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));
         }
index 5df39c5..3d8cc17 100644 (file)
@@ -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() ");
     }
 }
index bbf3387..16e0e2b 100644 (file)
@@ -32,7 +32,7 @@ public class PtpIpCameraCommandSendDialog  extends DialogFragment
     private IPtpIpCommandPublisher commandPublisher = null;
     private PtpIpCameraCommandResponse responseReceiver = null;
     private SparseArrayCompat<String> commandNameIndexArray;
-    private boolean isDumpLog = false;
+    private boolean isDumpLog = true;
 
     private int selectedCommandIdPosition = 0;
     private int selectedBodyLengthPosition = 0;
index e1120bb..b57ad4b 100644 (file)
@@ -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;
index abae8fc..597d0c2 100644 (file)
@@ -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();
+                            }
                         }
                     });
                 }