Ricoh THETA のビュー・撮影
Révision | 9a107c0d8c332950195d69690045909fc214da43 (tree) |
---|---|
l'heure | 2021-03-20 23:03:10 |
Auteur | MRSa <mrsa@myad...> |
Commiter | MRSa |
THETAのシャッターを駆動させないモードを搭載する。
@@ -4,7 +4,7 @@ interface IShowInformation | ||
4 | 4 | { |
5 | 5 | enum class VibratePattern |
6 | 6 | { |
7 | - NONE, SIMPLE_SHORT_SHORT, SIMPLE_SHORT, SIMPLE_LONG | |
7 | + NONE, SIMPLE_SHORT_SHORT, SIMPLE_SHORT, SIMPLE_MIDDLE, SIMPLE_LONG | |
8 | 8 | } |
9 | 9 | |
10 | 10 | fun showToast(rscId: Int, appendMessage: String, duration: Int) |
@@ -172,6 +172,7 @@ class MainActivity : AppCompatActivity(), IShowInformation, ICameraStatusReceive | ||
172 | 172 | { |
173 | 173 | IShowInformation.VibratePattern.SIMPLE_SHORT_SHORT -> vibrator.vibrate(30) |
174 | 174 | IShowInformation.VibratePattern.SIMPLE_SHORT -> vibrator.vibrate(50) |
175 | + IShowInformation.VibratePattern.SIMPLE_MIDDLE -> vibrator.vibrate(100) | |
175 | 176 | IShowInformation.VibratePattern.SIMPLE_LONG -> vibrator.vibrate(150) |
176 | 177 | else -> { } |
177 | 178 | } |
@@ -177,7 +177,13 @@ class ThetaControl(private val context: AppCompatActivity, private val showInfor | ||
177 | 177 | try |
178 | 178 | { |
179 | 179 | 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 | + } | |
181 | 187 | if (statusWatcher.captureMode.contains("image")) |
182 | 188 | { |
183 | 189 | // image |
@@ -215,7 +221,7 @@ class ThetaControl(private val context: AppCompatActivity, private val showInfor | ||
215 | 221 | isMovieRecording = false |
216 | 222 | } |
217 | 223 | |
218 | - private fun captureImageLiveView() | |
224 | + private fun captureImageLiveView() : Boolean | |
219 | 225 | { |
220 | 226 | try |
221 | 227 | { |
@@ -224,6 +230,10 @@ class ThetaControl(private val context: AppCompatActivity, private val showInfor | ||
224 | 230 | IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, |
225 | 231 | IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW_DEFAULT_VALUE |
226 | 232 | ) |
233 | + val notUseShutter = PreferenceAccessWrapper(context).getBoolean( | |
234 | + IPreferencePropertyAccessor.DO_NOT_USE_THETA_SHUTTER, | |
235 | + IPreferencePropertyAccessor.DO_NOT_USE_THETA_SHUTTER_DEFAULT_VALUE | |
236 | + ) | |
227 | 237 | if ((captureBothCamera)&&(liveViewListener.isImageReceived())) |
228 | 238 | { |
229 | 239 | // ライブビュー画像を保管する場合... |
@@ -237,11 +247,13 @@ class ThetaControl(private val context: AppCompatActivity, private val showInfor | ||
237 | 247 | e.printStackTrace() |
238 | 248 | } |
239 | 249 | } |
250 | + return (notUseShutter) | |
240 | 251 | } |
241 | 252 | catch (e : Exception) |
242 | 253 | { |
243 | 254 | e.printStackTrace() |
244 | 255 | } |
256 | + return (false) | |
245 | 257 | } |
246 | 258 | |
247 | 259 | companion object |
@@ -23,6 +23,9 @@ interface IPreferencePropertyAccessor | ||
23 | 23 | const val CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW = "capture_both_camera_and_live_view" |
24 | 24 | const val CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW_DEFAULT_VALUE = false |
25 | 25 | |
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 | + | |
26 | 29 | const val CAPTURE_ONLY_LIVE_VIEW = "capture_only_live_view" |
27 | 30 | const val CAPTURE_ONLY_LIVE_VIEW_DEFAULT_VALUE = false |
28 | 31 |
@@ -138,6 +138,13 @@ class PreferenceValueInitializer : IPreferenceValueInitializer | ||
138 | 138 | IPreferencePropertyAccessor.LIVEVIEW_RESOLUTION_DEFAULT_VALUE |
139 | 139 | ) |
140 | 140 | } |
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 | + } | |
141 | 148 | editor.apply() |
142 | 149 | } |
143 | 150 | catch (e : Exception) |
@@ -28,6 +28,9 @@ | ||
28 | 28 | <string name="save_local_location">ローカル領域に保存</string> |
29 | 29 | |
30 | 30 | <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 | + | |
31 | 34 | <string name="pref_capture_both_camera_and_live_view">ライブ画像を同時保存</string> |
32 | 35 | <string name="pref_summary_capture_both_live_view">撮影時にライブビュー画像を同時保存します</string> |
33 | 36 |
@@ -28,6 +28,9 @@ | ||
28 | 28 | <string name="save_local_location">Save local location</string> |
29 | 29 | |
30 | 30 | <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 | + | |
31 | 34 | <string name="pref_capture_both_camera_and_live_view">Capture LiveView Image</string> |
32 | 35 | <string name="pref_summary_capture_both_live_view">Captures a LiveView image.</string> |
33 | 36 |
@@ -28,6 +28,11 @@ | ||
28 | 28 | android:title="@string/save_local_location"/> |
29 | 29 | --> |
30 | 30 | <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 | |
31 | 36 | android:key="capture_both_camera_and_live_view" |
32 | 37 | android:title="@string/pref_capture_both_camera_and_live_view" |
33 | 38 | android:summary="@string/pref_summary_capture_both_live_view"/> |