OSDN Git Service

カメラの接続部分作りこみ開始。
authorMRSa <mrsa@myad.jp>
Sat, 22 May 2021 15:04:11 +0000 (00:04 +0900)
committerMRSa <mrsa@myad.jp>
Sat, 22 May 2021 15:04:11 +0000 (00:04 +0900)
20 files changed:
app/src/main/java/jp/osdn/gokigen/gokigenassets/camera/DummyCameraControl.kt [new file with mode: 0644]
app/src/main/java/jp/osdn/gokigen/gokigenassets/camera/interfaces/ICameraStatusWatcher.kt
app/src/main/java/jp/osdn/gokigen/gokigenassets/camera/ricohpentax/RicohPentaxCameraControl.kt
app/src/main/java/jp/osdn/gokigen/gokigenassets/camera/ricohpentax/status/RicohGr2StatusChecker.kt
app/src/main/java/jp/osdn/gokigen/gokigenassets/camera/ricohpentax/status/RicohGr2StatusHolder.kt
app/src/main/java/jp/osdn/gokigen/gokigenassets/camera/theta/ThetaCameraControl.kt
app/src/main/java/jp/osdn/gokigen/gokigenassets/camera/theta/status/ThetaCameraStatusWatcher.kt
app/src/main/java/jp/osdn/gokigen/gokigenassets/constants/IApplicationConstantConvert.kt
app/src/main/java/jp/osdn/gokigen/gokigenassets/liveview/LiveImageViewFragment.kt
app/src/main/java/jp/osdn/gokigen/gokigenassets/preference/MainPreferenceFragment.kt
app/src/main/java/jp/osdn/gokigen/mangle/preference/IPreferencePropertyAccessor.kt
app/src/main/java/jp/osdn/gokigen/mangle/preference/PreferenceChanger.kt
app/src/main/java/jp/osdn/gokigen/mangle/preference/PreferenceValueInitializer.kt
app/src/main/java/jp/osdn/gokigen/mangle/preference/SelectCameraConnectionMethodDialog.kt [new file with mode: 0644]
app/src/main/java/jp/osdn/gokigen/mangle/scene/IChangeScene.kt
app/src/main/java/jp/osdn/gokigen/mangle/scene/SceneChanger.kt
app/src/main/res/layout/camera_connection_method.xml [new file with mode: 0644]
app/src/main/res/values-ja/strings.xml
app/src/main/res/values/strings.xml
app/src/main/res/xml/preference_main.xml

diff --git a/app/src/main/java/jp/osdn/gokigen/gokigenassets/camera/DummyCameraControl.kt b/app/src/main/java/jp/osdn/gokigen/gokigenassets/camera/DummyCameraControl.kt
new file mode 100644 (file)
index 0000000..a7408d1
--- /dev/null
@@ -0,0 +1,26 @@
+package jp.osdn.gokigen.gokigenassets.camera
+
+import android.view.View
+import androidx.camera.core.CameraSelector
+import jp.osdn.gokigen.gokigenassets.camera.interfaces.ICameraControl
+import jp.osdn.gokigen.gokigenassets.liveview.ILiveView
+import jp.osdn.gokigen.gokigenassets.liveview.ILiveViewRefresher
+
+class DummyCameraControl() : ICameraControl, View.OnClickListener
+{
+    override fun getConnectionMethod(): String
+    {
+        return ("NONE")
+    }
+    override fun initialize() { }
+    override fun connectToCamera() { }
+    override fun startCamera(isPreviewView: Boolean, cameraSelector: CameraSelector) { }
+    override fun finishCamera() { }
+    override fun changeCaptureMode(mode: String) { }
+    override fun setRefresher(refresher: ILiveViewRefresher, imageView: ILiveView) { }
+    override fun captureButtonReceiver(id: Int): View.OnClickListener
+    {
+        return (this)
+    }
+    override fun onClick(v: View?) { }
+}
\ No newline at end of file
index c912e87..0cc59c6 100644 (file)
@@ -4,7 +4,6 @@ import jp.osdn.gokigen.gokigenassets.liveview.message.IMessageDrawer
 
 interface ICameraStatusWatcher
 {
-    fun startStatusWatch(indicator : IMessageDrawer?)
-    fun startStatusWatch(notifier: ICameraStatusUpdateNotify)
+    fun startStatusWatch(indicator : IMessageDrawer?, notifier: ICameraStatusUpdateNotify?)
     fun stopStatusWatch()
 }
index 3bea538..dcc2998 100644 (file)
@@ -2,6 +2,7 @@ package jp.osdn.gokigen.gokigenassets.camera.ricohpentax
 
 import android.util.Log
 import android.view.View
+import androidx.appcompat.app.AppCompatActivity
 import androidx.camera.core.CameraSelector
 import androidx.fragment.app.FragmentActivity
 import jp.osdn.gokigen.gokigenassets.camera.interfaces.*
@@ -15,16 +16,23 @@ import jp.osdn.gokigen.gokigenassets.camera.ricohpentax.operation.*
 import jp.osdn.gokigen.gokigenassets.camera.ricohpentax.status.RicohGr2StatusChecker
 import jp.osdn.gokigen.gokigenassets.camera.ricohpentax.wrapper.RicohGr2RunMode
 import jp.osdn.gokigen.gokigenassets.camera.ricohpentax.wrapper.playback.RicohGr2PlaybackControl
+import jp.osdn.gokigen.gokigenassets.camera.theta.ThetaCameraControl
+import jp.osdn.gokigen.gokigenassets.camera.theta.operation.ThetaMovieRecordingControl
+import jp.osdn.gokigen.gokigenassets.camera.theta.operation.ThetaSingleShotControl
+import jp.osdn.gokigen.gokigenassets.constants.IApplicationConstantConvert
 import jp.osdn.gokigen.gokigenassets.liveview.IIndicatorControl
 import jp.osdn.gokigen.gokigenassets.liveview.focusframe.IAutoFocusFrameDisplay
+import jp.osdn.gokigen.gokigenassets.liveview.image.CameraLiveViewListenerImpl
+import jp.osdn.gokigen.gokigenassets.scene.IVibrator
 
