mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-06-10 22:13:19 +00:00
62 lines
1.8 KiB
C++
Generated
62 lines
1.8 KiB
C++
Generated
///
|
|
/// JonVolumeChangeData.hpp
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
///
|
|
|
|
#pragma once
|
|
|
|
#include <fbjni/fbjni.h>
|
|
#include "onVolumeChangeData.hpp"
|
|
|
|
|
|
|
|
namespace margelo::nitro::video {
|
|
|
|
using namespace facebook;
|
|
|
|
/**
|
|
* The C++ JNI bridge between the C++ struct "onVolumeChangeData" and the the Kotlin data class "onVolumeChangeData".
|
|
*/
|
|
struct JonVolumeChangeData final: public jni::JavaClass<JonVolumeChangeData> {
|
|
public:
|
|
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/video/onVolumeChangeData;";
|
|
|
|
public:
|
|
/**
|
|
* Convert this Java/Kotlin-based struct to the C++ struct onVolumeChangeData by copying all values to C++.
|
|
*/
|
|
[[maybe_unused]]
|
|
[[nodiscard]]
|
|
onVolumeChangeData toCpp() const {
|
|
static const auto clazz = javaClassStatic();
|
|
static const auto fieldVolume = clazz->getField<double>("volume");
|
|
double volume = this->getFieldValue(fieldVolume);
|
|
static const auto fieldMuted = clazz->getField<jboolean>("muted");
|
|
jboolean muted = this->getFieldValue(fieldMuted);
|
|
return onVolumeChangeData(
|
|
volume,
|
|
static_cast<bool>(muted)
|
|
);
|
|
}
|
|
|
|
public:
|
|
/**
|
|
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
*/
|
|
[[maybe_unused]]
|
|
static jni::local_ref<JonVolumeChangeData::javaobject> fromCpp(const onVolumeChangeData& value) {
|
|
using JSignature = JonVolumeChangeData(double, jboolean);
|
|
static const auto clazz = javaClassStatic();
|
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
return create(
|
|
clazz,
|
|
value.volume,
|
|
value.muted
|
|
);
|
|
}
|
|
};
|
|
|
|
} // namespace margelo::nitro::video
|