theta-client-react-native 1.0.1 → 1.1.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/README.md +6 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/Converter.kt +34 -0
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +311 -9
- package/ios/ThetaClientReactNative.mm +552 -67
- package/lib/commonjs/capture/capture.js +118 -0
- package/lib/commonjs/capture/capture.js.map +1 -0
- package/lib/commonjs/capture/index.js +39 -0
- package/lib/commonjs/capture/index.js.map +1 -0
- package/lib/commonjs/capture/photo-capture.js +64 -0
- package/lib/commonjs/capture/photo-capture.js.map +1 -0
- package/lib/commonjs/capture/video-capture.js +71 -0
- package/lib/commonjs/capture/video-capture.js.map +1 -0
- package/lib/commonjs/index.js +40 -1041
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/theta-repository/access-point.js +23 -0
- package/lib/commonjs/theta-repository/access-point.js.map +1 -0
- package/lib/commonjs/theta-repository/index.js +72 -0
- package/lib/commonjs/theta-repository/index.js.map +1 -0
- package/lib/commonjs/theta-repository/options/index.js +28 -0
- package/lib/commonjs/theta-repository/options/index.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-white-balance-auto-strength.js +25 -0
- package/lib/commonjs/theta-repository/options/option-white-balance-auto-strength.js.map +1 -0
- package/lib/commonjs/theta-repository/options/options.js +462 -0
- package/lib/commonjs/theta-repository/options/options.js.map +1 -0
- package/lib/commonjs/theta-repository/theta-files.js +23 -0
- package/lib/commonjs/theta-repository/theta-files.js.map +1 -0
- package/lib/commonjs/theta-repository/theta-info.js +2 -0
- package/lib/commonjs/theta-repository/theta-info.js.map +1 -0
- package/lib/commonjs/theta-repository/theta-meta.js +2 -0
- package/lib/commonjs/theta-repository/theta-meta.js.map +1 -0
- package/lib/commonjs/theta-repository/theta-plugin.js +2 -0
- package/lib/commonjs/theta-repository/theta-plugin.js.map +1 -0
- package/lib/commonjs/theta-repository/theta-repository.js +479 -0
- package/lib/commonjs/theta-repository/theta-repository.js.map +1 -0
- package/lib/commonjs/theta-repository/theta-state.js +120 -0
- package/lib/commonjs/theta-repository/theta-state.js.map +1 -0
- package/lib/module/capture/capture.js +111 -0
- package/lib/module/capture/capture.js.map +1 -0
- package/lib/module/capture/index.js +4 -0
- package/lib/module/capture/index.js.map +1 -0
- package/lib/module/capture/photo-capture.js +56 -0
- package/lib/module/capture/photo-capture.js.map +1 -0
- package/lib/module/capture/video-capture.js +63 -0
- package/lib/module/capture/video-capture.js.map +1 -0
- package/lib/module/index.js +3 -1009
- package/lib/module/index.js.map +1 -1
- package/lib/module/theta-repository/access-point.js +16 -0
- package/lib/module/theta-repository/access-point.js.map +1 -0
- package/lib/module/theta-repository/index.js +7 -0
- package/lib/module/theta-repository/index.js.map +1 -0
- package/lib/module/theta-repository/options/index.js +3 -0
- package/lib/module/theta-repository/options/index.js.map +1 -0
- package/lib/module/theta-repository/options/option-white-balance-auto-strength.js +18 -0
- package/lib/module/theta-repository/options/option-white-balance-auto-strength.js.map +1 -0
- package/lib/module/theta-repository/options/options.js +454 -0
- package/lib/module/theta-repository/options/options.js.map +1 -0
- package/lib/module/theta-repository/theta-files.js +16 -0
- package/lib/module/theta-repository/theta-files.js.map +1 -0
- package/lib/module/theta-repository/theta-info.js +2 -0
- package/lib/module/theta-repository/theta-info.js.map +1 -0
- package/lib/module/theta-repository/theta-meta.js +2 -0
- package/lib/module/theta-repository/theta-meta.js.map +1 -0
- package/lib/module/theta-repository/theta-plugin.js +2 -0
- package/lib/module/theta-repository/theta-plugin.js.map +1 -0
- package/lib/module/theta-repository/theta-repository.js +437 -0
- package/lib/module/theta-repository/theta-repository.js.map +1 -0
- package/lib/module/theta-repository/theta-state.js +113 -0
- package/lib/module/theta-repository/theta-state.js.map +1 -0
- package/lib/typescript/capture/capture.d.ts +71 -0
- package/lib/typescript/capture/capture.d.ts.map +1 -0
- package/lib/typescript/capture/index.d.ts +4 -0
- package/lib/typescript/capture/index.d.ts.map +1 -0
- package/lib/typescript/capture/photo-capture.d.ts +38 -0
- package/lib/typescript/capture/photo-capture.d.ts.map +1 -0
- package/lib/typescript/capture/video-capture.d.ts +43 -0
- package/lib/typescript/capture/video-capture.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +3 -972
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/theta-repository/access-point.d.ts +33 -0
- package/lib/typescript/theta-repository/access-point.d.ts.map +1 -0
- package/lib/typescript/theta-repository/index.d.ts +7 -0
- package/lib/typescript/theta-repository/index.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 -0
- package/lib/typescript/theta-repository/options/option-white-balance-auto-strength.d.ts +18 -0
- package/lib/typescript/theta-repository/options/option-white-balance-auto-strength.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/options.d.ts +499 -0
- package/lib/typescript/theta-repository/options/options.d.ts.map +1 -0
- package/lib/typescript/theta-repository/theta-files.d.ts +32 -0
- package/lib/typescript/theta-repository/theta-files.d.ts.map +1 -0
- package/lib/typescript/theta-repository/theta-info.d.ts +34 -0
- package/lib/typescript/theta-repository/theta-info.d.ts.map +1 -0
- package/lib/typescript/theta-repository/theta-meta.d.ts +38 -0
- package/lib/typescript/theta-repository/theta-meta.d.ts.map +1 -0
- package/lib/typescript/theta-repository/theta-plugin.d.ts +26 -0
- package/lib/typescript/theta-repository/theta-plugin.d.ts.map +1 -0
- package/lib/typescript/theta-repository/theta-repository.d.ts +312 -0
- package/lib/typescript/theta-repository/theta-repository.d.ts.map +1 -0
- package/lib/typescript/theta-repository/theta-state.d.ts +150 -0
- package/lib/typescript/theta-repository/theta-state.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/capture/capture.ts +124 -0
- package/src/capture/index.ts +3 -0
- package/src/capture/photo-capture.ts +62 -0
- package/src/capture/video-capture.ts +69 -0
- package/src/index.tsx +3 -1243
- package/src/theta-repository/access-point.ts +34 -0
- package/src/theta-repository/index.ts +6 -0
- package/src/theta-repository/options/index.ts +2 -0
- package/src/theta-repository/options/option-white-balance-auto-strength.ts +19 -0
- package/src/theta-repository/options/options.ts +554 -0
- package/src/theta-repository/theta-files.ts +34 -0
- package/src/theta-repository/theta-info.ts +35 -0
- package/src/theta-repository/theta-meta.ts +39 -0
- package/src/theta-repository/theta-plugin.ts +25 -0
- package/src/theta-repository/theta-repository.ts +476 -0
- package/src/theta-repository/theta-state.ts +164 -0
- package/theta-client-react-native.podspec +1 -1
|
@@ -197,6 +197,62 @@ static convert_t ChargingStateEnum = {
|
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
199
|
|
|
200
|
+
static convert_t CaptureStatusEnum = {
|
|
201
|
+
.fromTheta = @{
|
|
202
|
+
THETACThetaRepositoryCaptureStatusEnum.shooting: @"SHOOTING",
|
|
203
|
+
THETACThetaRepositoryCaptureStatusEnum.idle: @"IDLE",
|
|
204
|
+
THETACThetaRepositoryCaptureStatusEnum.selfTimerCountdown: @"SELF_TIMER_COUNTDOWN",
|
|
205
|
+
THETACThetaRepositoryCaptureStatusEnum.bracketShooting: @"BRACKET_SHOOTING",
|
|
206
|
+
THETACThetaRepositoryCaptureStatusEnum.converting: @"CONVERTING",
|
|
207
|
+
THETACThetaRepositoryCaptureStatusEnum.timeShiftShooting: @"TIME_SHIFT_SHOOTING",
|
|
208
|
+
THETACThetaRepositoryCaptureStatusEnum.continuousShooting: @"CONTINUOUS_SHOOTING",
|
|
209
|
+
THETACThetaRepositoryCaptureStatusEnum.retrospectiveImageRecording: @"RETROSPECTIVE_IMAGE_RECORDING"
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
static convert_t ShootingFunctionEnum = {
|
|
214
|
+
.fromTheta = @{
|
|
215
|
+
THETACThetaRepositoryShootingFunctionEnum.normal: @"NORMAL",
|
|
216
|
+
THETACThetaRepositoryShootingFunctionEnum.selfTimer: @"SELF_TIMER",
|
|
217
|
+
THETACThetaRepositoryShootingFunctionEnum.mySetting: @"MY_SETTING"
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
static convert_t MicrophoneOptionEnum = {
|
|
222
|
+
.fromTheta = @{
|
|
223
|
+
THETACThetaRepositoryMicrophoneOptionEnum.auto_: @"AUTO",
|
|
224
|
+
THETACThetaRepositoryMicrophoneOptionEnum.internal: @"INTERNAL",
|
|
225
|
+
THETACThetaRepositoryMicrophoneOptionEnum.external: @"EXTERNAL"
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
static convert_t CameraErrorEnum = {
|
|
230
|
+
.fromTheta = @{
|
|
231
|
+
THETACThetaRepositoryCameraErrorEnum.noMemory: @"NO_MEMORY",
|
|
232
|
+
THETACThetaRepositoryCameraErrorEnum.fileNumberOver: @"FILE_NUMBER_OVER",
|
|
233
|
+
THETACThetaRepositoryCameraErrorEnum.noDateSetting: @"NO_DATE_SETTING",
|
|
234
|
+
THETACThetaRepositoryCameraErrorEnum.readError: @"READ_ERROR",
|
|
235
|
+
THETACThetaRepositoryCameraErrorEnum.notSupportedMediaType: @"NOT_SUPPORTED_MEDIA_TYPE",
|
|
236
|
+
THETACThetaRepositoryCameraErrorEnum.notSupportedFileSystem: @"NOT_SUPPORTED_FILE_SYSTEM",
|
|
237
|
+
THETACThetaRepositoryCameraErrorEnum.mediaNotReady: @"MEDIA_NOT_READY",
|
|
238
|
+
THETACThetaRepositoryCameraErrorEnum.notEnoughBattery: @"NOT_ENOUGH_BATTERY",
|
|
239
|
+
THETACThetaRepositoryCameraErrorEnum.invalidFile: @"INVALID_FILE",
|
|
240
|
+
THETACThetaRepositoryCameraErrorEnum.pluginBootError: @"PLUGIN_BOOT_ERROR",
|
|
241
|
+
THETACThetaRepositoryCameraErrorEnum.inProgressError: @"IN_PROGRESS_ERROR",
|
|
242
|
+
THETACThetaRepositoryCameraErrorEnum.cannotRecording: @"CANNOT_RECORDING",
|
|
243
|
+
THETACThetaRepositoryCameraErrorEnum.cannotRecordLowbat: @"CANNOT_RECORD_LOWBAT",
|
|
244
|
+
THETACThetaRepositoryCameraErrorEnum.captureHwFailed: @"CAPTURE_HW_FAILED",
|
|
245
|
+
THETACThetaRepositoryCameraErrorEnum.captureSwFailed: @"CAPTURE_SW_FAILED",
|
|
246
|
+
THETACThetaRepositoryCameraErrorEnum.internalMemAccessFail: @"INTERNAL_MEM_ACCESS_FAIL",
|
|
247
|
+
THETACThetaRepositoryCameraErrorEnum.unexpectedError: @"UNEXPECTED_ERROR",
|
|
248
|
+
THETACThetaRepositoryCameraErrorEnum.batteryChargeFail: @"BATTERY_CHARGE_FAIL",
|
|
249
|
+
THETACThetaRepositoryCameraErrorEnum.highTemperatureWarning: @"HIGH_TEMPERATURE_WARNING",
|
|
250
|
+
THETACThetaRepositoryCameraErrorEnum.highTemperature: @"HIGH_TEMPERATURE",
|
|
251
|
+
THETACThetaRepositoryCameraErrorEnum.batteryHighTemperature: @"BATTERY_HIGH_TEMPERATURE",
|
|
252
|
+
THETACThetaRepositoryCameraErrorEnum.compassCalibration: @"COMPASS_CALIBRATION"
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
|
|
200
256
|
/**
|
|
201
257
|
* FileTypeEnum converter
|
|
202
258
|
*/
|
|
@@ -270,6 +326,32 @@ static convert_t ApertureEnum = {
|
|
|
270
326
|
}
|
|
271
327
|
};
|
|
272
328
|
|
|
329
|
+
/**
|
|
330
|
+
* BluetoothPowerEnum converter
|
|
331
|
+
*/
|
|
332
|
+
static convert_t BluetoothPowerEnum = {
|
|
333
|
+
.toTheta = @{
|
|
334
|
+
@"ON": THETACThetaRepositoryBluetoothPowerEnum.on,
|
|
335
|
+
@"OFF": THETACThetaRepositoryBluetoothPowerEnum.off
|
|
336
|
+
},
|
|
337
|
+
.fromTheta = @{
|
|
338
|
+
THETACThetaRepositoryBluetoothPowerEnum.on: @"ON",
|
|
339
|
+
THETACThetaRepositoryBluetoothPowerEnum.off: @"OFF"
|
|
340
|
+
},
|
|
341
|
+
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
342
|
+
id val = [BluetoothPowerEnum.toTheta objectForKey:[rct objectForKey:@"bluetoothPower"]];
|
|
343
|
+
if (val) {
|
|
344
|
+
opt.bluetoothPower = val;
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
348
|
+
id val = [BluetoothPowerEnum.fromTheta objectForKey:opt.bluetoothPower];
|
|
349
|
+
if (val) {
|
|
350
|
+
[rct setObject:val forKey:@"bluetoothPower"];
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
|
|
273
355
|
/**
|
|
274
356
|
* CaptureModeEnum converter
|
|
275
357
|
*/
|
|
@@ -301,34 +383,34 @@ static convert_t CaptureModeEnum = {
|
|
|
301
383
|
*/
|
|
302
384
|
static convert_t ExposureCompensationEnum = {
|
|
303
385
|
.toTheta = @{
|
|
304
|
-
@"
|
|
305
|
-
@"
|
|
306
|
-
@"
|
|
307
|
-
@"
|
|
308
|
-
@"
|
|
309
|
-
@"
|
|
386
|
+
@"M2_0": THETACThetaRepositoryExposureCompensationEnum.m20,
|
|
387
|
+
@"M1_7": THETACThetaRepositoryExposureCompensationEnum.m17,
|
|
388
|
+
@"M1_3": THETACThetaRepositoryExposureCompensationEnum.m13,
|
|
389
|
+
@"M1_0": THETACThetaRepositoryExposureCompensationEnum.m10,
|
|
390
|
+
@"M0_7": THETACThetaRepositoryExposureCompensationEnum.m07,
|
|
391
|
+
@"M0_3": THETACThetaRepositoryExposureCompensationEnum.m03,
|
|
310
392
|
@"ZERO": THETACThetaRepositoryExposureCompensationEnum.zero,
|
|
311
|
-
@"
|
|
312
|
-
@"
|
|
313
|
-
@"
|
|
314
|
-
@"
|
|
315
|
-
@"
|
|
316
|
-
@"
|
|
393
|
+
@"P0_3": THETACThetaRepositoryExposureCompensationEnum.p03,
|
|
394
|
+
@"P0_7": THETACThetaRepositoryExposureCompensationEnum.p07,
|
|
395
|
+
@"P1_0": THETACThetaRepositoryExposureCompensationEnum.p10,
|
|
396
|
+
@"P1_3": THETACThetaRepositoryExposureCompensationEnum.p13,
|
|
397
|
+
@"P1_7": THETACThetaRepositoryExposureCompensationEnum.p17,
|
|
398
|
+
@"P2_0": THETACThetaRepositoryExposureCompensationEnum.p20
|
|
317
399
|
},
|
|
318
400
|
.fromTheta = @{
|
|
319
|
-
THETACThetaRepositoryExposureCompensationEnum.m20: @"
|
|
320
|
-
THETACThetaRepositoryExposureCompensationEnum.m17: @"
|
|
321
|
-
THETACThetaRepositoryExposureCompensationEnum.m13: @"
|
|
322
|
-
THETACThetaRepositoryExposureCompensationEnum.m10: @"
|
|
323
|
-
THETACThetaRepositoryExposureCompensationEnum.m07: @"
|
|
324
|
-
THETACThetaRepositoryExposureCompensationEnum.m03: @"
|
|
401
|
+
THETACThetaRepositoryExposureCompensationEnum.m20: @"M2_0",
|
|
402
|
+
THETACThetaRepositoryExposureCompensationEnum.m17: @"M1_7",
|
|
403
|
+
THETACThetaRepositoryExposureCompensationEnum.m13: @"M1_3",
|
|
404
|
+
THETACThetaRepositoryExposureCompensationEnum.m10: @"M1_0",
|
|
405
|
+
THETACThetaRepositoryExposureCompensationEnum.m07: @"M0_7",
|
|
406
|
+
THETACThetaRepositoryExposureCompensationEnum.m03: @"M0_3",
|
|
325
407
|
THETACThetaRepositoryExposureCompensationEnum.zero: @"ZERO",
|
|
326
|
-
THETACThetaRepositoryExposureCompensationEnum.p03: @"
|
|
327
|
-
THETACThetaRepositoryExposureCompensationEnum.p07: @"
|
|
328
|
-
THETACThetaRepositoryExposureCompensationEnum.p10: @"
|
|
329
|
-
THETACThetaRepositoryExposureCompensationEnum.p13: @"
|
|
330
|
-
THETACThetaRepositoryExposureCompensationEnum.p17: @"
|
|
331
|
-
THETACThetaRepositoryExposureCompensationEnum.p20: @"
|
|
408
|
+
THETACThetaRepositoryExposureCompensationEnum.p03: @"P0_3",
|
|
409
|
+
THETACThetaRepositoryExposureCompensationEnum.p07: @"P0_7",
|
|
410
|
+
THETACThetaRepositoryExposureCompensationEnum.p10: @"P1_0",
|
|
411
|
+
THETACThetaRepositoryExposureCompensationEnum.p13: @"P1_3",
|
|
412
|
+
THETACThetaRepositoryExposureCompensationEnum.p17: @"P1_7",
|
|
413
|
+
THETACThetaRepositoryExposureCompensationEnum.p20: @"P2_0",
|
|
332
414
|
},
|
|
333
415
|
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
334
416
|
id val = [ExposureCompensationEnum.toTheta
|
|
@@ -971,6 +1053,33 @@ static convert_t WhiteBalanceEnum = {
|
|
|
971
1053
|
}
|
|
972
1054
|
};
|
|
973
1055
|
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* WhiteBalanceAutoStrengthEnum converter
|
|
1059
|
+
*/
|
|
1060
|
+
static convert_t WhiteBalanceAutoStrengthEnum = {
|
|
1061
|
+
.toTheta = @{
|
|
1062
|
+
@"ON": THETACThetaRepositoryWhiteBalanceAutoStrengthEnum.on,
|
|
1063
|
+
@"OFF": THETACThetaRepositoryWhiteBalanceAutoStrengthEnum.off
|
|
1064
|
+
},
|
|
1065
|
+
.fromTheta = @{
|
|
1066
|
+
THETACThetaRepositoryWhiteBalanceAutoStrengthEnum.on: @"ON",
|
|
1067
|
+
THETACThetaRepositoryWhiteBalanceAutoStrengthEnum.off: @"OFF"
|
|
1068
|
+
},
|
|
1069
|
+
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1070
|
+
id val = [WhiteBalanceAutoStrengthEnum.toTheta objectForKey:[rct objectForKey:@"whiteBalanceAutoStrength"]];
|
|
1071
|
+
if (val) {
|
|
1072
|
+
opt.whiteBalanceAutoStrength = val;
|
|
1073
|
+
}
|
|
1074
|
+
},
|
|
1075
|
+
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1076
|
+
id val = [WhiteBalanceAutoStrengthEnum.fromTheta objectForKey:opt.whiteBalanceAutoStrength];
|
|
1077
|
+
if (val) {
|
|
1078
|
+
[rct setObject:val forKey:@"whiteBalanceAutoStrength"];
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
};
|
|
1082
|
+
|
|
974
1083
|
/**
|
|
975
1084
|
* ColorTemperature converter
|
|
976
1085
|
*/
|
|
@@ -978,11 +1087,13 @@ static convert_t ColorTemperatureCvt = {
|
|
|
978
1087
|
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
979
1088
|
NSNumber* val = [rct objectForKey:@"colorTemperature"];
|
|
980
1089
|
if (val) {
|
|
981
|
-
opt.colorTemperature =
|
|
1090
|
+
opt.colorTemperature = [THETACInt numberWithInt:[val intValue]];
|
|
982
1091
|
}
|
|
983
1092
|
},
|
|
984
1093
|
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
985
|
-
|
|
1094
|
+
if (opt.colorTemperature) {
|
|
1095
|
+
[rct setObject:opt.colorTemperature forKey:@"colorTemperature"];
|
|
1096
|
+
}
|
|
986
1097
|
},
|
|
987
1098
|
.setPhotoOption = ^(NSDictionary* rct, THETACPhotoCaptureBuilder *builder) {
|
|
988
1099
|
NSNumber *val = (NSNumber*) [rct objectForKey:@"colorTemperature"];
|
|
@@ -1022,7 +1133,7 @@ static convert_t IsGpsOnCvt = {
|
|
|
1022
1133
|
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1023
1134
|
NSNumber* val = [rct objectForKey:@"isGpsOn"];
|
|
1024
1135
|
if (val) {
|
|
1025
|
-
opt.isGpsOn =
|
|
1136
|
+
opt.isGpsOn = [THETACBoolean numberWithBool:[val boolValue]];
|
|
1026
1137
|
}
|
|
1027
1138
|
},
|
|
1028
1139
|
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
@@ -1081,7 +1192,7 @@ static convert_t RemainingPicturesCvt = {
|
|
|
1081
1192
|
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1082
1193
|
NSNumber* val = [rct objectForKey:@"remainingPictures"];
|
|
1083
1194
|
if (val) {
|
|
1084
|
-
opt.remainingPictures =
|
|
1195
|
+
opt.remainingPictures = [THETACInt numberWithInt:[val intValue]];
|
|
1085
1196
|
}
|
|
1086
1197
|
},
|
|
1087
1198
|
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
@@ -1098,7 +1209,7 @@ static convert_t RemainingVideoSecondsCvt = {
|
|
|
1098
1209
|
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1099
1210
|
NSNumber* val = [rct objectForKey:@"remainingVideoSeconds"];
|
|
1100
1211
|
if (val) {
|
|
1101
|
-
opt.remainingVideoSeconds =
|
|
1212
|
+
opt.remainingVideoSeconds = [THETACInt numberWithInt:[val intValue]];
|
|
1102
1213
|
}
|
|
1103
1214
|
},
|
|
1104
1215
|
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
@@ -1115,7 +1226,7 @@ static convert_t RemainingSpaceCvt = {
|
|
|
1115
1226
|
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1116
1227
|
NSNumber* val = [rct objectForKey:@"remainingSpace"];
|
|
1117
1228
|
if (val) {
|
|
1118
|
-
opt.remainingSpace =
|
|
1229
|
+
opt.remainingSpace = [THETACLong numberWithLongLong:[val longLongValue]];
|
|
1119
1230
|
}
|
|
1120
1231
|
},
|
|
1121
1232
|
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
@@ -1132,7 +1243,7 @@ static convert_t TotalSpaceCvt = {
|
|
|
1132
1243
|
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1133
1244
|
NSNumber* val = [rct objectForKey:@"totalSpace"];
|
|
1134
1245
|
if (val) {
|
|
1135
|
-
opt.totalSpace =
|
|
1246
|
+
opt.totalSpace = [THETACLong numberWithLongLong:[val longLongValue]];
|
|
1136
1247
|
}
|
|
1137
1248
|
},
|
|
1138
1249
|
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
@@ -1149,7 +1260,7 @@ static convert_t ShutterVolumeCvt = {
|
|
|
1149
1260
|
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1150
1261
|
NSNumber* val = [rct objectForKey:@"shutterVolume"];
|
|
1151
1262
|
if (val) {
|
|
1152
|
-
opt.shutterVolume =
|
|
1263
|
+
opt.shutterVolume = [THETACInt numberWithInt:[val intValue]];
|
|
1153
1264
|
}
|
|
1154
1265
|
},
|
|
1155
1266
|
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
@@ -1193,6 +1304,7 @@ static convert_t GpsInfoCvt = {
|
|
|
1193
1304
|
*/
|
|
1194
1305
|
static NSDictionary *NameToOptionEnum = @{
|
|
1195
1306
|
@"Aperture": THETACThetaRepositoryOptionNameEnum.aperture,
|
|
1307
|
+
@"BluetoothPower": THETACThetaRepositoryOptionNameEnum.bluetoothpower,
|
|
1196
1308
|
@"CaptureMode": THETACThetaRepositoryOptionNameEnum.capturemode,
|
|
1197
1309
|
@"ColorTemperature": THETACThetaRepositoryOptionNameEnum.colortemperature,
|
|
1198
1310
|
@"DateTimeZone": THETACThetaRepositoryOptionNameEnum.datetimezone,
|
|
@@ -1214,7 +1326,8 @@ static NSDictionary *NameToOptionEnum = @{
|
|
|
1214
1326
|
@"RemainingSpace": THETACThetaRepositoryOptionNameEnum.remainingspace,
|
|
1215
1327
|
@"TotalSpace": THETACThetaRepositoryOptionNameEnum.totalspace,
|
|
1216
1328
|
@"ShutterVolume": THETACThetaRepositoryOptionNameEnum.shuttervolume,
|
|
1217
|
-
@"WhiteBalance": THETACThetaRepositoryOptionNameEnum.whitebalance
|
|
1329
|
+
@"WhiteBalance": THETACThetaRepositoryOptionNameEnum.whitebalance,
|
|
1330
|
+
@"WhiteBalanceAutoStrength": THETACThetaRepositoryOptionNameEnum.whitebalanceautostrength
|
|
1218
1331
|
};
|
|
1219
1332
|
|
|
1220
1333
|
/**
|
|
@@ -1222,6 +1335,7 @@ static NSDictionary *NameToOptionEnum = @{
|
|
|
1222
1335
|
*/
|
|
1223
1336
|
static NSDictionary *OptionEnumToOption = @{
|
|
1224
1337
|
@"Aperture": @"aperture",
|
|
1338
|
+
@"BluetoothPower": @"bluetoothPower",
|
|
1225
1339
|
@"CaptureMode": @"captureMode",
|
|
1226
1340
|
@"ColorTemperature": @"colorTemperature",
|
|
1227
1341
|
@"DateTimeZone": @"dateTimeZone",
|
|
@@ -1243,7 +1357,8 @@ static NSDictionary *OptionEnumToOption = @{
|
|
|
1243
1357
|
@"RemainingSpace": @"remainingSpace",
|
|
1244
1358
|
@"TotalSpace": @"totalSpace",
|
|
1245
1359
|
@"ShutterVolume": @"shutterVolume",
|
|
1246
|
-
@"WhiteBalance": @"whiteBalance"
|
|
1360
|
+
@"WhiteBalance": @"whiteBalance",
|
|
1361
|
+
@"WhiteBalanceAutoStrength": @"whiteBalanceAutoStrength"
|
|
1247
1362
|
};
|
|
1248
1363
|
|
|
1249
1364
|
/** Option converter builder */
|
|
@@ -1254,6 +1369,7 @@ typedef convert_t * (^OptionConverter)();
|
|
|
1254
1369
|
*/
|
|
1255
1370
|
static NSDictionary<NSString*, OptionConverter> *NameToConverter = @{
|
|
1256
1371
|
@"aperture": ^{return &ApertureEnum;},
|
|
1372
|
+
@"bluetoothPower": ^{return &BluetoothPowerEnum;},
|
|
1257
1373
|
@"captureMode": ^{return &CaptureModeEnum;},
|
|
1258
1374
|
@"colorTemperature": ^{return &ColorTemperatureCvt;},
|
|
1259
1375
|
@"dateTimeZone": ^{return &DateTimeZoneCvt;},
|
|
@@ -1276,7 +1392,8 @@ static NSDictionary<NSString*, OptionConverter> *NameToConverter = @{
|
|
|
1276
1392
|
@"totalSpace": ^{return &TotalSpaceCvt;},
|
|
1277
1393
|
@"shutterVolume": ^{return &ShutterVolumeCvt;},
|
|
1278
1394
|
@"whiteBalance": ^{return &WhiteBalanceEnum;},
|
|
1279
|
-
@"_gpsTagRecording": ^{return &GpsTagRecordingEnum;}
|
|
1395
|
+
@"_gpsTagRecording": ^{return &GpsTagRecordingEnum;},
|
|
1396
|
+
@"whiteBalanceAutoStrength": ^{return &WhiteBalanceAutoStrengthEnum;}
|
|
1280
1397
|
};
|
|
1281
1398
|
|
|
1282
1399
|
static NSString *EVENT_NAME = @"ThetaFrameEvent";
|
|
@@ -1379,19 +1496,33 @@ RCT_REMAP_METHOD(getThetaInfo,
|
|
|
1379
1496
|
{
|
|
1380
1497
|
[_theta getThetaInfoWithCompletionHandler:^(THETACThetaRepositoryThetaInfo *info,
|
|
1381
1498
|
NSError *error) {
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
@"hasGps":@(info.hasGps),
|
|
1389
|
-
@"hasGyro":@(info.hasGyro),
|
|
1390
|
-
@"uptime":@(info.uptime)});
|
|
1391
|
-
} else {
|
|
1392
|
-
reject(@"error", @"no info", nil);
|
|
1499
|
+
if (error) {
|
|
1500
|
+
reject(@"error", [error localizedDescription], error);
|
|
1501
|
+
} else if (info) {
|
|
1502
|
+
NSMutableArray *apiLevelList = [[NSMutableArray alloc] init];
|
|
1503
|
+
for (THETACInt *element in info.apiLevel) {
|
|
1504
|
+
[apiLevelList addObject:@([element intValue])];
|
|
1393
1505
|
}
|
|
1394
|
-
|
|
1506
|
+
resolve(@{@"manufacturer": info.manufacturer,
|
|
1507
|
+
@"model": info.model,
|
|
1508
|
+
@"serialNumber": info.serialNumber,
|
|
1509
|
+
@"wlanMacAddress": info.wlanMacAddress != nil ? info.wlanMacAddress : [NSNull null],
|
|
1510
|
+
@"bluetoothMacAddress": info.bluetoothMacAddress != nil ? info.bluetoothMacAddress : [NSNull null],
|
|
1511
|
+
@"firmwareVersion": info.firmwareVersion,
|
|
1512
|
+
@"supportUrl": info.supportUrl,
|
|
1513
|
+
@"hasGps": @(info.hasGps),
|
|
1514
|
+
@"hasGyro": @(info.hasGyro),
|
|
1515
|
+
@"uptime": @(info.uptime),
|
|
1516
|
+
@"api": info.api,
|
|
1517
|
+
@"endpoints": @{
|
|
1518
|
+
@"httpPort": @(info.endpoints.httpPort),
|
|
1519
|
+
@"httpUpdatesPort": @(info.endpoints.httpUpdatesPort),
|
|
1520
|
+
},
|
|
1521
|
+
@"apiLevel": apiLevelList});
|
|
1522
|
+
} else {
|
|
1523
|
+
reject(@"error", @"no info", nil);
|
|
1524
|
+
}
|
|
1525
|
+
}];
|
|
1395
1526
|
}
|
|
1396
1527
|
|
|
1397
1528
|
/**
|
|
@@ -1408,14 +1539,32 @@ RCT_REMAP_METHOD(getThetaState,
|
|
|
1408
1539
|
if (error) {
|
|
1409
1540
|
reject(@"error", [error localizedDescription], error);
|
|
1410
1541
|
} else if (state) {
|
|
1542
|
+
NSMutableArray *cameraErrorList = [[NSMutableArray alloc] init];
|
|
1543
|
+
if (state.cameraError != nil) {
|
|
1544
|
+
for (THETACThetaRepositoryCameraErrorEnum *element in state.cameraError) {
|
|
1545
|
+
[cameraErrorList addObject:[CameraErrorEnum.fromTheta objectForKey:element]];
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1411
1548
|
resolve(@{@"fingerprint": state.fingerprint,
|
|
1412
|
-
@"batteryLevel"
|
|
1413
|
-
@"
|
|
1414
|
-
|
|
1415
|
-
@"
|
|
1416
|
-
@"recordedTime"
|
|
1417
|
-
@"recordableTime"
|
|
1418
|
-
@"
|
|
1549
|
+
@"batteryLevel": @(state.batteryLevel),
|
|
1550
|
+
@"storageUri": state.storageUri != nil ? state.storageUri : [NSNull null],
|
|
1551
|
+
@"storageID": state.storageID != nil ? state.storageID : [NSNull null],
|
|
1552
|
+
@"captureStatus": [CaptureStatusEnum.fromTheta objectForKey:state.captureStatus],
|
|
1553
|
+
@"recordedTime": @(state.recordedTime),
|
|
1554
|
+
@"recordableTime": @(state.recordableTime),
|
|
1555
|
+
@"capturedPictures": state.capturedPictures != nil ? @([state.capturedPictures intValue]): [NSNull null],
|
|
1556
|
+
@"compositeShootingElapsedTime": state.compositeShootingElapsedTime != nil ? @([state.compositeShootingElapsedTime intValue]) : [NSNull null],
|
|
1557
|
+
@"latestFileUrl": state.latestFileUrl,
|
|
1558
|
+
@"chargingState": [ChargingStateEnum.fromTheta objectForKey:state.chargingState],
|
|
1559
|
+
@"apiVersion": @(state.apiVersion),
|
|
1560
|
+
@"isPluginRunning": state.isPluginRunning != nil ? @([state.isPluginRunning boolValue]) : [NSNull null],
|
|
1561
|
+
@"isPluginWebServer": state.isPluginWebServer != nil ? @([state.isPluginWebServer boolValue]) : [NSNull null],
|
|
1562
|
+
@"function": state.function != nil ? [ShootingFunctionEnum.fromTheta objectForKey:state.function] : [NSNull null],
|
|
1563
|
+
@"isMySettingChanged": state.isMySettingChanged != nil? @([state.isMySettingChanged boolValue]) : [NSNull null],
|
|
1564
|
+
@"currentMicrophone": state.currentMicrophone != nil ? [MicrophoneOptionEnum.fromTheta objectForKey:state.currentMicrophone] : [NSNull null],
|
|
1565
|
+
@"isSdCard": @(state.isSdCard),
|
|
1566
|
+
@"cameraError": state.cameraError != nil ? cameraErrorList : [NSNull null],
|
|
1567
|
+
@"isBatteryInsert": state.isBatteryInsert != nil ? @([state.isBatteryInsert boolValue]) : [NSNull null]});
|
|
1419
1568
|
} else {
|
|
1420
1569
|
reject(@"error", @"no state", nil);
|
|
1421
1570
|
}
|
|
@@ -1440,14 +1589,14 @@ RCT_REMAP_METHOD(listFiles,
|
|
|
1440
1589
|
[_theta listFilesFileType:[FileTypeEnum.toTheta objectForKey:fileType]
|
|
1441
1590
|
startPosition:startPosition
|
|
1442
1591
|
entryCount:entryCount
|
|
1443
|
-
completionHandler:^(
|
|
1592
|
+
completionHandler:^(THETACThetaRepositoryThetaFiles *items,
|
|
1444
1593
|
NSError *error) {
|
|
1445
1594
|
if (error) {
|
|
1446
1595
|
reject(@"error", [error localizedDescription], error);
|
|
1447
1596
|
} else if (items) {
|
|
1448
1597
|
NSMutableArray *ary = [[NSMutableArray alloc] init];
|
|
1449
|
-
for (int i = 0; i < items.count; i++) {
|
|
1450
|
-
THETACThetaRepositoryFileInfo *finfo = items[i];
|
|
1598
|
+
for (int i = 0; i < items.fileList.count; i++) {
|
|
1599
|
+
THETACThetaRepositoryFileInfo *finfo = items.fileList[i];
|
|
1451
1600
|
[ary addObject: @{
|
|
1452
1601
|
@"name":finfo.name,
|
|
1453
1602
|
@"size":@(finfo.size),
|
|
@@ -1456,7 +1605,8 @@ RCT_REMAP_METHOD(listFiles,
|
|
|
1456
1605
|
@"fileUrl":finfo.fileUrl
|
|
1457
1606
|
}];
|
|
1458
1607
|
}
|
|
1459
|
-
|
|
1608
|
+
resolve(@{@"fileList":ary,
|
|
1609
|
+
@"totalEntries": @(items.totalEntries)});
|
|
1460
1610
|
} else {
|
|
1461
1611
|
reject(@"error", @"no items", nil);
|
|
1462
1612
|
}
|
|
@@ -1585,18 +1735,21 @@ RCT_REMAP_METHOD(setOptions,
|
|
|
1585
1735
|
{
|
|
1586
1736
|
THETACThetaRepositoryOptions *newoptions = [[THETACThetaRepositoryOptions alloc] init];
|
|
1587
1737
|
for (id option in [options allKeys]) {
|
|
1588
|
-
|
|
1589
|
-
if (
|
|
1590
|
-
convert
|
|
1738
|
+
OptionConverter converter = [NameToConverter objectForKey:option];
|
|
1739
|
+
if (converter) {
|
|
1740
|
+
convert_t *convert = converter();
|
|
1741
|
+
if (convert && convert->setToTheta) {
|
|
1742
|
+
convert->setToTheta(options, newoptions);
|
|
1743
|
+
}
|
|
1591
1744
|
}
|
|
1592
1745
|
}
|
|
1593
1746
|
[_theta setOptionsOptions:newoptions completionHandler:^(NSError *error) {
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1747
|
+
if (error) {
|
|
1748
|
+
reject(@"error", [error localizedDescription], error);
|
|
1749
|
+
} else {
|
|
1750
|
+
resolve(@(YES));
|
|
1751
|
+
}
|
|
1752
|
+
}];
|
|
1600
1753
|
}
|
|
1601
1754
|
|
|
1602
1755
|
/**
|
|
@@ -2093,6 +2246,338 @@ RCT_REMAP_METHOD(deleteAccessPoint,
|
|
|
2093
2246
|
}];
|
|
2094
2247
|
}
|
|
2095
2248
|
|
|
2249
|
+
/**
|
|
2250
|
+
* convertOptionsFromTheta - convert resposnse of getMySetting
|
|
2251
|
+
* @param results conversion results
|
|
2252
|
+
* @param options response of getMySetting
|
|
2253
|
+
* @return error during conversion
|
|
2254
|
+
*/
|
|
2255
|
+
static NSError* convertOptionsFromTheta(NSMutableDictionary* results, THETACThetaRepositoryOptions* options)
|
|
2256
|
+
{
|
|
2257
|
+
THETACKotlinArray<THETACThetaRepositoryOptionNameEnum *>* optionNames = THETACThetaRepositoryOptionNameEnum.values;
|
|
2258
|
+
for (int i = 0; i < optionNames.size; i++) {
|
|
2259
|
+
THETACThetaRepositoryOptionNameEnum* optionName = [optionNames getIndex:i];
|
|
2260
|
+
NSError* error = nil;
|
|
2261
|
+
id value = [options getValueName:optionName error:&error];
|
|
2262
|
+
if (error) {
|
|
2263
|
+
return error;
|
|
2264
|
+
}
|
|
2265
|
+
if (value != nil) {
|
|
2266
|
+
NSString* name = [OptionEnumToOption objectForKey:optionName.name];
|
|
2267
|
+
convert_t *convert = [NameToConverter objectForKey:name]();
|
|
2268
|
+
if (convert && convert->setFromTheta) {
|
|
2269
|
+
convert->setFromTheta(results, options);
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
return nil;
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2276
|
+
/**
|
|
2277
|
+
* getMySetting - acquires the shooting properties ( just for Theta V and later )
|
|
2278
|
+
* @param captureMode the target shooting mode
|
|
2279
|
+
* @param resolve resolver for getMySetting
|
|
2280
|
+
* @param rejecter rejecter for getMySetting
|
|
2281
|
+
*/
|
|
2282
|
+
RCT_REMAP_METHOD(getMySetting,
|
|
2283
|
+
getMySettingWithCaptureMode:(NSString *)captureMode
|
|
2284
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
2285
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2286
|
+
{
|
|
2287
|
+
[_theta getMySettingCaptureMode:[CaptureModeEnum.toTheta objectForKey:captureMode]
|
|
2288
|
+
completionHandler:^(THETACThetaRepositoryOptions *options, NSError *error) {
|
|
2289
|
+
if (error) {
|
|
2290
|
+
reject(@"error", [error localizedDescription], error);
|
|
2291
|
+
} else if (options) {
|
|
2292
|
+
NSMutableDictionary *results = [[NSMutableDictionary alloc] init];
|
|
2293
|
+
NSError *convertError = convertOptionsFromTheta(results, options);
|
|
2294
|
+
if (convertError) {
|
|
2295
|
+
reject(@"error", [error localizedDescription], convertError);
|
|
2296
|
+
}
|
|
2297
|
+
resolve(results);
|
|
2298
|
+
} else {
|
|
2299
|
+
reject(@"error", @"no options", nil);
|
|
2300
|
+
}
|
|
2301
|
+
}];
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2304
|
+
/**
|
|
2305
|
+
* getMySetting - acquires the shooting properties ( just for Theta S and SC )
|
|
2306
|
+
* @param optionNames list of option names to acquire
|
|
2307
|
+
* @param resolve resolver for getMySetting
|
|
2308
|
+
* @param rejecter rejecter for getMySetting
|
|
2309
|
+
*/
|
|
2310
|
+
RCT_REMAP_METHOD(getMySettingFromOldModel,
|
|
2311
|
+
getMySettingWithOptionNames:(NSArray*)optionNames
|
|
2312
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
2313
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2314
|
+
{
|
|
2315
|
+
NSMutableArray *optionNameList = [[NSMutableArray alloc] init];
|
|
2316
|
+
for (id name in optionNames) {
|
|
2317
|
+
[optionNameList addObject:[NameToOptionEnum objectForKey:name]];
|
|
2318
|
+
}
|
|
2319
|
+
[_theta getMySettingOptionNames:optionNameList
|
|
2320
|
+
completionHandler:^(THETACThetaRepositoryOptions *options, NSError *error) {
|
|
2321
|
+
if (error) {
|
|
2322
|
+
reject(@"error", [error localizedDescription], error);
|
|
2323
|
+
} else if (options) {
|
|
2324
|
+
NSMutableDictionary *results = [[NSMutableDictionary alloc] init];
|
|
2325
|
+
for (id name in optionNames) {
|
|
2326
|
+
id option = [OptionEnumToOption objectForKey:name];
|
|
2327
|
+
OptionConverter converter = [NameToConverter objectForKey:option];
|
|
2328
|
+
if (converter) {
|
|
2329
|
+
convert_t *convert = converter();
|
|
2330
|
+
if (convert && convert->setFromTheta) {
|
|
2331
|
+
convert->setFromTheta(results, options);
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
resolve(results);
|
|
2336
|
+
} else {
|
|
2337
|
+
reject(@"error", @"no options", nil);
|
|
2338
|
+
}
|
|
2339
|
+
}];
|
|
2340
|
+
}
|
|
2341
|
+
|
|
2342
|
+
/**
|
|
2343
|
+
* setMySetting - registers shooting conditions in My Settings
|
|
2344
|
+
* @param captureMode the target shooting mode. RICOH THETA S and SC do not support My Settings in video capture mode
|
|
2345
|
+
* @param options registered to My Settings
|
|
2346
|
+
* @param resolve resolver for setMySetting
|
|
2347
|
+
* @param rejecter rejecter for setMySetting
|
|
2348
|
+
*/
|
|
2349
|
+
RCT_REMAP_METHOD(setMySetting,
|
|
2350
|
+
setMySettingWithCaptureMode:(NSString *)captureMode
|
|
2351
|
+
setMySettingWithOptions:(NSDictionary*)options
|
|
2352
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
2353
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2354
|
+
{
|
|
2355
|
+
THETACThetaRepositoryOptions *newoptions = [[THETACThetaRepositoryOptions alloc] init];
|
|
2356
|
+
for (id option in [options allKeys]) {
|
|
2357
|
+
OptionConverter converter = [NameToConverter objectForKey:option];
|
|
2358
|
+
if (converter) {
|
|
2359
|
+
convert_t *convert = converter();
|
|
2360
|
+
if (convert && convert->setToTheta) {
|
|
2361
|
+
convert->setToTheta(options, newoptions);
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
[_theta setMySettingCaptureMode:[CaptureModeEnum.toTheta objectForKey:captureMode]
|
|
2366
|
+
options:newoptions
|
|
2367
|
+
completionHandler:^(NSError *error) {
|
|
2368
|
+
if (error) {
|
|
2369
|
+
reject(@"error", [error localizedDescription], error);
|
|
2370
|
+
} else {
|
|
2371
|
+
resolve(@(YES));
|
|
2372
|
+
}
|
|
2373
|
+
}];
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2376
|
+
/**
|
|
2377
|
+
* deleteMySetting - delete shooting conditions in My Settings
|
|
2378
|
+
* @param captureMode the target shooting mode
|
|
2379
|
+
* @param resolve resolver for deleteMySetting
|
|
2380
|
+
* @param rejecter rejecter for deleteMySetting
|
|
2381
|
+
*/
|
|
2382
|
+
RCT_REMAP_METHOD(deleteMySetting,
|
|
2383
|
+
deleteMySettingWithCaptureMode:(NSString *)captureMode
|
|
2384
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
2385
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2386
|
+
{
|
|
2387
|
+
[_theta deleteMySettingCaptureMode:[CaptureModeEnum.toTheta objectForKey:captureMode]
|
|
2388
|
+
completionHandler:^(NSError *error) {
|
|
2389
|
+
if (error) {
|
|
2390
|
+
reject(@"error", [error localizedDescription], error);
|
|
2391
|
+
} else {
|
|
2392
|
+
resolve(@(YES));
|
|
2393
|
+
}
|
|
2394
|
+
}];
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
/**
|
|
2398
|
+
* listPlugins - acquires a list of installed plugins
|
|
2399
|
+
* @param resolve resolver for listPlugins
|
|
2400
|
+
* @param rejecter rejecter for listPlugins
|
|
2401
|
+
*/
|
|
2402
|
+
RCT_REMAP_METHOD(listPlugins,
|
|
2403
|
+
listPluginsWithResolver:(RCTPromiseResolveBlock)resolve
|
|
2404
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2405
|
+
{
|
|
2406
|
+
[_theta listPluginsWithCompletionHandler:^(NSArray *pluginList, NSError *error) {
|
|
2407
|
+
if (error) {
|
|
2408
|
+
reject(@"error", [error localizedDescription], error);
|
|
2409
|
+
} else if (pluginList) {
|
|
2410
|
+
NSMutableArray *ary = [[NSMutableArray alloc] init];
|
|
2411
|
+
for (int i = 0; i < pluginList.count; i++) {
|
|
2412
|
+
THETACThetaRepositoryPluginInfo *plugininfo = pluginList[i];
|
|
2413
|
+
[ary addObject: @{
|
|
2414
|
+
@"name": plugininfo.name,
|
|
2415
|
+
@"packageName": plugininfo.packageName,
|
|
2416
|
+
@"version": plugininfo.version,
|
|
2417
|
+
@"isPreInstalled": @(plugininfo.isPreInstalled),
|
|
2418
|
+
@"isRunning": @(plugininfo.isRunning),
|
|
2419
|
+
@"isForeground": @(plugininfo.isForeground),
|
|
2420
|
+
@"isBoot": @(plugininfo.isBoot),
|
|
2421
|
+
@"hasWebServer": @(plugininfo.hasWebServer),
|
|
2422
|
+
@"exitStatus": plugininfo.exitStatus,
|
|
2423
|
+
@"message": plugininfo.message
|
|
2424
|
+
}];
|
|
2425
|
+
}
|
|
2426
|
+
resolve(ary);
|
|
2427
|
+
} else {
|
|
2428
|
+
reject(@"error", @"no plugin", nil);
|
|
2429
|
+
}
|
|
2430
|
+
}];
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
/**
|
|
2434
|
+
* setPlugin - sets the installed plugin for boot
|
|
2435
|
+
* @param packageName package name of the target plugin
|
|
2436
|
+
* @param resolve resolver for setPlugin
|
|
2437
|
+
* @param rejecter rejecter for setPlugin
|
|
2438
|
+
*/
|
|
2439
|
+
RCT_REMAP_METHOD(setPlugin,
|
|
2440
|
+
setPluginPackageName:(NSString *)packageName
|
|
2441
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
2442
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2443
|
+
{
|
|
2444
|
+
[_theta setPluginPackageName:packageName
|
|
2445
|
+
completionHandler:^(NSError *error) {
|
|
2446
|
+
if (error) {
|
|
2447
|
+
reject(@"error", [error localizedDescription], error);
|
|
2448
|
+
} else {
|
|
2449
|
+
resolve(@(YES));
|
|
2450
|
+
}
|
|
2451
|
+
}];
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2454
|
+
/**
|
|
2455
|
+
* startPlugin - start the plugin specified by the packageName
|
|
2456
|
+
* @param packageName package name of the target plugin
|
|
2457
|
+
* @param resolve resolver for startPlugin
|
|
2458
|
+
* @param rejecter rejecter for startPlugin
|
|
2459
|
+
*/
|
|
2460
|
+
RCT_REMAP_METHOD(startPlugin,
|
|
2461
|
+
startPluginPackageName:(NSString *)packageName
|
|
2462
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
2463
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2464
|
+
{
|
|
2465
|
+
[_theta startPluginPackageName:packageName
|
|
2466
|
+
completionHandler:^(NSError *error) {
|
|
2467
|
+
if (error) {
|
|
2468
|
+
reject(@"error", [error localizedDescription], error);
|
|
2469
|
+
|
|
2470
|
+
} else {
|
|
2471
|
+
resolve(@(YES));
|
|
2472
|
+
}
|
|
2473
|
+
}];
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2476
|
+
/**
|
|
2477
|
+
* stopPlugin - stop the running plugin
|
|
2478
|
+
* @param resolve resolver for stopPlugin
|
|
2479
|
+
* @param rejecter rejecter for stopPlugin
|
|
2480
|
+
*/
|
|
2481
|
+
RCT_REMAP_METHOD(stopPlugin,
|
|
2482
|
+
stopPluginWithResolver:(RCTPromiseResolveBlock)resolve
|
|
2483
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2484
|
+
{
|
|
2485
|
+
[_theta stopPluginWithCompletionHandler:^(NSError *error) {
|
|
2486
|
+
if (error) {
|
|
2487
|
+
reject(@"error", [error localizedDescription], error);
|
|
2488
|
+
|
|
2489
|
+
} else {
|
|
2490
|
+
resolve(@(YES));
|
|
2491
|
+
}
|
|
2492
|
+
}];
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
/**
|
|
2496
|
+
* getPluginLicense - acquires the license for the installed plugin
|
|
2497
|
+
* @param packageName package name of the target plugin
|
|
2498
|
+
* @param resolve resolver for getPluginLicense
|
|
2499
|
+
* @param rejecter rejecter for getPluginLicense
|
|
2500
|
+
*/
|
|
2501
|
+
RCT_REMAP_METHOD(getPluginLicense,
|
|
2502
|
+
getPluginLicensePackageName:(NSString *)packageName
|
|
2503
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
2504
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2505
|
+
{
|
|
2506
|
+
[_theta getPluginLicensePackageName:packageName
|
|
2507
|
+
completionHandler:^(NSString *pluginLicense, NSError *error) {
|
|
2508
|
+
if (error) {
|
|
2509
|
+
reject(@"error", [error localizedDescription], error);
|
|
2510
|
+
|
|
2511
|
+
} else if (pluginLicense) {
|
|
2512
|
+
resolve(pluginLicense);
|
|
2513
|
+
} else {
|
|
2514
|
+
reject(@"error", @"no plugin lincense", nil);
|
|
2515
|
+
}
|
|
2516
|
+
}];
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
/**
|
|
2520
|
+
* getPluginOrders - return the plugin orders
|
|
2521
|
+
* @param resolve resolver for getPluginOrders
|
|
2522
|
+
* @param rejecter rejecter for getPluginOrders
|
|
2523
|
+
*/
|
|
2524
|
+
RCT_REMAP_METHOD(getPluginOrders,
|
|
2525
|
+
getPluginOrdersWithResolver:(RCTPromiseResolveBlock)resolve
|
|
2526
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2527
|
+
{
|
|
2528
|
+
[_theta getPluginOrdersWithCompletionHandler:^(NSArray *pluginOrders, NSError *error) {
|
|
2529
|
+
if (error) {
|
|
2530
|
+
reject(@"error", [error localizedDescription], error);
|
|
2531
|
+
} else if (pluginOrders) {
|
|
2532
|
+
resolve(pluginOrders);
|
|
2533
|
+
} else {
|
|
2534
|
+
reject(@"error", @"no plugin orders", nil);
|
|
2535
|
+
}
|
|
2536
|
+
}];
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
/**
|
|
2540
|
+
* setPluginOrders - sets the plugin orders
|
|
2541
|
+
* @param list of package names of plugins
|
|
2542
|
+
* @param resolve resolver for setPluginOrders
|
|
2543
|
+
* @param rejecter rejecter for setPluginOrders
|
|
2544
|
+
*/
|
|
2545
|
+
RCT_REMAP_METHOD(setPluginOrders,
|
|
2546
|
+
setPluginOrdersPlugins:(NSArray *) plugins
|
|
2547
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
2548
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2549
|
+
{
|
|
2550
|
+
[_theta setPluginOrdersPlugins:plugins
|
|
2551
|
+
completionHandler:^(NSError *error) {
|
|
2552
|
+
if (error) {
|
|
2553
|
+
reject(@"error", [error localizedDescription], error);
|
|
2554
|
+
} else {
|
|
2555
|
+
resolve(@(YES));
|
|
2556
|
+
}
|
|
2557
|
+
}];
|
|
2558
|
+
}
|
|
2559
|
+
|
|
2560
|
+
/**
|
|
2561
|
+
* setBluetoothDevice - register uuid of a BLE device
|
|
2562
|
+
* @param uuid uuid to set
|
|
2563
|
+
* @param resolve resolver for setAccessPointStaticcaly
|
|
2564
|
+
* @param rejecter rejecter for setAccessPointStaticcaly
|
|
2565
|
+
*/
|
|
2566
|
+
RCT_REMAP_METHOD(setBluetoothDevice,
|
|
2567
|
+
setBluetoothDeviceWithUuid:(NSString *)uuid
|
|
2568
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
2569
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2570
|
+
{
|
|
2571
|
+
[_theta setBluetoothDeviceUuid:uuid
|
|
2572
|
+
completionHandler:^(NSString *deviceName, NSError *error) {
|
|
2573
|
+
if (error) {
|
|
2574
|
+
reject(@"error", [error localizedDescription], error);
|
|
2575
|
+
} else {
|
|
2576
|
+
resolve(deviceName);
|
|
2577
|
+
}
|
|
2578
|
+
}];
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2096
2581
|
// Don't compile this code when we build for the old architecture.
|
|
2097
2582
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2098
2583
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|