@react-native-ohos/react-native-audio-recorder-player 3.6.11 → 3.6.13-beta.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/LICENSE +21 -21
  3. package/README.OpenSource +10 -10
  4. package/README.md +899 -14
  5. package/harmony/audio_recorder_player/BuildProfile.ets +17 -0
  6. package/harmony/audio_recorder_player/LICENSE +21 -21
  7. package/harmony/audio_recorder_player/ResourceTable.txt +1 -1
  8. package/harmony/audio_recorder_player/build-profile.json5 +28 -28
  9. package/harmony/audio_recorder_player/index.ets +27 -26
  10. package/harmony/audio_recorder_player/oh-package-lock.json5 +29 -0
  11. package/harmony/audio_recorder_player/oh-package.json5 +20 -20
  12. package/harmony/audio_recorder_player/src/main/cpp/CMakeLists.txt +7 -7
  13. package/harmony/audio_recorder_player/src/main/cpp/RNAudioRecorderPlayerPackage.h +52 -52
  14. package/harmony/audio_recorder_player/src/main/cpp/RNAudioRecorderPlayerTurboModule.cpp +92 -92
  15. package/harmony/audio_recorder_player/src/main/cpp/RNAudioRecorderPlayerTurboModule.h +37 -37
  16. package/harmony/audio_recorder_player/src/main/ets/RNAudioRecorderPlayerPackage.ets +48 -48
  17. package/harmony/audio_recorder_player/src/main/ets/RNAudioRecorderPlayerTurboModule.ts +316 -310
  18. package/harmony/audio_recorder_player/src/main/ets/audioPlayer/AudioPlayer.ts +420 -414
  19. package/harmony/audio_recorder_player/src/main/ets/audioPlayer/types.ts +43 -43
  20. package/harmony/audio_recorder_player/src/main/ets/index.d.ts +209 -209
  21. package/harmony/audio_recorder_player/src/main/ets/recorder/Recorder.ts +305 -299
  22. package/harmony/audio_recorder_player/src/main/ets/recorder/types.ts +61 -61
  23. package/harmony/audio_recorder_player/src/main/ets/utils/DateTimeUtils.ts +88 -88
  24. package/harmony/audio_recorder_player/src/main/ets/utils/Logger.ts +45 -45
  25. package/harmony/audio_recorder_player/src/main/ets/utils/SaveAudioAsset.ts +101 -105
  26. package/harmony/audio_recorder_player/src/main/module.json5 +9 -9
  27. package/harmony/audio_recorder_player/src/main/resources/base/element/string.json +8 -8
  28. package/harmony/audio_recorder_player/src/main/resources/base/media/ic_public_error.svg +9 -9
  29. package/harmony/audio_recorder_player/src/main/resources/en_US/element/string.json +8 -8
  30. package/harmony/audio_recorder_player/src/main/resources/zh_CN/element/string.json +8 -8
  31. package/harmony/audio_recorder_player/ts.ets +26 -26
  32. package/harmony/audio_recorder_player.har +0 -0
  33. package/index.d.ts +227 -227
  34. package/index.ts +530 -525
  35. package/package.json +82 -68
  36. package/src/NativeAudioRecorderPlayerModule.ts +41 -41
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Use these variables when you tailor your ArkTS code. They must be of the const type.
3
+ */
4
+ export const HAR_VERSION = '3.6.13-beta.1';
5
+ export const BUILD_MODE_NAME = 'debug';
6
+ export const DEBUG = true;
7
+ export const TARGET_NAME = 'default';
8
+
9
+ /**
10
+ * BuildProfile Class is used only for compatibility purposes.
11
+ */
12
+ export default class BuildProfile {
13
+ static readonly HAR_VERSION = HAR_VERSION;
14
+ static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
15
+ static readonly DEBUG = DEBUG;
16
+ static readonly TARGET_NAME = TARGET_NAME;
17
+ }
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2017 Atul
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Atul
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,2 +1,2 @@
1
- string page_show 0x01000000
1
+ string page_show 0x01000000
2
2
  media ic_public_error 0x01000001
