• R/O
  • HTTP
  • SSH
  • HTTPS

ThetaView: Commit

Ricoh THETA のビュー・撮影


Commit MetaInfo

Révision9a107c0d8c332950195d69690045909fc214da43 (tree)
l'heure2021-03-20 23:03:10
AuteurMRSa <mrsa@myad...>
CommiterMRSa

Message de Log

THETAのシャッターを駆動させないモードを搭載する。

Change Summary

Modification

--- a/app/src/main/java/jp/osdn/gokigen/thetaview/IShowInformation.kt
+++ b/app/src/main/java/jp/osdn/gokigen/thetaview/IShowInformation.kt
@@ -4,7 +4,7 @@ interface IShowInformation
44 {
55 enum class VibratePattern
66 {
7- NONE, SIMPLE_SHORT_SHORT, SIMPLE_SHORT, SIMPLE_LONG
7+ NONE, SIMPLE_SHORT_SHORT, SIMPLE_SHORT, SIMPLE_MIDDLE, SIMPLE_LONG
88 }
99
1010 fun showToast(rscId: Int, appendMessage: String, duration: Int)
--- a/app/src/main/java/jp/osdn/gokigen/thetaview/MainActivity.kt
+++ b/app/src/main/java/jp/osdn/gokigen/thetaview/MainActivity.kt
@@ -172,6 +172,7 @@ class MainActivity : AppCompatActivity(), IShowInformation, ICameraStatusReceive
172172 {
173173 IShowInformation.VibratePattern.SIMPLE_SHORT_SHORT -> vibrator.vibrate(30)
174174 IShowInformation.VibratePattern.SIMPLE_SHORT -> vibrator.vibrate(50)
175+ IShowInformation.VibratePattern.SIMPLE_MIDDLE -> vibrator.vibrate(100)
175176 IShowInformation.VibratePattern.SIMPLE_LONG -> vibrator.vibrate(150)
176177 else -> { }
177178 }
--- a/app/src/main/java/jp/osdn/gokigen/thetaview/camera/theta/ThetaControl.kt
+++ b/app/src/main/java/jp/osdn/gokigen/thetaview/camera/theta/ThetaControl.kt
@@ -177,7 +177,13 @@ class ThetaControl(private val context: AppCompatActivity, private val showInfor
177177 try
178178 {
179179 Log.v(TAG, " doShutter()")
180- captureImageLiveView()
180+ val isNotDriveShutter = captureImageLiveView()
181+ if (isNotDriveShutter)
182+ {
183+ // シャッターを駆動させない(けど、バイブレーションで通知する)
184+ showInformation.vibrate(IShowInformation.VibratePattern.SIMPLE_SHORT)
185+ return
186+ }
181187 if (statusWatcher.captureMode.contains("image"))
182188 {
183189 // image
@@ -215,7 +221,7 @@ class ThetaControl(private val context: AppCompatActivity, private val showInfor
215221 isMovieRecording = false
216222 }
217223
218- private fun captureImageLiveView()
224+ private fun captureImageLiveView() : Boolean
219225 {
220226 try
221227 {
@@ -224,6 +230,10 @@ class ThetaControl(private val context: AppCompatActivity, private val showInfor
224230 IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW,
225231 IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW_DEFAULT_VALUE
226232 )
233+ val notUseShutter = PreferenceAccessWrapper(context).getBoolean(
234+ IPreferencePropertyAccessor.DO_NOT_USE_THETA_SHUTTER,
235+ IPreferencePropertyAccessor.DO_NOT_USE_THETA_SHUTTER_DEFAULT_VALUE
236+ )
227237 if ((captureBothCamera)&&(liveViewListener.isImageReceived()))
228238 {
229239 // ライブビュー画像を保管する場合...
@@ -237,11 +247,13 @@ class ThetaControl(private val context: AppCompatActivity, private val showInfor
237247 e.printStackTrace()
238248 }
239249 }
250+ return (notUseShutter)
240251 }
241252 catch (e : Exception)
242253 {
243254 e.printStackTrace()
244255 }
256+ return (false)
245257 }
246258
247259 companion object
--- a/app/src/main/java/jp/osdn/gokigen/thetaview/preference/IPreferencePropertyAccessor.kt
+++ b/app/src/main/java/jp/osdn/gokigen/thetaview/preference/IPreferencePropertyAccessor.kt
@@ -23,6 +23,9 @@ interface IPreferencePropertyAccessor
2323 const val CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW = "capture_both_camera_and_live_view"
2424 const val CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW_DEFAULT_VALUE = false
2525
26+ const val DO_NOT_USE_THETA_SHUTTER = "do_not_use_theta_shutter"
27+ const val DO_NOT_USE_THETA_SHUTTER_DEFAULT_VALUE = false
28+
2629 const val CAPTURE_ONLY_LIVE_VIEW = "capture_only_live_view"
2730 const val CAPTURE_ONLY_LIVE_VIEW_DEFAULT_VALUE = false
2831
--- a/app/src/main/java/jp/osdn/gokigen/thetaview/preference/PreferenceValueInitializer.kt
+++ b/app/src/main/java/jp/osdn/gokigen/thetaview/preference/PreferenceValueInitializer.kt
@@ -138,6 +138,13 @@ class PreferenceValueInitializer : IPreferenceValueInitializer
138138 IPreferencePropertyAccessor.LIVEVIEW_RESOLUTION_DEFAULT_VALUE
139139 )
140140 }
141+ if (!items.containsKey(IPreferencePropertyAccessor.DO_NOT_USE_THETA_SHUTTER))
142+ {
143+ editor.putBoolean(
144+ IPreferencePropertyAccessor.DO_NOT_USE_THETA_SHUTTER,
145+ IPreferencePropertyAccessor.DO_NOT_USE_THETA_SHUTTER_DEFAULT_VALUE
146+ )
147+ }
141148 editor.apply()
142149 }
143150 catch (e : Exception)
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -28,6 +28,9 @@
2828 <string name="save_local_location">ローカル領域に保存</string>
2929
3030 <string name="pref_cat_camera">カメラ設定</string>
31+ <string name="pref_do_not_use_theta_shutter">カメラシャッターを使用しない</string>
32+ <string name="pref_summary_do_not_use_theta_shutter">カメラ側のシャッターを駆動させません</string>
33+
3134 <string name="pref_capture_both_camera_and_live_view">ライブ画像を同時保存</string>
3235 <string name="pref_summary_capture_both_live_view">撮影時にライブビュー画像を同時保存します</string>
3336
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -28,6 +28,9 @@
2828 <string name="save_local_location">Save local location</string>
2929
3030 <string name="pref_cat_camera">Camera</string>
31+ <string name="pref_do_not_use_theta_shutter">Do not use Camera Shutter</string>
32+ <string name="pref_summary_do_not_use_theta_shutter"> </string>
33+
3134 <string name="pref_capture_both_camera_and_live_view">Capture LiveView Image</string>
3235 <string name="pref_summary_capture_both_live_view">Captures a LiveView image.</string>
3336
--- a/app/src/main/res/xml/preference_main.xml
+++ b/app/src/main/res/xml/preference_main.xml
@@ -28,6 +28,11 @@
2828 android:title="@string/save_local_location"/>
2929 -->
3030 <SwitchPreferenceCompat
31+ android:key="do_not_use_theta_shutter"
32+ android:title="@string/pref_do_not_use_theta_shutter"
33+ android:summary="@string/pref_summary_do_not_use_theta_shutter"/>
34+
35+ <SwitchPreferenceCompat
3136 android:key="capture_both_camera_and_live_view"
3237 android:title="@string/pref_capture_both_camera_and_live_view"
3338 android:summary="@string/pref_summary_capture_both_live_view"/>
Afficher sur ancien navigateur de dépôt.