-class RicohPentaxCameraControl(context: FragmentActivity, provider: ICameraStatusReceiver)  : ILiveViewController, ICameraControl, View.OnClickListener,
+class RicohPentaxCameraControl(private val context: AppCompatActivity, private val vibrator : IVibrator, statusReceiver : ICameraStatusReceiver)  : ILiveViewController, ICameraControl, View.OnClickListener,
     ICaptureModeReceiver, ICameraShutter, IDisplayInjector, IUseGR2CommandNotify
 {
 
     //private final Activity activity;
     //private final ICameraStatusReceiver provider;
-    private val gr2Connection = RicohGr2Connection(context, provider, this)
+    private var liveViewListener = CameraLiveViewListenerImpl(context)
+    private val gr2Connection = RicohGr2Connection(context, statusReceiver, this)
     private val buttonControl = RicohGr2CameraButtonControl()
     private val statusChecker = RicohGr2StatusChecker(500)
     private val playbackControl = RicohGr2PlaybackControl(communicationTimeoutMs)
@@ -35,66 +43,139 @@ class RicohPentaxCameraControl(context: FragmentActivity, provider: ICameraStatu
     private val pentaxCaptureAfterAf: Boolean = false
     private val liveViewControl = RicohGr2LiveViewControl(context)
     private var captureControl: RicohGr2CameraCaptureControl? = null
-    private val zoomControl = RicohGr2CameraZoomLensControl()
     private var focusControl: RicohGr2CameraFocusControl? = null
     private var useGR2Command = false
     private var useGR2CommandUpdated = false
     private var useCameraScreen = false
+    private var isStatusWatch = false
+    private var cameraPositionId = 0
 
-
+    private val zoomControl = RicohGr2CameraZoomLensControl()
 
     override fun startLiveView()
     {
-        TODO("Not yet implemented")
+        Log.v(TAG, " startLiveView() ")
+        try
+        {
+            if (!isStatusWatch)
+            {
+                statusChecker.startStatusWatch(null, null)
+                isStatusWatch = true
+            }
+            liveViewControl.startLiveView()
+        }
+        catch (e : Exception)
+        {
+            e.printStackTrace()
+        }
     }
 
     override fun stopLiveView()
     {
-        TODO("Not yet implemented")
+        try
+        {
+            liveViewControl.stopLiveView()
+        }
+        catch (e : Exception)
+        {
+            e.printStackTrace()
+        }
     }
 
     override fun getConnectionMethod(): String
     {
-        TODO("Not yet implemented")
+        return ("PENTAX")
     }
 
     override fun initialize()
     {
-        TODO("Not yet implemented")
+        // TODO("Not yet implemented")
     }
 
     override fun connectToCamera()
     {
-        TODO("Not yet implemented")
+        Log.v(TAG, " connectToCamera() : PENTAX ")
+        try
+        {
+            gr2Connection.connect()
+        }
+        catch (e : Exception)
+        {
+            e.printStackTrace()
+        }
     }
 
     override fun startCamera(isPreviewView: Boolean, cameraSelector: CameraSelector)
     {
-        TODO("Not yet implemented")
+        try
+        {
+            if (gr2Connection.getConnectionStatus() != ICameraConnectionStatus.CameraConnectionStatus.CONNECTED)
+            {
+                gr2Connection.startWatchWifiStatus(context)
+            }
+            else
+            {
+                gr2Connection.connect()
+            }
+        }
+        catch (e : Exception)
+        {
+            e.printStackTrace()
+        }
     }
 
     override fun finishCamera()
     {
-        TODO("Not yet implemented")
-    }
-
-    override fun changeCaptureMode(mode: String)
-    {
-        TODO("Not yet implemented")
+        try
+        {
+            if (isStatusWatch)
+            {
+                statusChecker.stopStatusWatch()
+                isStatusWatch = false
+            }
+            gr2Connection.disconnect(false)
+            gr2Connection.stopWatchWifiStatus(context)
+        }
+        catch (e : Exception)
+        {
+            e.printStackTrace()
+        }
     }
 
     override fun setRefresher(refresher: ILiveViewRefresher, imageView: ILiveView)
     {
-        TODO("Not yet implemented")
+        try
+        {
+            liveViewListener.setRefresher(refresher)
+            imageView.setImageProvider(liveViewListener)
+        }
+        catch (e : Exception)
+        {
+            e.printStackTrace()
+        }
     }
 
     override fun captureButtonReceiver(id: Int): View.OnClickListener
     {
-        TODO("Not yet implemented")
+        cameraPositionId = id
+        return (this)
     }
 
     override fun onClick(v: View?)
     {
+        if (v == null)
+        {
+            return
+        }
+        when (v.id)
+        {
+            IApplicationConstantConvert.ID_BUTTON_SHUTTER -> { doShutter() }
+            else -> { }
+        }
+    }
+
+    override fun changeCaptureMode(mode: String)
+    {
         TODO("Not yet implemented")
     }
 
@@ -105,12 +186,28 @@ class RicohPentaxCameraControl(context: FragmentActivity, provider: ICameraStatu
 
     override fun doShutter()
     {
-        TODO("Not yet implemented")
+        try
+        {
+            Log.v(TAG, " doShutter()")
+            captureControl?.doCapture(0)
+        }
+        catch (e : Exception)
+        {
+            e.printStackTrace()
+        }
     }
 
     override fun doShutterOff()
     {
-        TODO("Not yet implemented")
+        try
+        {
+            Log.v(TAG, " doShutterOff()")
+            captureControl?.doCapture(0)
+        }
+        catch (e : Exception)
+        {
+            e.printStackTrace()
+        }
     }
 
     override fun setUseGR2Command(useGR2Command: Boolean, useCameraScreen: Boolean)
index 42994ab..76dad9e 100644 (file)
@@ -34,16 +34,8 @@ class RicohGr2StatusChecker
         this.useGR2command = useGR2command
     }
 
-    override fun startStatusWatch(indicator: IMessageDrawer?)
+    override fun startStatusWatch(indicator : IMessageDrawer?, notifier: ICameraStatusUpdateNotify?)
     {
-        TODO("Not yet implemented")
-    }
-
-    /**
-     *
-     *
-     */
-    override fun startStatusWatch(notifier: ICameraStatusUpdateNotify) {
         Log.v(TAG, "startStatusWatch()")
         try {
             statusHolder = RicohGr2StatusHolder(notifier)
index 457605b..b42700b 100644 (file)
@@ -9,7 +9,7 @@ import java.util.*
  *
  *
  */
-internal class RicohGr2StatusHolder(private val notifier: ICameraStatusUpdateNotify)
+class RicohGr2StatusHolder(private val notifier: ICameraStatusUpdateNotify?)
 {
     private var latestResultObject: JSONObject? = null
     private var focused = false
@@ -53,8 +53,12 @@ internal class RicohGr2StatusHolder(private val notifier: ICameraStatusUpdateNot
         return ""
     }
 
-    private fun getStatusString(obj: JSONObject, name: String): String {
+    private fun getStatusString(obj: JSONObject?, name: String): String {
         try {
+            if (obj == null)
+            {
+                return ""
+            }
             return obj.getString(name)
         } catch (e: Exception) {
             //e.printStackTrace();
@@ -62,8 +66,12 @@ internal class RicohGr2StatusHolder(private val notifier: ICameraStatusUpdateNot
         return ""
     }
 
-    private fun getBooleanStatus(obj: JSONObject, name: String): Boolean {
+    private fun getBooleanStatus(obj: JSONObject?, name: String): Boolean {
         try {
+            if (obj == null)
+            {
+                return false
+            }
             return obj.getBoolean(name)
         } catch (e: Exception) {
             //e.printStackTrace();
@@ -82,49 +90,49 @@ internal class RicohGr2StatusHolder(private val notifier: ICameraStatusUpdateNot
         }
         try {
             latestResultObject = JSONObject(replyString)
-            val result = getStatusString(latestResultObject!!, "errMsg")
-            val av = getStatusString(latestResultObject!!, "av")
-            val tv = getStatusString(latestResultObject!!, "tv")
-            val xv = getStatusString(latestResultObject!!, "xv")
-            val exposureMode = getStatusString(latestResultObject!!, "exposureMode")
-            val meteringMode = getStatusString(latestResultObject!!, "meteringMode")
-            val wbMode = getStatusString(latestResultObject!!, "WBMode")
-            val battery = getStatusString(latestResultObject!!, "battery")
-            val focus = getBooleanStatus(latestResultObject!!, "focused")
-            val focusLock = getBooleanStatus(latestResultObject!!, "focusLocked")
+            val result = getStatusString(latestResultObject, "errMsg")
+            val av = getStatusString(latestResultObject, "av")
+            val tv = getStatusString(latestResultObject, "tv")
+            val xv = getStatusString(latestResultObject, "xv")
+            val exposureMode = getStatusString(latestResultObject, "exposureMode")
+            val meteringMode = getStatusString(latestResultObject, "meteringMode")
+            val wbMode = getStatusString(latestResultObject, "WBMode")
+            val battery = getStatusString(latestResultObject, "battery")
+            val focus = getBooleanStatus(latestResultObject, "focused")
+            val focusLock = getBooleanStatus(latestResultObject, "focusLocked")
             if (result.contains("OK")) {
                 if (avStatus != av) {
                     avStatus = av
-                    notifier.updatedAperture(avStatus)
+                    notifier?.updatedAperture(avStatus)
                 }
                 if (tvStatus != tv) {
                     tvStatus = tv
-                    notifier.updatedShutterSpeed(tvStatus)
+                    notifier?.updatedShutterSpeed(tvStatus)
                 }
                 if (xvStatus != xv) {
                     xvStatus = xv
-                    notifier.updatedExposureCompensation(xvStatus)
+                    notifier?.updatedExposureCompensation(xvStatus)
                 }
                 if (exposureModeStatus != exposureMode) {
                     exposureModeStatus = exposureMode
-                    notifier.updatedTakeMode(exposureModeStatus)
+                    notifier?.updatedTakeMode(exposureModeStatus)
                 }
                 if (meteringModeStatus != meteringMode) {
                     meteringModeStatus = meteringMode
-                    notifier.updatedMeteringMode(meteringModeStatus)
+                    notifier?.updatedMeteringMode(meteringModeStatus)
                 }
                 if (wbModeStatus != wbMode) {
                     wbModeStatus = wbMode
-                    notifier.updatedWBMode(wbModeStatus)
+                    notifier?.updatedWBMode(wbModeStatus)
                 }
                 if (batteryStatus != battery) {
                     batteryStatus = battery
-                    notifier.updateRemainBattery(batteryStatus.toInt())
+                    notifier?.updateRemainBattery(batteryStatus.toInt())
                 }
                 if (focus != focused || focusLock != focusLocked) {
                     focused = focus
                     focusLocked = focusLock
-                    notifier.updateFocusedStatus(focused, focusLocked)
+                    notifier?.updateFocusedStatus(focused, focusLocked)
                 }
             }
             System.gc()
index 37a98ca..ecddc0e 100644 (file)
@@ -275,7 +275,7 @@ class ThetaCameraControl(private val context: AppCompatActivity, private val vib
         {
             if (!isStatusWatch)
             {
-                statusWatcher.startStatusWatch(indicator)
+                statusWatcher.startStatusWatch(indicator, null)
                 isStatusWatch = true
             }
             liveViewControl.setSessionIdProvider(sessionIdHolder)
index 9340fab..e7faad9 100644 (file)
@@ -25,7 +25,7 @@ class ThetaCameraStatusWatcher(private val sessionIdProvider: IThetaSessionIdPro
 
     private var showInformation: IMessageDrawer? = null
 
-    override fun startStatusWatch(indicator : IMessageDrawer?)
+    override fun startStatusWatch(indicator : IMessageDrawer?, notifier: ICameraStatusUpdateNotify?)
     {
         if (whileFetching)
         {
@@ -112,11 +112,6 @@ class ThetaCameraStatusWatcher(private val sessionIdProvider: IThetaSessionIdPro
         }
     }
 
-    override fun startStatusWatch(notifier: ICameraStatusUpdateNotify)
-    {
-        startStatusWatch(null)
-    }
-
     private fun checkStatus0(response: String)
     {
         try
index caf304b..ad9ab3b 100644 (file)
@@ -14,6 +14,7 @@ import jp.osdn.gokigen.mangle.preference.IPreferencePropertyAccessor.Companion.L
 import jp.osdn.gokigen.mangle.preference.IPreferencePropertyAccessor.Companion.LABEL_WIFI_SETTINGS
 import jp.osdn.gokigen.mangle.preference.IPreferencePropertyAccessor.Companion.NUMBER_OF_CACHE_PICTURES
 import jp.osdn.gokigen.mangle.preference.IPreferencePropertyAccessor.Companion.NUMBER_OF_CACHE_PICTURES_DEFAULT_VALUE
+import jp.osdn.gokigen.mangle.preference.IPreferencePropertyAccessor.Companion.PREFERENCE_CONNECTION_METHOD
 import jp.osdn.gokigen.mangle.preference.IPreferencePropertyAccessor.Companion.PREFERENCE_SAVE_LOCAL_LOCATION
 import jp.osdn.gokigen.mangle.preference.IPreferencePropertyAccessor.Companion.PREFERENCE_SAVE_LOCAL_LOCATION_DEFAULT_VALUE
 import jp.osdn.gokigen.mangle.preference.IPreferencePropertyAccessor.Companion.USE_GR2_SPECIAL_COMMAND
@@ -51,6 +52,10 @@ interface IApplicationConstantConvert
         const val ID_VIEW_FINDER_3 = R.id.liveViewFinder3
         const val ID_VIEW_UPPER_AREA = R.id.liveview_upper_area
         const val ID_VIEW_LOWER_AREA = R.id.liveview_lower_area
+        const val ID_VIEW_AREA_0 = R.id.panelLayout0
+        const val ID_VIEW_AREA_1 = R.id.panelLayout1
+        const val ID_VIEW_AREA_2 = R.id.panelLayout2
+        const val ID_VIEW_AREA_3 = R.id.panelLayout3
 
         const val ID_CACHE_SEEKBAR_0 = R.id.liveview_cache_seekbar0
         const val ID_CACHE_SEEKBAR_1 = R.id.liveview_cache_seekbar1
@@ -93,6 +98,8 @@ interface IApplicationConstantConvert
         const val ID_PREFERENCE_RICOH_GR2_LCD_SLEEP = GR2_LCD_SLEEP
         const val ID_PREFERENCE_USE_GR2_SPECIAL_COMMAND = USE_GR2_SPECIAL_COMMAND
 
+        const val ID_PREFERENCE_LABEL_SELECT_CAMERA_CONNECTION_METHOD = PREFERENCE_CONNECTION_METHOD
+
     }
 
 }
index 880dd3c..b47106a 100644 (file)
@@ -7,6 +7,7 @@ import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
 import android.widget.ImageButton
+import android.widget.LinearLayout
 import android.widget.SeekBar
 import androidx.fragment.app.Fragment
 import androidx.preference.PreferenceManager
@@ -24,6 +25,10 @@ import jp.osdn.gokigen.gokigenassets.constants.IApplicationConstantConvert.Compa
 import jp.osdn.gokigen.gokigenassets.constants.IApplicationConstantConvert.Companion.ID_VIEW_LOWER_AREA
 import jp.osdn.gokigen.gokigenassets.constants.IApplicationConstantConvert.Companion.ID_VIEW_UPPER_AREA
 import jp.osdn.gokigen.gokigenassets.camera.interfaces.ICameraControl
+import jp.osdn.gokigen.gokigenassets.constants.IApplicationConstantConvert.Companion.ID_VIEW_AREA_0
+import jp.osdn.gokigen.gokigenassets.constants.IApplicationConstantConvert.Companion.ID_VIEW_AREA_1
+import jp.osdn.gokigen.gokigenassets.constants.IApplicationConstantConvert.Companion.ID_VIEW_AREA_2
+import jp.osdn.gokigen.gokigenassets.constants.IApplicationConstantConvert.Companion.ID_VIEW_AREA_3
 
 class LiveImageViewFragment(private val contentLayoutId: Int = ID_LIVE_VIEW_LAYOUT_DEFAULT) : Fragment(contentLayoutId), View.OnClickListener
 {
@@ -61,31 +66,22 @@ class LiveImageViewFragment(private val contentLayoutId: Int = ID_LIVE_VIEW_LAYO
         this.isCameraControl3 = isCameraControl3
         this.cameraControl3 = cameraControl3
 
+        updateCameraLayout()
     }
 
-    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View
+    private fun updateCameraLayout()
     {
-        if (::liveviewView.isInitialized)
-        {
-            return (liveviewView)
-        }
-        liveviewView = inflater.inflate(contentLayoutId, null, false)
-        liveviewView.findViewById<ImageButton>(ID_BUTTON_SHUTTER)?.setOnClickListener(this)
-
-        try
+        if (!::liveviewView.isInitialized)
         {
-            val preferences : SharedPreferences = PreferenceManager.getDefaultSharedPreferences(activity)
-            this.isCacheImage = preferences.getBoolean(ID_PREFERENCE_CACHE_LIVE_VIEW_PICTURES, false)
+            //  まだ Viewができていないときには何もしない
+            return
         }
-        catch (e : Exception)
-        {
-            e.printStackTrace()
-        }
-
         try
         {
+            Log.v(TAG, "updateCameraLayout()")
             if (::cameraControl0.isInitialized)
             {
+                val area0 = liveviewView.findViewById<LinearLayout>(ID_VIEW_AREA_0)
                 val imageCache0 = liveviewView.findViewById<SeekBar>(ID_CACHE_SEEKBAR_0)
                 imageCache0.visibility = View.GONE
 
@@ -98,14 +94,17 @@ class LiveImageViewFragment(private val contentLayoutId: Int = ID_LIVE_VIEW_LAYO
                         imageCache0.visibility = View.VISIBLE
                         imageCache0.setOnSeekBarChangeListener(imageView0)
                     }
+                    area0.visibility = View.VISIBLE
                 }
                 else
                 {
                     imageView0.visibility = View.GONE
+                    area0.visibility = View.GONE
                 }
             }
             if (::cameraControl1.isInitialized)
             {
+                val area1 = liveviewView.findViewById<LinearLayout>(ID_VIEW_AREA_1)
                 val imageCache1 = liveviewView.findViewById<SeekBar>(ID_CACHE_SEEKBAR_1)
                 imageCache1.visibility = View.GONE
 
@@ -118,14 +117,17 @@ class LiveImageViewFragment(private val contentLayoutId: Int = ID_LIVE_VIEW_LAYO
                         imageCache1.visibility = View.VISIBLE
                         imageCache1.setOnSeekBarChangeListener(imageView1)
                     }
+                    area1.visibility = View.VISIBLE
                 }
                 else
                 {
                     imageView1.visibility = View.GONE
+                    area1.visibility = View.GONE
                 }
             }
             if (::cameraControl2.isInitialized)
             {
+                val area2 = liveviewView.findViewById<LinearLayout>(ID_VIEW_AREA_2)
                 val imageCache2 = liveviewView.findViewById<SeekBar>(ID_CACHE_SEEKBAR_2)
                 imageCache2.visibility = View.GONE
 
@@ -138,14 +140,17 @@ class LiveImageViewFragment(private val contentLayoutId: Int = ID_LIVE_VIEW_LAYO
                         imageCache2.visibility = View.VISIBLE
                         imageCache2.setOnSeekBarChangeListener(imageView2)
                     }
+                    area2.visibility = View.VISIBLE
                 }
                 else
                 {
                     imageView2.visibility = View.GONE
+                    area2.visibility = View.GONE
                 }
             }
             if (::cameraControl3.isInitialized)
             {
+                val area3 = liveviewView.findViewById<LinearLayout>(ID_VIEW_AREA_3)
                 val imageCache3 = liveviewView.findViewById<SeekBar>(ID_CACHE_SEEKBAR_3)
                 imageCache3.visibility = View.GONE
 
@@ -158,10 +163,12 @@ class LiveImageViewFragment(private val contentLayoutId: Int = ID_LIVE_VIEW_LAYO
                         imageCache3.visibility = View.VISIBLE
                         imageCache3.setOnSeekBarChangeListener(imageView3)
                     }
+                    area3.visibility = View.VISIBLE
                 }
                 else
                 {
                     imageView3.visibility = View.GONE
+                    area3.visibility = View.GONE
                 }
             }
             if ((!isCameraControl0)&&(!isCameraControl1))
@@ -174,11 +181,33 @@ class LiveImageViewFragment(private val contentLayoutId: Int = ID_LIVE_VIEW_LAYO
                 val area = liveviewView.findViewById<LiveImageView>(ID_VIEW_LOWER_AREA)
                 area.visibility = View.GONE
             }
+            liveviewView.postInvalidate()
+        }
+        catch (e : Exception)
+        {
+            e.printStackTrace()
+        }
+    }
+
+    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View
+    {
+        if (::liveviewView.isInitialized)
+        {
+            return (liveviewView)
+        }
+        liveviewView = inflater.inflate(contentLayoutId, null, false)
+        liveviewView.findViewById<ImageButton>(ID_BUTTON_SHUTTER)?.setOnClickListener(this)
+
+        try
+        {
+            val preferences : SharedPreferences = PreferenceManager.getDefaultSharedPreferences(activity)
+            this.isCacheImage = preferences.getBoolean(ID_PREFERENCE_CACHE_LIVE_VIEW_PICTURES, false)
         }
         catch (e : Exception)
         {
             e.printStackTrace()
         }
+        updateCameraLayout()
         return (liveviewView)
     }
 
index 98e01fc..502ca1b 100644 (file)
@@ -9,6 +9,7 @@ import androidx.preference.PreferenceManager
 import jp.osdn.gokigen.gokigenassets.constants.IApplicationConstantConvert.Companion.ID_LAYOUT_PREFERENCE
 import jp.osdn.gokigen.gokigenassets.constants.IApplicationConstantConvert.Companion.ID_PREFERENCE_LABEL_DEBUG_INFO
 import jp.osdn.gokigen.gokigenassets.constants.IApplicationConstantConvert.Companion.ID_PREFERENCE_LABEL_EXIT_APPLICATION
+import jp.osdn.gokigen.gokigenassets.constants.IApplicationConstantConvert.Companion.ID_PREFERENCE_LABEL_SELECT_CAMERA_CONNECTION_METHOD
 import jp.osdn.gokigen.gokigenassets.constants.IApplicationConstantConvert.Companion.ID_PREFERENCE_LABEL_WIFI_SETTINGS
 
 class MainPreferenceFragment : PreferenceFragmentCompat()
@@ -41,6 +42,7 @@ class MainPreferenceFragment : PreferenceFragmentCompat()
         prepareClickListener(ID_PREFERENCE_LABEL_EXIT_APPLICATION)
         prepareClickListener(ID_PREFERENCE_LABEL_WIFI_SETTINGS)
         prepareClickListener(ID_PREFERENCE_LABEL_DEBUG_INFO)
+        prepareClickListener(ID_PREFERENCE_LABEL_SELECT_CAMERA_CONNECTION_METHOD)
     }
 
     private fun prepareChangeListener(context: Context)
index 7f99582..2081085 100644 (file)
@@ -51,6 +51,21 @@ interface IPreferencePropertyAccessor
         const val GR2_LCD_SLEEP = "gr2_lcd_sleep"
         const val USE_GR2_SPECIAL_COMMAND = "use_gr2_command"
 
+        // --- CONNECTION METHOD
+        const val PREFERENCE_CAMERA_METHOD_NONE = "none"
+        const val PREFERENCE_CONNECTION_METHOD = "connection_method"
+        const val PREFERENCE_CAMERA_METHOD_1 = "camera_method1"
+        const val PREFERENCE_CAMERA_METHOD_1_DEFAULT_VALUE = "camerax"
+
+        const val PREFERENCE_CAMERA_METHOD_2 = "camera_method2"
+        const val PREFERENCE_CAMERA_METHOD_2_DEFAULT_VALUE = "camerax"
+
+        const val PREFERENCE_CAMERA_METHOD_3 = "camera_method3"
+        const val PREFERENCE_CAMERA_METHOD_3_DEFAULT_VALUE = "camerax"
+
+        const val PREFERENCE_CAMERA_METHOD_4 = "camera_method4"
+        const val PREFERENCE_CAMERA_METHOD_4_DEFAULT_VALUE = "camerax"
+
     }
 
 }
index 8a4dafc..456645e 100644 (file)
@@ -10,8 +10,9 @@ import androidx.preference.Preference
 import androidx.preference.PreferenceManager
 import jp.osdn.gokigen.gokigenassets.preference.IActionReceiver
 import jp.osdn.gokigen.gokigenassets.scene.IChangeSceneBasic
+import jp.osdn.gokigen.mangle.scene.IChangeScene
 
-class PreferenceChanger(private val activity : AppCompatActivity, private val changeSceneBasic : IChangeSceneBasic) : SharedPreferences.OnSharedPreferenceChangeListener, Preference.OnPreferenceClickListener, IActionReceiver
+class PreferenceChanger(private val activity : AppCompatActivity, private val changeSceneBasic : IChangeSceneBasic, private val changeScene : IChangeScene) : SharedPreferences.OnSharedPreferenceChangeListener, Preference.OnPreferenceClickListener, IActionReceiver
 {
     private var preferences : SharedPreferences = PreferenceManager.getDefaultSharedPreferences(activity)
 
@@ -42,6 +43,7 @@ class PreferenceChanger(private val activity : AppCompatActivity, private val ch
             )
             IPreferencePropertyAccessor.LABEL_EXIT_APPLICATION -> changeSceneBasic.exitApplication()
             IPreferencePropertyAccessor.LABEL_DEBUG_INFO -> changeSceneBasic.changeToDebugInformation()
+            IPreferencePropertyAccessor.PREFERENCE_CONNECTION_METHOD -> changeScene.selectConnectionMethod()
             else -> { Log.v(TAG, " onPreferenceClick() : " + preference?.key); ret = false; }
         }
         return (ret)
index 0f80583..0af9d3d 100644 (file)
@@ -105,6 +105,22 @@ class PreferenceValueInitializer() : IPreferenceValueInitializer
             {
                 editor.putString(IPreferencePropertyAccessor.THETA_LIVEVIEW_RESOLUTION, IPreferencePropertyAccessor.THETA_LIVEVIEW_RESOLUTION_DEFAULT_VALUE)
             }
+            if (!items.containsKey(IPreferencePropertyAccessor.PREFERENCE_CAMERA_METHOD_1))
+            {
+                editor.putString(IPreferencePropertyAccessor.PREFERENCE_CAMERA_METHOD_1, IPreferencePropertyAccessor.PREFERENCE_CAMERA_METHOD_1_DEFAULT_VALUE)
+            }
+            if (!items.containsKey(IPreferencePropertyAccessor.PREFERENCE_CAMERA_METHOD_2))
+            {
+                editor.putString(IPreferencePropertyAccessor.PREFERENCE_CAMERA_METHOD_2, IPreferencePropertyAccessor.PREFERENCE_CAMERA_METHOD_2_DEFAULT_VALUE)
+            }
+            if (!items.containsKey(IPreferencePropertyAccessor.PREFERENCE_CAMERA_METHOD_3))
+            {
+                editor.putString(IPreferencePropertyAccessor.PREFERENCE_CAMERA_METHOD_3, IPreferencePropertyAccessor.PREFERENCE_CAMERA_METHOD_3_DEFAULT_VALUE)
+            }
+            if (!items.containsKey(IPreferencePropertyAccessor.PREFERENCE_CAMERA_METHOD_4))
+            {
+                editor.putString(IPreferencePropertyAccessor.PREFERENCE_CAMERA_METHOD_4, IPreferencePropertyAccessor.PREFERENCE_CAMERA_METHOD_4_DEFAULT_VALUE)
+            }
             editor.apply()
         }
         catch (e : Exception)
diff --git a/app/src/main/java/jp/osdn/gokigen/mangle/preference/SelectCameraConnectionMethodDialog.kt b/app/src/main/java/jp/osdn/gokigen/mangle/preference/SelectCameraConnectionMethodDialog.kt
new file mode 100644 (file)
index 0000000..8327418
--- /dev/null
@@ -0,0 +1,10 @@
+package jp.osdn.gokigen.mangle.preference
+
+import androidx.fragment.app.DialogFragment
+
+class SelectCameraConnectionMethodDialog() : DialogFragment()
+{
+
+
+
+}
\ No newline at end of file
index bb0efd7..1a931e2 100644 (file)
@@ -6,6 +6,7 @@ interface IChangeScene
     fun changeToLiveView()
     fun connectToCamera()
     fun changeToConfiguration()
+    fun selectConnectionMethod()
     //fun changeToDebugInformation()
     //fun exitApplication()
 }
index 00b6299..4d36836 100644 (file)
@@ -6,6 +6,7 @@ import androidx.appcompat.app.AppCompatActivity
 import androidx.camera.core.CameraSelector
 import androidx.fragment.app.Fragment
 import androidx.fragment.app.FragmentTransaction
+import jp.osdn.gokigen.gokigenassets.camera.DummyCameraControl
 import jp.osdn.gokigen.gokigenassets.camera.interfaces.ICameraStatusReceiver
 import jp.osdn.gokigen.gokigenassets.camera.theta.ThetaCameraControl
 import jp.osdn.gokigen.gokigenassets.liveview.LiveImageViewFragment
@@ -13,6 +14,7 @@ import jp.osdn.gokigen.gokigenassets.camera.camerax.operation.CameraControl
 import jp.osdn.gokigen.gokigenassets.preference.MainPreferenceFragment
 import jp.osdn.gokigen.gokigenassets.preference.PreferenceAccessWrapper
 import jp.osdn.gokigen.gokigenassets.camera.camerax.preview.PreviewFragment
+import jp.osdn.gokigen.gokigenassets.camera.interfaces.ICameraControl
 import jp.osdn.gokigen.gokigenassets.scene.IChangeSceneBasic
 import jp.osdn.gokigen.gokigenassets.scene.IInformationReceiver
 import jp.osdn.gokigen.gokigenassets.scene.IVibrator
@@ -20,17 +22,23 @@ import jp.osdn.gokigen.gokigenassets.utils.ConfirmationDialog
 import jp.osdn.gokigen.gokigenassets.utils.logcat.LogCatFragment
 import jp.osdn.gokigen.mangle.R
 import jp.osdn.gokigen.mangle.preference.IPreferencePropertyAccessor
+import jp.osdn.gokigen.mangle.preference.IPreferencePropertyAccessor.Companion.PREFERENCE_CAMERA_METHOD_1
+import jp.osdn.gokigen.mangle.preference.IPreferencePropertyAccessor.Companion.PREFERENCE_CAMERA_METHOD_2
+import jp.osdn.gokigen.mangle.preference.IPreferencePropertyAccessor.Companion.PREFERENCE_CAMERA_METHOD_3
+import jp.osdn.gokigen.mangle.preference.IPreferencePropertyAccessor.Companion.PREFERENCE_CAMERA_METHOD_4
 import jp.osdn.gokigen.mangle.preference.PreferenceChanger
 import jp.osdn.gokigen.mangle.preference.PreferenceValueInitializer
 
-
 class SceneChanger(private val activity: AppCompatActivity, private val informationNotify: IInformationReceiver, vibrator : IVibrator, statusReceiver : ICameraStatusReceiver) : IChangeScene, IChangeSceneBasic
 {
-    private val cameraControl0: CameraControl
-    private val cameraControl1: CameraControl
-    private val cameraControl2 = ThetaCameraControl(activity, vibrator, statusReceiver)
+    private var cameraXisCreated = false
+    private lateinit var cameraControl: ICameraControl
+    private val cameraControl1: ICameraControl
+    private val cameraControl2: ICameraControl
+    private val cameraControl3: ICameraControl
+    private val cameraControl4: ICameraControl
 
-    private val preferenceChanger = PreferenceChanger(activity, this)
+    private val preferenceChanger = PreferenceChanger(activity, this, this)
     private lateinit var liveviewFragment : LiveImageViewFragment
     private lateinit var previewFragment : PreviewFragment
     private lateinit var logCatFragment : LogCatFragment
@@ -39,24 +47,51 @@ class SceneChanger(private val activity: AppCompatActivity, private val informat
     init
     {
         Log.v(TAG, " SceneChanger is created. ")
-        cameraControl0 = CameraControl(activity)
-        cameraControl0.initialize()
 
-        cameraControl1 = CameraControl(activity)
-        cameraControl1.initialize()
+        cameraControl1 = DummyCameraControl() //decideCameraControl(PREFERENCE_CAMERA_METHOD_1, activity, vibrator, statusReceiver)
+        cameraControl2 = decideCameraControl(PREFERENCE_CAMERA_METHOD_2, activity, vibrator, statusReceiver)
+        cameraControl3 = decideCameraControl(PREFERENCE_CAMERA_METHOD_3, activity, vibrator, statusReceiver)
+        cameraControl4 = DummyCameraControl() //decideCameraControl(PREFERENCE_CAMERA_METHOD_4, activity, vibrator, statusReceiver)
 
+        cameraControl1.initialize()
         cameraControl2.initialize()
-        cameraControl2.connectToCamera()
+        cameraControl3.initialize()
+        cameraControl4.initialize()
     }
 
+    private fun decideCameraControl(preferenceKey : String, activity: AppCompatActivity, vibrator : IVibrator, statusReceiver : ICameraStatusReceiver) : ICameraControl
+    {
+        try
+        {
+            if ((cameraXisCreated)&&(::cameraControl.isInitialized))
+            {
+                return (cameraControl)
+            }
+            cameraControl = CameraControl(activity)
+            cameraXisCreated = true
+            return (cameraControl)
+        }
+        catch (e : Exception)
+        {
+            e.printStackTrace()
+        }
+        return (DummyCameraControl())
+    }
+
+
     private fun initializeFragmentForPreview()
     {
+        if (!::cameraControl.isInitialized)
+        {
+            cameraControl = CameraControl(activity)
+            cameraXisCreated = true
+        }
         if (!::previewFragment.isInitialized)
         {
-            previewFragment = PreviewFragment.newInstance(cameraControl0)
+            previewFragment = PreviewFragment.newInstance(cameraControl)
         }
         setDefaultFragment(previewFragment)
-        cameraControl0.startCamera()
+        cameraControl.startCamera()
 
         val msg = activity.getString(R.string.app_name) + " : " + " camerax"
         informationNotify.updateMessage(msg, isBold = false, isColor = true, color = Color.LTGRAY)
@@ -66,20 +101,29 @@ class SceneChanger(private val activity: AppCompatActivity, private val informat
     {
         if (!::liveviewFragment.isInitialized)
         {
+            val isEnableCamera1 = cameraControl1.getConnectionMethod() != "NONE"
+            val isEnableCamera2 = cameraControl2.getConnectionMethod() != "NONE"
+            val isEnableCamera3 = cameraControl3.getConnectionMethod() != "NONE"
+            val isEnableCamera4 = cameraControl4.getConnectionMethod() != "NONE"
+
             liveviewFragment = LiveImageViewFragment.newInstance()
-            liveviewFragment.setCameraControl(true, cameraControl1,true, cameraControl1,true, cameraControl1,true, cameraControl2)
+            liveviewFragment.setCameraControl(isEnableCamera1, cameraControl1, isEnableCamera2, cameraControl2, isEnableCamera3, cameraControl3, isEnableCamera4, cameraControl4)
         }
         setDefaultFragment(liveviewFragment)
 
-        cameraControl0.startCamera(
+        cameraControl1.startCamera(
             isPreviewView = false,
             cameraSelector = CameraSelector.DEFAULT_FRONT_CAMERA
         )
-        cameraControl1.startCamera(
+        cameraControl2.startCamera(
             isPreviewView = false,
             cameraSelector = CameraSelector.DEFAULT_BACK_CAMERA
         )
-        cameraControl2.startCamera(
+        cameraControl3.startCamera(
+            isPreviewView = false,
+            cameraSelector = CameraSelector.DEFAULT_BACK_CAMERA
+        )
+        cameraControl4.startCamera(
             isPreviewView = false,
             cameraSelector = CameraSelector.DEFAULT_BACK_CAMERA
         )
@@ -112,8 +156,17 @@ class SceneChanger(private val activity: AppCompatActivity, private val informat
     {
         if (!::liveviewFragment.isInitialized)
         {
+            val isEnableCamera1 = cameraControl1.getConnectionMethod() != "NONE"
+            val isEnableCamera2 = cameraControl2.getConnectionMethod() != "NONE"
+            val isEnableCamera3 = cameraControl3.getConnectionMethod() != "NONE"
+            val isEnableCamera4 = cameraControl4.getConnectionMethod() != "NONE"
             liveviewFragment = LiveImageViewFragment.newInstance()
-            liveviewFragment.setCameraControl(true, cameraControl0,true, cameraControl0,true, cameraControl1,true, cameraControl1)
+            liveviewFragment.setCameraControl(
+                isEnableCamera1, cameraControl1,
+                isEnableCamera2, cameraControl2,
+                isEnableCamera3, cameraControl3,
+                isEnableCamera4, cameraControl4
+            )
         }
         changeFragment(liveviewFragment)
     }
@@ -164,6 +217,19 @@ class SceneChanger(private val activity: AppCompatActivity, private val informat
         )
     }
 
+    override fun selectConnectionMethod()
+    {
+        try
+        {
+            Log.v(TAG, " selectConnectionMethod ")
+
+        }
+        catch (e : Exception)
+        {
+            e.printStackTrace()
+        }
+    }
+
     private fun changeFragment(fragment: Fragment)
     {
         val transaction : FragmentTransaction = activity.supportFragmentManager.beginTransaction()
@@ -182,9 +248,10 @@ class SceneChanger(private val activity: AppCompatActivity, private val informat
 
     fun finish()
     {
-        cameraControl0.finishCamera()
         cameraControl1.finishCamera()
         cameraControl2.finishCamera()
+        cameraControl3.finishCamera()
+        cameraControl4.finishCamera()
     }
 
     companion object
diff --git a/app/src/main/res/layout/camera_connection_method.xml b/app/src/main/res/layout/camera_connection_method.xml
new file mode 100644 (file)
index 0000000..6c711a3
--- /dev/null
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <View
+        android:layout_width="fill_parent"
+        android:layout_height="1dp"
+        android:background="@android:color/darker_gray"/>
+
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+        <TextView
+            android:id="@+id/label_connection_method1"
+            android:layout_width="0dp"
+            android:layout_height="fill_parent"
+            android:layout_weight="1"
+            android:adjustViewBounds = "true"
+            android:scaleType="fitCenter"
+            android:layout_gravity="center_horizontal"
+            android:gravity="center"
+            android:textSize="9pt"
+            android:text="@string/label_connection_method1"
+            >
+        </TextView>
+        <Spinner
+            android:id="@+id/connection_method1"
+            android:layout_gravity="start"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:padding="6dp"
+            android:textSize="9pt"
+            />
+
+    </LinearLayout>
+
+    <View
+        android:layout_width="fill_parent"
+        android:layout_height="1dp"
+        android:background="@android:color/darker_gray"/>
+
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+        <TextView
+            android:id="@+id/label_connection_method2"
+            android:layout_width="0dp"
+            android:layout_height="fill_parent"
+            android:layout_weight="1"
+            android:adjustViewBounds = "true"
+            android:scaleType="fitCenter"
+            android:layout_gravity="center_horizontal"
+            android:gravity="center"
+            android:textSize="9pt"
+            android:text="@string/label_connection_method2"
+            >
+        </TextView>
+        <Spinner
+            android:id="@+id/connection_method2"
+            android:layout_gravity="start"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:padding="6dp"
+            android:textSize="9pt"
+            />
+
+    </LinearLayout>
+
+    <View
+        android:layout_width="fill_parent"
+        android:layout_height="1dp"
+        android:background="@android:color/darker_gray"/>
+
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+        <TextView
+            android:id="@+id/label_connection_method3"
+            android:layout_width="0dp"
+            android:layout_height="fill_parent"
+            android:layout_weight="1"
+            android:adjustViewBounds = "true"
+            android:scaleType="fitCenter"
+            android:layout_gravity="center_horizontal"
+            android:gravity="center"
+            android:textSize="9pt"
+            android:text="@string/label_connection_method3"
+            >
+        </TextView>
+        <Spinner
+            android:id="@+id/connection_method3"
+            android:layout_gravity="start"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:padding="6dp"
+            android:textSize="9pt"
+            />
+    </LinearLayout>
+
+    <View
+        android:layout_width="fill_parent"
+        android:layout_height="1dp"
+        android:background="@android:color/darker_gray"/>
+
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+        <TextView
+            android:id="@+id/label_connection_method4"
+            android:layout_width="0dp"
+            android:layout_height="fill_parent"
+            android:layout_weight="1"
+            android:adjustViewBounds = "true"
+            android:scaleType="fitCenter"
+            android:layout_gravity="center_horizontal"
+            android:gravity="center"
+            android:textSize="9pt"
+            android:text="@string/label_connection_method4"
+            >
+        </TextView>
+        <Spinner
+            android:id="@+id/connection_method4"
+            android:layout_gravity="start"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:padding="6dp"
+            android:textSize="9pt"
+            />
+    </LinearLayout>
+
+    <View
+        android:layout_width="fill_parent"
+        android:layout_height="1dp"
+        android:background="@android:color/darker_gray"/>
+
+</LinearLayout>
\ No newline at end of file
index 7423790..ed697ea 100644 (file)
     <string name="pref_number_of_cache_pictures">ライブビュー画像の遅延最大数</string>
     <string name="pref_summary_number_of_cache_pictures">ライブビューを遅らせる画像の最大枚数を指定します。(初期値:500、再起動後に有効)</string>
 
+    <string name="pref_connection_method">接続方式設定</string>
+    <string name="pref_summary_connection_method">接続するカメラを設定します。</string>
+
+    <string name="label_connection_method1">カメラ 1</string>
+    <string name="label_connection_method2">カメラ 2</string>
+    <string name="label_connection_method3">カメラ 3</string>
+    <string name="label_connection_method4">カメラ 4</string>
+
     <string name="connect_start">開始</string>
     <string name="connect_check_wifi">WIFI確認中</string>
     <string name="connect_connect">接続</string>
index d2d3b7c..279c6ad 100644 (file)
     <string name="pref_number_of_cache_pictures">Max number of cache pictures</string>
     <string name="pref_summary_number_of_cache_pictures">Set number of cache pictures. (Default:500, enables after restart.)</string>
 
+    <string name="pref_connection_method">Camera Connection Method</string>
+    <string name="pref_summary_connection_method"> </string>
+
+    <string name="label_connection_method1">CAMERA 1</string>
+    <string name="label_connection_method2">CAMERA 2</string>
+    <string name="label_connection_method3">CAMERA 3</string>
+    <string name="label_connection_method4">CAMERA 4</string>
 
     <string name="connect_start">start</string>
     <string name="connect_check_wifi">check WIFI</string>
index 11dc164..b524130 100644 (file)
             android:key="capture_both_camera_and_live_view"
             android:title="@string/pref_capture_both_camera_and_live_view"
             android:summary="@string/pref_summary_capture_both_live_view"/>
+
+        <PreferenceScreen
+            android:key="connection_method"
+            android:title="@string/pref_connection_method"
+            android:summary="@string/pref_summary_connection_method" />
+
 <!--
         <SwitchPreferenceCompat
             android:key="capture_only_live_view"