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

66 lines
2.0 KiB
C++
Generated

///
/// JTtsProgress.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 "TtsProgress.hpp"
#include <string>
namespace margelo::nitro::nitrotts {
using namespace facebook;
/**
* The C++ JNI bridge between the C++ struct "TtsProgress" and the Kotlin data class "TtsProgress".
*/
struct JTtsProgress final: public jni::JavaClass<JTtsProgress> {
public:
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrotts/TtsProgress;";
public:
/**
* Convert this Java/Kotlin-based struct to the C++ struct TtsProgress by copying all values to C++.
*/
[[maybe_unused]]
[[nodiscard]]
TtsProgress toCpp() const {
static const auto clazz = javaClassStatic();
static const auto fieldIndex = clazz->getField<double>("index");
double index = this->getFieldValue(fieldIndex);
static const auto fieldTotal = clazz->getField<double>("total");
double total = this->getFieldValue(fieldTotal);
static const auto fieldParagraphId = clazz->getField<jni::JString>("paragraphId");
jni::local_ref<jni::JString> paragraphId = this->getFieldValue(fieldParagraphId);
return TtsProgress(
index,
total,
paragraphId->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<JTtsProgress::javaobject> fromCpp(const TtsProgress& value) {
using JSignature = JTtsProgress(double, double, jni::alias_ref<jni::JString>);
static const auto clazz = javaClassStatic();
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
return create(
clazz,
value.index,
value.total,
jni::make_jstring(value.paragraphId)
);
}
};
} // namespace margelo::nitro::nitrotts