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.
Files changed (166) hide show
  1. package/android/build.gradle +2 -2
  2. package/android/src/main/java/com/ricoh360/thetaclientreactnative/Converter.kt +196 -19
  3. package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +493 -3
  4. package/ios/ConvertUtil.swift +272 -18
  5. package/ios/ThetaClientReactNative.m +56 -0
  6. package/ios/ThetaClientReactNative.swift +574 -2
  7. package/lib/commonjs/capture/burst-capture.js +119 -0
  8. package/lib/commonjs/capture/burst-capture.js.map +1 -0
  9. package/lib/commonjs/capture/composite-interval-capture.js +112 -0
  10. package/lib/commonjs/capture/composite-interval-capture.js.map +1 -0
  11. package/lib/commonjs/capture/continuous-capture.js +108 -0
  12. package/lib/commonjs/capture/continuous-capture.js.map +1 -0
  13. package/lib/commonjs/capture/index.js +44 -0
  14. package/lib/commonjs/capture/index.js.map +1 -1
  15. package/lib/commonjs/capture/multi-bracket-capture.js +121 -0
  16. package/lib/commonjs/capture/multi-bracket-capture.js.map +1 -0
  17. package/lib/commonjs/capture/shot-count-specified-interval-capture.js +1 -0
  18. package/lib/commonjs/capture/shot-count-specified-interval-capture.js.map +1 -1
  19. package/lib/commonjs/capture/time-shift-capture.js +9 -1
  20. package/lib/commonjs/capture/time-shift-capture.js.map +1 -1
  21. package/lib/commonjs/index.js +1 -2
  22. package/lib/commonjs/index.js.map +1 -1
  23. package/lib/commonjs/theta-repository/access-point.js +1 -2
  24. package/lib/commonjs/theta-repository/access-point.js.map +1 -1
  25. package/lib/commonjs/theta-repository/options/index.js +44 -0
  26. package/lib/commonjs/theta-repository/options/index.js.map +1 -1
  27. package/lib/commonjs/theta-repository/options/option-ai-auto-thumbnail.js +1 -2
  28. package/lib/commonjs/theta-repository/options/option-ai-auto-thumbnail.js.map +1 -1
  29. package/lib/commonjs/theta-repository/options/option-auto-bracket.js +6 -0
  30. package/lib/commonjs/theta-repository/options/option-auto-bracket.js.map +1 -0
  31. package/lib/commonjs/theta-repository/options/option-bitrate.js +1 -2
  32. package/lib/commonjs/theta-repository/options/option-bitrate.js.map +1 -1
  33. package/lib/commonjs/theta-repository/options/option-bluetooth-role.js +20 -0
  34. package/lib/commonjs/theta-repository/options/option-bluetooth-role.js.map +1 -0
  35. package/lib/commonjs/theta-repository/options/option-burst-mode.js +1 -2
  36. package/lib/commonjs/theta-repository/options/option-burst-mode.js.map +1 -1
  37. package/lib/commonjs/theta-repository/options/option-burst-option.js +11 -12
  38. package/lib/commonjs/theta-repository/options/option-burst-option.js.map +1 -1
  39. package/lib/commonjs/theta-repository/options/option-camera-control-source.js +1 -2
  40. package/lib/commonjs/theta-repository/options/option-camera-control-source.js.map +1 -1
  41. package/lib/commonjs/theta-repository/options/option-camera-mode.js +1 -2
  42. package/lib/commonjs/theta-repository/options/option-camera-mode.js.map +1 -1
  43. package/lib/commonjs/theta-repository/options/option-capture-mode.js +1 -2
  44. package/lib/commonjs/theta-repository/options/option-capture-mode.js.map +1 -1
  45. package/lib/commonjs/theta-repository/options/option-continuous-number.js +1 -2
  46. package/lib/commonjs/theta-repository/options/option-continuous-number.js.map +1 -1
  47. package/lib/commonjs/theta-repository/options/option-face-detect.js +1 -2
  48. package/lib/commonjs/theta-repository/options/option-face-detect.js.map +1 -1
  49. package/lib/commonjs/theta-repository/options/option-filter.js +1 -2
  50. package/lib/commonjs/theta-repository/options/option-filter.js.map +1 -1
  51. package/lib/commonjs/theta-repository/options/option-function.js +1 -2
  52. package/lib/commonjs/theta-repository/options/option-function.js.map +1 -1
  53. package/lib/commonjs/theta-repository/options/option-gain.js +1 -2
  54. package/lib/commonjs/theta-repository/options/option-gain.js.map +1 -1
  55. package/lib/commonjs/theta-repository/options/option-image-stitching.js +1 -2
  56. package/lib/commonjs/theta-repository/options/option-image-stitching.js.map +1 -1
  57. package/lib/commonjs/theta-repository/options/option-network-type.js +1 -2
  58. package/lib/commonjs/theta-repository/options/option-network-type.js.map +1 -1
  59. package/lib/commonjs/theta-repository/options/option-off-delay.js +42 -0
  60. package/lib/commonjs/theta-repository/options/option-off-delay.js.map +1 -0
  61. package/lib/commonjs/theta-repository/options/option-power-saving.js +1 -2
  62. package/lib/commonjs/theta-repository/options/option-power-saving.js.map +1 -1
  63. package/lib/commonjs/theta-repository/options/option-preset.js +1 -2
  64. package/lib/commonjs/theta-repository/options/option-preset.js.map +1 -1
  65. package/lib/commonjs/theta-repository/options/option-preview-format.js +1 -2
  66. package/lib/commonjs/theta-repository/options/option-preview-format.js.map +1 -1
  67. package/lib/commonjs/theta-repository/options/option-shooting-method.js +1 -2
  68. package/lib/commonjs/theta-repository/options/option-shooting-method.js.map +1 -1
  69. package/lib/commonjs/theta-repository/options/option-shutter-speed.js +1 -2
  70. package/lib/commonjs/theta-repository/options/option-shutter-speed.js.map +1 -1
  71. package/lib/commonjs/theta-repository/options/option-sleep-delay.js +42 -0
  72. package/lib/commonjs/theta-repository/options/option-sleep-delay.js.map +1 -0
  73. package/lib/commonjs/theta-repository/options/option-time-shift.js +1 -2
  74. package/lib/commonjs/theta-repository/options/option-time-shift.js.map +1 -1
  75. package/lib/commonjs/theta-repository/options/option-top-bottom-correction.js +1 -2
  76. package/lib/commonjs/theta-repository/options/option-top-bottom-correction.js.map +1 -1
  77. package/lib/commonjs/theta-repository/options/option-video-stitching.js +1 -2
  78. package/lib/commonjs/theta-repository/options/option-video-stitching.js.map +1 -1
  79. package/lib/commonjs/theta-repository/options/option-visibility-reduction.js +1 -2
  80. package/lib/commonjs/theta-repository/options/option-visibility-reduction.js.map +1 -1
  81. package/lib/commonjs/theta-repository/options/option-white-balance-auto-strength.js +1 -2
  82. package/lib/commonjs/theta-repository/options/option-white-balance-auto-strength.js.map +1 -1
  83. package/lib/commonjs/theta-repository/options/option-wlan-frequency.js +1 -2
  84. package/lib/commonjs/theta-repository/options/option-wlan-frequency.js.map +1 -1
  85. package/lib/commonjs/theta-repository/options/options.js +32 -62
  86. package/lib/commonjs/theta-repository/options/options.js.map +1 -1
  87. package/lib/commonjs/theta-repository/theta-files.js +7 -8
  88. package/lib/commonjs/theta-repository/theta-files.js.map +1 -1
  89. package/lib/commonjs/theta-repository/theta-info.js +1 -2
  90. package/lib/commonjs/theta-repository/theta-info.js.map +1 -1
  91. package/lib/commonjs/theta-repository/theta-repository.js +50 -23
  92. package/lib/commonjs/theta-repository/theta-repository.js.map +1 -1
  93. package/lib/commonjs/theta-repository/theta-state.js +7 -8
  94. package/lib/commonjs/theta-repository/theta-state.js.map +1 -1
  95. package/lib/module/capture/burst-capture.js +111 -0
  96. package/lib/module/capture/burst-capture.js.map +1 -0
  97. package/lib/module/capture/composite-interval-capture.js +104 -0
  98. package/lib/module/capture/composite-interval-capture.js.map +1 -0
  99. package/lib/module/capture/continuous-capture.js +100 -0
  100. package/lib/module/capture/continuous-capture.js.map +1 -0
  101. package/lib/module/capture/index.js +4 -0
  102. package/lib/module/capture/index.js.map +1 -1
  103. package/lib/module/capture/multi-bracket-capture.js +113 -0
  104. package/lib/module/capture/multi-bracket-capture.js.map +1 -0
  105. package/lib/module/capture/shot-count-specified-interval-capture.js +1 -0
  106. package/lib/module/capture/shot-count-specified-interval-capture.js.map +1 -1
  107. package/lib/module/capture/time-shift-capture.js +9 -1
  108. package/lib/module/capture/time-shift-capture.js.map +1 -1
  109. package/lib/module/theta-repository/options/index.js +4 -0
  110. package/lib/module/theta-repository/options/index.js.map +1 -1
  111. package/lib/module/theta-repository/options/option-auto-bracket.js +2 -0
  112. package/lib/module/theta-repository/options/option-auto-bracket.js.map +1 -0
  113. package/lib/module/theta-repository/options/option-bluetooth-role.js +14 -0
  114. package/lib/module/theta-repository/options/option-bluetooth-role.js.map +1 -0
  115. package/lib/module/theta-repository/options/option-off-delay.js +35 -0
  116. package/lib/module/theta-repository/options/option-off-delay.js.map +1 -0
  117. package/lib/module/theta-repository/options/option-sleep-delay.js +35 -0
  118. package/lib/module/theta-repository/options/option-sleep-delay.js.map +1 -0
  119. package/lib/module/theta-repository/options/options.js +4 -32
  120. package/lib/module/theta-repository/options/options.js.map +1 -1
  121. package/lib/module/theta-repository/theta-repository.js +47 -24
  122. package/lib/module/theta-repository/theta-repository.js.map +1 -1
  123. package/lib/typescript/capture/burst-capture.d.ts +55 -0
  124. package/lib/typescript/capture/burst-capture.d.ts.map +1 -0
  125. package/lib/typescript/capture/composite-interval-capture.d.ts +47 -0
  126. package/lib/typescript/capture/composite-interval-capture.d.ts.map +1 -0
  127. package/lib/typescript/capture/continuous-capture.d.ts +49 -0
  128. package/lib/typescript/capture/continuous-capture.d.ts.map +1 -0
  129. package/lib/typescript/capture/index.d.ts +4 -0
  130. package/lib/typescript/capture/index.d.ts.map +1 -1
  131. package/lib/typescript/capture/multi-bracket-capture.d.ts +56 -0
  132. package/lib/typescript/capture/multi-bracket-capture.d.ts.map +1 -0
  133. package/lib/typescript/capture/shot-count-specified-interval-capture.d.ts +1 -0
  134. package/lib/typescript/capture/shot-count-specified-interval-capture.d.ts.map +1 -1
  135. package/lib/typescript/capture/time-shift-capture.d.ts +2 -1
  136. package/lib/typescript/capture/time-shift-capture.d.ts.map +1 -1
  137. package/lib/typescript/theta-repository/options/index.d.ts +4 -0
  138. package/lib/typescript/theta-repository/options/index.d.ts.map +1 -1
  139. package/lib/typescript/theta-repository/options/option-auto-bracket.d.ts +36 -0
  140. package/lib/typescript/theta-repository/options/option-auto-bracket.d.ts.map +1 -0
  141. package/lib/typescript/theta-repository/options/option-bluetooth-role.d.ts +14 -0
  142. package/lib/typescript/theta-repository/options/option-bluetooth-role.d.ts.map +1 -0
  143. package/lib/typescript/theta-repository/options/option-off-delay.d.ts +22 -0
  144. package/lib/typescript/theta-repository/options/option-off-delay.d.ts.map +1 -0
  145. package/lib/typescript/theta-repository/options/option-sleep-delay.d.ts +22 -0
  146. package/lib/typescript/theta-repository/options/option-sleep-delay.d.ts.map +1 -0
  147. package/lib/typescript/theta-repository/options/options.d.ts +12 -30
  148. package/lib/typescript/theta-repository/options/options.d.ts.map +1 -1
  149. package/lib/typescript/theta-repository/theta-repository.d.ts +32 -2
  150. package/lib/typescript/theta-repository/theta-repository.d.ts.map +1 -1
  151. package/package.json +2 -2
  152. package/src/capture/burst-capture.ts +169 -0
  153. package/src/capture/composite-interval-capture.ts +140 -0
  154. package/src/capture/continuous-capture.ts +126 -0
  155. package/src/capture/index.ts +4 -0
  156. package/src/capture/multi-bracket-capture.ts +145 -0
  157. package/src/capture/shot-count-specified-interval-capture.ts +1 -0
  158. package/src/capture/time-shift-capture.ts +19 -1
  159. package/src/theta-repository/options/index.ts +4 -0
  160. package/src/theta-repository/options/option-auto-bracket.ts +48 -0
  161. package/src/theta-repository/options/option-bluetooth-role.ts +15 -0
  162. package/src/theta-repository/options/option-off-delay.ts +38 -0
  163. package/src/theta-repository/options/option-sleep-delay.ts +37 -0
  164. package/src/theta-repository/options/options.ts +12 -38
  165. package/src/theta-repository/theta-repository.ts +68 -0
  166. package/theta-client-react-native.podspec +1 -1
