theta-client-react-native 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/Converter.kt +196 -19
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +493 -3
- package/ios/ConvertUtil.swift +272 -18
- package/ios/ThetaClientReactNative.m +56 -0
- package/ios/ThetaClientReactNative.swift +574 -2
- package/lib/commonjs/capture/burst-capture.js +119 -0
- package/lib/commonjs/capture/burst-capture.js.map +1 -0
- package/lib/commonjs/capture/composite-interval-capture.js +112 -0
- package/lib/commonjs/capture/composite-interval-capture.js.map +1 -0
- package/lib/commonjs/capture/continuous-capture.js +108 -0
- package/lib/commonjs/capture/continuous-capture.js.map +1 -0
- package/lib/commonjs/capture/index.js +44 -0
- package/lib/commonjs/capture/index.js.map +1 -1
- package/lib/commonjs/capture/multi-bracket-capture.js +121 -0
- package/lib/commonjs/capture/multi-bracket-capture.js.map +1 -0
- package/lib/commonjs/capture/shot-count-specified-interval-capture.js +1 -0
- package/lib/commonjs/capture/shot-count-specified-interval-capture.js.map +1 -1
- package/lib/commonjs/capture/time-shift-capture.js +9 -1
- package/lib/commonjs/capture/time-shift-capture.js.map +1 -1
- package/lib/commonjs/index.js +1 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/theta-repository/access-point.js +1 -2
- package/lib/commonjs/theta-repository/access-point.js.map +1 -1
- package/lib/commonjs/theta-repository/options/index.js +44 -0
- package/lib/commonjs/theta-repository/options/index.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-ai-auto-thumbnail.js +1 -2
- package/lib/commonjs/theta-repository/options/option-ai-auto-thumbnail.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-auto-bracket.js +6 -0
- package/lib/commonjs/theta-repository/options/option-auto-bracket.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-bitrate.js +1 -2
- package/lib/commonjs/theta-repository/options/option-bitrate.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-bluetooth-role.js +20 -0
- package/lib/commonjs/theta-repository/options/option-bluetooth-role.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-burst-mode.js +1 -2
- package/lib/commonjs/theta-repository/options/option-burst-mode.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-burst-option.js +11 -12
- package/lib/commonjs/theta-repository/options/option-burst-option.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-camera-control-source.js +1 -2
- package/lib/commonjs/theta-repository/options/option-camera-control-source.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-camera-mode.js +1 -2
- package/lib/commonjs/theta-repository/options/option-camera-mode.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-capture-mode.js +1 -2
- package/lib/commonjs/theta-repository/options/option-capture-mode.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-continuous-number.js +1 -2
- package/lib/commonjs/theta-repository/options/option-continuous-number.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-face-detect.js +1 -2
- package/lib/commonjs/theta-repository/options/option-face-detect.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-filter.js +1 -2
- package/lib/commonjs/theta-repository/options/option-filter.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-function.js +1 -2
- package/lib/commonjs/theta-repository/options/option-function.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-gain.js +1 -2
- package/lib/commonjs/theta-repository/options/option-gain.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-image-stitching.js +1 -2
- package/lib/commonjs/theta-repository/options/option-image-stitching.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-network-type.js +1 -2
- package/lib/commonjs/theta-repository/options/option-network-type.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-off-delay.js +42 -0
- package/lib/commonjs/theta-repository/options/option-off-delay.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-power-saving.js +1 -2
- package/lib/commonjs/theta-repository/options/option-power-saving.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-preset.js +1 -2
- package/lib/commonjs/theta-repository/options/option-preset.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-preview-format.js +1 -2
- package/lib/commonjs/theta-repository/options/option-preview-format.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-shooting-method.js +1 -2
- package/lib/commonjs/theta-repository/options/option-shooting-method.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-shutter-speed.js +1 -2
- package/lib/commonjs/theta-repository/options/option-shutter-speed.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-sleep-delay.js +42 -0
- package/lib/commonjs/theta-repository/options/option-sleep-delay.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-time-shift.js +1 -2
- package/lib/commonjs/theta-repository/options/option-time-shift.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-top-bottom-correction.js +1 -2
- package/lib/commonjs/theta-repository/options/option-top-bottom-correction.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-video-stitching.js +1 -2
- package/lib/commonjs/theta-repository/options/option-video-stitching.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-visibility-reduction.js +1 -2
- package/lib/commonjs/theta-repository/options/option-visibility-reduction.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-white-balance-auto-strength.js +1 -2
- package/lib/commonjs/theta-repository/options/option-white-balance-auto-strength.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-wlan-frequency.js +1 -2
- package/lib/commonjs/theta-repository/options/option-wlan-frequency.js.map +1 -1
- package/lib/commonjs/theta-repository/options/options.js +32 -62
- package/lib/commonjs/theta-repository/options/options.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-files.js +7 -8
- package/lib/commonjs/theta-repository/theta-files.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-info.js +1 -2
- package/lib/commonjs/theta-repository/theta-info.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-repository.js +50 -23
- package/lib/commonjs/theta-repository/theta-repository.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-state.js +7 -8
- package/lib/commonjs/theta-repository/theta-state.js.map +1 -1
- package/lib/module/capture/burst-capture.js +111 -0
- package/lib/module/capture/burst-capture.js.map +1 -0
- package/lib/module/capture/composite-interval-capture.js +104 -0
- package/lib/module/capture/composite-interval-capture.js.map +1 -0
- package/lib/module/capture/continuous-capture.js +100 -0
- package/lib/module/capture/continuous-capture.js.map +1 -0
- package/lib/module/capture/index.js +4 -0
- package/lib/module/capture/index.js.map +1 -1
- package/lib/module/capture/multi-bracket-capture.js +113 -0
- package/lib/module/capture/multi-bracket-capture.js.map +1 -0
- package/lib/module/capture/shot-count-specified-interval-capture.js +1 -0
- package/lib/module/capture/shot-count-specified-interval-capture.js.map +1 -1
- package/lib/module/capture/time-shift-capture.js +9 -1
- package/lib/module/capture/time-shift-capture.js.map +1 -1
- package/lib/module/theta-repository/options/index.js +4 -0
- package/lib/module/theta-repository/options/index.js.map +1 -1
- package/lib/module/theta-repository/options/option-auto-bracket.js +2 -0
- package/lib/module/theta-repository/options/option-auto-bracket.js.map +1 -0
- package/lib/module/theta-repository/options/option-bluetooth-role.js +14 -0
- package/lib/module/theta-repository/options/option-bluetooth-role.js.map +1 -0
- package/lib/module/theta-repository/options/option-off-delay.js +35 -0
- package/lib/module/theta-repository/options/option-off-delay.js.map +1 -0
- package/lib/module/theta-repository/options/option-sleep-delay.js +35 -0
- package/lib/module/theta-repository/options/option-sleep-delay.js.map +1 -0
- package/lib/module/theta-repository/options/options.js +4 -32
- package/lib/module/theta-repository/options/options.js.map +1 -1
- package/lib/module/theta-repository/theta-repository.js +47 -24
- package/lib/module/theta-repository/theta-repository.js.map +1 -1
- package/lib/typescript/capture/burst-capture.d.ts +55 -0
- package/lib/typescript/capture/burst-capture.d.ts.map +1 -0
- package/lib/typescript/capture/composite-interval-capture.d.ts +47 -0
- package/lib/typescript/capture/composite-interval-capture.d.ts.map +1 -0
- package/lib/typescript/capture/continuous-capture.d.ts +49 -0
- package/lib/typescript/capture/continuous-capture.d.ts.map +1 -0
- package/lib/typescript/capture/index.d.ts +4 -0
- package/lib/typescript/capture/index.d.ts.map +1 -1
- package/lib/typescript/capture/multi-bracket-capture.d.ts +56 -0
- package/lib/typescript/capture/multi-bracket-capture.d.ts.map +1 -0
- package/lib/typescript/capture/shot-count-specified-interval-capture.d.ts +1 -0
- package/lib/typescript/capture/shot-count-specified-interval-capture.d.ts.map +1 -1
- package/lib/typescript/capture/time-shift-capture.d.ts +2 -1
- package/lib/typescript/capture/time-shift-capture.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/index.d.ts +4 -0
- package/lib/typescript/theta-repository/options/index.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-auto-bracket.d.ts +36 -0
- package/lib/typescript/theta-repository/options/option-auto-bracket.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-bluetooth-role.d.ts +14 -0
- package/lib/typescript/theta-repository/options/option-bluetooth-role.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-off-delay.d.ts +22 -0
- package/lib/typescript/theta-repository/options/option-off-delay.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-sleep-delay.d.ts +22 -0
- package/lib/typescript/theta-repository/options/option-sleep-delay.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/options.d.ts +12 -30
- package/lib/typescript/theta-repository/options/options.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-repository.d.ts +32 -2
- package/lib/typescript/theta-repository/theta-repository.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/capture/burst-capture.ts +169 -0
- package/src/capture/composite-interval-capture.ts +140 -0
- package/src/capture/continuous-capture.ts +126 -0
- package/src/capture/index.ts +4 -0
- package/src/capture/multi-bracket-capture.ts +145 -0
- package/src/capture/shot-count-specified-interval-capture.ts +1 -0
- package/src/capture/time-shift-capture.ts +19 -1
- package/src/theta-repository/options/index.ts +4 -0
- package/src/theta-repository/options/option-auto-bracket.ts +48 -0
- package/src/theta-repository/options/option-bluetooth-role.ts +15 -0
- package/src/theta-repository/options/option-off-delay.ts +38 -0
- package/src/theta-repository/options/option-sleep-delay.ts +37 -0
- package/src/theta-repository/options/options.ts +12 -38
- package/src/theta-repository/theta-repository.ts +68 -0
- package/theta-client-react-native.podspec +1 -1
|
@@ -3,8 +3,8 @@ package com.ricoh360.thetaclientreactnative
|
|
|
3
3
|
import com.facebook.react.bridge.*
|
|
4
4
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
5
5
|
import com.ricoh360.thetaclient.ThetaRepository
|
|
6
|
+
import com.ricoh360.thetaclient.ThetaRepository.*
|
|
6
7
|
import com.ricoh360.thetaclient.capture.*
|
|
7
|
-
import io.ktor.utils.io.core.*
|
|
8
8
|
import kotlinx.coroutines.*
|
|
9
9
|
import java.util.*
|
|
10
10
|
import kotlin.coroutines.*
|
|
@@ -35,6 +35,17 @@ class ThetaClientReactNativeModule(
|
|
|
35
35
|
var shotCountSpecifiedIntervalCaptureBuilder: ShotCountSpecifiedIntervalCapture.Builder? = null
|
|
36
36
|
var shotCountSpecifiedIntervalCapture: ShotCountSpecifiedIntervalCapture? = null
|
|
37
37
|
var shotCountSpecifiedIntervalCapturing: ShotCountSpecifiedIntervalCapturing? = null
|
|
38
|
+
var compositeIntervalCaptureBuilder: CompositeIntervalCapture.Builder? = null
|
|
39
|
+
var compositeIntervalCapture: CompositeIntervalCapture? = null
|
|
40
|
+
var compositeIntervalCapturing: CompositeIntervalCapturing? = null
|
|
41
|
+
var burstCaptureBuilder: BurstCapture.Builder? = null
|
|
42
|
+
var burstCapture: BurstCapture? = null
|
|
43
|
+
var burstCapturing: BurstCapturing? = null
|
|
44
|
+
var multiBracketCaptureBuilder: MultiBracketCapture.Builder? = null
|
|
45
|
+
var multiBracketCapture: MultiBracketCapture? = null
|
|
46
|
+
var multiBracketCapturing: MultiBracketCapturing? = null
|
|
47
|
+
var continuousCaptureBuilder: ContinuousCapture.Builder? = null
|
|
48
|
+
var continuousCapture: ContinuousCapture? = null
|
|
38
49
|
var theta: ThetaRepository? = null
|
|
39
50
|
var listenerCount: Int = 0
|
|
40
51
|
|
|
@@ -97,6 +108,17 @@ class ThetaClientReactNativeModule(
|
|
|
97
108
|
shotCountSpecifiedIntervalCaptureBuilder = null
|
|
98
109
|
shotCountSpecifiedIntervalCapture = null
|
|
99
110
|
shotCountSpecifiedIntervalCapturing = null
|
|
111
|
+
compositeIntervalCaptureBuilder = null
|
|
112
|
+
compositeIntervalCapture = null
|
|
113
|
+
compositeIntervalCapturing = null
|
|
114
|
+
burstCaptureBuilder = null
|
|
115
|
+
burstCapture = null
|
|
116
|
+
burstCapturing = null
|
|
117
|
+
multiBracketCaptureBuilder = null
|
|
118
|
+
multiBracketCapture = null
|
|
119
|
+
multiBracketCapturing = null
|
|
120
|
+
continuousCaptureBuilder = null
|
|
121
|
+
continuousCapture = null
|
|
100
122
|
|
|
101
123
|
theta = ThetaRepository.newInstance(
|
|
102
124
|
endpoint,
|
|
@@ -595,7 +617,7 @@ class ThetaClientReactNativeModule(
|
|
|
595
617
|
return
|
|
596
618
|
}
|
|
597
619
|
class StartCaptureCallback : TimeShiftCapture.StartCaptureCallback {
|
|
598
|
-
override fun
|
|
620
|
+
override fun onCaptureCompleted(fileUrl: String?) {
|
|
599
621
|
promise.resolve(fileUrl)
|
|
600
622
|
timeShiftCapture = null
|
|
601
623
|
}
|
|
@@ -606,10 +628,19 @@ class ThetaClientReactNativeModule(
|
|
|
606
628
|
)
|
|
607
629
|
}
|
|
608
630
|
|
|
609
|
-
override fun
|
|
631
|
+
override fun onCaptureFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
610
632
|
promise.reject(exception)
|
|
611
633
|
timeShiftCapture = null
|
|
612
634
|
}
|
|
635
|
+
|
|
636
|
+
override fun onStopFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
637
|
+
sendNotifyEvent(
|
|
638
|
+
toNotify(
|
|
639
|
+
NOTIFY_TIMESHIFT_STOP_ERROR,
|
|
640
|
+
toMessageNotifyParam(exception.message ?: exception.toString())
|
|
641
|
+
)
|
|
642
|
+
)
|
|
643
|
+
}
|
|
613
644
|
}
|
|
614
645
|
timeShiftCapturing = timeShiftCapture?.startCapture(StartCaptureCallback())
|
|
615
646
|
}
|
|
@@ -938,6 +969,457 @@ class ThetaClientReactNativeModule(
|
|
|
938
969
|
promise.resolve(true)
|
|
939
970
|
}
|
|
940
971
|
|
|
972
|
+
/**
|
|
973
|
+
* getCompositeIntervalCaptureBuilder - get interval composite shooting builder from repository
|
|
974
|
+
* @param shootingTimeSec Shooting time for interval composite shooting (sec)
|
|
975
|
+
* @param promise Promise for getCompositeIntervalCaptureBuilder
|
|
976
|
+
*/
|
|
977
|
+
@ReactMethod
|
|
978
|
+
fun getCompositeIntervalCaptureBuilder(shootingTimeSec: Int, promise: Promise) {
|
|
979
|
+
val theta = theta
|
|
980
|
+
if (theta == null) {
|
|
981
|
+
promise.reject(Exception(messageNotInit))
|
|
982
|
+
return
|
|
983
|
+
}
|
|
984
|
+
compositeIntervalCaptureBuilder = theta.getCompositeIntervalCaptureBuilder(shootingTimeSec)
|
|
985
|
+
promise.resolve(true)
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* buildCompositeIntervalCapture - build interval composite shooting
|
|
990
|
+
* @param options option to execute interval composite shooting
|
|
991
|
+
* @param promise Promise for buildCompositeIntervalCapture
|
|
992
|
+
*/
|
|
993
|
+
@ReactMethod
|
|
994
|
+
fun buildCompositeIntervalCapture(options: ReadableMap, promise: Promise) {
|
|
995
|
+
if (theta == null) {
|
|
996
|
+
promise.reject(Exception(messageNotInit))
|
|
997
|
+
return
|
|
998
|
+
}
|
|
999
|
+
if (compositeIntervalCaptureBuilder == null) {
|
|
1000
|
+
promise.reject(Exception("no compositeIntervalCaptureBuilder"))
|
|
1001
|
+
return
|
|
1002
|
+
}
|
|
1003
|
+
launch {
|
|
1004
|
+
try {
|
|
1005
|
+
compositeIntervalCaptureBuilder?.let {
|
|
1006
|
+
setCaptureBuilderParams(optionMap = options, builder = it)
|
|
1007
|
+
setCompositeIntervalCaptureBuilderParams(optionMap = options, builder = it)
|
|
1008
|
+
compositeIntervalCapture = it.build()
|
|
1009
|
+
}
|
|
1010
|
+
promise.resolve(true)
|
|
1011
|
+
compositeIntervalCaptureBuilder = null
|
|
1012
|
+
} catch (t: Throwable) {
|
|
1013
|
+
promise.reject(t)
|
|
1014
|
+
compositeIntervalCaptureBuilder = null
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* startCompositeIntervalCapture - start interval composite shooting
|
|
1021
|
+
* @param promise promise for startCompositeIntervalCapture
|
|
1022
|
+
*/
|
|
1023
|
+
@ReactMethod
|
|
1024
|
+
fun startCompositeIntervalCapture(promise: Promise) {
|
|
1025
|
+
if (theta == null) {
|
|
1026
|
+
promise.reject(Exception(messageNotInit))
|
|
1027
|
+
return
|
|
1028
|
+
}
|
|
1029
|
+
if (compositeIntervalCapture == null) {
|
|
1030
|
+
promise.reject(Exception("no compositeIntervalCapture"))
|
|
1031
|
+
return
|
|
1032
|
+
}
|
|
1033
|
+
class StartCaptureCallback : CompositeIntervalCapture.StartCaptureCallback {
|
|
1034
|
+
override fun onCaptureCompleted(fileUrls: List<String>?) {
|
|
1035
|
+
promise.resolve(fileUrls?.let {
|
|
1036
|
+
val resultList = Arguments.createArray()
|
|
1037
|
+
it.forEach {
|
|
1038
|
+
resultList.pushString(it)
|
|
1039
|
+
}
|
|
1040
|
+
resultList
|
|
1041
|
+
})
|
|
1042
|
+
compositeIntervalCapture = null
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
override fun onProgress(completion: Float) {
|
|
1046
|
+
sendNotifyEvent(
|
|
1047
|
+
toNotify(
|
|
1048
|
+
NOTIFY_COMPOSITE_INTERVAL_PROGRESS,
|
|
1049
|
+
toCaptureProgressNotifyParam(value = completion)
|
|
1050
|
+
)
|
|
1051
|
+
)
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
override fun onStopFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
1055
|
+
sendNotifyEvent(
|
|
1056
|
+
toNotify(
|
|
1057
|
+
NOTIFY_COMPOSITE_INTERVAL_STOP_ERROR,
|
|
1058
|
+
toMessageNotifyParam(exception.message ?: exception.toString())
|
|
1059
|
+
)
|
|
1060
|
+
)
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
override fun onCaptureFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
1064
|
+
promise.reject(exception)
|
|
1065
|
+
compositeIntervalCapture = null
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
compositeIntervalCapturing = compositeIntervalCapture?.startCapture(StartCaptureCallback())
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* cancelCompositeIntervalCapture - stop interval composite shooting
|
|
1073
|
+
* @param promise promise for cancelCompositeIntervalCapture
|
|
1074
|
+
*/
|
|
1075
|
+
@ReactMethod
|
|
1076
|
+
fun cancelCompositeIntervalCapture(promise: Promise) {
|
|
1077
|
+
if (theta == null) {
|
|
1078
|
+
promise.reject(Exception(messageNotInit))
|
|
1079
|
+
return
|
|
1080
|
+
}
|
|
1081
|
+
compositeIntervalCapturing?.cancelCapture()
|
|
1082
|
+
promise.resolve(true)
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
* getBurstCaptureBuilder - get burst shooting builder from repository
|
|
1087
|
+
*
|
|
1088
|
+
* @param burstCaptureNum Number of shots for burst shooting
|
|
1089
|
+
* @param burstBracketStep Bracket value range between each shot for burst shooting
|
|
1090
|
+
* @param burstCompensation Exposure compensation for the base image and entire shooting for burst shooting
|
|
1091
|
+
* @param burstMaxExposureTime Maximum exposure time for burst shooting
|
|
1092
|
+
* @param burstEnableIsoControl Adjustment with ISO sensitivity for burst shooting
|
|
1093
|
+
* @param burstOrder Shooting order for burst shooting
|
|
1094
|
+
* @param promise Promise for getBurstCaptureBuilder
|
|
1095
|
+
*/
|
|
1096
|
+
@ReactMethod
|
|
1097
|
+
fun getBurstCaptureBuilder(
|
|
1098
|
+
burstCaptureNum: String,
|
|
1099
|
+
burstBracketStep: String,
|
|
1100
|
+
burstCompensation: String,
|
|
1101
|
+
burstMaxExposureTime: String,
|
|
1102
|
+
burstEnableIsoControl: String,
|
|
1103
|
+
burstOrder: String,
|
|
1104
|
+
promise: Promise
|
|
1105
|
+
) {
|
|
1106
|
+
val theta = theta
|
|
1107
|
+
if (theta == null) {
|
|
1108
|
+
promise.reject(Exception(messageNotInit))
|
|
1109
|
+
return
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
burstCaptureBuilder = theta.getBurstCaptureBuilder(
|
|
1113
|
+
burstCaptureNum = ThetaRepository.BurstCaptureNumEnum.valueOf(burstCaptureNum),
|
|
1114
|
+
burstBracketStep = ThetaRepository.BurstBracketStepEnum.valueOf(burstBracketStep),
|
|
1115
|
+
burstCompensation = ThetaRepository.BurstCompensationEnum.valueOf(burstCompensation),
|
|
1116
|
+
burstMaxExposureTime = ThetaRepository.BurstMaxExposureTimeEnum.valueOf(burstMaxExposureTime),
|
|
1117
|
+
burstEnableIsoControl = ThetaRepository.BurstEnableIsoControlEnum.valueOf(burstEnableIsoControl),
|
|
1118
|
+
burstOrder = ThetaRepository.BurstOrderEnum.valueOf(burstOrder)
|
|
1119
|
+
)
|
|
1120
|
+
promise.resolve(true)
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
/**
|
|
1124
|
+
* buildBurstCapture - build burst shooting
|
|
1125
|
+
* @param options option to execute burst shooting
|
|
1126
|
+
* @param promise Promise for buildBurstCapture
|
|
1127
|
+
*/
|
|
1128
|
+
@ReactMethod
|
|
1129
|
+
fun buildBurstCapture(options: ReadableMap, promise: Promise) {
|
|
1130
|
+
if (theta == null) {
|
|
1131
|
+
promise.reject(Exception(messageNotInit))
|
|
1132
|
+
return
|
|
1133
|
+
}
|
|
1134
|
+
if (burstCaptureBuilder == null) {
|
|
1135
|
+
promise.reject(Exception("no burstCaptureBuilder"))
|
|
1136
|
+
return
|
|
1137
|
+
}
|
|
1138
|
+
launch {
|
|
1139
|
+
try {
|
|
1140
|
+
burstCaptureBuilder?.let {
|
|
1141
|
+
setCaptureBuilderParams(optionMap = options, builder = it)
|
|
1142
|
+
setBurstCaptureBuilderParams(optionMap = options, builder = it)
|
|
1143
|
+
burstCapture = it.build()
|
|
1144
|
+
}
|
|
1145
|
+
promise.resolve(true)
|
|
1146
|
+
burstCaptureBuilder = null
|
|
1147
|
+
} catch (t: Throwable) {
|
|
1148
|
+
promise.reject(t)
|
|
1149
|
+
burstCaptureBuilder = null
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* startBurstCapture - start burst shooting
|
|
1156
|
+
* @param promise promise for startBurstCapture
|
|
1157
|
+
*/
|
|
1158
|
+
@ReactMethod
|
|
1159
|
+
fun startBurstCapture(promise: Promise) {
|
|
1160
|
+
if (theta == null) {
|
|
1161
|
+
promise.reject(Exception(messageNotInit))
|
|
1162
|
+
return
|
|
1163
|
+
}
|
|
1164
|
+
if (burstCapture == null) {
|
|
1165
|
+
promise.reject(Exception("no burstCapture"))
|
|
1166
|
+
return
|
|
1167
|
+
}
|
|
1168
|
+
class StartCaptureCallback : BurstCapture.StartCaptureCallback {
|
|
1169
|
+
override fun onCaptureCompleted(fileUrls: List<String>?) {
|
|
1170
|
+
promise.resolve(fileUrls?.let {
|
|
1171
|
+
val resultList = Arguments.createArray()
|
|
1172
|
+
it.forEach {
|
|
1173
|
+
resultList.pushString(it)
|
|
1174
|
+
}
|
|
1175
|
+
resultList
|
|
1176
|
+
})
|
|
1177
|
+
burstCapture = null
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
override fun onProgress(completion: Float) {
|
|
1181
|
+
sendNotifyEvent(
|
|
1182
|
+
toNotify(
|
|
1183
|
+
NOTIFY_BURST_PROGRESS,
|
|
1184
|
+
toCaptureProgressNotifyParam(value = completion)
|
|
1185
|
+
)
|
|
1186
|
+
)
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
override fun onStopFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
1190
|
+
sendNotifyEvent(
|
|
1191
|
+
toNotify(
|
|
1192
|
+
NOTIFY_BURST_STOP_ERROR,
|
|
1193
|
+
toMessageNotifyParam(exception.message ?: exception.toString())
|
|
1194
|
+
)
|
|
1195
|
+
)
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
override fun onCaptureFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
1199
|
+
promise.reject(exception)
|
|
1200
|
+
burstCapture = null
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
burstCapturing = burstCapture?.startCapture(StartCaptureCallback())
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* cancelBurstCapture - stop burst shooting
|
|
1208
|
+
* @param promise promise for cancelBurstCapture
|
|
1209
|
+
*/
|
|
1210
|
+
@ReactMethod
|
|
1211
|
+
fun cancelBurstCapture(promise: Promise) {
|
|
1212
|
+
if (theta == null) {
|
|
1213
|
+
promise.reject(Exception(messageNotInit))
|
|
1214
|
+
return
|
|
1215
|
+
}
|
|
1216
|
+
burstCapturing?.cancelCapture()
|
|
1217
|
+
promise.resolve(true)
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* getMultiBracketCaptureBuilder - get multi bracket shooting builder from repository
|
|
1222
|
+
* @param promise Promise for getMultiBracketCaptureBuilder
|
|
1223
|
+
*/
|
|
1224
|
+
@ReactMethod
|
|
1225
|
+
fun getMultiBracketCaptureBuilder(promise: Promise) {
|
|
1226
|
+
val theta = theta
|
|
1227
|
+
if (theta == null) {
|
|
1228
|
+
promise.reject(Exception(messageNotInit))
|
|
1229
|
+
return
|
|
1230
|
+
}
|
|
1231
|
+
multiBracketCaptureBuilder = theta.getMultiBracketCaptureBuilder()
|
|
1232
|
+
promise.resolve(true)
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
/**
|
|
1236
|
+
* buildMultiBracketCapture - build multi bracket shooting
|
|
1237
|
+
* @param options option to execute multi bracket shooting
|
|
1238
|
+
* @param promise Promise for buildMultiBracketCapture
|
|
1239
|
+
*/
|
|
1240
|
+
@ReactMethod
|
|
1241
|
+
fun buildMultiBracketCapture(options: ReadableMap, promise: Promise) {
|
|
1242
|
+
if (theta == null) {
|
|
1243
|
+
promise.reject(Exception(messageNotInit))
|
|
1244
|
+
return
|
|
1245
|
+
}
|
|
1246
|
+
if (multiBracketCaptureBuilder == null) {
|
|
1247
|
+
promise.reject(Exception("no MultiBracketCaptureBuilder"))
|
|
1248
|
+
return
|
|
1249
|
+
}
|
|
1250
|
+
launch {
|
|
1251
|
+
try {
|
|
1252
|
+
multiBracketCaptureBuilder?.let {
|
|
1253
|
+
setCaptureBuilderParams(optionMap = options, builder = it)
|
|
1254
|
+
setMultiBracketCaptureBuilderParams(optionMap = options, builder = it)
|
|
1255
|
+
multiBracketCapture = it.build()
|
|
1256
|
+
}
|
|
1257
|
+
promise.resolve(true)
|
|
1258
|
+
multiBracketCaptureBuilder = null
|
|
1259
|
+
} catch (t: Throwable) {
|
|
1260
|
+
promise.reject(t)
|
|
1261
|
+
multiBracketCaptureBuilder = null
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
/**
|
|
1267
|
+
* startMultiBracketCapture - start multi bracket shooting
|
|
1268
|
+
* @param promise promise for startMultiBracketCapture
|
|
1269
|
+
*/
|
|
1270
|
+
@ReactMethod
|
|
1271
|
+
fun startMultiBracketCapture(promise: Promise) {
|
|
1272
|
+
if (theta == null) {
|
|
1273
|
+
promise.reject(Exception(messageNotInit))
|
|
1274
|
+
return
|
|
1275
|
+
}
|
|
1276
|
+
if (multiBracketCapture == null) {
|
|
1277
|
+
promise.reject(Exception("no multiBracketCapture"))
|
|
1278
|
+
return
|
|
1279
|
+
}
|
|
1280
|
+
class StartCaptureCallback : MultiBracketCapture.StartCaptureCallback {
|
|
1281
|
+
override fun onCaptureCompleted(fileUrls: List<String>?) {
|
|
1282
|
+
promise.resolve(fileUrls?.let {
|
|
1283
|
+
val resultList = Arguments.createArray()
|
|
1284
|
+
it.forEach {
|
|
1285
|
+
resultList.pushString(it)
|
|
1286
|
+
}
|
|
1287
|
+
resultList
|
|
1288
|
+
})
|
|
1289
|
+
multiBracketCapture = null
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
override fun onProgress(completion: Float) {
|
|
1293
|
+
sendNotifyEvent(
|
|
1294
|
+
toNotify(
|
|
1295
|
+
NOTIFY_MULTI_BRACKET_PROGRESS,
|
|
1296
|
+
toCaptureProgressNotifyParam(value = completion)
|
|
1297
|
+
)
|
|
1298
|
+
)
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
override fun onStopFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
1302
|
+
sendNotifyEvent(
|
|
1303
|
+
toNotify(
|
|
1304
|
+
NOTIFY_MULTI_BRACKET_STOP_ERROR,
|
|
1305
|
+
toMessageNotifyParam(exception.message ?: exception.toString())
|
|
1306
|
+
)
|
|
1307
|
+
)
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
override fun onCaptureFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
1311
|
+
promise.reject(exception)
|
|
1312
|
+
multiBracketCapture = null
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
multiBracketCapturing = multiBracketCapture?.startCapture(StartCaptureCallback())
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
/**
|
|
1319
|
+
* cancelMultiBracketCapture - stop multi bracket shooting
|
|
1320
|
+
* @param promise promise for cancelMultiBracketCapture
|
|
1321
|
+
*/
|
|
1322
|
+
@ReactMethod
|
|
1323
|
+
fun cancelMultiBracketCapture(promise: Promise) {
|
|
1324
|
+
if (theta == null) {
|
|
1325
|
+
promise.reject(Exception(messageNotInit))
|
|
1326
|
+
return
|
|
1327
|
+
}
|
|
1328
|
+
multiBracketCapturing?.cancelCapture()
|
|
1329
|
+
promise.resolve(true)
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
/**
|
|
1333
|
+
* getContinuousCaptureBuilder - get continuous shooting builder from repository
|
|
1334
|
+
*
|
|
1335
|
+
* @param promise Promise for getContinuousCaptureBuilder
|
|
1336
|
+
*/
|
|
1337
|
+
@ReactMethod
|
|
1338
|
+
fun getContinuousCaptureBuilder(promise: Promise) {
|
|
1339
|
+
val theta = theta
|
|
1340
|
+
if (theta == null) {
|
|
1341
|
+
promise.reject(Exception(messageNotInit))
|
|
1342
|
+
return
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
continuousCaptureBuilder = theta.getContinuousCaptureBuilder()
|
|
1346
|
+
promise.resolve(true)
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
/**
|
|
1350
|
+
* buildContinuousCapture - build continuous shooting
|
|
1351
|
+
* @param options option to execute continuous shooting
|
|
1352
|
+
* @param promise Promise for buildContinuousCapture
|
|
1353
|
+
*/
|
|
1354
|
+
@ReactMethod
|
|
1355
|
+
fun buildContinuousCapture(options: ReadableMap, promise: Promise) {
|
|
1356
|
+
if (theta == null) {
|
|
1357
|
+
promise.reject(Exception(messageNotInit))
|
|
1358
|
+
return
|
|
1359
|
+
}
|
|
1360
|
+
if (continuousCaptureBuilder == null) {
|
|
1361
|
+
promise.reject(Exception("no continuousCaptureBuilder"))
|
|
1362
|
+
return
|
|
1363
|
+
}
|
|
1364
|
+
launch {
|
|
1365
|
+
try {
|
|
1366
|
+
continuousCaptureBuilder?.let {
|
|
1367
|
+
setCaptureBuilderParams(optionMap = options, builder = it)
|
|
1368
|
+
setContinuousCaptureBuilderParams(optionMap = options, builder = it)
|
|
1369
|
+
continuousCapture = it.build()
|
|
1370
|
+
}
|
|
1371
|
+
promise.resolve(true)
|
|
1372
|
+
continuousCaptureBuilder = null
|
|
1373
|
+
} catch (t: Throwable) {
|
|
1374
|
+
promise.reject(t)
|
|
1375
|
+
continuousCaptureBuilder = null
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
/**
|
|
1381
|
+
* startContinuousCapture - start continuous shooting
|
|
1382
|
+
* @param promise promise for startContinuousCapture
|
|
1383
|
+
*/
|
|
1384
|
+
@ReactMethod
|
|
1385
|
+
fun startContinuousCapture(promise: Promise) {
|
|
1386
|
+
if (theta == null) {
|
|
1387
|
+
promise.reject(Exception(messageNotInit))
|
|
1388
|
+
return
|
|
1389
|
+
}
|
|
1390
|
+
if (continuousCapture == null) {
|
|
1391
|
+
promise.reject(Exception("no continuousCapture"))
|
|
1392
|
+
return
|
|
1393
|
+
}
|
|
1394
|
+
class StartCaptureCallback : ContinuousCapture.StartCaptureCallback {
|
|
1395
|
+
override fun onCaptureCompleted(fileUrls: List<String>?) {
|
|
1396
|
+
promise.resolve(fileUrls?.let {
|
|
1397
|
+
val resultList = Arguments.createArray()
|
|
1398
|
+
it.forEach {
|
|
1399
|
+
resultList.pushString(it)
|
|
1400
|
+
}
|
|
1401
|
+
resultList
|
|
1402
|
+
})
|
|
1403
|
+
continuousCapture = null
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
override fun onProgress(completion: Float) {
|
|
1407
|
+
sendNotifyEvent(
|
|
1408
|
+
toNotify(
|
|
1409
|
+
NOTIFY_CONTINUOUS_PROGRESS,
|
|
1410
|
+
toCaptureProgressNotifyParam(value = completion)
|
|
1411
|
+
)
|
|
1412
|
+
)
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
override fun onCaptureFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
1416
|
+
promise.reject(exception)
|
|
1417
|
+
continuousCapture = null
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
continuousCapture?.startCapture(StartCaptureCallback())
|
|
1421
|
+
}
|
|
1422
|
+
|
|
941
1423
|
/**
|
|
942
1424
|
* getMetadata - retrieve meta data from THETA via repository
|
|
943
1425
|
* @param promise promise to set result
|
|
@@ -1546,9 +2028,17 @@ class ThetaClientReactNativeModule(
|
|
|
1546
2028
|
const val EVENT_NAME = "ThetaFrameEvent"
|
|
1547
2029
|
const val EVENT_NOTIFY = "ThetaNotify"
|
|
1548
2030
|
const val NOTIFY_TIMESHIFT_PROGRESS = "TIME-SHIFT-PROGRESS"
|
|
2031
|
+
const val NOTIFY_TIMESHIFT_STOP_ERROR = "TIME-SHIFT-STOP-ERROR"
|
|
1549
2032
|
const val NOTIFY_VIDEO_CAPTURE_STOP_ERROR = "VIDEO-CAPTURE-STOP-ERROR"
|
|
1550
2033
|
const val NOTIFY_LIMITLESS_INTERVAL_CAPTURE_STOP_ERROR = "LIMITLESS-INTERVAL-CAPTURE-STOP-ERROR"
|
|
1551
2034
|
const val NOTIFY_SHOT_COUNT_SPECIFIED_INTERVAL_PROGRESS = "SHOT-COUNT-SPECIFIED-INTERVAL-PROGRESS"
|
|
1552
2035
|
const val NOTIFY_SHOT_COUNT_SPECIFIED_INTERVAL_STOP_ERROR = "SHOT-COUNT-SPECIFIED-INTERVAL-STOP-ERROR"
|
|
2036
|
+
const val NOTIFY_COMPOSITE_INTERVAL_PROGRESS = "COMPOSITE-INTERVAL-PROGRESS"
|
|
2037
|
+
const val NOTIFY_COMPOSITE_INTERVAL_STOP_ERROR = "COMPOSITE-INTERVAL-STOP-ERROR"
|
|
2038
|
+
const val NOTIFY_BURST_PROGRESS = "BURST-PROGRESS"
|
|
2039
|
+
const val NOTIFY_BURST_STOP_ERROR = "BURST-STOP-ERROR"
|
|
2040
|
+
const val NOTIFY_MULTI_BRACKET_PROGRESS = "MULTI-BRACKET-PROGRESS"
|
|
2041
|
+
const val NOTIFY_MULTI_BRACKET_STOP_ERROR = "MULTI-BRACKET-STOP-ERROR"
|
|
2042
|
+
const val NOTIFY_CONTINUOUS_PROGRESS = "CONTINUOUS-PROGRESS"
|
|
1553
2043
|
}
|
|
1554
2044
|
}
|