theta-client-react-native 1.9.1 → 1.10.1
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 +27 -0
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +73 -0
- package/ios/ConvertUtil.swift +22 -0
- package/ios/ThetaClientReactNative.swift +112 -9
- package/lib/commonjs/capture/burst-capture.js +13 -1
- package/lib/commonjs/capture/burst-capture.js.map +1 -1
- package/lib/commonjs/capture/capture.js +12 -1
- package/lib/commonjs/capture/capture.js.map +1 -1
- package/lib/commonjs/capture/composite-interval-capture.js +13 -1
- package/lib/commonjs/capture/composite-interval-capture.js.map +1 -1
- package/lib/commonjs/capture/continuous-capture.js +12 -1
- package/lib/commonjs/capture/continuous-capture.js.map +1 -1
- package/lib/commonjs/capture/limitless-interval-capture.js +29 -2
- package/lib/commonjs/capture/limitless-interval-capture.js.map +1 -1
- package/lib/commonjs/capture/multi-bracket-capture.js +13 -1
- package/lib/commonjs/capture/multi-bracket-capture.js.map +1 -1
- package/lib/commonjs/capture/photo-capture.js +38 -4
- package/lib/commonjs/capture/photo-capture.js.map +1 -1
- package/lib/commonjs/capture/shot-count-specified-interval-capture.js +12 -1
- package/lib/commonjs/capture/shot-count-specified-interval-capture.js.map +1 -1
- package/lib/commonjs/capture/time-shift-capture.js +12 -1
- package/lib/commonjs/capture/time-shift-capture.js.map +1 -1
- package/lib/commonjs/capture/video-capture.js +29 -2
- package/lib/commonjs/capture/video-capture.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-state/capture-status.js +32 -0
- package/lib/commonjs/theta-repository/theta-state/capture-status.js.map +1 -0
- package/lib/commonjs/theta-repository/theta-state/index.js +11 -0
- package/lib/commonjs/theta-repository/theta-state/index.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-state/theta-state.js +1 -23
- package/lib/commonjs/theta-repository/theta-state/theta-state.js.map +1 -1
- package/lib/module/capture/burst-capture.js +13 -1
- package/lib/module/capture/burst-capture.js.map +1 -1
- package/lib/module/capture/capture.js +11 -0
- package/lib/module/capture/capture.js.map +1 -1
- package/lib/module/capture/composite-interval-capture.js +13 -1
- package/lib/module/capture/composite-interval-capture.js.map +1 -1
- package/lib/module/capture/continuous-capture.js +12 -1
- package/lib/module/capture/continuous-capture.js.map +1 -1
- package/lib/module/capture/limitless-interval-capture.js +29 -2
- package/lib/module/capture/limitless-interval-capture.js.map +1 -1
- package/lib/module/capture/multi-bracket-capture.js +13 -1
- package/lib/module/capture/multi-bracket-capture.js.map +1 -1
- package/lib/module/capture/photo-capture.js +38 -4
- package/lib/module/capture/photo-capture.js.map +1 -1
- package/lib/module/capture/shot-count-specified-interval-capture.js +12 -1
- package/lib/module/capture/shot-count-specified-interval-capture.js.map +1 -1
- package/lib/module/capture/time-shift-capture.js +12 -1
- package/lib/module/capture/time-shift-capture.js.map +1 -1
- package/lib/module/capture/video-capture.js +29 -2
- package/lib/module/capture/video-capture.js.map +1 -1
- package/lib/module/theta-repository/theta-state/capture-status.js +26 -0
- package/lib/module/theta-repository/theta-state/capture-status.js.map +1 -0
- package/lib/module/theta-repository/theta-state/index.js +1 -0
- package/lib/module/theta-repository/theta-state/index.js.map +1 -1
- package/lib/module/theta-repository/theta-state/theta-state.js +0 -22
- package/lib/module/theta-repository/theta-state/theta-state.js.map +1 -1
- package/lib/typescript/capture/burst-capture.d.ts +4 -2
- package/lib/typescript/capture/burst-capture.d.ts.map +1 -1
- package/lib/typescript/capture/capture.d.ts +9 -0
- package/lib/typescript/capture/capture.d.ts.map +1 -1
- package/lib/typescript/capture/composite-interval-capture.d.ts +4 -2
- package/lib/typescript/capture/composite-interval-capture.d.ts.map +1 -1
- package/lib/typescript/capture/continuous-capture.d.ts +3 -2
- package/lib/typescript/capture/continuous-capture.d.ts.map +1 -1
- package/lib/typescript/capture/limitless-interval-capture.d.ts +10 -2
- package/lib/typescript/capture/limitless-interval-capture.d.ts.map +1 -1
- package/lib/typescript/capture/multi-bracket-capture.d.ts +5 -3
- package/lib/typescript/capture/multi-bracket-capture.d.ts.map +1 -1
- package/lib/typescript/capture/photo-capture.d.ts +15 -2
- package/lib/typescript/capture/photo-capture.d.ts.map +1 -1
- package/lib/typescript/capture/shot-count-specified-interval-capture.d.ts +3 -2
- package/lib/typescript/capture/shot-count-specified-interval-capture.d.ts.map +1 -1
- package/lib/typescript/capture/time-shift-capture.d.ts +3 -2
- package/lib/typescript/capture/time-shift-capture.d.ts.map +1 -1
- package/lib/typescript/capture/video-capture.d.ts +10 -2
- package/lib/typescript/capture/video-capture.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-state/capture-status.d.ts +26 -0
- package/lib/typescript/theta-repository/theta-state/capture-status.d.ts.map +1 -0
- package/lib/typescript/theta-repository/theta-state/index.d.ts +1 -0
- package/lib/typescript/theta-repository/theta-state/index.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-state/theta-state.d.ts +1 -21
- package/lib/typescript/theta-repository/theta-state/theta-state.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/capture/burst-capture.ts +20 -2
- package/src/capture/capture.ts +12 -0
- package/src/capture/composite-interval-capture.ts +20 -2
- package/src/capture/continuous-capture.ts +19 -2
- package/src/capture/limitless-interval-capture.ts +40 -5
- package/src/capture/multi-bracket-capture.ts +21 -3
- package/src/capture/photo-capture.ts +53 -4
- package/src/capture/shot-count-specified-interval-capture.ts +19 -2
- package/src/capture/time-shift-capture.ts +19 -2
- package/src/capture/video-capture.ts +38 -3
- package/src/theta-repository/theta-state/capture-status.ts +27 -0
- package/src/theta-repository/theta-state/index.ts +1 -0
- package/src/theta-repository/theta-state/theta-state.ts +1 -24
- package/theta-client-react-native.podspec +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "theta-client-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "This library provides a way to control RICOH THETA using.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"engines": {
|
|
84
84
|
"node": ">= 16.0.0"
|
|
85
85
|
},
|
|
86
|
-
"packageManager": "yarn@1.22.
|
|
86
|
+
"packageManager": "yarn@1.22.22",
|
|
87
87
|
"jest": {
|
|
88
88
|
"preset": "react-native",
|
|
89
89
|
"modulePathIgnorePatterns": [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CaptureBuilder } from './capture';
|
|
1
|
+
import { CaptureBuilder, CapturingStatusEnum } from './capture';
|
|
2
2
|
import { NativeModules } from 'react-native';
|
|
3
3
|
import {
|
|
4
4
|
BaseNotify,
|
|
@@ -17,6 +17,7 @@ const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
|
|
|
17
17
|
|
|
18
18
|
const NOTIFY_PROGRESS = 'BURST-PROGRESS';
|
|
19
19
|
const NOTIFY_STOP_ERROR = 'BURST-STOP-ERROR';
|
|
20
|
+
const NOTIFY_CAPTURING = 'BURST-CAPTURING';
|
|
20
21
|
|
|
21
22
|
interface CaptureProgressNotify extends BaseNotify {
|
|
22
23
|
params?: {
|
|
@@ -30,6 +31,12 @@ interface CaptureStopErrorNotify extends BaseNotify {
|
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
interface CapturingNotify extends BaseNotify {
|
|
35
|
+
params?: {
|
|
36
|
+
status: CapturingStatusEnum;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
33
40
|
/**
|
|
34
41
|
* BurstCapture class
|
|
35
42
|
*/
|
|
@@ -41,11 +48,14 @@ export class BurstCapture {
|
|
|
41
48
|
/**
|
|
42
49
|
* start burst shooting
|
|
43
50
|
* @param onProgress the block for burst shooting onProgress
|
|
51
|
+
* @param onStopFailed Called when stopCapture error occurs
|
|
52
|
+
* @param onCapturing Called when change capture status
|
|
44
53
|
* @return promise of captured file url
|
|
45
54
|
*/
|
|
46
55
|
async startCapture(
|
|
47
56
|
onProgress?: (completion?: number) => void,
|
|
48
|
-
onStopFailed?: (error: any) => void
|
|
57
|
+
onStopFailed?: (error: any) => void,
|
|
58
|
+
onCapturing?: (status: CapturingStatusEnum) => void
|
|
49
59
|
): Promise<string[] | undefined> {
|
|
50
60
|
if (onProgress) {
|
|
51
61
|
this.notify.addNotify(NOTIFY_PROGRESS, (event: CaptureProgressNotify) => {
|
|
@@ -60,6 +70,13 @@ export class BurstCapture {
|
|
|
60
70
|
}
|
|
61
71
|
);
|
|
62
72
|
}
|
|
73
|
+
if (onCapturing) {
|
|
74
|
+
this.notify.addNotify(NOTIFY_CAPTURING, (event: CapturingNotify) => {
|
|
75
|
+
if (event.params?.status) {
|
|
76
|
+
onCapturing(event.params.status);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
63
80
|
|
|
64
81
|
return new Promise<string[] | undefined>(async (resolve, reject) => {
|
|
65
82
|
await ThetaClientReactNative.startBurstCapture()
|
|
@@ -72,6 +89,7 @@ export class BurstCapture {
|
|
|
72
89
|
.finally(() => {
|
|
73
90
|
this.notify.removeNotify(NOTIFY_PROGRESS);
|
|
74
91
|
this.notify.removeNotify(NOTIFY_STOP_ERROR);
|
|
92
|
+
this.notify.removeNotify(NOTIFY_CAPTURING);
|
|
75
93
|
});
|
|
76
94
|
});
|
|
77
95
|
}
|
package/src/capture/capture.ts
CHANGED
|
@@ -124,6 +124,18 @@ export abstract class CaptureBuilder<T extends CaptureBuilder<T>> {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
/** Capturing status */
|
|
128
|
+
export const CapturingStatusEnum = {
|
|
129
|
+
/** Capture in progress */
|
|
130
|
+
CAPTURING: 'CAPTURING',
|
|
131
|
+
/** Self-timer in progress */
|
|
132
|
+
SELF_TIMER_COUNTDOWN: 'SELF_TIMER_COUNTDOWN',
|
|
133
|
+
} as const;
|
|
134
|
+
|
|
135
|
+
/** type definition of CapturingStatusEnum */
|
|
136
|
+
export type CapturingStatusEnum =
|
|
137
|
+
(typeof CapturingStatusEnum)[keyof typeof CapturingStatusEnum];
|
|
138
|
+
|
|
127
139
|
export class PhotoCaptureBuilderBase<
|
|
128
140
|
T extends PhotoCaptureBuilderBase<T>
|
|
129
141
|
> extends CaptureBuilder<T> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CaptureBuilder } from './capture';
|
|
1
|
+
import { CaptureBuilder, CapturingStatusEnum } from './capture';
|
|
2
2
|
import { NativeModules } from 'react-native';
|
|
3
3
|
import {
|
|
4
4
|
BaseNotify,
|
|
@@ -8,6 +8,7 @@ const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
|
|
|
8
8
|
|
|
9
9
|
const NOTIFY_PROGRESS = 'COMPOSITE-INTERVAL-PROGRESS';
|
|
10
10
|
const NOTIFY_STOP_ERROR = 'COMPOSITE-INTERVAL-STOP-ERROR';
|
|
11
|
+
const NOTIFY_CAPTURING = 'COMPOSITE-INTERVAL-CAPTURING';
|
|
11
12
|
|
|
12
13
|
interface CaptureProgressNotify extends BaseNotify {
|
|
13
14
|
params?: {
|
|
@@ -21,6 +22,12 @@ interface CaptureStopErrorNotify extends BaseNotify {
|
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
interface CapturingNotify extends BaseNotify {
|
|
26
|
+
params?: {
|
|
27
|
+
status: CapturingStatusEnum;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
/**
|
|
25
32
|
* CompositeIntervalCapture class
|
|
26
33
|
*/
|
|
@@ -32,11 +39,14 @@ export class CompositeIntervalCapture {
|
|
|
32
39
|
/**
|
|
33
40
|
* start interval composite shooting
|
|
34
41
|
* @param onProgress the block for interval composite shooting onProgress
|
|
42
|
+
* @param onStopFailed Called when stopCapture error occurs
|
|
43
|
+
* @param onCapturing Called when change capture status
|
|
35
44
|
* @return promise of captured file url
|
|
36
45
|
*/
|
|
37
46
|
async startCapture(
|
|
38
47
|
onProgress?: (completion?: number) => void,
|
|
39
|
-
onStopFailed?: (error: any) => void
|
|
48
|
+
onStopFailed?: (error: any) => void,
|
|
49
|
+
onCapturing?: (status: CapturingStatusEnum) => void
|
|
40
50
|
): Promise<string[] | undefined> {
|
|
41
51
|
if (onProgress) {
|
|
42
52
|
this.notify.addNotify(NOTIFY_PROGRESS, (event: CaptureProgressNotify) => {
|
|
@@ -51,6 +61,13 @@ export class CompositeIntervalCapture {
|
|
|
51
61
|
}
|
|
52
62
|
);
|
|
53
63
|
}
|
|
64
|
+
if (onCapturing) {
|
|
65
|
+
this.notify.addNotify(NOTIFY_CAPTURING, (event: CapturingNotify) => {
|
|
66
|
+
if (event.params?.status) {
|
|
67
|
+
onCapturing(event.params.status);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
54
71
|
|
|
55
72
|
return new Promise<string[] | undefined>(async (resolve, reject) => {
|
|
56
73
|
await ThetaClientReactNative.startCompositeIntervalCapture()
|
|
@@ -63,6 +80,7 @@ export class CompositeIntervalCapture {
|
|
|
63
80
|
.finally(() => {
|
|
64
81
|
this.notify.removeNotify(NOTIFY_PROGRESS);
|
|
65
82
|
this.notify.removeNotify(NOTIFY_STOP_ERROR);
|
|
83
|
+
this.notify.removeNotify(NOTIFY_CAPTURING);
|
|
66
84
|
});
|
|
67
85
|
});
|
|
68
86
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CaptureBuilder } from './capture';
|
|
1
|
+
import { CaptureBuilder, CapturingStatusEnum } from './capture';
|
|
2
2
|
import { NativeModules } from 'react-native';
|
|
3
3
|
import {
|
|
4
4
|
BaseNotify,
|
|
@@ -13,6 +13,7 @@ import { getOptions } from '../theta-repository';
|
|
|
13
13
|
const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
|
|
14
14
|
|
|
15
15
|
const NOTIFY_PROGRESS = 'CONTINUOUS-PROGRESS';
|
|
16
|
+
const NOTIFY_CAPTURING = 'CONTINUOUS-CAPTURING';
|
|
16
17
|
|
|
17
18
|
interface CaptureProgressNotify extends BaseNotify {
|
|
18
19
|
params?: {
|
|
@@ -20,6 +21,12 @@ interface CaptureProgressNotify extends BaseNotify {
|
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
interface CapturingNotify extends BaseNotify {
|
|
25
|
+
params?: {
|
|
26
|
+
status: CapturingStatusEnum;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
/**
|
|
24
31
|
* ContinuousCapture class
|
|
25
32
|
*/
|
|
@@ -31,16 +38,25 @@ export class ContinuousCapture {
|
|
|
31
38
|
/**
|
|
32
39
|
* start continuous shooting
|
|
33
40
|
* @param onProgress the block for continuous shooting onProgress
|
|
41
|
+
* @param onCapturing Called when change capture status
|
|
34
42
|
* @return promise of captured file url
|
|
35
43
|
*/
|
|
36
44
|
async startCapture(
|
|
37
|
-
onProgress?: (completion?: number) => void
|
|
45
|
+
onProgress?: (completion?: number) => void,
|
|
46
|
+
onCapturing?: (status: CapturingStatusEnum) => void
|
|
38
47
|
): Promise<string[] | undefined> {
|
|
39
48
|
if (onProgress) {
|
|
40
49
|
this.notify.addNotify(NOTIFY_PROGRESS, (event: CaptureProgressNotify) => {
|
|
41
50
|
onProgress(event.params?.completion);
|
|
42
51
|
});
|
|
43
52
|
}
|
|
53
|
+
if (onCapturing) {
|
|
54
|
+
this.notify.addNotify(NOTIFY_CAPTURING, (event: CapturingNotify) => {
|
|
55
|
+
if (event.params?.status) {
|
|
56
|
+
onCapturing(event.params.status);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
44
60
|
|
|
45
61
|
return new Promise<string[] | undefined>(async (resolve, reject) => {
|
|
46
62
|
await ThetaClientReactNative.startContinuousCapture()
|
|
@@ -52,6 +68,7 @@ export class ContinuousCapture {
|
|
|
52
68
|
})
|
|
53
69
|
.finally(() => {
|
|
54
70
|
this.notify.removeNotify(NOTIFY_PROGRESS);
|
|
71
|
+
this.notify.removeNotify(NOTIFY_CAPTURING);
|
|
55
72
|
});
|
|
56
73
|
});
|
|
57
74
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CaptureBuilder } from './capture';
|
|
1
|
+
import { CaptureBuilder, CapturingStatusEnum } from './capture';
|
|
2
2
|
import { NativeModules } from 'react-native';
|
|
3
3
|
import {
|
|
4
4
|
BaseNotify,
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
|
|
8
8
|
|
|
9
9
|
const NOTIFY_NAME = 'LIMITLESS-INTERVAL-CAPTURE-STOP-ERROR';
|
|
10
|
+
const NOTIFY_CAPTURING = 'LIMITLESS-INTERVAL-CAPTURE-CAPTURING';
|
|
10
11
|
|
|
11
12
|
interface CaptureStopErrorNotify extends BaseNotify {
|
|
12
13
|
params?: {
|
|
@@ -14,6 +15,12 @@ interface CaptureStopErrorNotify extends BaseNotify {
|
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
interface CapturingNotify extends BaseNotify {
|
|
19
|
+
params?: {
|
|
20
|
+
status: CapturingStatusEnum;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
17
24
|
/**
|
|
18
25
|
* LimitlessIntervalCapture class
|
|
19
26
|
*/
|
|
@@ -26,16 +33,25 @@ export class LimitlessIntervalCapture {
|
|
|
26
33
|
/**
|
|
27
34
|
* start limitless interval capture
|
|
28
35
|
* @param onStopFailed the block for error of stopCapture
|
|
36
|
+
* @param onCapturing Called when change capture status
|
|
29
37
|
* @return promise of captured file url
|
|
30
38
|
*/
|
|
31
39
|
startCapture(
|
|
32
|
-
onStopFailed?: (error: any) => void
|
|
40
|
+
onStopFailed?: (error: any) => void,
|
|
41
|
+
onCapturing?: (status: CapturingStatusEnum) => void
|
|
33
42
|
): Promise<string[] | undefined> {
|
|
34
43
|
if (onStopFailed) {
|
|
35
44
|
this.notify.addNotify(NOTIFY_NAME, (event: CaptureStopErrorNotify) => {
|
|
36
45
|
onStopFailed(event.params);
|
|
37
46
|
});
|
|
38
47
|
}
|
|
48
|
+
if (onCapturing) {
|
|
49
|
+
this.notify.addNotify(NOTIFY_CAPTURING, (event: CapturingNotify) => {
|
|
50
|
+
if (event.params?.status) {
|
|
51
|
+
onCapturing(event.params.status);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
39
55
|
return new Promise<string[] | undefined>(async (resolve, reject) => {
|
|
40
56
|
await ThetaClientReactNative.startLimitlessIntervalCapture()
|
|
41
57
|
.then((result?: string[]) => {
|
|
@@ -46,6 +62,7 @@ export class LimitlessIntervalCapture {
|
|
|
46
62
|
})
|
|
47
63
|
.finally(() => {
|
|
48
64
|
this.notify.removeNotify(NOTIFY_NAME);
|
|
65
|
+
this.notify.removeNotify(NOTIFY_CAPTURING);
|
|
49
66
|
});
|
|
50
67
|
});
|
|
51
68
|
}
|
|
@@ -62,9 +79,24 @@ export class LimitlessIntervalCapture {
|
|
|
62
79
|
* LimitlessIntervalCaptureBuilder class
|
|
63
80
|
*/
|
|
64
81
|
export class LimitlessIntervalCaptureBuilder extends CaptureBuilder<LimitlessIntervalCaptureBuilder> {
|
|
82
|
+
interval?: number;
|
|
83
|
+
|
|
65
84
|
/** construct LimitlessIntervalCaptureBuilder instance */
|
|
66
85
|
constructor() {
|
|
67
86
|
super();
|
|
87
|
+
this.interval = undefined;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* set interval of checking continuous shooting status command
|
|
92
|
+
* @param timeMillis interval
|
|
93
|
+
* @returns LimitlessIntervalCaptureBuilder
|
|
94
|
+
*/
|
|
95
|
+
setCheckStatusCommandInterval(
|
|
96
|
+
timeMillis: number
|
|
97
|
+
): LimitlessIntervalCaptureBuilder {
|
|
98
|
+
this.interval = timeMillis;
|
|
99
|
+
return this;
|
|
68
100
|
}
|
|
69
101
|
|
|
70
102
|
/**
|
|
@@ -84,12 +116,15 @@ export class LimitlessIntervalCaptureBuilder extends CaptureBuilder<LimitlessInt
|
|
|
84
116
|
* @return promise of LimitlessIntervalCapture instance
|
|
85
117
|
*/
|
|
86
118
|
build(): Promise<LimitlessIntervalCapture> {
|
|
119
|
+
let params = {
|
|
120
|
+
...this.options,
|
|
121
|
+
// Cannot pass negative values in IOS, use objects
|
|
122
|
+
_capture_interval: this.interval ?? -1,
|
|
123
|
+
};
|
|
87
124
|
return new Promise<LimitlessIntervalCapture>(async (resolve, reject) => {
|
|
88
125
|
try {
|
|
89
126
|
await ThetaClientReactNative.getLimitlessIntervalCaptureBuilder();
|
|
90
|
-
await ThetaClientReactNative.buildLimitlessIntervalCapture(
|
|
91
|
-
this.options
|
|
92
|
-
);
|
|
127
|
+
await ThetaClientReactNative.buildLimitlessIntervalCapture(params);
|
|
93
128
|
resolve(new LimitlessIntervalCapture(NotifyController.instance));
|
|
94
129
|
} catch (error) {
|
|
95
130
|
reject(error);
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { CaptureBuilder } from './capture';
|
|
1
|
+
import { CaptureBuilder, CapturingStatusEnum } from './capture';
|
|
2
2
|
import { NativeModules } from 'react-native';
|
|
3
3
|
import {
|
|
4
4
|
BaseNotify,
|
|
5
5
|
NotifyController,
|
|
6
6
|
} from '../theta-repository/notify-controller';
|
|
7
|
-
import type { BracketSetting } from '
|
|
7
|
+
import type { BracketSetting } from '../theta-repository/options';
|
|
8
8
|
const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
|
|
9
9
|
|
|
10
10
|
const NOTIFY_PROGRESS = 'MULTI-BRACKET-PROGRESS';
|
|
11
11
|
const NOTIFY_STOP_ERROR = 'MULTI-BRACKET-STOP-ERROR';
|
|
12
|
+
const NOTIFY_CAPTURING = 'MULTI-BRACKET-CAPTURING';
|
|
12
13
|
|
|
13
14
|
interface CaptureProgressNotify extends BaseNotify {
|
|
14
15
|
params?: {
|
|
@@ -22,6 +23,12 @@ interface CaptureStopErrorNotify extends BaseNotify {
|
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
interface CapturingNotify extends BaseNotify {
|
|
27
|
+
params?: {
|
|
28
|
+
status: CapturingStatusEnum;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
25
32
|
/**
|
|
26
33
|
* MultiBracketCapture class
|
|
27
34
|
*/
|
|
@@ -34,11 +41,14 @@ export class MultiBracketCapture {
|
|
|
34
41
|
/**
|
|
35
42
|
* start multi bracket shooting
|
|
36
43
|
* @param onProgress the block for multi bracket shooting onProgress
|
|
44
|
+
* @param onStopFailed the block for error of cancelCapture
|
|
45
|
+
* @param onCapturing Called when change capture status
|
|
37
46
|
* @return promise of captured file urls
|
|
38
47
|
*/
|
|
39
48
|
async startCapture(
|
|
40
49
|
onProgress?: (completion?: number) => void,
|
|
41
|
-
onStopFailed?: (error: any) => void
|
|
50
|
+
onStopFailed?: (error: any) => void,
|
|
51
|
+
onCapturing?: (status: CapturingStatusEnum) => void
|
|
42
52
|
): Promise<string[] | undefined> {
|
|
43
53
|
if (onProgress) {
|
|
44
54
|
this.notify.addNotify(NOTIFY_PROGRESS, (event: CaptureProgressNotify) => {
|
|
@@ -53,6 +63,13 @@ export class MultiBracketCapture {
|
|
|
53
63
|
}
|
|
54
64
|
);
|
|
55
65
|
}
|
|
66
|
+
if (onCapturing) {
|
|
67
|
+
this.notify.addNotify(NOTIFY_CAPTURING, (event: CapturingNotify) => {
|
|
68
|
+
if (event.params?.status) {
|
|
69
|
+
onCapturing(event.params.status);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
56
73
|
|
|
57
74
|
return new Promise<string[] | undefined>(async (resolve, reject) => {
|
|
58
75
|
await ThetaClientReactNative.startMultiBracketCapture()
|
|
@@ -65,6 +82,7 @@ export class MultiBracketCapture {
|
|
|
65
82
|
.finally(() => {
|
|
66
83
|
this.notify.removeNotify(NOTIFY_PROGRESS);
|
|
67
84
|
this.notify.removeNotify(NOTIFY_STOP_ERROR);
|
|
85
|
+
this.notify.removeNotify(NOTIFY_CAPTURING);
|
|
68
86
|
});
|
|
69
87
|
});
|
|
70
88
|
}
|
|
@@ -1,22 +1,53 @@
|
|
|
1
|
-
import { PhotoCaptureBuilderBase } from './capture';
|
|
1
|
+
import { CapturingStatusEnum, PhotoCaptureBuilderBase } from './capture';
|
|
2
2
|
import type { FilterEnum, PresetEnum } from '../theta-repository/options';
|
|
3
3
|
|
|
4
4
|
import { NativeModules } from 'react-native';
|
|
5
|
+
import {
|
|
6
|
+
BaseNotify,
|
|
7
|
+
NotifyController,
|
|
8
|
+
} from '../theta-repository/notify-controller';
|
|
5
9
|
const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
|
|
6
10
|
|
|
11
|
+
const NOTIFY_CAPTURING = 'PHOTO-CAPTURING';
|
|
12
|
+
|
|
13
|
+
interface CapturingNotify extends BaseNotify {
|
|
14
|
+
params?: {
|
|
15
|
+
status: CapturingStatusEnum;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
7
19
|
/**
|
|
8
20
|
* PhotoCapture class
|
|
9
21
|
*/
|
|
10
22
|
export class PhotoCapture {
|
|
23
|
+
notify: NotifyController;
|
|
24
|
+
constructor(notify: NotifyController) {
|
|
25
|
+
this.notify = notify;
|
|
26
|
+
}
|
|
27
|
+
|
|
11
28
|
/**
|
|
29
|
+
* Take a picture
|
|
30
|
+
*
|
|
31
|
+
* @param onCapturing Called when change capture status
|
|
12
32
|
* @return promise of token file url
|
|
13
33
|
*/
|
|
14
|
-
async takePicture(
|
|
34
|
+
async takePicture(
|
|
35
|
+
onCapturing?: (status: CapturingStatusEnum) => void
|
|
36
|
+
): Promise<string | undefined> {
|
|
37
|
+
if (onCapturing) {
|
|
38
|
+
this.notify.addNotify(NOTIFY_CAPTURING, (event: CapturingNotify) => {
|
|
39
|
+
if (event.params?.status) {
|
|
40
|
+
onCapturing(event.params.status);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
15
44
|
try {
|
|
16
45
|
const fileUrl = await ThetaClientReactNative.takePicture();
|
|
17
46
|
return fileUrl ?? undefined;
|
|
18
47
|
} catch (error) {
|
|
19
48
|
throw error;
|
|
49
|
+
} finally {
|
|
50
|
+
this.notify.removeNotify(NOTIFY_CAPTURING);
|
|
20
51
|
}
|
|
21
52
|
}
|
|
22
53
|
}
|
|
@@ -25,9 +56,22 @@ export class PhotoCapture {
|
|
|
25
56
|
* PhotoCaptureBaseBuilder class
|
|
26
57
|
*/
|
|
27
58
|
export class PhotoCaptureBuilder extends PhotoCaptureBuilderBase<PhotoCaptureBuilder> {
|
|
59
|
+
interval?: number;
|
|
60
|
+
|
|
28
61
|
/** construct PhotoCaptureBuilder instance */
|
|
29
62
|
constructor() {
|
|
30
63
|
super();
|
|
64
|
+
this.interval = undefined;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* set interval of checking take picture status command
|
|
69
|
+
* @param timeMillis interval
|
|
70
|
+
* @returns PhotoCaptureBuilder
|
|
71
|
+
*/
|
|
72
|
+
setCheckStatusCommandInterval(timeMillis: number): PhotoCaptureBuilder {
|
|
73
|
+
this.interval = timeMillis;
|
|
74
|
+
return this;
|
|
31
75
|
}
|
|
32
76
|
|
|
33
77
|
/**
|
|
@@ -57,11 +101,16 @@ export class PhotoCaptureBuilder extends PhotoCaptureBuilderBase<PhotoCaptureBui
|
|
|
57
101
|
* @return promise of PhotoCapture instance
|
|
58
102
|
*/
|
|
59
103
|
build(): Promise<PhotoCapture> {
|
|
104
|
+
let params = {
|
|
105
|
+
...this.options,
|
|
106
|
+
// Cannot pass negative values in IOS, use objects
|
|
107
|
+
_capture_interval: this.interval ?? -1,
|
|
108
|
+
};
|
|
60
109
|
return new Promise<PhotoCapture>(async (resolve, reject) => {
|
|
61
110
|
try {
|
|
62
111
|
await ThetaClientReactNative.getPhotoCaptureBuilder();
|
|
63
|
-
await ThetaClientReactNative.buildPhotoCapture(
|
|
64
|
-
resolve(new PhotoCapture());
|
|
112
|
+
await ThetaClientReactNative.buildPhotoCapture(params);
|
|
113
|
+
resolve(new PhotoCapture(NotifyController.instance));
|
|
65
114
|
} catch (error) {
|
|
66
115
|
reject(error);
|
|
67
116
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CaptureBuilder } from './capture';
|
|
1
|
+
import { CaptureBuilder, CapturingStatusEnum } from './capture';
|
|
2
2
|
import { NativeModules } from 'react-native';
|
|
3
3
|
import {
|
|
4
4
|
BaseNotify,
|
|
@@ -8,6 +8,7 @@ const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
|
|
|
8
8
|
|
|
9
9
|
const NOTIFY_PROGRESS = 'SHOT-COUNT-SPECIFIED-INTERVAL-PROGRESS';
|
|
10
10
|
const NOTIFY_STOP_ERROR = 'SHOT-COUNT-SPECIFIED-INTERVAL-STOP-ERROR';
|
|
11
|
+
const NOTIFY_CAPTURING = 'SHOT-COUNT-SPECIFIED-INTERVAL-CAPTURING';
|
|
11
12
|
|
|
12
13
|
interface CaptureProgressNotify extends BaseNotify {
|
|
13
14
|
params?: {
|
|
@@ -21,6 +22,12 @@ interface CaptureStopErrorNotify extends BaseNotify {
|
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
interface CapturingNotify extends BaseNotify {
|
|
26
|
+
params?: {
|
|
27
|
+
status: CapturingStatusEnum;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
/**
|
|
25
32
|
* ShotCountSpecifiedIntervalCapture class
|
|
26
33
|
*/
|
|
@@ -33,11 +40,13 @@ export class ShotCountSpecifiedIntervalCapture {
|
|
|
33
40
|
* start interval shooting with the shot count specified
|
|
34
41
|
* @param onProgress the block for interval shooting with the shot count specified onProgress
|
|
35
42
|
* @param onStopFailed the block for error of cancelCapture
|
|
43
|
+
* @param onCapturing Called when change capture status
|
|
36
44
|
* @return promise of captured file url
|
|
37
45
|
*/
|
|
38
46
|
async startCapture(
|
|
39
47
|
onProgress?: (completion?: number) => void,
|
|
40
|
-
onStopFailed?: (error: any) => void
|
|
48
|
+
onStopFailed?: (error: any) => void,
|
|
49
|
+
onCapturing?: (status: CapturingStatusEnum) => void
|
|
41
50
|
): Promise<string[] | undefined> {
|
|
42
51
|
if (onProgress) {
|
|
43
52
|
this.notify.addNotify(NOTIFY_PROGRESS, (event: CaptureProgressNotify) => {
|
|
@@ -52,6 +61,13 @@ export class ShotCountSpecifiedIntervalCapture {
|
|
|
52
61
|
}
|
|
53
62
|
);
|
|
54
63
|
}
|
|
64
|
+
if (onCapturing) {
|
|
65
|
+
this.notify.addNotify(NOTIFY_CAPTURING, (event: CapturingNotify) => {
|
|
66
|
+
if (event.params?.status) {
|
|
67
|
+
onCapturing(event.params.status);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
55
71
|
|
|
56
72
|
return new Promise<string[] | undefined>(async (resolve, reject) => {
|
|
57
73
|
await ThetaClientReactNative.startShotCountSpecifiedIntervalCapture()
|
|
@@ -64,6 +80,7 @@ export class ShotCountSpecifiedIntervalCapture {
|
|
|
64
80
|
.finally(() => {
|
|
65
81
|
this.notify.removeNotify(NOTIFY_PROGRESS);
|
|
66
82
|
this.notify.removeNotify(NOTIFY_STOP_ERROR);
|
|
83
|
+
this.notify.removeNotify(NOTIFY_CAPTURING);
|
|
67
84
|
});
|
|
68
85
|
});
|
|
69
86
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CaptureBuilder } from './capture';
|
|
1
|
+
import { CaptureBuilder, CapturingStatusEnum } from './capture';
|
|
2
2
|
import { NativeModules } from 'react-native';
|
|
3
3
|
import type { TimeShiftIntervalEnum } from '../theta-repository/options';
|
|
4
4
|
import {
|
|
@@ -9,6 +9,7 @@ const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
|
|
|
9
9
|
|
|
10
10
|
const NOTIFY_NAME = 'TIME-SHIFT-PROGRESS';
|
|
11
11
|
const NOTIFY_STOP_ERROR = 'TIME-SHIFT-STOP-ERROR';
|
|
12
|
+
const NOTIFY_CAPTURING = 'TIME-SHIFT-CAPTURING';
|
|
12
13
|
|
|
13
14
|
interface CaptureProgressNotify extends BaseNotify {
|
|
14
15
|
params?: {
|
|
@@ -22,6 +23,12 @@ interface CaptureStopErrorNotify extends BaseNotify {
|
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
interface CapturingNotify extends BaseNotify {
|
|
27
|
+
params?: {
|
|
28
|
+
status: CapturingStatusEnum;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
25
32
|
/**
|
|
26
33
|
* TimeShiftCapture class
|
|
27
34
|
*/
|
|
@@ -34,11 +41,13 @@ export class TimeShiftCapture {
|
|
|
34
41
|
* start time-shift
|
|
35
42
|
* @param onProgress the block for time-shift onProgress
|
|
36
43
|
* @param onStopFailed the block for error of cancelCapture
|
|
44
|
+
* @param onCapturing Called when change capture status
|
|
37
45
|
* @return promise of captured file url
|
|
38
46
|
*/
|
|
39
47
|
async startCapture(
|
|
40
48
|
onProgress?: (completion?: number) => void,
|
|
41
|
-
onStopFailed?: (error: any) => void
|
|
49
|
+
onStopFailed?: (error: any) => void,
|
|
50
|
+
onCapturing?: (status: CapturingStatusEnum) => void
|
|
42
51
|
): Promise<string | undefined> {
|
|
43
52
|
if (onProgress) {
|
|
44
53
|
this.notify.addNotify(NOTIFY_NAME, (event: CaptureProgressNotify) => {
|
|
@@ -53,6 +62,13 @@ export class TimeShiftCapture {
|
|
|
53
62
|
}
|
|
54
63
|
);
|
|
55
64
|
}
|
|
65
|
+
if (onCapturing) {
|
|
66
|
+
this.notify.addNotify(NOTIFY_CAPTURING, (event: CapturingNotify) => {
|
|
67
|
+
if (event.params?.status) {
|
|
68
|
+
onCapturing(event.params.status);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
56
72
|
|
|
57
73
|
return new Promise<string | undefined>(async (resolve, reject) => {
|
|
58
74
|
await ThetaClientReactNative.startTimeShiftCapture()
|
|
@@ -65,6 +81,7 @@ export class TimeShiftCapture {
|
|
|
65
81
|
.finally(() => {
|
|
66
82
|
this.notify.removeNotify(NOTIFY_NAME);
|
|
67
83
|
this.notify.removeNotify(NOTIFY_STOP_ERROR);
|
|
84
|
+
this.notify.removeNotify(NOTIFY_CAPTURING);
|
|
68
85
|
});
|
|
69
86
|
});
|
|
70
87
|
}
|