@react-native-ohos/react-native-audio-recorder-player 3.7.1-beta.1 → 3.7.2
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/CHANGELOG.md +21 -0
- package/LICENSE +20 -20
- package/README.OpenSource +10 -10
- package/README.md +899 -753
- package/harmony/audio_recorder_player/BuildProfile.ets +16 -16
- package/harmony/audio_recorder_player/LICENSE +21 -21
- package/harmony/audio_recorder_player/build-profile.json5 +28 -28
- package/harmony/audio_recorder_player/index.ets +27 -25
- package/harmony/audio_recorder_player/oh-package-lock.json5 +18 -0
- package/harmony/audio_recorder_player/oh-package.json5 +20 -20
- package/harmony/audio_recorder_player/src/main/cpp/CMakeLists.txt +7 -7
- package/harmony/audio_recorder_player/src/main/cpp/RNAudioRecorderPlayerPackage.h +48 -48
- package/harmony/audio_recorder_player/src/main/cpp/RNAudioRecorderPlayerTurboModule.cpp +90 -90
- package/harmony/audio_recorder_player/src/main/cpp/RNAudioRecorderPlayerTurboModule.h +35 -35
- package/harmony/audio_recorder_player/src/main/ets/{RNAudioRecorderPlayerPackage.ts → RNAudioRecorderPlayerPackage.ets} +48 -47
- package/harmony/audio_recorder_player/src/main/ets/RNAudioRecorderPlayerTurboModule.ts +330 -323
- package/harmony/audio_recorder_player/src/main/ets/audioPlayer/AudioPlayer.ts +469 -464
- package/harmony/audio_recorder_player/src/main/ets/audioPlayer/types.ts +45 -45
- package/harmony/audio_recorder_player/src/main/ets/index.ts +209 -209
- package/harmony/audio_recorder_player/src/main/ets/recorder/Recorder.ts +305 -299
- package/harmony/audio_recorder_player/src/main/ets/recorder/types.ts +61 -61
- package/harmony/audio_recorder_player/src/main/ets/utils/DateTimeUtils.ts +88 -88
- package/harmony/audio_recorder_player/src/main/ets/utils/Logger.ts +45 -45
- package/harmony/audio_recorder_player/src/main/ets/utils/SaveAudioAsset.ts +101 -105
- package/harmony/audio_recorder_player/src/main/module.json5 +9 -9
- package/harmony/audio_recorder_player/src/main/resources/base/element/string.json +8 -8
- package/harmony/audio_recorder_player/src/main/resources/base/media/ic_public_error.svg +9 -9
- package/harmony/audio_recorder_player/src/main/resources/en_US/element/string.json +8 -8
- package/harmony/audio_recorder_player/src/main/resources/zh_CN/element/string.json +8 -8
- package/harmony/audio_recorder_player/{ts.ts → ts.ets} +26 -26
- package/harmony/audio_recorder_player.har +0 -0
- package/index.ts +539 -539
- package/package.json +77 -60
- package/src/NativeAudioRecorderPlayerModule.ts +42 -42
|
@@ -1,17 +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.
|
|
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;
|
|
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.7.2';
|
|
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
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,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,25 +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
|
-
|
|
25
|
-
|
|
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,18 @@
|
|
|
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
|
+
"@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"
|
|
9
|
+
},
|
|
10
|
+
"packages": {
|
|
11
|
+
"@rnoh/react-native-openharmony@../../example/node_modules/react-native-harmony/react_native_openharmony.har": {
|
|
12
|
+
"name": "@rnoh/react-native-openharmony",
|
|
13
|
+
"version": "0.77.18",
|
|
14
|
+
"resolved": "../../example/node_modules/react-native-harmony/react_native_openharmony.har",
|
|
15
|
+
"registryType": "local"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -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.7.
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@rnoh/react-native-openharmony": "file:../../node_modules/@react-native-oh/react-native-harmony/harmony/react_native_openharmony.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.7.2",
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@rnoh/react-native-openharmony": "file:../../node_modules/@react-native-oh/react-native-harmony/harmony/react_native_openharmony.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,48 +1,48 @@
|
|
|
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
|
-
#include "RNOH/Package.h"
|
|
26
|
-
#include "RNAudioRecorderPlayerTurboModule.h"
|
|
27
|
-
|
|
28
|
-
using namespace rnoh;
|
|
29
|
-
using namespace facebook;
|
|
30
|
-
class RNAudioRecorderPlayerFactoryDelegate : public TurboModuleFactoryDelegate {
|
|
31
|
-
public:
|
|
32
|
-
SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
|
|
33
|
-
if (name == "RNAudioRecorderPlayerTurboModule") {
|
|
34
|
-
return std::make_shared<RNAudioRecorderPlayerTurboModuleSpecJSI>(ctx, name);
|
|
35
|
-
}
|
|
36
|
-
return nullptr;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
namespace rnoh {
|
|
41
|
-
class RNAudioRecorderPlayerPackage : public Package {
|
|
42
|
-
public:
|
|
43
|
-
RNAudioRecorderPlayerPackage(Package::Context ctx) : Package(ctx) {}
|
|
44
|
-
std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override {
|
|
45
|
-
return std::make_unique<RNAudioRecorderPlayerFactoryDelegate>();
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
} // 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
|
+
#include "RNOH/Package.h"
|
|
26
|
+
#include "RNAudioRecorderPlayerTurboModule.h"
|
|
27
|
+
|
|
28
|
+
using namespace rnoh;
|
|
29
|
+
using namespace facebook;
|
|
30
|
+
class RNAudioRecorderPlayerFactoryDelegate : public TurboModuleFactoryDelegate {
|
|
31
|
+
public:
|
|
32
|
+
SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
|
|
33
|
+
if (name == "RNAudioRecorderPlayerTurboModule") {
|
|
34
|
+
return std::make_shared<RNAudioRecorderPlayerTurboModuleSpecJSI>(ctx, name);
|
|
35
|
+
}
|
|
36
|
+
return nullptr;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
namespace rnoh {
|
|
41
|
+
class RNAudioRecorderPlayerPackage : public Package {
|
|
42
|
+
public:
|
|
43
|
+
RNAudioRecorderPlayerPackage(Package::Context ctx) : Package(ctx) {}
|
|
44
|
+
std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override {
|
|
45
|
+
return std::make_unique<RNAudioRecorderPlayerFactoryDelegate>();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
} // namespace rnoh
|
|
@@ -1,91 +1,91 @@
|
|
|
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
|
-
return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "addRecordBackListener", args, count);
|
|
33
|
-
}
|
|
34
|
-
static jsi::Value __hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeRecordBackListener(
|
|
35
|
-
jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count) {
|
|
36
|
-
return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "removeRecordBackListener", args, count);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static jsi::Value __hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addPlayBackListener(
|
|
40
|
-
jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count) {
|
|
41
|
-
return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "addPlayBackListener", args, count);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
static jsi::Value __hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removePlayBackListener(
|
|
45
|
-
jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count) {
|
|
46
|
-
return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "removePlayBackListener", args, count);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
static jsi::Value _hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addListener(jsi::Runtime &rt,
|
|
50
|
-
react::TurboModule &turboModule,
|
|
51
|
-
const jsi::Value *args,
|
|
52
|
-
size_t count) {
|
|
53
|
-
return jsi::Value(static_cast<ArkTSTurboModule &>(turboModule).call(rt, "addListener", args, count));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
static jsi::Value _hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeListeners(jsi::Runtime &rt,
|
|
57
|
-
react::TurboModule &turboModule,
|
|
58
|
-
const jsi::Value *args,
|
|
59
|
-
size_t count) {
|
|
60
|
-
return jsi::Value(static_cast<ArkTSTurboModule &>(turboModule).call(rt, "removeListeners", args, count));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
RNAudioRecorderPlayerTurboModuleSpecJSI::RNAudioRecorderPlayerTurboModuleSpecJSI(const ArkTSTurboModule::Context ctx,
|
|
64
|
-
const std::string name)
|
|
65
|
-
: ArkTSTurboModule(ctx, name) {
|
|
66
|
-
methodMap_ = {
|
|
67
|
-
ARK_ASYNC_METHOD_METADATA(startRecorder, 3),
|
|
68
|
-
ARK_ASYNC_METHOD_METADATA(pauseRecorder, 0),
|
|
69
|
-
ARK_ASYNC_METHOD_METADATA(resumeRecorder, 0),
|
|
70
|
-
ARK_ASYNC_METHOD_METADATA(stopRecorder, 0),
|
|
71
|
-
ARK_ASYNC_METHOD_METADATA(resumePlayer, 0),
|
|
72
|
-
ARK_ASYNC_METHOD_METADATA(startPlayer, 2),
|
|
73
|
-
ARK_ASYNC_METHOD_METADATA(stopPlayer, 0),
|
|
74
|
-
ARK_ASYNC_METHOD_METADATA(pausePlayer, 0),
|
|
75
|
-
ARK_ASYNC_METHOD_METADATA(seekToPlayer, 1),
|
|
76
|
-
ARK_ASYNC_METHOD_METADATA(setVolume, 1),
|
|
77
|
-
ARK_ASYNC_METHOD_METADATA(setPlaybackSpeed, 1),
|
|
78
|
-
ARK_ASYNC_METHOD_METADATA(setSubscriptionDuration, 1),
|
|
79
|
-
};
|
|
80
|
-
methodMap_["addRecordBackListener"] =
|
|
81
|
-
MethodMetadata{1, __hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addRecordBackListener};
|
|
82
|
-
methodMap_["removeRecordBackListener"] =
|
|
83
|
-
MethodMetadata{0, __hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeRecordBackListener};
|
|
84
|
-
methodMap_["addPlayBackListener"] =
|
|
85
|
-
MethodMetadata{1, __hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addPlayBackListener};
|
|
86
|
-
methodMap_["removePlayBackListener"] =
|
|
87
|
-
MethodMetadata{0, __hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removePlayBackListener};
|
|
88
|
-
methodMap_["addListener"] = MethodMetadata{1, _hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addListener};
|
|
89
|
-
methodMap_["removeListeners"] =
|
|
90
|
-
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
|
+
return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "addRecordBackListener", args, count);
|
|
33
|
+
}
|
|
34
|
+
static jsi::Value __hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeRecordBackListener(
|
|
35
|
+
jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count) {
|
|
36
|
+
return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "removeRecordBackListener", args, count);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static jsi::Value __hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addPlayBackListener(
|
|
40
|
+
jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count) {
|
|
41
|
+
return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "addPlayBackListener", args, count);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static jsi::Value __hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removePlayBackListener(
|
|
45
|
+
jsi::Runtime &rt, react::TurboModule &turboModule, const jsi::Value *args, size_t count) {
|
|
46
|
+
return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "removePlayBackListener", args, count);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static jsi::Value _hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addListener(jsi::Runtime &rt,
|
|
50
|
+
react::TurboModule &turboModule,
|
|
51
|
+
const jsi::Value *args,
|
|
52
|
+
size_t count) {
|
|
53
|
+
return jsi::Value(static_cast<ArkTSTurboModule &>(turboModule).call(rt, "addListener", args, count));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static jsi::Value _hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeListeners(jsi::Runtime &rt,
|
|
57
|
+
react::TurboModule &turboModule,
|
|
58
|
+
const jsi::Value *args,
|
|
59
|
+
size_t count) {
|
|
60
|
+
return jsi::Value(static_cast<ArkTSTurboModule &>(turboModule).call(rt, "removeListeners", args, count));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
RNAudioRecorderPlayerTurboModuleSpecJSI::RNAudioRecorderPlayerTurboModuleSpecJSI(const ArkTSTurboModule::Context ctx,
|
|
64
|
+
const std::string name)
|
|
65
|
+
: ArkTSTurboModule(ctx, name) {
|
|
66
|
+
methodMap_ = {
|
|
67
|
+
ARK_ASYNC_METHOD_METADATA(startRecorder, 3),
|
|
68
|
+
ARK_ASYNC_METHOD_METADATA(pauseRecorder, 0),
|
|
69
|
+
ARK_ASYNC_METHOD_METADATA(resumeRecorder, 0),
|
|
70
|
+
ARK_ASYNC_METHOD_METADATA(stopRecorder, 0),
|
|
71
|
+
ARK_ASYNC_METHOD_METADATA(resumePlayer, 0),
|
|
72
|
+
ARK_ASYNC_METHOD_METADATA(startPlayer, 2),
|
|
73
|
+
ARK_ASYNC_METHOD_METADATA(stopPlayer, 0),
|
|
74
|
+
ARK_ASYNC_METHOD_METADATA(pausePlayer, 0),
|
|
75
|
+
ARK_ASYNC_METHOD_METADATA(seekToPlayer, 1),
|
|
76
|
+
ARK_ASYNC_METHOD_METADATA(setVolume, 1),
|
|
77
|
+
ARK_ASYNC_METHOD_METADATA(setPlaybackSpeed, 1),
|
|
78
|
+
ARK_ASYNC_METHOD_METADATA(setSubscriptionDuration, 1),
|
|
79
|
+
};
|
|
80
|
+
methodMap_["addRecordBackListener"] =
|
|
81
|
+
MethodMetadata{1, __hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addRecordBackListener};
|
|
82
|
+
methodMap_["removeRecordBackListener"] =
|
|
83
|
+
MethodMetadata{0, __hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeRecordBackListener};
|
|
84
|
+
methodMap_["addPlayBackListener"] =
|
|
85
|
+
MethodMetadata{1, __hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addPlayBackListener};
|
|
86
|
+
methodMap_["removePlayBackListener"] =
|
|
87
|
+
MethodMetadata{0, __hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removePlayBackListener};
|
|
88
|
+
methodMap_["addListener"] = MethodMetadata{1, _hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_addListener};
|
|
89
|
+
methodMap_["removeListeners"] =
|
|
90
|
+
MethodMetadata{1, _hostFunction_RNAudioRecorderPlayerTurboModuleSpecJSI_removeListeners};
|
|
91
91
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
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
|
-
|
|
26
|
-
#include <ReactCommon/TurboModule.h>
|
|
27
|
-
#include "RNOH/ArkTSTurboModule.h"
|
|
28
|
-
|
|
29
|
-
namespace rnoh {
|
|
30
|
-
|
|
31
|
-
class JSI_EXPORT RNAudioRecorderPlayerTurboModuleSpecJSI : public ArkTSTurboModule {
|
|
32
|
-
public:
|
|
33
|
-
RNAudioRecorderPlayerTurboModuleSpecJSI(const ArkTSTurboModule::Context ctx, const std::string name);
|
|
34
|
-
};
|
|
35
|
-
|
|
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
|
+
|
|
26
|
+
#include <ReactCommon/TurboModule.h>
|
|
27
|
+
#include "RNOH/ArkTSTurboModule.h"
|
|
28
|
+
|
|
29
|
+
namespace rnoh {
|
|
30
|
+
|
|
31
|
+
class JSI_EXPORT RNAudioRecorderPlayerTurboModuleSpecJSI : public ArkTSTurboModule {
|
|
32
|
+
public:
|
|
33
|
+
RNAudioRecorderPlayerTurboModuleSpecJSI(const ArkTSTurboModule::Context ctx, const std::string name);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
36
|
} // namespace rnoh
|