react-native-audio-concat 0.2.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AudioConcat.podspec +2 -21
- package/README.md +3 -7
- package/android/build.gradle +2 -54
- package/android/src/main/java/com/audioconcat/AudioConcatModule.kt +1178 -0
- package/android/src/main/java/com/audioconcat/AudioConcatPackage.kt +33 -0
- package/ios/AudioConcat.h +5 -0
- package/ios/AudioConcat.mm +104 -0
- package/lib/module/NativeAudioConcat.js +5 -0
- package/lib/module/NativeAudioConcat.js.map +1 -0
- package/lib/module/index.js +2 -28
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NativeAudioConcat.d.ts +12 -0
- package/lib/typescript/src/NativeAudioConcat.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -27
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +14 -18
- package/src/NativeAudioConcat.ts +12 -0
- package/src/index.tsx +4 -32
- package/android/CMakeLists.txt +0 -24
- package/android/src/main/cpp/cpp-adapter.cpp +0 -6
- package/android/src/main/java/com/margelo/nitro/audioconcat/AudioConcat.kt +0 -349
- package/android/src/main/java/com/margelo/nitro/audioconcat/AudioConcatPackage.kt +0 -22
- package/ios/AudioConcat.swift +0 -75
- package/lib/module/AudioConcat.nitro.js +0 -4
- package/lib/module/AudioConcat.nitro.js.map +0 -1
- package/lib/typescript/src/AudioConcat.nitro.d.ts +0 -16
- package/lib/typescript/src/AudioConcat.nitro.d.ts.map +0 -1
- package/nitro.json +0 -17
- package/nitrogen/generated/android/audioconcat+autolinking.cmake +0 -82
- package/nitrogen/generated/android/audioconcat+autolinking.gradle +0 -27
- package/nitrogen/generated/android/audioconcatOnLoad.cpp +0 -44
- package/nitrogen/generated/android/audioconcatOnLoad.hpp +0 -25
- package/nitrogen/generated/android/c++/JAudioData.hpp +0 -53
- package/nitrogen/generated/android/c++/JAudioDataOrSilence.cpp +0 -26
- package/nitrogen/generated/android/c++/JAudioDataOrSilence.hpp +0 -72
- package/nitrogen/generated/android/c++/JHybridAudioConcatSpec.cpp +0 -77
- package/nitrogen/generated/android/c++/JHybridAudioConcatSpec.hpp +0 -64
- package/nitrogen/generated/android/c++/JSilentData.hpp +0 -53
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audioconcat/AudioData.kt +0 -29
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audioconcat/AudioDataOrSilence.kt +0 -42
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audioconcat/HybridAudioConcatSpec.kt +0 -52
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audioconcat/SilentData.kt +0 -29
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audioconcat/audioconcatOnLoad.kt +0 -35
- package/nitrogen/generated/ios/AudioConcat+autolinking.rb +0 -60
- package/nitrogen/generated/ios/AudioConcat-Swift-Cxx-Bridge.cpp +0 -48
- package/nitrogen/generated/ios/AudioConcat-Swift-Cxx-Bridge.hpp +0 -160
- package/nitrogen/generated/ios/AudioConcat-Swift-Cxx-Umbrella.hpp +0 -53
- package/nitrogen/generated/ios/AudioConcatAutolinking.mm +0 -33
- package/nitrogen/generated/ios/AudioConcatAutolinking.swift +0 -25
- package/nitrogen/generated/ios/c++/HybridAudioConcatSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridAudioConcatSpecSwift.hpp +0 -81
- package/nitrogen/generated/ios/swift/AudioData.swift +0 -35
- package/nitrogen/generated/ios/swift/AudioDataOrSilence.swift +0 -18
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +0 -47
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +0 -47
- package/nitrogen/generated/ios/swift/HybridAudioConcatSpec.swift +0 -49
- package/nitrogen/generated/ios/swift/HybridAudioConcatSpec_cxx.swift +0 -142
- package/nitrogen/generated/ios/swift/SilentData.swift +0 -35
- package/nitrogen/generated/shared/c++/AudioData.hpp +0 -67
- package/nitrogen/generated/shared/c++/HybridAudioConcatSpec.cpp +0 -21
- package/nitrogen/generated/shared/c++/HybridAudioConcatSpec.hpp +0 -70
- package/nitrogen/generated/shared/c++/SilentData.hpp +0 -67
- package/src/AudioConcat.nitro.ts +0 -19
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// AudioConcat-Swift-Cxx-Bridge.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
// Forward declarations of C++ defined types
|
|
11
|
-
// Forward declaration of `AudioData` to properly resolve imports.
|
|
12
|
-
namespace margelo::nitro::audioconcat { struct AudioData; }
|
|
13
|
-
// Forward declaration of `HybridAudioConcatSpec` to properly resolve imports.
|
|
14
|
-
namespace margelo::nitro::audioconcat { class HybridAudioConcatSpec; }
|
|
15
|
-
// Forward declaration of `SilentData` to properly resolve imports.
|
|
16
|
-
namespace margelo::nitro::audioconcat { struct SilentData; }
|
|
17
|
-
|
|
18
|
-
// Forward declarations of Swift defined types
|
|
19
|
-
// Forward declaration of `HybridAudioConcatSpec_cxx` to properly resolve imports.
|
|
20
|
-
namespace AudioConcat { class HybridAudioConcatSpec_cxx; }
|
|
21
|
-
|
|
22
|
-
// Include C++ defined types
|
|
23
|
-
#include "AudioData.hpp"
|
|
24
|
-
#include "HybridAudioConcatSpec.hpp"
|
|
25
|
-
#include "SilentData.hpp"
|
|
26
|
-
#include <NitroModules/FastVectorCopy.hpp>
|
|
27
|
-
#include <NitroModules/Promise.hpp>
|
|
28
|
-
#include <NitroModules/PromiseHolder.hpp>
|
|
29
|
-
#include <NitroModules/Result.hpp>
|
|
30
|
-
#include <exception>
|
|
31
|
-
#include <functional>
|
|
32
|
-
#include <memory>
|
|
33
|
-
#include <string>
|
|
34
|
-
#include <variant>
|
|
35
|
-
#include <vector>
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
39
|
-
* as well as helper functions to interact with those C++ types from Swift.
|
|
40
|
-
*/
|
|
41
|
-
namespace margelo::nitro::audioconcat::bridge::swift {
|
|
42
|
-
|
|
43
|
-
// pragma MARK: std::shared_ptr<Promise<std::string>>
|
|
44
|
-
/**
|
|
45
|
-
* Specialized version of `std::shared_ptr<Promise<std::string>>`.
|
|
46
|
-
*/
|
|
47
|
-
using std__shared_ptr_Promise_std__string__ = std::shared_ptr<Promise<std::string>>;
|
|
48
|
-
inline std::shared_ptr<Promise<std::string>> create_std__shared_ptr_Promise_std__string__() noexcept {
|
|
49
|
-
return Promise<std::string>::create();
|
|
50
|
-
}
|
|
51
|
-
inline PromiseHolder<std::string> wrap_std__shared_ptr_Promise_std__string__(std::shared_ptr<Promise<std::string>> promise) noexcept {
|
|
52
|
-
return PromiseHolder<std::string>(std::move(promise));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// pragma MARK: std::function<void(const std::string& /* result */)>
|
|
56
|
-
/**
|
|
57
|
-
* Specialized version of `std::function<void(const std::string&)>`.
|
|
58
|
-
*/
|
|
59
|
-
using Func_void_std__string = std::function<void(const std::string& /* result */)>;
|
|
60
|
-
/**
|
|
61
|
-
* Wrapper class for a `std::function<void(const std::string& / * result * /)>`, this can be used from Swift.
|
|
62
|
-
*/
|
|
63
|
-
class Func_void_std__string_Wrapper final {
|
|
64
|
-
public:
|
|
65
|
-
explicit Func_void_std__string_Wrapper(std::function<void(const std::string& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::string& /* result */)>>(std::move(func))) {}
|
|
66
|
-
inline void call(std::string result) const noexcept {
|
|
67
|
-
_function->operator()(result);
|
|
68
|
-
}
|
|
69
|
-
private:
|
|
70
|
-
std::unique_ptr<std::function<void(const std::string& /* result */)>> _function;
|
|
71
|
-
} SWIFT_NONCOPYABLE;
|
|
72
|
-
Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
73
|
-
inline Func_void_std__string_Wrapper wrap_Func_void_std__string(Func_void_std__string value) noexcept {
|
|
74
|
-
return Func_void_std__string_Wrapper(std::move(value));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
78
|
-
/**
|
|
79
|
-
* Specialized version of `std::function<void(const std::exception_ptr&)>`.
|
|
80
|
-
*/
|
|
81
|
-
using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
|
|
82
|
-
/**
|
|
83
|
-
* Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
|
|
84
|
-
*/
|
|
85
|
-
class Func_void_std__exception_ptr_Wrapper final {
|
|
86
|
-
public:
|
|
87
|
-
explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
|
|
88
|
-
inline void call(std::exception_ptr error) const noexcept {
|
|
89
|
-
_function->operator()(error);
|
|
90
|
-
}
|
|
91
|
-
private:
|
|
92
|
-
std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
|
|
93
|
-
} SWIFT_NONCOPYABLE;
|
|
94
|
-
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
95
|
-
inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
|
|
96
|
-
return Func_void_std__exception_ptr_Wrapper(std::move(value));
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// pragma MARK: std::variant<AudioData, SilentData>
|
|
100
|
-
/**
|
|
101
|
-
* Wrapper struct for `std::variant<AudioData, SilentData>`.
|
|
102
|
-
* std::variant cannot be used in Swift because of a Swift bug.
|
|
103
|
-
* Not even specializing it works. So we create a wrapper struct.
|
|
104
|
-
*/
|
|
105
|
-
struct std__variant_AudioData__SilentData_ {
|
|
106
|
-
std::variant<AudioData, SilentData> variant;
|
|
107
|
-
std__variant_AudioData__SilentData_(std::variant<AudioData, SilentData> variant): variant(variant) { }
|
|
108
|
-
operator std::variant<AudioData, SilentData>() const noexcept {
|
|
109
|
-
return variant;
|
|
110
|
-
}
|
|
111
|
-
inline size_t index() const noexcept {
|
|
112
|
-
return variant.index();
|
|
113
|
-
}
|
|
114
|
-
inline AudioData get_0() const noexcept {
|
|
115
|
-
return std::get<0>(variant);
|
|
116
|
-
}
|
|
117
|
-
inline SilentData get_1() const noexcept {
|
|
118
|
-
return std::get<1>(variant);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
inline std__variant_AudioData__SilentData_ create_std__variant_AudioData__SilentData_(const AudioData& value) noexcept {
|
|
122
|
-
return std__variant_AudioData__SilentData_(value);
|
|
123
|
-
}
|
|
124
|
-
inline std__variant_AudioData__SilentData_ create_std__variant_AudioData__SilentData_(const SilentData& value) noexcept {
|
|
125
|
-
return std__variant_AudioData__SilentData_(value);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// pragma MARK: std::vector<std::variant<AudioData, SilentData>>
|
|
129
|
-
/**
|
|
130
|
-
* Specialized version of `std::vector<std::variant<AudioData, SilentData>>`.
|
|
131
|
-
*/
|
|
132
|
-
using std__vector_std__variant_AudioData__SilentData__ = std::vector<std::variant<AudioData, SilentData>>;
|
|
133
|
-
inline std::vector<std::variant<AudioData, SilentData>> create_std__vector_std__variant_AudioData__SilentData__(size_t size) noexcept {
|
|
134
|
-
std::vector<std::variant<AudioData, SilentData>> vector;
|
|
135
|
-
vector.reserve(size);
|
|
136
|
-
return vector;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// pragma MARK: std::shared_ptr<HybridAudioConcatSpec>
|
|
140
|
-
/**
|
|
141
|
-
* Specialized version of `std::shared_ptr<HybridAudioConcatSpec>`.
|
|
142
|
-
*/
|
|
143
|
-
using std__shared_ptr_HybridAudioConcatSpec_ = std::shared_ptr<HybridAudioConcatSpec>;
|
|
144
|
-
std::shared_ptr<HybridAudioConcatSpec> create_std__shared_ptr_HybridAudioConcatSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
145
|
-
void* NON_NULL get_std__shared_ptr_HybridAudioConcatSpec_(std__shared_ptr_HybridAudioConcatSpec_ cppType) noexcept;
|
|
146
|
-
|
|
147
|
-
// pragma MARK: std::weak_ptr<HybridAudioConcatSpec>
|
|
148
|
-
using std__weak_ptr_HybridAudioConcatSpec_ = std::weak_ptr<HybridAudioConcatSpec>;
|
|
149
|
-
inline std__weak_ptr_HybridAudioConcatSpec_ weakify_std__shared_ptr_HybridAudioConcatSpec_(const std::shared_ptr<HybridAudioConcatSpec>& strong) noexcept { return strong; }
|
|
150
|
-
|
|
151
|
-
// pragma MARK: Result<std::shared_ptr<Promise<std::string>>>
|
|
152
|
-
using Result_std__shared_ptr_Promise_std__string___ = Result<std::shared_ptr<Promise<std::string>>>;
|
|
153
|
-
inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::shared_ptr<Promise<std::string>>& value) noexcept {
|
|
154
|
-
return Result<std::shared_ptr<Promise<std::string>>>::withValue(value);
|
|
155
|
-
}
|
|
156
|
-
inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::exception_ptr& error) noexcept {
|
|
157
|
-
return Result<std::shared_ptr<Promise<std::string>>>::withError(error);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
} // namespace margelo::nitro::audioconcat::bridge::swift
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// AudioConcat-Swift-Cxx-Umbrella.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
// Forward declarations of C++ defined types
|
|
11
|
-
// Forward declaration of `AudioData` to properly resolve imports.
|
|
12
|
-
namespace margelo::nitro::audioconcat { struct AudioData; }
|
|
13
|
-
// Forward declaration of `HybridAudioConcatSpec` to properly resolve imports.
|
|
14
|
-
namespace margelo::nitro::audioconcat { class HybridAudioConcatSpec; }
|
|
15
|
-
// Forward declaration of `SilentData` to properly resolve imports.
|
|
16
|
-
namespace margelo::nitro::audioconcat { struct SilentData; }
|
|
17
|
-
|
|
18
|
-
// Include C++ defined types
|
|
19
|
-
#include "AudioData.hpp"
|
|
20
|
-
#include "HybridAudioConcatSpec.hpp"
|
|
21
|
-
#include "SilentData.hpp"
|
|
22
|
-
#include <NitroModules/Promise.hpp>
|
|
23
|
-
#include <NitroModules/Result.hpp>
|
|
24
|
-
#include <exception>
|
|
25
|
-
#include <memory>
|
|
26
|
-
#include <string>
|
|
27
|
-
#include <variant>
|
|
28
|
-
#include <vector>
|
|
29
|
-
|
|
30
|
-
// C++ helpers for Swift
|
|
31
|
-
#include "AudioConcat-Swift-Cxx-Bridge.hpp"
|
|
32
|
-
|
|
33
|
-
// Common C++ types used in Swift
|
|
34
|
-
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
35
|
-
#include <NitroModules/AnyMapUtils.hpp>
|
|
36
|
-
#include <NitroModules/RuntimeError.hpp>
|
|
37
|
-
#include <NitroModules/DateToChronoDate.hpp>
|
|
38
|
-
|
|
39
|
-
// Forward declarations of Swift defined types
|
|
40
|
-
// Forward declaration of `HybridAudioConcatSpec_cxx` to properly resolve imports.
|
|
41
|
-
namespace AudioConcat { class HybridAudioConcatSpec_cxx; }
|
|
42
|
-
|
|
43
|
-
// Include Swift defined types
|
|
44
|
-
#if __has_include("AudioConcat-Swift.h")
|
|
45
|
-
// This header is generated by Xcode/Swift on every app build.
|
|
46
|
-
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "AudioConcat".
|
|
47
|
-
#include "AudioConcat-Swift.h"
|
|
48
|
-
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
49
|
-
#elif __has_include(<AudioConcat/AudioConcat-Swift.h>)
|
|
50
|
-
#include <AudioConcat/AudioConcat-Swift.h>
|
|
51
|
-
#else
|
|
52
|
-
#error AudioConcat's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "AudioConcat", and try building the app first.
|
|
53
|
-
#endif
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// AudioConcatAutolinking.mm
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
-
#import "AudioConcat-Swift-Cxx-Umbrella.hpp"
|
|
11
|
-
#import <type_traits>
|
|
12
|
-
|
|
13
|
-
#include "HybridAudioConcatSpecSwift.hpp"
|
|
14
|
-
|
|
15
|
-
@interface AudioConcatAutolinking : NSObject
|
|
16
|
-
@end
|
|
17
|
-
|
|
18
|
-
@implementation AudioConcatAutolinking
|
|
19
|
-
|
|
20
|
-
+ (void) load {
|
|
21
|
-
using namespace margelo::nitro;
|
|
22
|
-
using namespace margelo::nitro::audioconcat;
|
|
23
|
-
|
|
24
|
-
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
25
|
-
"AudioConcat",
|
|
26
|
-
[]() -> std::shared_ptr<HybridObject> {
|
|
27
|
-
std::shared_ptr<HybridAudioConcatSpec> hybridObject = AudioConcat::AudioConcatAutolinking::createAudioConcat();
|
|
28
|
-
return hybridObject;
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@end
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// AudioConcatAutolinking.swift
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
public final class AudioConcatAutolinking {
|
|
9
|
-
public typealias bridge = margelo.nitro.audioconcat.bridge.swift
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Creates an instance of a Swift class that implements `HybridAudioConcatSpec`,
|
|
13
|
-
* and wraps it in a Swift class that can directly interop with C++ (`HybridAudioConcatSpec_cxx`)
|
|
14
|
-
*
|
|
15
|
-
* This is generated by Nitrogen and will initialize the class specified
|
|
16
|
-
* in the `"autolinking"` property of `nitro.json` (in this case, `AudioConcat`).
|
|
17
|
-
*/
|
|
18
|
-
public static func createAudioConcat() -> bridge.std__shared_ptr_HybridAudioConcatSpec_ {
|
|
19
|
-
let hybridObject = AudioConcat()
|
|
20
|
-
return { () -> bridge.std__shared_ptr_HybridAudioConcatSpec_ in
|
|
21
|
-
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
22
|
-
return __cxxWrapped.getCxxPart()
|
|
23
|
-
}()
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridAudioConcatSpecSwift.cpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#include "HybridAudioConcatSpecSwift.hpp"
|
|
9
|
-
|
|
10
|
-
namespace margelo::nitro::audioconcat {
|
|
11
|
-
} // namespace margelo::nitro::audioconcat
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridAudioConcatSpecSwift.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#include "HybridAudioConcatSpec.hpp"
|
|
11
|
-
|
|
12
|
-
// Forward declaration of `HybridAudioConcatSpec_cxx` to properly resolve imports.
|
|
13
|
-
namespace AudioConcat { class HybridAudioConcatSpec_cxx; }
|
|
14
|
-
|
|
15
|
-
// Forward declaration of `AudioData` to properly resolve imports.
|
|
16
|
-
namespace margelo::nitro::audioconcat { struct AudioData; }
|
|
17
|
-
// Forward declaration of `SilentData` to properly resolve imports.
|
|
18
|
-
namespace margelo::nitro::audioconcat { struct SilentData; }
|
|
19
|
-
|
|
20
|
-
#include <string>
|
|
21
|
-
#include <NitroModules/Promise.hpp>
|
|
22
|
-
#include "AudioData.hpp"
|
|
23
|
-
#include "SilentData.hpp"
|
|
24
|
-
#include <variant>
|
|
25
|
-
#include <vector>
|
|
26
|
-
|
|
27
|
-
#include "AudioConcat-Swift-Cxx-Umbrella.hpp"
|
|
28
|
-
|
|
29
|
-
namespace margelo::nitro::audioconcat {
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* The C++ part of HybridAudioConcatSpec_cxx.swift.
|
|
33
|
-
*
|
|
34
|
-
* HybridAudioConcatSpecSwift (C++) accesses HybridAudioConcatSpec_cxx (Swift), and might
|
|
35
|
-
* contain some additional bridging code for C++ <> Swift interop.
|
|
36
|
-
*
|
|
37
|
-
* Since this obviously introduces an overhead, I hope at some point in
|
|
38
|
-
* the future, HybridAudioConcatSpec_cxx can directly inherit from the C++ class HybridAudioConcatSpec
|
|
39
|
-
* to simplify the whole structure and memory management.
|
|
40
|
-
*/
|
|
41
|
-
class HybridAudioConcatSpecSwift: public virtual HybridAudioConcatSpec {
|
|
42
|
-
public:
|
|
43
|
-
// Constructor from a Swift instance
|
|
44
|
-
explicit HybridAudioConcatSpecSwift(const AudioConcat::HybridAudioConcatSpec_cxx& swiftPart):
|
|
45
|
-
HybridObject(HybridAudioConcatSpec::TAG),
|
|
46
|
-
_swiftPart(swiftPart) { }
|
|
47
|
-
|
|
48
|
-
public:
|
|
49
|
-
// Get the Swift part
|
|
50
|
-
inline AudioConcat::HybridAudioConcatSpec_cxx& getSwiftPart() noexcept {
|
|
51
|
-
return _swiftPart;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public:
|
|
55
|
-
inline size_t getExternalMemorySize() noexcept override {
|
|
56
|
-
return _swiftPart.getMemorySize();
|
|
57
|
-
}
|
|
58
|
-
void dispose() noexcept override {
|
|
59
|
-
_swiftPart.dispose();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
public:
|
|
63
|
-
// Properties
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
public:
|
|
67
|
-
// Methods
|
|
68
|
-
inline std::shared_ptr<Promise<std::string>> concatAudioFiles(const std::vector<std::variant<AudioData, SilentData>>& data, const std::string& outputPath) override {
|
|
69
|
-
auto __result = _swiftPart.concatAudioFiles(data, outputPath);
|
|
70
|
-
if (__result.hasError()) [[unlikely]] {
|
|
71
|
-
std::rethrow_exception(__result.error());
|
|
72
|
-
}
|
|
73
|
-
auto __value = std::move(__result.value());
|
|
74
|
-
return __value;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
private:
|
|
78
|
-
AudioConcat::HybridAudioConcatSpec_cxx _swiftPart;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
} // namespace margelo::nitro::audioconcat
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// AudioData.swift
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
import NitroModules
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Represents an instance of `AudioData`, backed by a C++ struct.
|
|
12
|
-
*/
|
|
13
|
-
public typealias AudioData = margelo.nitro.audioconcat.AudioData
|
|
14
|
-
|
|
15
|
-
public extension AudioData {
|
|
16
|
-
private typealias bridge = margelo.nitro.audioconcat.bridge.swift
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Create a new instance of `AudioData`.
|
|
20
|
-
*/
|
|
21
|
-
init(filePath: String) {
|
|
22
|
-
self.init(std.string(filePath))
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
var filePath: String {
|
|
26
|
-
@inline(__always)
|
|
27
|
-
get {
|
|
28
|
-
return String(self.__filePath)
|
|
29
|
-
}
|
|
30
|
-
@inline(__always)
|
|
31
|
-
set {
|
|
32
|
-
self.__filePath = std.string(newValue)
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// AudioDataOrSilence.swift
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* An Swift enum with associated values representing a Variant/Union type.
|
|
12
|
-
* JS type: `struct | struct`
|
|
13
|
-
*/
|
|
14
|
-
@frozen
|
|
15
|
-
public indirect enum AudioDataOrSilence {
|
|
16
|
-
case first(AudioData)
|
|
17
|
-
case second(SilentData)
|
|
18
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// Func_void_std__exception_ptr.swift
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
import NitroModules
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Wraps a Swift `(_ error: Error) -> Void` as a class.
|
|
13
|
-
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
-
*/
|
|
15
|
-
public final class Func_void_std__exception_ptr {
|
|
16
|
-
public typealias bridge = margelo.nitro.audioconcat.bridge.swift
|
|
17
|
-
|
|
18
|
-
private let closure: (_ error: Error) -> Void
|
|
19
|
-
|
|
20
|
-
public init(_ closure: @escaping (_ error: Error) -> Void) {
|
|
21
|
-
self.closure = closure
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@inline(__always)
|
|
25
|
-
public func call(error: std.exception_ptr) -> Void {
|
|
26
|
-
self.closure(RuntimeError.from(cppError: error))
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
-
* This acquires one additional strong reference on the object!
|
|
32
|
-
*/
|
|
33
|
-
@inline(__always)
|
|
34
|
-
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
-
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Casts an unsafe pointer to a `Func_void_std__exception_ptr`.
|
|
40
|
-
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__exception_ptr>`.
|
|
41
|
-
* This removes one strong reference from the object!
|
|
42
|
-
*/
|
|
43
|
-
@inline(__always)
|
|
44
|
-
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr {
|
|
45
|
-
return Unmanaged<Func_void_std__exception_ptr>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// Func_void_std__string.swift
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
import NitroModules
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Wraps a Swift `(_ value: String) -> Void` as a class.
|
|
13
|
-
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
-
*/
|
|
15
|
-
public final class Func_void_std__string {
|
|
16
|
-
public typealias bridge = margelo.nitro.audioconcat.bridge.swift
|
|
17
|
-
|
|
18
|
-
private let closure: (_ value: String) -> Void
|
|
19
|
-
|
|
20
|
-
public init(_ closure: @escaping (_ value: String) -> Void) {
|
|
21
|
-
self.closure = closure
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@inline(__always)
|
|
25
|
-
public func call(value: std.string) -> Void {
|
|
26
|
-
self.closure(String(value))
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
-
* This acquires one additional strong reference on the object!
|
|
32
|
-
*/
|
|
33
|
-
@inline(__always)
|
|
34
|
-
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
-
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Casts an unsafe pointer to a `Func_void_std__string`.
|
|
40
|
-
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__string>`.
|
|
41
|
-
* This removes one strong reference from the object!
|
|
42
|
-
*/
|
|
43
|
-
@inline(__always)
|
|
44
|
-
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__string {
|
|
45
|
-
return Unmanaged<Func_void_std__string>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridAudioConcatSpec.swift
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
import Foundation
|
|
9
|
-
import NitroModules
|
|
10
|
-
|
|
11
|
-
/// See ``HybridAudioConcatSpec``
|
|
12
|
-
public protocol HybridAudioConcatSpec_protocol: HybridObject {
|
|
13
|
-
// Properties
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// Methods
|
|
17
|
-
func concatAudioFiles(data: [AudioDataOrSilence], outputPath: String) throws -> Promise<String>
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/// See ``HybridAudioConcatSpec``
|
|
21
|
-
open class HybridAudioConcatSpec_base {
|
|
22
|
-
private weak var cxxWrapper: HybridAudioConcatSpec_cxx? = nil
|
|
23
|
-
public init() { }
|
|
24
|
-
public func getCxxWrapper() -> HybridAudioConcatSpec_cxx {
|
|
25
|
-
#if DEBUG
|
|
26
|
-
guard self is HybridAudioConcatSpec else {
|
|
27
|
-
fatalError("`self` is not a `HybridAudioConcatSpec`! Did you accidentally inherit from `HybridAudioConcatSpec_base` instead of `HybridAudioConcatSpec`?")
|
|
28
|
-
}
|
|
29
|
-
#endif
|
|
30
|
-
if let cxxWrapper = self.cxxWrapper {
|
|
31
|
-
return cxxWrapper
|
|
32
|
-
} else {
|
|
33
|
-
let cxxWrapper = HybridAudioConcatSpec_cxx(self as! HybridAudioConcatSpec)
|
|
34
|
-
self.cxxWrapper = cxxWrapper
|
|
35
|
-
return cxxWrapper
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* A Swift base-protocol representing the AudioConcat HybridObject.
|
|
42
|
-
* Implement this protocol to create Swift-based instances of AudioConcat.
|
|
43
|
-
* ```swift
|
|
44
|
-
* class HybridAudioConcat : HybridAudioConcatSpec {
|
|
45
|
-
* // ...
|
|
46
|
-
* }
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
public typealias HybridAudioConcatSpec = HybridAudioConcatSpec_protocol & HybridAudioConcatSpec_base
|