Files
Rajarshee Chatterjee 74808f086e feat: Replace Legacy Media Controls with Nitro-Powered Playback (#1896)
* 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>
2026-07-24 23:42:17 +05:30

62 lines
1.9 KiB
C++
Generated

///
/// JTtsParagraph.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///
#pragma once
#include <fbjni/fbjni.h>
#include "TtsParagraph.hpp"
#include <string>
namespace margelo::nitro::nitrotts {
using namespace facebook;
/**
* The C++ JNI bridge between the C++ struct "TtsParagraph" and the Kotlin data class "TtsParagraph".
*/
struct JTtsParagraph final: public jni::JavaClass<JTtsParagraph> {
public:
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrotts/TtsParagraph;";
public:
/**
* Convert this Java/Kotlin-based struct to the C++ struct TtsParagraph by copying all values to C++.
*/
[[maybe_unused]]
[[nodiscard]]
TtsParagraph toCpp() const {
static const auto clazz = javaClassStatic();
static const auto fieldId = clazz->getField<jni::JString>("id");
jni::local_ref<jni::JString> id = this->getFieldValue(fieldId);
static const auto fieldText = clazz->getField<jni::JString>("text");
jni::local_ref<jni::JString> text = this->getFieldValue(fieldText);
return TtsParagraph(
id->toStdString(),
text->toStdString()
);
}
public:
/**
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
*/
[[maybe_unused]]
static jni::local_ref<JTtsParagraph::javaobject> fromCpp(const TtsParagraph& value) {
using JSignature = JTtsParagraph(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
static const auto clazz = javaClassStatic();
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
return create(
clazz,
jni::make_jstring(value.id),
jni::make_jstring(value.text)
);
}
};
} // namespace margelo::nitro::nitrotts