@@ -19,6 +19,7 @@ let KEY_THETA_MODEL = "thetaModel"
19
19
  let KEY_TIMESHIFT = "timeShift"
20
20
  let KEY_APERTURE = "aperture"
21
21
  let KEY_CAPTURE_INTERVAL = "captureInterval"
22
+ let KEY_COMPOSITE_SHOOTING_OUTPUT_INTERVAL = "compositeShootingOutputInterval"
22
23
  let KEY_COLOR_TEMPERATURE = "colorTemperature"
23
24
  let KEY_EXPOSURE_COMPENSATION = "exposureCompensation"
24
25
  let KEY_EXPOSURE_DELAY = "exposureDelay"
@@ -46,6 +47,7 @@ let KEY_PROXY_URL = "url"
46
47
  let KEY_PROXY_PORT = "port"
47
48
  let KEY_PROXY_USER_ID = "userid"
48
49
  let KEY_PROXY_PASSWORD = "password"
50
+ let KEY_BURST_MODE = "burstMode"
49
51
  let KEY_BURST_CAPTURE_NUM = "burstCaptureNum"
50
52
  let KEY_BURST_BRACKET_STEP = "burstBracketStep"
51
53
  let KEY_BURST_COMPENSATION = "burstCompensation"
@@ -56,6 +58,7 @@ let KEY_TOP_BOTTOM_CORRECTION_ROTATION_PITCH = "pitch"
56
58
  let KEY_TOP_BOTTOM_CORRECTION_ROTATION_ROLL = "roll"
