theta-client-react-native 1.6.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 +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 +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/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/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/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/theta-client-react-native.podspec +1 -1
package/android/build.gradle
CHANGED
|
@@ -135,7 +135,7 @@ dependencies {
|
|
|
135
135
|
implementation "com.facebook.react:react-native:+"
|
|
136
136
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
137
137
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"
|
|
138
|
-
implementation "com.ricoh360.thetaclient:theta-client:1.
|
|
138
|
+
implementation "com.ricoh360.thetaclient:theta-client:1.7.0"
|
|
139
139
|
|
|
140
140
|
// From node_modules
|
|
141
141
|
}
|
|
@@ -21,6 +21,7 @@ val optionItemNameToEnum: Map<String, OptionNameEnum> = mutableMapOf(
|
|
|
21
21
|
"autoBracket" to OptionNameEnum.AutoBracket,
|
|
22
22
|
"bitrate" to OptionNameEnum.Bitrate,
|
|
23
23
|
"bluetoothPower" to OptionNameEnum.BluetoothPower,
|
|
24
|
+
"bluetoothRole" to OptionNameEnum.BluetoothRole,
|
|
24
25
|
"burstMode" to OptionNameEnum.BurstMode,
|
|
25
26
|
"burstOption" to OptionNameEnum.BurstOption,
|
|
26
27
|
"cameraControlSource" to OptionNameEnum.CameraControlSource,
|
|
@@ -213,6 +214,47 @@ fun setCompositeIntervalCaptureBuilderParams(optionMap: ReadableMap, builder: Co
|
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
216
|
|
|
217
|
+
fun setBurstCaptureBuilderParams(optionMap: ReadableMap, builder: BurstCapture.Builder) {
|
|
218
|
+
val interval = if (optionMap.hasKey("_capture_interval")) optionMap.getInt("_capture_interval") else null
|
|
219
|
+
interval?.let {
|
|
220
|
+
if (it >= 0) {
|
|
221
|
+
builder.setCheckStatusCommandInterval(it.toLong())
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
optionMap.getString("burstMode")?.let {
|
|
225
|
+
builder.setBurstMode(BurstModeEnum.valueOf(it))
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
fun setMultiBracketCaptureBuilderParams(optionMap: ReadableMap, builder: MultiBracketCapture.Builder) {
|
|
230
|
+
val settingArray = optionMap.getArray("autoBracket") ?: return
|
|
231
|
+
for (i in 0 until settingArray.size()) {
|
|
232
|
+
settingArray.getMap(i)?.let { setting ->
|
|
233
|
+
builder.addBracketParameters(
|
|
234
|
+
aperture = setting.getString("aperture")?.let { ApertureEnum.valueOf(it) },
|
|
235
|
+
colorTemperature = if (setting.hasKey("colorTemperature")) setting.getInt("colorTemperature") else null,
|
|
236
|
+
exposureCompensation = setting.getString("exposureCompensation")?.let { ExposureCompensationEnum.valueOf(it) },
|
|
237
|
+
exposureProgram = setting.getString("exposureProgram")?.let { ExposureProgramEnum.valueOf(it) },
|
|
238
|
+
iso = setting.getString("iso")?.let { IsoEnum.valueOf(it) },
|
|
239
|
+
shutterSpeed = setting.getString("shutterSpeed")?.let { ShutterSpeedEnum.valueOf(it) },
|
|
240
|
+
whiteBalance = setting.getString("whiteBalance")?.let { WhiteBalanceEnum.valueOf(it) },
|
|
241
|
+
)
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
fun setContinuousCaptureBuilderParams(optionMap: ReadableMap, builder: ContinuousCapture.Builder) {
|
|
247
|
+
val interval = if (optionMap.hasKey("_capture_interval")) optionMap.getInt("_capture_interval") else null
|
|
248
|
+
interval?.let {
|
|
249
|
+
if (it >= 0) {
|
|
250
|
+
builder.setCheckStatusCommandInterval(it.toLong())
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
optionMap.getString("fileFormat")?.let {
|
|
254
|
+
builder.setFileFormat(PhotoFileFormatEnum.valueOf(it))
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
216
258
|
fun toGetOptionsParam(optionNames: ReadableArray): MutableList<OptionNameEnum> {
|
|
217
259
|
val optionNameList = mutableListOf<OptionNameEnum>()
|
|
218
260
|
for (index in 0..(optionNames.size() - 1)) {
|
|
@@ -262,10 +304,26 @@ fun toResult(options: Options): WritableMap {
|
|
|
262
304
|
options.gpsInfo?.let {
|
|
263
305
|
result.putMap("gpsInfo", toResult(gpsInfo = it))
|
|
264
306
|
}
|
|
307
|
+
} else if (name == OptionNameEnum.OffDelay) {
|
|
308
|
+
options.offDelay?.let {
|
|
309
|
+
if (it is OffDelayEnum) {
|
|
310
|
+
result.putString("offDelay", it.name)
|
|
311
|
+
} else if (it is OffDelaySec) {
|
|
312
|
+
result.putInt("offDelay", it.sec)
|
|
313
|
+
}
|
|
314
|
+
}
|
|
265
315
|
} else if (name == OptionNameEnum.Proxy) {
|
|
266
316
|
options.proxy?.let {
|
|
267
317
|
result.putMap("proxy", toResult(proxy = it))
|
|
268
318
|
}
|
|
319
|
+
} else if (name == OptionNameEnum.SleepDelay) {
|
|
320
|
+
options.sleepDelay?.let {
|
|
321
|
+
if (it is SleepDelayEnum) {
|
|
322
|
+
result.putString("sleepDelay", it.name)
|
|
323
|
+
} else if (it is SleepDelaySec) {
|
|
324
|
+
result.putInt("sleepDelay", it.sec)
|
|
325
|
+
}
|
|
326
|
+
}
|
|
269
327
|
} else if (name == OptionNameEnum.TimeShift) {
|
|
270
328
|
options.timeShift?.let {
|
|
271
329
|
result.putMap("timeShift", toResult(timeShift = it))
|
|
@@ -337,22 +395,22 @@ fun toResult(autoBracket: BracketSettingList): WritableArray {
|
|
|
337
395
|
|
|
338
396
|
fun toResult(burstOption: BurstOption): WritableMap {
|
|
339
397
|
val result = Arguments.createMap()
|
|
340
|
-
burstOption.burstCaptureNum?.
|
|
398
|
+
burstOption.burstCaptureNum?.name?.let { name ->
|
|
341
399
|
result.putString("burstCaptureNum", name)
|
|
342
400
|
}
|
|
343
|
-
burstOption.burstBracketStep?.
|
|
401
|
+
burstOption.burstBracketStep?.name?.let { name ->
|
|
344
402
|
result.putString("burstBracketStep", name)
|
|
345
403
|
}
|
|
346
|
-
burstOption.burstCompensation?.
|
|
404
|
+
burstOption.burstCompensation?.name?.let { name ->
|
|
347
405
|
result.putString("burstCompensation", name)
|
|
348
406
|
}
|
|
349
|
-
burstOption.burstMaxExposureTime?.
|
|
407
|
+
burstOption.burstMaxExposureTime?.name?.let { name ->
|
|
350
408
|
result.putString("burstMaxExposureTime", name)
|
|
351
409
|
}
|
|
352
|
-
burstOption.burstEnableIsoControl?.
|
|
410
|
+
burstOption.burstEnableIsoControl?.name?.let { name ->
|
|
353
411
|
result.putString("burstEnableIsoControl", name)
|
|
354
412
|
}
|
|
355
|
-
burstOption.burstOrder?.
|
|
413
|
+
burstOption.burstOrder?.name?.let { name ->
|
|
356
414
|
result.putString("burstOrder", name)
|
|
357
415
|
}
|
|
358
416
|
return result
|
|
@@ -531,10 +589,18 @@ fun setOptionValue(options: Options, name: OptionNameEnum, optionsMap: ReadableM
|
|
|
531
589
|
optionsMap.getMap(key)?.let {
|
|
532
590
|
options.setValue(name, toGpsInfo(map = it))
|
|
533
591
|
}
|
|
592
|
+
} else if (name == OptionNameEnum.OffDelay) {
|
|
593
|
+
toOffDelay(optionsMap)?.let {
|
|
594
|
+
options.setValue(name, it)
|
|
595
|
+
}
|
|
534
596
|
} else if (name == OptionNameEnum.Proxy) {
|
|
535
597
|
optionsMap.getMap(key)?.let {
|
|
536
598
|
options.setValue(name, toProxy(map = it) as Any)
|
|
537
599
|
}
|
|
600
|
+
} else if (name == OptionNameEnum.SleepDelay) {
|
|
601
|
+
toSleepDelay(optionsMap)?.let {
|
|
602
|
+
options.setValue(name, it)
|
|
603
|
+
}
|
|
538
604
|
} else if (name == OptionNameEnum.TimeShift) {
|
|
539
605
|
optionsMap.getMap(key)?.let {
|
|
540
606
|
options.setValue(name, toTimeShift(map = it))
|
|
@@ -553,6 +619,7 @@ fun getOptionValueEnum(name: OptionNameEnum, valueName: String): Any? {
|
|
|
553
619
|
OptionNameEnum.AiAutoThumbnail -> AiAutoThumbnailEnum.values().find { it.name == valueName }
|
|
554
620
|
OptionNameEnum.Aperture -> ApertureEnum.values().find { it.name == valueName }
|
|
555
621
|
OptionNameEnum.BluetoothPower -> BluetoothPowerEnum.values().find { it.name == valueName }
|
|
622
|
+
OptionNameEnum.BluetoothRole -> BluetoothRoleEnum.values().find { it.name == valueName }
|
|
556
623
|
OptionNameEnum.BurstMode -> BurstModeEnum.values().find { it.name == valueName }
|
|
557
624
|
OptionNameEnum.CameraControlSource -> CameraControlSourceEnum.values().find { it.name == valueName }
|
|
558
625
|
OptionNameEnum.CameraMode -> CameraModeEnum.values().find { it.name == valueName }
|
|
@@ -675,13 +742,9 @@ fun configToTheta(objects: ReadableMap): Config {
|
|
|
675
742
|
config.language = LanguageEnum.valueOf(it)
|
|
676
743
|
}
|
|
677
744
|
|
|
678
|
-
|
|
679
|
-
config.offDelay = OffDelayEnum.valueOf(it)
|
|
680
|
-
}
|
|
745
|
+
config.offDelay = toOffDelay(objects)
|
|
681
746
|
|
|
682
|
-
|
|
683
|
-
config.sleepDelay = SleepDelayEnum.valueOf(it)
|
|
684
|
-
}
|
|
747
|
+
config.sleepDelay = toSleepDelay(objects)
|
|
685
748
|
|
|
686
749
|
config.shutterVolume = if (objects.hasKey("shutterVolume")) {
|
|
687
750
|
objects.getInt("shutterVolume")
|
|
@@ -719,3 +782,43 @@ fun timeoutToTheta(objects: ReadableMap): Timeout {
|
|
|
719
782
|
objects.getInt("socketTimeout").toLong(),
|
|
720
783
|
)
|
|
721
784
|
}
|
|
785
|
+
|
|
786
|
+
fun toOffDelay(objects: ReadableMap): OffDelay? {
|
|
787
|
+
if (!objects.hasKey("offDelay")) {
|
|
788
|
+
return null
|
|
789
|
+
}
|
|
790
|
+
when (objects.getType("offDelay")) {
|
|
791
|
+
ReadableType.String -> {
|
|
792
|
+
(objects.getString("offDelay"))?.let { value ->
|
|
793
|
+
return getOptionValueEnum(OptionNameEnum.OffDelay, value) as? OffDelayEnum
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
ReadableType.Number -> {
|
|
798
|
+
return OffDelaySec(objects.getInt("offDelay"))
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
else -> {}
|
|
802
|
+
}
|
|
803
|
+
return null
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
fun toSleepDelay(objects: ReadableMap): SleepDelay? {
|
|
807
|
+
if (!objects.hasKey("sleepDelay")) {
|
|
808
|
+
return null
|
|
809
|
+
}
|
|
810
|
+
when (objects.getType("sleepDelay")) {
|
|
811
|
+
ReadableType.String -> {
|
|
812
|
+
(objects.getString("sleepDelay"))?.let { value ->
|
|
813
|
+
return getOptionValueEnum(OptionNameEnum.SleepDelay, value) as? SleepDelayEnum
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
ReadableType.Number -> {
|
|
818
|
+
return SleepDelaySec(objects.getInt("sleepDelay"))
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
else -> {}
|
|
822
|
+
}
|
|
823
|
+
return null
|
|
824
|
+
}
|
|
@@ -3,6 +3,7 @@ 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
8
|
import kotlinx.coroutines.*
|
|
8
9
|
import java.util.*
|
|
@@ -37,6 +38,14 @@ class ThetaClientReactNativeModule(
|
|
|
37
38
|
var compositeIntervalCaptureBuilder: CompositeIntervalCapture.Builder? = null
|
|
38
39
|
var compositeIntervalCapture: CompositeIntervalCapture? = null
|
|
39
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
|
|
40
49
|
var theta: ThetaRepository? = null
|
|
41
50
|
var listenerCount: Int = 0
|
|
42
51
|
|
|
@@ -102,6 +111,14 @@ class ThetaClientReactNativeModule(
|
|
|
102
111
|
compositeIntervalCaptureBuilder = null
|
|
103
112
|
compositeIntervalCapture = null
|
|
104
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
|
|
105
122
|
|
|
106
123
|
theta = ThetaRepository.newInstance(
|
|
107
124
|
endpoint,
|
|
@@ -970,7 +987,7 @@ class ThetaClientReactNativeModule(
|
|
|
970
987
|
|
|
971
988
|
/**
|
|
972
989
|
* buildCompositeIntervalCapture - build interval composite shooting
|
|
973
|
-
* @param options option to execute interval shooting
|
|
990
|
+
* @param options option to execute interval composite shooting
|
|
974
991
|
* @param promise Promise for buildCompositeIntervalCapture
|
|
975
992
|
*/
|
|
976
993
|
@ReactMethod
|
|
@@ -1065,6 +1082,344 @@ class ThetaClientReactNativeModule(
|
|
|
1065
1082
|
promise.resolve(true)
|
|
1066
1083
|
}
|
|
1067
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
|
+
|
|
1068
1423
|
/**
|
|
1069
1424
|
* getMetadata - retrieve meta data from THETA via repository
|
|
1070
1425
|
* @param promise promise to set result
|
|
@@ -1680,5 +2035,10 @@ class ThetaClientReactNativeModule(
|
|
|
1680
2035
|
const val NOTIFY_SHOT_COUNT_SPECIFIED_INTERVAL_STOP_ERROR = "SHOT-COUNT-SPECIFIED-INTERVAL-STOP-ERROR"
|
|
1681
2036
|
const val NOTIFY_COMPOSITE_INTERVAL_PROGRESS = "COMPOSITE-INTERVAL-PROGRESS"
|
|
1682
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"
|
|
1683
2043
|
}
|
|
1684
2044
|
}
|