theta-client-react-native 1.6.0 → 1.7.1
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 +1 -1
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/Converter.kt +115 -12
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +361 -1
- package/ios/ConvertUtil.swift +144 -19
- package/ios/ThetaClientReactNative.m +42 -0
- package/ios/ThetaClientReactNative.swift +419 -0
- package/lib/commonjs/capture/burst-capture.js +119 -0
- package/lib/commonjs/capture/burst-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 +33 -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/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 +33 -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-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 +30 -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 +38 -23
- package/lib/commonjs/theta-repository/theta-repository.js.map +1 -1
- package/lib/commonjs/theta-repository/{theta-state.js → theta-state/camera-error.js} +6 -53
- package/lib/commonjs/theta-repository/theta-state/camera-error.js.map +1 -0
- package/lib/commonjs/theta-repository/theta-state/index.js +28 -0
- package/lib/commonjs/theta-repository/theta-state/index.js.map +1 -0
- package/lib/commonjs/theta-repository/theta-state/theta-state.js +54 -0
- package/lib/commonjs/theta-repository/theta-state/theta-state.js.map +1 -0
- package/lib/module/capture/burst-capture.js +111 -0
- package/lib/module/capture/burst-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 +3 -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/theta-repository/options/index.js +3 -0
- package/lib/module/theta-repository/options/index.js.map +1 -1
- 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 +2 -32
- package/lib/module/theta-repository/options/options.js.map +1 -1
- package/lib/module/theta-repository/theta-repository.js +36 -24
- package/lib/module/theta-repository/theta-repository.js.map +1 -1
- package/lib/module/theta-repository/{theta-state.js → theta-state/camera-error.js} +4 -50
- package/lib/module/theta-repository/theta-state/camera-error.js.map +1 -0
- package/lib/module/theta-repository/theta-state/index.js +3 -0
- package/lib/module/theta-repository/theta-state/index.js.map +1 -0
- package/lib/module/theta-repository/theta-state/theta-state.js +48 -0
- package/lib/module/theta-repository/theta-state/theta-state.js.map +1 -0
- 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/continuous-capture.d.ts +49 -0
- package/lib/typescript/capture/continuous-capture.d.ts.map +1 -0
- package/lib/typescript/capture/index.d.ts +3 -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/theta-repository/options/index.d.ts +3 -0
- package/lib/typescript/theta-repository/options/index.d.ts.map +1 -1
- 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 +7 -30
- package/lib/typescript/theta-repository/options/options.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-repository.d.ts +24 -2
- package/lib/typescript/theta-repository/theta-repository.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-state/camera-error.d.ts +55 -0
- package/lib/typescript/theta-repository/theta-state/camera-error.d.ts.map +1 -0
- package/lib/typescript/theta-repository/theta-state/index.d.ts +3 -0
- package/lib/typescript/theta-repository/theta-state/index.d.ts.map +1 -0
- package/lib/typescript/theta-repository/{theta-state.d.ts → theta-state/theta-state.d.ts} +2 -53
- package/lib/typescript/theta-repository/theta-state/theta-state.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/capture/burst-capture.ts +169 -0
- package/src/capture/continuous-capture.ts +126 -0
- package/src/capture/index.ts +3 -0
- package/src/capture/multi-bracket-capture.ts +145 -0
- package/src/theta-repository/options/index.ts +3 -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 +7 -38
- package/src/theta-repository/theta-repository.ts +54 -0
- package/src/theta-repository/theta-state/camera-error.ts +56 -0
- package/src/theta-repository/theta-state/index.ts +2 -0
- package/src/theta-repository/{theta-state.ts → theta-state/theta-state.ts} +2 -56
- package/theta-client-react-native.podspec +1 -1
- package/lib/commonjs/theta-repository/theta-state.js.map +0 -1
- package/lib/module/theta-repository/theta-state.js.map +0 -1
- package/lib/typescript/theta-repository/theta-state.d.ts.map +0 -1
|
@@ -21,6 +21,14 @@ let MESSAGE_NO_SHOT_COUNT_SPECIFIED_INTERVAL_CAPTURING = "no shotCountSpecifiedI
|
|
|
21
21
|
let MESSAGE_NO_COMPOSITE_INTERVAL_CAPTURE = "No compositeIntervalCapture."
|
|
22
22
|
let MESSAGE_NO_COMPOSITE_INTERVAL_CAPTURE_BUILDER = "no compositeIntervalCaptureBuilder."
|
|
23
23
|
let MESSAGE_NO_COMPOSITE_INTERVAL_CAPTURING = "no compositeIntervalCapturing."
|
|
24
|
+
let MESSAGE_NO_BURST_CAPTURE = "No burstCapture."
|
|
25
|
+
let MESSAGE_NO_BURST_CAPTURE_BUILDER = "no burstCaptureBuilder."
|
|
26
|
+
let MESSAGE_NO_BURST_CAPTURING = "no burstCapturing."
|
|
27
|
+
let MESSAGE_NO_MULTI_BRACKET_CAPTURE = "No multiBracketCapture."
|
|
28
|
+
let MESSAGE_NO_MULTI_BRACKET_CAPTURE_BUILDER = "no multiBracketCaptureBuilder."
|
|
29
|
+
let MESSAGE_NO_MULTI_BRACKET_CAPTURING = "no multiBracketCapturing."
|
|
30
|
+
let MESSAGE_NO_CONTINUOUS_CAPTURE = "No continuousCapture."
|
|
31
|
+
let MESSAGE_NO_CONTINUOUS_CAPTURE_BUILDER = "no continuousCaptureBuilder."
|
|
24
32
|
|
|
25
33
|
@objc(ThetaClientReactNative)
|
|
26
34
|
class ThetaClientReactNative: RCTEventEmitter {
|
|
@@ -43,6 +51,14 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
43
51
|
var compositeIntervalCaptureBuilder: CompositeIntervalCapture.Builder?
|
|
44
52
|
var compositeIntervalCapture: CompositeIntervalCapture?
|
|
45
53
|
var compositeIntervalCapturing: CompositeIntervalCapturing?
|
|
54
|
+
var burstCaptureBuilder: BurstCapture.Builder?
|
|
55
|
+
var burstCapture: BurstCapture?
|
|
56
|
+
var burstCapturing: BurstCapturing?
|
|
57
|
+
var multiBracketCaptureBuilder: MultiBracketCapture.Builder?
|
|
58
|
+
var multiBracketCapture: MultiBracketCapture?
|
|
59
|
+
var multiBracketCapturing: MultiBracketCapturing?
|
|
60
|
+
var continuousCaptureBuilder: ContinuousCapture.Builder?
|
|
61
|
+
var continuousCapture: ContinuousCapture?
|
|
46
62
|
|
|
47
63
|
static let EVENT_FRAME = "ThetaFrameEvent"
|
|
48
64
|
static let EVENT_NOTIFY = "ThetaNotify"
|
|
@@ -55,6 +71,11 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
55
71
|
static let NOTIFY_LIMITLESS_INTERVAL_CAPTURE_STOP_ERROR = "LIMITLESS-INTERVAL-CAPTURE-STOP-ERROR"
|
|
56
72
|
static let NOTIFY_COMPOSITE_INTERVAL_PROGRESS = "COMPOSITE-INTERVAL-PROGRESS"
|
|
57
73
|
static let NOTIFY_COMPOSITE_INTERVAL_STOP_ERROR = "COMPOSITE-INTERVAL-STOP-ERROR"
|
|
74
|
+
static let NOTIFY_BURST_PROGRESS = "BURST-PROGRESS"
|
|
75
|
+
static let NOTIFY_BURST_STOP_ERROR = "BURST-STOP-ERROR"
|
|
76
|
+
static let NOTIFY_MULTI_BRACKET_PROGRESS = "MULTI-BRACKET-PROGRESS"
|
|
77
|
+
static let NOTIFY_MULTI_BRACKET_STOP_ERROR = "MULTI-BRACKET-STOP-ERROR"
|
|
78
|
+
static let NOTIFY_CONTINUOUS_PROGRESS = "CONTINUOUS-PROGRESS"
|
|
58
79
|
|
|
59
80
|
@objc
|
|
60
81
|
override func supportedEvents() -> [String]! {
|
|
@@ -99,6 +120,14 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
99
120
|
compositeIntervalCaptureBuilder = nil
|
|
100
121
|
compositeIntervalCapture = nil
|
|
101
122
|
compositeIntervalCapturing = nil
|
|
123
|
+
burstCaptureBuilder = nil
|
|
124
|
+
burstCapture = nil
|
|
125
|
+
burstCapturing = nil
|
|
126
|
+
multiBracketCaptureBuilder = nil
|
|
127
|
+
multiBracketCapture = nil
|
|
128
|
+
multiBracketCapturing = nil
|
|
129
|
+
continuousCaptureBuilder = nil
|
|
130
|
+
continuousCapture = nil
|
|
102
131
|
previewing = false
|
|
103
132
|
|
|
104
133
|
Task {
|
|
@@ -1154,6 +1183,396 @@ class ThetaClientReactNative: RCTEventEmitter {
|
|
|
1154
1183
|
resolve(nil)
|
|
1155
1184
|
}
|
|
1156
1185
|
|
|
1186
|
+
// MARK: - BurstCapture
|
|
1187
|
+
|
|
1188
|
+
@objc(getBurstCaptureBuilder:burstBracketStep:burstCompensation:burstMaxExposureTime:burstEnableIsoControl:burstOrder:withResolver:withRejecter:)
|
|
1189
|
+
func getBurstCaptureBuilder(
|
|
1190
|
+
burstCaptureNum: String,
|
|
1191
|
+
burstBracketStep: String,
|
|
1192
|
+
burstCompensation: String,
|
|
1193
|
+
burstMaxExposureTime: String,
|
|
1194
|
+
burstEnableIsoControl: String,
|
|
1195
|
+
burstOrder: String,
|
|
1196
|
+
resolve: RCTPromiseResolveBlock,
|
|
1197
|
+
reject: RCTPromiseRejectBlock
|
|
1198
|
+
) {
|
|
1199
|
+
guard let thetaRepository else {
|
|
1200
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
1201
|
+
return
|
|
1202
|
+
}
|
|
1203
|
+
guard
|
|
1204
|
+
let burstCaptureNumVal = getEnumValue(values: ThetaRepository.BurstCaptureNumEnum.values(), name: burstCaptureNum),
|
|
1205
|
+
let burstBracketStepVal = getEnumValue(values: ThetaRepository.BurstBracketStepEnum.values(), name: burstBracketStep),
|
|
1206
|
+
let burstCompensationVal = getEnumValue(values: ThetaRepository.BurstCompensationEnum.values(), name: burstCompensation),
|
|
1207
|
+
let burstMaxExposureTimeVal = getEnumValue(values: ThetaRepository.BurstMaxExposureTimeEnum.values(), name: burstMaxExposureTime),
|
|
1208
|
+
let burstEnableIsoControlVal = getEnumValue(values: ThetaRepository.BurstEnableIsoControlEnum.values(), name: burstEnableIsoControl),
|
|
1209
|
+
let burstOrderVal = getEnumValue(values: ThetaRepository.BurstOrderEnum.values(), name: burstOrder)
|
|
1210
|
+
else {
|
|
1211
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_ARGUMENT, nil)
|
|
1212
|
+
return
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
burstCaptureBuilder = thetaRepository.getBurstCaptureBuilder(burstCaptureNum: burstCaptureNumVal,
|
|
1216
|
+
burstBracketStep: burstBracketStepVal,
|
|
1217
|
+
burstCompensation: burstCompensationVal,
|
|
1218
|
+
burstMaxExposureTime: burstMaxExposureTimeVal,
|
|
1219
|
+
burstEnableIsoControl: burstEnableIsoControlVal,
|
|
1220
|
+
burstOrder: burstOrderVal)
|
|
1221
|
+
resolve(nil)
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
@objc(buildBurstCapture:withResolver:withRejecter:)
|
|
1225
|
+
func buildBurstCapture(
|
|
1226
|
+
options: [AnyHashable: Any]?,
|
|
1227
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
1228
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
1229
|
+
) {
|
|
1230
|
+
guard let _ = thetaRepository else {
|
|
1231
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
1232
|
+
return
|
|
1233
|
+
}
|
|
1234
|
+
guard let burstCaptureBuilder else {
|
|
1235
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_BURST_CAPTURE_BUILDER, nil)
|
|
1236
|
+
return
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
if let options = options as? [String: Any] {
|
|
1240
|
+
setCaptureBuilderParams(params: options, builder: burstCaptureBuilder)
|
|
1241
|
+
setBurstCaptureBuilderParams(params: options, builder: burstCaptureBuilder)
|
|
1242
|
+
}
|
|
1243
|
+
burstCaptureBuilder.build { capture, error in
|
|
1244
|
+
if let error {
|
|
1245
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
1246
|
+
} else if let capture {
|
|
1247
|
+
self.burstCapture = capture
|
|
1248
|
+
self.burstCaptureBuilder = nil
|
|
1249
|
+
resolve(true)
|
|
1250
|
+
} else {
|
|
1251
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_BURST_CAPTURE, nil)
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
@objc(startBurstCapture:withRejecter:)
|
|
1257
|
+
func startBurstCapture(
|
|
1258
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
1259
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
1260
|
+
) {
|
|
1261
|
+
guard let _ = thetaRepository else {
|
|
1262
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
1263
|
+
return
|
|
1264
|
+
}
|
|
1265
|
+
guard let burstCapture else {
|
|
1266
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_BURST_CAPTURE, nil)
|
|
1267
|
+
return
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
class Callback: BurstCaptureStartCaptureCallback {
|
|
1271
|
+
let callback: (_ urls: [String]?, _ error: Error?) -> Void
|
|
1272
|
+
weak var client: ThetaClientReactNative?
|
|
1273
|
+
init(
|
|
1274
|
+
_ callback: @escaping (_ urls: [String]?, _ error: Error?) -> Void,
|
|
1275
|
+
client: ThetaClientReactNative
|
|
1276
|
+
) {
|
|
1277
|
+
self.callback = callback
|
|
1278
|
+
self.client = client
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
func onCaptureFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
1282
|
+
callback(nil, exception.asError())
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
func onProgress(completion: Float) {
|
|
1286
|
+
client?.sendEvent(
|
|
1287
|
+
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
1288
|
+
body: toNotify(
|
|
1289
|
+
name: ThetaClientReactNative.NOTIFY_BURST_PROGRESS,
|
|
1290
|
+
params: toCaptureProgressNotifyParam(value: completion)
|
|
1291
|
+
)
|
|
1292
|
+
)
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
func onCaptureCompleted(fileUrls: [String]?) {
|
|
1296
|
+
callback(fileUrls, nil)
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
func onStopFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
1300
|
+
let error = exception.asError()
|
|
1301
|
+
client?.sendEvent(
|
|
1302
|
+
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
1303
|
+
body: toNotify(
|
|
1304
|
+
name: ThetaClientReactNative.NOTIFY_BURST_STOP_ERROR,
|
|
1305
|
+
params: toMessageNotifyParam(value: error.localizedDescription)
|
|
1306
|
+
)
|
|
1307
|
+
)
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
burstCapturing = burstCapture.startCapture(
|
|
1312
|
+
callback: Callback(
|
|
1313
|
+
{ url, error in
|
|
1314
|
+
if let error {
|
|
1315
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
1316
|
+
} else {
|
|
1317
|
+
resolve(url)
|
|
1318
|
+
}
|
|
1319
|
+
}, client: self
|
|
1320
|
+
))
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
@objc(cancelBurstCapture:withRejecter:)
|
|
1324
|
+
func cancelBurstCapture(
|
|
1325
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
1326
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
1327
|
+
) {
|
|
1328
|
+
guard let _ = thetaRepository else {
|
|
1329
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
1330
|
+
return
|
|
1331
|
+
}
|
|
1332
|
+
guard let burstCapturing else {
|
|
1333
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_BURST_CAPTURING, nil)
|
|
1334
|
+
return
|
|
1335
|
+
}
|
|
1336
|
+
burstCapturing.cancelCapture()
|
|
1337
|
+
resolve(nil)
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
// MARK: - MultiBracketCapture
|
|
1341
|
+
|
|
1342
|
+
@objc(getMultiBracketCaptureBuilder:withRejecter:)
|
|
1343
|
+
func getMultiBracketCaptureBuilder(
|
|
1344
|
+
resolve: RCTPromiseResolveBlock,
|
|
1345
|
+
reject: RCTPromiseRejectBlock
|
|
1346
|
+
) {
|
|
1347
|
+
guard let thetaRepository else {
|
|
1348
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
1349
|
+
return
|
|
1350
|
+
}
|
|
1351
|
+
multiBracketCaptureBuilder = thetaRepository.getMultiBracketCaptureBuilder()
|
|
1352
|
+
resolve(nil)
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
@objc(buildMultiBracketCapture:withResolver:withRejecter:)
|
|
1356
|
+
func buildMultiBracketCapture(
|
|
1357
|
+
options: [AnyHashable: Any]?,
|
|
1358
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
1359
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
1360
|
+
) {
|
|
1361
|
+
guard let _ = thetaRepository else {
|
|
1362
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
1363
|
+
return
|
|
1364
|
+
}
|
|
1365
|
+
guard let multiBracketCaptureBuilder else {
|
|
1366
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_MULTI_BRACKET_CAPTURE_BUILDER, nil)
|
|
1367
|
+
return
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
if let options = options as? [String: Any] {
|
|
1371
|
+
setCaptureBuilderParams(params: options, builder: multiBracketCaptureBuilder)
|
|
1372
|
+
setMultiBracketCaptureBuilderParams(params: options, builder: multiBracketCaptureBuilder)
|
|
1373
|
+
}
|
|
1374
|
+
multiBracketCaptureBuilder.build { capture, error in
|
|
1375
|
+
if let error {
|
|
1376
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
1377
|
+
} else if let capture {
|
|
1378
|
+
self.multiBracketCapture = capture
|
|
1379
|
+
self.multiBracketCaptureBuilder = nil
|
|
1380
|
+
resolve(true)
|
|
1381
|
+
} else {
|
|
1382
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_MULTI_BRACKET_CAPTURE, nil)
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
@objc(startMultiBracketCapture:withRejecter:)
|
|
1388
|
+
func startMultiBracketCapture(
|
|
1389
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
1390
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
1391
|
+
) {
|
|
1392
|
+
guard let _ = thetaRepository else {
|
|
1393
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
1394
|
+
return
|
|
1395
|
+
}
|
|
1396
|
+
guard let multiBracketCapture else {
|
|
1397
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_MULTI_BRACKET_CAPTURE, nil)
|
|
1398
|
+
return
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
class Callback: MultiBracketCaptureStartCaptureCallback {
|
|
1402
|
+
let callback: (_ urls: [String]?, _ error: Error?) -> Void
|
|
1403
|
+
weak var client: ThetaClientReactNative?
|
|
1404
|
+
init(
|
|
1405
|
+
_ callback: @escaping (_ urls: [String]?, _ error: Error?) -> Void,
|
|
1406
|
+
client: ThetaClientReactNative
|
|
1407
|
+
) {
|
|
1408
|
+
self.callback = callback
|
|
1409
|
+
self.client = client
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
func onCaptureFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
1413
|
+
callback(nil, exception.asError())
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
func onProgress(completion: Float) {
|
|
1417
|
+
client?.sendEvent(
|
|
1418
|
+
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
1419
|
+
body: toNotify(
|
|
1420
|
+
name: ThetaClientReactNative.NOTIFY_MULTI_BRACKET_PROGRESS,
|
|
1421
|
+
params: toCaptureProgressNotifyParam(value: completion)
|
|
1422
|
+
)
|
|
1423
|
+
)
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
func onCaptureCompleted(fileUrls: [String]?) {
|
|
1427
|
+
callback(fileUrls, nil)
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
func onStopFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
1431
|
+
let error = exception.asError()
|
|
1432
|
+
client?.sendEvent(
|
|
1433
|
+
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
1434
|
+
body: toNotify(
|
|
1435
|
+
name: ThetaClientReactNative.NOTIFY_MULTI_BRACKET_STOP_ERROR,
|
|
1436
|
+
params: toMessageNotifyParam(value: error.localizedDescription)
|
|
1437
|
+
)
|
|
1438
|
+
)
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
multiBracketCapturing = multiBracketCapture.startCapture(
|
|
1443
|
+
callback: Callback(
|
|
1444
|
+
{ url, error in
|
|
1445
|
+
if let error {
|
|
1446
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
1447
|
+
} else {
|
|
1448
|
+
resolve(url)
|
|
1449
|
+
}
|
|
1450
|
+
}, client: self
|
|
1451
|
+
))
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
@objc(cancelMultiBracketCapture:withRejecter:)
|
|
1455
|
+
func cancelMultiBracketCapture(
|
|
1456
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
1457
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
1458
|
+
) {
|
|
1459
|
+
guard let _ = thetaRepository else {
|
|
1460
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
1461
|
+
return
|
|
1462
|
+
}
|
|
1463
|
+
guard let multiBracketCapturing else {
|
|
1464
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_MULTI_BRACKET_CAPTURING, nil)
|
|
1465
|
+
return
|
|
1466
|
+
}
|
|
1467
|
+
multiBracketCapturing.cancelCapture()
|
|
1468
|
+
resolve(nil)
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
// MARK: - ContinuousCapture
|
|
1472
|
+
|
|
1473
|
+
@objc(getContinuousCaptureBuilder:withRejecter:)
|
|
1474
|
+
func getContinuousCaptureBuilder(
|
|
1475
|
+
resolve: RCTPromiseResolveBlock,
|
|
1476
|
+
reject: RCTPromiseRejectBlock
|
|
1477
|
+
) {
|
|
1478
|
+
guard let thetaRepository else {
|
|
1479
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
1480
|
+
return
|
|
1481
|
+
}
|
|
1482
|
+
continuousCaptureBuilder = thetaRepository.getContinuousCaptureBuilder()
|
|
1483
|
+
resolve(nil)
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
@objc(buildContinuousCapture:withResolver:withRejecter:)
|
|
1487
|
+
func buildContinuousCapture(
|
|
1488
|
+
options: [AnyHashable: Any]?,
|
|
1489
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
1490
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
1491
|
+
) {
|
|
1492
|
+
guard let _ = thetaRepository else {
|
|
1493
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
1494
|
+
return
|
|
1495
|
+
}
|
|
1496
|
+
guard let continuousCaptureBuilder else {
|
|
1497
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_CONTINUOUS_CAPTURE_BUILDER, nil)
|
|
1498
|
+
return
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
if let options = options as? [String: Any] {
|
|
1502
|
+
setCaptureBuilderParams(params: options, builder: continuousCaptureBuilder)
|
|
1503
|
+
setContinuousCaptureBuilderParams(params: options, builder: continuousCaptureBuilder)
|
|
1504
|
+
}
|
|
1505
|
+
continuousCaptureBuilder.build { capture, error in
|
|
1506
|
+
if let error {
|
|
1507
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
1508
|
+
} else if let capture {
|
|
1509
|
+
self.continuousCapture = capture
|
|
1510
|
+
self.continuousCaptureBuilder = nil
|
|
1511
|
+
resolve(true)
|
|
1512
|
+
} else {
|
|
1513
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_BURST_CAPTURE, nil)
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
@objc(startContinuousCapture:withRejecter:)
|
|
1519
|
+
func startContinuousCapture(
|
|
1520
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
1521
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
1522
|
+
) {
|
|
1523
|
+
guard let _ = thetaRepository else {
|
|
1524
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil)
|
|
1525
|
+
return
|
|
1526
|
+
}
|
|
1527
|
+
guard let continuousCapture else {
|
|
1528
|
+
reject(ERROR_CODE_ERROR, MESSAGE_NO_CONTINUOUS_CAPTURE, nil)
|
|
1529
|
+
return
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
class Callback: ContinuousCaptureStartCaptureCallback {
|
|
1533
|
+
let callback: (_ urls: [String]?, _ error: Error?) -> Void
|
|
1534
|
+
weak var client: ThetaClientReactNative?
|
|
1535
|
+
init(
|
|
1536
|
+
_ callback: @escaping (_ urls: [String]?, _ error: Error?) -> Void,
|
|
1537
|
+
client: ThetaClientReactNative
|
|
1538
|
+
) {
|
|
1539
|
+
self.callback = callback
|
|
1540
|
+
self.client = client
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
func onCaptureFailed(exception: ThetaRepository.ThetaRepositoryException) {
|
|
1544
|
+
callback(nil, exception.asError())
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
func onProgress(completion: Float) {
|
|
1548
|
+
client?.sendEvent(
|
|
1549
|
+
withName: ThetaClientReactNative.EVENT_NOTIFY,
|
|
1550
|
+
body: toNotify(
|
|
1551
|
+
name: ThetaClientReactNative.NOTIFY_CONTINUOUS_PROGRESS,
|
|
1552
|
+
params: toCaptureProgressNotifyParam(value: completion)
|
|
1553
|
+
)
|
|
1554
|
+
)
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
func onCaptureCompleted(fileUrls: [String]?) {
|
|
1558
|
+
callback(fileUrls, nil)
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
continuousCapture.startCapture(
|
|
1563
|
+
callback: Callback(
|
|
1564
|
+
{ url, error in
|
|
1565
|
+
if let error {
|
|
1566
|
+
reject(ERROR_CODE_ERROR, error.localizedDescription, error)
|
|
1567
|
+
} else {
|
|
1568
|
+
resolve(url)
|
|
1569
|
+
}
|
|
1570
|
+
}, client: self
|
|
1571
|
+
))
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
// MARK: -
|
|
1575
|
+
|
|
1157
1576
|
@objc(getMetadata:withResolver:withRejecter:)
|
|
1158
1577
|
func getMetadata(
|
|
1159
1578
|
fileUrl: String,
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BurstCaptureBuilder = exports.BurstCapture = void 0;
|
|
7
|
+
var _capture = require("./capture");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _notifyController = require("../theta-repository/notify-controller");
|
|
10
|
+
const ThetaClientReactNative = _reactNative.NativeModules.ThetaClientReactNative;
|
|
11
|
+
const NOTIFY_PROGRESS = 'BURST-PROGRESS';
|
|
12
|
+
const NOTIFY_STOP_ERROR = 'BURST-STOP-ERROR';
|
|
13
|
+
/**
|
|
14
|
+
* BurstCapture class
|
|
15
|
+
*/
|
|
16
|
+
class BurstCapture {
|
|
17
|
+
constructor(notify) {
|
|
18
|
+
this.notify = notify;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* start burst shooting
|
|
22
|
+
* @param onProgress the block for burst shooting onProgress
|
|
23
|
+
* @return promise of captured file url
|
|
24
|
+
*/
|
|
25
|
+
async startCapture(onProgress, onStopFailed) {
|
|
26
|
+
if (onProgress) {
|
|
27
|
+
this.notify.addNotify(NOTIFY_PROGRESS, event => {
|
|
28
|
+
var _event$params;
|
|
29
|
+
onProgress((_event$params = event.params) === null || _event$params === void 0 ? void 0 : _event$params.completion);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
if (onStopFailed) {
|
|
33
|
+
this.notify.addNotify(NOTIFY_STOP_ERROR, event => {
|
|
34
|
+
onStopFailed(event.params);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return new Promise(async (resolve, reject) => {
|
|
38
|
+
await ThetaClientReactNative.startBurstCapture().then(result => {
|
|
39
|
+
resolve(result ?? undefined);
|
|
40
|
+
}).catch(error => {
|
|
41
|
+
reject(error);
|
|
42
|
+
}).finally(() => {
|
|
43
|
+
this.notify.removeNotify(NOTIFY_PROGRESS);
|
|
44
|
+
this.notify.removeNotify(NOTIFY_STOP_ERROR);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* cancel burst shooting
|
|
51
|
+
*/
|
|
52
|
+
async cancelCapture() {
|
|
53
|
+
return await ThetaClientReactNative.cancelBurstCapture();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* BurstCaptureBuilder class
|
|
59
|
+
*/
|
|
60
|
+
exports.BurstCapture = BurstCapture;
|
|
61
|
+
class BurstCaptureBuilder extends _capture.CaptureBuilder {
|
|
62
|
+
/** construct BurstCaptureBuilder instance */
|
|
63
|
+
constructor(burstCaptureNum, burstBracketStep, burstCompensation, burstMaxExposureTime, burstEnableIsoControl, burstOrder) {
|
|
64
|
+
super();
|
|
65
|
+
this.interval = undefined;
|
|
66
|
+
this.burstCaptureNum = burstCaptureNum;
|
|
67
|
+
this.burstBracketStep = burstBracketStep;
|
|
68
|
+
this.burstCompensation = burstCompensation;
|
|
69
|
+
this.burstMaxExposureTime = burstMaxExposureTime;
|
|
70
|
+
this.burstEnableIsoControl = burstEnableIsoControl;
|
|
71
|
+
this.burstOrder = burstOrder;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* set interval of checking burst shooting status command
|
|
76
|
+
* @param timeMillis interval
|
|
77
|
+
* @returns BurstCaptureBuilder
|
|
78
|
+
*/
|
|
79
|
+
setCheckStatusCommandInterval(timeMillis) {
|
|
80
|
+
this.interval = timeMillis;
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* BurstMode setting.
|
|
86
|
+
* When this is set to ON, burst shooting is enabled,
|
|
87
|
+
* and a screen dedicated to burst shooting is displayed in Live View.
|
|
88
|
+
* @param mode BurstMode
|
|
89
|
+
* @return BurstCaptureBuilder
|
|
90
|
+
*/
|
|
91
|
+
setBurstMode(mode) {
|
|
92
|
+
this.options.burstMode = mode;
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Builds an instance of a BurstCapture that has all the combined
|
|
98
|
+
* parameters of the Options that have been added to the Builder.
|
|
99
|
+
* @return promise of BurstCapture instance
|
|
100
|
+
*/
|
|
101
|
+
build() {
|
|
102
|
+
let params = {
|
|
103
|
+
...this.options,
|
|
104
|
+
// Cannot pass negative values in IOS, use objects
|
|
105
|
+
_capture_interval: this.interval ?? -1
|
|
106
|
+
};
|
|
107
|
+
return new Promise(async (resolve, reject) => {
|
|
108
|
+
try {
|
|
109
|
+
await ThetaClientReactNative.getBurstCaptureBuilder(this.burstCaptureNum, this.burstBracketStep, this.burstCompensation, this.burstMaxExposureTime, this.burstEnableIsoControl, this.burstOrder);
|
|
110
|
+
await ThetaClientReactNative.buildBurstCapture(params);
|
|
111
|
+
resolve(new BurstCapture(_notifyController.NotifyController.instance));
|
|
112
|
+
} catch (error) {
|
|
113
|
+
reject(error);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.BurstCaptureBuilder = BurstCaptureBuilder;
|
|
119
|
+
//# sourceMappingURL=burst-capture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_capture","require","_reactNative","_notifyController","ThetaClientReactNative","NativeModules","NOTIFY_PROGRESS","NOTIFY_STOP_ERROR","BurstCapture","constructor","notify","startCapture","onProgress","onStopFailed","addNotify","event","_event$params","params","completion","Promise","resolve","reject","startBurstCapture","then","result","undefined","catch","error","finally","removeNotify","cancelCapture","cancelBurstCapture","exports","BurstCaptureBuilder","CaptureBuilder","burstCaptureNum","burstBracketStep","burstCompensation","burstMaxExposureTime","burstEnableIsoControl","burstOrder","interval","setCheckStatusCommandInterval","timeMillis","setBurstMode","mode","options","burstMode","build","_capture_interval","getBurstCaptureBuilder","buildBurstCapture","NotifyController","instance"],"sourceRoot":"../../../src","sources":["capture/burst-capture.ts"],"mappings":"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"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ContinuousCaptureBuilder = exports.ContinuousCapture = void 0;
|
|
7
|
+
var _capture = require("./capture");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _notifyController = require("../theta-repository/notify-controller");
|
|
10
|
+
var _options = require("../theta-repository/options");
|
|
11
|
+
var _thetaRepository = require("../theta-repository");
|
|
12
|
+
const ThetaClientReactNative = _reactNative.NativeModules.ThetaClientReactNative;
|
|
13
|
+
const NOTIFY_PROGRESS = 'CONTINUOUS-PROGRESS';
|
|
14
|
+
/**
|
|
15
|
+
* ContinuousCapture class
|
|
16
|
+
*/
|
|
17
|
+
class ContinuousCapture {
|
|
18
|
+
constructor(notify) {
|
|
19
|
+
this.notify = notify;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* start continuous shooting
|
|
23
|
+
* @param onProgress the block for continuous shooting onProgress
|
|
24
|
+
* @return promise of captured file url
|
|
25
|
+
*/
|
|
26
|
+
async startCapture(onProgress) {
|
|
27
|
+
if (onProgress) {
|
|
28
|
+
this.notify.addNotify(NOTIFY_PROGRESS, event => {
|
|
29
|
+
var _event$params;
|
|
30
|
+
onProgress((_event$params = event.params) === null || _event$params === void 0 ? void 0 : _event$params.completion);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return new Promise(async (resolve, reject) => {
|
|
34
|
+
await ThetaClientReactNative.startContinuousCapture().then(result => {
|
|
35
|
+
resolve(result ?? undefined);
|
|
36
|
+
}).catch(error => {
|
|
37
|
+
reject(error);
|
|
38
|
+
}).finally(() => {
|
|
39
|
+
this.notify.removeNotify(NOTIFY_PROGRESS);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get Number of shots for continuous shooting.
|
|
46
|
+
* @returns ContinuousNumberEnum
|
|
47
|
+
*/
|
|
48
|
+
async getContinuousNumber() {
|
|
49
|
+
return (await (0, _thetaRepository.getOptions)([_options.OptionNameEnum.ContinuousNumber])).continuousNumber ?? _options.ContinuousNumberEnum.UNSUPPORTED;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* ContinuousCaptureBuilder class
|
|
55
|
+
*/
|
|
56
|
+
exports.ContinuousCapture = ContinuousCapture;
|
|
57
|
+
class ContinuousCaptureBuilder extends _capture.CaptureBuilder {
|
|
58
|
+
/** construct ContinuousCaptureBuilder instance */
|
|
59
|
+
constructor() {
|
|
60
|
+
super();
|
|
61
|
+
this.interval = undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* set interval of checking continuous shooting status command
|
|
66
|
+
* @param timeMillis interval
|
|
67
|
+
* @returns ContinuousCaptureBuilder
|
|
68
|
+
*/
|
|
69
|
+
setCheckStatusCommandInterval(timeMillis) {
|
|
70
|
+
this.interval = timeMillis;
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Set photo file format.
|
|
76
|
+
* Continuous shooting only supports 5.5K and 11K
|
|
77
|
+
* @param {PhotoFileFormatEnum} fileFormat Photo file format to set
|
|
78
|
+
* @return PhotoCaptureBuilder
|
|
79
|
+
*/
|
|
80
|
+
setFileFormat(fileFormat) {
|
|
81
|
+
this.options.fileFormat = fileFormat;
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Builds an instance of a ContinuousCapture that has all the combined
|
|
87
|
+
* parameters of the Options that have been added to the Builder.
|
|
88
|
+
* @return promise of ContinuousCapture instance
|
|
89
|
+
*/
|
|
90
|
+
build() {
|
|
91
|
+
let params = {
|
|
92
|
+
...this.options,
|
|
93
|
+
// Cannot pass negative values in IOS, use objects
|
|
94
|
+
_capture_interval: this.interval ?? -1
|
|
95
|
+
};
|
|
96
|
+
return new Promise(async (resolve, reject) => {
|
|
97
|
+
try {
|
|
98
|
+
await ThetaClientReactNative.getContinuousCaptureBuilder();
|
|
99
|
+
await ThetaClientReactNative.buildContinuousCapture(params);
|
|
100
|
+
resolve(new ContinuousCapture(_notifyController.NotifyController.instance));
|
|
101
|
+
} catch (error) {
|
|
102
|
+
reject(error);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.ContinuousCaptureBuilder = ContinuousCaptureBuilder;
|
|
108
|
+
//# sourceMappingURL=continuous-capture.js.map
|