57
59
  let KEY_TOP_BOTTOM_CORRECTION_ROTATION_YAW = "yaw"
58
60
  let KEY_TIMESHIFT_CAPTURE_INTERVAL = "_capture_interval"
61
+ let KEY_AUTO_BRACKET = "autoBracket"
59
62
 
60
63
  public class ConvertUtil: NSObject {}
61
64
 
@@ -65,8 +68,10 @@ let optionItemNameToEnum = [
65
68
  // TODO: Add items when adding options
66
69
  "aiAutoThumbnail": ThetaRepository.OptionNameEnum.aiautothumbnail,
67
70
  "aperture": ThetaRepository.OptionNameEnum.aperture,
71
+ "autoBracket": ThetaRepository.OptionNameEnum.autobracket,
68
72
  "bitrate": ThetaRepository.OptionNameEnum.bitrate,
69
73
  "bluetoothPower": ThetaRepository.OptionNameEnum.bluetoothpower,
74
+ "bluetoothRole": ThetaRepository.OptionNameEnum.bluetoothrole,
70
75
  "burstMode": ThetaRepository.OptionNameEnum.burstmode,
71
76
  "burstOption": ThetaRepository.OptionNameEnum.burstoption,
72
77
  "cameraControlSource": ThetaRepository.OptionNameEnum.cameracontrolsource,
@@ -162,12 +167,20 @@ func setOptionsValue(options: ThetaRepository.Options, name: String, value: Any)
162
167
  options.aperture = getEnumValue(
163
168
  values: ThetaRepository.ApertureEnum.values(), name: value as! String
164
169
  )!
170
+ case ThetaRepository.OptionNameEnum.autobracket.name:
171
+ if let params = value as? [[String: Any]] {
172
+ options.autoBracket = toAutoBracket(params: params)
173
+ }
165
174
  case ThetaRepository.OptionNameEnum.bitrate.name:
166
175
  options.bitrate = toBitrate(value: value)
167
176
  case ThetaRepository.OptionNameEnum.bluetoothpower.name:
168
177
  options.bluetoothPower = getEnumValue(
169
178
  values: ThetaRepository.BluetoothPowerEnum.values(), name: value as! String
170
179
  )!
180
+ case ThetaRepository.OptionNameEnum.bluetoothrole.name:
181
+ options.bluetoothRole = getEnumValue(
182
+ values: ThetaRepository.BluetoothRoleEnum.values(), name: value as! String
183
+ )!
171
184
  case ThetaRepository.OptionNameEnum.burstmode.name:
172
185
  options.burstMode = getEnumValue(
173
186
  values: ThetaRepository.BurstModeEnum.values(), name: value as! String
@@ -269,9 +282,7 @@ func setOptionsValue(options: ThetaRepository.Options, name: String, value: Any)
269
282
  values: ThetaRepository.NetworkTypeEnum.values(), name: value as! String
270
283
  )!
271
284
  case ThetaRepository.OptionNameEnum.offdelay.name:
272
- options.offDelay = getEnumValue(
273
- values: ThetaRepository.OffDelayEnum.values(), name: value as! String
274
- )!
285
+ options.offDelay = toOffDelay(value: value)
275
286
  case ThetaRepository.OptionNameEnum.password.name:
276
287
  options.password = value as? String
277
288
  case ThetaRepository.OptionNameEnum.powersaving.name:
@@ -307,9 +318,7 @@ func setOptionsValue(options: ThetaRepository.Options, name: String, value: Any)
307
318
  case ThetaRepository.OptionNameEnum.shuttervolume.name:
308
319
  options.shutterVolume = KotlinInt(integerLiteral: value as! Int)
309
320
  case ThetaRepository.OptionNameEnum.sleepdelay.name:
310
- options.sleepDelay = getEnumValue(
311
- values: ThetaRepository.SleepDelayEnum.values(), name: value as! String
312
- )!
321
+ options.sleepDelay = toSleepDelay(value: value)
313
322
  case ThetaRepository.OptionNameEnum.timeshift.name:
314
323
  if let params = value as? [String: Any] {
315
324
  options.timeShift = toTimeShift(params: params)
@@ -360,6 +369,10 @@ func convertResult(options: ThetaRepository.Options) -> [String: Any] {
360
369
  result[key] = value as! Bool ? true : false
361
370
  } else if value is NSNumber || value is String {
362
371
  result[key] = value
372
+ } else if value is ThetaRepository.BracketSettingList,
373
+ let autoBracket = value as? ThetaRepository.BracketSettingList
374
+ {
375
+ result[key] = convertResult(autoBracket: autoBracket)
363
376
  } else if let bitrate = value as? ThetaRepository.BitrateNumber {
364
377
  result[key] = bitrate.value
365
378
  } else if value is ThetaRepository.BurstOption,
@@ -558,6 +571,119 @@ func setShotCountSpecifiedIntervalCaptureBuilderParams(params: [String: Any], bu
558
571
  }
559
572
  }
560
573
 
574
+ func setCompositeIntervalCaptureBuilderParams(params: [String: Any], builder: CompositeIntervalCapture.Builder) {
575
+ if let interval = params[KEY_TIMESHIFT_CAPTURE_INTERVAL] as? Int,
576
+ interval >= 0
577
+ {
578
+ builder.setCheckStatusCommandInterval(timeMillis: Int64(interval))
579
+ }
580
+ if let value = params[KEY_COMPOSITE_SHOOTING_OUTPUT_INTERVAL] as? Int32 {
581
+ builder.setCompositeShootingOutputInterval(sec: value)
582
+ }
583
+ }
584
+
585
+ func setBurstCaptureBuilderParams(params: [String: Any], builder: BurstCapture.Builder) {
586
+ if let interval = params[KEY_TIMESHIFT_CAPTURE_INTERVAL] as? Int,
587
+ interval >= 0
588
+ {
589
+ builder.setCheckStatusCommandInterval(timeMillis: Int64(interval))
590
+ }
591
+ if let value = params[KEY_BURST_MODE] as? String {
592
+ if let enumValue = getEnumValue(values: ThetaRepository.BurstModeEnum.values(),
593
+ name: value)
594
+ {
595
+ builder.setBurstMode(mode: enumValue)
596
+ }
597
+ }
598
+ }
599
+
600
+ func setMultiBracketCaptureBuilderParams(params: [String: Any], builder: MultiBracketCapture.Builder) {
601
+ if let autoBracket = params[KEY_AUTO_BRACKET] as? [[String: Any]] {
602
+ autoBracket.forEach { map in
603
+ let aperture = {
604
+ if let name = map["aperture"] as? String {
605
+ return getEnumValue(values: ThetaRepository.ApertureEnum.values(), name: name)
606
+ } else {
607
+ return nil
608
+ }
609
+ }()
610
+
611
+ let colorTemperature = {
612
+ if let value = map["colorTemperature"] as? Int {
613
+ return toKotlinInt(value: value)
614
+ } else {
615
+ return nil
616
+ }
617
+ }()
618
+
619
+ let exposureCompensation = {
620
+ if let name = map["exposureCompensation"] as? String {
621
+ return getEnumValue(values: ThetaRepository.ExposureCompensationEnum.values(), name: name)
622
+ } else {
623
+ return nil
624
+ }
625
+ }()
626
+
627
+ let exposureProgram = {
628
+ if let name = map["exposureProgram"] as? String {
629
+ return getEnumValue(values: ThetaRepository.ExposureProgramEnum.values(), name: name)
630
+ } else {
631
+ return nil
632
+ }
633
+ }()
634
+
635
+ let iso = {
636
+ if let name = map["iso"] as? String {
637
+ return getEnumValue(values: ThetaRepository.IsoEnum.values(), name: name)
638
+ } else {
639
+ return nil
640
+ }
641
+ }()
642
+
643
+ let shutterSpeed = {
644
+ if let name = map["shutterSpeed"] as? String {
645
+ return getEnumValue(values: ThetaRepository.ShutterSpeedEnum.values(), name: name)
646
+ } else {
647
+ return nil
648
+ }
649
+ }()
650
+
651
+ let whiteBalance = {
652
+ if let name = map["whiteBalance"] as? String {
653
+ return getEnumValue(values: ThetaRepository.WhiteBalanceEnum.values(), name: name)
654
+ } else {
655
+ return nil
656
+ }
657
+ }()
658
+
659
+ builder.addBracketParameters(
660
+ aperture: aperture,
661
+ colorTemperature: colorTemperature,
662
+ exposureCompensation: exposureCompensation,
663
+ exposureProgram: exposureProgram,
664
+ iso: iso,
665
+ shutterSpeed: shutterSpeed,
666
+ whiteBalance: whiteBalance
667
+ )
668
+ }
669
+ }
670
+ }
671
+
672
+ func setContinuousCaptureBuilderParams(params: [String: Any], builder: ContinuousCapture.Builder) {
673
+ if let interval = params[KEY_TIMESHIFT_CAPTURE_INTERVAL] as? Int,
674
+ interval >= 0
675
+ {
676
+ builder.setCheckStatusCommandInterval(timeMillis: Int64(interval))
677
+ }
678
+ if let value = params[KEY_FILE_FORMAT] as? String {
679
+ if let enumValue = getEnumValue(
680
+ values: ThetaRepository.PhotoFileFormatEnum.values(), name: value
681
+ ) {
682
+ builder.setFileFormat(fileFormat: enumValue)
683
+ }
684
+ }
685
+ }
686
+
561
687
  // MARK: - Utility
562
688
 
563
689
  func getEnumValue<T, E: KotlinEnum<T>>(values: KotlinArray<E>, name: String) -> E? {
@@ -722,26 +848,60 @@ func convertResult(thetaState: ThetaRepository.ThetaState) -> [String: Any?] {
722
848
  func convertResult(burstOption: ThetaRepository.BurstOption) -> [String: Any] {
723
849
  var result: [String: Any] = [:]
724
850
  if let burstCaptureNum = burstOption.burstCaptureNum {
725
- result[KEY_BURST_CAPTURE_NUM] = burstCaptureNum.value.name
851
+ result[KEY_BURST_CAPTURE_NUM] = burstCaptureNum.name
726
852
  }
727
853
  if let burstBracketStep = burstOption.burstBracketStep {
728
- result[KEY_BURST_BRACKET_STEP] = burstBracketStep.value.name
854
+ result[KEY_BURST_BRACKET_STEP] = burstBracketStep.name
729
855
  }
730
856
  if let burstCompensation = burstOption.burstCompensation {
731
- result[KEY_BURST_COMPENSATION] = burstCompensation.value.name
857
+ result[KEY_BURST_COMPENSATION] = burstCompensation.name
732
858
  }
733
859
  if let burstMaxExposureTime = burstOption.burstMaxExposureTime {
734
- result[KEY_BURST_MAX_EXPOSURE_TIME] = burstMaxExposureTime.value.name
860
+ result[KEY_BURST_MAX_EXPOSURE_TIME] = burstMaxExposureTime.name
735
861
  }
736
862
  if let burstEnableIsoControl = burstOption.burstEnableIsoControl {
737
- result[KEY_BURST_ENABLE_ISO_CONTROL] = burstEnableIsoControl.value.name
863
+ result[KEY_BURST_ENABLE_ISO_CONTROL] = burstEnableIsoControl.name
738
864
  }
739
865
  if let burstOrder = burstOption.burstOrder {
740
- result[KEY_BURST_ORDER] = burstOrder.value.name
866
+ result[KEY_BURST_ORDER] = burstOrder.name
741
867
  }
742
868
  return result
743
869
  }
744
870
 
871
+ func convertResult(autoBracket: ThetaRepository.BracketSettingList) -> [[String: Any]] {
872
+ var resultList = [[String: Any]]()
873
+
874
+ autoBracket.list.forEach { bracketSetting in
875
+ var result: [String: Any] = [:]
876
+ if let setting = bracketSetting as? ThetaRepository.BracketSetting {
877
+ if let aperture = setting.aperture?.name {
878
+ result["aperture"] = aperture
879
+ }
880
+ if let colorTemperature = setting.colorTemperature?.intValue {
881
+ result["colorTemperature"] = colorTemperature
882
+ }
883
+ if let exposureCompensation = setting.exposureCompensation?.name {
884
+ result["exposureCompensation"] = exposureCompensation
885
+ }
886
+ if let exposureProgram = setting.exposureProgram?.name {
887
+ result["exposureProgram"] = exposureProgram
888
+ }
889
+ if let iso = setting.iso?.name {
890
+ result["iso"] = iso
891
+ }
892
+ if let shutterSpeed = setting.shutterSpeed?.name {
893
+ result["shutterSpeed"] = shutterSpeed
894
+ }
895
+ if let whiteBalance = setting.whiteBalance?.name {
896
+ result["whiteBalance"] = whiteBalance
897
+ }
898
+ resultList.append(result)
899
+ }
900
+ }
901
+
902
+ return resultList
903
+ }
904
+
745
905
  func convertResult(gpsInfo: ThetaRepository.GpsInfo) -> [String: Any] {
746
906
  return [
747
907
  "latitude": gpsInfo.latitude,
@@ -890,6 +1050,30 @@ func toBitrate(value: Any) -> ThetaRepositoryBitrate? {
890
1050
  }
891
1051
  }
892
1052
 
1053
+ func toOffDelay(value: Any) -> ThetaRepositoryOffDelay? {
1054
+ if value is NSNumber, let intVal = value as? Int32 {
1055
+ return ThetaRepository.OffDelaySec(sec: intVal)
1056
+ } else if let name = value as? String,
1057
+ let enumValue = getEnumValue(values: ThetaRepository.OffDelayEnum.values(), name: name)
1058
+ {
1059
+ return enumValue
1060
+ } else {
1061
+ return nil
1062
+ }
1063
+ }
1064
+
1065
+ func toSleepDelay(value: Any) -> ThetaRepositorySleepDelay? {
1066
+ if value is NSNumber, let intVal = value as? Int32 {
1067
+ return ThetaRepository.SleepDelaySec(sec: intVal)
1068
+ } else if let name = value as? String,
1069
+ let enumValue = getEnumValue(values: ThetaRepository.SleepDelayEnum.values(), name: name)
1070
+ {
1071
+ return enumValue
1072
+ } else {
1073
+ return nil
1074
+ }
1075
+ }
1076
+
893
1077
  func toBurstOption(params: [String: Any]) -> ThetaRepository.BurstOption {
894
1078
  var burstCaptureNum: ThetaRepository.BurstCaptureNumEnum? = nil
895
1079
  if let name = params["burstCaptureNum"] as? String {
@@ -941,6 +1125,80 @@ func toBurstOption(params: [String: Any]) -> ThetaRepository.BurstOption {
941
1125
  )
942
1126
  }
943
1127
 
1128
+ func toAutoBracket(params: [[String: Any]]) -> ThetaRepository.BracketSettingList {
1129
+ let autoBracket = ThetaRepository.BracketSettingList()
1130
+
1131
+ params.forEach { map in
1132
+ let aperture = {
1133
+ if let name = map["aperture"] as? String {
1134
+ return getEnumValue(values: ThetaRepository.ApertureEnum.values(), name: name)
1135
+ } else {
1136
+ return nil
1137
+ }
1138
+ }()
1139
+
1140
+ let colorTemperature = {
1141
+ if let value = map["colorTemperature"] as? Int {
1142
+ return toKotlinInt(value: value)
1143
+ } else {
1144
+ return nil
1145
+ }
1146
+ }()
1147
+
1148
+ let exposureCompensation = {
1149
+ if let name = map["exposureCompensation"] as? String {
1150
+ return getEnumValue(values: ThetaRepository.ExposureCompensationEnum.values(), name: name)
1151
+ } else {
1152
+ return nil
1153
+ }
1154
+ }()
1155
+
1156
+ let exposureProgram = {
1157
+ if let name = map["exposureProgram"] as? String {
1158
+ return getEnumValue(values: ThetaRepository.ExposureProgramEnum.values(), name: name)
1159
+ } else {
1160
+ return nil
1161
+ }
1162
+ }()
1163
+
1164
+ let iso = {
1165
+ if let name = map["iso"] as? String {
1166
+ return getEnumValue(values: ThetaRepository.IsoEnum.values(), name: name)
1167
+ } else {
1168
+ return nil
1169
+ }
1170
+ }()
1171
+
1172
+ let shutterSpeed = {
1173
+ if let name = map["shutterSpeed"] as? String {
1174
+ return getEnumValue(values: ThetaRepository.ShutterSpeedEnum.values(), name: name)
1175
+ } else {
1176
+ return nil
1177
+ }
1178
+ }()
1179
+
1180
+ let whiteBalance = {
1181
+ if let name = map["whiteBalance"] as? String {
1182
+ return getEnumValue(values: ThetaRepository.WhiteBalanceEnum.values(), name: name)
1183
+ } else {
1184
+ return nil
1185
+ }
1186
+ }()
1187
+
1188
+ autoBracket.add(setting: ThetaRepository.BracketSetting(
1189
+ aperture: aperture,
1190
+ colorTemperature: colorTemperature,
1191
+ exposureCompensation: exposureCompensation,
1192
+ exposureProgram: exposureProgram,
1193
+ iso: iso,
1194
+ shutterSpeed: shutterSpeed,
1195
+ whiteBalance: whiteBalance
1196
+ ))
1197
+ }
1198
+
1199
+ return autoBracket
1200
+ }
1201
+
944
1202
  func toGpsInfo(params: [String: Any]) -> ThetaRepository.GpsInfo? {
945
1203
  guard let latitude = params[KEY_GPS_LATITUDE] as? Double,
946
1204
  let longitude = params[KEY_GPS_LONGITUDE] as? Double,
@@ -1020,13 +1278,9 @@ func toConfig(params: [String: Any]) -> ThetaRepository.Config {
1020
1278
  values: ThetaRepository.LanguageEnum.values(), name: value as? String ?? ""
1021
1279
  )
1022
1280
  case KEY_OFF_DELAY:
1023
- config.offDelay = getEnumValue(
1024
- values: ThetaRepository.OffDelayEnum.values(), name: value as? String ?? ""
1025
- )
1281
+ config.offDelay = toOffDelay(value: value)
1026
1282
  case KEY_SLEEP_DELAY:
1027
- config.sleepDelay = getEnumValue(
1028
- values: ThetaRepository.SleepDelayEnum.values(), name: value as? String ?? ""
1029
- )
1283
+ config.sleepDelay = toSleepDelay(value: value)
1030
1284
  case KEY_SHUTTER_VOLUME:
1031
1285
  if let value = value as? Int {
1032
1286
  config.shutterVolume = KotlinInt(integerLiteral: value)
@@ -121,6 +121,62 @@ RCT_EXTERN_METHOD(startShotCountSpecifiedIntervalCapture:(RCTPromiseResolveBlock
121
121
  RCT_EXTERN_METHOD(cancelShotCountSpecifiedIntervalCapture:(RCTPromiseResolveBlock)resolve
122
122
  withRejecter:(RCTPromiseRejectBlock)reject)
123
123
 
124
+ RCT_EXTERN_METHOD(getCompositeIntervalCaptureBuilder:(int)shootingTimeSec
125
+ withResolver:(RCTPromiseResolveBlock)resolve
126
+ withRejecter:(RCTPromiseRejectBlock)reject)
127
+
128
+ RCT_EXTERN_METHOD(buildCompositeIntervalCapture:(NSDictionary*)options
129
+ withResolver:(RCTPromiseResolveBlock)resolve
130
+ withRejecter:(RCTPromiseRejectBlock)reject)
131
+
132
+ RCT_EXTERN_METHOD(startCompositeIntervalCapture:(RCTPromiseResolveBlock)resolve
133
+ withRejecter:(RCTPromiseRejectBlock)reject)
134
+
135
+ RCT_EXTERN_METHOD(cancelCompositeIntervalCapture:(RCTPromiseResolveBlock)resolve
136
+ withRejecter:(RCTPromiseRejectBlock)reject)
137
+
138
+ RCT_EXTERN_METHOD(getBurstCaptureBuilder:(NSString*)burstCaptureNum
139
+ burstBracketStep:(NSString*)burstBracketStep
140
+ burstCompensation:(NSString*)burstCompensation
141
+ burstMaxExposureTime:(NSString*)burstMaxExposureTime
142
+ burstEnableIsoControl:(NSString*)burstEnableIsoControl
143
+ burstOrder:(NSString*)burstOrder
144
+ withResolver:(RCTPromiseResolveBlock)resolve
145
+ withRejecter:(RCTPromiseRejectBlock)reject)
146
+
147
+ RCT_EXTERN_METHOD(buildBurstCapture:(NSDictionary*)options
148
+ withResolver:(RCTPromiseResolveBlock)resolve
149
+ withRejecter:(RCTPromiseRejectBlock)reject)
150
+
151
+ RCT_EXTERN_METHOD(startBurstCapture:(RCTPromiseResolveBlock)resolve
152
+ withRejecter:(RCTPromiseRejectBlock)reject)
153
+
154
+ RCT_EXTERN_METHOD(cancelBurstCapture:(RCTPromiseResolveBlock)resolve
155
+ withRejecter:(RCTPromiseRejectBlock)reject)
156
+
157
+ RCT_EXTERN_METHOD(getMultiBracketCaptureBuilder:(RCTPromiseResolveBlock)resolve
158
+ withRejecter:(RCTPromiseRejectBlock)reject)
159
+
160
+ RCT_EXTERN_METHOD(buildMultiBracketCapture:(NSDictionary*)options
161
+ withResolver:(RCTPromiseResolveBlock)resolve
162
+ withRejecter:(RCTPromiseRejectBlock)reject)
163
+
164
+ RCT_EXTERN_METHOD(startMultiBracketCapture:(RCTPromiseResolveBlock)resolve
165
+ withRejecter:(RCTPromiseRejectBlock)reject)
166
+
167
+ RCT_EXTERN_METHOD(cancelMultiBracketCapture:(RCTPromiseResolveBlock)resolve
168
+ withRejecter:(RCTPromiseRejectBlock)reject)
169
+
170
+ RCT_EXTERN_METHOD(getContinuousCaptureBuilder:(RCTPromiseResolveBlock)resolve
171
+ withRejecter:(RCTPromiseRejectBlock)reject)
172
+
173
+ RCT_EXTERN_METHOD(buildContinuousCapture:(NSDictionary*)options
174
+ withResolver:(RCTPromiseResolveBlock)resolve
175
+ withRejecter:(RCTPromiseRejectBlock)reject)
176
+
177
+ RCT_EXTERN_METHOD(startContinuousCapture:(RCTPromiseResolveBlock)resolve
178
+ withRejecter:(RCTPromiseRejectBlock)reject)
179
+
124
180
  RCT_EXTERN_METHOD(getMetadata:(NSString*)fileUrl
125
181
  withResolver:(RCTPromiseResolveBlock)resolve
126
182
  withRejecter:(RCTPromiseRejectBlock)reject)