74808f086e
* feat: Replace Legacy Media Controls with Nitro-Powered Playback * feat: Add TTS Engine Selection * chore: Remove User-Facing Error Reporting * refactor: Combine `Tts` and `TtsSession` Imports from `nitro-tts` Module --------- Co-authored-by: Claude <noreply@anthropic.com>
65 lines
2.3 KiB
C++
Generated
65 lines
2.3 KiB
C++
Generated
///
|
|
/// NitroTtsOnLoad.cpp
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © Marc Rousavy @ Margelo
|
|
///
|
|
|
|
#ifndef BUILDING_NITROTTS_WITH_GENERATED_CMAKE_PROJECT
|
|
#error NitroTtsOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
|
|
#endif
|
|
|
|
#include "NitroTtsOnLoad.hpp"
|
|
|
|
#include <jni.h>
|
|
#include <fbjni/fbjni.h>
|
|
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
|
|
#include "JHybridTtsFactorySpec.hpp"
|
|
#include "JHybridTtsSessionSpec.hpp"
|
|
#include "JFunc_void.hpp"
|
|
#include "JFunc_void_TtsPlaybackState.hpp"
|
|
#include "JFunc_void_TtsProgress.hpp"
|
|
#include "JFunc_void_std__string.hpp"
|
|
#include <NitroModules/DefaultConstructableObject.hpp>
|
|
|
|
namespace margelo::nitro::nitrotts {
|
|
|
|
int initialize(JavaVM* vm) {
|
|
return facebook::jni::initialize(vm, []() {
|
|
::margelo::nitro::nitrotts::registerAllNatives();
|
|
});
|
|
}
|
|
|
|
struct JHybridTtsFactorySpecImpl: public jni::JavaClass<JHybridTtsFactorySpecImpl, JHybridTtsFactorySpec::JavaPart> {
|
|
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrotts/HybridTtsFactory;";
|
|
static std::shared_ptr<JHybridTtsFactorySpec> create() {
|
|
static const auto constructorFn = javaClassStatic()->getConstructor<JHybridTtsFactorySpecImpl::javaobject()>();
|
|
jni::local_ref<JHybridTtsFactorySpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
|
|
return javaPart->getJHybridTtsFactorySpec();
|
|
}
|
|
};
|
|
|
|
void registerAllNatives() {
|
|
using namespace margelo::nitro;
|
|
using namespace margelo::nitro::nitrotts;
|
|
|
|
// Register native JNI methods
|
|
margelo::nitro::nitrotts::JHybridTtsFactorySpec::CxxPart::registerNatives();
|
|
margelo::nitro::nitrotts::JHybridTtsSessionSpec::CxxPart::registerNatives();
|
|
margelo::nitro::nitrotts::JFunc_void_cxx::registerNatives();
|
|
margelo::nitro::nitrotts::JFunc_void_TtsPlaybackState_cxx::registerNatives();
|
|
margelo::nitro::nitrotts::JFunc_void_TtsProgress_cxx::registerNatives();
|
|
margelo::nitro::nitrotts::JFunc_void_std__string_cxx::registerNatives();
|
|
|
|
// Register Nitro Hybrid Objects
|
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
"TtsFactory",
|
|
[]() -> std::shared_ptr<HybridObject> {
|
|
return JHybridTtsFactorySpecImpl::create();
|
|
}
|
|
);
|
|
}
|
|
|
|
} // namespace margelo::nitro::nitrotts
|