@@ -1,28 +1,28 @@
1
- {
2
- "apiType": "stageMode",
3
- "buildOption": {
4
- },
5
- "buildOptionSet": [
6
- {
7
- "name": "release",
8
- "arkOptions": {
9
- "obfuscation": {
10
- "ruleOptions": {
11
- "enable": true,
12
- "files": [
13
- "./obfuscation-rules.txt"
14
- ]
15
- },
16
- "consumerFiles": [
17
- "./consumer-rules.txt"
18
- ]
19
- }
20
- },
21
- },
22
- ],
23
- "targets": [
24
- {
25
- "name": "default"
26
- }
27
- ]
28
- }
1
+ {
2
+ "apiType": "stageMode",
3
+ "buildOption": {
4
+ },
5
+ "buildOptionSet": [
6
+ {
7
+ "name": "release",
8
+ "arkOptions": {
9
+ "obfuscation": {
10
+ "ruleOptions": {
11
+ "enable": true,
12
+ "files": [
13
+ "./obfuscation-rules.txt"
14
+ ]
15
+ },
16
+ "consumerFiles": [
17
+ "./consumer-rules.txt"
18
+ ]
19
+ }
20
+ },
21
+ },
22
+ ],
23
+ "targets": [
24
+ {
25
+ "name": "default"
26
+ }
27
+ ]
28
+ }
@@ -1,26 +1,27 @@
1
- /*
2
- * MIT License
3
- *
4
- * Copyright (C) 2023 Huawei Device Co., Ltd.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
- import { RNAudioRecorderPlayerPackage } from './src/main/ets/RNAudioRecorderPlayerPackage'
25
- export default RNAudioRecorderPlayerPackage
26
- export * from './ts';
1
+ /*
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2023 Huawei Device Co., Ltd.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import { RNAudioRecorderPlayerPackage } from './src/main/ets/RNAudioRecorderPlayerPackage';
26
+ export default RNAudioRecorderPlayerPackage;
27
+ export * from './ts';
@@ -0,0 +1,29 @@
1
+ {
2
+ "meta": {
3
+ "stableOrder": true
4
+ },
5
+ "lockfileVersion": 3,
6
+ "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
7
+ "specifiers": {
8
+ "@ppd/ffrt@^1.1.5": "@ppd/ffrt@1.1.11",
9
+ "@rnoh/react-native-openharmony@../../example/node_modules/react-native-harmony/react_native_openharmony.har": "@rnoh/react-native-openharmony@../../example/node_modules/react-native-harmony/react_native_openharmony.har"
10
+ },
11
+ "packages": {
12
+ "@ppd/ffrt@1.1.11": {
13
+ "name": "@ppd/ffrt",
14
+ "version": "1.1.11",
15
+ "integrity": "sha512-5AWjn+MUj88L6v5zkz9AimhZ/CrQq1+xlzOeDkBp0aTWFoC6qHH6A/LKwyloPW+pUQrDGr8gYi36RARFdws/9g==",
16
+ "resolved": "https://ohpm.openharmony.cn/ohpm/@ppd/ffrt/-/ffrt-1.1.11.har",
17
+ "registryType": "ohpm"
18
+ },
19
+ "@rnoh/react-native-openharmony@../../example/node_modules/react-native-harmony/react_native_openharmony.har": {
20
+ "name": "@rnoh/react-native-openharmony",
21
+ "version": "0.72.140",
22
+ "resolved": "../../example/node_modules/react-native-harmony/react_native_openharmony.har",
23
+ "registryType": "local",
24
+ "dependencies": {
25
+ "@ppd/ffrt": "^1.1.5"
26
+ }
27
+ }
28
+ }
29
+ }
@@ -1,20 +1,20 @@
1
- {
2
- "license": "ISC",
3
- "types": "",
4
- "devDependencies": {},
5
- "name": "@react-native-ohos/react-native-audio-recorder-player",
6
- "description": "",
7
- "main": "index.ets",
8
- "version": "3.6.11",
9
- "dependencies": {
10
- "@rnoh/react-native-openharmony": "file:../libs/react_native_openharmony-5.0.0.500.har"
11
- },
12
- "metadata": {
13
- "sourceRoots": [
14
- "./src/main"
15
- ]
16
- },
17
- "compatibleSdkVersion": '12',
18
- "compatibleSdkType": "HarmonyOS",
19
- "obfuscated": false
20
- }
1
+ {
2
+ "license": "ISC",
3
+ "types": "",
4
+ "devDependencies": {},
5
+ "name": "@react-native-ohos/react-native-audio-recorder-player",
6
+ "description": "",
7
+ "main": "index.ets",
8
+ "version": "3.6.13-beta.1",
9
+ "dependencies": {
10
+ "@rnoh/react-native-openharmony": "file:../libs/react_native_openharmony-5.0.0.500.har"
11
+ },
12
+ "metadata": {
13
+ "sourceRoots": [
14
+ "./src/main"
15
+ ]
16
+ },
17
+ "compatibleSdkVersion": '12',
18
+ "compatibleSdkType": "HarmonyOS",
19
+ "obfuscated": false
20
+ }
@@ -1,7 +1,7 @@
1
- cmake_minimum_required(VERSION 3.13)
2
- set(CMAKE_VERBOSE_MAKEFILE on)
3
-
4
- file(GLOB rnoh_audio_recorder_player_SRC CONFIGURE_DEPENDS *.cpp)
5
- add_library(rnoh_audio_recorder_player SHARED ${rnoh_audio_recorder_player_SRC})
6
- target_include_directories(rnoh_audio_recorder_player PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
7
- target_link_libraries(rnoh_audio_recorder_player PUBLIC rnoh)
1
+ cmake_minimum_required(VERSION 3.13)
2
+ set(CMAKE_VERBOSE_MAKEFILE on)
3
+
4
+ file(GLOB rnoh_audio_recorder_player_SRC CONFIGURE_DEPENDS *.cpp)
5
+ add_library(rnoh_audio_recorder_player SHARED ${rnoh_audio_recorder_player_SRC})
6
+ target_include_directories(rnoh_audio_recorder_player PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
7
+ target_link_libraries(rnoh_audio_recorder_player PUBLIC rnoh)
@@ -1,53 +1,53 @@
1
-
2
- /**
3
- * MIT License
4
- *
5
- * Copyright (C) 2023 Huawei Device Co., Ltd.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- * SOFTWARE.
24
- */
25
- #ifndef RNAUDIORECORDERPLAYERPACKAGE_H
26
- #define RNAUDIORECORDERPLAYERPACKAGE_H
27
- #include "RNOH/Package.h"
28
- #include "RNAudioRecorderPlayerTurboModule.h"
29
-
30
- using namespace rnoh;
31
- using namespace facebook;
32
- class RNAudioRecorderPlayerFactoryDelegate : public TurboModuleFactoryDelegate {
33
- public:
34
- SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override
35
- {
36
- if (name == "RNAudioRecorderPlayerTurboModule") {
37
- return std::make_shared<RNAudioRecorderPlayerTurboModuleSpecJSI>(ctx, name);
38
- }
39
- return nullptr;
40
- };
41
- };
42
-
43
- namespace rnoh {
44
- class RNAudioRecorderPlayerPackage : public Package {
45
- public:
46
- RNAudioRecorderPlayerPackage(Package::Context ctx) : Package(ctx) {}
47
- std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override
48
- {
49
- return std::make_unique<RNAudioRecorderPlayerFactoryDelegate>();
50
- }
51
- };
52
- } // namespace rnoh
1
+
2
+ /**
3
+ * MIT License
4
+ *
5
+ * Copyright (C) 2023 Huawei Device Co., Ltd.
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ #ifndef RNAUDIORECORDERPLAYERPACKAGE_H
26
+ #define RNAUDIORECORDERPLAYERPACKAGE_H
27
+ #include "RNOH/Package.h"
28
+ #include "RNAudioRecorderPlayerTurboModule.h"
29
+
30
+ using namespace rnoh;
31
+ using namespace facebook;
32
+ class RNAudioRecorderPlayerFactoryDelegate : public TurboModuleFactoryDelegate {
33
+ public:
34
+ SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override
35
+ {
36
+ if (name == "RNAudioRecorderPlayerTurboModule") {
37
+ return std::make_shared<RNAudioRecorderPlayerTurboModuleSpecJSI>(ctx, name);
38
+ }
39
+ return nullptr;
40
+ };
41
+ };
42
+
43
+ namespace rnoh {
44
+ class RNAudioRecorderPlayerPackage : public Package {
45
+ public:
46
+ RNAudioRecorderPlayerPackage(Package::Context ctx) : Package(ctx) {}
47
+ std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override
48
+ {
49
+ return std::make_unique<RNAudioRecorderPlayerFactoryDelegate>();
50
+ }
51
+ };
52
+ } // namespace rnoh
53
53
  #endif // RNAUDIORECORDERPLAYERPACKAGE_H
@@ -1,93 +1,93 @@
1
- /**
2
- * MIT License
3
- *
4
- * Copyright (C) 2023 Huawei Device Co., Ltd.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- #include "RNAudioRecorderPlayerTurboModule.h"
26
- #include "RNOH/ArkTSTurboModule.h"
27
-
28
- using namespace rnoh;
29
- using namespace facebook;
30
- static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addRecordBackListener(
31
- jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
32
- {
33
- return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "addRecordBackListener", args, count);
34
- }
35
- static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeRecordBackListener(
36
- jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
37
- {
38
- return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "removeRecordBackListener", args, count);
39
- }
40
-
41
- static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addPlayBackListener(
42
- jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
43
- {
44
- return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "addPlayBackListener", args, count);
45
- }
46
-
47
- static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removePlayBackListener(
48
- jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
49
- {
50
- return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "removePlayBackListener", args, count);
51
- }
52
-
53
- static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addListener(
54
- jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
55
- {
56
- return jsi::Value(static_cast<ArkTSTurboModule &>(turboModule).call(rt, "addListener", args, count));
57
- }
58
-
59
- static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeListeners(
60
- jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
61
- {
62
- return jsi::Value(static_cast<ArkTSTurboModule &>(turboModule).call(rt, "removeListeners", args, count));
63
- }
64
-
65
- RNAudioRecorderPlayerTurboModuleSpecJSI::RNAudioRecorderPlayerTurboModuleSpecJSI(
66
- const ArkTSTurboModule::Context ctx, const std::string name)
67
- : ArkTSTurboModule(ctx, name)
68
- {
69
- methodMap_ = {
70
- ARK_ASYNC_METHOD_METADATA(startRecorder, 3),
71
- ARK_ASYNC_METHOD_METADATA(pauseRecorder, 0),
72
- ARK_ASYNC_METHOD_METADATA(resumeRecorder, 0),
73
- ARK_ASYNC_METHOD_METADATA(stopRecorder, 0),
74
- ARK_ASYNC_METHOD_METADATA(resumePlayer, 0),
75
- ARK_ASYNC_METHOD_METADATA(startPlayer, 2),
76
- ARK_ASYNC_METHOD_METADATA(stopPlayer, 0),
77
- ARK_ASYNC_METHOD_METADATA(pausePlayer, 0),
78
- ARK_ASYNC_METHOD_METADATA(seekToPlayer, 1),
79
- ARK_ASYNC_METHOD_METADATA(setVolume, 1),
80
- ARK_ASYNC_METHOD_METADATA(setSubscriptionDuration, 1),
81
- };
82
- methodMap_["addRecordBackListener"] =
83
- MethodMetadata{1, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addRecordBackListener};
84
- methodMap_["removeRecordBackListener"] =
85
- MethodMetadata{0, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeRecordBackListener};
86
- methodMap_["addPlayBackListener"] =
87
- MethodMetadata{1, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addPlayBackListener};
88
- methodMap_["removePlayBackListener"] =
89
- MethodMetadata{0, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removePlayBackListener};
90
- methodMap_["addListener"] = MethodMetadata{1, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addListener};
91
- methodMap_["removeListeners"] =
92
- MethodMetadata{1, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeListeners};
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2023 Huawei Device Co., Ltd.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ #include "RNAudioRecorderPlayerTurboModule.h"
26
+ #include "RNOH/ArkTSTurboModule.h"
27
+
28
+ using namespace rnoh;
29
+ using namespace facebook;
30
+ static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addRecordBackListener(
31
+ jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
32
+ {
33
+ return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "addRecordBackListener", args, count);
34
+ }
35
+ static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeRecordBackListener(
36
+ jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
37
+ {
38
+ return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "removeRecordBackListener", args, count);
39
+ }
40
+
41
+ static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addPlayBackListener(
42
+ jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
43
+ {
44
+ return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "addPlayBackListener", args, count);
45
+ }
46
+
47
+ static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removePlayBackListener(
48
+ jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
49
+ {
50
+ return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "removePlayBackListener", args, count);
51
+ }
52
+
53
+ static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addListener(
54
+ jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
55
+ {
56
+ return jsi::Value(static_cast<ArkTSTurboModule &>(turboModule).call(rt, "addListener", args, count));
57
+ }
58
+
59
+ static jsi::Value hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeListeners(
60
+ jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count)
61
+ {
62
+ return jsi::Value(static_cast<ArkTSTurboModule &>(turboModule).call(rt, "removeListeners", args, count));
63
+ }
64
+
65
+ RNAudioRecorderPlayerTurboModuleSpecJSI::RNAudioRecorderPlayerTurboModuleSpecJSI(
66
+ const ArkTSTurboModule::Context ctx, const std::string name)
67
+ : ArkTSTurboModule(ctx, name)
68
+ {
69
+ methodMap_ = {
70
+ ARK_ASYNC_METHOD_METADATA(startRecorder, 3),
71
+ ARK_ASYNC_METHOD_METADATA(pauseRecorder, 0),
72
+ ARK_ASYNC_METHOD_METADATA(resumeRecorder, 0),
73
+ ARK_ASYNC_METHOD_METADATA(stopRecorder, 0),
74
+ ARK_ASYNC_METHOD_METADATA(resumePlayer, 0),
75
+ ARK_ASYNC_METHOD_METADATA(startPlayer, 2),
76
+ ARK_ASYNC_METHOD_METADATA(stopPlayer, 0),
77
+ ARK_ASYNC_METHOD_METADATA(pausePlayer, 0),
78
+ ARK_ASYNC_METHOD_METADATA(seekToPlayer, 1),
79
+ ARK_ASYNC_METHOD_METADATA(setVolume, 1),
80
+ ARK_ASYNC_METHOD_METADATA(setSubscriptionDuration, 1),
81
+ };
82
+ methodMap_["addRecordBackListener"] =
83
+ MethodMetadata{1, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addRecordBackListener};
84
+ methodMap_["removeRecordBackListener"] =
85
+ MethodMetadata{0, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeRecordBackListener};
86
+ methodMap_["addPlayBackListener"] =
87
+ MethodMetadata{1, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addPlayBackListener};
88
+ methodMap_["removePlayBackListener"] =
89
+ MethodMetadata{0, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removePlayBackListener};
90
+ methodMap_["addListener"] = MethodMetadata{1, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addListener};
91
+ methodMap_["removeListeners"] =
92
+ MethodMetadata{1, hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeListeners};
93
93
  }
@@ -1,38 +1,38 @@
1
-
2
- /**
3
- * MIT License
4
- *
5
- * Copyright (C) 2023 Huawei Device Co., Ltd.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- * SOFTWARE.
24
- */
25
- #ifndef RNAUDIORECORDERPLAYERTURBOMODULE_H
26
- #define RNAUDIORECORDERPLAYERTURBOMODULE_H
27
- #include <ReactCommon/TurboModule.h>
28
- #include "RNOH/ArkTSTurboModule.h"
29
-
30
- namespace rnoh {
31
-
32
- class JSI_EXPORT RNAudioRecorderPlayerTurboModuleSpecJSI : public ArkTSTurboModule {
33
- public:
34
- RNAudioRecorderPlayerTurboModuleSpecJSI(const ArkTSTurboModule::Context ctx, const std::string name);
35
- };
36
-
37
- } // namespace rnoh
1
+
2
+ /**
3
+ * MIT License
4
+ *
5
+ * Copyright (C) 2023 Huawei Device Co., Ltd.
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ #ifndef RNAUDIORECORDERPLAYERTURBOMODULE_H
26
+ #define RNAUDIORECORDERPLAYERTURBOMODULE_H
27
+ #include <ReactCommon/TurboModule.h>
28
+ #include "RNOH/ArkTSTurboModule.h"
29
+
30
+ namespace rnoh {
31
+
32
+ class JSI_EXPORT RNAudioRecorderPlayerTurboModuleSpecJSI : public ArkTSTurboModule {
33
+ public:
34
+ RNAudioRecorderPlayerTurboModuleSpecJSI(const ArkTSTurboModule::Context ctx, const std::string name);
35
+ };
36
+
37
+ } // namespace rnoh
38
38
  #endif // RNAUDIORECORDERPLAYERTURBOMODULE_H