OSDN Git Service

NIKON対応の開始。
authorMRSa <mrsa@myad.jp>
Wed, 19 Feb 2020 15:13:36 +0000 (00:13 +0900)
committerMRSa <mrsa@myad.jp>
Wed, 19 Feb 2020 15:13:36 +0000 (00:13 +0900)
app/build.gradle
app/src/main/java/net/osdn/gokigen/a01d/A01dMain.java
app/src/main/java/net/osdn/gokigen/a01d/camera/CameraInterfaceProvider.java
app/src/main/java/net/osdn/gokigen/a01d/camera/ICameraConnection.java
app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewClickTouchListener.java
app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewFragment.java
app/src/main/res/values-ja/arrays.xml
app/src/main/res/values/arrays.xml

index 7ffe53a..3d1f7c3 100644 (file)
@@ -6,8 +6,8 @@ android {
         applicationId "net.osdn.gokigen.a01d"
         minSdkVersion 14
         targetSdkVersion 29
-        versionCode 10600
-        versionName "1.6.0"
+        versionCode 10700
+        versionName "1.7.0"
     }
     buildTypes {
         release {
index c28f2fd..b972f58 100644 (file)
@@ -29,6 +29,7 @@ import net.osdn.gokigen.a01d.logcat.LogCatFragment;
 import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
 import net.osdn.gokigen.a01d.preference.canon.CanonPreferenceFragment;
 import net.osdn.gokigen.a01d.preference.fujix.FujiXPreferenceFragment;
+import net.osdn.gokigen.a01d.preference.nikon.NikonPreferenceFragment;
 import net.osdn.gokigen.a01d.preference.olympus.PreferenceFragment;
 import net.osdn.gokigen.a01d.preference.panasonic.PanasonicPreferenceFragment;
 import net.osdn.gokigen.a01d.preference.olympuspen.OlympusPreferenceFragment;
@@ -316,6 +317,18 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
                     e.printStackTrace();
                 }
             }
+            else if (method == ICameraConnection.CameraConnectionMethod.NIKON)
+            {
+                try
+                {
+                    // NIKON の場合は、PTPIPコマンド送信ダイアログを表示する
+                    PtpIpCameraCommandSendDialog.newInstance(interfaceProvider.getCanonInterface(), true).show(getSupportFragmentManager(), "ptpipSendCommandDialog");
+                }
+                catch (Exception e)
+                {
+                    e.printStackTrace();
+                }
+            }
             else
             {
                 // OPC カメラの場合...
@@ -371,6 +384,8 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
                         preferenceFragment = ThetaPreferenceFragment.newInstance(this, this);
                     } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.CANON) {
                         preferenceFragment = CanonPreferenceFragment.newInstance(this, this);
+                    } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.NIKON) {
+                        preferenceFragment = NikonPreferenceFragment.newInstance(this, this);
                     } else //  if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
                     {
                         preferenceFragment = PreferenceFragment.newInstance(this, interfaceProvider, this);
@@ -668,6 +683,10 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
         {
             connection = interfaceProvider.getCanonInterface().getCameraConnection();
         }
+        else if  (connectionMethod == ICameraConnection.CameraConnectionMethod.NIKON)
+        {
+            connection = interfaceProvider.getNikonInterface().getCameraConnection();
+        }
         else // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
         {
             connection = interfaceProvider.getOlympusInterface().getOlyCameraConnection();
index fbc6ca8..60df36c 100644 (file)
@@ -170,6 +170,10 @@ public class CameraInterfaceProvider implements IInterfaceProvider
             {
                 ret = ICameraConnection.CameraConnectionMethod.CANON;
             }
+            else if (connectionMethod.contains("NIKON"))
+            {
+                ret = ICameraConnection.CameraConnectionMethod.NIKON;
+            }
         }
         catch (Exception e)
         {
index 29e9d7d..9819a6f 100644 (file)
@@ -18,6 +18,7 @@ public interface ICameraConnection
         OLYMPUS,
         THETA,
         CANON,
+        NIKON,
     }
 
     enum CameraConnectionStatus
index c5addc2..33e1afc 100644 (file)
@@ -115,6 +115,15 @@ class LiveViewClickTouchListener implements View.OnClickListener, View.OnTouchLi
             this.cameraConnection = interfaceProvider.getCanonInterface().getCameraConnection();
             this.zoomLensControl = interfaceProvider.getCanonInterface().getZoomLensControl();
         }
