theta-client-react-native 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/Converter.kt +84 -0
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +55 -19
- package/ios/ConvertUtil.swift +989 -0
- package/ios/ThetaClientReactNative-Bridging-Header.h +3 -0
- package/ios/ThetaClientReactNative.m +201 -0
- package/ios/ThetaClientReactNative.swift +1337 -0
- package/ios/ThetaClientReactNative.xcodeproj/project.pbxproj +15 -57
- package/lib/commonjs/capture/photo-capture.js +19 -1
- package/lib/commonjs/capture/photo-capture.js.map +1 -1
- package/lib/commonjs/capture/time-shift-capture.js +27 -23
- package/lib/commonjs/capture/time-shift-capture.js.map +1 -1
- package/lib/commonjs/capture/video-capture.js +33 -5
- package/lib/commonjs/capture/video-capture.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/theta-repository/notify-controller.js +40 -0
- package/lib/commonjs/theta-repository/notify-controller.js.map +1 -0
- package/lib/commonjs/theta-repository/options/index.js +44 -0
- package/lib/commonjs/theta-repository/options/index.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-face-detect.js +22 -0
- package/lib/commonjs/theta-repository/options/option-face-detect.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-function.js +27 -0
- package/lib/commonjs/theta-repository/options/option-function.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-gain.js +26 -0
- package/lib/commonjs/theta-repository/options/option-gain.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-image-stitching.js +38 -0
- package/lib/commonjs/theta-repository/options/option-image-stitching.js.map +1 -0
- package/lib/commonjs/theta-repository/options/options.js +8 -0
- package/lib/commonjs/theta-repository/options/options.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-files.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-repository.js +2 -3
- package/lib/commonjs/theta-repository/theta-repository.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-state.js +1 -13
- package/lib/commonjs/theta-repository/theta-state.js.map +1 -1
- package/lib/module/capture/photo-capture.js +19 -1
- package/lib/module/capture/photo-capture.js.map +1 -1
- package/lib/module/capture/time-shift-capture.js +27 -23
- package/lib/module/capture/time-shift-capture.js.map +1 -1
- package/lib/module/capture/video-capture.js +33 -5
- package/lib/module/capture/video-capture.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/theta-repository/notify-controller.js +33 -0
- package/lib/module/theta-repository/notify-controller.js.map +1 -0
- package/lib/module/theta-repository/options/index.js +4 -0
- package/lib/module/theta-repository/options/index.js.map +1 -1
- package/lib/module/theta-repository/options/option-face-detect.js +15 -0
- package/lib/module/theta-repository/options/option-face-detect.js.map +1 -0
- package/lib/module/theta-repository/options/option-function.js +20 -0
- package/lib/module/theta-repository/options/option-function.js.map +1 -0
- package/lib/module/theta-repository/options/option-gain.js +19 -0
- package/lib/module/theta-repository/options/option-gain.js.map +1 -0
- package/lib/module/theta-repository/options/option-image-stitching.js +31 -0
- package/lib/module/theta-repository/options/option-image-stitching.js.map +1 -0
- package/lib/module/theta-repository/options/options.js +8 -0
- package/lib/module/theta-repository/options/options.js.map +1 -1
- package/lib/module/theta-repository/theta-files.js.map +1 -1
- package/lib/module/theta-repository/theta-repository.js +2 -3
- package/lib/module/theta-repository/theta-repository.js.map +1 -1
- package/lib/module/theta-repository/theta-state.js +0 -12
- package/lib/module/theta-repository/theta-state.js.map +1 -1
- package/lib/typescript/capture/photo-capture.d.ts +7 -1
- package/lib/typescript/capture/photo-capture.d.ts.map +1 -1
- package/lib/typescript/capture/time-shift-capture.d.ts +4 -7
- package/lib/typescript/capture/time-shift-capture.d.ts.map +1 -1
- package/lib/typescript/capture/video-capture.d.ts +5 -1
- package/lib/typescript/capture/video-capture.d.ts.map +1 -1
- package/lib/typescript/theta-repository/notify-controller.d.ts +17 -0
- package/lib/typescript/theta-repository/notify-controller.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/index.d.ts +4 -0
- package/lib/typescript/theta-repository/options/index.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-face-detect.d.ts +15 -0
- package/lib/typescript/theta-repository/options/option-face-detect.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-function.d.ts +20 -0
- package/lib/typescript/theta-repository/options/option-function.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-gain.d.ts +19 -0
- package/lib/typescript/theta-repository/options/option-gain.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-image-stitching.d.ts +30 -0
- package/lib/typescript/theta-repository/options/option-image-stitching.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/options.d.ts +20 -0
- package/lib/typescript/theta-repository/options/options.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-files.d.ts +2 -0
- package/lib/typescript/theta-repository/theta-files.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-repository.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-state.d.ts +1 -11
- package/lib/typescript/theta-repository/theta-state.d.ts.map +1 -1
- package/package.json +14 -8
- package/src/capture/photo-capture.ts +20 -3
- package/src/capture/time-shift-capture.ts +40 -33
- package/src/capture/video-capture.ts +49 -6
- package/src/theta-repository/notify-controller.ts +50 -0
- package/src/theta-repository/options/index.ts +4 -0
- package/src/theta-repository/options/option-face-detect.ts +16 -0
- package/src/theta-repository/options/option-function.ts +21 -0
- package/src/theta-repository/options/option-gain.ts +19 -0
- package/src/theta-repository/options/option-image-stitching.ts +32 -0
- package/src/theta-repository/options/options.ts +20 -0
- package/src/theta-repository/theta-files.ts +2 -0
- package/src/theta-repository/theta-repository.ts +3 -3
- package/src/theta-repository/theta-state.ts +2 -14
- package/theta-client-react-native.podspec +2 -2
- package/ios/ThetaClientReactNative.h +0 -34
- package/ios/ThetaClientReactNative.mm +0 -4084
- package/lib/commonjs/capture/notify.js +0 -12
- package/lib/commonjs/capture/notify.js.map +0 -1
- package/lib/module/capture/notify.js +0 -6
- package/lib/module/capture/notify.js.map +0 -1
- package/lib/typescript/capture/notify.d.ts +0 -13
- package/lib/typescript/capture/notify.d.ts.map +0 -1
- package/src/capture/notify.ts +0 -27
|
@@ -1,4084 +0,0 @@
|
|
|
1
|
-
#import "THETAClient/THETAClient.h"
|
|
2
|
-
#import "ThetaClientReactNative.h"
|
|
3
|
-
#import "RCTConvert.h"
|
|
4
|
-
|
|
5
|
-
#define MESSAGE_NOT_INIT @"Not initialized."
|
|
6
|
-
#define ERROR_CODE_ERROR @"error"
|
|
7
|
-
|
|
8
|
-
static NSDictionary* toNotify(NSString *name, NSDictionary *params) {
|
|
9
|
-
NSMutableDictionary *objects = [NSMutableDictionary dictionary];
|
|
10
|
-
[objects setObject:name forKey:@"name"];
|
|
11
|
-
if (params != nil) {
|
|
12
|
-
[objects setObject:params forKey:@"params"];
|
|
13
|
-
}
|
|
14
|
-
return objects;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
static NSDictionary* toCaptureProgressNotifyParam(NSNumber *value) {
|
|
18
|
-
NSMutableDictionary *result = [NSMutableDictionary dictionary];
|
|
19
|
-
[result setObject:value forKey:@"completion"];
|
|
20
|
-
return toNotify(@"TIME-SHIFT-PROGRESS", result);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* converter for int32_t
|
|
25
|
-
*/
|
|
26
|
-
@implementation RCTConvert (int32_t)
|
|
27
|
-
RCT_NUMBER_CONVERTER(int32_t, intValue)
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* takepicture callback holder
|
|
32
|
-
*/
|
|
33
|
-
@interface PhotoCallback: NSObject <THETACPhotoCaptureTakePictureCallback>
|
|
34
|
-
@end
|
|
35
|
-
@implementation PhotoCallback {
|
|
36
|
-
RCTPromiseResolveBlock _resolve; ///< takepicture callback resolver
|
|
37
|
-
RCTPromiseRejectBlock _reject; ///< takepicture callback rejecter
|
|
38
|
-
ThetaClientReactNative *_sdk; ///< theta client sdk instance
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* initialize PhotoCallback
|
|
42
|
-
* @param sdk theta client sdk instance
|
|
43
|
-
* @param resolve resolver for promise
|
|
44
|
-
* @param reject rejecter for promise
|
|
45
|
-
* @return initialized callback instance
|
|
46
|
-
*/
|
|
47
|
-
-(id)initWith:(ThetaClientReactNative *)sdk
|
|
48
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
49
|
-
withRejecter:(RCTPromiseRejectBlock)reject
|
|
50
|
-
{
|
|
51
|
-
self = [super init];
|
|
52
|
-
if (self) {
|
|
53
|
-
_sdk = sdk;
|
|
54
|
-
_resolve = resolve;
|
|
55
|
-
_reject = reject;
|
|
56
|
-
}
|
|
57
|
-
return self;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* call when error detect
|
|
62
|
-
* @param exception exception object
|
|
63
|
-
*/
|
|
64
|
-
-(void)onErrorException:(THETACThetaRepositoryThetaRepositoryException *)exception
|
|
65
|
-
{
|
|
66
|
-
_reject(ERROR_CODE_ERROR, exception.message, nil);
|
|
67
|
-
_sdk.photoCapture = nil;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* call when successfully taken picture
|
|
72
|
-
* @param fileUrl taken picture file url
|
|
73
|
-
*/
|
|
74
|
-
-(void)onSuccessFileUrl:(NSString *)fileUrl
|
|
75
|
-
{
|
|
76
|
-
_resolve(fileUrl);
|
|
77
|
-
_sdk.photoCapture = nil;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
- (void)onProgressCompletion:(float)completion {
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
@end
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* time-shift startCapture callback holder
|
|
87
|
-
*/
|
|
88
|
-
typedef void (^ TimeShiftOnProgressBlock)(float);
|
|
89
|
-
@interface TimeShiftStartCallback: NSObject <THETACTimeShiftCaptureStartCaptureCallback>
|
|
90
|
-
@end
|
|
91
|
-
@implementation TimeShiftStartCallback {
|
|
92
|
-
RCTPromiseResolveBlock _resolve; ///< start capture resolver
|
|
93
|
-
TimeShiftOnProgressBlock _onProgress; ///< start capture resolver
|
|
94
|
-
RCTPromiseRejectBlock _reject; ///< start capture rejecter
|
|
95
|
-
ThetaClientReactNative *_sdk; ///< theta client sdk instance
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* initialize TimeShiftCallback
|
|
100
|
-
* @param sdk theta client sdk instance
|
|
101
|
-
* @param resolve resolver for promise
|
|
102
|
-
* @param reject rejecter for promise
|
|
103
|
-
* @return initialized callback instance
|
|
104
|
-
*/
|
|
105
|
-
-(id)initWith:(ThetaClientReactNative *)sdk
|
|
106
|
-
withProgress:(TimeShiftOnProgressBlock)onProgress
|
|
107
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
108
|
-
withRejecter:(RCTPromiseRejectBlock)reject
|
|
109
|
-
{
|
|
110
|
-
self = [super init];
|
|
111
|
-
if (self) {
|
|
112
|
-
_sdk = sdk;
|
|
113
|
-
_onProgress = onProgress;
|
|
114
|
-
_resolve = resolve;
|
|
115
|
-
_reject = reject;
|
|
116
|
-
}
|
|
117
|
-
return self;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* call when error detect
|
|
122
|
-
* @param exception exception object
|
|
123
|
-
*/
|
|
124
|
-
-(void)onErrorException:(THETACThetaRepositoryThetaRepositoryException *)exception {
|
|
125
|
-
_reject(@"error", exception.message, nil);
|
|
126
|
-
_sdk.timeShiftCapture = nil;
|
|
127
|
-
_sdk.timeShiftCapturing = nil;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* call when successfully time-shift captured
|
|
132
|
-
* @param fileUrl captured video file url
|
|
133
|
-
*/
|
|
134
|
-
- (void)onSuccessFileUrl_:(NSString * _Nullable)fileUrl {
|
|
135
|
-
_resolve(fileUrl != nil ? fileUrl : [NSNull null]);
|
|
136
|
-
_sdk.timeShiftCapture = nil;
|
|
137
|
-
_sdk.timeShiftCapturing = nil;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* call when check time-shift progress
|
|
142
|
-
* @param completion captured video file url
|
|
143
|
-
*/
|
|
144
|
-
- (void)onProgressCompletion:(float)completion {
|
|
145
|
-
_onProgress(completion);
|
|
146
|
-
}
|
|
147
|
-
@end
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* startCapture callback holder
|
|
151
|
-
*/
|
|
152
|
-
@interface VideoCallback: NSObject <THETACVideoCaptureStartCaptureCallback>
|
|
153
|
-
@end
|
|
154
|
-
@implementation VideoCallback {
|
|
155
|
-
RCTPromiseResolveBlock _resolve; ///< start capture resolver
|
|
156
|
-
RCTPromiseRejectBlock _reject; ///< start capture rejecter
|
|
157
|
-
ThetaClientReactNative *_sdk; ///< theta client sdk instance
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* initialize VideoCallback
|
|
162
|
-
* @param sdk theta client sdk instance
|
|
163
|
-
* @param resolve resolver for promise
|
|
164
|
-
* @param reject rejecter for promise
|
|
165
|
-
* @return initialized callback instance
|
|
166
|
-
*/
|
|
167
|
-
-(id)initWith:(ThetaClientReactNative *)sdk
|
|
168
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
169
|
-
withRejecter:(RCTPromiseRejectBlock)reject
|
|
170
|
-
{
|
|
171
|
-
self = [super init];
|
|
172
|
-
if (self) {
|
|
173
|
-
_sdk = sdk;
|
|
174
|
-
_resolve = resolve;
|
|
175
|
-
_reject = reject;
|
|
176
|
-
}
|
|
177
|
-
return self;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* call when error detect
|
|
182
|
-
* @param exception exception object
|
|
183
|
-
*/
|
|
184
|
-
-(void)onErrorException:(THETACThetaRepositoryThetaRepositoryException *)exception
|
|
185
|
-
{
|
|
186
|
-
_reject(ERROR_CODE_ERROR, exception.message, nil);
|
|
187
|
-
_sdk.videoCapture = nil;
|
|
188
|
-
_sdk.videoCapturing = nil;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* call when successfully video captured
|
|
193
|
-
* @param fileUrl captured video file url
|
|
194
|
-
*/
|
|
195
|
-
-(void)onSuccessFileUrl:(NSString *)fileUrl
|
|
196
|
-
{
|
|
197
|
-
_resolve(fileUrl);
|
|
198
|
-
_sdk.videoCapture = nil;
|
|
199
|
-
_sdk.videoCapturing = nil;
|
|
200
|
-
}
|
|
201
|
-
@end
|
|
202
|
-
|
|
203
|
-
/** frame event handler with NSData */
|
|
204
|
-
typedef void (^FrameEventHandler)(NSData *);
|
|
205
|
-
/** frame interval time */
|
|
206
|
-
static CFTimeInterval FRAME_INTERVAL = (CFTimeInterval) (1.0/10.0);
|
|
207
|
-
/**
|
|
208
|
-
* live preview frame handler holder
|
|
209
|
-
*/
|
|
210
|
-
@interface FrameHandler: NSObject <THETACKotlinSuspendFunction1>
|
|
211
|
-
@end
|
|
212
|
-
@implementation FrameHandler {
|
|
213
|
-
FrameEventHandler _handler; ///< frame event handler
|
|
214
|
-
ThetaClientReactNative *_sdk; ///< theta client sdk instance
|
|
215
|
-
CFTimeInterval _last; ///< last event time
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* initialize frame handler
|
|
220
|
-
* @param sdk theta client sdk instance
|
|
221
|
-
* @param handler frame event handler
|
|
222
|
-
*/
|
|
223
|
-
-(id)initWith:(ThetaClientReactNative *)sdk
|
|
224
|
-
withEvent:(FrameEventHandler)handler
|
|
225
|
-
{
|
|
226
|
-
self = [super init];
|
|
227
|
-
if (self) {
|
|
228
|
-
_sdk = sdk;
|
|
229
|
-
_handler = handler;
|
|
230
|
-
_last = 0;
|
|
231
|
-
}
|
|
232
|
-
return self;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* call when frame data arrived
|
|
237
|
-
* @param p1 ByteReadPacket instance
|
|
238
|
-
* @param completionHandler set result
|
|
239
|
-
*/
|
|
240
|
-
- (void)invokeP1:(id)p1 completionHandler:(void (^)(id _Nullable_result, NSError * _Nullable))completionHandler __attribute__((swift_name("invoke(p1:completionHandler:)")));
|
|
241
|
-
{
|
|
242
|
-
CFTimeInterval now = CACurrentMediaTime();
|
|
243
|
-
if (now - _last > FRAME_INTERVAL) {
|
|
244
|
-
NSData *data =
|
|
245
|
-
[THETACPlatformKt frameFromPacket:(THETACKotlinPair<THETACKotlinByteArray *, THETACInt *> *)p1];
|
|
246
|
-
_handler(data);
|
|
247
|
-
completionHandler(@(_sdk.previewing), nil);
|
|
248
|
-
_last = now;
|
|
249
|
-
} else {
|
|
250
|
-
completionHandler(@(_sdk.previewing), nil);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
@end
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* check null for object
|
|
257
|
-
*/
|
|
258
|
-
static bool isNull(id obj) {
|
|
259
|
-
return (obj == nil || obj == [NSNull null]);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/** opiton converter from theta to react */
|
|
263
|
-
typedef void (^SetFromTheta)(NSMutableDictionary *, THETACThetaRepositoryOptions *);
|
|
264
|
-
/** option converter from react to theta */
|
|
265
|
-
typedef void (^SetToTheta)(NSDictionary *, THETACThetaRepositoryOptions *);
|
|
266
|
-
/** option converter to set photo option */
|
|
267
|
-
typedef void (^SetPhotoOption)(NSDictionary *, THETACPhotoCaptureBuilder *);
|
|
268
|
-
/** option converter to set time-shift option */
|
|
269
|
-
typedef void (^SetTimeShiftOption)(NSDictionary *, THETACTimeShiftCaptureBuilder *);
|
|
270
|
-
/** option converter to set video option */
|
|
271
|
-
typedef void (^SetVideoOption)(NSDictionary *, THETACVideoCaptureBuilder *);
|
|
272
|
-
|
|
273
|
-
typedef struct _convert_t {
|
|
274
|
-
NSDictionary* toTheta; ///< dictionary react to theta
|
|
275
|
-
NSDictionary* fromTheta; ///< dictionary theta to react
|
|
276
|
-
NSDictionary* photoOption; ///< dictionary photoOption
|
|
277
|
-
NSDictionary* videoOption; ///< dictionary videoOption
|
|
278
|
-
SetToTheta setToTheta; ///< option setter react to theta
|
|
279
|
-
SetFromTheta setFromTheta; ///< option setter theta to react
|
|
280
|
-
SetPhotoOption setPhotoOption; ///< photo option setter
|
|
281
|
-
SetTimeShiftOption setTimeShiftOption; ///< time-shift option setter
|
|
282
|
-
SetVideoOption setVideoOption; ///< video option setter
|
|
283
|
-
} convert_t;
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* BitrateEnum converter
|
|
287
|
-
*/
|
|
288
|
-
static convert_t BitrateEnum = {
|
|
289
|
-
.toTheta = nil,
|
|
290
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
291
|
-
if (!BitrateEnum.toTheta) {
|
|
292
|
-
NSMutableDictionary* dictionary = [NSMutableDictionary dictionary];
|
|
293
|
-
THETACKotlinArray* array = THETACThetaRepositoryBitrateEnum.values;
|
|
294
|
-
for (int i = 0; i < array.size; i++) {
|
|
295
|
-
THETACThetaRepositoryBitrateEnum* item = [array getIndex:i];
|
|
296
|
-
[dictionary setObject:item forKey:item.name];
|
|
297
|
-
}
|
|
298
|
-
BitrateEnum.toTheta = dictionary;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
id rv = [rct objectForKey:@"bitrate"];
|
|
302
|
-
if (rv) {
|
|
303
|
-
if ([rv isKindOfClass:NSString.class]) {
|
|
304
|
-
opt.bitrate = [BitrateEnum.toTheta objectForKey:rv];
|
|
305
|
-
} else if ([rv isKindOfClass:NSNumber.class]) {
|
|
306
|
-
id val = [[THETACThetaRepositoryBitrateNumber alloc] initWithValue:[rv intValue]];
|
|
307
|
-
opt.bitrate = val;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
312
|
-
if ([((id)opt.bitrate) isKindOfClass:THETACThetaRepositoryBitrateEnum.class]) {
|
|
313
|
-
THETACThetaRepositoryBitrateEnum* bitrateEnum = (THETACThetaRepositoryBitrateEnum*)opt.bitrate;
|
|
314
|
-
[rct setObject:bitrateEnum.name forKey:@"bitrate"];
|
|
315
|
-
} else if ([((id)opt.bitrate) isKindOfClass:THETACThetaRepositoryBitrateNumber.class]) {
|
|
316
|
-
THETACThetaRepositoryBitrateNumber* bitrateNumber = (THETACThetaRepositoryBitrateNumber*)opt.bitrate;
|
|
317
|
-
[rct setObject:[NSNumber numberWithInt:bitrateNumber.value] forKey:@"bitrate"];
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* BurstModeEnum converter
|
|
324
|
-
*/
|
|
325
|
-
static convert_t BurstModeEnum = {
|
|
326
|
-
.toTheta = @{
|
|
327
|
-
@"ON": THETACThetaRepositoryBurstModeEnum.on,
|
|
328
|
-
@"OFF": THETACThetaRepositoryBurstModeEnum.off
|
|
329
|
-
},
|
|
330
|
-
.fromTheta = @{
|
|
331
|
-
THETACThetaRepositoryBurstModeEnum.on: @"ON",
|
|
332
|
-
THETACThetaRepositoryBurstModeEnum.off: @"OFF"
|
|
333
|
-
},
|
|
334
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
335
|
-
id val = [BurstModeEnum.toTheta objectForKey:[rct objectForKey:@"burstMode"]];
|
|
336
|
-
if (val) {
|
|
337
|
-
opt.burstMode = val;
|
|
338
|
-
}
|
|
339
|
-
},
|
|
340
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
341
|
-
id val = [BurstModeEnum.fromTheta objectForKey:opt.burstMode];
|
|
342
|
-
if (val) {
|
|
343
|
-
[rct setObject:val forKey:@"burstMode"];
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
static convert_t BurstCaptureNumEnum = {
|
|
349
|
-
.toTheta = @{
|
|
350
|
-
@"BURST_CAPTURE_NUM_1": THETACThetaRepositoryBurstCaptureNumEnum.burstCaptureNum1,
|
|
351
|
-
@"BURST_CAPTURE_NUM_3": THETACThetaRepositoryBurstCaptureNumEnum.burstCaptureNum3,
|
|
352
|
-
@"BURST_CAPTURE_NUM_5": THETACThetaRepositoryBurstCaptureNumEnum.burstCaptureNum5,
|
|
353
|
-
@"BURST_CAPTURE_NUM_7": THETACThetaRepositoryBurstCaptureNumEnum.burstCaptureNum7,
|
|
354
|
-
@"BURST_CAPTURE_NUM_9": THETACThetaRepositoryBurstCaptureNumEnum.burstCaptureNum9
|
|
355
|
-
}
|
|
356
|
-
};
|
|
357
|
-
|
|
358
|
-
static convert_t BurstBracketStepEnum = {
|
|
359
|
-
.toTheta = @{
|
|
360
|
-
@"BRACKET_STEP_0_0": THETACThetaRepositoryBurstBracketStepEnum.bracketStep00,
|
|
361
|
-
@"BRACKET_STEP_0_3": THETACThetaRepositoryBurstBracketStepEnum.bracketStep03,
|
|
362
|
-
@"BRACKET_STEP_0_7": THETACThetaRepositoryBurstBracketStepEnum.bracketStep07,
|
|
363
|
-
@"BRACKET_STEP_1_0": THETACThetaRepositoryBurstBracketStepEnum.bracketStep10,
|
|
364
|
-
@"BRACKET_STEP_1_3": THETACThetaRepositoryBurstBracketStepEnum.bracketStep13,
|
|
365
|
-
@"BRACKET_STEP_1_7": THETACThetaRepositoryBurstBracketStepEnum.bracketStep17,
|
|
366
|
-
@"BRACKET_STEP_2_0": THETACThetaRepositoryBurstBracketStepEnum.bracketStep20,
|
|
367
|
-
@"BRACKET_STEP_2_3": THETACThetaRepositoryBurstBracketStepEnum.bracketStep23,
|
|
368
|
-
@"BRACKET_STEP_2_7": THETACThetaRepositoryBurstBracketStepEnum.bracketStep27,
|
|
369
|
-
@"BRACKET_STEP_3_0": THETACThetaRepositoryBurstBracketStepEnum.bracketStep30
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
static convert_t BurstCompensationEnum = {
|
|
374
|
-
.toTheta = @{
|
|
375
|
-
@"BURST_COMPENSATION_DOWN_5_0": THETACThetaRepositoryBurstCompensationEnum.burstCompensationDown50,
|
|
376
|
-
@"BURST_COMPENSATION_DOWN_4_7": THETACThetaRepositoryBurstCompensationEnum.burstCompensationDown47,
|
|
377
|
-
@"BURST_COMPENSATION_DOWN_4_3": THETACThetaRepositoryBurstCompensationEnum.burstCompensationDown43,
|
|
378
|
-
@"BURST_COMPENSATION_DOWN_4_0": THETACThetaRepositoryBurstCompensationEnum.burstCompensationDown40,
|
|
379
|
-
@"BURST_COMPENSATION_DOWN_3_7": THETACThetaRepositoryBurstCompensationEnum.burstCompensationDown37,
|
|
380
|
-
@"BURST_COMPENSATION_DOWN_3_3": THETACThetaRepositoryBurstCompensationEnum.burstCompensationDown33,
|
|
381
|
-
@"BURST_COMPENSATION_DOWN_3_0": THETACThetaRepositoryBurstCompensationEnum.burstCompensationDown30,
|
|
382
|
-
@"BURST_COMPENSATION_DOWN_2_7": THETACThetaRepositoryBurstCompensationEnum.burstCompensationDown27,
|
|
383
|
-
@"BURST_COMPENSATION_DOWN_2_3": THETACThetaRepositoryBurstCompensationEnum.burstCompensationDown23,
|
|
384
|
-
@"BURST_COMPENSATION_DOWN_2_0": THETACThetaRepositoryBurstCompensationEnum.burstCompensationDown20,
|
|
385
|
-
@"BURST_COMPENSATION_DOWN_1_7": THETACThetaRepositoryBurstCompensationEnum.burstCompensationDown17,
|
|
386
|
-
@"BURST_COMPENSATION_DOWN_1_3": THETACThetaRepositoryBurstCompensationEnum.burstCompensationDown13,
|
|
387
|
-
@"BURST_COMPENSATION_DOWN_1_0": THETACThetaRepositoryBurstCompensationEnum.burstCompensationDown10,
|
|
388
|
-
@"BURST_COMPENSATION_DOWN_0_7": THETACThetaRepositoryBurstCompensationEnum.burstCompensationDown07,
|
|
389
|
-
@"BURST_COMPENSATION_DOWN_0_3": THETACThetaRepositoryBurstCompensationEnum.burstCompensationDown03,
|
|
390
|
-
@"BURST_COMPENSATION_0_0": THETACThetaRepositoryBurstCompensationEnum.burstCompensation00,
|
|
391
|
-
@"BURST_COMPENSATION_UP_0_3": THETACThetaRepositoryBurstCompensationEnum.burstCompensationUp03,
|
|
392
|
-
@"BURST_COMPENSATION_UP_0_7": THETACThetaRepositoryBurstCompensationEnum.burstCompensationUp07,
|
|
393
|
-
@"BURST_COMPENSATION_UP_1_0": THETACThetaRepositoryBurstCompensationEnum.burstCompensationUp10,
|
|
394
|
-
@"BURST_COMPENSATION_UP_1_3": THETACThetaRepositoryBurstCompensationEnum.burstCompensationUp13,
|
|
395
|
-
@"BURST_COMPENSATION_UP_1_7": THETACThetaRepositoryBurstCompensationEnum.burstCompensationUp17,
|
|
396
|
-
@"BURST_COMPENSATION_UP_2_0": THETACThetaRepositoryBurstCompensationEnum.burstCompensationUp20,
|
|
397
|
-
@"BURST_COMPENSATION_UP_2_3": THETACThetaRepositoryBurstCompensationEnum.burstCompensationUp23,
|
|
398
|
-
@"BURST_COMPENSATION_UP_2_7": THETACThetaRepositoryBurstCompensationEnum.burstCompensationUp27,
|
|
399
|
-
@"BURST_COMPENSATION_UP_3_0": THETACThetaRepositoryBurstCompensationEnum.burstCompensationUp30,
|
|
400
|
-
@"BURST_COMPENSATION_UP_3_3": THETACThetaRepositoryBurstCompensationEnum.burstCompensationUp33,
|
|
401
|
-
@"BURST_COMPENSATION_UP_3_7": THETACThetaRepositoryBurstCompensationEnum.burstCompensationUp37,
|
|
402
|
-
@"BURST_COMPENSATION_UP_4_0": THETACThetaRepositoryBurstCompensationEnum.burstCompensationUp40,
|
|
403
|
-
@"BURST_COMPENSATION_UP_4_3": THETACThetaRepositoryBurstCompensationEnum.burstCompensationUp43,
|
|
404
|
-
@"BURST_COMPENSATION_UP_4_7": THETACThetaRepositoryBurstCompensationEnum.burstCompensationUp47,
|
|
405
|
-
@"BURST_COMPENSATION_UP_5_0": THETACThetaRepositoryBurstCompensationEnum.burstCompensationUp50
|
|
406
|
-
}
|
|
407
|
-
};
|
|
408
|
-
|
|
409
|
-
static convert_t BurstMaxExposureTimeEnum = {
|
|
410
|
-
.toTheta = @{
|
|
411
|
-
@"MAX_EXPOSURE_TIME_0_5": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime05,
|
|
412
|
-
@"MAX_EXPOSURE_TIME_0_625": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime0625,
|
|
413
|
-
@"MAX_EXPOSURE_TIME_0_76923076": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime076923076,
|
|
414
|
-
@"MAX_EXPOSURE_TIME_1": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime1,
|
|
415
|
-
@"MAX_EXPOSURE_TIME_1_3": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime13,
|
|
416
|
-
@"MAX_EXPOSURE_TIME_1_6": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime16,
|
|
417
|
-
@"MAX_EXPOSURE_TIME_2": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime2,
|
|
418
|
-
@"MAX_EXPOSURE_TIME_2_5": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime25,
|
|
419
|
-
@"MAX_EXPOSURE_TIME_3_2": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime32,
|
|
420
|
-
@"MAX_EXPOSURE_TIME_4": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime4,
|
|
421
|
-
@"MAX_EXPOSURE_TIME_5": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime5,
|
|
422
|
-
@"MAX_EXPOSURE_TIME_6": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime6,
|
|
423
|
-
@"MAX_EXPOSURE_TIME_8": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime8,
|
|
424
|
-
@"MAX_EXPOSURE_TIME_10": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime10,
|
|
425
|
-
@"MAX_EXPOSURE_TIME_13": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime13_,
|
|
426
|
-
@"MAX_EXPOSURE_TIME_15": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime15,
|
|
427
|
-
@"MAX_EXPOSURE_TIME_20": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime20,
|
|
428
|
-
@"MAX_EXPOSURE_TIME_25": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime25_,
|
|
429
|
-
@"MAX_EXPOSURE_TIME_30": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime30,
|
|
430
|
-
@"MAX_EXPOSURE_TIME_40": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime40,
|
|
431
|
-
@"MAX_EXPOSURE_TIME_50": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime50,
|
|
432
|
-
@"MAX_EXPOSURE_TIME_60": THETACThetaRepositoryBurstMaxExposureTimeEnum.maxExposureTime60
|
|
433
|
-
}
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
static convert_t BurstEnableIsoControlEnum = {
|
|
437
|
-
.toTheta = @{
|
|
438
|
-
@"OFF": THETACThetaRepositoryBurstEnableIsoControlEnum.off,
|
|
439
|
-
@"ON": THETACThetaRepositoryBurstEnableIsoControlEnum.on
|
|
440
|
-
}
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
static convert_t BurstOrderEnum = {
|
|
444
|
-
.toTheta = @{
|
|
445
|
-
@"BURST_BRACKET_ORDER_0": THETACThetaRepositoryBurstOrderEnum.burstBracketOrder0,
|
|
446
|
-
@"BURST_BRACKET_ORDER_1": THETACThetaRepositoryBurstOrderEnum.burstBracketOrder1
|
|
447
|
-
}
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
/**
|
|
451
|
-
* BurstOption converter
|
|
452
|
-
*/
|
|
453
|
-
static convert_t BurstOptionCvt = {
|
|
454
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
455
|
-
NSDictionary *dic = [rct objectForKey:@"burstOption"];
|
|
456
|
-
if (dic) {
|
|
457
|
-
opt.burstOption = [[THETACThetaRepositoryBurstOption alloc]
|
|
458
|
-
initWithBurstCaptureNum:!isNull([dic objectForKey:@"burstCaptureNum"]) ? [BurstCaptureNumEnum.toTheta objectForKey:[dic objectForKey:@"burstCaptureNum"]] : nil
|
|
459
|
-
burstBracketStep:!isNull([dic objectForKey:@"burstBracketStep"]) ? [BurstBracketStepEnum.toTheta objectForKey:[dic objectForKey:@"burstBracketStep"]] : nil
|
|
460
|
-
burstCompensation:!isNull([dic objectForKey:@"burstCompensation"]) ? [BurstCompensationEnum.toTheta objectForKey:[dic objectForKey:@"burstCompensation"]] : nil
|
|
461
|
-
burstMaxExposureTime:!isNull([dic objectForKey:@"burstMaxExposureTime"]) ? [BurstMaxExposureTimeEnum.toTheta objectForKey:[dic objectForKey:@"burstMaxExposureTime"]] : nil
|
|
462
|
-
burstEnableIsoControl:!isNull([dic objectForKey:@"burstEnableIsoControl"]) ? [BurstEnableIsoControlEnum.toTheta objectForKey:[dic objectForKey:@"burstEnableIsoControl"]] : nil
|
|
463
|
-
burstOrder:!isNull([dic objectForKey:@"burstOrder"]) ? [BurstOrderEnum.toTheta objectForKey:[dic objectForKey:@"burstOrder"]] : nil];
|
|
464
|
-
}
|
|
465
|
-
},
|
|
466
|
-
|
|
467
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
468
|
-
if (opt.burstOption) {
|
|
469
|
-
NSMutableDictionary *burstOption = [NSMutableDictionary dictionary];
|
|
470
|
-
|
|
471
|
-
if (opt.burstOption.burstCaptureNum) {
|
|
472
|
-
[burstOption setObject:opt.burstOption.burstCaptureNum.name forKey:@"burstCaptureNum"];
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
if (opt.burstOption.burstBracketStep) {
|
|
476
|
-
[burstOption setObject:opt.burstOption.burstBracketStep.name forKey:@"burstBracketStep"];
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
if (opt.burstOption.burstCompensation) {
|
|
480
|
-
[burstOption setObject:opt.burstOption.burstCompensation.name forKey:@"burstCompensation"];
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
if (opt.burstOption.burstMaxExposureTime) {
|
|
484
|
-
[burstOption setObject:opt.burstOption.burstMaxExposureTime.name forKey:@"burstMaxExposureTime"];
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
if (opt.burstOption.burstEnableIsoControl) {
|
|
488
|
-
[burstOption setObject:opt.burstOption.burstEnableIsoControl.name forKey:@"burstEnableIsoControl"];
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
if (opt.burstOption.burstOrder) {
|
|
492
|
-
[burstOption setObject:opt.burstOption.burstOrder.name forKey:@"burstOrder"];
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
[rct setObject:burstOption forKey:@"burstOption"];
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
};
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* ChargingStateEnum converter
|
|
502
|
-
*/
|
|
503
|
-
static convert_t ChargingStateEnum = {
|
|
504
|
-
.fromTheta = @{
|
|
505
|
-
THETACThetaRepositoryChargingStateEnum.charging: @"CHARGING",
|
|
506
|
-
THETACThetaRepositoryChargingStateEnum.completed: @"COMPLETED",
|
|
507
|
-
THETACThetaRepositoryChargingStateEnum.notCharging: @"NOT_CHARGING"
|
|
508
|
-
}
|
|
509
|
-
};
|
|
510
|
-
|
|
511
|
-
static convert_t CaptureStatusEnum = {
|
|
512
|
-
.fromTheta = @{
|
|
513
|
-
THETACThetaRepositoryCaptureStatusEnum.shooting: @"SHOOTING",
|
|
514
|
-
THETACThetaRepositoryCaptureStatusEnum.idle: @"IDLE",
|
|
515
|
-
THETACThetaRepositoryCaptureStatusEnum.selfTimerCountdown: @"SELF_TIMER_COUNTDOWN",
|
|
516
|
-
THETACThetaRepositoryCaptureStatusEnum.bracketShooting: @"BRACKET_SHOOTING",
|
|
517
|
-
THETACThetaRepositoryCaptureStatusEnum.converting: @"CONVERTING",
|
|
518
|
-
THETACThetaRepositoryCaptureStatusEnum.timeShiftShooting: @"TIME_SHIFT_SHOOTING",
|
|
519
|
-
THETACThetaRepositoryCaptureStatusEnum.continuousShooting: @"CONTINUOUS_SHOOTING",
|
|
520
|
-
THETACThetaRepositoryCaptureStatusEnum.retrospectiveImageRecording: @"RETROSPECTIVE_IMAGE_RECORDING"
|
|
521
|
-
}
|
|
522
|
-
};
|
|
523
|
-
|
|
524
|
-
static convert_t ShootingFunctionEnum = {
|
|
525
|
-
.fromTheta = @{
|
|
526
|
-
THETACThetaRepositoryShootingFunctionEnum.normal: @"NORMAL",
|
|
527
|
-
THETACThetaRepositoryShootingFunctionEnum.selfTimer: @"SELF_TIMER",
|
|
528
|
-
THETACThetaRepositoryShootingFunctionEnum.mySetting: @"MY_SETTING"
|
|
529
|
-
}
|
|
530
|
-
};
|
|
531
|
-
|
|
532
|
-
static convert_t MicrophoneOptionEnum = {
|
|
533
|
-
.fromTheta = @{
|
|
534
|
-
THETACThetaRepositoryMicrophoneOptionEnum.auto_: @"AUTO",
|
|
535
|
-
THETACThetaRepositoryMicrophoneOptionEnum.internal: @"INTERNAL",
|
|
536
|
-
THETACThetaRepositoryMicrophoneOptionEnum.external: @"EXTERNAL"
|
|
537
|
-
}
|
|
538
|
-
};
|
|
539
|
-
|
|
540
|
-
static convert_t CameraErrorEnum = {
|
|
541
|
-
.fromTheta = @{
|
|
542
|
-
THETACThetaRepositoryCameraErrorEnum.noMemory: @"NO_MEMORY",
|
|
543
|
-
THETACThetaRepositoryCameraErrorEnum.fileNumberOver: @"FILE_NUMBER_OVER",
|
|
544
|
-
THETACThetaRepositoryCameraErrorEnum.noDateSetting: @"NO_DATE_SETTING",
|
|
545
|
-
THETACThetaRepositoryCameraErrorEnum.readError: @"READ_ERROR",
|
|
546
|
-
THETACThetaRepositoryCameraErrorEnum.notSupportedMediaType: @"NOT_SUPPORTED_MEDIA_TYPE",
|
|
547
|
-
THETACThetaRepositoryCameraErrorEnum.notSupportedFileSystem: @"NOT_SUPPORTED_FILE_SYSTEM",
|
|
548
|
-
THETACThetaRepositoryCameraErrorEnum.mediaNotReady: @"MEDIA_NOT_READY",
|
|
549
|
-
THETACThetaRepositoryCameraErrorEnum.notEnoughBattery: @"NOT_ENOUGH_BATTERY",
|
|
550
|
-
THETACThetaRepositoryCameraErrorEnum.invalidFile: @"INVALID_FILE",
|
|
551
|
-
THETACThetaRepositoryCameraErrorEnum.pluginBootError: @"PLUGIN_BOOT_ERROR",
|
|
552
|
-
THETACThetaRepositoryCameraErrorEnum.inProgressError: @"IN_PROGRESS_ERROR",
|
|
553
|
-
THETACThetaRepositoryCameraErrorEnum.cannotRecording: @"CANNOT_RECORDING",
|
|
554
|
-
THETACThetaRepositoryCameraErrorEnum.cannotRecordLowbat: @"CANNOT_RECORD_LOWBAT",
|
|
555
|
-
THETACThetaRepositoryCameraErrorEnum.captureHwFailed: @"CAPTURE_HW_FAILED",
|
|
556
|
-
THETACThetaRepositoryCameraErrorEnum.captureSwFailed: @"CAPTURE_SW_FAILED",
|
|
557
|
-
THETACThetaRepositoryCameraErrorEnum.internalMemAccessFail: @"INTERNAL_MEM_ACCESS_FAIL",
|
|
558
|
-
THETACThetaRepositoryCameraErrorEnum.unexpectedError: @"UNEXPECTED_ERROR",
|
|
559
|
-
THETACThetaRepositoryCameraErrorEnum.batteryChargeFail: @"BATTERY_CHARGE_FAIL",
|
|
560
|
-
THETACThetaRepositoryCameraErrorEnum.highTemperatureWarning: @"HIGH_TEMPERATURE_WARNING",
|
|
561
|
-
THETACThetaRepositoryCameraErrorEnum.highTemperature: @"HIGH_TEMPERATURE",
|
|
562
|
-
THETACThetaRepositoryCameraErrorEnum.batteryHighTemperature: @"BATTERY_HIGH_TEMPERATURE",
|
|
563
|
-
THETACThetaRepositoryCameraErrorEnum.compassCalibration: @"COMPASS_CALIBRATION"
|
|
564
|
-
}
|
|
565
|
-
};
|
|
566
|
-
|
|
567
|
-
/**
|
|
568
|
-
* FileTypeEnum converter
|
|
569
|
-
*/
|
|
570
|
-
static convert_t FileTypeEnum = {
|
|
571
|
-
.toTheta = @{
|
|
572
|
-
@"IMAGE": THETACThetaRepositoryFileTypeEnum.image,
|
|
573
|
-
@"VIDEO": THETACThetaRepositoryFileTypeEnum.video,
|
|
574
|
-
@"ALL": THETACThetaRepositoryFileTypeEnum.all
|
|
575
|
-
}
|
|
576
|
-
};
|
|
577
|
-
|
|
578
|
-
/**
|
|
579
|
-
* StorageEnum converter
|
|
580
|
-
*/
|
|
581
|
-
static convert_t StorageEnum = {
|
|
582
|
-
.toTheta = @{
|
|
583
|
-
@"INTERNAL": THETACThetaRepositoryStorageEnum.internal,
|
|
584
|
-
@"SD": THETACThetaRepositoryStorageEnum.sd,
|
|
585
|
-
@"CURRENT": THETACThetaRepositoryStorageEnum.current,
|
|
586
|
-
}
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
/**
|
|
590
|
-
* AuthModeEnum converter
|
|
591
|
-
*/
|
|
592
|
-
static convert_t AuthModeEnum = {
|
|
593
|
-
.toTheta = @{
|
|
594
|
-
@"NONE": THETACThetaRepositoryAuthModeEnum.none,
|
|
595
|
-
@"WEP": THETACThetaRepositoryAuthModeEnum.wep,
|
|
596
|
-
@"WPA": THETACThetaRepositoryAuthModeEnum.wpa
|
|
597
|
-
},
|
|
598
|
-
.fromTheta = @{
|
|
599
|
-
THETACThetaRepositoryAuthModeEnum.none: @"NONE",
|
|
600
|
-
THETACThetaRepositoryAuthModeEnum.wep: @"WEP",
|
|
601
|
-
THETACThetaRepositoryAuthModeEnum.wpa: @"WPA"
|
|
602
|
-
}
|
|
603
|
-
};
|
|
604
|
-
|
|
605
|
-
/**
|
|
606
|
-
* AiAutoThumbnailEnum converter
|
|
607
|
-
*/
|
|
608
|
-
static convert_t AiAutoThumbnailEnum = {
|
|
609
|
-
.toTheta = @{
|
|
610
|
-
@"ON": THETACThetaRepositoryAiAutoThumbnailEnum.on,
|
|
611
|
-
@"OFF": THETACThetaRepositoryAiAutoThumbnailEnum.off
|
|
612
|
-
},
|
|
613
|
-
.fromTheta = @{
|
|
614
|
-
THETACThetaRepositoryAiAutoThumbnailEnum.on: @"ON",
|
|
615
|
-
THETACThetaRepositoryAiAutoThumbnailEnum.off: @"OFF"
|
|
616
|
-
},
|
|
617
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
618
|
-
id val = [AiAutoThumbnailEnum.toTheta objectForKey:[rct objectForKey:@"aiAutoThumbnail"]];
|
|
619
|
-
if (val) {
|
|
620
|
-
opt.aiAutoThumbnail = val;
|
|
621
|
-
}
|
|
622
|
-
},
|
|
623
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
624
|
-
id val = [AiAutoThumbnailEnum.fromTheta objectForKey:opt.aiAutoThumbnail];
|
|
625
|
-
if (val) {
|
|
626
|
-
[rct setObject:val forKey:@"aiAutoThumbnail"];
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
};
|
|
630
|
-
|
|
631
|
-
/**
|
|
632
|
-
* ApertureEnum converter
|
|
633
|
-
*/
|
|
634
|
-
static convert_t ApertureEnum = {
|
|
635
|
-
.toTheta = @{
|
|
636
|
-
@"APERTURE_AUTO": THETACThetaRepositoryApertureEnum.apertureAuto,
|
|
637
|
-
@"APERTURE_2_0": THETACThetaRepositoryApertureEnum.aperture20,
|
|
638
|
-
@"APERTURE_2_1": THETACThetaRepositoryApertureEnum.aperture21,
|
|
639
|
-
@"APERTURE_2_4": THETACThetaRepositoryApertureEnum.aperture24,
|
|
640
|
-
@"APERTURE_3_5": THETACThetaRepositoryApertureEnum.aperture35,
|
|
641
|
-
@"APERTURE_5_6": THETACThetaRepositoryApertureEnum.aperture56
|
|
642
|
-
},
|
|
643
|
-
.fromTheta = @{
|
|
644
|
-
THETACThetaRepositoryApertureEnum.apertureAuto: @"APERTURE_AUTO",
|
|
645
|
-
THETACThetaRepositoryApertureEnum.aperture20: @"APERTURE_2_0",
|
|
646
|
-
THETACThetaRepositoryApertureEnum.aperture21: @"APERTURE_2_1",
|
|
647
|
-
THETACThetaRepositoryApertureEnum.aperture24: @"APERTURE_2_4",
|
|
648
|
-
THETACThetaRepositoryApertureEnum.aperture35: @"APERTURE_3_5",
|
|
649
|
-
THETACThetaRepositoryApertureEnum.aperture56: @"APERTURE_5_6"
|
|
650
|
-
},
|
|
651
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
652
|
-
id val = [ApertureEnum.toTheta objectForKey:[rct objectForKey:@"aperture"]];
|
|
653
|
-
if (val) {
|
|
654
|
-
opt.aperture = val;
|
|
655
|
-
}
|
|
656
|
-
},
|
|
657
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
658
|
-
id val = [ApertureEnum.fromTheta objectForKey:opt.aperture];
|
|
659
|
-
if (val) {
|
|
660
|
-
[rct setObject:val forKey:@"aperture"];
|
|
661
|
-
}
|
|
662
|
-
},
|
|
663
|
-
.setPhotoOption = ^(NSDictionary* rct, THETACPhotoCaptureBuilder *builder) {
|
|
664
|
-
id val = [ApertureEnum.toTheta objectForKey:[rct objectForKey:@"aperture"]];
|
|
665
|
-
if (val) {
|
|
666
|
-
[builder setApertureAperture:val];
|
|
667
|
-
}
|
|
668
|
-
},
|
|
669
|
-
.setTimeShiftOption = ^(NSDictionary* rct, THETACTimeShiftCaptureBuilder *builder) {
|
|
670
|
-
id val = [ApertureEnum.toTheta objectForKey:[rct objectForKey:@"aperture"]];
|
|
671
|
-
if (val) {
|
|
672
|
-
[builder setApertureAperture:val];
|
|
673
|
-
}
|
|
674
|
-
},
|
|
675
|
-
.setVideoOption = ^(NSDictionary* rct, THETACVideoCaptureBuilder *builder) {
|
|
676
|
-
id val = [ApertureEnum.toTheta objectForKey:[rct objectForKey:@"aperture"]];
|
|
677
|
-
if (val) {
|
|
678
|
-
[builder setApertureAperture:val];
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
};
|
|
682
|
-
|
|
683
|
-
/**
|
|
684
|
-
* BluetoothPowerEnum converter
|
|
685
|
-
*/
|
|
686
|
-
static convert_t BluetoothPowerEnum = {
|
|
687
|
-
.toTheta = @{
|
|
688
|
-
@"ON": THETACThetaRepositoryBluetoothPowerEnum.on,
|
|
689
|
-
@"OFF": THETACThetaRepositoryBluetoothPowerEnum.off
|
|
690
|
-
},
|
|
691
|
-
.fromTheta = @{
|
|
692
|
-
THETACThetaRepositoryBluetoothPowerEnum.on: @"ON",
|
|
693
|
-
THETACThetaRepositoryBluetoothPowerEnum.off: @"OFF"
|
|
694
|
-
},
|
|
695
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
696
|
-
id val = [BluetoothPowerEnum.toTheta objectForKey:[rct objectForKey:@"bluetoothPower"]];
|
|
697
|
-
if (val) {
|
|
698
|
-
opt.bluetoothPower = val;
|
|
699
|
-
}
|
|
700
|
-
},
|
|
701
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
702
|
-
id val = [BluetoothPowerEnum.fromTheta objectForKey:opt.bluetoothPower];
|
|
703
|
-
if (val) {
|
|
704
|
-
[rct setObject:val forKey:@"bluetoothPower"];
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
};
|
|
708
|
-
|
|
709
|
-
/**
|
|
710
|
-
* CameraControlSourceEnum converter
|
|
711
|
-
*/
|
|
712
|
-
static convert_t CameraControlSourceEnum = {
|
|
713
|
-
.toTheta = @{
|
|
714
|
-
@"CAMERA": THETACThetaRepositoryCameraControlSourceEnum.camera,
|
|
715
|
-
@"APP": THETACThetaRepositoryCameraControlSourceEnum.app
|
|
716
|
-
},
|
|
717
|
-
.fromTheta = @{
|
|
718
|
-
THETACThetaRepositoryCameraControlSourceEnum.camera: @"CAMERA",
|
|
719
|
-
THETACThetaRepositoryCameraControlSourceEnum.app: @"APP"
|
|
720
|
-
},
|
|
721
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
722
|
-
id val = [CameraControlSourceEnum.toTheta objectForKey:[rct objectForKey:@"cameraControlSource"]];
|
|
723
|
-
if (val) {
|
|
724
|
-
opt.cameraControlSource = val;
|
|
725
|
-
}
|
|
726
|
-
},
|
|
727
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
728
|
-
id val = [CameraControlSourceEnum.fromTheta objectForKey:opt.cameraControlSource];
|
|
729
|
-
if (val) {
|
|
730
|
-
[rct setObject:val forKey:@"cameraControlSource"];
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
};
|
|
734
|
-
|
|
735
|
-
/**
|
|
736
|
-
* CameraModeEnum converter
|
|
737
|
-
*/
|
|
738
|
-
static convert_t CameraModeEnum = {
|
|
739
|
-
.toTheta = @{
|
|
740
|
-
@"CAPTURE": THETACThetaRepositoryCameraModeEnum.capture,
|
|
741
|
-
@"PLAYBACK": THETACThetaRepositoryCameraModeEnum.playback,
|
|
742
|
-
@"SETTING": THETACThetaRepositoryCameraModeEnum.setting,
|
|
743
|
-
@"PLUGIN": THETACThetaRepositoryCameraModeEnum.plugin
|
|
744
|
-
},
|
|
745
|
-
.fromTheta = @{
|
|
746
|
-
THETACThetaRepositoryCameraModeEnum.capture: @"CAPTURE",
|
|
747
|
-
THETACThetaRepositoryCameraModeEnum.playback: @"PLAYBACK",
|
|
748
|
-
THETACThetaRepositoryCameraModeEnum.setting: @"SETTING",
|
|
749
|
-
THETACThetaRepositoryCameraModeEnum.plugin: @"PLUGIN"
|
|
750
|
-
},
|
|
751
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
752
|
-
id val = [CameraModeEnum.toTheta objectForKey:[rct objectForKey:@"cameraMode"]];
|
|
753
|
-
if (val) {
|
|
754
|
-
opt.cameraMode = val;
|
|
755
|
-
}
|
|
756
|
-
},
|
|
757
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
758
|
-
id val = [CameraModeEnum.fromTheta objectForKey:opt.cameraMode];
|
|
759
|
-
if (val) {
|
|
760
|
-
[rct setObject:val forKey:@"cameraMode"];
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
};
|
|
764
|
-
|
|
765
|
-
/**
|
|
766
|
-
* CaptureInterval converter
|
|
767
|
-
*/
|
|
768
|
-
static convert_t CaptureIntervalConverter = {
|
|
769
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
770
|
-
NSNumber* val = [rct objectForKey:@"captureInterval"];
|
|
771
|
-
if (val) {
|
|
772
|
-
opt.captureInterval = [THETACInt numberWithInt:[val intValue]];
|
|
773
|
-
}
|
|
774
|
-
},
|
|
775
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
776
|
-
if (opt.captureInterval) {
|
|
777
|
-
[rct setObject:opt.captureInterval forKey:@"captureInterval"];
|
|
778
|
-
}
|
|
779
|
-
},
|
|
780
|
-
};
|
|
781
|
-
|
|
782
|
-
/**
|
|
783
|
-
* CaptureModeEnum converter
|
|
784
|
-
*/
|
|
785
|
-
static convert_t CaptureModeEnum = {
|
|
786
|
-
.toTheta = @{
|
|
787
|
-
@"IMAGE": THETACThetaRepositoryCaptureModeEnum.image,
|
|
788
|
-
@"VIDEO": THETACThetaRepositoryCaptureModeEnum.video,
|
|
789
|
-
@"LIVE_STREAMING": THETACThetaRepositoryCaptureModeEnum.liveStreaming,
|
|
790
|
-
@"INTERVAL": THETACThetaRepositoryCaptureModeEnum.interval,
|
|
791
|
-
@"PRESET": THETACThetaRepositoryCaptureModeEnum.preset
|
|
792
|
-
},
|
|
793
|
-
.fromTheta = @{
|
|
794
|
-
THETACThetaRepositoryCaptureModeEnum.image: @"IMAGE",
|
|
795
|
-
THETACThetaRepositoryCaptureModeEnum.video: @"VIDEO",
|
|
796
|
-
THETACThetaRepositoryCaptureModeEnum.liveStreaming: @"LIVE_STREAMING",
|
|
797
|
-
THETACThetaRepositoryCaptureModeEnum.interval: @"INTERVAL",
|
|
798
|
-
THETACThetaRepositoryCaptureModeEnum.preset: @"PRESET"
|
|
799
|
-
},
|
|
800
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
801
|
-
id val = [CaptureModeEnum.toTheta objectForKey:[rct objectForKey:@"captureMode"]];
|
|
802
|
-
if (val) {
|
|
803
|
-
opt.captureMode = val;
|
|
804
|
-
}
|
|
805
|
-
},
|
|
806
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
807
|
-
id val = [CaptureModeEnum.fromTheta objectForKey:opt.captureMode];
|
|
808
|
-
if (val) {
|
|
809
|
-
[rct setObject:val forKey:@"captureMode"];
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
};
|
|
813
|
-
|
|
814
|
-
/**
|
|
815
|
-
* CaptureNumber converter
|
|
816
|
-
*/
|
|
817
|
-
static convert_t CaptureNumberConverter = {
|
|
818
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
819
|
-
NSNumber* val = [rct objectForKey:@"captureNumber"];
|
|
820
|
-
if (val) {
|
|
821
|
-
opt.captureNumber = [THETACInt numberWithInt:[val intValue]];
|
|
822
|
-
}
|
|
823
|
-
},
|
|
824
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
825
|
-
if (opt.captureNumber) {
|
|
826
|
-
[rct setObject:opt.captureNumber forKey:@"captureNumber"];
|
|
827
|
-
}
|
|
828
|
-
},
|
|
829
|
-
};
|
|
830
|
-
|
|
831
|
-
/**
|
|
832
|
-
* ContinuousNumberEnum converter
|
|
833
|
-
*/
|
|
834
|
-
static convert_t ContinuousNumberEnum = {
|
|
835
|
-
.toTheta = nil,
|
|
836
|
-
.fromTheta = nil,
|
|
837
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
838
|
-
if (!ContinuousNumberEnum.toTheta) {
|
|
839
|
-
NSMutableDictionary* dictionary = [[NSMutableDictionary alloc] init];
|
|
840
|
-
THETACKotlinArray* array = THETACThetaRepositoryContinuousNumberEnum.values;
|
|
841
|
-
for (int i = 0; i < array.size; i++) {
|
|
842
|
-
THETACThetaRepositoryContinuousNumberEnum* item = [array getIndex:i];
|
|
843
|
-
[dictionary setObject:item forKey:item.name];
|
|
844
|
-
}
|
|
845
|
-
ContinuousNumberEnum.toTheta = dictionary;
|
|
846
|
-
}
|
|
847
|
-
id val = [ContinuousNumberEnum.toTheta objectForKey:[rct objectForKey:@"continuousNumber"]];
|
|
848
|
-
if (val) {
|
|
849
|
-
opt.continuousNumber = val;
|
|
850
|
-
}
|
|
851
|
-
},
|
|
852
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
853
|
-
if (!ContinuousNumberEnum.fromTheta) {
|
|
854
|
-
NSMutableDictionary* dictionary = [[NSMutableDictionary alloc] init];
|
|
855
|
-
THETACKotlinArray* array = THETACThetaRepositoryContinuousNumberEnum.values;
|
|
856
|
-
for (int i = 0; i < array.size; i++) {
|
|
857
|
-
THETACThetaRepositoryContinuousNumberEnum* item = [array getIndex:i];
|
|
858
|
-
[dictionary setObject:item.name forKey:item];
|
|
859
|
-
}
|
|
860
|
-
ContinuousNumberEnum.fromTheta = dictionary;
|
|
861
|
-
}
|
|
862
|
-
id val = [ContinuousNumberEnum.fromTheta objectForKey:opt.continuousNumber];
|
|
863
|
-
if (val) {
|
|
864
|
-
[rct setObject:val forKey:@"continuousNumber"];
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
};
|
|
868
|
-
|
|
869
|
-
/**
|
|
870
|
-
* ExposureCompensationEnum converter
|
|
871
|
-
*/
|
|
872
|
-
static convert_t ExposureCompensationEnum = {
|
|
873
|
-
.toTheta = @{
|
|
874
|
-
@"M2_0": THETACThetaRepositoryExposureCompensationEnum.m20,
|
|
875
|
-
@"M1_7": THETACThetaRepositoryExposureCompensationEnum.m17,
|
|
876
|
-
@"M1_3": THETACThetaRepositoryExposureCompensationEnum.m13,
|
|
877
|
-
@"M1_0": THETACThetaRepositoryExposureCompensationEnum.m10,
|
|
878
|
-
@"M0_7": THETACThetaRepositoryExposureCompensationEnum.m07,
|
|
879
|
-
@"M0_3": THETACThetaRepositoryExposureCompensationEnum.m03,
|
|
880
|
-
@"ZERO": THETACThetaRepositoryExposureCompensationEnum.zero,
|
|
881
|
-
@"P0_3": THETACThetaRepositoryExposureCompensationEnum.p03,
|
|
882
|
-
@"P0_7": THETACThetaRepositoryExposureCompensationEnum.p07,
|
|
883
|
-
@"P1_0": THETACThetaRepositoryExposureCompensationEnum.p10,
|
|
884
|
-
@"P1_3": THETACThetaRepositoryExposureCompensationEnum.p13,
|
|
885
|
-
@"P1_7": THETACThetaRepositoryExposureCompensationEnum.p17,
|
|
886
|
-
@"P2_0": THETACThetaRepositoryExposureCompensationEnum.p20
|
|
887
|
-
},
|
|
888
|
-
.fromTheta = @{
|
|
889
|
-
THETACThetaRepositoryExposureCompensationEnum.m20: @"M2_0",
|
|
890
|
-
THETACThetaRepositoryExposureCompensationEnum.m17: @"M1_7",
|
|
891
|
-
THETACThetaRepositoryExposureCompensationEnum.m13: @"M1_3",
|
|
892
|
-
THETACThetaRepositoryExposureCompensationEnum.m10: @"M1_0",
|
|
893
|
-
THETACThetaRepositoryExposureCompensationEnum.m07: @"M0_7",
|
|
894
|
-
THETACThetaRepositoryExposureCompensationEnum.m03: @"M0_3",
|
|
895
|
-
THETACThetaRepositoryExposureCompensationEnum.zero: @"ZERO",
|
|
896
|
-
THETACThetaRepositoryExposureCompensationEnum.p03: @"P0_3",
|
|
897
|
-
THETACThetaRepositoryExposureCompensationEnum.p07: @"P0_7",
|
|
898
|
-
THETACThetaRepositoryExposureCompensationEnum.p10: @"P1_0",
|
|
899
|
-
THETACThetaRepositoryExposureCompensationEnum.p13: @"P1_3",
|
|
900
|
-
THETACThetaRepositoryExposureCompensationEnum.p17: @"P1_7",
|
|
901
|
-
THETACThetaRepositoryExposureCompensationEnum.p20: @"P2_0",
|
|
902
|
-
},
|
|
903
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
904
|
-
id val = [ExposureCompensationEnum.toTheta
|
|
905
|
-
objectForKey:[rct objectForKey:@"exposureCompensation"]];
|
|
906
|
-
if (val) {
|
|
907
|
-
opt.exposureCompensation = val;
|
|
908
|
-
}
|
|
909
|
-
},
|
|
910
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
911
|
-
id val = [ExposureCompensationEnum.fromTheta objectForKey:opt.exposureCompensation];
|
|
912
|
-
if (val) {
|
|
913
|
-
[rct setObject:val forKey:@"exposureCompensation"];
|
|
914
|
-
}
|
|
915
|
-
},
|
|
916
|
-
.setPhotoOption = ^(NSDictionary* rct, THETACPhotoCaptureBuilder *builder) {
|
|
917
|
-
id val = [ExposureCompensationEnum.toTheta
|
|
918
|
-
objectForKey:[rct objectForKey:@"exposureCompensation"]];
|
|
919
|
-
if (val) {
|
|
920
|
-
[builder setExposureCompensationValue:val];
|
|
921
|
-
}
|
|
922
|
-
},
|
|
923
|
-
.setTimeShiftOption = ^(NSDictionary* rct, THETACTimeShiftCaptureBuilder *builder) {
|
|
924
|
-
id val = [ExposureCompensationEnum.toTheta objectForKey:[rct objectForKey:@"exposureCompensation"]];
|
|
925
|
-
if (val) {
|
|
926
|
-
[builder setExposureCompensationValue:val];
|
|
927
|
-
}
|
|
928
|
-
},
|
|
929
|
-
.setVideoOption = ^(NSDictionary* rct, THETACVideoCaptureBuilder *builder) {
|
|
930
|
-
id val = [ExposureCompensationEnum.toTheta
|
|
931
|
-
objectForKey:[rct objectForKey:@"exposureCompensation"]];
|
|
932
|
-
if (val) {
|
|
933
|
-
[builder setExposureCompensationValue:val];
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
};
|
|
937
|
-
|
|
938
|
-
/**
|
|
939
|
-
* ExposureDelayEnum converter
|
|
940
|
-
*/
|
|
941
|
-
static convert_t ExposureDelayEnum = {
|
|
942
|
-
.toTheta = @{
|
|
943
|
-
@"DELAY_OFF": THETACThetaRepositoryExposureDelayEnum.delayOff,
|
|
944
|
-
@"DELAY_1": THETACThetaRepositoryExposureDelayEnum.delay1,
|
|
945
|
-
@"DELAY_2": THETACThetaRepositoryExposureDelayEnum.delay2,
|
|
946
|
-
@"DELAY_3": THETACThetaRepositoryExposureDelayEnum.delay3,
|
|
947
|
-
@"DELAY_4": THETACThetaRepositoryExposureDelayEnum.delay4,
|
|
948
|
-
@"DELAY_5": THETACThetaRepositoryExposureDelayEnum.delay5,
|
|
949
|
-
@"DELAY_6": THETACThetaRepositoryExposureDelayEnum.delay6,
|
|
950
|
-
@"DELAY_7": THETACThetaRepositoryExposureDelayEnum.delay7,
|
|
951
|
-
@"DELAY_8": THETACThetaRepositoryExposureDelayEnum.delay8,
|
|
952
|
-
@"DELAY_9": THETACThetaRepositoryExposureDelayEnum.delay9,
|
|
953
|
-
@"DELAY_10": THETACThetaRepositoryExposureDelayEnum.delay10
|
|
954
|
-
},
|
|
955
|
-
.fromTheta = @{
|
|
956
|
-
THETACThetaRepositoryExposureDelayEnum.delayOff: @"DELAY_OFF",
|
|
957
|
-
THETACThetaRepositoryExposureDelayEnum.delay1: @"DELAY_1",
|
|
958
|
-
THETACThetaRepositoryExposureDelayEnum.delay2: @"DELAY_2",
|
|
959
|
-
THETACThetaRepositoryExposureDelayEnum.delay3: @"DELAY_3",
|
|
960
|
-
THETACThetaRepositoryExposureDelayEnum.delay4: @"DELAY_4",
|
|
961
|
-
THETACThetaRepositoryExposureDelayEnum.delay5: @"DELAY_5",
|
|
962
|
-
THETACThetaRepositoryExposureDelayEnum.delay6: @"DELAY_6",
|
|
963
|
-
THETACThetaRepositoryExposureDelayEnum.delay7: @"DELAY_7",
|
|
964
|
-
THETACThetaRepositoryExposureDelayEnum.delay8: @"DELAY_8",
|
|
965
|
-
THETACThetaRepositoryExposureDelayEnum.delay9: @"DELAY_9",
|
|
966
|
-
THETACThetaRepositoryExposureDelayEnum.delay10: @"DELAY_10"
|
|
967
|
-
},
|
|
968
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
969
|
-
id val = [ExposureDelayEnum.toTheta objectForKey:[rct objectForKey:@"exposureDelay"]];
|
|
970
|
-
if (val) {
|
|
971
|
-
opt.exposureDelay = val;
|
|
972
|
-
}
|
|
973
|
-
},
|
|
974
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
975
|
-
id val = [ExposureDelayEnum.fromTheta objectForKey:opt.exposureDelay];
|
|
976
|
-
if (val) {
|
|
977
|
-
[rct setObject:val forKey:@"exposureDelay"];
|
|
978
|
-
}
|
|
979
|
-
},
|
|
980
|
-
.setPhotoOption = ^(NSDictionary* rct, THETACPhotoCaptureBuilder *builder) {
|
|
981
|
-
id val = [ExposureDelayEnum.toTheta objectForKey:[rct objectForKey:@"exposureDelay"]];
|
|
982
|
-
if (val) {
|
|
983
|
-
[builder setExposureDelayDelay:val];
|
|
984
|
-
}
|
|
985
|
-
},
|
|
986
|
-
.setTimeShiftOption = ^(NSDictionary* rct, THETACTimeShiftCaptureBuilder *builder) {
|
|
987
|
-
id val = [ExposureDelayEnum.toTheta objectForKey:[rct objectForKey:@"exposureDelay"]];
|
|
988
|
-
if (val) {
|
|
989
|
-
[builder setExposureDelayDelay:val];
|
|
990
|
-
}
|
|
991
|
-
},
|
|
992
|
-
.setVideoOption = ^(NSDictionary* rct, THETACVideoCaptureBuilder *builder) {
|
|
993
|
-
id val = [ExposureDelayEnum.toTheta objectForKey:[rct objectForKey:@"exposureDelay"]];
|
|
994
|
-
if (val) {
|
|
995
|
-
[builder setExposureDelayDelay:val];
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
};
|
|
999
|
-
|
|
1000
|
-
/**
|
|
1001
|
-
* ExposureProgramEnum converter
|
|
1002
|
-
*/
|
|
1003
|
-
static convert_t ExposureProgramEnum = {
|
|
1004
|
-
.toTheta = @{
|
|
1005
|
-
@"MANUAL": THETACThetaRepositoryExposureProgramEnum.manual,
|
|
1006
|
-
@"NORMAL_PROGRAM": THETACThetaRepositoryExposureProgramEnum.normalProgram,
|
|
1007
|
-
@"APERTURE_PRIORITY": THETACThetaRepositoryExposureProgramEnum.aperturePriority,
|
|
1008
|
-
@"SHUTTER_PRIORITY": THETACThetaRepositoryExposureProgramEnum.shutterPriority,
|
|
1009
|
-
@"ISO_PRIORITY": THETACThetaRepositoryExposureProgramEnum.isoPriority
|
|
1010
|
-
},
|
|
1011
|
-
.fromTheta = @{
|
|
1012
|
-
THETACThetaRepositoryExposureProgramEnum.manual: @"MANUAL",
|
|
1013
|
-
THETACThetaRepositoryExposureProgramEnum.normalProgram: @"NORMAL_PROGRAM",
|
|
1014
|
-
THETACThetaRepositoryExposureProgramEnum.aperturePriority: @"APERTURE_PRIORITY",
|
|
1015
|
-
THETACThetaRepositoryExposureProgramEnum.shutterPriority: @"SHUTTER_PRIORITY",
|
|
1016
|
-
THETACThetaRepositoryExposureProgramEnum.isoPriority: @"ISO_PRIORITY"
|
|
1017
|
-
},
|
|
1018
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1019
|
-
id val = [ExposureProgramEnum.toTheta
|
|
1020
|
-
objectForKey:[rct objectForKey:@"exposureProgram"]];
|
|
1021
|
-
if (val) {
|
|
1022
|
-
opt.exposureProgram = val;
|
|
1023
|
-
}
|
|
1024
|
-
},
|
|
1025
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1026
|
-
id val = [ExposureProgramEnum.fromTheta objectForKey:opt.exposureProgram];
|
|
1027
|
-
if (val) {
|
|
1028
|
-
[rct setObject:val forKey:@"exposureProgram"];
|
|
1029
|
-
}
|
|
1030
|
-
},
|
|
1031
|
-
.setPhotoOption = ^(NSDictionary* rct, THETACPhotoCaptureBuilder *builder) {
|
|
1032
|
-
id val = [ExposureProgramEnum.toTheta
|
|
1033
|
-
objectForKey:[rct objectForKey:@"exposureProgram"]];
|
|
1034
|
-
if (val) {
|
|
1035
|
-
[builder setExposureProgramProgram:val];
|
|
1036
|
-
}
|
|
1037
|
-
},
|
|
1038
|
-
.setTimeShiftOption = ^(NSDictionary* rct, THETACTimeShiftCaptureBuilder *builder) {
|
|
1039
|
-
id val = [ExposureProgramEnum.toTheta objectForKey:[rct objectForKey:@"exposureProgram"]];
|
|
1040
|
-
if (val) {
|
|
1041
|
-
[builder setExposureProgramProgram:val];
|
|
1042
|
-
}
|
|
1043
|
-
},
|
|
1044
|
-
.setVideoOption = ^(NSDictionary* rct, THETACVideoCaptureBuilder *builder) {
|
|
1045
|
-
id val = [ExposureProgramEnum.toTheta
|
|
1046
|
-
objectForKey:[rct objectForKey:@"exposureProgram"]];
|
|
1047
|
-
if (val) {
|
|
1048
|
-
[builder setExposureProgramProgram:val];
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
};
|
|
1052
|
-
|
|
1053
|
-
/**
|
|
1054
|
-
* FileFormatTypeEnum converter
|
|
1055
|
-
*/
|
|
1056
|
-
static convert_t FileFormatTypeEnum = {
|
|
1057
|
-
.toTheta = @{
|
|
1058
|
-
@"JPEG": THETACThetaRepositoryFileFormatTypeEnum.jpeg,
|
|
1059
|
-
@"MP4": THETACThetaRepositoryFileFormatTypeEnum.mp4,
|
|
1060
|
-
@"RAW": THETACThetaRepositoryFileFormatTypeEnum.raw
|
|
1061
|
-
},
|
|
1062
|
-
.fromTheta = @{
|
|
1063
|
-
THETACThetaRepositoryFileFormatTypeEnum.jpeg: @"JPEG",
|
|
1064
|
-
THETACThetaRepositoryFileFormatTypeEnum.mp4: @"MP4",
|
|
1065
|
-
THETACThetaRepositoryFileFormatTypeEnum.raw: @"RAW"
|
|
1066
|
-
}
|
|
1067
|
-
};
|
|
1068
|
-
|
|
1069
|
-
/**
|
|
1070
|
-
* FileFormatEnum converter
|
|
1071
|
-
*/
|
|
1072
|
-
static convert_t FileFormatEnum = {
|
|
1073
|
-
.toTheta = @{
|
|
1074
|
-
@"IMAGE_2K": THETACThetaRepositoryFileFormatEnum.image2k,
|
|
1075
|
-
@"IMAGE_5K": THETACThetaRepositoryFileFormatEnum.image5k,
|
|
1076
|
-
@"IMAGE_6_7K": THETACThetaRepositoryFileFormatEnum.image67k,
|
|
1077
|
-
@"RAW_P_6_7K": THETACThetaRepositoryFileFormatEnum.rawP67k,
|
|
1078
|
-
@"IMAGE_5_5K": THETACThetaRepositoryFileFormatEnum.image55k,
|
|
1079
|
-
@"IMAGE_11K": THETACThetaRepositoryFileFormatEnum.image11k,
|
|
1080
|
-
@"VIDEO_HD": THETACThetaRepositoryFileFormatEnum.videoHd,
|
|
1081
|
-
@"VIDEO_FULL_HD": THETACThetaRepositoryFileFormatEnum.videoFullHd,
|
|
1082
|
-
@"VIDEO_2K": THETACThetaRepositoryFileFormatEnum.video2k,
|
|
1083
|
-
@"VIDEO_4K": THETACThetaRepositoryFileFormatEnum.video4k,
|
|
1084
|
-
@"VIDEO_2K_30F": THETACThetaRepositoryFileFormatEnum.video2k30f,
|
|
1085
|
-
@"VIDEO_2K_60F": THETACThetaRepositoryFileFormatEnum.video2k60f,
|
|
1086
|
-
@"VIDEO_4K_30F": THETACThetaRepositoryFileFormatEnum.video4k30f,
|
|
1087
|
-
@"VIDEO_4K_60F": THETACThetaRepositoryFileFormatEnum.video4k60f,
|
|
1088
|
-
@"VIDEO_5_7K_2F": THETACThetaRepositoryFileFormatEnum.video57k2f,
|
|
1089
|
-
@"VIDEO_5_7K_5F": THETACThetaRepositoryFileFormatEnum.video57k5f,
|
|
1090
|
-
@"VIDEO_5_7K_30F": THETACThetaRepositoryFileFormatEnum.video57k30f,
|
|
1091
|
-
@"VIDEO_7K_2F": THETACThetaRepositoryFileFormatEnum.video7k2f,
|
|
1092
|
-
@"VIDEO_7K_5F": THETACThetaRepositoryFileFormatEnum.video7k5f,
|
|
1093
|
-
@"VIDEO_7K_10F": THETACThetaRepositoryFileFormatEnum.video7k10f
|
|
1094
|
-
},
|
|
1095
|
-
.fromTheta = @{
|
|
1096
|
-
THETACThetaRepositoryFileFormatEnum.image2k: @"IMAGE_2K",
|
|
1097
|
-
THETACThetaRepositoryFileFormatEnum.image5k: @"IMAGE_5K",
|
|
1098
|
-
THETACThetaRepositoryFileFormatEnum.image67k: @"IMAGE_6_7K",
|
|
1099
|
-
THETACThetaRepositoryFileFormatEnum.rawP67k: @"RAW_P_6_7K",
|
|
1100
|
-
THETACThetaRepositoryFileFormatEnum.image55k: @"IMAGE_5_5K",
|
|
1101
|
-
THETACThetaRepositoryFileFormatEnum.image11k: @"IMAGE_11K",
|
|
1102
|
-
THETACThetaRepositoryFileFormatEnum.videoHd: @"VIDEO_HD",
|
|
1103
|
-
THETACThetaRepositoryFileFormatEnum.videoFullHd: @"VIDEO_FULL_HD",
|
|
1104
|
-
THETACThetaRepositoryFileFormatEnum.video2k: @"VIDEO_2K",
|
|
1105
|
-
THETACThetaRepositoryFileFormatEnum.video4k: @"VIDEO_4K",
|
|
1106
|
-
THETACThetaRepositoryFileFormatEnum.video2k30f: @"VIDEO_2K_30F",
|
|
1107
|
-
THETACThetaRepositoryFileFormatEnum.video2k60f: @"VIDEO_2K_60F",
|
|
1108
|
-
THETACThetaRepositoryFileFormatEnum.video4k30f: @"VIDEO_4K_30F",
|
|
1109
|
-
THETACThetaRepositoryFileFormatEnum.video4k60f: @"VIDEO_4K_60F",
|
|
1110
|
-
THETACThetaRepositoryFileFormatEnum.video57k2f: @"VIDEO_5_7K_2F",
|
|
1111
|
-
THETACThetaRepositoryFileFormatEnum.video57k5f: @"VIDEO_5_7K_5F",
|
|
1112
|
-
THETACThetaRepositoryFileFormatEnum.video57k30f: @"VIDEO_5_7K_30F",
|
|
1113
|
-
THETACThetaRepositoryFileFormatEnum.video7k2f: @"VIDEO_7K_2F",
|
|
1114
|
-
THETACThetaRepositoryFileFormatEnum.video7k5f: @"VIDEO_7K_5F",
|
|
1115
|
-
THETACThetaRepositoryFileFormatEnum.video7k10f: @"VIDEO_7K_10F"
|
|
1116
|
-
},
|
|
1117
|
-
.photoOption = @{
|
|
1118
|
-
@"IMAGE_2K": THETACThetaRepositoryPhotoFileFormatEnum.image2k,
|
|
1119
|
-
@"IMAGE_5K": THETACThetaRepositoryPhotoFileFormatEnum.image5k,
|
|
1120
|
-
@"IMAGE_6_7K": THETACThetaRepositoryPhotoFileFormatEnum.image67k,
|
|
1121
|
-
@"RAW_P_6_7K": THETACThetaRepositoryPhotoFileFormatEnum.rawP67k,
|
|
1122
|
-
@"IMAGE_5_5K": THETACThetaRepositoryPhotoFileFormatEnum.image55k,
|
|
1123
|
-
@"IMAGE_11K": THETACThetaRepositoryPhotoFileFormatEnum.image11k,
|
|
1124
|
-
},
|
|
1125
|
-
.videoOption = @{
|
|
1126
|
-
@"VIDEO_HD": THETACThetaRepositoryVideoFileFormatEnum.videoHd,
|
|
1127
|
-
@"VIDEO_FULL_HD": THETACThetaRepositoryVideoFileFormatEnum.videoFullHd,
|
|
1128
|
-
@"VIDEO_2K": THETACThetaRepositoryVideoFileFormatEnum.video2k,
|
|
1129
|
-
@"VIDEO_4K": THETACThetaRepositoryVideoFileFormatEnum.video4k,
|
|
1130
|
-
@"VIDEO_2K_30F": THETACThetaRepositoryVideoFileFormatEnum.video2k30f,
|
|
1131
|
-
@"VIDEO_2K_60F": THETACThetaRepositoryVideoFileFormatEnum.video2k60f,
|
|
1132
|
-
@"VIDEO_4K_30F": THETACThetaRepositoryVideoFileFormatEnum.video4k30f,
|
|
1133
|
-
@"VIDEO_4K_60F": THETACThetaRepositoryVideoFileFormatEnum.video4k60f,
|
|
1134
|
-
@"VIDEO_5_7K_2F": THETACThetaRepositoryVideoFileFormatEnum.video57k2f,
|
|
1135
|
-
@"VIDEO_5_7K_5F": THETACThetaRepositoryVideoFileFormatEnum.video57k5f,
|
|
1136
|
-
@"VIDEO_5_7K_30F": THETACThetaRepositoryVideoFileFormatEnum.video57k30f,
|
|
1137
|
-
@"VIDEO_7K_2F": THETACThetaRepositoryVideoFileFormatEnum.video7k2f,
|
|
1138
|
-
@"VIDEO_7K_5F": THETACThetaRepositoryVideoFileFormatEnum.video7k5f,
|
|
1139
|
-
@"VIDEO_7K_10F": THETACThetaRepositoryVideoFileFormatEnum.video7k10f
|
|
1140
|
-
},
|
|
1141
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1142
|
-
id val = [FileFormatEnum.toTheta objectForKey:[rct objectForKey:@"fileFormat"]];
|
|
1143
|
-
if (val) {
|
|
1144
|
-
opt.fileFormat = val;
|
|
1145
|
-
}
|
|
1146
|
-
},
|
|
1147
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1148
|
-
id val = [FileFormatEnum.fromTheta objectForKey:opt.fileFormat];
|
|
1149
|
-
if (val) {
|
|
1150
|
-
[rct setObject:val forKey:@"fileFormat"];
|
|
1151
|
-
}
|
|
1152
|
-
},
|
|
1153
|
-
.setPhotoOption = ^(NSDictionary* rct, THETACPhotoCaptureBuilder *builder) {
|
|
1154
|
-
id val = [FileFormatEnum.photoOption objectForKey:[rct objectForKey:@"fileFormat"]];
|
|
1155
|
-
if (val) {
|
|
1156
|
-
[builder setFileFormatFileFormat:val];
|
|
1157
|
-
}
|
|
1158
|
-
},
|
|
1159
|
-
.setVideoOption = ^(NSDictionary* rct, THETACVideoCaptureBuilder *builder) {
|
|
1160
|
-
id val = [FileFormatEnum.videoOption objectForKey:[rct objectForKey:@"fileFormat"]];
|
|
1161
|
-
if (val) {
|
|
1162
|
-
[builder setFileFormatFileFormat:val];
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
};
|
|
1166
|
-
|
|
1167
|
-
/**
|
|
1168
|
-
* FilterEnum converter
|
|
1169
|
-
*/
|
|
1170
|
-
static convert_t FilterEnum = {
|
|
1171
|
-
.toTheta = @{
|
|
1172
|
-
@"OFF": THETACThetaRepositoryFilterEnum.off,
|
|
1173
|
-
@"DR_COMP": THETACThetaRepositoryFilterEnum.drComp,
|
|
1174
|
-
@"NOISE_REDUCTION": THETACThetaRepositoryFilterEnum.noiseReduction,
|
|
1175
|
-
@"HDR": THETACThetaRepositoryFilterEnum.hdr,
|
|
1176
|
-
@"HH_HDR": THETACThetaRepositoryFilterEnum.hhHdr
|
|
1177
|
-
},
|
|
1178
|
-
.fromTheta = @{
|
|
1179
|
-
THETACThetaRepositoryFilterEnum.off: @"OFF",
|
|
1180
|
-
THETACThetaRepositoryFilterEnum.drComp: @"DR_COMP",
|
|
1181
|
-
THETACThetaRepositoryFilterEnum.noiseReduction: @"NOISE_REDUCTION",
|
|
1182
|
-
THETACThetaRepositoryFilterEnum.hdr: @"HDR",
|
|
1183
|
-
THETACThetaRepositoryFilterEnum.hhHdr: @"HH_HDR"
|
|
1184
|
-
},
|
|
1185
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1186
|
-
id val = [FilterEnum.toTheta objectForKey:[rct objectForKey:@"filter"]];
|
|
1187
|
-
if (val) {
|
|
1188
|
-
opt.filter = val;
|
|
1189
|
-
}
|
|
1190
|
-
},
|
|
1191
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1192
|
-
id val = [FilterEnum.fromTheta objectForKey:opt.filter];
|
|
1193
|
-
if (val) {
|
|
1194
|
-
[rct setObject:val forKey:@"filter"];
|
|
1195
|
-
}
|
|
1196
|
-
},
|
|
1197
|
-
.setPhotoOption = ^(NSDictionary* rct, THETACPhotoCaptureBuilder *builder) {
|
|
1198
|
-
id val = [FilterEnum.toTheta objectForKey:[rct objectForKey:@"filter"]];
|
|
1199
|
-
if (val) {
|
|
1200
|
-
[builder setFilterFilter:val];
|
|
1201
|
-
}
|
|
1202
|
-
}
|
|
1203
|
-
};
|
|
1204
|
-
|
|
1205
|
-
/**
|
|
1206
|
-
* GpsTagRecordingEnum converter
|
|
1207
|
-
*/
|
|
1208
|
-
static convert_t GpsTagRecordingEnum = {
|
|
1209
|
-
.toTheta = @{
|
|
1210
|
-
@"ON": THETACThetaRepositoryGpsTagRecordingEnum.on,
|
|
1211
|
-
@"OFF": THETACThetaRepositoryGpsTagRecordingEnum.off
|
|
1212
|
-
},
|
|
1213
|
-
.fromTheta = @{
|
|
1214
|
-
THETACThetaRepositoryGpsTagRecordingEnum.on: @"ON",
|
|
1215
|
-
THETACThetaRepositoryGpsTagRecordingEnum.off: @"OFF"
|
|
1216
|
-
},
|
|
1217
|
-
.setPhotoOption = ^(NSDictionary* rct, THETACPhotoCaptureBuilder *builder) {
|
|
1218
|
-
id val = [GpsTagRecordingEnum.toTheta
|
|
1219
|
-
objectForKey:[rct objectForKey:@"_gpsTagRecording"]];
|
|
1220
|
-
if (val) {
|
|
1221
|
-
[builder setGpsTagRecordingValue:val];
|
|
1222
|
-
}
|
|
1223
|
-
},
|
|
1224
|
-
.setTimeShiftOption = ^(NSDictionary* rct, THETACTimeShiftCaptureBuilder *builder) {
|
|
1225
|
-
id val = [GpsTagRecordingEnum.toTheta objectForKey:[rct objectForKey:@"_gpsTagRecording"]];
|
|
1226
|
-
if (val) {
|
|
1227
|
-
[builder setGpsTagRecordingValue:val];
|
|
1228
|
-
}
|
|
1229
|
-
},
|
|
1230
|
-
.setVideoOption = ^(NSDictionary* rct, THETACVideoCaptureBuilder *builder) {
|
|
1231
|
-
id val = [GpsTagRecordingEnum.toTheta
|
|
1232
|
-
objectForKey:[rct objectForKey:@"_gpsTagRecording"]];
|
|
1233
|
-
if (val) {
|
|
1234
|
-
[builder setGpsTagRecordingValue:val];
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
};
|
|
1238
|
-
|
|
1239
|
-
/**
|
|
1240
|
-
* IsoEnum converter
|
|
1241
|
-
*/
|
|
1242
|
-
static convert_t IsoEnum = {
|
|
1243
|
-
.toTheta = @{
|
|
1244
|
-
@"ISO_AUTO": THETACThetaRepositoryIsoEnum.isoAuto,
|
|
1245
|
-
@"ISO_50": THETACThetaRepositoryIsoEnum.iso50,
|
|
1246
|
-
@"ISO_64": THETACThetaRepositoryIsoEnum.iso64,
|
|
1247
|
-
@"ISO_80": THETACThetaRepositoryIsoEnum.iso80,
|
|
1248
|
-
@"ISO_100": THETACThetaRepositoryIsoEnum.iso100,
|
|
1249
|
-
@"ISO_125": THETACThetaRepositoryIsoEnum.iso125,
|
|
1250
|
-
@"ISO_160": THETACThetaRepositoryIsoEnum.iso160,
|
|
1251
|
-
@"ISO_200": THETACThetaRepositoryIsoEnum.iso200,
|
|
1252
|
-
@"ISO_250": THETACThetaRepositoryIsoEnum.iso250,
|
|
1253
|
-
@"ISO_320": THETACThetaRepositoryIsoEnum.iso320,
|
|
1254
|
-
@"ISO_400": THETACThetaRepositoryIsoEnum.iso400,
|
|
1255
|
-
@"ISO_500": THETACThetaRepositoryIsoEnum.iso500,
|
|
1256
|
-
@"ISO_640": THETACThetaRepositoryIsoEnum.iso640,
|
|
1257
|
-
@"ISO_800": THETACThetaRepositoryIsoEnum.iso800,
|
|
1258
|
-
@"ISO_1000": THETACThetaRepositoryIsoEnum.iso1000,
|
|
1259
|
-
@"ISO_1250": THETACThetaRepositoryIsoEnum.iso1250,
|
|
1260
|
-
@"ISO_1600": THETACThetaRepositoryIsoEnum.iso1600,
|
|
1261
|
-
@"ISO_2000": THETACThetaRepositoryIsoEnum.iso2000,
|
|
1262
|
-
@"ISO_2500": THETACThetaRepositoryIsoEnum.iso2500,
|
|
1263
|
-
@"ISO_3200": THETACThetaRepositoryIsoEnum.iso3200,
|
|
1264
|
-
@"ISO_4000": THETACThetaRepositoryIsoEnum.iso4000,
|
|
1265
|
-
@"ISO_5000": THETACThetaRepositoryIsoEnum.iso5000,
|
|
1266
|
-
@"ISO_6400": THETACThetaRepositoryIsoEnum.iso6400
|
|
1267
|
-
},
|
|
1268
|
-
.fromTheta = @{
|
|
1269
|
-
THETACThetaRepositoryIsoEnum.isoAuto: @"ISO_AUTO",
|
|
1270
|
-
THETACThetaRepositoryIsoEnum.iso50: @"ISO_50",
|
|
1271
|
-
THETACThetaRepositoryIsoEnum.iso64: @"ISO_64",
|
|
1272
|
-
THETACThetaRepositoryIsoEnum.iso80: @"ISO_80",
|
|
1273
|
-
THETACThetaRepositoryIsoEnum.iso100: @"ISO_100",
|
|
1274
|
-
THETACThetaRepositoryIsoEnum.iso125: @"ISO_125",
|
|
1275
|
-
THETACThetaRepositoryIsoEnum.iso160: @"ISO_160",
|
|
1276
|
-
THETACThetaRepositoryIsoEnum.iso200: @"ISO_200",
|
|
1277
|
-
THETACThetaRepositoryIsoEnum.iso250: @"ISO_250",
|
|
1278
|
-
THETACThetaRepositoryIsoEnum.iso320: @"ISO_320",
|
|
1279
|
-
THETACThetaRepositoryIsoEnum.iso400: @"ISO_400",
|
|
1280
|
-
THETACThetaRepositoryIsoEnum.iso500: @"ISO_500",
|
|
1281
|
-
THETACThetaRepositoryIsoEnum.iso640: @"ISO_640",
|
|
1282
|
-
THETACThetaRepositoryIsoEnum.iso800: @"ISO_800",
|
|
1283
|
-
THETACThetaRepositoryIsoEnum.iso1000: @"ISO_1000",
|
|
1284
|
-
THETACThetaRepositoryIsoEnum.iso1250: @"ISO_1250",
|
|
1285
|
-
THETACThetaRepositoryIsoEnum.iso1600: @"ISO_1600",
|
|
1286
|
-
THETACThetaRepositoryIsoEnum.iso2000: @"ISO_2000",
|
|
1287
|
-
THETACThetaRepositoryIsoEnum.iso2500: @"ISO_2500",
|
|
1288
|
-
THETACThetaRepositoryIsoEnum.iso3200: @"ISO_3200",
|
|
1289
|
-
THETACThetaRepositoryIsoEnum.iso4000: @"ISO_4000",
|
|
1290
|
-
THETACThetaRepositoryIsoEnum.iso5000: @"ISO_5000",
|
|
1291
|
-
THETACThetaRepositoryIsoEnum.iso6400: @"ISO_6400"
|
|
1292
|
-
},
|
|
1293
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1294
|
-
id val = [IsoEnum.toTheta objectForKey:[rct objectForKey:@"iso"]];
|
|
1295
|
-
if (val) {
|
|
1296
|
-
opt.iso = val;
|
|
1297
|
-
}
|
|
1298
|
-
},
|
|
1299
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1300
|
-
id val = [IsoEnum.fromTheta objectForKey:opt.iso];
|
|
1301
|
-
if (val) {
|
|
1302
|
-
[rct setObject:val forKey:@"iso"];
|
|
1303
|
-
}
|
|
1304
|
-
},
|
|
1305
|
-
.setPhotoOption = ^(NSDictionary* rct, THETACPhotoCaptureBuilder *builder) {
|
|
1306
|
-
id val = [IsoEnum.toTheta objectForKey:[rct objectForKey:@"iso"]];
|
|
1307
|
-
if (val) {
|
|
1308
|
-
[builder setIsoIso:val];
|
|
1309
|
-
}
|
|
1310
|
-
},
|
|
1311
|
-
.setTimeShiftOption = ^(NSDictionary* rct, THETACTimeShiftCaptureBuilder *builder) {
|
|
1312
|
-
id val = [IsoEnum.toTheta objectForKey:[rct objectForKey:@"iso"]];
|
|
1313
|
-
if (val) {
|
|
1314
|
-
[builder setIsoIso:val];
|
|
1315
|
-
}
|
|
1316
|
-
},
|
|
1317
|
-
.setVideoOption = ^(NSDictionary* rct, THETACVideoCaptureBuilder *builder) {
|
|
1318
|
-
id val = [IsoEnum.toTheta objectForKey:[rct objectForKey:@"iso"]];
|
|
1319
|
-
if (val) {
|
|
1320
|
-
[builder setIsoIso:val];
|
|
1321
|
-
}
|
|
1322
|
-
}
|
|
1323
|
-
};
|
|
1324
|
-
|
|
1325
|
-
/**
|
|
1326
|
-
* IsoAutoHighLimitEnum converter
|
|
1327
|
-
*/
|
|
1328
|
-
static convert_t IsoAutoHighLimitEnum = {
|
|
1329
|
-
.toTheta = @{
|
|
1330
|
-
@"ISO_100": THETACThetaRepositoryIsoAutoHighLimitEnum.iso100,
|
|
1331
|
-
@"ISO_125": THETACThetaRepositoryIsoAutoHighLimitEnum.iso125,
|
|
1332
|
-
@"ISO_160": THETACThetaRepositoryIsoAutoHighLimitEnum.iso160,
|
|
1333
|
-
@"ISO_200": THETACThetaRepositoryIsoAutoHighLimitEnum.iso200,
|
|
1334
|
-
@"ISO_250": THETACThetaRepositoryIsoAutoHighLimitEnum.iso250,
|
|
1335
|
-
@"ISO_320": THETACThetaRepositoryIsoAutoHighLimitEnum.iso320,
|
|
1336
|
-
@"ISO_400": THETACThetaRepositoryIsoAutoHighLimitEnum.iso400,
|
|
1337
|
-
@"ISO_500": THETACThetaRepositoryIsoAutoHighLimitEnum.iso500,
|
|
1338
|
-
@"ISO_640": THETACThetaRepositoryIsoAutoHighLimitEnum.iso640,
|
|
1339
|
-
@"ISO_800": THETACThetaRepositoryIsoAutoHighLimitEnum.iso800,
|
|
1340
|
-
@"ISO_1000": THETACThetaRepositoryIsoAutoHighLimitEnum.iso1000,
|
|
1341
|
-
@"ISO_1250": THETACThetaRepositoryIsoAutoHighLimitEnum.iso1250,
|
|
1342
|
-
@"ISO_1600": THETACThetaRepositoryIsoAutoHighLimitEnum.iso1600,
|
|
1343
|
-
@"ISO_2000": THETACThetaRepositoryIsoAutoHighLimitEnum.iso2000,
|
|
1344
|
-
@"ISO_2500": THETACThetaRepositoryIsoAutoHighLimitEnum.iso2500,
|
|
1345
|
-
@"ISO_3200": THETACThetaRepositoryIsoAutoHighLimitEnum.iso3200,
|
|
1346
|
-
@"ISO_4000": THETACThetaRepositoryIsoAutoHighLimitEnum.iso4000,
|
|
1347
|
-
@"ISO_5000": THETACThetaRepositoryIsoAutoHighLimitEnum.iso5000,
|
|
1348
|
-
@"ISO_6400": THETACThetaRepositoryIsoAutoHighLimitEnum.iso6400
|
|
1349
|
-
},
|
|
1350
|
-
.fromTheta = @{
|
|
1351
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso100: @"ISO_100",
|
|
1352
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso125: @"ISO_125",
|
|
1353
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso160: @"ISO_160",
|
|
1354
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso200: @"ISO_200",
|
|
1355
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso250: @"ISO_250",
|
|
1356
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso320: @"ISO_320",
|
|
1357
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso400: @"ISO_400",
|
|
1358
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso500: @"ISO_500",
|
|
1359
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso640: @"ISO_640",
|
|
1360
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso800: @"ISO_800",
|
|
1361
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso1000: @"ISO_1000",
|
|
1362
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso1250: @"ISO_1250",
|
|
1363
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso1600: @"ISO_1600",
|
|
1364
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso2000: @"ISO_2000",
|
|
1365
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso2500: @"ISO_2500",
|
|
1366
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso3200: @"ISO_3200",
|
|
1367
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso4000: @"ISO_4000",
|
|
1368
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso5000: @"ISO_5000",
|
|
1369
|
-
THETACThetaRepositoryIsoAutoHighLimitEnum.iso6400: @"ISO_6400"
|
|
1370
|
-
},
|
|
1371
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1372
|
-
id val = [IsoAutoHighLimitEnum.toTheta
|
|
1373
|
-
objectForKey:[rct objectForKey:@"isoAutoHighLimit"]];
|
|
1374
|
-
if (val) {
|
|
1375
|
-
opt.isoAutoHighLimit = val;
|
|
1376
|
-
}
|
|
1377
|
-
},
|
|
1378
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1379
|
-
id val = [IsoAutoHighLimitEnum.fromTheta objectForKey:opt.isoAutoHighLimit];
|
|
1380
|
-
if (val) {
|
|
1381
|
-
[rct setObject:val forKey:@"isoAutoHighLimit"];
|
|
1382
|
-
}
|
|
1383
|
-
},
|
|
1384
|
-
.setPhotoOption = ^(NSDictionary* rct, THETACPhotoCaptureBuilder *builder) {
|
|
1385
|
-
id val = [IsoAutoHighLimitEnum.toTheta
|
|
1386
|
-
objectForKey:[rct objectForKey:@"isoAutoHighLimit"]];
|
|
1387
|
-
if (val) {
|
|
1388
|
-
[builder setIsoAutoHighLimitIso:val];
|
|
1389
|
-
}
|
|
1390
|
-
},
|
|
1391
|
-
.setTimeShiftOption = ^(NSDictionary* rct, THETACTimeShiftCaptureBuilder *builder) {
|
|
1392
|
-
id val = [IsoAutoHighLimitEnum.toTheta objectForKey:[rct objectForKey:@"isoAutoHighLimit"]];
|
|
1393
|
-
if (val) {
|
|
1394
|
-
[builder setIsoAutoHighLimitIso:val];
|
|
1395
|
-
}
|
|
1396
|
-
},
|
|
1397
|
-
.setVideoOption = ^(NSDictionary* rct, THETACVideoCaptureBuilder *builder) {
|
|
1398
|
-
id val = [IsoAutoHighLimitEnum.toTheta
|
|
1399
|
-
objectForKey:[rct objectForKey:@"isoAutoHighLimit"]];
|
|
1400
|
-
if (val) {
|
|
1401
|
-
[builder setIsoAutoHighLimitIso:val];
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
};
|
|
1405
|
-
|
|
1406
|
-
/**
|
|
1407
|
-
* LanguageEnum converter
|
|
1408
|
-
*/
|
|
1409
|
-
static convert_t LanguageEnum = {
|
|
1410
|
-
.toTheta = @{
|
|
1411
|
-
@"DE": THETACThetaRepositoryLanguageEnum.de,
|
|
1412
|
-
@"EN_GB": THETACThetaRepositoryLanguageEnum.enGb,
|
|
1413
|
-
@"EN_US": THETACThetaRepositoryLanguageEnum.enUs,
|
|
1414
|
-
@"FR": THETACThetaRepositoryLanguageEnum.fr,
|
|
1415
|
-
@"IT": THETACThetaRepositoryLanguageEnum.it,
|
|
1416
|
-
@"JA": THETACThetaRepositoryLanguageEnum.ja,
|
|
1417
|
-
@"KO": THETACThetaRepositoryLanguageEnum.ko,
|
|
1418
|
-
@"ZH_CN": THETACThetaRepositoryLanguageEnum.zhCn,
|
|
1419
|
-
@"ZH_TW": THETACThetaRepositoryLanguageEnum.zhTw
|
|
1420
|
-
},
|
|
1421
|
-
.fromTheta = @{
|
|
1422
|
-
THETACThetaRepositoryLanguageEnum.de: @"DE",
|
|
1423
|
-
THETACThetaRepositoryLanguageEnum.enGb: @"EN_GB",
|
|
1424
|
-
THETACThetaRepositoryLanguageEnum.enUs: @"EN_US",
|
|
1425
|
-
THETACThetaRepositoryLanguageEnum.fr: @"FR",
|
|
1426
|
-
THETACThetaRepositoryLanguageEnum.it: @"IT",
|
|
1427
|
-
THETACThetaRepositoryLanguageEnum.ja: @"JA",
|
|
1428
|
-
THETACThetaRepositoryLanguageEnum.ko: @"KO",
|
|
1429
|
-
THETACThetaRepositoryLanguageEnum.zhCn: @"ZH_CN",
|
|
1430
|
-
THETACThetaRepositoryLanguageEnum.zhTw: @"ZH_TW"
|
|
1431
|
-
},
|
|
1432
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1433
|
-
id val = [LanguageEnum.toTheta objectForKey:[rct objectForKey:@"language"]];
|
|
1434
|
-
if (val) {
|
|
1435
|
-
opt.language = val;
|
|
1436
|
-
}
|
|
1437
|
-
},
|
|
1438
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1439
|
-
id val = [LanguageEnum.fromTheta objectForKey:opt.language];
|
|
1440
|
-
if (val) {
|
|
1441
|
-
[rct setObject:val forKey:@"language"];
|
|
1442
|
-
}
|
|
1443
|
-
}
|
|
1444
|
-
};
|
|
1445
|
-
|
|
1446
|
-
/**
|
|
1447
|
-
* MaxRecordableTimeEnum converter
|
|
1448
|
-
*/
|
|
1449
|
-
static convert_t MaxRecordableTimeEnum = {
|
|
1450
|
-
.toTheta = @{
|
|
1451
|
-
@"RECORDABLE_TIME_180": THETACThetaRepositoryMaxRecordableTimeEnum.recordableTime180,
|
|
1452
|
-
@"RECORDABLE_TIME_300": THETACThetaRepositoryMaxRecordableTimeEnum.recordableTime300,
|
|
1453
|
-
@"RECORDABLE_TIME_1500": THETACThetaRepositoryMaxRecordableTimeEnum.recordableTime1500,
|
|
1454
|
-
@"RECORDABLE_TIME_7200": THETACThetaRepositoryMaxRecordableTimeEnum.recordableTime7200,
|
|
1455
|
-
@"DO_NOT_UPDATE_MY_SETTING_CONDITION": THETACThetaRepositoryMaxRecordableTimeEnum.doNotUpdateMySettingCondition
|
|
1456
|
-
},
|
|
1457
|
-
.fromTheta = @{
|
|
1458
|
-
THETACThetaRepositoryMaxRecordableTimeEnum.recordableTime180: @"RECORDABLE_TIME_180",
|
|
1459
|
-
THETACThetaRepositoryMaxRecordableTimeEnum.recordableTime300: @"RECORDABLE_TIME_300",
|
|
1460
|
-
THETACThetaRepositoryMaxRecordableTimeEnum.recordableTime1500: @"RECORDABLE_TIME_1500",
|
|
1461
|
-
THETACThetaRepositoryMaxRecordableTimeEnum.recordableTime7200: @"RECORDABLE_TIME_7200",
|
|
1462
|
-
THETACThetaRepositoryMaxRecordableTimeEnum.doNotUpdateMySettingCondition: @"DO_NOT_UPDATE_MY_SETTING_CONDITION"
|
|
1463
|
-
},
|
|
1464
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1465
|
-
id val = [MaxRecordableTimeEnum.toTheta
|
|
1466
|
-
objectForKey:[rct objectForKey:@"maxRecordableTime"]];
|
|
1467
|
-
if (val) {
|
|
1468
|
-
opt.maxRecordableTime = val;
|
|
1469
|
-
}
|
|
1470
|
-
},
|
|
1471
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1472
|
-
id val = [MaxRecordableTimeEnum.fromTheta objectForKey:opt.maxRecordableTime];
|
|
1473
|
-
if (val) {
|
|
1474
|
-
[rct setObject:val forKey:@"maxRecordableTime"];
|
|
1475
|
-
}
|
|
1476
|
-
},
|
|
1477
|
-
.setVideoOption = ^(NSDictionary* rct, THETACVideoCaptureBuilder *builder) {
|
|
1478
|
-
id val = [MaxRecordableTimeEnum.toTheta
|
|
1479
|
-
objectForKey:[rct objectForKey:@"maxRecordableTime"]];
|
|
1480
|
-
if (val) {
|
|
1481
|
-
[builder setMaxRecordableTimeTime:val];
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
1484
|
-
};
|
|
1485
|
-
|
|
1486
|
-
/**
|
|
1487
|
-
* OffDelayEnum converter
|
|
1488
|
-
*/
|
|
1489
|
-
static convert_t OffDelayEnum = {
|
|
1490
|
-
.toTheta = @{
|
|
1491
|
-
@"DISABLE": THETACThetaRepositoryOffDelayEnum.disable,
|
|
1492
|
-
@"OFF_DELAY_5M": THETACThetaRepositoryOffDelayEnum.offDelay5m,
|
|
1493
|
-
@"OFF_DELAY_10M": THETACThetaRepositoryOffDelayEnum.offDelay10m,
|
|
1494
|
-
@"OFF_DELAY_15M": THETACThetaRepositoryOffDelayEnum.offDelay15m,
|
|
1495
|
-
@"OFF_DELAY_30M": THETACThetaRepositoryOffDelayEnum.offDelay30m
|
|
1496
|
-
},
|
|
1497
|
-
.fromTheta = @{
|
|
1498
|
-
@(THETACThetaRepositoryOffDelayEnum.disable.sec): @"DISABLE",
|
|
1499
|
-
@(THETACThetaRepositoryOffDelayEnum.offDelay5m.sec): @"OFF_DELAY_5M",
|
|
1500
|
-
@(THETACThetaRepositoryOffDelayEnum.offDelay10m.sec): @"OFF_DELAY_10M",
|
|
1501
|
-
@(THETACThetaRepositoryOffDelayEnum.offDelay15m.sec): @"OFF_DELAY_15M",
|
|
1502
|
-
@(THETACThetaRepositoryOffDelayEnum.offDelay30m.sec): @"OFF_DELAY_30M"
|
|
1503
|
-
},
|
|
1504
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1505
|
-
id rv = [rct objectForKey:@"offDelay"];
|
|
1506
|
-
if (rv) {
|
|
1507
|
-
if ([rv isKindOfClass:NSString.class]) {
|
|
1508
|
-
id val = [OffDelayEnum.toTheta objectForKey:rv];
|
|
1509
|
-
opt.offDelay = val;
|
|
1510
|
-
} else if ([rv isKindOfClass:NSNumber.class]) {
|
|
1511
|
-
id val = [[THETACThetaRepositoryOffDelaySec alloc] initWithSec:[rv intValue]];
|
|
1512
|
-
opt.offDelay = val;
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
|
-
},
|
|
1516
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1517
|
-
if (opt.offDelay) {
|
|
1518
|
-
id val = [OffDelayEnum.fromTheta objectForKey:@(opt.offDelay.sec)];
|
|
1519
|
-
if (val) {
|
|
1520
|
-
[rct setObject:val forKey:@"offDelay"];
|
|
1521
|
-
} else {
|
|
1522
|
-
[rct setObject:@(opt.offDelay.sec) forKey:@"offDelay"];
|
|
1523
|
-
}
|
|
1524
|
-
}
|
|
1525
|
-
}
|
|
1526
|
-
};
|
|
1527
|
-
|
|
1528
|
-
/**
|
|
1529
|
-
* PowerSaving convertor
|
|
1530
|
-
*/
|
|
1531
|
-
static convert_t PowerSavingEnum = {
|
|
1532
|
-
.toTheta = @{
|
|
1533
|
-
@"ON": THETACThetaRepositoryPowerSavingEnum.on,
|
|
1534
|
-
@"OFF": THETACThetaRepositoryPowerSavingEnum.off
|
|
1535
|
-
},
|
|
1536
|
-
.fromTheta = @{
|
|
1537
|
-
THETACThetaRepositoryPowerSavingEnum.on: @"ON",
|
|
1538
|
-
THETACThetaRepositoryPowerSavingEnum.off: @"OFF"
|
|
1539
|
-
},
|
|
1540
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1541
|
-
id val = [PowerSavingEnum.toTheta objectForKey:[rct objectForKey:@"powerSaving"]];
|
|
1542
|
-
if (val) {
|
|
1543
|
-
opt.powerSaving = val;
|
|
1544
|
-
}
|
|
1545
|
-
},
|
|
1546
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1547
|
-
id val = [PowerSavingEnum.fromTheta objectForKey:opt.powerSaving];
|
|
1548
|
-
if (val) {
|
|
1549
|
-
[rct setObject:val forKey:@"powerSaving"];
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
};
|
|
1553
|
-
|
|
1554
|
-
/**
|
|
1555
|
-
* PreviewFormat convertor
|
|
1556
|
-
*/
|
|
1557
|
-
static convert_t PreviewFormatEnum = {
|
|
1558
|
-
.toTheta = @{
|
|
1559
|
-
@"W1024_H512_F30": THETACThetaRepositoryPreviewFormatEnum.w1024H512F30,
|
|
1560
|
-
@"W1024_H512_F15": THETACThetaRepositoryPreviewFormatEnum.w1024H512F15,
|
|
1561
|
-
@"W512_H512_F30": THETACThetaRepositoryPreviewFormatEnum.w512H512F30,
|
|
1562
|
-
@"W1920_H960_F8": THETACThetaRepositoryPreviewFormatEnum.w1920H960F8,
|
|
1563
|
-
@"W1024_H512_F8": THETACThetaRepositoryPreviewFormatEnum.w1024H512F8,
|
|
1564
|
-
@"W640_H320_F30": THETACThetaRepositoryPreviewFormatEnum.w640H320F30,
|
|
1565
|
-
@"W640_H320_F8": THETACThetaRepositoryPreviewFormatEnum.w640H320F8,
|
|
1566
|
-
@"W640_H320_F10": THETACThetaRepositoryPreviewFormatEnum.w640H320F10
|
|
1567
|
-
},
|
|
1568
|
-
.fromTheta = @{
|
|
1569
|
-
THETACThetaRepositoryPreviewFormatEnum.w1024H512F30: @"W1024_H512_F30",
|
|
1570
|
-
THETACThetaRepositoryPreviewFormatEnum.w1024H512F15: @"W1024_H512_F15",
|
|
1571
|
-
THETACThetaRepositoryPreviewFormatEnum.w512H512F30: @"W512_H512_F30",
|
|
1572
|
-
THETACThetaRepositoryPreviewFormatEnum.w1920H960F8: @"W1920_H960_F8",
|
|
1573
|
-
THETACThetaRepositoryPreviewFormatEnum.w1024H512F8: @"W1024_H512_F8",
|
|
1574
|
-
THETACThetaRepositoryPreviewFormatEnum.w640H320F30: @"W640_H320_F30",
|
|
1575
|
-
THETACThetaRepositoryPreviewFormatEnum.w640H320F8: @"W640_H320_F8",
|
|
1576
|
-
THETACThetaRepositoryPreviewFormatEnum.w640H320F10: @"W640_H320_F10",
|
|
1577
|
-
},
|
|
1578
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1579
|
-
id val = [PreviewFormatEnum.toTheta objectForKey:[rct objectForKey:@"previewFormat"]];
|
|
1580
|
-
if (val) {
|
|
1581
|
-
opt.previewFormat = val;
|
|
1582
|
-
}
|
|
1583
|
-
},
|
|
1584
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1585
|
-
id val = [PreviewFormatEnum.fromTheta objectForKey:opt.previewFormat];
|
|
1586
|
-
if (val) {
|
|
1587
|
-
[rct setObject:val forKey:@"previewFormat"];
|
|
1588
|
-
}
|
|
1589
|
-
}
|
|
1590
|
-
};
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
/**
|
|
1594
|
-
* WhiteBalanceEnum converter
|
|
1595
|
-
*/
|
|
1596
|
-
static convert_t WhiteBalanceEnum = {
|
|
1597
|
-
.toTheta = @{
|
|
1598
|
-
@"AUTO": THETACThetaRepositoryWhiteBalanceEnum.auto_,
|
|
1599
|
-
@"DAYLIGHT": THETACThetaRepositoryWhiteBalanceEnum.daylight,
|
|
1600
|
-
@"SHADE": THETACThetaRepositoryWhiteBalanceEnum.shade,
|
|
1601
|
-
@"CLOUDY_DAYLIGHT": THETACThetaRepositoryWhiteBalanceEnum.cloudyDaylight,
|
|
1602
|
-
@"INCANDESCENT": THETACThetaRepositoryWhiteBalanceEnum.incandescent,
|
|
1603
|
-
@"WARM_WHITE_FLUORESCENT": THETACThetaRepositoryWhiteBalanceEnum.warmWhiteFluorescent,
|
|
1604
|
-
@"DAYLIGHT_FLUORESCENT": THETACThetaRepositoryWhiteBalanceEnum.daylightFluorescent,
|
|
1605
|
-
@"DAYWHITE_FLUORESCENT": THETACThetaRepositoryWhiteBalanceEnum.daywhiteFluorescent,
|
|
1606
|
-
@"FLUORESCENT": THETACThetaRepositoryWhiteBalanceEnum.fluorescent,
|
|
1607
|
-
@"BULB_FLUORESCENT": THETACThetaRepositoryWhiteBalanceEnum.bulbFluorescent,
|
|
1608
|
-
@"COLOR_TEMPERATURE": THETACThetaRepositoryWhiteBalanceEnum.colorTemperature,
|
|
1609
|
-
@"UNDERWATER": THETACThetaRepositoryWhiteBalanceEnum.underwater
|
|
1610
|
-
},
|
|
1611
|
-
.fromTheta = @{
|
|
1612
|
-
THETACThetaRepositoryWhiteBalanceEnum.auto_: @"AUTO",
|
|
1613
|
-
THETACThetaRepositoryWhiteBalanceEnum.daylight: @"DAYLIGHT",
|
|
1614
|
-
THETACThetaRepositoryWhiteBalanceEnum.shade: @"SHADE",
|
|
1615
|
-
THETACThetaRepositoryWhiteBalanceEnum.cloudyDaylight: @"CLOUDY_DAYLIGHT",
|
|
1616
|
-
THETACThetaRepositoryWhiteBalanceEnum.incandescent: @"INCANDESCENT",
|
|
1617
|
-
THETACThetaRepositoryWhiteBalanceEnum.warmWhiteFluorescent: @"WARM_WHITE_FLUORESCENT",
|
|
1618
|
-
THETACThetaRepositoryWhiteBalanceEnum.daylightFluorescent: @"DAYLIGHT_FLUORESCENT",
|
|
1619
|
-
THETACThetaRepositoryWhiteBalanceEnum.daywhiteFluorescent: @"DAYWHITE_FLUORESCENT",
|
|
1620
|
-
THETACThetaRepositoryWhiteBalanceEnum.fluorescent: @"FLUORESCENT",
|
|
1621
|
-
THETACThetaRepositoryWhiteBalanceEnum.bulbFluorescent: @"BULB_FLUORESCENT",
|
|
1622
|
-
THETACThetaRepositoryWhiteBalanceEnum.colorTemperature: @"COLOR_TEMPERATURE",
|
|
1623
|
-
THETACThetaRepositoryWhiteBalanceEnum.underwater: @"UNDERWATER"
|
|
1624
|
-
},
|
|
1625
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1626
|
-
id val = [WhiteBalanceEnum.toTheta objectForKey:[rct objectForKey:@"whiteBalance"]];
|
|
1627
|
-
if (val) {
|
|
1628
|
-
opt.whiteBalance = val;
|
|
1629
|
-
}
|
|
1630
|
-
},
|
|
1631
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1632
|
-
id val = [WhiteBalanceEnum.fromTheta objectForKey:opt.whiteBalance];
|
|
1633
|
-
if (val) {
|
|
1634
|
-
[rct setObject:val forKey:@"whiteBalance"];
|
|
1635
|
-
}
|
|
1636
|
-
},
|
|
1637
|
-
.setPhotoOption = ^(NSDictionary* rct, THETACPhotoCaptureBuilder *builder) {
|
|
1638
|
-
id val = [WhiteBalanceEnum.toTheta
|
|
1639
|
-
objectForKey:[rct objectForKey:@"whiteBalance"]];
|
|
1640
|
-
if (val) {
|
|
1641
|
-
[builder setWhiteBalanceWhiteBalance:val];
|
|
1642
|
-
}
|
|
1643
|
-
},
|
|
1644
|
-
.setVideoOption = ^(NSDictionary* rct, THETACVideoCaptureBuilder *builder) {
|
|
1645
|
-
id val = [WhiteBalanceEnum.toTheta
|
|
1646
|
-
objectForKey:[rct objectForKey:@"whiteBalance"]];
|
|
1647
|
-
if (val) {
|
|
1648
|
-
[builder setWhiteBalanceWhiteBalance:val];
|
|
1649
|
-
}
|
|
1650
|
-
}
|
|
1651
|
-
};
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
/**
|
|
1655
|
-
* WhiteBalanceAutoStrengthEnum converter
|
|
1656
|
-
*/
|
|
1657
|
-
static convert_t WhiteBalanceAutoStrengthEnum = {
|
|
1658
|
-
.toTheta = @{
|
|
1659
|
-
@"ON": THETACThetaRepositoryWhiteBalanceAutoStrengthEnum.on,
|
|
1660
|
-
@"OFF": THETACThetaRepositoryWhiteBalanceAutoStrengthEnum.off
|
|
1661
|
-
},
|
|
1662
|
-
.fromTheta = @{
|
|
1663
|
-
THETACThetaRepositoryWhiteBalanceAutoStrengthEnum.on: @"ON",
|
|
1664
|
-
THETACThetaRepositoryWhiteBalanceAutoStrengthEnum.off: @"OFF"
|
|
1665
|
-
},
|
|
1666
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1667
|
-
id val = [WhiteBalanceAutoStrengthEnum.toTheta objectForKey:[rct objectForKey:@"whiteBalanceAutoStrength"]];
|
|
1668
|
-
if (val) {
|
|
1669
|
-
opt.whiteBalanceAutoStrength = val;
|
|
1670
|
-
}
|
|
1671
|
-
},
|
|
1672
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1673
|
-
id val = [WhiteBalanceAutoStrengthEnum.fromTheta objectForKey:opt.whiteBalanceAutoStrength];
|
|
1674
|
-
if (val) {
|
|
1675
|
-
[rct setObject:val forKey:@"whiteBalanceAutoStrength"];
|
|
1676
|
-
}
|
|
1677
|
-
}
|
|
1678
|
-
};
|
|
1679
|
-
|
|
1680
|
-
/**
|
|
1681
|
-
* ColorTemperature converter
|
|
1682
|
-
*/
|
|
1683
|
-
static convert_t ColorTemperatureCvt = {
|
|
1684
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1685
|
-
NSNumber* val = [rct objectForKey:@"colorTemperature"];
|
|
1686
|
-
if (val) {
|
|
1687
|
-
opt.colorTemperature = [THETACInt numberWithInt:[val intValue]];
|
|
1688
|
-
}
|
|
1689
|
-
},
|
|
1690
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1691
|
-
if (opt.colorTemperature) {
|
|
1692
|
-
[rct setObject:opt.colorTemperature forKey:@"colorTemperature"];
|
|
1693
|
-
}
|
|
1694
|
-
},
|
|
1695
|
-
.setPhotoOption = ^(NSDictionary* rct, THETACPhotoCaptureBuilder *builder) {
|
|
1696
|
-
NSNumber *val = (NSNumber*) [rct objectForKey:@"colorTemperature"];
|
|
1697
|
-
if (val) {
|
|
1698
|
-
[builder setColorTemperatureKelvin:val.intValue];
|
|
1699
|
-
}
|
|
1700
|
-
},
|
|
1701
|
-
.setVideoOption = ^(NSDictionary* rct, THETACVideoCaptureBuilder *builder) {
|
|
1702
|
-
NSNumber *val = (NSNumber*) [rct objectForKey:@"colorTemperature"];
|
|
1703
|
-
if (val) {
|
|
1704
|
-
[builder setColorTemperatureKelvin:val.intValue];
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1707
|
-
};
|
|
1708
|
-
|
|
1709
|
-
/**
|
|
1710
|
-
* CompositeShootingOutputInterval converter
|
|
1711
|
-
*/
|
|
1712
|
-
static convert_t CompositeShootingOutputIntervalCvt = {
|
|
1713
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1714
|
-
NSNumber* val = [rct objectForKey:@"compositeShootingOutputInterval"];
|
|
1715
|
-
if (val) {
|
|
1716
|
-
opt.compositeShootingOutputInterval = [THETACInt numberWithInt:[val intValue]];
|
|
1717
|
-
}
|
|
1718
|
-
},
|
|
1719
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1720
|
-
if (opt.compositeShootingOutputInterval) {
|
|
1721
|
-
[rct setObject:opt.compositeShootingOutputInterval forKey:@"compositeShootingOutputInterval"];
|
|
1722
|
-
}
|
|
1723
|
-
},
|
|
1724
|
-
};
|
|
1725
|
-
|
|
1726
|
-
/**
|
|
1727
|
-
* CompositeShootingTime converter
|
|
1728
|
-
*/
|
|
1729
|
-
static convert_t CompositeShootingTimeCvt = {
|
|
1730
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1731
|
-
NSNumber* val = [rct objectForKey:@"compositeShootingTime"];
|
|
1732
|
-
if (val) {
|
|
1733
|
-
opt.compositeShootingTime = [THETACInt numberWithInt:[val intValue]];
|
|
1734
|
-
}
|
|
1735
|
-
},
|
|
1736
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1737
|
-
if (opt.compositeShootingTime) {
|
|
1738
|
-
[rct setObject:opt.compositeShootingTime forKey:@"compositeShootingTime"];
|
|
1739
|
-
}
|
|
1740
|
-
},
|
|
1741
|
-
};
|
|
1742
|
-
|
|
1743
|
-
/**
|
|
1744
|
-
* DateTimeZone converter
|
|
1745
|
-
*/
|
|
1746
|
-
static convert_t DateTimeZoneCvt = {
|
|
1747
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1748
|
-
NSString* val = [rct objectForKey:@"dateTimeZone"];
|
|
1749
|
-
if (val) {
|
|
1750
|
-
opt.dateTimeZone = val;
|
|
1751
|
-
}
|
|
1752
|
-
},
|
|
1753
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1754
|
-
if (opt.dateTimeZone) {
|
|
1755
|
-
[rct setObject:opt.dateTimeZone forKey:@"dateTimeZone"];
|
|
1756
|
-
}
|
|
1757
|
-
}
|
|
1758
|
-
};
|
|
1759
|
-
|
|
1760
|
-
/**
|
|
1761
|
-
* IsGpsOn converter
|
|
1762
|
-
*/
|
|
1763
|
-
static convert_t IsGpsOnCvt = {
|
|
1764
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1765
|
-
NSNumber* val = [rct objectForKey:@"isGpsOn"];
|
|
1766
|
-
if (val) {
|
|
1767
|
-
opt.isGpsOn = [THETACBoolean numberWithBool:[val boolValue]];
|
|
1768
|
-
}
|
|
1769
|
-
},
|
|
1770
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1771
|
-
if (opt.isGpsOn) {
|
|
1772
|
-
[rct setObject:@(((NSNumber *) opt.isGpsOn).boolValue) forKey:@"isGpsOn"];
|
|
1773
|
-
}
|
|
1774
|
-
}
|
|
1775
|
-
};
|
|
1776
|
-
|
|
1777
|
-
/**
|
|
1778
|
-
* ShutterSpeed converter
|
|
1779
|
-
*/
|
|
1780
|
-
static convert_t ShutterSpeedEnum = {
|
|
1781
|
-
.toTheta = nil,
|
|
1782
|
-
.fromTheta = nil,
|
|
1783
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1784
|
-
if (!ShutterSpeedEnum.toTheta) {
|
|
1785
|
-
NSMutableDictionary* dictionary = [[NSMutableDictionary alloc] init];
|
|
1786
|
-
THETACKotlinArray* array = THETACThetaRepositoryShutterSpeedEnum.values;
|
|
1787
|
-
for (int i = 0; i < array.size; i++) {
|
|
1788
|
-
THETACThetaRepositorySleepDelayEnum* item = [array getIndex:i];
|
|
1789
|
-
[dictionary setObject:item forKey:item.name];
|
|
1790
|
-
}
|
|
1791
|
-
ShutterSpeedEnum.toTheta = dictionary;
|
|
1792
|
-
}
|
|
1793
|
-
id val = [ShutterSpeedEnum.toTheta objectForKey:[rct objectForKey:@"shutterSpeed"]];
|
|
1794
|
-
if (val) {
|
|
1795
|
-
opt.shutterSpeed = val;
|
|
1796
|
-
}
|
|
1797
|
-
},
|
|
1798
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1799
|
-
if (!ShutterSpeedEnum.fromTheta) {
|
|
1800
|
-
NSMutableDictionary* dictionary = [[NSMutableDictionary alloc] init];
|
|
1801
|
-
THETACKotlinArray* array = THETACThetaRepositoryShutterSpeedEnum.values;
|
|
1802
|
-
for (int i = 0; i < array.size; i++) {
|
|
1803
|
-
THETACThetaRepositorySleepDelayEnum* item = [array getIndex:i];
|
|
1804
|
-
[dictionary setObject:item.name forKey:item];
|
|
1805
|
-
}
|
|
1806
|
-
ShutterSpeedEnum.fromTheta = dictionary;
|
|
1807
|
-
}
|
|
1808
|
-
id val = [ShutterSpeedEnum.fromTheta objectForKey:opt.shutterSpeed];
|
|
1809
|
-
if (val) {
|
|
1810
|
-
[rct setObject:val forKey:@"shutterSpeed"];
|
|
1811
|
-
}
|
|
1812
|
-
}
|
|
1813
|
-
};
|
|
1814
|
-
|
|
1815
|
-
/**
|
|
1816
|
-
* SleepDelay converter
|
|
1817
|
-
*/
|
|
1818
|
-
static convert_t SleepDelayEnum = {
|
|
1819
|
-
.toTheta = @{
|
|
1820
|
-
@"DISABLE": THETACThetaRepositorySleepDelayEnum.disable,
|
|
1821
|
-
@"SLEEP_DELAY_3M": THETACThetaRepositorySleepDelayEnum.sleepDelay3m,
|
|
1822
|
-
@"SLEEP_DELAY_5M": THETACThetaRepositorySleepDelayEnum.sleepDelay5m,
|
|
1823
|
-
@"SLEEP_DELAY_7M": THETACThetaRepositorySleepDelayEnum.sleepDelay7m,
|
|
1824
|
-
@"SLEEP_DELAY_10M": THETACThetaRepositorySleepDelayEnum.sleepDelay10m
|
|
1825
|
-
},
|
|
1826
|
-
.fromTheta = @{
|
|
1827
|
-
@(THETACThetaRepositorySleepDelayEnum.disable.sec): @"DISABLE",
|
|
1828
|
-
@(THETACThetaRepositorySleepDelayEnum.sleepDelay3m.sec): @"SLEEP_DELAY_3M",
|
|
1829
|
-
@(THETACThetaRepositorySleepDelayEnum.sleepDelay5m.sec): @"SLEEP_DELAY_5M",
|
|
1830
|
-
@(THETACThetaRepositorySleepDelayEnum.sleepDelay7m.sec): @"SLEEP_DELAY_7M",
|
|
1831
|
-
@(THETACThetaRepositorySleepDelayEnum.sleepDelay10m.sec): @"SLEEP_DELAY_10M"
|
|
1832
|
-
},
|
|
1833
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1834
|
-
id rv = [rct objectForKey:@"sleepDelay"];
|
|
1835
|
-
if (rv) {
|
|
1836
|
-
if ([rv isKindOfClass:NSString.class]) {
|
|
1837
|
-
id val = [SleepDelayEnum.toTheta objectForKey:rv];
|
|
1838
|
-
opt.sleepDelay = val;
|
|
1839
|
-
} else if ([rv isKindOfClass:NSNumber.class]) {
|
|
1840
|
-
id val = [[THETACThetaRepositorySleepDelaySec alloc] initWithSec:[rv intValue]];
|
|
1841
|
-
opt.sleepDelay = val;
|
|
1842
|
-
}
|
|
1843
|
-
}
|
|
1844
|
-
},
|
|
1845
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1846
|
-
if (opt.sleepDelay) {
|
|
1847
|
-
id val = [SleepDelayEnum.fromTheta objectForKey:@(opt.sleepDelay.sec)];
|
|
1848
|
-
if (val) {
|
|
1849
|
-
[rct setObject:val forKey:@"sleepDelay"];
|
|
1850
|
-
} else {
|
|
1851
|
-
[rct setObject:@(opt.sleepDelay.sec) forKey:@"sleepDelay"];
|
|
1852
|
-
}
|
|
1853
|
-
}
|
|
1854
|
-
}
|
|
1855
|
-
};
|
|
1856
|
-
|
|
1857
|
-
/**
|
|
1858
|
-
* RemainingPictures converter
|
|
1859
|
-
*/
|
|
1860
|
-
static convert_t RemainingPicturesCvt = {
|
|
1861
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1862
|
-
NSNumber* val = [rct objectForKey:@"remainingPictures"];
|
|
1863
|
-
if (val) {
|
|
1864
|
-
opt.remainingPictures = [THETACInt numberWithInt:[val intValue]];
|
|
1865
|
-
}
|
|
1866
|
-
},
|
|
1867
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1868
|
-
if (opt.remainingPictures) {
|
|
1869
|
-
[rct setObject:opt.remainingPictures forKey:@"remainingPictures"];
|
|
1870
|
-
}
|
|
1871
|
-
}
|
|
1872
|
-
};
|
|
1873
|
-
|
|
1874
|
-
/**
|
|
1875
|
-
* RemainingVideoSeconds converter
|
|
1876
|
-
*/
|
|
1877
|
-
static convert_t RemainingVideoSecondsCvt = {
|
|
1878
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1879
|
-
NSNumber* val = [rct objectForKey:@"remainingVideoSeconds"];
|
|
1880
|
-
if (val) {
|
|
1881
|
-
opt.remainingVideoSeconds = [THETACInt numberWithInt:[val intValue]];
|
|
1882
|
-
}
|
|
1883
|
-
},
|
|
1884
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1885
|
-
if (opt.remainingVideoSeconds) {
|
|
1886
|
-
[rct setObject:opt.remainingVideoSeconds forKey:@"remainingVideoSeconds"];
|
|
1887
|
-
}
|
|
1888
|
-
}
|
|
1889
|
-
};
|
|
1890
|
-
|
|
1891
|
-
/**
|
|
1892
|
-
* RemainingSpace converter
|
|
1893
|
-
*/
|
|
1894
|
-
static convert_t RemainingSpaceCvt = {
|
|
1895
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1896
|
-
NSNumber* val = [rct objectForKey:@"remainingSpace"];
|
|
1897
|
-
if (val) {
|
|
1898
|
-
opt.remainingSpace = [THETACLong numberWithLongLong:[val longLongValue]];
|
|
1899
|
-
}
|
|
1900
|
-
},
|
|
1901
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1902
|
-
if (opt.remainingSpace) {
|
|
1903
|
-
[rct setObject:opt.remainingSpace forKey:@"remainingSpace"];
|
|
1904
|
-
}
|
|
1905
|
-
}
|
|
1906
|
-
};
|
|
1907
|
-
|
|
1908
|
-
/**
|
|
1909
|
-
* TotalSpace converter
|
|
1910
|
-
*/
|
|
1911
|
-
static convert_t TotalSpaceCvt = {
|
|
1912
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1913
|
-
NSNumber* val = [rct objectForKey:@"totalSpace"];
|
|
1914
|
-
if (val) {
|
|
1915
|
-
opt.totalSpace = [THETACLong numberWithLongLong:[val longLongValue]];
|
|
1916
|
-
}
|
|
1917
|
-
},
|
|
1918
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1919
|
-
if (opt.totalSpace) {
|
|
1920
|
-
[rct setObject:opt.totalSpace forKey:@"totalSpace"];
|
|
1921
|
-
}
|
|
1922
|
-
}
|
|
1923
|
-
};
|
|
1924
|
-
|
|
1925
|
-
/**
|
|
1926
|
-
* ShutterVolume converter
|
|
1927
|
-
*/
|
|
1928
|
-
static convert_t ShutterVolumeCvt = {
|
|
1929
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1930
|
-
NSNumber* val = [rct objectForKey:@"shutterVolume"];
|
|
1931
|
-
if (val) {
|
|
1932
|
-
opt.shutterVolume = [THETACInt numberWithInt:[val intValue]];
|
|
1933
|
-
}
|
|
1934
|
-
},
|
|
1935
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1936
|
-
if (opt.shutterVolume) {
|
|
1937
|
-
[rct setObject:opt.shutterVolume forKey:@"shutterVolume"];
|
|
1938
|
-
}
|
|
1939
|
-
}
|
|
1940
|
-
};
|
|
1941
|
-
|
|
1942
|
-
/**
|
|
1943
|
-
* GpsInfo converter
|
|
1944
|
-
*/
|
|
1945
|
-
static convert_t GpsInfoCvt = {
|
|
1946
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1947
|
-
NSDictionary *gpsInfoDict = [rct objectForKey:@"gpsInfo"];
|
|
1948
|
-
if (gpsInfoDict) {
|
|
1949
|
-
opt.gpsInfo =
|
|
1950
|
-
[[THETACThetaRepositoryGpsInfo alloc]
|
|
1951
|
-
initWithLatitude:((NSNumber*) [gpsInfoDict objectForKey:@"latitude"]).floatValue
|
|
1952
|
-
longitude:((NSNumber*) [gpsInfoDict objectForKey:@"longitude"]).floatValue
|
|
1953
|
-
altitude:((NSNumber*) [gpsInfoDict objectForKey:@"altitude"]).floatValue
|
|
1954
|
-
dateTimeZone:[gpsInfoDict objectForKey:@"dateTimeZone"]];
|
|
1955
|
-
}
|
|
1956
|
-
},
|
|
1957
|
-
|
|
1958
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1959
|
-
if (opt.gpsInfo) {
|
|
1960
|
-
NSDictionary *gpsInfo = @{
|
|
1961
|
-
@"latitude": @(opt.gpsInfo.latitude),
|
|
1962
|
-
@"longitude": @(opt.gpsInfo.longitude),
|
|
1963
|
-
@"altitude": @(opt.gpsInfo.altitude),
|
|
1964
|
-
@"dateTimeZone": opt.gpsInfo.dateTimeZone
|
|
1965
|
-
};
|
|
1966
|
-
[rct setObject:gpsInfo forKey:@"gpsInfo"];
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
};
|
|
1970
|
-
|
|
1971
|
-
/**
|
|
1972
|
-
* NetworkType converter
|
|
1973
|
-
*/
|
|
1974
|
-
static convert_t NetworkTypeEnum = {
|
|
1975
|
-
.toTheta = @{
|
|
1976
|
-
@"DIRECT": THETACThetaRepositoryNetworkTypeEnum.direct,
|
|
1977
|
-
@"CLIENT": THETACThetaRepositoryNetworkTypeEnum.client,
|
|
1978
|
-
@"ETHERNET": THETACThetaRepositoryNetworkTypeEnum.ethernet,
|
|
1979
|
-
@"OFF": THETACThetaRepositoryNetworkTypeEnum.off
|
|
1980
|
-
},
|
|
1981
|
-
.fromTheta = @{
|
|
1982
|
-
THETACThetaRepositoryNetworkTypeEnum.direct: @"DIRECT",
|
|
1983
|
-
THETACThetaRepositoryNetworkTypeEnum.client: @"CLIENT",
|
|
1984
|
-
THETACThetaRepositoryNetworkTypeEnum.ethernet: @"ETHERNET",
|
|
1985
|
-
THETACThetaRepositoryNetworkTypeEnum.off: @"OFF"
|
|
1986
|
-
},
|
|
1987
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1988
|
-
id val = [NetworkTypeEnum.toTheta objectForKey:[rct objectForKey:@"networkType"]];
|
|
1989
|
-
if (val) {
|
|
1990
|
-
opt.networkType = val;
|
|
1991
|
-
}
|
|
1992
|
-
},
|
|
1993
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
1994
|
-
id val = [NetworkTypeEnum.fromTheta objectForKey:opt.networkType];
|
|
1995
|
-
if (val) {
|
|
1996
|
-
[rct setObject:val forKey:@"networkType"];
|
|
1997
|
-
}
|
|
1998
|
-
}
|
|
1999
|
-
};
|
|
2000
|
-
|
|
2001
|
-
/**
|
|
2002
|
-
* WlanFrequency converter
|
|
2003
|
-
*/
|
|
2004
|
-
static convert_t WlanFrequencyEnum = {
|
|
2005
|
-
.toTheta = @{
|
|
2006
|
-
@"GHZ_2_4": THETACThetaRepositoryWlanFrequencyEnum.ghz24,
|
|
2007
|
-
@"GHZ_5": THETACThetaRepositoryWlanFrequencyEnum.ghz5
|
|
2008
|
-
},
|
|
2009
|
-
.fromTheta = @{
|
|
2010
|
-
THETACThetaRepositoryWlanFrequencyEnum.ghz24: @"GHZ_2_4",
|
|
2011
|
-
THETACThetaRepositoryWlanFrequencyEnum.ghz5: @"GHZ_5"
|
|
2012
|
-
},
|
|
2013
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
2014
|
-
id val = [WlanFrequencyEnum.toTheta objectForKey:[rct objectForKey:@"wlanFrequency"]];
|
|
2015
|
-
if (val) {
|
|
2016
|
-
opt.wlanFrequency = val;
|
|
2017
|
-
}
|
|
2018
|
-
},
|
|
2019
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
2020
|
-
id val = [WlanFrequencyEnum.fromTheta objectForKey:opt.wlanFrequency];
|
|
2021
|
-
if (val) {
|
|
2022
|
-
[rct setObject:val forKey:@"wlanFrequency"];
|
|
2023
|
-
}
|
|
2024
|
-
}
|
|
2025
|
-
};
|
|
2026
|
-
|
|
2027
|
-
/**
|
|
2028
|
-
* Password converter
|
|
2029
|
-
*/
|
|
2030
|
-
static convert_t PasswordCvt = {
|
|
2031
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
2032
|
-
NSString* val = [rct objectForKey:@"password"];
|
|
2033
|
-
if (val) {
|
|
2034
|
-
opt.password = val;
|
|
2035
|
-
}
|
|
2036
|
-
},
|
|
2037
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
2038
|
-
if (opt.password) {
|
|
2039
|
-
[rct setObject:opt.password forKey:@"password"];
|
|
2040
|
-
}
|
|
2041
|
-
}
|
|
2042
|
-
};
|
|
2043
|
-
|
|
2044
|
-
/**
|
|
2045
|
-
* Preset convertor
|
|
2046
|
-
*/
|
|
2047
|
-
static convert_t PresetEnum = {
|
|
2048
|
-
.toTheta = @{
|
|
2049
|
-
@"FACE": THETACThetaRepositoryPresetEnum.face,
|
|
2050
|
-
@"NIGHT_VIEW": THETACThetaRepositoryPresetEnum.nightView,
|
|
2051
|
-
@"LENS_BY_LENS_EXPOSURE": THETACThetaRepositoryPresetEnum.lensByLensExposure,
|
|
2052
|
-
@"ROOM": THETACThetaRepositoryPresetEnum.room
|
|
2053
|
-
},
|
|
2054
|
-
.fromTheta = @{
|
|
2055
|
-
THETACThetaRepositoryPresetEnum.face: @"FACE",
|
|
2056
|
-
THETACThetaRepositoryPresetEnum.nightView: @"NIGHT_VIEW",
|
|
2057
|
-
THETACThetaRepositoryPresetEnum.lensByLensExposure: @"LENS_BY_LENS_EXPOSURE",
|
|
2058
|
-
THETACThetaRepositoryPresetEnum.room: @"ROOM"
|
|
2059
|
-
},
|
|
2060
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
2061
|
-
id val = [PresetEnum.toTheta objectForKey:[rct objectForKey:@"preset"]];
|
|
2062
|
-
if (val) {
|
|
2063
|
-
opt.preset = val;
|
|
2064
|
-
}
|
|
2065
|
-
},
|
|
2066
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
2067
|
-
id val = [PresetEnum.fromTheta objectForKey:opt.preset];
|
|
2068
|
-
if (val) {
|
|
2069
|
-
[rct setObject:val forKey:@"preset"];
|
|
2070
|
-
}
|
|
2071
|
-
}
|
|
2072
|
-
};
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
/**
|
|
2076
|
-
* Proxy converter
|
|
2077
|
-
*/
|
|
2078
|
-
static convert_t ProxyCvt = {
|
|
2079
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
2080
|
-
NSDictionary *proxyDic = [rct objectForKey:@"proxy"];
|
|
2081
|
-
if (proxyDic) {
|
|
2082
|
-
opt.proxy = [[THETACThetaRepositoryProxy alloc]
|
|
2083
|
-
initWithUse:!isNull([proxyDic objectForKey:@"use"]) ? ((NSNumber*) [proxyDic objectForKey:@"use"]).boolValue : NO
|
|
2084
|
-
url:!isNull([proxyDic objectForKey:@"url"]) ? [proxyDic objectForKey:@"url"] : nil
|
|
2085
|
-
port:!isNull([proxyDic objectForKey:@"port"]) ? [THETACInt numberWithInt:((NSNumber*) [proxyDic objectForKey:@"port"]).intValue] : nil
|
|
2086
|
-
userid:!isNull([proxyDic objectForKey:@"userid"]) ? [proxyDic objectForKey:@"userid"] : nil
|
|
2087
|
-
password:!isNull([proxyDic objectForKey:@"password"]) ? [proxyDic objectForKey:@"password"] : nil];
|
|
2088
|
-
}
|
|
2089
|
-
},
|
|
2090
|
-
|
|
2091
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
2092
|
-
if (opt.proxy) {
|
|
2093
|
-
NSMutableDictionary *proxy = [NSMutableDictionary dictionary];
|
|
2094
|
-
|
|
2095
|
-
[proxy setObject:@(opt.proxy.use) forKey:@"use"];
|
|
2096
|
-
|
|
2097
|
-
if (opt.proxy.url) {
|
|
2098
|
-
[proxy setObject:opt.proxy.url forKey:@"url"];
|
|
2099
|
-
}
|
|
2100
|
-
|
|
2101
|
-
if (opt.proxy.port) {
|
|
2102
|
-
[proxy setObject:@(opt.proxy.port.intValue) forKey:@"port"];
|
|
2103
|
-
}
|
|
2104
|
-
|
|
2105
|
-
if (opt.proxy.userid) {
|
|
2106
|
-
[proxy setObject:opt.proxy.userid forKey:@"userid"];
|
|
2107
|
-
}
|
|
2108
|
-
|
|
2109
|
-
if (opt.proxy.password) {
|
|
2110
|
-
[proxy setObject:opt.proxy.password forKey:@"password"];
|
|
2111
|
-
}
|
|
2112
|
-
|
|
2113
|
-
[rct setObject:proxy forKey:@"proxy"];
|
|
2114
|
-
}
|
|
2115
|
-
}
|
|
2116
|
-
};
|
|
2117
|
-
|
|
2118
|
-
/**
|
|
2119
|
-
* TimeShift converter
|
|
2120
|
-
*/
|
|
2121
|
-
static convert_t TimeShiftCvt = {
|
|
2122
|
-
.toTheta = @{
|
|
2123
|
-
@"INTERVAL_0": THETACThetaRepositoryTimeShiftIntervalEnum.interval0,
|
|
2124
|
-
@"INTERVAL_1": THETACThetaRepositoryTimeShiftIntervalEnum.interval1,
|
|
2125
|
-
@"INTERVAL_2": THETACThetaRepositoryTimeShiftIntervalEnum.interval2,
|
|
2126
|
-
@"INTERVAL_3": THETACThetaRepositoryTimeShiftIntervalEnum.interval3,
|
|
2127
|
-
@"INTERVAL_4": THETACThetaRepositoryTimeShiftIntervalEnum.interval4,
|
|
2128
|
-
@"INTERVAL_5": THETACThetaRepositoryTimeShiftIntervalEnum.interval5,
|
|
2129
|
-
@"INTERVAL_6": THETACThetaRepositoryTimeShiftIntervalEnum.interval6,
|
|
2130
|
-
@"INTERVAL_7": THETACThetaRepositoryTimeShiftIntervalEnum.interval7,
|
|
2131
|
-
@"INTERVAL_8": THETACThetaRepositoryTimeShiftIntervalEnum.interval8,
|
|
2132
|
-
@"INTERVAL_9": THETACThetaRepositoryTimeShiftIntervalEnum.interval9,
|
|
2133
|
-
@"INTERVAL_10": THETACThetaRepositoryTimeShiftIntervalEnum.interval10
|
|
2134
|
-
},
|
|
2135
|
-
.fromTheta = @{
|
|
2136
|
-
THETACThetaRepositoryTimeShiftIntervalEnum.interval0: @"INTERVAL_0",
|
|
2137
|
-
THETACThetaRepositoryTimeShiftIntervalEnum.interval1: @"INTERVAL_1",
|
|
2138
|
-
THETACThetaRepositoryTimeShiftIntervalEnum.interval2: @"INTERVAL_2",
|
|
2139
|
-
THETACThetaRepositoryTimeShiftIntervalEnum.interval3: @"INTERVAL_3",
|
|
2140
|
-
THETACThetaRepositoryTimeShiftIntervalEnum.interval4: @"INTERVAL_4",
|
|
2141
|
-
THETACThetaRepositoryTimeShiftIntervalEnum.interval5: @"INTERVAL_5",
|
|
2142
|
-
THETACThetaRepositoryTimeShiftIntervalEnum.interval6: @"INTERVAL_6",
|
|
2143
|
-
THETACThetaRepositoryTimeShiftIntervalEnum.interval7: @"INTERVAL_7",
|
|
2144
|
-
THETACThetaRepositoryTimeShiftIntervalEnum.interval8: @"INTERVAL_8",
|
|
2145
|
-
THETACThetaRepositoryTimeShiftIntervalEnum.interval9: @"INTERVAL_9",
|
|
2146
|
-
THETACThetaRepositoryTimeShiftIntervalEnum.interval10: @"INTERVAL_10"
|
|
2147
|
-
},
|
|
2148
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
2149
|
-
NSDictionary *timeshiftDic = [rct objectForKey:@"timeShift"];
|
|
2150
|
-
if (timeshiftDic) {
|
|
2151
|
-
opt.timeShift = [[THETACThetaRepositoryTimeShiftSetting alloc]
|
|
2152
|
-
initWithIsFrontFirst:!isNull([timeshiftDic objectForKey:@"isFrontFirst"]) ? [THETACBoolean numberWithBool:((NSNumber*) [timeshiftDic objectForKey:@"isFrontFirst"]).boolValue] : nil
|
|
2153
|
-
firstInterval:!isNull([timeshiftDic objectForKey:@"firstInterval"]) ? [TimeShiftCvt.toTheta objectForKey:[timeshiftDic objectForKey:@"firstInterval"]] : nil
|
|
2154
|
-
secondInterval:!isNull([timeshiftDic objectForKey:@"secondInterval"]) ? [TimeShiftCvt.toTheta objectForKey:[timeshiftDic objectForKey:@"secondInterval"]] : nil];
|
|
2155
|
-
}
|
|
2156
|
-
},
|
|
2157
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
2158
|
-
if (opt.timeShift) {
|
|
2159
|
-
NSMutableDictionary *timeshift = [NSMutableDictionary dictionary];
|
|
2160
|
-
|
|
2161
|
-
if (opt.timeShift.isFrontFirst) {
|
|
2162
|
-
[timeshift setObject:@(((NSNumber *) opt.timeShift.isFrontFirst).boolValue) forKey:@"isFrontFirst"];
|
|
2163
|
-
}
|
|
2164
|
-
|
|
2165
|
-
if (opt.timeShift.firstInterval) {
|
|
2166
|
-
[timeshift setObject:[TimeShiftCvt.fromTheta objectForKey:opt.timeShift.firstInterval] forKey:@"firstInterval"];
|
|
2167
|
-
}
|
|
2168
|
-
|
|
2169
|
-
if (opt.timeShift.secondInterval) {
|
|
2170
|
-
[timeshift setObject:[TimeShiftCvt.fromTheta objectForKey:opt.timeShift.secondInterval] forKey:@"secondInterval"];
|
|
2171
|
-
}
|
|
2172
|
-
|
|
2173
|
-
[rct setObject:timeshift forKey:@"timeShift"];
|
|
2174
|
-
}
|
|
2175
|
-
},
|
|
2176
|
-
.setTimeShiftOption = ^(NSDictionary* rct, THETACTimeShiftCaptureBuilder *builder) {
|
|
2177
|
-
NSDictionary *timeshiftDic = [rct objectForKey:@"timeShift"];
|
|
2178
|
-
if (timeshiftDic) {
|
|
2179
|
-
[builder setIsFrontFirstIsFrontFirst:!isNull([timeshiftDic objectForKey:@"isFrontFirst"]) ? [THETACBoolean numberWithBool:((NSNumber*) [timeshiftDic objectForKey:@"isFrontFirst"]).boolValue] : nil];
|
|
2180
|
-
[builder setFirstIntervalInterval:!isNull([timeshiftDic objectForKey:@"firstInterval"]) ? [TimeShiftCvt.toTheta objectForKey:[timeshiftDic objectForKey:@"firstInterval"]] : nil];
|
|
2181
|
-
[builder setSecondIntervalInterval:!isNull([timeshiftDic objectForKey:@"secondInterval"]) ? [TimeShiftCvt.toTheta objectForKey:[timeshiftDic objectForKey:@"secondInterval"]] : nil];
|
|
2182
|
-
}
|
|
2183
|
-
},
|
|
2184
|
-
};
|
|
2185
|
-
|
|
2186
|
-
/**
|
|
2187
|
-
* ShootingMethod convertor
|
|
2188
|
-
*/
|
|
2189
|
-
static convert_t ShootingMethodEnum = {
|
|
2190
|
-
.toTheta = @{
|
|
2191
|
-
@"NORMAL": THETACThetaRepositoryShootingMethodEnum.normal,
|
|
2192
|
-
@"INTERVAL": THETACThetaRepositoryShootingMethodEnum.interval,
|
|
2193
|
-
@"MOVE_INTERVAL": THETACThetaRepositoryShootingMethodEnum.moveInterval,
|
|
2194
|
-
@"FIXED_INTERVAL": THETACThetaRepositoryShootingMethodEnum.fixedInterval,
|
|
2195
|
-
@"BRACKET": THETACThetaRepositoryShootingMethodEnum.bracket,
|
|
2196
|
-
@"COMPOSITE": THETACThetaRepositoryShootingMethodEnum.composite,
|
|
2197
|
-
@"CONTINUOUS": THETACThetaRepositoryShootingMethodEnum.continuous,
|
|
2198
|
-
@"TIME_SHIFT": THETACThetaRepositoryShootingMethodEnum.timeShift,
|
|
2199
|
-
@"BURST": THETACThetaRepositoryShootingMethodEnum.burst,
|
|
2200
|
-
},
|
|
2201
|
-
.fromTheta = @{
|
|
2202
|
-
THETACThetaRepositoryShootingMethodEnum.normal: @"NORMAL",
|
|
2203
|
-
THETACThetaRepositoryShootingMethodEnum.interval: @"INTERVAL",
|
|
2204
|
-
THETACThetaRepositoryShootingMethodEnum.moveInterval: @"MOVE_INTERVAL",
|
|
2205
|
-
THETACThetaRepositoryShootingMethodEnum.fixedInterval: @"FIXED_INTERVAL",
|
|
2206
|
-
THETACThetaRepositoryShootingMethodEnum.bracket: @"BRACKET",
|
|
2207
|
-
THETACThetaRepositoryShootingMethodEnum.composite: @"COMPOSITE",
|
|
2208
|
-
THETACThetaRepositoryShootingMethodEnum.continuous: @"CONTINUOUS",
|
|
2209
|
-
THETACThetaRepositoryShootingMethodEnum.timeShift: @"TIME_SHIFT",
|
|
2210
|
-
THETACThetaRepositoryShootingMethodEnum.burst: @"BURST",
|
|
2211
|
-
},
|
|
2212
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
2213
|
-
id val = [ShootingMethodEnum.toTheta objectForKey:[rct objectForKey:@"shootingMethod"]];
|
|
2214
|
-
if (val) {
|
|
2215
|
-
opt.shootingMethod = val;
|
|
2216
|
-
}
|
|
2217
|
-
},
|
|
2218
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
2219
|
-
id val = [ShootingMethodEnum.toTheta objectForKey:[rct objectForKey:@"shootingMethod"]];
|
|
2220
|
-
if (val) {
|
|
2221
|
-
opt.shootingMethod = val;
|
|
2222
|
-
}
|
|
2223
|
-
},
|
|
2224
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
2225
|
-
id val = [ShootingMethodEnum.fromTheta objectForKey:opt.shootingMethod];
|
|
2226
|
-
if (val) {
|
|
2227
|
-
[rct setObject:val forKey:@"shootingMethod"];
|
|
2228
|
-
}
|
|
2229
|
-
}
|
|
2230
|
-
};
|
|
2231
|
-
|
|
2232
|
-
/**
|
|
2233
|
-
* Username converter
|
|
2234
|
-
*/
|
|
2235
|
-
static convert_t UsernameCvt = {
|
|
2236
|
-
.setToTheta = ^(NSDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
2237
|
-
NSString* val = [rct objectForKey:@"username"];
|
|
2238
|
-
if (val) {
|
|
2239
|
-
opt.username = val;
|
|
2240
|
-
}
|
|
2241
|
-
},
|
|
2242
|
-
.setFromTheta = ^(NSMutableDictionary* rct, THETACThetaRepositoryOptions *opt) {
|
|
2243
|
-
if (opt.username) {
|
|
2244
|
-
[rct setObject:opt.username forKey:@"username"];
|
|
2245
|
-
}
|
|
2246
|
-
}
|
|
2247
|
-
};
|
|
2248
|
-
|
|
2249
|
-
/**
|
|
2250
|
-
* OptionNames converter
|
|
2251
|
-
*/
|
|
2252
|
-
static NSDictionary *NameToOptionEnum = @{
|
|
2253
|
-
@"AiAutoThumbnail": THETACThetaRepositoryOptionNameEnum.aiautothumbnail,
|
|
2254
|
-
@"Aperture": THETACThetaRepositoryOptionNameEnum.aperture,
|
|
2255
|
-
@"Bitrate": THETACThetaRepositoryOptionNameEnum.bitrate,
|
|
2256
|
-
@"BluetoothPower": THETACThetaRepositoryOptionNameEnum.bluetoothpower,
|
|
2257
|
-
@"BurstMode": THETACThetaRepositoryOptionNameEnum.burstmode,
|
|
2258
|
-
@"BurstOption": THETACThetaRepositoryOptionNameEnum.burstoption,
|
|
2259
|
-
@"CameraControlSource": THETACThetaRepositoryOptionNameEnum.cameracontrolsource,
|
|
2260
|
-
@"CameraMode": THETACThetaRepositoryOptionNameEnum.cameramode,
|
|
2261
|
-
@"CaptureInterval": THETACThetaRepositoryOptionNameEnum.captureinterval,
|
|
2262
|
-
@"CaptureMode": THETACThetaRepositoryOptionNameEnum.capturemode,
|
|
2263
|
-
@"CaptureNumber": THETACThetaRepositoryOptionNameEnum.capturenumber,
|
|
2264
|
-
@"ColorTemperature": THETACThetaRepositoryOptionNameEnum.colortemperature,
|
|
2265
|
-
@"CompositeShootingOutputInterval": THETACThetaRepositoryOptionNameEnum.compositeshootingoutputinterval,
|
|
2266
|
-
@"CompositeShootingTime": THETACThetaRepositoryOptionNameEnum.compositeshootingtime,
|
|
2267
|
-
@"ContinuousNumber": THETACThetaRepositoryOptionNameEnum.continuousnumber,
|
|
2268
|
-
@"DateTimeZone": THETACThetaRepositoryOptionNameEnum.datetimezone,
|
|
2269
|
-
@"ExposureCompensation": THETACThetaRepositoryOptionNameEnum.exposurecompensation,
|
|
2270
|
-
@"ExposureDelay": THETACThetaRepositoryOptionNameEnum.exposuredelay,
|
|
2271
|
-
@"ExposureProgram": THETACThetaRepositoryOptionNameEnum.exposureprogram,
|
|
2272
|
-
@"FileFormat": THETACThetaRepositoryOptionNameEnum.fileformat,
|
|
2273
|
-
@"Filter": THETACThetaRepositoryOptionNameEnum.filter,
|
|
2274
|
-
@"GpsInfo": THETACThetaRepositoryOptionNameEnum.gpsinfo,
|
|
2275
|
-
@"IsGpsOn": THETACThetaRepositoryOptionNameEnum.isgpson,
|
|
2276
|
-
@"Iso": THETACThetaRepositoryOptionNameEnum.iso,
|
|
2277
|
-
@"IsoAutoHighLimit": THETACThetaRepositoryOptionNameEnum.isoautohighlimit,
|
|
2278
|
-
@"Language": THETACThetaRepositoryOptionNameEnum.language,
|
|
2279
|
-
@"MaxRecordableTime": THETACThetaRepositoryOptionNameEnum.maxrecordabletime,
|
|
2280
|
-
@"NetworkType": THETACThetaRepositoryOptionNameEnum.networktype,
|
|
2281
|
-
@"OffDelay": THETACThetaRepositoryOptionNameEnum.offdelay,
|
|
2282
|
-
@"Password": THETACThetaRepositoryOptionNameEnum.password,
|
|
2283
|
-
@"PowerSaving": THETACThetaRepositoryOptionNameEnum.powersaving,
|
|
2284
|
-
@"Preset": THETACThetaRepositoryOptionNameEnum.preset,
|
|
2285
|
-
@"PreviewFormat": THETACThetaRepositoryOptionNameEnum.previewformat,
|
|
2286
|
-
@"Proxy": THETACThetaRepositoryOptionNameEnum.proxy,
|
|
2287
|
-
@"ShootingMethod": THETACThetaRepositoryOptionNameEnum.shootingmethod,
|
|
2288
|
-
@"ShutterSpeed": THETACThetaRepositoryOptionNameEnum.shutterspeed,
|
|
2289
|
-
@"SleepDelay": THETACThetaRepositoryOptionNameEnum.sleepdelay,
|
|
2290
|
-
@"RemainingPictures": THETACThetaRepositoryOptionNameEnum.remainingpictures,
|
|
2291
|
-
@"RemainingVideoSeconds": THETACThetaRepositoryOptionNameEnum.remainingvideoseconds,
|
|
2292
|
-
@"RemainingSpace": THETACThetaRepositoryOptionNameEnum.remainingspace,
|
|
2293
|
-
@"TimeShift": THETACThetaRepositoryOptionNameEnum.timeshift,
|
|
2294
|
-
@"TotalSpace": THETACThetaRepositoryOptionNameEnum.totalspace,
|
|
2295
|
-
@"ShutterVolume": THETACThetaRepositoryOptionNameEnum.shuttervolume,
|
|
2296
|
-
@"Username": THETACThetaRepositoryOptionNameEnum.username,
|
|
2297
|
-
@"WhiteBalance": THETACThetaRepositoryOptionNameEnum.whitebalance,
|
|
2298
|
-
@"WhiteBalanceAutoStrength": THETACThetaRepositoryOptionNameEnum.whitebalanceautostrength,
|
|
2299
|
-
@"WlanFrequency": THETACThetaRepositoryOptionNameEnum.wlanfrequency
|
|
2300
|
-
};
|
|
2301
|
-
|
|
2302
|
-
/**
|
|
2303
|
-
* OptionNameEnum to OptionName
|
|
2304
|
-
*/
|
|
2305
|
-
static NSDictionary *OptionEnumToOption = @{
|
|
2306
|
-
@"AiAutoThumbnail": @"aiAutoThumbnail",
|
|
2307
|
-
@"Aperture": @"aperture",
|
|
2308
|
-
@"Bitrate": @"bitrate",
|
|
2309
|
-
@"BluetoothPower": @"bluetoothPower",
|
|
2310
|
-
@"BurstMode": @"burstMode",
|
|
2311
|
-
@"BurstOption": @"burstOption",
|
|
2312
|
-
@"CameraControlSource": @"cameraControlSource",
|
|
2313
|
-
@"CameraMode": @"cameraMode",
|
|
2314
|
-
@"CaptureInterval": @"captureInterval",
|
|
2315
|
-
@"CaptureMode": @"captureMode",
|
|
2316
|
-
@"CaptureNumber": @"captureNumber",
|
|
2317
|
-
@"ColorTemperature": @"colorTemperature",
|
|
2318
|
-
@"CompositeShootingOutputInterval": @"compositeShootingOutputInterval",
|
|
2319
|
-
@"CompositeShootingTime": @"compositeShootingTime",
|
|
2320
|
-
@"ContinuousNumber": @"continuousNumber",
|
|
2321
|
-
@"DateTimeZone": @"dateTimeZone",
|
|
2322
|
-
@"ExposureCompensation": @"exposureCompensation",
|
|
2323
|
-
@"ExposureDelay": @"exposureDelay",
|
|
2324
|
-
@"ExposureProgram": @"exposureProgram",
|
|
2325
|
-
@"FileFormat": @"fileFormat",
|
|
2326
|
-
@"Filter": @"filter",
|
|
2327
|
-
@"GpsInfo": @"gpsInfo",
|
|
2328
|
-
@"IsGpsOn": @"isGpsOn",
|
|
2329
|
-
@"Iso": @"iso",
|
|
2330
|
-
@"IsoAutoHighLimit": @"isoAutoHighLimit",
|
|
2331
|
-
@"Language": @"language",
|
|
2332
|
-
@"MaxRecordableTime": @"maxRecordableTime",
|
|
2333
|
-
@"NetworkType": @"networkType",
|
|
2334
|
-
@"OffDelay": @"offDelay",
|
|
2335
|
-
@"Password": @"password",
|
|
2336
|
-
@"PowerSaving": @"powerSaving",
|
|
2337
|
-
@"Preset": @"preset",
|
|
2338
|
-
@"PreviewFormat": @"previewFormat",
|
|
2339
|
-
@"Proxy": @"proxy",
|
|
2340
|
-
@"ShootingMethod": @"shootingMethod",
|
|
2341
|
-
@"ShutterSpeed": @"shutterSpeed",
|
|
2342
|
-
@"SleepDelay": @"sleepDelay",
|
|
2343
|
-
@"RemainingPictures": @"remainingPictures",
|
|
2344
|
-
@"RemainingVideoSeconds": @"remainingVideoSeconds",
|
|
2345
|
-
@"RemainingSpace": @"remainingSpace",
|
|
2346
|
-
@"TimeShift": @"timeShift",
|
|
2347
|
-
@"TotalSpace": @"totalSpace",
|
|
2348
|
-
@"ShutterVolume": @"shutterVolume",
|
|
2349
|
-
@"Username": @"username",
|
|
2350
|
-
@"WhiteBalance": @"whiteBalance",
|
|
2351
|
-
@"WhiteBalanceAutoStrength": @"whiteBalanceAutoStrength",
|
|
2352
|
-
@"WlanFrequency": @"wlanFrequency"
|
|
2353
|
-
};
|
|
2354
|
-
|
|
2355
|
-
/** Option converter builder */
|
|
2356
|
-
typedef convert_t * (^OptionConverter)();
|
|
2357
|
-
|
|
2358
|
-
/**
|
|
2359
|
-
* option converter tables
|
|
2360
|
-
*/
|
|
2361
|
-
static NSDictionary<NSString*, OptionConverter> *NameToConverter = @{
|
|
2362
|
-
@"aiAutoThumbnail": ^{return &AiAutoThumbnailEnum;},
|
|
2363
|
-
@"aperture": ^{return &ApertureEnum;},
|
|
2364
|
-
@"bitrate": ^{return &BitrateEnum;},
|
|
2365
|
-
@"bluetoothPower": ^{return &BluetoothPowerEnum;},
|
|
2366
|
-
@"burstMode": ^{return &BurstModeEnum;},
|
|
2367
|
-
@"burstOption": ^{return &BurstOptionCvt;},
|
|
2368
|
-
@"cameraControlSource": ^{return &CameraControlSourceEnum;},
|
|
2369
|
-
@"cameraMode": ^{return &CameraModeEnum;},
|
|
2370
|
-
@"captureInterval": ^{return &CaptureIntervalConverter;},
|
|
2371
|
-
@"captureMode": ^{return &CaptureModeEnum;},
|
|
2372
|
-
@"captureNumber": ^{return &CaptureNumberConverter;},
|
|
2373
|
-
@"colorTemperature": ^{return &ColorTemperatureCvt;},
|
|
2374
|
-
@"compositeShootingOutputInterval": ^{return &CompositeShootingOutputIntervalCvt;},
|
|
2375
|
-
@"compositeShootingTime": ^{return &CompositeShootingTimeCvt;},
|
|
2376
|
-
@"continuousNumber": ^{return &ContinuousNumberEnum;},
|
|
2377
|
-
@"dateTimeZone": ^{return &DateTimeZoneCvt;},
|
|
2378
|
-
@"exposureCompensation": ^{return &ExposureCompensationEnum;},
|
|
2379
|
-
@"exposureDelay": ^{return &ExposureDelayEnum;},
|
|
2380
|
-
@"exposureProgram": ^{return &ExposureProgramEnum;},
|
|
2381
|
-
@"fileFormat": ^{return &FileFormatEnum;},
|
|
2382
|
-
@"filter": ^{return &FilterEnum;},
|
|
2383
|
-
@"gpsInfo": ^{return &GpsInfoCvt;},
|
|
2384
|
-
@"isGpsOn": ^{return &IsGpsOnCvt;},
|
|
2385
|
-
@"iso": ^{return &IsoEnum;},
|
|
2386
|
-
@"isoAutoHighLimit": ^{return &IsoAutoHighLimitEnum;},
|
|
2387
|
-
@"language": ^{return &LanguageEnum;},
|
|
2388
|
-
@"maxRecordableTime": ^{return &MaxRecordableTimeEnum;},
|
|
2389
|
-
@"networkType": ^{return &NetworkTypeEnum;},
|
|
2390
|
-
@"offDelay": ^{return &OffDelayEnum;},
|
|
2391
|
-
@"password": ^{return &PasswordCvt;},
|
|
2392
|
-
@"powerSaving": ^{return &PowerSavingEnum;},
|
|
2393
|
-
@"preset": ^{return &PresetEnum;},
|
|
2394
|
-
@"previewFormat": ^{return &PreviewFormatEnum;},
|
|
2395
|
-
@"proxy": ^{return &ProxyCvt;},
|
|
2396
|
-
@"shootingMethod": ^{return &ShootingMethodEnum;},
|
|
2397
|
-
@"shutterSpeed": ^{return &ShutterSpeedEnum;},
|
|
2398
|
-
@"sleepDelay": ^{return &SleepDelayEnum;},
|
|
2399
|
-
@"remainingPictures": ^{return &RemainingPicturesCvt;},
|
|
2400
|
-
@"remainingVideoSeconds": ^{return &RemainingVideoSecondsCvt;},
|
|
2401
|
-
@"remainingSpace": ^{return &RemainingSpaceCvt;},
|
|
2402
|
-
@"timeShift": ^{return &TimeShiftCvt;},
|
|
2403
|
-
@"totalSpace": ^{return &TotalSpaceCvt;},
|
|
2404
|
-
@"shutterVolume": ^{return &ShutterVolumeCvt;},
|
|
2405
|
-
@"username": ^{return &UsernameCvt;},
|
|
2406
|
-
@"whiteBalance": ^{return &WhiteBalanceEnum;},
|
|
2407
|
-
@"_gpsTagRecording": ^{return &GpsTagRecordingEnum;},
|
|
2408
|
-
@"whiteBalanceAutoStrength": ^{return &WhiteBalanceAutoStrengthEnum;},
|
|
2409
|
-
@"wlanFrequency": ^{return &WlanFrequencyEnum;}
|
|
2410
|
-
};
|
|
2411
|
-
|
|
2412
|
-
static NSString *EVENT_NAME = @"ThetaFrameEvent";
|
|
2413
|
-
static NSString *EVENT_NOTIFY = @"ThetaNotify";
|
|
2414
|
-
|
|
2415
|
-
THETACDigestAuth* digestAuthToTheta(NSDictionary* objects)
|
|
2416
|
-
{
|
|
2417
|
-
if (!objects) {
|
|
2418
|
-
return nil;
|
|
2419
|
-
}
|
|
2420
|
-
NSString* username = [objects objectForKey:@"username"];
|
|
2421
|
-
if (!username) {
|
|
2422
|
-
return nil;
|
|
2423
|
-
}
|
|
2424
|
-
NSString* password = [objects objectForKey:@"password"];
|
|
2425
|
-
THETACDigestAuth* digestAuth = [[THETACDigestAuth alloc] initWithUsername:username password:password];
|
|
2426
|
-
return digestAuth;
|
|
2427
|
-
}
|
|
2428
|
-
|
|
2429
|
-
THETACThetaRepositoryConfig* configToTheta(NSDictionary* objects)
|
|
2430
|
-
{
|
|
2431
|
-
if (!objects) {
|
|
2432
|
-
return nil;
|
|
2433
|
-
}
|
|
2434
|
-
THETACThetaRepositoryConfig* config = [[THETACThetaRepositoryConfig alloc] init];
|
|
2435
|
-
NSString* datetime = [objects objectForKey:@"dateTime"];
|
|
2436
|
-
if (datetime) {
|
|
2437
|
-
config.dateTime = datetime;
|
|
2438
|
-
}
|
|
2439
|
-
id language = [LanguageEnum.toTheta objectForKey:[objects objectForKey:@"language"]];
|
|
2440
|
-
if (language) {
|
|
2441
|
-
config.language = language;
|
|
2442
|
-
}
|
|
2443
|
-
id offDelay = [OffDelayEnum.toTheta objectForKey:[objects objectForKey:@"offDelay"]];
|
|
2444
|
-
if (offDelay) {
|
|
2445
|
-
config.offDelay = offDelay;
|
|
2446
|
-
}
|
|
2447
|
-
id sleepDelay = [SleepDelayEnum.toTheta objectForKey:[objects objectForKey:@"sleepDelay"]];
|
|
2448
|
-
if (sleepDelay) {
|
|
2449
|
-
config.sleepDelay = sleepDelay;
|
|
2450
|
-
}
|
|
2451
|
-
NSNumber* shutterVolume = [objects objectForKey:@"shutterVolume"];
|
|
2452
|
-
if (shutterVolume) {
|
|
2453
|
-
config.shutterVolume = [THETACInt numberWithInt:[shutterVolume intValue]];
|
|
2454
|
-
}
|
|
2455
|
-
|
|
2456
|
-
config.clientMode = digestAuthToTheta([objects objectForKey:@"clientMode"]);
|
|
2457
|
-
|
|
2458
|
-
return config;
|
|
2459
|
-
}
|
|
2460
|
-
|
|
2461
|
-
THETACThetaRepositoryTimeout* timeoutToTheta(NSDictionary* objects)
|
|
2462
|
-
{
|
|
2463
|
-
if (!objects) {
|
|
2464
|
-
return nil;
|
|
2465
|
-
}
|
|
2466
|
-
NSNumber* connectTimeout = [objects objectForKey:@"connectTimeout"];
|
|
2467
|
-
NSNumber* requestTimeout = [objects objectForKey:@"requestTimeout"];
|
|
2468
|
-
NSNumber* socketTimeout = [objects objectForKey:@"socketTimeout"];
|
|
2469
|
-
if (!connectTimeout || !requestTimeout || !socketTimeout) {
|
|
2470
|
-
return nil;
|
|
2471
|
-
}
|
|
2472
|
-
THETACThetaRepositoryTimeout* timeout = [[THETACThetaRepositoryTimeout alloc]
|
|
2473
|
-
initWithConnectTimeout:[connectTimeout longValue]
|
|
2474
|
-
requestTimeout:[requestTimeout longLongValue]
|
|
2475
|
-
socketTimeout:[socketTimeout longLongValue]];
|
|
2476
|
-
return timeout;
|
|
2477
|
-
}
|
|
2478
|
-
|
|
2479
|
-
NSDictionary* fileInfoFromTheta(THETACThetaRepositoryFileInfo* fileInfo) {
|
|
2480
|
-
NSMutableDictionary *fileInfoObject = [NSMutableDictionary dictionaryWithDictionary:@{
|
|
2481
|
-
@"name":fileInfo.name,
|
|
2482
|
-
@"fileUrl":fileInfo.fileUrl,
|
|
2483
|
-
@"size":@(fileInfo.size),
|
|
2484
|
-
@"dateTime":fileInfo.dateTime,
|
|
2485
|
-
@"thumbnailUrl":fileInfo.thumbnailUrl
|
|
2486
|
-
}];
|
|
2487
|
-
if (fileInfo.lat) {
|
|
2488
|
-
[fileInfoObject setObject:@(fileInfo.lat.floatValue) forKey:@"lat"];
|
|
2489
|
-
}
|
|
2490
|
-
if (fileInfo.lng) {
|
|
2491
|
-
[fileInfoObject setObject:@(fileInfo.lng.floatValue) forKey:@"lng"];
|
|
2492
|
-
}
|
|
2493
|
-
if (fileInfo.width) {
|
|
2494
|
-
[fileInfoObject setObject:@(fileInfo.width.intValue) forKey:@"width"];
|
|
2495
|
-
}
|
|
2496
|
-
if (fileInfo.height) {
|
|
2497
|
-
[fileInfoObject setObject:@(fileInfo.height.intValue) forKey:@"height"];
|
|
2498
|
-
}
|
|
2499
|
-
if (fileInfo.intervalCaptureGroupId) {
|
|
2500
|
-
[fileInfoObject setObject:fileInfo.intervalCaptureGroupId forKey:@"intervalCaptureGroupId"];
|
|
2501
|
-
}
|
|
2502
|
-
if (fileInfo.compositeShootingGroupId) {
|
|
2503
|
-
[fileInfoObject setObject:fileInfo.compositeShootingGroupId forKey:@"compositeShootingGroupId"];
|
|
2504
|
-
}
|
|
2505
|
-
if (fileInfo.autoBracketGroupId) {
|
|
2506
|
-
[fileInfoObject setObject:fileInfo.autoBracketGroupId forKey:@"autoBracketGroupId"];
|
|
2507
|
-
}
|
|
2508
|
-
if (fileInfo.recordTime) {
|
|
2509
|
-
[fileInfoObject setObject:@(fileInfo.recordTime.intValue) forKey:@"recordTime"];
|
|
2510
|
-
}
|
|
2511
|
-
if (fileInfo.isProcessed) {
|
|
2512
|
-
[fileInfoObject setObject:@(fileInfo.isProcessed.boolValue) forKey:@"isProcessed"];
|
|
2513
|
-
}
|
|
2514
|
-
if (fileInfo.previewUrl) {
|
|
2515
|
-
[fileInfoObject setObject:fileInfo.previewUrl forKey:@"previewUrl"];
|
|
2516
|
-
}
|
|
2517
|
-
if (fileInfo.codec) {
|
|
2518
|
-
[fileInfoObject setObject:fileInfo.codec.name forKey:@"codec"];
|
|
2519
|
-
}
|
|
2520
|
-
if (fileInfo.projectionType) {
|
|
2521
|
-
[fileInfoObject setObject:fileInfo.projectionType.name forKey:@"projectionType"];
|
|
2522
|
-
}
|
|
2523
|
-
if (fileInfo.continuousShootingGroupId) {
|
|
2524
|
-
[fileInfoObject setObject:fileInfo.continuousShootingGroupId forKey:@"continuousShootingGroupId"];
|
|
2525
|
-
}
|
|
2526
|
-
if (fileInfo.frameRate) {
|
|
2527
|
-
[fileInfoObject setObject:@(fileInfo.frameRate.intValue) forKey:@"frameRate"];
|
|
2528
|
-
}
|
|
2529
|
-
if (fileInfo.favorite) {
|
|
2530
|
-
[fileInfoObject setObject:@(fileInfo.favorite.boolValue) forKey:@"favorite"];
|
|
2531
|
-
}
|
|
2532
|
-
if (fileInfo.imageDescription) {
|
|
2533
|
-
[fileInfoObject setObject:fileInfo.imageDescription forKey:@"imageDescription"];
|
|
2534
|
-
}
|
|
2535
|
-
if (fileInfo.storageID) {
|
|
2536
|
-
[fileInfoObject setObject:fileInfo.storageID forKey:@"storageID"];
|
|
2537
|
-
}
|
|
2538
|
-
|
|
2539
|
-
return fileInfoObject;
|
|
2540
|
-
}
|
|
2541
|
-
|
|
2542
|
-
/**
|
|
2543
|
-
* ThetaClientReactNative implementation
|
|
2544
|
-
*/
|
|
2545
|
-
@implementation ThetaClientReactNative {
|
|
2546
|
-
BOOL hasListeners;
|
|
2547
|
-
}
|
|
2548
|
-
RCT_EXPORT_MODULE(ThetaClientReactNative)
|
|
2549
|
-
|
|
2550
|
-
/**
|
|
2551
|
-
* Will be called when this module's first listener is added.
|
|
2552
|
-
*/
|
|
2553
|
-
-(void)startObserving {
|
|
2554
|
-
hasListeners = YES;
|
|
2555
|
-
// Set up any upstream listeners or background tasks as necessary
|
|
2556
|
-
}
|
|
2557
|
-
|
|
2558
|
-
/**
|
|
2559
|
-
* Will be called when this module's last listener is removed, or on dealloc.
|
|
2560
|
-
*/
|
|
2561
|
-
-(void)stopObserving {
|
|
2562
|
-
hasListeners = NO;
|
|
2563
|
-
// Remove upstream listeners, stop unnecessary background tasks
|
|
2564
|
-
}
|
|
2565
|
-
|
|
2566
|
-
/**
|
|
2567
|
-
* export constants
|
|
2568
|
-
*/
|
|
2569
|
-
- (NSDictionary *)constantsToExport
|
|
2570
|
-
{
|
|
2571
|
-
return @{ @"DEFAULT_EVENT_NAME": EVENT_NAME};
|
|
2572
|
-
}
|
|
2573
|
-
|
|
2574
|
-
/**
|
|
2575
|
-
* supported event name list
|
|
2576
|
-
*/
|
|
2577
|
-
-(NSArray *)supportedEvents
|
|
2578
|
-
{
|
|
2579
|
-
return @[EVENT_NAME, EVENT_NOTIFY];
|
|
2580
|
-
}
|
|
2581
|
-
|
|
2582
|
-
/**
|
|
2583
|
-
* dispatch queue to send events
|
|
2584
|
-
*/
|
|
2585
|
-
- (dispatch_queue_t)methodQueue
|
|
2586
|
-
{
|
|
2587
|
-
return dispatch_queue_create("com.ricoh360.event.queue", DISPATCH_QUEUE_SERIAL);
|
|
2588
|
-
}
|
|
2589
|
-
|
|
2590
|
-
/**
|
|
2591
|
-
* require main queue setup
|
|
2592
|
-
*/
|
|
2593
|
-
+ (BOOL)requiresMainQueueSetup
|
|
2594
|
-
{
|
|
2595
|
-
return YES;
|
|
2596
|
-
}
|
|
2597
|
-
|
|
2598
|
-
/**
|
|
2599
|
-
* initialize ThetaRepository
|
|
2600
|
-
* @param endPoint endpoint to connect theta
|
|
2601
|
-
* @param config Configuration of initialize. If null, get from THETA
|
|
2602
|
-
* @param timeout Timeout of HTTP call
|
|
2603
|
-
* @param resolve resolver for initilization
|
|
2604
|
-
* @param rejecter rejecter for initialization
|
|
2605
|
-
*/
|
|
2606
|
-
RCT_REMAP_METHOD(initialize,
|
|
2607
|
-
initializeWithEndpoint:(NSString *)endPoint
|
|
2608
|
-
withConfig:(NSDictionary*)config
|
|
2609
|
-
withTimeout:(NSDictionary*)timeout
|
|
2610
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
2611
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2612
|
-
{
|
|
2613
|
-
self.theta = nil;
|
|
2614
|
-
self.photoCaptureBuilder = nil;
|
|
2615
|
-
self.photoCapture = nil;
|
|
2616
|
-
self.timeShiftCaptureBuilder = nil;
|
|
2617
|
-
self.timeShiftCapture = nil;
|
|
2618
|
-
self.timeShiftCapturing = nil;
|
|
2619
|
-
self.videoCaptureBuilder = nil;
|
|
2620
|
-
self.videoCapture = nil;
|
|
2621
|
-
self.videoCapturing = nil;
|
|
2622
|
-
self.previewing = NO;
|
|
2623
|
-
|
|
2624
|
-
if (!endPoint) {
|
|
2625
|
-
endPoint = @"http://192.168.1.1";
|
|
2626
|
-
}
|
|
2627
|
-
NSError *error = nil;
|
|
2628
|
-
THETACThetaRepositoryCompanion *companion = THETACThetaRepository.companion;
|
|
2629
|
-
[companion doNewInstanceEndpoint:endPoint
|
|
2630
|
-
config:configToTheta(config)
|
|
2631
|
-
timeout:timeoutToTheta(timeout)
|
|
2632
|
-
completionHandler:^(THETACThetaRepository *repo, NSError *error) {
|
|
2633
|
-
if (error) {
|
|
2634
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
2635
|
-
} else if (repo) {
|
|
2636
|
-
self.theta = repo;
|
|
2637
|
-
resolve(@(YES));
|
|
2638
|
-
} else {
|
|
2639
|
-
reject(ERROR_CODE_ERROR, @"can not create repository", nil);
|
|
2640
|
-
}
|
|
2641
|
-
}];
|
|
2642
|
-
}
|
|
2643
|
-
|
|
2644
|
-
/**
|
|
2645
|
-
* isInitialized - Returns whether it is initialized or not.
|
|
2646
|
-
* @param resolve is initialized
|
|
2647
|
-
* @param rejecter
|
|
2648
|
-
*/
|
|
2649
|
-
RCT_REMAP_METHOD(isInitialized,
|
|
2650
|
-
isInitializedWithResolver:(RCTPromiseResolveBlock)resolve
|
|
2651
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2652
|
-
{
|
|
2653
|
-
resolve(_theta != nil ? @(YES) : @(NO));
|
|
2654
|
-
}
|
|
2655
|
-
|
|
2656
|
-
/**
|
|
2657
|
-
* getThetaModel - Returns the connected THETA model.
|
|
2658
|
-
* @param resolve for getThetaModel
|
|
2659
|
-
* @param rejecter
|
|
2660
|
-
*/
|
|
2661
|
-
RCT_REMAP_METHOD(getThetaModel,
|
|
2662
|
-
getThetaModelWithResolver:(RCTPromiseResolveBlock)resolve
|
|
2663
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2664
|
-
{
|
|
2665
|
-
if (!_theta) {
|
|
2666
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
2667
|
-
return;
|
|
2668
|
-
}
|
|
2669
|
-
resolve(self.theta.cameraModel ? self.theta.cameraModel.name : nil);
|
|
2670
|
-
}
|
|
2671
|
-
|
|
2672
|
-
/**
|
|
2673
|
-
* getThetaInfo - retrieve ThetaInfo from THETA via repository
|
|
2674
|
-
* @param resolve resolver for getThetaInfo
|
|
2675
|
-
* @param rejecter rejecter for getThetaInfo
|
|
2676
|
-
*/
|
|
2677
|
-
RCT_REMAP_METHOD(getThetaInfo,
|
|
2678
|
-
getThetaInfoWithResolver:(RCTPromiseResolveBlock)resolve
|
|
2679
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2680
|
-
{
|
|
2681
|
-
if (!_theta) {
|
|
2682
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
2683
|
-
return;
|
|
2684
|
-
}
|
|
2685
|
-
[_theta getThetaInfoWithCompletionHandler:^(THETACThetaRepositoryThetaInfo *info,
|
|
2686
|
-
NSError *error) {
|
|
2687
|
-
if (error) {
|
|
2688
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
2689
|
-
} else if (info) {
|
|
2690
|
-
NSMutableArray *apiLevelList = [[NSMutableArray alloc] init];
|
|
2691
|
-
for (THETACInt *element in info.apiLevel) {
|
|
2692
|
-
[apiLevelList addObject:@([element intValue])];
|
|
2693
|
-
}
|
|
2694
|
-
NSMutableDictionary *thetaInfoObject = [NSMutableDictionary dictionaryWithDictionary:@{
|
|
2695
|
-
@"manufacturer": info.manufacturer,
|
|
2696
|
-
@"model": info.model,
|
|
2697
|
-
@"serialNumber": info.serialNumber,
|
|
2698
|
-
@"wlanMacAddress": info.wlanMacAddress != nil ? info.wlanMacAddress : [NSNull null],
|
|
2699
|
-
@"bluetoothMacAddress": info.bluetoothMacAddress != nil ? info.bluetoothMacAddress : [NSNull null],
|
|
2700
|
-
@"firmwareVersion": info.firmwareVersion,
|
|
2701
|
-
@"supportUrl": info.supportUrl,
|
|
2702
|
-
@"hasGps": @(info.hasGps),
|
|
2703
|
-
@"hasGyro": @(info.hasGyro),
|
|
2704
|
-
@"uptime": @(info.uptime),
|
|
2705
|
-
@"api": info.api,
|
|
2706
|
-
@"endpoints": @{
|
|
2707
|
-
@"httpPort": @(info.endpoints.httpPort),
|
|
2708
|
-
@"httpUpdatesPort": @(info.endpoints.httpUpdatesPort),
|
|
2709
|
-
},
|
|
2710
|
-
@"apiLevel": apiLevelList
|
|
2711
|
-
}];
|
|
2712
|
-
if (self.theta.cameraModel) {
|
|
2713
|
-
[thetaInfoObject setObject:self.theta.cameraModel.name forKey:@"thetaModel"];
|
|
2714
|
-
}
|
|
2715
|
-
resolve(thetaInfoObject);
|
|
2716
|
-
} else {
|
|
2717
|
-
reject(ERROR_CODE_ERROR, @"no info", nil);
|
|
2718
|
-
}
|
|
2719
|
-
}];
|
|
2720
|
-
}
|
|
2721
|
-
|
|
2722
|
-
/**
|
|
2723
|
-
* getThetaState - retrieve ThetaState from THETA via repository
|
|
2724
|
-
* @param resolve resolver for getThetaState
|
|
2725
|
-
* @param rejecter rejecter for getThetaState
|
|
2726
|
-
*/
|
|
2727
|
-
RCT_REMAP_METHOD(getThetaState,
|
|
2728
|
-
getThetaStateWithResolver:(RCTPromiseResolveBlock)resolve
|
|
2729
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2730
|
-
{
|
|
2731
|
-
if (!_theta) {
|
|
2732
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
2733
|
-
return;
|
|
2734
|
-
}
|
|
2735
|
-
[_theta getThetaStateWithCompletionHandler:^(THETACThetaRepositoryThetaState *state,
|
|
2736
|
-
NSError *error) {
|
|
2737
|
-
if (error) {
|
|
2738
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
2739
|
-
} else if (state) {
|
|
2740
|
-
NSMutableArray *cameraErrorList = [[NSMutableArray alloc] init];
|
|
2741
|
-
if (state.cameraError != nil) {
|
|
2742
|
-
for (THETACThetaRepositoryCameraErrorEnum *element in state.cameraError) {
|
|
2743
|
-
[cameraErrorList addObject:[CameraErrorEnum.fromTheta objectForKey:element]];
|
|
2744
|
-
}
|
|
2745
|
-
}
|
|
2746
|
-
resolve(@{@"fingerprint": state.fingerprint,
|
|
2747
|
-
@"batteryLevel": @(state.batteryLevel),
|
|
2748
|
-
@"storageUri": state.storageUri != nil ? state.storageUri : [NSNull null],
|
|
2749
|
-
@"storageID": state.storageID != nil ? state.storageID : [NSNull null],
|
|
2750
|
-
@"captureStatus": [CaptureStatusEnum.fromTheta objectForKey:state.captureStatus],
|
|
2751
|
-
@"recordedTime": @(state.recordedTime),
|
|
2752
|
-
@"recordableTime": @(state.recordableTime),
|
|
2753
|
-
@"capturedPictures": state.capturedPictures != nil ? @([state.capturedPictures intValue]): [NSNull null],
|
|
2754
|
-
@"compositeShootingElapsedTime": state.compositeShootingElapsedTime != nil ? @([state.compositeShootingElapsedTime intValue]) : [NSNull null],
|
|
2755
|
-
@"latestFileUrl": state.latestFileUrl,
|
|
2756
|
-
@"chargingState": [ChargingStateEnum.fromTheta objectForKey:state.chargingState],
|
|
2757
|
-
@"apiVersion": @(state.apiVersion),
|
|
2758
|
-
@"isPluginRunning": state.isPluginRunning != nil ? @([state.isPluginRunning boolValue]) : [NSNull null],
|
|
2759
|
-
@"isPluginWebServer": state.isPluginWebServer != nil ? @([state.isPluginWebServer boolValue]) : [NSNull null],
|
|
2760
|
-
@"function": state.function != nil ? [ShootingFunctionEnum.fromTheta objectForKey:state.function] : [NSNull null],
|
|
2761
|
-
@"isMySettingChanged": state.isMySettingChanged != nil? @([state.isMySettingChanged boolValue]) : [NSNull null],
|
|
2762
|
-
@"currentMicrophone": state.currentMicrophone != nil ? [MicrophoneOptionEnum.fromTheta objectForKey:state.currentMicrophone] : [NSNull null],
|
|
2763
|
-
@"isSdCard": @(state.isSdCard),
|
|
2764
|
-
@"cameraError": state.cameraError != nil ? cameraErrorList : [NSNull null],
|
|
2765
|
-
@"isBatteryInsert": state.isBatteryInsert != nil ? @([state.isBatteryInsert boolValue]) : [NSNull null]});
|
|
2766
|
-
} else {
|
|
2767
|
-
reject(ERROR_CODE_ERROR, @"no state", nil);
|
|
2768
|
-
}
|
|
2769
|
-
}];
|
|
2770
|
-
}
|
|
2771
|
-
|
|
2772
|
-
/**
|
|
2773
|
-
* listFiles - retrieve File list from THETA via repository
|
|
2774
|
-
* @param fileType file type to retrieve
|
|
2775
|
-
* @param startPosition start position to retrieve
|
|
2776
|
-
* @param entryCount count to retrieve
|
|
2777
|
-
* @param storage Desired storage
|
|
2778
|
-
* @param resolve resolver for listFiles
|
|
2779
|
-
* @param rejecter rejecter for listFiles
|
|
2780
|
-
*/
|
|
2781
|
-
RCT_REMAP_METHOD(listFiles,
|
|
2782
|
-
listFilesWithFileTypeEnum:(NSString*)fileType
|
|
2783
|
-
withStartPosition:(int32_t)startPosition
|
|
2784
|
-
withEntryCount:(int32_t)entryCount
|
|
2785
|
-
withStorage:(NSString*)storage
|
|
2786
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
2787
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2788
|
-
{
|
|
2789
|
-
if (!_theta) {
|
|
2790
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
2791
|
-
return;
|
|
2792
|
-
}
|
|
2793
|
-
[_theta listFilesFileType:[FileTypeEnum.toTheta objectForKey:fileType]
|
|
2794
|
-
startPosition:startPosition
|
|
2795
|
-
entryCount:entryCount
|
|
2796
|
-
storage:[StorageEnum.toTheta objectForKey:storage]
|
|
2797
|
-
completionHandler:^(THETACThetaRepositoryThetaFiles *items,
|
|
2798
|
-
NSError *error) {
|
|
2799
|
-
if (error) {
|
|
2800
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
2801
|
-
} else if (items) {
|
|
2802
|
-
NSMutableArray *ary = [[NSMutableArray alloc] init];
|
|
2803
|
-
for (int i = 0; i < items.fileList.count; i++) {
|
|
2804
|
-
THETACThetaRepositoryFileInfo *finfo = items.fileList[i];
|
|
2805
|
-
[ary addObject:fileInfoFromTheta(finfo)];
|
|
2806
|
-
}
|
|
2807
|
-
resolve(@{@"fileList":ary,
|
|
2808
|
-
@"totalEntries": @(items.totalEntries)});
|
|
2809
|
-
} else {
|
|
2810
|
-
reject(ERROR_CODE_ERROR, @"no items", nil);
|
|
2811
|
-
}
|
|
2812
|
-
}];
|
|
2813
|
-
}
|
|
2814
|
-
|
|
2815
|
-
/**
|
|
2816
|
-
* deleteFiles - delete specified files
|
|
2817
|
-
* @param fileUrls file url list to delete
|
|
2818
|
-
* @param resolve resolver for deleteFiles
|
|
2819
|
-
* @param rejecter rejecter for deleteFiles
|
|
2820
|
-
*/
|
|
2821
|
-
RCT_REMAP_METHOD(deleteFiles,
|
|
2822
|
-
deleteFilesWithFileUrls:(NSArray*)fileUrls
|
|
2823
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
2824
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2825
|
-
{
|
|
2826
|
-
if (!_theta) {
|
|
2827
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
2828
|
-
return;
|
|
2829
|
-
}
|
|
2830
|
-
[_theta deleteFilesFileUrls:fileUrls completionHandler:^(NSError *error) {
|
|
2831
|
-
if (error) {
|
|
2832
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
2833
|
-
} else {
|
|
2834
|
-
resolve(@(YES));
|
|
2835
|
-
}
|
|
2836
|
-
}];
|
|
2837
|
-
}
|
|
2838
|
-
|
|
2839
|
-
/**
|
|
2840
|
-
* deleteAllFiles - delete all files
|
|
2841
|
-
* @param resolve resolver for deleteAllFiles
|
|
2842
|
-
* @param rejecter rejecter for deleteAllFiles
|
|
2843
|
-
*/
|
|
2844
|
-
RCT_REMAP_METHOD(deleteAllFiles,
|
|
2845
|
-
deleteAllFilesWithResolver:(RCTPromiseResolveBlock)resolve
|
|
2846
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2847
|
-
{
|
|
2848
|
-
if (!_theta) {
|
|
2849
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
2850
|
-
return;
|
|
2851
|
-
}
|
|
2852
|
-
[_theta deleteAllFilesWithCompletionHandler:^(NSError *error) {
|
|
2853
|
-
if (error) {
|
|
2854
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
2855
|
-
} else {
|
|
2856
|
-
resolve(@(YES));
|
|
2857
|
-
}
|
|
2858
|
-
}];
|
|
2859
|
-
}
|
|
2860
|
-
|
|
2861
|
-
/**
|
|
2862
|
-
* deleteAllImageFiles - delete all image files
|
|
2863
|
-
* @param resolve resolver for deleteAllImageFiles
|
|
2864
|
-
* @param rejecter rejecter for deleteAllImageFiles
|
|
2865
|
-
*/
|
|
2866
|
-
RCT_REMAP_METHOD(deleteAllImageFiles,
|
|
2867
|
-
deleteAllImageFilesWithResolver:(RCTPromiseResolveBlock)resolve
|
|
2868
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2869
|
-
{
|
|
2870
|
-
if (!_theta) {
|
|
2871
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
2872
|
-
return;
|
|
2873
|
-
}
|
|
2874
|
-
[_theta deleteAllImageFilesWithCompletionHandler:^(NSError *error) {
|
|
2875
|
-
if (error) {
|
|
2876
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
2877
|
-
return;
|
|
2878
|
-
}
|
|
2879
|
-
resolve(@(YES));
|
|
2880
|
-
}];
|
|
2881
|
-
}
|
|
2882
|
-
|
|
2883
|
-
/**
|
|
2884
|
-
* deleteAllVideoFiles - delete all video files
|
|
2885
|
-
* @param resolve resolver for deleteAllVideoFiles
|
|
2886
|
-
* @param rejecter rejecter for deleteAllVideoFiles
|
|
2887
|
-
*/
|
|
2888
|
-
RCT_REMAP_METHOD(deleteAllVideoFiles,
|
|
2889
|
-
deleteAllVideoFilesWithResolver:(RCTPromiseResolveBlock)resolve
|
|
2890
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2891
|
-
{
|
|
2892
|
-
if (!_theta) {
|
|
2893
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
2894
|
-
return;
|
|
2895
|
-
}
|
|
2896
|
-
[_theta deleteAllVideoFilesWithCompletionHandler:^(NSError *error) {
|
|
2897
|
-
if (error) {
|
|
2898
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
2899
|
-
} else {
|
|
2900
|
-
resolve(@(YES));
|
|
2901
|
-
}
|
|
2902
|
-
}];
|
|
2903
|
-
}
|
|
2904
|
-
|
|
2905
|
-
/**
|
|
2906
|
-
* getOptions - get options from THETA via repository
|
|
2907
|
-
* @param optionNames option name list to get
|
|
2908
|
-
* @param resolve resolver for getOptions
|
|
2909
|
-
* @param rejecter rejecter for getOptions
|
|
2910
|
-
*/
|
|
2911
|
-
RCT_REMAP_METHOD(getOptions,
|
|
2912
|
-
getOptionsWithOptionNames:(NSArray*)optionNames
|
|
2913
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
2914
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2915
|
-
{
|
|
2916
|
-
if (!_theta) {
|
|
2917
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
2918
|
-
return;
|
|
2919
|
-
}
|
|
2920
|
-
NSMutableArray *optionNameList = [[NSMutableArray alloc] init];
|
|
2921
|
-
for (id name in optionNames) {
|
|
2922
|
-
[optionNameList addObject:[NameToOptionEnum objectForKey:name]];
|
|
2923
|
-
}
|
|
2924
|
-
[_theta getOptionsOptionNames:optionNameList
|
|
2925
|
-
completionHandler:^(THETACThetaRepositoryOptions *options, NSError *error) {
|
|
2926
|
-
if (error) {
|
|
2927
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
2928
|
-
} else if (options) {
|
|
2929
|
-
NSMutableDictionary *results = [[NSMutableDictionary alloc] init];
|
|
2930
|
-
for (id name in optionNames) {
|
|
2931
|
-
id option = [OptionEnumToOption objectForKey:name];
|
|
2932
|
-
convert_t *convert = [NameToConverter objectForKey:option]();
|
|
2933
|
-
if (convert && convert->setFromTheta) {
|
|
2934
|
-
convert->setFromTheta(results, options);
|
|
2935
|
-
}
|
|
2936
|
-
}
|
|
2937
|
-
resolve(results);
|
|
2938
|
-
} else {
|
|
2939
|
-
reject(ERROR_CODE_ERROR, @"no options", nil);
|
|
2940
|
-
}
|
|
2941
|
-
}];
|
|
2942
|
-
}
|
|
2943
|
-
|
|
2944
|
-
/**
|
|
2945
|
-
* setOptions - set options to THETA via repository
|
|
2946
|
-
* @param options options to set
|
|
2947
|
-
* @param resolve resolver for setOptions
|
|
2948
|
-
* @param rejecter rejecter for setOptions
|
|
2949
|
-
*/
|
|
2950
|
-
RCT_REMAP_METHOD(setOptions,
|
|
2951
|
-
setOptionsWithOptions:(NSDictionary*)options
|
|
2952
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
2953
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
2954
|
-
{
|
|
2955
|
-
if (!_theta) {
|
|
2956
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
2957
|
-
return;
|
|
2958
|
-
}
|
|
2959
|
-
THETACThetaRepositoryOptions *newoptions = [[THETACThetaRepositoryOptions alloc] init];
|
|
2960
|
-
for (id option in [options allKeys]) {
|
|
2961
|
-
OptionConverter converter = [NameToConverter objectForKey:option];
|
|
2962
|
-
if (converter) {
|
|
2963
|
-
convert_t *convert = converter();
|
|
2964
|
-
if (convert && convert->setToTheta) {
|
|
2965
|
-
convert->setToTheta(options, newoptions);
|
|
2966
|
-
}
|
|
2967
|
-
}
|
|
2968
|
-
}
|
|
2969
|
-
[_theta setOptionsOptions:newoptions completionHandler:^(NSError *error) {
|
|
2970
|
-
if (error) {
|
|
2971
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
2972
|
-
} else {
|
|
2973
|
-
resolve(@(YES));
|
|
2974
|
-
}
|
|
2975
|
-
}];
|
|
2976
|
-
}
|
|
2977
|
-
|
|
2978
|
-
/**
|
|
2979
|
-
* return created data url from [data]
|
|
2980
|
-
*/
|
|
2981
|
-
-(NSString*)createDataURL:(NSData*) data
|
|
2982
|
-
{
|
|
2983
|
-
static NSMutableString *uri = nil;
|
|
2984
|
-
static NSUInteger prefix_length = 0;
|
|
2985
|
-
if (!uri) {
|
|
2986
|
-
uri = [[NSMutableString alloc] init];
|
|
2987
|
-
[uri appendString:@"data:image/jpeg;base64,"];
|
|
2988
|
-
prefix_length = [uri length];
|
|
2989
|
-
}
|
|
2990
|
-
NSString *b64 = [data base64EncodedStringWithOptions:0];
|
|
2991
|
-
NSRange range = {
|
|
2992
|
-
.location = prefix_length,
|
|
2993
|
-
.length = [uri length] - prefix_length
|
|
2994
|
-
};
|
|
2995
|
-
[uri replaceCharactersInRange:range withString:b64];
|
|
2996
|
-
b64 = nil;
|
|
2997
|
-
return uri;
|
|
2998
|
-
}
|
|
2999
|
-
|
|
3000
|
-
/**
|
|
3001
|
-
* getLivePreview - retrieve live preview frame from THETA via repository
|
|
3002
|
-
* @param resolve resolver for getLivePreview
|
|
3003
|
-
* @param rejecter rejecter for getLivePreview
|
|
3004
|
-
*/
|
|
3005
|
-
RCT_REMAP_METHOD(getLivePreview,
|
|
3006
|
-
getLivePreviewWithResolver:(RCTPromiseResolveBlock)resolve
|
|
3007
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3008
|
-
{
|
|
3009
|
-
if (!_theta) {
|
|
3010
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3011
|
-
return;
|
|
3012
|
-
}
|
|
3013
|
-
FrameHandler *_frameHandler =
|
|
3014
|
-
[[FrameHandler alloc] initWith:self withEvent:^(NSData *data) {
|
|
3015
|
-
if (self->hasListeners) {
|
|
3016
|
-
@autoreleasepool {
|
|
3017
|
-
NSString *dataUrl = [self createDataURL:data];
|
|
3018
|
-
[self sendEventWithName:EVENT_NAME body:@{@"data":dataUrl}];
|
|
3019
|
-
}
|
|
3020
|
-
}
|
|
3021
|
-
}];
|
|
3022
|
-
self.previewing = YES;
|
|
3023
|
-
[_theta getLivePreviewFrameHandler:_frameHandler completionHandler:^(NSError *error) {
|
|
3024
|
-
if (error) {
|
|
3025
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3026
|
-
} else {
|
|
3027
|
-
resolve(@(YES));
|
|
3028
|
-
}
|
|
3029
|
-
}];
|
|
3030
|
-
}
|
|
3031
|
-
|
|
3032
|
-
/**
|
|
3033
|
-
* stopLivePreview - stop live previewing
|
|
3034
|
-
*/
|
|
3035
|
-
RCT_REMAP_METHOD(stopLivePreview,
|
|
3036
|
-
stopLivePreview)
|
|
3037
|
-
{
|
|
3038
|
-
self.previewing = NO;
|
|
3039
|
-
}
|
|
3040
|
-
|
|
3041
|
-
/**
|
|
3042
|
-
* getPhotoCaptureBuilder - get photo capture builder from repository
|
|
3043
|
-
*/
|
|
3044
|
-
RCT_REMAP_METHOD(getPhotoCaptureBuilder,
|
|
3045
|
-
getPhotoCaptureBuilder)
|
|
3046
|
-
{
|
|
3047
|
-
if (!_theta) {
|
|
3048
|
-
[NSException raise:ERROR_CODE_ERROR format:MESSAGE_NOT_INIT];
|
|
3049
|
-
return;
|
|
3050
|
-
}
|
|
3051
|
-
self.photoCaptureBuilder = [_theta getPhotoCaptureBuilder];
|
|
3052
|
-
}
|
|
3053
|
-
|
|
3054
|
-
/**
|
|
3055
|
-
* buildPhotoCapture - build photo capture
|
|
3056
|
-
* @param options option to take picture
|
|
3057
|
-
* @param resolve resolver for buildPhotoCapture
|
|
3058
|
-
* @param rejecter rejecter for buildPhotoCapture
|
|
3059
|
-
*/
|
|
3060
|
-
RCT_REMAP_METHOD(buildPhotoCapture,
|
|
3061
|
-
buildPhotoCaptureWithOptions:(NSDictionary*)options
|
|
3062
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
3063
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3064
|
-
{
|
|
3065
|
-
if (!_theta) {
|
|
3066
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3067
|
-
return;
|
|
3068
|
-
}
|
|
3069
|
-
if (!self.photoCaptureBuilder) {
|
|
3070
|
-
reject(ERROR_CODE_ERROR, @"no photo capture pbuilder", nil);
|
|
3071
|
-
return;
|
|
3072
|
-
}
|
|
3073
|
-
for (id photoOption in [options allKeys]) {
|
|
3074
|
-
convert_t *convert = [NameToConverter objectForKey:photoOption]();
|
|
3075
|
-
if (convert && convert->setPhotoOption) {
|
|
3076
|
-
convert->setPhotoOption(options, self.photoCaptureBuilder);
|
|
3077
|
-
}
|
|
3078
|
-
}
|
|
3079
|
-
[self.photoCaptureBuilder
|
|
3080
|
-
buildWithCompletionHandler:^(THETACPhotoCapture *photoCapture, NSError *error) {
|
|
3081
|
-
if (error) {
|
|
3082
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3083
|
-
return;
|
|
3084
|
-
}
|
|
3085
|
-
if (photoCapture) {
|
|
3086
|
-
self.photoCapture = photoCapture;
|
|
3087
|
-
self.photoCaptureBuilder = nil;
|
|
3088
|
-
resolve(@(YES));
|
|
3089
|
-
} else {
|
|
3090
|
-
reject(ERROR_CODE_ERROR, @"no photoCapture", nil);
|
|
3091
|
-
}
|
|
3092
|
-
}];
|
|
3093
|
-
}
|
|
3094
|
-
|
|
3095
|
-
/**
|
|
3096
|
-
* takePicture - take a picture with THETA via repository
|
|
3097
|
-
* @param resolve resolver for takePicture
|
|
3098
|
-
* @param rejecter rejecter for takePicture
|
|
3099
|
-
*/
|
|
3100
|
-
RCT_REMAP_METHOD(takePicture,
|
|
3101
|
-
takePictureWithResolver:(RCTPromiseResolveBlock)resolve
|
|
3102
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3103
|
-
{
|
|
3104
|
-
if (!_theta) {
|
|
3105
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3106
|
-
return;
|
|
3107
|
-
}
|
|
3108
|
-
if (!self.photoCapture) {
|
|
3109
|
-
reject(ERROR_CODE_ERROR, @"no photoCapture", nil);
|
|
3110
|
-
return;
|
|
3111
|
-
}
|
|
3112
|
-
PhotoCallback *callback = [[PhotoCallback alloc] initWith:self
|
|
3113
|
-
withResolver:resolve
|
|
3114
|
-
withRejecter:reject];
|
|
3115
|
-
[self.photoCapture takePictureCallback:callback];
|
|
3116
|
-
}
|
|
3117
|
-
|
|
3118
|
-
/**
|
|
3119
|
-
* getTimeShiftCaptureBuilder - get time-shift builder from repository
|
|
3120
|
-
*/
|
|
3121
|
-
RCT_REMAP_METHOD(getTimeShiftCaptureBuilder,
|
|
3122
|
-
getTimeShiftCaptureBuilder)
|
|
3123
|
-
{
|
|
3124
|
-
if (!_theta) {
|
|
3125
|
-
[NSException raise:ERROR_CODE_ERROR format:MESSAGE_NOT_INIT];
|
|
3126
|
-
return;
|
|
3127
|
-
}
|
|
3128
|
-
self.timeShiftCaptureBuilder = [_theta getTimeShiftCaptureBuilder];
|
|
3129
|
-
}
|
|
3130
|
-
|
|
3131
|
-
/**
|
|
3132
|
-
* buildTimeShiftCapture - build time-shift capture
|
|
3133
|
-
* @param options option to execute time-shift
|
|
3134
|
-
* @param interval interval of checking time-shift status
|
|
3135
|
-
* @param resolve resolver for buildTimeShiftCapture
|
|
3136
|
-
* @param rejecter rejecter for buildTimeShiftCapture
|
|
3137
|
-
*/
|
|
3138
|
-
RCT_REMAP_METHOD(buildTimeShiftCapture,
|
|
3139
|
-
buildTimeShiftCaptureWithOptions:(NSDictionary*)options
|
|
3140
|
-
withInterval:(int)interval
|
|
3141
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
3142
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3143
|
-
{
|
|
3144
|
-
if (!_theta) {
|
|
3145
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3146
|
-
return;
|
|
3147
|
-
}
|
|
3148
|
-
if (!self.timeShiftCaptureBuilder) {
|
|
3149
|
-
reject(@"error", @"no time-shift capture pbuilder", nil);
|
|
3150
|
-
return;
|
|
3151
|
-
}
|
|
3152
|
-
|
|
3153
|
-
for (id option in [options allKeys]) {
|
|
3154
|
-
convert_t *convert = [NameToConverter objectForKey:option]();
|
|
3155
|
-
if (convert && convert->setTimeShiftOption) {
|
|
3156
|
-
convert->setTimeShiftOption(options, self.timeShiftCaptureBuilder);
|
|
3157
|
-
}
|
|
3158
|
-
}
|
|
3159
|
-
|
|
3160
|
-
if (interval >= 0) {
|
|
3161
|
-
[self.timeShiftCaptureBuilder setCheckStatusCommandIntervalTimeMillis: (int64_t)interval];
|
|
3162
|
-
}
|
|
3163
|
-
|
|
3164
|
-
[self.timeShiftCaptureBuilder buildWithCompletionHandler:^(THETACTimeShiftCapture *timeShiftCapture, NSError *error) {
|
|
3165
|
-
if (error) {
|
|
3166
|
-
reject(@"error", [error localizedDescription], error);
|
|
3167
|
-
return;
|
|
3168
|
-
}
|
|
3169
|
-
if (timeShiftCapture) {
|
|
3170
|
-
self.timeShiftCapture = timeShiftCapture;
|
|
3171
|
-
self.timeShiftCaptureBuilder = nil;
|
|
3172
|
-
resolve(@(YES));
|
|
3173
|
-
} else {
|
|
3174
|
-
reject(@"error", @"no timeShiftCapture", nil);
|
|
3175
|
-
}
|
|
3176
|
-
}];
|
|
3177
|
-
}
|
|
3178
|
-
|
|
3179
|
-
/**
|
|
3180
|
-
* startTimeShiftCapture - start time-shift
|
|
3181
|
-
* @param resolve resolver for startTimeShiftCapture
|
|
3182
|
-
* @param rejecter rejecter for startTimeShiftCapture
|
|
3183
|
-
*/
|
|
3184
|
-
RCT_REMAP_METHOD(startTimeShiftCapture,
|
|
3185
|
-
startTimeShiftCaptureWithResolver:(RCTPromiseResolveBlock)resolve
|
|
3186
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3187
|
-
{
|
|
3188
|
-
if (!_theta) {
|
|
3189
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3190
|
-
return;
|
|
3191
|
-
}
|
|
3192
|
-
if (!self.timeShiftCapture) {
|
|
3193
|
-
reject(@"error", @"no timeShiftCapture", nil);
|
|
3194
|
-
return;
|
|
3195
|
-
}
|
|
3196
|
-
|
|
3197
|
-
TimeShiftStartCallback *callback = [[TimeShiftStartCallback alloc] initWith:self
|
|
3198
|
-
withProgress:^(float completion) {
|
|
3199
|
-
[self sendEventWithName:EVENT_NOTIFY
|
|
3200
|
-
body:toCaptureProgressNotifyParam([NSNumber numberWithFloat:completion])];
|
|
3201
|
-
}
|
|
3202
|
-
withResolver:resolve
|
|
3203
|
-
withRejecter:reject];
|
|
3204
|
-
self.timeShiftCapturing = [self.timeShiftCapture startCaptureCallback:callback];
|
|
3205
|
-
}
|
|
3206
|
-
|
|
3207
|
-
/**
|
|
3208
|
-
* cancelTimeShiftCapture - stop time-shift
|
|
3209
|
-
* @param resolve resolver for stopTimeShiftCapture
|
|
3210
|
-
* @param rejecter rejecter for stopTimeShiftCapture
|
|
3211
|
-
*/
|
|
3212
|
-
RCT_REMAP_METHOD(cancelTimeShiftCapture,
|
|
3213
|
-
cancelTimeShiftCaptureWithResolver:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3214
|
-
{
|
|
3215
|
-
if (!_theta) {
|
|
3216
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3217
|
-
return;
|
|
3218
|
-
}
|
|
3219
|
-
|
|
3220
|
-
if (!self.timeShiftCapturing) {
|
|
3221
|
-
reject(@"error", @"no timeShiftCapturing", nil);
|
|
3222
|
-
return;
|
|
3223
|
-
}
|
|
3224
|
-
|
|
3225
|
-
[self.timeShiftCapturing cancelCapture];
|
|
3226
|
-
}
|
|
3227
|
-
|
|
3228
|
-
/**
|
|
3229
|
-
* getVideoCaptureBuilder - get video capture builder
|
|
3230
|
-
*/
|
|
3231
|
-
RCT_REMAP_METHOD(getVideoCaptureBuilder,
|
|
3232
|
-
getVideoCaptureBuilder)
|
|
3233
|
-
{
|
|
3234
|
-
if (!_theta) {
|
|
3235
|
-
[NSException raise:ERROR_CODE_ERROR format:MESSAGE_NOT_INIT];
|
|
3236
|
-
return;
|
|
3237
|
-
}
|
|
3238
|
-
self.videoCaptureBuilder = [_theta getVideoCaptureBuilder];
|
|
3239
|
-
}
|
|
3240
|
-
|
|
3241
|
-
/**
|
|
3242
|
-
* buildVideoCapture - build video capture
|
|
3243
|
-
* @param options option to capture video
|
|
3244
|
-
* @param resolve resolver for buildVideoCapture
|
|
3245
|
-
* @param rejecter rejecter for buildVideoCapture
|
|
3246
|
-
*/
|
|
3247
|
-
RCT_REMAP_METHOD(buildVideoCapture,
|
|
3248
|
-
buildVideoCaptureWithOptions:(NSDictionary*)options
|
|
3249
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
3250
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3251
|
-
{
|
|
3252
|
-
if (!_theta) {
|
|
3253
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3254
|
-
return;
|
|
3255
|
-
}
|
|
3256
|
-
if (!self.videoCaptureBuilder) {
|
|
3257
|
-
reject(ERROR_CODE_ERROR, @"no video capture builder", nil);
|
|
3258
|
-
return;
|
|
3259
|
-
}
|
|
3260
|
-
for (id videoOption in [options allKeys]) {
|
|
3261
|
-
convert_t *convert = [NameToConverter objectForKey:videoOption]();
|
|
3262
|
-
if (convert && convert->setVideoOption) {
|
|
3263
|
-
convert->setVideoOption(options, self.videoCaptureBuilder);
|
|
3264
|
-
}
|
|
3265
|
-
}
|
|
3266
|
-
[self.videoCaptureBuilder
|
|
3267
|
-
buildWithCompletionHandler:^(THETACVideoCapture *videoCapture, NSError *error) {
|
|
3268
|
-
if (error) {
|
|
3269
|
-
reject(ERROR_CODE_ERROR, @"videoCapture build failed", error);
|
|
3270
|
-
return;
|
|
3271
|
-
}
|
|
3272
|
-
if (videoCapture) {
|
|
3273
|
-
self.videoCapture = videoCapture;
|
|
3274
|
-
self.videoCaptureBuilder = nil;
|
|
3275
|
-
resolve(@(YES));
|
|
3276
|
-
} else {
|
|
3277
|
-
reject(ERROR_CODE_ERROR, @"no videoCapture", nil);
|
|
3278
|
-
}
|
|
3279
|
-
}];
|
|
3280
|
-
}
|
|
3281
|
-
|
|
3282
|
-
/**
|
|
3283
|
-
* startCapture - start capture video
|
|
3284
|
-
* @param resolve resolver for startCapture
|
|
3285
|
-
* @param rejecter rejecter for startCapture
|
|
3286
|
-
*/
|
|
3287
|
-
RCT_REMAP_METHOD(startCapture,
|
|
3288
|
-
startCaptureWithResolver:(RCTPromiseResolveBlock)resolve
|
|
3289
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3290
|
-
{
|
|
3291
|
-
if (!_theta) {
|
|
3292
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3293
|
-
return;
|
|
3294
|
-
}
|
|
3295
|
-
if (!self.videoCapture) {
|
|
3296
|
-
reject(ERROR_CODE_ERROR, @"no videoCapture", nil);
|
|
3297
|
-
return;
|
|
3298
|
-
}
|
|
3299
|
-
VideoCallback *callback = [[VideoCallback alloc] initWith:self
|
|
3300
|
-
withResolver:resolve
|
|
3301
|
-
withRejecter:reject];
|
|
3302
|
-
self.videoCapturing = [self.videoCapture startCaptureCallback:callback];
|
|
3303
|
-
}
|
|
3304
|
-
|
|
3305
|
-
/**
|
|
3306
|
-
* stopCapture - stop capturing video
|
|
3307
|
-
*/
|
|
3308
|
-
RCT_REMAP_METHOD(stopCapture,
|
|
3309
|
-
stopCapture)
|
|
3310
|
-
{
|
|
3311
|
-
if (!_theta) {
|
|
3312
|
-
[NSException raise:ERROR_CODE_ERROR format:MESSAGE_NOT_INIT];
|
|
3313
|
-
return;
|
|
3314
|
-
}
|
|
3315
|
-
if (!self.videoCapturing) {
|
|
3316
|
-
// todo warning
|
|
3317
|
-
return;
|
|
3318
|
-
}
|
|
3319
|
-
[self.videoCapturing stopCapture];
|
|
3320
|
-
}
|
|
3321
|
-
|
|
3322
|
-
/**
|
|
3323
|
-
* getMetadata - retrieve meta data from THETA via repository
|
|
3324
|
-
* @param resolve resolver for getMetadata
|
|
3325
|
-
* @param rejecter rejecter for getMetadata
|
|
3326
|
-
*/
|
|
3327
|
-
RCT_REMAP_METHOD(getMetadata,
|
|
3328
|
-
getMetadataWithFileUrl:(NSString*)fileUrl
|
|
3329
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
3330
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3331
|
-
{
|
|
3332
|
-
if (!_theta) {
|
|
3333
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3334
|
-
return;
|
|
3335
|
-
}
|
|
3336
|
-
[_theta getMetadataFileUrl:fileUrl
|
|
3337
|
-
completionHandler:^(THETACKotlinPair<THETACThetaRepositoryExif *,
|
|
3338
|
-
THETACThetaRepositoryXmp *> *metaData,
|
|
3339
|
-
NSError *error) {
|
|
3340
|
-
if (error) {
|
|
3341
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3342
|
-
} else if (metaData) {
|
|
3343
|
-
NSDictionary* exif = nil;
|
|
3344
|
-
NSDictionary* xmp = nil;
|
|
3345
|
-
if (metaData.first) {
|
|
3346
|
-
exif = @{
|
|
3347
|
-
@"exifVersion": metaData.first.exifVersion,
|
|
3348
|
-
@"dateTime": metaData.first.dateTime,
|
|
3349
|
-
@"imageWidth": metaData.first.imageWidth,
|
|
3350
|
-
@"imageLength": metaData.first.imageLength,
|
|
3351
|
-
@"gpsLatitude": metaData.first.gpsLatitude,
|
|
3352
|
-
@"gpsLongitude": metaData.first.gpsLongitude
|
|
3353
|
-
};
|
|
3354
|
-
}
|
|
3355
|
-
if (metaData.second) {
|
|
3356
|
-
xmp = @{
|
|
3357
|
-
@"poseHeadingDegrees": metaData.second.poseHeadingDegrees,
|
|
3358
|
-
@"fullPanoWidthPixels": @(metaData.second.fullPanoWidthPixels),
|
|
3359
|
-
@"fullPanoHeightPixels": @(metaData.second.fullPanoHeightPixels)
|
|
3360
|
-
};
|
|
3361
|
-
}
|
|
3362
|
-
resolve(@{@"exif": exif, @"xmp": xmp});
|
|
3363
|
-
} else {
|
|
3364
|
-
reject(ERROR_CODE_ERROR, @"no metaData", nil);
|
|
3365
|
-
}
|
|
3366
|
-
}];
|
|
3367
|
-
}
|
|
3368
|
-
|
|
3369
|
-
/**
|
|
3370
|
-
* reset - reset THETA via repository
|
|
3371
|
-
* @param resolve resolver for reset
|
|
3372
|
-
* @param rejecter rejecter for reset
|
|
3373
|
-
*/
|
|
3374
|
-
RCT_REMAP_METHOD(reset,
|
|
3375
|
-
resetWithResolver:(RCTPromiseResolveBlock)resolve
|
|
3376
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3377
|
-
{
|
|
3378
|
-
if (!_theta) {
|
|
3379
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3380
|
-
return;
|
|
3381
|
-
}
|
|
3382
|
-
[_theta resetWithCompletionHandler:^(NSError *error) {
|
|
3383
|
-
if (error) {
|
|
3384
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3385
|
-
} else {
|
|
3386
|
-
resolve(@(YES));
|
|
3387
|
-
}
|
|
3388
|
-
}];
|
|
3389
|
-
}
|
|
3390
|
-
|
|
3391
|
-
/**
|
|
3392
|
-
* restoreSettings - restore THETA setting before initialization
|
|
3393
|
-
* @param resolve resolver for restoreSettings
|
|
3394
|
-
* @param rejecter rejecter for restoreSettings
|
|
3395
|
-
*/
|
|
3396
|
-
RCT_REMAP_METHOD(restoreSettings,
|
|
3397
|
-
restoreSettingsWithResolver:(RCTPromiseResolveBlock)resolve
|
|
3398
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3399
|
-
{
|
|
3400
|
-
if (!_theta) {
|
|
3401
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3402
|
-
return;
|
|
3403
|
-
}
|
|
3404
|
-
[_theta restoreSettingsWithCompletionHandler:^(NSError *error) {
|
|
3405
|
-
if (error) {
|
|
3406
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3407
|
-
} else {
|
|
3408
|
-
resolve(@(YES));
|
|
3409
|
-
}
|
|
3410
|
-
}];
|
|
3411
|
-
}
|
|
3412
|
-
|
|
3413
|
-
/**
|
|
3414
|
-
* stopSelfTimer - stop self timer of THETA
|
|
3415
|
-
* @param resolve resolver for stopSelfTimer
|
|
3416
|
-
* @param rejecter rejecter for stopSelfTimer
|
|
3417
|
-
*/
|
|
3418
|
-
RCT_REMAP_METHOD(stopSelfTimer,
|
|
3419
|
-
stopSelfTimerWithResolver:(RCTPromiseResolveBlock)resolve
|
|
3420
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3421
|
-
{
|
|
3422
|
-
if (!_theta) {
|
|
3423
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3424
|
-
return;
|
|
3425
|
-
}
|
|
3426
|
-
[_theta stopSelfTimerWithCompletionHandler:^(NSError *error) {
|
|
3427
|
-
if (error) {
|
|
3428
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3429
|
-
} else {
|
|
3430
|
-
resolve(@(YES));
|
|
3431
|
-
}
|
|
3432
|
-
}];
|
|
3433
|
-
}
|
|
3434
|
-
|
|
3435
|
-
/**
|
|
3436
|
-
* convertVideoFormats - convert video format in THETA
|
|
3437
|
-
* @param fileUrl file url to convert
|
|
3438
|
-
* @param toLowResolution to lower resolution
|
|
3439
|
-
* @param applyTopBottomCorrection apply top bottom correction
|
|
3440
|
-
* @param resolve resolver for convertVideoFormats
|
|
3441
|
-
* @param rejecter rejecter for convertVideoFormats
|
|
3442
|
-
*/
|
|
3443
|
-
RCT_REMAP_METHOD(convertVideoFormats,
|
|
3444
|
-
convertVideoFormatsWithFileUrl:(NSString *)fileUrl
|
|
3445
|
-
withToLowResolution:(BOOL)toLowResolution
|
|
3446
|
-
withApplyTopBottomCorrection:(BOOL)applyTopBottomCorrection
|
|
3447
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
3448
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3449
|
-
{
|
|
3450
|
-
if (!_theta) {
|
|
3451
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3452
|
-
return;
|
|
3453
|
-
}
|
|
3454
|
-
[_theta convertVideoFormatsFileUrl:fileUrl
|
|
3455
|
-
toLowResolution:toLowResolution
|
|
3456
|
-
applyTopBottomCorrection:applyTopBottomCorrection
|
|
3457
|
-
completionHandler:^(NSString *convertedUrl, NSError *error) {
|
|
3458
|
-
if (error) {
|
|
3459
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3460
|
-
} else if (convertedUrl) {
|
|
3461
|
-
resolve(convertedUrl);
|
|
3462
|
-
} else {
|
|
3463
|
-
reject(ERROR_CODE_ERROR, @"no convertVideo", nil);
|
|
3464
|
-
}
|
|
3465
|
-
}];
|
|
3466
|
-
}
|
|
3467
|
-
|
|
3468
|
-
/**
|
|
3469
|
-
* cancelVideoconvert - cancel converting video format in THETA
|
|
3470
|
-
* @param resolve resolver for cancelVideoconvert
|
|
3471
|
-
* @param rejecter rejecter for cancelVideoconvert
|
|
3472
|
-
*/
|
|
3473
|
-
RCT_REMAP_METHOD(cancelVideoConvert,
|
|
3474
|
-
cancelVideoConvertWithResolver:(RCTPromiseResolveBlock)resolve
|
|
3475
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3476
|
-
{
|
|
3477
|
-
if (!_theta) {
|
|
3478
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3479
|
-
return;
|
|
3480
|
-
}
|
|
3481
|
-
[_theta cancelVideoConvertWithCompletionHandler:^(NSError *error) {
|
|
3482
|
-
if (error) {
|
|
3483
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3484
|
-
} else {
|
|
3485
|
-
resolve(@(YES));
|
|
3486
|
-
}
|
|
3487
|
-
}];
|
|
3488
|
-
}
|
|
3489
|
-
|
|
3490
|
-
/**
|
|
3491
|
-
* finishWlan - finish wireless lan
|
|
3492
|
-
* @param resolve resolver for finishWlan
|
|
3493
|
-
* @param rejecter rejecter for finishWlan
|
|
3494
|
-
*/
|
|
3495
|
-
RCT_REMAP_METHOD(finishWlan,
|
|
3496
|
-
finishWlanWithResolver:(RCTPromiseResolveBlock)resolve
|
|
3497
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3498
|
-
{
|
|
3499
|
-
if (!_theta) {
|
|
3500
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3501
|
-
return;
|
|
3502
|
-
}
|
|
3503
|
-
[_theta finishWlanWithCompletionHandler:^(NSError *error) {
|
|
3504
|
-
if (error) {
|
|
3505
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3506
|
-
} else {
|
|
3507
|
-
resolve(@(YES));
|
|
3508
|
-
}
|
|
3509
|
-
}];
|
|
3510
|
-
}
|
|
3511
|
-
|
|
3512
|
-
/**
|
|
3513
|
-
* listAccessPoints - list access points
|
|
3514
|
-
* @param resolve resolver for listAccessPoints
|
|
3515
|
-
* @param rejecter rejecter for listAccessPoints
|
|
3516
|
-
*/
|
|
3517
|
-
RCT_REMAP_METHOD(listAccessPoints,
|
|
3518
|
-
listAccessPointsWithResolver:(RCTPromiseResolveBlock)resolve
|
|
3519
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3520
|
-
{
|
|
3521
|
-
if (!_theta) {
|
|
3522
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3523
|
-
return;
|
|
3524
|
-
}
|
|
3525
|
-
[_theta listAccessPointsWithCompletionHandler:^(NSArray *accessPointList, NSError *error) {
|
|
3526
|
-
if (error) {
|
|
3527
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3528
|
-
} else if (accessPointList) {
|
|
3529
|
-
NSMutableArray *ary = [[NSMutableArray alloc] init];
|
|
3530
|
-
for (int i = 0; i < accessPointList.count; i++) {
|
|
3531
|
-
THETACThetaRepositoryAccessPoint *apinfo = accessPointList[i];
|
|
3532
|
-
|
|
3533
|
-
NSMutableDictionary *optionsDic = [[NSMutableDictionary alloc] init];
|
|
3534
|
-
convert_t *convert = &ProxyCvt;
|
|
3535
|
-
if (convert->setFromTheta) {
|
|
3536
|
-
THETACThetaRepositoryOptions *options = [[THETACThetaRepositoryOptions alloc] init];
|
|
3537
|
-
[options setProxy:apinfo.proxy];
|
|
3538
|
-
convert->setFromTheta(optionsDic, options);
|
|
3539
|
-
}
|
|
3540
|
-
|
|
3541
|
-
NSMutableDictionary *item = [[NSMutableDictionary alloc] init];
|
|
3542
|
-
[item setObject:apinfo.ssid forKey:@"ssid"];
|
|
3543
|
-
[item setObject:@(apinfo.ssidStealth) forKey:@"ssidStealth"];
|
|
3544
|
-
[item setObject:[AuthModeEnum.fromTheta objectForKey:apinfo.authMode]forKey:@"authMode"];
|
|
3545
|
-
[item setObject:@(apinfo.connectionPriority) forKey:@"connectionPriority"];
|
|
3546
|
-
[item setObject:@(apinfo.usingDhcp) forKey:@"usingDhcp"];
|
|
3547
|
-
if (apinfo.ipAddress) {
|
|
3548
|
-
[item setObject:apinfo.ipAddress forKey:@"ipAddress"];
|
|
3549
|
-
}
|
|
3550
|
-
if (apinfo.subnetMask) {
|
|
3551
|
-
[item setObject:apinfo.subnetMask forKey:@"subnetMask"];
|
|
3552
|
-
}
|
|
3553
|
-
if (apinfo.defaultGateway) {
|
|
3554
|
-
[item setObject:apinfo.defaultGateway forKey:@"defaultGateway"];
|
|
3555
|
-
}
|
|
3556
|
-
if ([optionsDic objectForKey:@"proxy"]) {
|
|
3557
|
-
[item setObject:[optionsDic objectForKey:@"proxy"] forKey:@"proxy"];
|
|
3558
|
-
}
|
|
3559
|
-
[ary addObject:item];
|
|
3560
|
-
}
|
|
3561
|
-
resolve(ary);
|
|
3562
|
-
} else {
|
|
3563
|
-
reject(ERROR_CODE_ERROR, @"no access point", nil);
|
|
3564
|
-
}
|
|
3565
|
-
}];
|
|
3566
|
-
}
|
|
3567
|
-
|
|
3568
|
-
/**
|
|
3569
|
-
* setAccessPointDynamically - set access point with dhcp
|
|
3570
|
-
* @param ssid ssid to connect
|
|
3571
|
-
* @param ssidStealth ssid is stealth or not
|
|
3572
|
-
* @param authMode auth mode to connect
|
|
3573
|
-
* @param password password to connect with auth
|
|
3574
|
-
* @param connectionPriority connection priority
|
|
3575
|
-
* @param proxy Proxy information to be used for the access point.
|
|
3576
|
-
* @param resolve resolver for setAccessPointDynamically
|
|
3577
|
-
* @param rejecter rejecter for setAccessPointDynamically
|
|
3578
|
-
*/
|
|
3579
|
-
RCT_REMAP_METHOD(setAccessPointDynamically,
|
|
3580
|
-
setAccessPointDynamicallyWithSsid:(NSString *)ssid
|
|
3581
|
-
withSsidStealth:(BOOL)ssidStealth
|
|
3582
|
-
withAuthMode:(NSString *)authMode
|
|
3583
|
-
withPassword:(NSString *)password
|
|
3584
|
-
withConnectionPrioryty:(int32_t)connectionPriority
|
|
3585
|
-
withProxy:(NSDictionary *)proxy
|
|
3586
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
3587
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3588
|
-
{
|
|
3589
|
-
if (!_theta) {
|
|
3590
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3591
|
-
return;
|
|
3592
|
-
}
|
|
3593
|
-
[_theta setAccessPointDynamicallySsid:ssid
|
|
3594
|
-
ssidStealth:ssidStealth
|
|
3595
|
-
authMode:[AuthModeEnum.toTheta objectForKey:authMode]
|
|
3596
|
-
password:password
|
|
3597
|
-
connectionPriority:connectionPriority
|
|
3598
|
-
proxy:convertDictionaryToProxy(proxy)
|
|
3599
|
-
completionHandler:^(NSError *error) {
|
|
3600
|
-
if (error) {
|
|
3601
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3602
|
-
} else {
|
|
3603
|
-
resolve(@(YES));
|
|
3604
|
-
}
|
|
3605
|
-
}];
|
|
3606
|
-
}
|
|
3607
|
-
|
|
3608
|
-
/**
|
|
3609
|
-
* setAccessPointStatically - set access point with static connection info
|
|
3610
|
-
* @param ssid ssid to connect
|
|
3611
|
-
* @param ssidStealth ssid is stealth or not
|
|
3612
|
-
* @param authMode auth mode to connect
|
|
3613
|
-
* @param password password to connect with auth
|
|
3614
|
-
* @param connectionPriority connection priority
|
|
3615
|
-
* @param ipAddress static ipaddress to connect
|
|
3616
|
-
* @param subnetMask subnet mask for ip address
|
|
3617
|
-
* @param defaultGateway default gateway address
|
|
3618
|
-
* @param proxy Proxy information to be used for the access point.
|
|
3619
|
-
* @param resolve resolver for setAccessPointStatically
|
|
3620
|
-
* @param rejecter rejecter for setAccessPointStatically
|
|
3621
|
-
*/
|
|
3622
|
-
RCT_REMAP_METHOD(setAccessPointStatically,
|
|
3623
|
-
setAccessPointStaticallyWithSsid:(NSString *)ssid
|
|
3624
|
-
withSsidStealth:(BOOL)ssidStealth
|
|
3625
|
-
withAuthMode:(NSString *)authMode
|
|
3626
|
-
withPassword:(NSString *)password
|
|
3627
|
-
withConnectionPrioryty:(int32_t)connectionPriority
|
|
3628
|
-
withIpAddress:(NSString *)ipAddress
|
|
3629
|
-
withSubnetMask:(NSString *)subnetMask
|
|
3630
|
-
withDefaultGateway:(NSString *)defaultGateway
|
|
3631
|
-
withProxy:(NSDictionary *)proxy
|
|
3632
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
3633
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3634
|
-
{
|
|
3635
|
-
if (!_theta) {
|
|
3636
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3637
|
-
return;
|
|
3638
|
-
}
|
|
3639
|
-
[_theta setAccessPointStaticallySsid:ssid
|
|
3640
|
-
ssidStealth:ssidStealth
|
|
3641
|
-
authMode:[AuthModeEnum.toTheta objectForKey:authMode]
|
|
3642
|
-
password:password
|
|
3643
|
-
connectionPriority:connectionPriority
|
|
3644
|
-
ipAddress:ipAddress
|
|
3645
|
-
subnetMask:subnetMask
|
|
3646
|
-
defaultGateway:defaultGateway
|
|
3647
|
-
proxy:convertDictionaryToProxy(proxy)
|
|
3648
|
-
completionHandler:^(NSError *error) {
|
|
3649
|
-
if (error) {
|
|
3650
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3651
|
-
} else {
|
|
3652
|
-
resolve(@(YES));
|
|
3653
|
-
}
|
|
3654
|
-
}];
|
|
3655
|
-
}
|
|
3656
|
-
|
|
3657
|
-
/**
|
|
3658
|
-
* deleteAccessPoint - delete access point related ssid
|
|
3659
|
-
* @param ssid ssid to delete
|
|
3660
|
-
* @param resolve resolver for setAccessPointStaticcaly
|
|
3661
|
-
* @param rejecter rejecter for setAccessPointStaticcaly
|
|
3662
|
-
*/
|
|
3663
|
-
RCT_REMAP_METHOD(deleteAccessPoint,
|
|
3664
|
-
deleteAccessPointWithSsid:(NSString *)ssid
|
|
3665
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
3666
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3667
|
-
{
|
|
3668
|
-
if (!_theta) {
|
|
3669
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3670
|
-
return;
|
|
3671
|
-
}
|
|
3672
|
-
[_theta deleteAccessPointSsid:ssid
|
|
3673
|
-
completionHandler:^(NSError *error) {
|
|
3674
|
-
if (error) {
|
|
3675
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3676
|
-
} else {
|
|
3677
|
-
resolve(@(YES));
|
|
3678
|
-
}
|
|
3679
|
-
}];
|
|
3680
|
-
}
|
|
3681
|
-
|
|
3682
|
-
/// convert NSDictionary to THETACThetaRepositoryProxy
|
|
3683
|
-
/// @param proxyDic NSDictionary of proxy
|
|
3684
|
-
static THETACThetaRepositoryProxy* convertDictionaryToProxy(NSDictionary *proxyDic) {
|
|
3685
|
-
THETACThetaRepositoryOptions *options = [[THETACThetaRepositoryOptions alloc] init];
|
|
3686
|
-
convert_t *convert = &ProxyCvt;
|
|
3687
|
-
if (convert->setToTheta) {
|
|
3688
|
-
NSMutableDictionary *optionsDic = [[NSMutableDictionary alloc] init];
|
|
3689
|
-
[optionsDic setObject:proxyDic forKey:@"proxy"];
|
|
3690
|
-
convert->setToTheta(optionsDic, options);
|
|
3691
|
-
}
|
|
3692
|
-
return options.proxy;
|
|
3693
|
-
}
|
|
3694
|
-
|
|
3695
|
-
/**
|
|
3696
|
-
* convertOptionsFromTheta - convert resposnse of getMySetting
|
|
3697
|
-
* @param results conversion results
|
|
3698
|
-
* @param options response of getMySetting
|
|
3699
|
-
* @return error during conversion
|
|
3700
|
-
*/
|
|
3701
|
-
static NSError* convertOptionsFromTheta(NSMutableDictionary* results, THETACThetaRepositoryOptions* options)
|
|
3702
|
-
{
|
|
3703
|
-
THETACKotlinArray<THETACThetaRepositoryOptionNameEnum *>* optionNames = THETACThetaRepositoryOptionNameEnum.values;
|
|
3704
|
-
for (int i = 0; i < optionNames.size; i++) {
|
|
3705
|
-
THETACThetaRepositoryOptionNameEnum* optionName = [optionNames getIndex:i];
|
|
3706
|
-
NSError* error = nil;
|
|
3707
|
-
id value = [options getValueName:optionName error:&error];
|
|
3708
|
-
if (error) {
|
|
3709
|
-
return error;
|
|
3710
|
-
}
|
|
3711
|
-
if (value != nil) {
|
|
3712
|
-
NSString* name = [OptionEnumToOption objectForKey:optionName.name];
|
|
3713
|
-
convert_t *convert = [NameToConverter objectForKey:name]();
|
|
3714
|
-
if (convert && convert->setFromTheta) {
|
|
3715
|
-
convert->setFromTheta(results, options);
|
|
3716
|
-
}
|
|
3717
|
-
}
|
|
3718
|
-
}
|
|
3719
|
-
return nil;
|
|
3720
|
-
}
|
|
3721
|
-
|
|
3722
|
-
/**
|
|
3723
|
-
* getMySetting - acquires the shooting properties ( just for Theta V and later )
|
|
3724
|
-
* @param captureMode the target shooting mode
|
|
3725
|
-
* @param resolve resolver for getMySetting
|
|
3726
|
-
* @param rejecter rejecter for getMySetting
|
|
3727
|
-
*/
|
|
3728
|
-
RCT_REMAP_METHOD(getMySetting,
|
|
3729
|
-
getMySettingWithCaptureMode:(NSString *)captureMode
|
|
3730
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
3731
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3732
|
-
{
|
|
3733
|
-
if (!_theta) {
|
|
3734
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3735
|
-
return;
|
|
3736
|
-
}
|
|
3737
|
-
[_theta getMySettingCaptureMode:[CaptureModeEnum.toTheta objectForKey:captureMode]
|
|
3738
|
-
completionHandler:^(THETACThetaRepositoryOptions *options, NSError *error) {
|
|
3739
|
-
if (error) {
|
|
3740
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3741
|
-
} else if (options) {
|
|
3742
|
-
NSMutableDictionary *results = [[NSMutableDictionary alloc] init];
|
|
3743
|
-
NSError *convertError = convertOptionsFromTheta(results, options);
|
|
3744
|
-
if (convertError) {
|
|
3745
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], convertError);
|
|
3746
|
-
}
|
|
3747
|
-
resolve(results);
|
|
3748
|
-
} else {
|
|
3749
|
-
reject(ERROR_CODE_ERROR, @"no options", nil);
|
|
3750
|
-
}
|
|
3751
|
-
}];
|
|
3752
|
-
}
|
|
3753
|
-
|
|
3754
|
-
/**
|
|
3755
|
-
* getMySetting - acquires the shooting properties ( just for Theta S and SC )
|
|
3756
|
-
* @param optionNames list of option names to acquire
|
|
3757
|
-
* @param resolve resolver for getMySetting
|
|
3758
|
-
* @param rejecter rejecter for getMySetting
|
|
3759
|
-
*/
|
|
3760
|
-
RCT_REMAP_METHOD(getMySettingFromOldModel,
|
|
3761
|
-
getMySettingWithOptionNames:(NSArray*)optionNames
|
|
3762
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
3763
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3764
|
-
{
|
|
3765
|
-
if (!_theta) {
|
|
3766
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3767
|
-
return;
|
|
3768
|
-
}
|
|
3769
|
-
NSMutableArray *optionNameList = [[NSMutableArray alloc] init];
|
|
3770
|
-
for (id name in optionNames) {
|
|
3771
|
-
[optionNameList addObject:[NameToOptionEnum objectForKey:name]];
|
|
3772
|
-
}
|
|
3773
|
-
[_theta getMySettingOptionNames:optionNameList
|
|
3774
|
-
completionHandler:^(THETACThetaRepositoryOptions *options, NSError *error) {
|
|
3775
|
-
if (error) {
|
|
3776
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3777
|
-
} else if (options) {
|
|
3778
|
-
NSMutableDictionary *results = [[NSMutableDictionary alloc] init];
|
|
3779
|
-
for (id name in optionNames) {
|
|
3780
|
-
id option = [OptionEnumToOption objectForKey:name];
|
|
3781
|
-
OptionConverter converter = [NameToConverter objectForKey:option];
|
|
3782
|
-
if (converter) {
|
|
3783
|
-
convert_t *convert = converter();
|
|
3784
|
-
if (convert && convert->setFromTheta) {
|
|
3785
|
-
convert->setFromTheta(results, options);
|
|
3786
|
-
}
|
|
3787
|
-
}
|
|
3788
|
-
}
|
|
3789
|
-
resolve(results);
|
|
3790
|
-
} else {
|
|
3791
|
-
reject(ERROR_CODE_ERROR, @"no options", nil);
|
|
3792
|
-
}
|
|
3793
|
-
}];
|
|
3794
|
-
}
|
|
3795
|
-
|
|
3796
|
-
/**
|
|
3797
|
-
* setMySetting - registers shooting conditions in My Settings
|
|
3798
|
-
* @param captureMode the target shooting mode. RICOH THETA S and SC do not support My Settings in video capture mode
|
|
3799
|
-
* @param options registered to My Settings
|
|
3800
|
-
* @param resolve resolver for setMySetting
|
|
3801
|
-
* @param rejecter rejecter for setMySetting
|
|
3802
|
-
*/
|
|
3803
|
-
RCT_REMAP_METHOD(setMySetting,
|
|
3804
|
-
setMySettingWithCaptureMode:(NSString *)captureMode
|
|
3805
|
-
setMySettingWithOptions:(NSDictionary*)options
|
|
3806
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
3807
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3808
|
-
{
|
|
3809
|
-
if (!_theta) {
|
|
3810
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3811
|
-
return;
|
|
3812
|
-
}
|
|
3813
|
-
THETACThetaRepositoryOptions *newoptions = [[THETACThetaRepositoryOptions alloc] init];
|
|
3814
|
-
for (id option in [options allKeys]) {
|
|
3815
|
-
OptionConverter converter = [NameToConverter objectForKey:option];
|
|
3816
|
-
if (converter) {
|
|
3817
|
-
convert_t *convert = converter();
|
|
3818
|
-
if (convert && convert->setToTheta) {
|
|
3819
|
-
convert->setToTheta(options, newoptions);
|
|
3820
|
-
}
|
|
3821
|
-
}
|
|
3822
|
-
}
|
|
3823
|
-
[_theta setMySettingCaptureMode:[CaptureModeEnum.toTheta objectForKey:captureMode]
|
|
3824
|
-
options:newoptions
|
|
3825
|
-
completionHandler:^(NSError *error) {
|
|
3826
|
-
if (error) {
|
|
3827
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3828
|
-
} else {
|
|
3829
|
-
resolve(@(YES));
|
|
3830
|
-
}
|
|
3831
|
-
}];
|
|
3832
|
-
}
|
|
3833
|
-
|
|
3834
|
-
/**
|
|
3835
|
-
* deleteMySetting - delete shooting conditions in My Settings
|
|
3836
|
-
* @param captureMode the target shooting mode
|
|
3837
|
-
* @param resolve resolver for deleteMySetting
|
|
3838
|
-
* @param rejecter rejecter for deleteMySetting
|
|
3839
|
-
*/
|
|
3840
|
-
RCT_REMAP_METHOD(deleteMySetting,
|
|
3841
|
-
deleteMySettingWithCaptureMode:(NSString *)captureMode
|
|
3842
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
3843
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3844
|
-
{
|
|
3845
|
-
if (!_theta) {
|
|
3846
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3847
|
-
return;
|
|
3848
|
-
}
|
|
3849
|
-
[_theta deleteMySettingCaptureMode:[CaptureModeEnum.toTheta objectForKey:captureMode]
|
|
3850
|
-
completionHandler:^(NSError *error) {
|
|
3851
|
-
if (error) {
|
|
3852
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3853
|
-
} else {
|
|
3854
|
-
resolve(@(YES));
|
|
3855
|
-
}
|
|
3856
|
-
}];
|
|
3857
|
-
}
|
|
3858
|
-
|
|
3859
|
-
/**
|
|
3860
|
-
* listPlugins - acquires a list of installed plugins
|
|
3861
|
-
* @param resolve resolver for listPlugins
|
|
3862
|
-
* @param rejecter rejecter for listPlugins
|
|
3863
|
-
*/
|
|
3864
|
-
RCT_REMAP_METHOD(listPlugins,
|
|
3865
|
-
listPluginsWithResolver:(RCTPromiseResolveBlock)resolve
|
|
3866
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3867
|
-
{
|
|
3868
|
-
if (!_theta) {
|
|
3869
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3870
|
-
return;
|
|
3871
|
-
}
|
|
3872
|
-
[_theta listPluginsWithCompletionHandler:^(NSArray *pluginList, NSError *error) {
|
|
3873
|
-
if (error) {
|
|
3874
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3875
|
-
} else if (pluginList) {
|
|
3876
|
-
NSMutableArray *ary = [[NSMutableArray alloc] init];
|
|
3877
|
-
for (int i = 0; i < pluginList.count; i++) {
|
|
3878
|
-
THETACThetaRepositoryPluginInfo *plugininfo = pluginList[i];
|
|
3879
|
-
[ary addObject: @{
|
|
3880
|
-
@"name": plugininfo.name,
|
|
3881
|
-
@"packageName": plugininfo.packageName,
|
|
3882
|
-
@"version": plugininfo.version,
|
|
3883
|
-
@"isPreInstalled": @(plugininfo.isPreInstalled),
|
|
3884
|
-
@"isRunning": @(plugininfo.isRunning),
|
|
3885
|
-
@"isForeground": @(plugininfo.isForeground),
|
|
3886
|
-
@"isBoot": @(plugininfo.isBoot),
|
|
3887
|
-
@"hasWebServer": @(plugininfo.hasWebServer),
|
|
3888
|
-
@"exitStatus": plugininfo.exitStatus,
|
|
3889
|
-
@"message": plugininfo.message
|
|
3890
|
-
}];
|
|
3891
|
-
}
|
|
3892
|
-
resolve(ary);
|
|
3893
|
-
} else {
|
|
3894
|
-
reject(ERROR_CODE_ERROR, @"no plugin", nil);
|
|
3895
|
-
}
|
|
3896
|
-
}];
|
|
3897
|
-
}
|
|
3898
|
-
|
|
3899
|
-
/**
|
|
3900
|
-
* setPlugin - sets the installed plugin for boot
|
|
3901
|
-
* @param packageName package name of the target plugin
|
|
3902
|
-
* @param resolve resolver for setPlugin
|
|
3903
|
-
* @param rejecter rejecter for setPlugin
|
|
3904
|
-
*/
|
|
3905
|
-
RCT_REMAP_METHOD(setPlugin,
|
|
3906
|
-
setPluginPackageName:(NSString *)packageName
|
|
3907
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
3908
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3909
|
-
{
|
|
3910
|
-
if (!_theta) {
|
|
3911
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3912
|
-
return;
|
|
3913
|
-
}
|
|
3914
|
-
[_theta setPluginPackageName:packageName
|
|
3915
|
-
completionHandler:^(NSError *error) {
|
|
3916
|
-
if (error) {
|
|
3917
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3918
|
-
} else {
|
|
3919
|
-
resolve(@(YES));
|
|
3920
|
-
}
|
|
3921
|
-
}];
|
|
3922
|
-
}
|
|
3923
|
-
|
|
3924
|
-
/**
|
|
3925
|
-
* startPlugin - start the plugin specified by the packageName
|
|
3926
|
-
* @param packageName package name of the target plugin
|
|
3927
|
-
* @param resolve resolver for startPlugin
|
|
3928
|
-
* @param rejecter rejecter for startPlugin
|
|
3929
|
-
*/
|
|
3930
|
-
RCT_REMAP_METHOD(startPlugin,
|
|
3931
|
-
startPluginPackageName:(NSString *)packageName
|
|
3932
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
3933
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3934
|
-
{
|
|
3935
|
-
if (!_theta) {
|
|
3936
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3937
|
-
return;
|
|
3938
|
-
}
|
|
3939
|
-
[_theta startPluginPackageName:packageName
|
|
3940
|
-
completionHandler:^(NSError *error) {
|
|
3941
|
-
if (error) {
|
|
3942
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3943
|
-
|
|
3944
|
-
} else {
|
|
3945
|
-
resolve(@(YES));
|
|
3946
|
-
}
|
|
3947
|
-
}];
|
|
3948
|
-
}
|
|
3949
|
-
|
|
3950
|
-
/**
|
|
3951
|
-
* stopPlugin - stop the running plugin
|
|
3952
|
-
* @param resolve resolver for stopPlugin
|
|
3953
|
-
* @param rejecter rejecter for stopPlugin
|
|
3954
|
-
*/
|
|
3955
|
-
RCT_REMAP_METHOD(stopPlugin,
|
|
3956
|
-
stopPluginWithResolver:(RCTPromiseResolveBlock)resolve
|
|
3957
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3958
|
-
{
|
|
3959
|
-
if (!_theta) {
|
|
3960
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3961
|
-
return;
|
|
3962
|
-
}
|
|
3963
|
-
[_theta stopPluginWithCompletionHandler:^(NSError *error) {
|
|
3964
|
-
if (error) {
|
|
3965
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3966
|
-
|
|
3967
|
-
} else {
|
|
3968
|
-
resolve(@(YES));
|
|
3969
|
-
}
|
|
3970
|
-
}];
|
|
3971
|
-
}
|
|
3972
|
-
|
|
3973
|
-
/**
|
|
3974
|
-
* getPluginLicense - acquires the license for the installed plugin
|
|
3975
|
-
* @param packageName package name of the target plugin
|
|
3976
|
-
* @param resolve resolver for getPluginLicense
|
|
3977
|
-
* @param rejecter rejecter for getPluginLicense
|
|
3978
|
-
*/
|
|
3979
|
-
RCT_REMAP_METHOD(getPluginLicense,
|
|
3980
|
-
getPluginLicensePackageName:(NSString *)packageName
|
|
3981
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
3982
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
3983
|
-
{
|
|
3984
|
-
if (!_theta) {
|
|
3985
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
3986
|
-
return;
|
|
3987
|
-
}
|
|
3988
|
-
[_theta getPluginLicensePackageName:packageName
|
|
3989
|
-
completionHandler:^(NSString *pluginLicense, NSError *error) {
|
|
3990
|
-
if (error) {
|
|
3991
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
3992
|
-
|
|
3993
|
-
} else if (pluginLicense) {
|
|
3994
|
-
resolve(pluginLicense);
|
|
3995
|
-
} else {
|
|
3996
|
-
reject(ERROR_CODE_ERROR, @"no plugin lincense", nil);
|
|
3997
|
-
}
|
|
3998
|
-
}];
|
|
3999
|
-
}
|
|
4000
|
-
|
|
4001
|
-
/**
|
|
4002
|
-
* getPluginOrders - return the plugin orders
|
|
4003
|
-
* @param resolve resolver for getPluginOrders
|
|
4004
|
-
* @param rejecter rejecter for getPluginOrders
|
|
4005
|
-
*/
|
|
4006
|
-
RCT_REMAP_METHOD(getPluginOrders,
|
|
4007
|
-
getPluginOrdersWithResolver:(RCTPromiseResolveBlock)resolve
|
|
4008
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
4009
|
-
{
|
|
4010
|
-
if (!_theta) {
|
|
4011
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
4012
|
-
return;
|
|
4013
|
-
}
|
|
4014
|
-
[_theta getPluginOrdersWithCompletionHandler:^(NSArray *pluginOrders, NSError *error) {
|
|
4015
|
-
if (error) {
|
|
4016
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
4017
|
-
} else if (pluginOrders) {
|
|
4018
|
-
resolve(pluginOrders);
|
|
4019
|
-
} else {
|
|
4020
|
-
reject(ERROR_CODE_ERROR, @"no plugin orders", nil);
|
|
4021
|
-
}
|
|
4022
|
-
}];
|
|
4023
|
-
}
|
|
4024
|
-
|
|
4025
|
-
/**
|
|
4026
|
-
* setPluginOrders - sets the plugin orders
|
|
4027
|
-
* @param list of package names of plugins
|
|
4028
|
-
* @param resolve resolver for setPluginOrders
|
|
4029
|
-
* @param rejecter rejecter for setPluginOrders
|
|
4030
|
-
*/
|
|
4031
|
-
RCT_REMAP_METHOD(setPluginOrders,
|
|
4032
|
-
setPluginOrdersPlugins:(NSArray *) plugins
|
|
4033
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
4034
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
4035
|
-
{
|
|
4036
|
-
if (!_theta) {
|
|
4037
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
4038
|
-
return;
|
|
4039
|
-
}
|
|
4040
|
-
[_theta setPluginOrdersPlugins:plugins
|
|
4041
|
-
completionHandler:^(NSError *error) {
|
|
4042
|
-
if (error) {
|
|
4043
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
4044
|
-
} else {
|
|
4045
|
-
resolve(@(YES));
|
|
4046
|
-
}
|
|
4047
|
-
}];
|
|
4048
|
-
}
|
|
4049
|
-
|
|
4050
|
-
/**
|
|
4051
|
-
* setBluetoothDevice - register uuid of a BLE device
|
|
4052
|
-
* @param uuid uuid to set
|
|
4053
|
-
* @param resolve resolver for setAccessPointStaticcaly
|
|
4054
|
-
* @param rejecter rejecter for setAccessPointStaticcaly
|
|
4055
|
-
*/
|
|
4056
|
-
RCT_REMAP_METHOD(setBluetoothDevice,
|
|
4057
|
-
setBluetoothDeviceWithUuid:(NSString *)uuid
|
|
4058
|
-
withResolver:(RCTPromiseResolveBlock)resolve
|
|
4059
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
4060
|
-
{
|
|
4061
|
-
if (!_theta) {
|
|
4062
|
-
reject(ERROR_CODE_ERROR, MESSAGE_NOT_INIT, nil);
|
|
4063
|
-
return;
|
|
4064
|
-
}
|
|
4065
|
-
[_theta setBluetoothDeviceUuid:uuid
|
|
4066
|
-
completionHandler:^(NSString *deviceName, NSError *error) {
|
|
4067
|
-
if (error) {
|
|
4068
|
-
reject(ERROR_CODE_ERROR, [error localizedDescription], error);
|
|
4069
|
-
} else {
|
|
4070
|
-
resolve(deviceName);
|
|
4071
|
-
}
|
|
4072
|
-
}];
|
|
4073
|
-
}
|
|
4074
|
-
|
|
4075
|
-
// Don't compile this code when we build for the old architecture.
|
|
4076
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
4077
|
-
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
4078
|
-
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
4079
|
-
{
|
|
4080
|
-
return std::make_shared<facebook::react::NativeThetaClientReactNativeSpecJSI>(params);
|
|
4081
|
-
}
|
|
4082
|
-
#endif
|
|
4083
|
-
|
|
4084
|
-
@end
|