theta-client-react-native 1.0.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/LICENSE +21 -0
- package/README.ja.md +64 -0
- package/README.md +66 -0
- package/android/build.gradle +149 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/Converter.kt +557 -0
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +774 -0
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkPackage.kt +17 -0
- package/ios/ThetaClientReactNative.h +28 -0
- package/ios/ThetaClientReactNative.mm +2105 -0
- package/ios/ThetaClientReactNative.xcodeproj/project.pbxproj +325 -0
- package/lib/commonjs/index.js +1061 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/index.js +1023 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/index.d.ts +975 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/package.json +154 -0
- package/src/index.tsx +1265 -0
- package/theta-client-react-native.podspec +36 -0
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
package com.ricoh360.thetaclientreactnative
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Arguments
|
|
4
|
+
import com.facebook.react.bridge.ReadableMap
|
|
5
|
+
import com.facebook.react.bridge.ReadableType
|
|
6
|
+
import com.facebook.react.bridge.WritableMap
|
|
7
|
+
import com.ricoh360.thetaclient.ThetaRepository
|
|
8
|
+
import com.ricoh360.thetaclient.capture.PhotoCapture
|
|
9
|
+
import com.ricoh360.thetaclient.capture.VideoCapture
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* convert option interface
|
|
13
|
+
*/
|
|
14
|
+
interface OptionConverter {
|
|
15
|
+
fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {}
|
|
16
|
+
fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {}
|
|
17
|
+
fun setPhotoOption(objects: ReadableMap, builder: PhotoCapture.Builder) {}
|
|
18
|
+
fun setVideoOption(objects: ReadableMap, builder: VideoCapture.Builder) {}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* ApertureConverter
|
|
23
|
+
*/
|
|
24
|
+
class ApertureConverter : OptionConverter {
|
|
25
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
26
|
+
objects.getString("aperture")?.let {
|
|
27
|
+
options.aperture = ThetaRepository.ApertureEnum.valueOf(it)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
32
|
+
options.aperture?.let {
|
|
33
|
+
objects.putString("aperture", it.toString())
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
override fun setPhotoOption(objects: ReadableMap, builder: PhotoCapture.Builder) {
|
|
38
|
+
objects.getString("aperture")?.let {
|
|
39
|
+
builder.setAperture(ThetaRepository.ApertureEnum.valueOf(it))
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
override fun setVideoOption(objects: ReadableMap, builder: VideoCapture.Builder) {
|
|
44
|
+
objects.getString("aperture")?.let {
|
|
45
|
+
builder.setAperture(ThetaRepository.ApertureEnum.valueOf(it))
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* CaptureModeConverter
|
|
52
|
+
*/
|
|
53
|
+
class CaptureModeConverter : OptionConverter {
|
|
54
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
55
|
+
objects.getString("captureMode")?.let {
|
|
56
|
+
options.captureMode = ThetaRepository.CaptureModeEnum.valueOf(it)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
61
|
+
options.captureMode?.let {
|
|
62
|
+
objects.putString("captureMode", it.toString())
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* ExposureCompensationConverter
|
|
69
|
+
*/
|
|
70
|
+
class ExposureCompensationConverter : OptionConverter {
|
|
71
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
72
|
+
objects.getString("exposureCompensation")?.let {
|
|
73
|
+
options.exposureCompensation = ThetaRepository.ExposureCompensationEnum.valueOf(it)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
78
|
+
options.exposureCompensation?.let {
|
|
79
|
+
objects.putString("exposureCompensation", it.toString())
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
override fun setPhotoOption(objects: ReadableMap, builder: PhotoCapture.Builder) {
|
|
84
|
+
objects.getString("exposureCompensation")?.let {
|
|
85
|
+
builder.setExposureCompensation(ThetaRepository.ExposureCompensationEnum.valueOf(it))
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
override fun setVideoOption(objects: ReadableMap, builder: VideoCapture.Builder) {
|
|
90
|
+
objects.getString("exposureCompensation")?.let {
|
|
91
|
+
builder.setExposureCompensation(ThetaRepository.ExposureCompensationEnum.valueOf(it))
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* ExposureDelayConverter
|
|
98
|
+
*/
|
|
99
|
+
class ExposureDelayConverter : OptionConverter {
|
|
100
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
101
|
+
objects.getString("exposureDelay")?.let {
|
|
102
|
+
options.exposureDelay = ThetaRepository.ExposureDelayEnum.valueOf(it)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
107
|
+
options.exposureDelay?.let {
|
|
108
|
+
objects.putString("exposureDelay", it.toString())
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
override fun setPhotoOption(objects: ReadableMap, builder: PhotoCapture.Builder) {
|
|
113
|
+
objects.getString("exposureDelay")?.let {
|
|
114
|
+
builder.setExposureDelay(ThetaRepository.ExposureDelayEnum.valueOf(it))
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
override fun setVideoOption(objects: ReadableMap, builder: VideoCapture.Builder) {
|
|
119
|
+
objects.getString("exposureDelay")?.let {
|
|
120
|
+
builder.setExposureDelay(ThetaRepository.ExposureDelayEnum.valueOf(it))
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* ExposureProgramConverter
|
|
127
|
+
*/
|
|
128
|
+
class ExposureProgramConverter : OptionConverter {
|
|
129
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
130
|
+
objects.getString("exposureProgram")?.let {
|
|
131
|
+
options.exposureProgram = ThetaRepository.ExposureProgramEnum.valueOf(it)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
136
|
+
options.exposureProgram?.let {
|
|
137
|
+
objects.putString("exposureProgram", it.toString())
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
override fun setPhotoOption(objects: ReadableMap, builder: PhotoCapture.Builder) {
|
|
142
|
+
objects.getString("exposureProgram")?.let {
|
|
143
|
+
builder.setExposureProgram(ThetaRepository.ExposureProgramEnum.valueOf(it))
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
override fun setVideoOption(objects: ReadableMap, builder: VideoCapture.Builder) {
|
|
148
|
+
objects.getString("exposureProgram")?.let {
|
|
149
|
+
builder.setExposureProgram(ThetaRepository.ExposureProgramEnum.valueOf(it))
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* FileFormatConverter
|
|
156
|
+
*/
|
|
157
|
+
class FileFormatConverter : OptionConverter {
|
|
158
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
159
|
+
objects.getString("fileFormat")?.let {
|
|
160
|
+
options.fileFormat = ThetaRepository.FileFormatEnum.valueOf(it)
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
165
|
+
options.fileFormat?.let {
|
|
166
|
+
objects.putString("fileFormat", it.toString())
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
override fun setPhotoOption(objects: ReadableMap, builder: PhotoCapture.Builder) {
|
|
171
|
+
objects.getString("fileFormat")?.let {
|
|
172
|
+
builder.setFileFormat(ThetaRepository.PhotoFileFormatEnum.valueOf(it))
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
override fun setVideoOption(objects: ReadableMap, builder: VideoCapture.Builder) {
|
|
177
|
+
objects.getString("fileFormat")?.let {
|
|
178
|
+
builder.setFileFormat(ThetaRepository.VideoFileFormatEnum.valueOf(it))
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* FilterConverter
|
|
185
|
+
*/
|
|
186
|
+
class FilterConverter : OptionConverter {
|
|
187
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
188
|
+
objects.getString("filter")?.let {
|
|
189
|
+
options.filter = ThetaRepository.FilterEnum.valueOf(it)
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
194
|
+
options.filter?.let {
|
|
195
|
+
objects.putString("filter", it.toString())
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
override fun setPhotoOption(objects: ReadableMap, builder: PhotoCapture.Builder) {
|
|
200
|
+
objects.getString("filter")?.let {
|
|
201
|
+
builder.setFilter(ThetaRepository.FilterEnum.valueOf(it))
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* GpsTagRecordingConverter
|
|
208
|
+
*/
|
|
209
|
+
class GpsTagRecordingConverter : OptionConverter {
|
|
210
|
+
override fun setPhotoOption(objects: ReadableMap, builder: PhotoCapture.Builder) {
|
|
211
|
+
objects.getString("gpsTagRecording")?.let {
|
|
212
|
+
builder.setGpsTagRecording(ThetaRepository.GpsTagRecordingEnum.valueOf(it))
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
override fun setVideoOption(objects: ReadableMap, builder: VideoCapture.Builder) {
|
|
217
|
+
objects.getString("gpsTagRecording")?.let {
|
|
218
|
+
builder.setGpsTagRecording(ThetaRepository.GpsTagRecordingEnum.valueOf(it))
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* IsoConverter
|
|
225
|
+
*/
|
|
226
|
+
class IsoConverter : OptionConverter {
|
|
227
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
228
|
+
objects.getString("iso")?.let {
|
|
229
|
+
options.iso = ThetaRepository.IsoEnum.valueOf(it)
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
234
|
+
options.iso?.let {
|
|
235
|
+
objects.putString("iso", it.toString())
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
override fun setPhotoOption(objects: ReadableMap, builder: PhotoCapture.Builder) {
|
|
240
|
+
objects.getString("iso")?.let {
|
|
241
|
+
builder.setIso(ThetaRepository.IsoEnum.valueOf(it))
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
override fun setVideoOption(objects: ReadableMap, builder: VideoCapture.Builder) {
|
|
246
|
+
objects.getString("iso")?.let {
|
|
247
|
+
builder.setIso(ThetaRepository.IsoEnum.valueOf(it))
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* IsoAutoHighLimitConverter
|
|
254
|
+
*/
|
|
255
|
+
class IsoAutoHighLimitConverter : OptionConverter {
|
|
256
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
257
|
+
objects.getString("isoAutoHighLimit")?.let {
|
|
258
|
+
options.isoAutoHighLimit = ThetaRepository.IsoAutoHighLimitEnum.valueOf(it)
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
263
|
+
options.isoAutoHighLimit?.let {
|
|
264
|
+
objects.putString("isoAutoHighLimit", it.toString())
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
override fun setPhotoOption(objects: ReadableMap, builder: PhotoCapture.Builder) {
|
|
269
|
+
objects.getString("isoAutoHighLimit")?.let {
|
|
270
|
+
builder.setIsoAutoHighLimit(ThetaRepository.IsoAutoHighLimitEnum.valueOf(it))
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
override fun setVideoOption(objects: ReadableMap, builder: VideoCapture.Builder) {
|
|
275
|
+
objects.getString("isoAutoHighLimit")?.let {
|
|
276
|
+
builder.setIsoAutoHighLimit(ThetaRepository.IsoAutoHighLimitEnum.valueOf(it))
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* LanguageConverter
|
|
283
|
+
*/
|
|
284
|
+
class LanguageConverter : OptionConverter {
|
|
285
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
286
|
+
objects.getString("language")?.let {
|
|
287
|
+
options.language = ThetaRepository.LanguageEnum.valueOf(it)
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
292
|
+
options.language?.let {
|
|
293
|
+
objects.putString("language", it.toString())
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* MaxRecordableTimeConverter
|
|
300
|
+
*/
|
|
301
|
+
class MaxRecordableTimeConverter : OptionConverter {
|
|
302
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
303
|
+
objects.getString("maxRecordableTime")?.let {
|
|
304
|
+
options.maxRecordableTime = ThetaRepository.MaxRecordableTimeEnum.valueOf(it)
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
309
|
+
options.maxRecordableTime?.let {
|
|
310
|
+
objects.putString("maxRecordableTime", it.toString())
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
override fun setVideoOption(objects: ReadableMap, builder: VideoCapture.Builder) {
|
|
315
|
+
objects.getString("maxRecordableTime")?.let {
|
|
316
|
+
builder.setMaxRecordableTime(ThetaRepository.MaxRecordableTimeEnum.valueOf(it))
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* OffDelayConverter
|
|
323
|
+
*/
|
|
324
|
+
class OffDelayConverter : OptionConverter {
|
|
325
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
326
|
+
val type = objects.getType("offDelay")
|
|
327
|
+
if (type == ReadableType.Number) {
|
|
328
|
+
options.offDelay = ThetaRepository.OffDelaySec(objects.getInt("offDelay"));
|
|
329
|
+
} else if (type == ReadableType.String) {
|
|
330
|
+
objects.getString("offDelay")?.let {
|
|
331
|
+
options.offDelay = ThetaRepository.OffDelayEnum.valueOf(it)
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
337
|
+
options.offDelay?.let {
|
|
338
|
+
if (it is ThetaRepository.OffDelayEnum) {
|
|
339
|
+
objects.putString("offDelay", it.toString())
|
|
340
|
+
} else if (it is ThetaRepository.OffDelaySec) {
|
|
341
|
+
objects.putInt("offDelay", it.sec)
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* WhiteBalanceConverter
|
|
349
|
+
*/
|
|
350
|
+
class WhiteBalanceConverter : OptionConverter {
|
|
351
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
352
|
+
objects.getString("whiteBalance")?.let {
|
|
353
|
+
options.whiteBalance = ThetaRepository.WhiteBalanceEnum.valueOf(it)
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
358
|
+
options.whiteBalance?.let {
|
|
359
|
+
objects.putString("whiteBalance", it.toString())
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
override fun setPhotoOption(objects: ReadableMap, builder: PhotoCapture.Builder) {
|
|
364
|
+
objects.getString("whiteBalance")?.let {
|
|
365
|
+
builder.setWhiteBalance(ThetaRepository.WhiteBalanceEnum.valueOf(it))
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
override fun setVideoOption(objects: ReadableMap, builder: VideoCapture.Builder) {
|
|
370
|
+
objects.getString("whiteBalance")?.let {
|
|
371
|
+
builder.setWhiteBalance(ThetaRepository.WhiteBalanceEnum.valueOf(it))
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* ColorTemperatureConverter
|
|
378
|
+
*/
|
|
379
|
+
class ColorTemperatureConverter : OptionConverter {
|
|
380
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
381
|
+
options.colorTemperature = objects.getInt("colorTemperature")
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
385
|
+
options.colorTemperature?.let {
|
|
386
|
+
objects.putInt("colorTemperature", it)
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
override fun setPhotoOption(objects: ReadableMap, builder: PhotoCapture.Builder) {
|
|
391
|
+
builder.setColorTemperature(objects.getInt("colorTemperature"))
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
override fun setVideoOption(objects: ReadableMap, builder: VideoCapture.Builder) {
|
|
395
|
+
builder.setColorTemperature(objects.getInt("colorTemperature"))
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* DateTimeZoneConverter
|
|
401
|
+
*/
|
|
402
|
+
class DateTimeZoneConverter : OptionConverter {
|
|
403
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
404
|
+
objects.getString("dateTimeZone")?.let {
|
|
405
|
+
options.dateTimeZone = it
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
410
|
+
options.dateTimeZone?.let {
|
|
411
|
+
objects.putString("dateTimeZone", it)
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* IsGpsOnConverter
|
|
418
|
+
*/
|
|
419
|
+
class IsGpsOnConverter : OptionConverter {
|
|
420
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
421
|
+
options.isGpsOn = objects.getBoolean("isGpsOn")
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
425
|
+
options.isGpsOn?.let {
|
|
426
|
+
objects.putBoolean("isGpsOn", it)
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* SleepDelayConverter
|
|
433
|
+
*/
|
|
434
|
+
class SleepDelayConverter : OptionConverter {
|
|
435
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
436
|
+
val type = objects.getType("sleepDelay")
|
|
437
|
+
if (type == ReadableType.Number) {
|
|
438
|
+
options.sleepDelay = ThetaRepository.SleepDelaySec(objects.getInt("sleepDelay"))
|
|
439
|
+
} else if (type == ReadableType.String) {
|
|
440
|
+
objects.getString("SleepDelay")?.let {
|
|
441
|
+
options.sleepDelay = ThetaRepository.SleepDelayEnum.valueOf(it)
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
447
|
+
options.sleepDelay?.let {
|
|
448
|
+
if (it is ThetaRepository.SleepDelayEnum) {
|
|
449
|
+
objects.putString("sleepDelay", it.toString())
|
|
450
|
+
} else if (it is ThetaRepository.SleepDelaySec) {
|
|
451
|
+
objects.putInt("sleepDelay", it.sec)
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* RemainingPicturesConverter
|
|
459
|
+
*/
|
|
460
|
+
class RemainingPicturesConverter : OptionConverter {
|
|
461
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
462
|
+
options.remainingPictures = objects.getInt("remainingPictures")
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
466
|
+
options.remainingPictures?.let {
|
|
467
|
+
objects.putInt("remainingPictures", it)
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* RemainingVideoSecondsConverter
|
|
474
|
+
*/
|
|
475
|
+
class RemainingVideoSecondsConverter : OptionConverter {
|
|
476
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
477
|
+
options.remainingVideoSeconds = objects.getInt("remainingVideoSeconds")
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
481
|
+
options.remainingVideoSeconds?.let {
|
|
482
|
+
objects.putInt("remainingVideoSeconds", it)
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* RemainingSpaceConverter
|
|
489
|
+
*/
|
|
490
|
+
class RemainingSpaceConverter : OptionConverter {
|
|
491
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
492
|
+
options.remainingSpace = objects.getDouble("remainingSpace").toLong()
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
496
|
+
options.remainingSpace?.let {
|
|
497
|
+
objects.putDouble("remainingSpace", it.toDouble())
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* TotalSpaceConverter
|
|
504
|
+
*/
|
|
505
|
+
class TotalSpaceConverter : OptionConverter {
|
|
506
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
507
|
+
options.totalSpace = objects.getDouble("totalSpace").toLong()
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
511
|
+
options.totalSpace?.let {
|
|
512
|
+
objects.putDouble("totalSpace", it.toDouble())
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* ShutterVolumeConverter
|
|
519
|
+
*/
|
|
520
|
+
class ShutterVolumeConverter : OptionConverter {
|
|
521
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
522
|
+
options.shutterVolume = objects.getInt("shutterVolume")
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
526
|
+
options.shutterVolume?.let {
|
|
527
|
+
objects.putInt("shutterVolume", it)
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* GpsInfoConverter
|
|
534
|
+
*/
|
|
535
|
+
class GpsInfoConverter : OptionConverter {
|
|
536
|
+
override fun setToTheta(options: ThetaRepository.Options, objects: ReadableMap) {
|
|
537
|
+
objects.getMap("gpsInfo")?.let {
|
|
538
|
+
options.gpsInfo = ThetaRepository.GpsInfo(
|
|
539
|
+
latitude = it.getDouble("latitude").toFloat(),
|
|
540
|
+
longitude = it.getDouble("longitude").toFloat(),
|
|
541
|
+
altitude = it.getDouble("altitude").toFloat(),
|
|
542
|
+
dateTimeZone = it.getString("dateTimeZone") ?: ""
|
|
543
|
+
)
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
override fun setFromTheta(options: ThetaRepository.Options, objects: WritableMap) {
|
|
548
|
+
options.gpsInfo?.let {
|
|
549
|
+
val gpsInfo = Arguments.createMap()
|
|
550
|
+
gpsInfo.putDouble("latitude", options.gpsInfo!!.latitude.toDouble())
|
|
551
|
+
gpsInfo.putDouble("longitude", options.gpsInfo!!.longitude.toDouble())
|
|
552
|
+
gpsInfo.putDouble("altitude", options.gpsInfo!!.altitude.toDouble())
|
|
553
|
+
gpsInfo.putString("dateTimeZone", options.gpsInfo!!.dateTimeZone)
|
|
554
|
+
objects.putMap("gpsInfo", gpsInfo)
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|