+        else if (connectionMethod == ICameraConnection.CameraConnectionMethod.NIKON)
+        {
+            this.focusingControl = interfaceProvider.getNikonInterface().getFocusingControl();
+            this.captureControl = interfaceProvider.getNikonInterface().getCaptureControl();
+            this.propertyProvider = interfaceProvider.getOlympusInterface().getCameraPropertyProvider();  // 要変更
+            this.cameraInformation = interfaceProvider.getNikonInterface().getCameraInformation();
+            this.cameraConnection = interfaceProvider.getNikonInterface().getCameraConnection();
+            this.zoomLensControl = interfaceProvider.getNikonInterface().getZoomLensControl();
+        }
         else  // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
         {
             this.focusingControl = interfaceProvider.getOlympusInterface().getFocusingControl();
index a28c48a..9cdee01 100644 (file)
@@ -368,6 +368,30 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
                         propertyButton.setOnClickListener(onClickTouchListener);
                     }
                 }
+                else if (connectionMethod == ICameraConnection.CameraConnectionMethod.NIKON)
+                {
+                    if (favoriteButton != null)
+                    {
+                        favoriteButton.setVisibility(View.VISIBLE);
+                        favoriteButton.setOnClickListener(onClickTouchListener);
+                    }
+                    if (manualFocus != null)
+                    {
+                        manualFocus.setVisibility(View.INVISIBLE);
+                    }
+                    if (changeLiveViewScale != null)
+                    {
+                        changeLiveViewScale.setVisibility(View.INVISIBLE);
+                    }
+                    if (focusIndicator != null)
+                    {
+                        focusIndicator.setVisibility(View.VISIBLE);
+                    }
+                    if (propertyButton != null)
+                    {
+                        propertyButton.setOnClickListener(onClickTouchListener);
+                    }
+                }
             }
             if (manualFocus != null)
             {
@@ -437,6 +461,10 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
         {
             interfaceInjector = interfaceProvider.getCanonInterface().getDisplayInjector();
         }
+        else if (connectionMethod == ICameraConnection.CameraConnectionMethod.NIKON)
+        {
+            interfaceInjector = interfaceProvider.getNikonInterface().getDisplayInjector();
+        }
         else // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
         {
             interfaceInjector = interfaceProvider.getOlympusInterface().getDisplayInjector();
@@ -487,6 +515,12 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
             this.zoomLensControl = interfaceProvider.getCanonInterface().getZoomLensControl();
             this.cameraInformation = interfaceProvider.getCanonInterface().getCameraInformation();
         }
+        else  if (connectionMethod == ICameraConnection.CameraConnectionMethod.NIKON)
+        {
+            this.liveViewControl = interfaceProvider.getNikonInterface().getLiveViewControl();
+            this.zoomLensControl = interfaceProvider.getNikonInterface().getZoomLensControl();
+            this.cameraInformation = interfaceProvider.getNikonInterface().getCameraInformation();
+        }
         else //  if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
         {
             this.liveViewControl = interfaceProvider.getOlympusInterface().getLiveViewControl();
@@ -797,6 +831,10 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
             {
                 lvListener = interfaceProvider.getCanonInterface().getLiveViewListener();
             }
+            else if (connectionMethod == ICameraConnection.CameraConnectionMethod.NIKON)
+            {
+                lvListener = interfaceProvider.getNikonInterface().getLiveViewListener();
+            }
             else  // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
             {
                 interfaceProvider.getOlympusLiveViewListener().setOlympusLiveViewListener(liveViewListener);
index 4f8deff..8de054b 100644 (file)
         <item >Fuji X Series</item>
         <item >Panasonic</item>
         <item >Canon</item>
+        <item >NIKON</item>
     </string-array>
 
     <string-array name="connection_method_value">
         <item >FUJI_X</item>
         <item >PANASONIC</item>
         <item >CANON</item>
+        <item >NIKON</item>
     </string-array>
 
 
index 3f172c5..a86c5d8 100644 (file)
         <item >Fuji X Series</item>
         <item >Panasonic</item>
         <item >Canon</item>
+        <item >NIKON</item>
     </string-array>
 
     <string-array name="connection_method_value">
         <item >FUJI_X</item>
         <item >PANASONIC</item>
         <item >CANON</item>
+        <item >NIKON</item>
     </string-array>
 
     <string-array name="gr2_display_mode">