-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy paththeta_client_flutter.dart
More file actions
3847 lines (3094 loc) · 112 KB
/
Copy paththeta_client_flutter.dart
File metadata and controls
3847 lines (3094 loc) · 112 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:theta_client_flutter/digest_auth.dart';
import 'package:theta_client_flutter/options/access_info.dart';
import 'capture/capture_builder.dart';
import 'options/importer.dart';
import 'state/importer.dart';
import 'theta_client_flutter_platform_interface.dart';
export 'capture/capture.dart';
export 'capture/capture_builder.dart';
export 'capture/capturing.dart';
export 'options/importer.dart';
export 'state/importer.dart';
/// Handle Theta web APIs.
class ThetaClientFlutter {
Future<String?> getPlatformVersion() {
return ThetaClientFlutterPlatform.instance.getPlatformVersion();
}
/// Set up a log listener for THETA API calls
///
/// @param listener Called when there is a THETA API request and response; if null, unregister.
Future<void> setApiLogListener(void Function(String message)? listener) {
return ThetaClientFlutterPlatform.instance.setApiLogListener(listener);
}
/// Initialize object.
///
/// - @param [endpoint] URL of Theta web API endpoint.
/// - @param config Configuration of initialize. If null, get from THETA.
/// - @param timeout Timeout of HTTP call.
/// - @throws If an error occurs in THETA.
Future<void> initialize(
[String endpoint = 'http://192.168.1.1:80/',
ThetaConfig? config,
ThetaTimeout? timeout]) {
return ThetaClientFlutterPlatform.instance
.initialize(endpoint, config, timeout);
}
/// Returns whether it is initialized or not.
///
/// - @return Whether it is initialized or not.
/// - @throws If an error occurs in THETA.
Future<bool> isInitialized() {
return ThetaClientFlutterPlatform.instance.isInitialized();
}
/// Restore setting to THETA
///
/// - @throws If an error occurs in THETA.
Future<void> restoreSettings() {
return ThetaClientFlutterPlatform.instance.restoreSettings();
}
/// Returns the connected THETA model.
///
/// - @return THETA model.
/// - @throws If an error occurs in THETA.
Future<ThetaModel?> getThetaModel() {
return ThetaClientFlutterPlatform.instance.getThetaModel();
}
/// Get basic information about Theta.
///
/// - @return Static attributes of Theta.
/// - @throws If an error occurs in THETA.
Future<ThetaInfo> getThetaInfo() {
return ThetaClientFlutterPlatform.instance.getThetaInfo();
}
/// Acquires open source license information related to the camera.
///
/// - @return HTML string of the license
/// - @throws If an error occurs in THETA.
Future<String> getThetaLicense() {
return ThetaClientFlutterPlatform.instance.getThetaLicense();
}
/// Get current state of Theta.
///
/// - @return Mutable values representing Theta status.
/// - @throws If an error occurs in THETA.
Future<ThetaState> getThetaState() {
return ThetaClientFlutterPlatform.instance.getThetaState();
}
/// Start live preview as motion JPEG.
///
/// - @param [frameHandler] Called for each JPEG frame.
/// - @throws Command is currently disabled; for example, the camera is shooting a video.
Future<void> getLivePreview(bool Function(Uint8List) frameHandler) {
return ThetaClientFlutterPlatform.instance.getLivePreview(frameHandler);
}
/// Lists information of images and videos in Theta.
///
/// - @param [fileType] Type of the files to be listed.
/// - @param [entryCount] Desired number of entries to return.
/// If [entryCount] is more than the number of remaining files, just return entries of actual remaining files.
/// - @param [startPosition] The position of the first file to be returned in the list. 0 represents the first file.
/// If [startPosition] is larger than the position of the last file, an empty list is returned.
/// - @return A list of file information and number of totalEntries.
/// see https://github.com/ricohapi/theta-api-specs/blob/main/theta-web-api-v2.1/commands/camera.list_files.md
/// - @throws If an error occurs in THETA.
Future<ThetaFiles> listFiles(FileTypeEnum fileType, int entryCount,
[int startPosition = 0, StorageEnum? storage]) {
return ThetaClientFlutterPlatform.instance
.listFiles(fileType, entryCount, startPosition, storage);
}
/// Delete files in Theta.
///
/// - @param [fileUrls] URLs of the file to be deleted.
/// - @throws Some of [fileUrls] don't exist. All specified files cannot be deleted.
Future<void> deleteFiles(List<String> fileUrls) {
return ThetaClientFlutterPlatform.instance.deleteFiles(fileUrls);
}
/// Delete all files in Theta.
///
/// - @throws If an error occurs in THETA.
Future<void> deleteAllFiles() {
return ThetaClientFlutterPlatform.instance.deleteAllFiles();
}
/// Delete all image files in Theta.
///
/// - @throws If an error occurs in THETA.
Future<void> deleteAllImageFiles() {
return ThetaClientFlutterPlatform.instance.deleteAllImageFiles();
}
/// Delete all video files in Theta.
///
/// - @throws If an error occurs in THETA.
Future<void> deleteAllVideoFiles() {
return ThetaClientFlutterPlatform.instance.deleteAllVideoFiles();
}
/// Get PhotoCapture.Builder for take a picture.
PhotoCaptureBuilder getPhotoCaptureBuilder() {
ThetaClientFlutterPlatform.instance.getPhotoCaptureBuilder();
return PhotoCaptureBuilder();
}
/// Get TimeShiftCapture.Builder for capture time shift.
TimeShiftCaptureBuilder getTimeShiftCaptureBuilder() {
ThetaClientFlutterPlatform.instance.getTimeShiftCaptureBuilder();
return TimeShiftCaptureBuilder();
}
/// Get TimeShiftManualCapture.Builder for capture time shift.
TimeShiftManualCaptureBuilder getTimeShiftManualCaptureBuilder() {
ThetaClientFlutterPlatform.instance.getTimeShiftManualCaptureBuilder();
return TimeShiftManualCaptureBuilder();
}
/// Get VideoCapture.Builder for capture video.
VideoCaptureBuilder getVideoCaptureBuilder() {
ThetaClientFlutterPlatform.instance.getVideoCaptureBuilder();
return VideoCaptureBuilder();
}
/// Get LimitlessIntervalCapture.Builder for capture limitless interval.
LimitlessIntervalCaptureBuilder getLimitlessIntervalCaptureBuilder() {
ThetaClientFlutterPlatform.instance.getLimitlessIntervalCaptureBuilder();
return LimitlessIntervalCaptureBuilder();
}
/// Get ShotCountSpecifiedIntervalCapture.Builder for capture interval shooting with the shot count specified.
ShotCountSpecifiedIntervalCaptureBuilder
getShotCountSpecifiedIntervalCaptureBuilder(int shotCount) {
ThetaClientFlutterPlatform.instance
.getShotCountSpecifiedIntervalCaptureBuilder(shotCount);
return ShotCountSpecifiedIntervalCaptureBuilder();
}
/// Get getCompositeIntervalCapture.Builder for capture interval composite shooting.
CompositeIntervalCaptureBuilder getCompositeIntervalCaptureBuilder(
int shootingTimeSec) {
ThetaClientFlutterPlatform.instance
.getCompositeIntervalCaptureBuilder(shootingTimeSec);
return CompositeIntervalCaptureBuilder();
}
/// Get BurstCapture.Builder for burst shooting
BurstCaptureBuilder getBurstCaptureBuilder(
BurstCaptureNumEnum burstCaptureNum,
BurstBracketStepEnum burstBracketStep,
BurstCompensationEnum burstCompensation,
BurstMaxExposureTimeEnum burstMaxExposureTime,
BurstEnableIsoControlEnum burstEnableIsoControl,
BurstOrderEnum burstOrder) {
ThetaClientFlutterPlatform.instance.getBurstCaptureBuilder(
burstCaptureNum,
burstBracketStep,
burstCompensation,
burstMaxExposureTime,
burstEnableIsoControl,
burstOrder);
return BurstCaptureBuilder();
}
/// Get getMultiBracketCapture.Builder for capture interval composite shooting.
MultiBracketCaptureBuilder getMultiBracketCaptureBuilder() {
ThetaClientFlutterPlatform.instance.getMultiBracketCaptureBuilder();
return MultiBracketCaptureBuilder();
}
/// Get ContinuousCaptureBuilder.Builder for capture limitless interval.
ContinuousCaptureBuilder getContinuousCaptureBuilder() {
ThetaClientFlutterPlatform.instance.getContinuousCaptureBuilder();
return ContinuousCaptureBuilder();
}
/// Acquires the properties and property support specifications for shooting, the camera, etc.
///
/// Refer to the [options category](https://github.com/ricohapi/theta-api-specs/blob/main/theta-web-api-v2.1/options.md)
/// of API v2.1 reference for details on properties that can be acquired.
///
/// - @param optionNames List of [OptionNameEnum].
/// - @return [Options] acquired
Future<Options> getOptions(List<OptionNameEnum> optionNames) {
return ThetaClientFlutterPlatform.instance.getOptions(optionNames);
}
/// Property settings for shooting, the camera, etc.
///
/// Check the properties that can be set and specifications by the API v2.1 reference options
/// category or [camera.getOptions](https://github.com/ricohapi/theta-api-specs/blob/main/theta-web-api-v2.1/options.md).
///
/// - @param options Camera setting options.
/// - @throws When an invalid option is specified.
Future<void> setOptions(Options options) {
return ThetaClientFlutterPlatform.instance.setOptions(options);
}
/// Get metadata of a still image
///
/// This command cannot be executed during video recording.
/// RICOH THETA V firmware v2.00.2 or later
///
/// - @param[fileUrl] URL of a still image file
/// - @return Exif and [photo sphere XMP](https://developers.google.com/streetview/spherical-metadata/)
/// - @throws Command is currently disabled; for example, the camera is shooting a video.
Future<Metadata> getMetadata(String fileUrl) {
return ThetaClientFlutterPlatform.instance.getMetadata(fileUrl);
}
/// Turn off/on (reboot) the camera.
/// Supported models are THETA A1 only.
///
/// Error when connecting in CL mode for Japan-bound models only
///
/// - @throws If an error occurs in THETA.
Future<void> reboot() {
return ThetaClientFlutterPlatform.instance.reboot();
}
/// Reset all device settings and capture settings.
/// After reset, the camera will be restarted.
///
/// - @throws If an error occurs in THETA.
Future<void> reset() {
return ThetaClientFlutterPlatform.instance.reset();
}
/// Stop running self-timer.
///
/// - @throws If an error occurs in THETA.
Future<void> stopSelfTimer() {
return ThetaClientFlutterPlatform.instance.stopSelfTimer();
}
/// Converts the movie format of a saved movie.
///
/// Theta S and Theta SC don't support this functionality, so always [fileUrl] is returned.
///
/// - @param fileUrl URL of a saved movie file.
/// - @param toLowResolution If true generates lower resolution video, otherwise same resolution.
/// - @param applyTopBottomCorrection apply Top/bottom correction. This parameter is ignored on Theta X.
/// - @param onProgress the block for convertVideoFormats progress.
/// - @return URL of a converted movie file.
/// - @throws Command is currently disabled.
Future<String> convertVideoFormats(String fileUrl, bool toLowResolution,
[bool applyTopBottomCorrection = true,
void Function(double)? onProgress]) {
return ThetaClientFlutterPlatform.instance.convertVideoFormats(
fileUrl, toLowResolution, applyTopBottomCorrection, onProgress);
}
/// Cancels the movie format conversion.
///
/// - @throws When convertVideoFormats is not started.
Future<void> cancelVideoConvert() {
return ThetaClientFlutterPlatform.instance.cancelVideoConvert();
}
/// Turns the wireless LAN off.
///
/// - @throws If an error occurs in THETA.
Future<void> finishWlan() {
return ThetaClientFlutterPlatform.instance.finishWlan();
}
/// Acquires the access point list used in client mode.
///
/// For RICOH THETA X, only the access points registered with [setAccessPoint] can be acquired.
/// (The access points automatically detected with the camera UI cannot be acquired with this API.)
///
/// - @return Lists the access points stored on the camera and the access points detected by the camera.
/// - @throws If an error occurs in THETA.
Future<List<AccessPoint>> listAccessPoints() {
return ThetaClientFlutterPlatform.instance.listAccessPoints();
}
/// Set access point. IP address is set dynamically.
///
/// - @param ssid SSID of the access point.
/// - @param ssidStealth True if SSID stealth is enabled.
/// - @param authMode Authentication mode.
/// - @param password Password. Not set if [authMode] is "[none]".
/// - @param connectionPriority Connection priority 1 to 5. Theta X fixes to 1 (The access point registered later has a higher priority.)
/// - @param proxy Proxy information to be used for the access point.
/// - @throws If an error occurs in THETA.
Future<void> setAccessPointDynamically(String ssid,
{bool? ssidStealth,
AuthModeEnum? authMode,
String? password,
int? connectionPriority,
Proxy? proxy}) {
return ThetaClientFlutterPlatform.instance.setAccessPointDynamically(
ssid, ssidStealth, authMode, password, connectionPriority, proxy);
}
/// Set access point. IP address is set statically.
///
/// - @param ssid SSID of the access point.
/// - @param ssidStealth True if SSID stealth is enabled. Default is false.
/// - @param authMode [AuthModeEnum] Authentication mode.
/// - @param password Password. Not set if [authMode] is "[none]".
/// - @param connectionPriority Connection priority (1 to 5). Default is 1. Theta X fixed to 1 (The access point registered later has a higher priority.)
/// - @param ipAddress IP address assigns to Theta.
/// - @param subnetMask Subnet mask.
/// - @param defaultGateway Default gateway.
/// - @param Primary DNS server.
/// - @param Secondary DNS server.
/// - @param proxy Proxy information to be used for the access point.
/// - @throws If an error occurs in THETA.
Future<void> setAccessPointStatically(String ssid,
{bool? ssidStealth,
AuthModeEnum? authMode,
String? password,
int? connectionPriority,
required String ipAddress,
required String subnetMask,
required String defaultGateway,
String? dns1,
String? dns2,
Proxy? proxy}) {
return ThetaClientFlutterPlatform.instance.setAccessPointStatically(
ssid,
ssidStealth,
authMode,
password,
connectionPriority,
ipAddress,
subnetMask,
defaultGateway,
dns1,
dns2,
proxy);
}
/// Updates the connection priority of the access point.
///
/// - @param ssid SSID of the access point.
/// - @param connectionPriority Connection priority (1 to 5). Default is 1. Theta X fixed to 1 (The access point registered later has a higher priority.)
/// - @param ssidStealth True if SSID stealth is enabled. Default is false.
/// - @throws If an error occurs in THETA.
Future<void> setAccessPointConnectionPriority(
String ssid, int connectionPriority, bool ssidStealth) {
return ThetaClientFlutterPlatform.instance.setAccessPointConnectionPriority(
ssid, connectionPriority, ssidStealth);
}
/// Deletes access point information used in client mode.
/// Only the access points registered with [setAccessPoint] can be deleted.
///
/// - @param ssid SSID of the access point.
/// - @throws If an error occurs in THETA.
Future<void> deleteAccessPoint(String ssid) {
return ThetaClientFlutterPlatform.instance.deleteAccessPoint(ssid);
}
/// Acquires the shooting properties set by the camera._setMySetting command.
/// Just for Theta V and later.
///
/// Refer to the [options Overview](https://github.com/ricohapi/theta-api-specs/blob/main/theta-web-api-v2.1/options.md)
/// of API v2.1 reference for properties available for acquisition.
///
/// - @param captureMode The target shooting mode.
/// - @return Options of my setting
/// - @exception ThetaWebApiException When an invalid option is specified.
/// - @exception NotConnectedException
Future<Options> getMySetting(CaptureModeEnum captureMode) {
return ThetaClientFlutterPlatform.instance.getMySetting(captureMode);
}
/// Acquires the shooting properties set by the camera._setMySetting command.
/// Just for Theta S and SC.
///
/// Refer to the [options Overview](https://github.com/ricohapi/theta-api-specs/blob/main/theta-web-api-v2.1/options.md)
/// of API v2.1 reference for properties available for acquisition.
///
/// - @param optionNames List of option names to acquire.
/// - @return Options of my setting
/// - @exception ThetaWebApiException When an invalid option is specified.
/// - @exception NotConnectedException
Future<Options> getMySettingFromOldModel(List<OptionNameEnum> optionNames) {
return ThetaClientFlutterPlatform.instance
.getMySettingFromOldModel(optionNames);
}
/// Registers shooting conditions in My Settings.
///
/// - @param captureMode The target shooting mode. RICOH THETA S and SC do not support My Settings in video capture mode.
/// - @param options registered to My Settings.
/// - @exception ThetaWebApiException When an invalid option is specified.
/// - @exception NotConnectedException
Future<void> setMySetting(CaptureModeEnum captureMode, Options options) {
return ThetaClientFlutterPlatform.instance
.setMySetting(captureMode, options);
}
/// Delete shooting conditions in My Settings. Supported just by Theta X and Z1.
///
/// - @param captureMode The target shooting mode.
/// - @exception ThetaWebApiException When an invalid option is specified.
/// - @exception NotConnectedException
Future<void> deleteMySetting(CaptureModeEnum captureMode) {
return ThetaClientFlutterPlatform.instance.deleteMySetting(captureMode);
}
/// Acquires a list of installed plugins. Supported just by Theta X, Z1 and V.
/// - @return a list of installed plugin information
/// - @exception ThetaWebApiException When an invalid option is specified.
/// - @exception NotConnectedException
Future<List<PluginInfo>> listPlugins() {
return ThetaClientFlutterPlatform.instance.listPlugins();
}
/// Sets the installed plugin for boot. Supported just by Theta V.
///
/// - @param packageName package name of the plugin
/// - @exception ThetaWebApiException When an invalid option is specified.
/// - @exception NotConnectedException
Future<void> setPlugin(String packageName) {
return ThetaClientFlutterPlatform.instance.setPlugin(packageName);
}
/// Start the plugin specified by the [packageName].
/// If [packageName] is not specified, plugin 1 will start.
/// Supported just by Theta X, Z1 and V.
///
/// - @param packageName package name of the plugin. Theta V does not support this parameter.
/// - @exception ThetaWebApiException When an invalid option is specified.
/// - @exception NotConnectedException
Future<void> startPlugin([String? packageName]) {
return ThetaClientFlutterPlatform.instance.startPlugin(packageName);
}
/// Stop the running plugin.
/// Supported just by Theta X, Z1 and V.
/// - @exception ThetaWebApiException When an invalid option is specified.
/// - @exception NotConnectedException
Future<void> stopPlugin() {
return ThetaClientFlutterPlatform.instance.stopPlugin();
}
/// Acquires the license for the installed plugin
///
/// - @param packageName package name of the target plugin
/// - @return HTML string of the license
/// - @exception ThetaWebApiException When an invalid option is specified.
/// - @exception NotConnectedException
Future<String> getPluginLicense(String packageName) {
return ThetaClientFlutterPlatform.instance.getPluginLicense(packageName);
}
/// Return the plugin orders. Supported just by Theta X and Z1.
///
/// - @return list of package names of plugins
/// For Z1, list of three package names for the start-up plugin. No restrictions for the number of package names for X.
/// - @exception ThetaWebApiException When an invalid option is specified.
/// - @exception NotConnectedException
Future<List<String>> getPluginOrders() {
return ThetaClientFlutterPlatform.instance.getPluginOrders();
}
/// Sets the plugin orders. Supported just by Theta X and Z1.
///
/// - @param plugins list of package names of plugins
/// For Z1, list size must be three. No restrictions for the size for X.
/// When not specifying, set an empty string.
/// If an empty string is placed mid-way, it will be moved to the front.
/// Specifying zero package name will result in an error.
/// - @exception ThetaWebApiException When an invalid option is specified.
/// - @exception NotConnectedException
Future<void> setPluginOrders(List<String> plugins) {
return ThetaClientFlutterPlatform.instance.setPluginOrders(plugins);
}
/// Registers identification information (UUID) of a BLE device (Smartphone application) connected to the camera.
/// UUID can be set while the wireless LAN function of the camera is placed in the direct mode.
///
/// - @param uuid Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
/// Alphabetic letters are not case-sensitive.
/// - @return Device name generated from the serial number (S/N) of the camera.
/// Eg. "00101234" or "THETAXS00101234" when the serial number (S/N) is "XS00101234"
/// - @exception ThetaWebApiException When an invalid option is specified.
/// - @exception NotConnectedException
Future<String> setBluetoothDevice(String uuid) {
return ThetaClientFlutterPlatform.instance.setBluetoothDevice(uuid);
}
}
/// Support THETA model.
enum ThetaModel {
/// THETA S
thetaS('THETA_S'),
/// THETA SC
thetaSC('THETA_SC'),
/// THETA V
thetaV('THETA_V'),
/// THETA Z1
thetaZ1('THETA_Z1'),
/// THETA X
thetaX('THETA_X'),
/// THETA SC2
thetaSC2('THETA_SC2'),
/// THETA SC2 for business
thetaSC2B('THETA_SC2_B'),
/// THETA A1
thetaA1('THETA_A1'),
;
final String rawValue;
const ThetaModel(this.rawValue);
@override
String toString() {
return rawValue;
}
static ThetaModel? getValue(String? rawValue) {
return ThetaModel.values.cast<ThetaModel?>().firstWhere(
(element) => element?.rawValue == rawValue,
orElse: () => null);
}
}
/// Static attributes of Theta.
class ThetaInfo {
/// Manufacturer name
final String manufacturer;
/// Theta model name.
final String model;
/// Theta serial number.
final String serialNumber;
/// MAC address of wireless LAN
/// (RICOH THETA V firmware v2.11.1 or later)
///
/// For THETA X, firmware versions v2.63.0 and earlier display `the communication MAC address`,
/// while v2.71.1 and later diplay `the physical MAC address`.
/// For other than THETA X, `the physical MAC address` is displayed.
final String? wlanMacAddress;
/// MAC address of Bluetooth (RICOH THETA V firmware v2.11.1 or later)
final String? bluetoothMacAddress;
/// Theta firmware version.
final String firmwareVersion;
/// URL of the support page
final String supportUrl;
/// True if Theta has GPS.
final bool hasGps;
/// True if Theta has Gyroscope.
final bool hasGyro;
/// Number of seconds since Theta boot.
final int uptime;
/// List of supported APIs
final List<String> api;
/// Endpoint information
final Endpoints endpoints;
/// List of supported APIs (1: v2.0, 2: v2.1)
final List<int> apiLevel;
/// THETA model
final ThetaModel? thetaModel;
ThetaInfo(
this.manufacturer,
this.model,
this.serialNumber,
this.wlanMacAddress,
this.bluetoothMacAddress,
this.firmwareVersion,
this.supportUrl,
this.hasGps,
this.hasGyro,
this.uptime,
this.api,
this.endpoints,
this.apiLevel,
this.thetaModel);
}
/// Endpoint information
class Endpoints {
/// Port number for using APIs
final int httpPort;
/// Port number for status update check (CheckForUpdates)
final int httpUpdatesPort;
Endpoints(this.httpPort, this.httpUpdatesPort);
}
/// File type in Theta.
enum FileTypeEnum {
/// All files.
all('ALL'),
/// Still image files.
image('IMAGE'),
/// Video files.
video('VIDEO');
final String rawValue;
const FileTypeEnum(this.rawValue);
@override
String toString() {
return rawValue;
}
}
/// Specifies the storage
enum StorageEnum {
/// internal storage
internal('INTERNAL'),
/// external storage (SD card)
sd('SD'),
/// current storage
current('CURRENT');
final String rawValue;
const StorageEnum(this.rawValue);
@override
String toString() {
return rawValue;
}
}
/// Video codec
enum CodecEnum {
/// Undefined value
unknown('UNKNOWN'),
/// codec H.264/MPEG-4 AVC
h264mp4avc('H264MP4AVC'),
/// codec H.265/HEVC
h265hevc('H265HEVC');
final String rawValue;
const CodecEnum(this.rawValue);
@override
String toString() {
return rawValue;
}
static CodecEnum? getValue(String rawValue) {
return CodecEnum.values.cast<CodecEnum?>().firstWhere(
(element) => element?.rawValue == rawValue,
orElse: () => null);
}
}
/// THETA projection type
enum ProjectionTypeEnum {
/// Equirectangular type
equirectangular('EQUIRECTANGULAR'),
/// Dual Fisheye type
dualFisheye('DUAL_FISHEYE'),
/// Fisheye type
fisheye('FISHEYE');
final String rawValue;
const ProjectionTypeEnum(this.rawValue);
@override
String toString() {
return rawValue;
}
static ProjectionTypeEnum? getValue(String rawValue) {
return ProjectionTypeEnum.values.cast<ProjectionTypeEnum?>().firstWhere(
(element) => element?.rawValue == rawValue,
orElse: () => null);
}
}
/// File information in Theta.
class FileInfo {
/// File name.
final String name;
/// You can get a file using HTTP GET to [fileUrl].
final String fileUrl;
/// File size in bytes.
final int size;
/// File creation or update time with the time zone in the format "YYYY:MM:DD hh:mm:ss+(-)hh:mm".
final String dateTimeZone;
/// File creation time in the format "YYYY:MM:DD HH:MM:SS".
final String dateTime;
/// Latitude.
final double? lat;
/// Longitude.
final double? lng;
/// Horizontal size of image (pixels).
final int? width;
/// Vertical size of image (pixels).
final int? height;
/// You can get a thumbnail image using HTTP GET to [thumbnailUrl].
final String thumbnailUrl;
/// Group ID of a still image shot by interval shooting.
final String? intervalCaptureGroupId;
/// Group ID of a still image shot by interval composite shooting.
final String? compositeShootingGroupId;
/// Group ID of a still image shot by multi bracket shooting.
final String? autoBracketGroupId;
/// Video shooting time (sec).
final int? recordTime;
/// Whether or not image processing has been completed.
final bool? isProcessed;
/// URL of the file being processed.
final String? previewUrl;
/// Codec. (RICOH THETA V or later)
final CodecEnum? codec;
/// Projection type of movie file. (RICOH THETA V or later)
final ProjectionTypeEnum? projectionType;
/// Group ID of continuous shooting. (RICOH THETA X or later)
final String? continuousShootingGroupId;
/// Frame rate. (RICOH THETA Z1 Version 3.01.1 or later, RICOH THETA X or later)
final int? frameRate;
/// Favorite. (RICOH THETA X or later)
final bool? favorite;
/// Image description. (RICOH THETA X or later)
final String? imageDescription;
/// Storage ID. (RICOH THETA X Version 2.00.0 or later)
final String? storageID;
FileInfo(
this.name,
this.fileUrl,
this.size,
this.dateTimeZone,
this.dateTime,
this.lat,
this.lng,
this.width,
this.height,
this.thumbnailUrl,
this.intervalCaptureGroupId,
this.compositeShootingGroupId,
this.autoBracketGroupId,
this.recordTime,
this.isProcessed,
this.previewUrl,
this.codec,
this.projectionType,
this.continuousShootingGroupId,
this.frameRate,
this.favorite,
this.imageDescription,
this.storageID);
}
/// Data about files in Theta.
class ThetaFiles {
/// A list of file information.
final List<FileInfo> fileList;
/// Number of totalEntries.
final int totalEntries;
ThetaFiles(this.fileList, this.totalEntries);
}
/// bluetooth power.
enum BluetoothPowerEnum {
/// bluetooth ON
on('ON'),
/// bluetooth OFF
off('OFF');
final String rawValue;
const BluetoothPowerEnum(this.rawValue);
@override
String toString() {
return rawValue;
}
static BluetoothPowerEnum? getValue(String rawValue) {
return BluetoothPowerEnum.values.cast<BluetoothPowerEnum?>().firstWhere(
(element) => element?.rawValue == rawValue,
orElse: () => null);
}
}
/// BurstMode setting.
/// When this is set to ON, burst shooting is enabled,
/// and a screen dedicated to burst shooting is displayed in Live View.
///
/// only For RICOH THETA Z1 firmware v2.10.1 or later
enum BurstModeEnum {
/// BurstMode ON
on('ON'),
/// BurstMode OFF
off('OFF');
final String rawValue;
const BurstModeEnum(this.rawValue);
@override
String toString() {
return rawValue;
}
static BurstModeEnum? getValue(String rawValue) {
return BurstModeEnum.values.cast<BurstModeEnum?>().firstWhere(
(element) => element?.rawValue == rawValue,
orElse: () => null);
}
}
/// Burst shooting setting.
///
/// only For RICOH THETA Z1 firmware v2.10.1 or later
class BurstOption {
/// see [BurstCaptureNumEnum]
BurstCaptureNumEnum? burstCaptureNum;
/// see [BurstBracketStepEnum]
BurstBracketStepEnum? burstBracketStep;
/// see [BurstCompensationEnum]
BurstCompensationEnum? burstCompensation;
/// see [BurstMaxExposureTimeEnum]
BurstMaxExposureTimeEnum? burstMaxExposureTime;
/// see [BurstEnableIsoControlEnum]
BurstEnableIsoControlEnum? burstEnableIsoControl;
/// see [BurstOrderEnum]
BurstOrderEnum? burstOrder;
BurstOption(
this.burstCaptureNum,
this.burstBracketStep,
this.burstCompensation,
this.burstMaxExposureTime,
this.burstEnableIsoControl,
this.burstOrder);
@override
bool operator ==(Object other) => hashCode == other.hashCode;
@override
int get hashCode => Object.hashAll([
burstCaptureNum,
burstBracketStep,
burstCompensation,
burstMaxExposureTime,
burstEnableIsoControl,
burstOrder
]);
}
/// Number of shots for burst shooting
/// 1, 3, 5, 7, 9
enum BurstCaptureNumEnum {
burstCaptureNum_1('BURST_CAPTURE_NUM_1'),
burstCaptureNum_3('BURST_CAPTURE_NUM_3'),
burstCaptureNum_5('BURST_CAPTURE_NUM_5'),
burstCaptureNum_7('BURST_CAPTURE_NUM_7'),
burstCaptureNum_9('BURST_CAPTURE_NUM_9');
final String rawValue;
const BurstCaptureNumEnum(this.rawValue);
@override
String toString() {
return rawValue;
}
static BurstCaptureNumEnum? getValue(String rawValue) {
return BurstCaptureNumEnum.values.cast<BurstCaptureNumEnum?>().firstWhere(
(element) => element?.rawValue == rawValue,
orElse: () => null);
}
}
/// Bracket value range between each shot for burst shooting
/// 0.0, 0.3, 0.7, 1.0, 1.3, 1.7, 2.0, 2.3, 2.7, 3.0
enum BurstBracketStepEnum {
bracketStep_0_0('BRACKET_STEP_0_0'),
bracketStep_0_3('BRACKET_STEP_0_3'),
bracketStep_0_7('BRACKET_STEP_0_7'),
bracketStep_1_0('BRACKET_STEP_1_0'),
bracketStep_1_3('BRACKET_STEP_1_3'),
bracketStep_1_7('BRACKET_STEP_1_7'),
bracketStep_2_0('BRACKET_STEP_2_0'),
bracketStep_2_3('BRACKET_STEP_2_3'),
bracketStep_2_7('BRACKET_STEP_2_7'),
bracketStep_3_0('BRACKET_STEP_3_0');
final String rawValue;
const BurstBracketStepEnum(this.rawValue);
@override
String toString() {
return rawValue;
}