/// /// JHybridOmniPlayerFactorySpec.cpp /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © Marc Rousavy @ Margelo /// #include "JHybridOmniPlayerFactorySpec.hpp" // Forward declaration of `HybridOmniPlayerSpec` to properly resolve imports. namespace margelo::nitro::omni { class HybridOmniPlayerSpec; } // Forward declaration of `Source` to properly resolve imports. namespace margelo::nitro::omni { struct Source; } // Forward declaration of `VideoSrc` to properly resolve imports. namespace margelo::nitro::omni { struct VideoSrc; } // Forward declaration of `Subtitle` to properly resolve imports. namespace margelo::nitro::omni { struct Subtitle; } // Forward declaration of `Metadata` to properly resolve imports. namespace margelo::nitro::omni { struct Metadata; } // Forward declaration of `MixAudioMode` to properly resolve imports. namespace margelo::nitro::omni { enum class MixAudioMode; } // Forward declaration of `PlayerBackend` to properly resolve imports. namespace margelo::nitro::omni { struct PlayerBackend; } // Forward declaration of `AndroidBackend` to properly resolve imports. namespace margelo::nitro::omni { enum class AndroidBackend; } // Forward declaration of `CastOptions` to properly resolve imports. namespace margelo::nitro::omni { struct CastOptions; } #include #include "HybridOmniPlayerSpec.hpp" #include "JHybridOmniPlayerSpec.hpp" #include "Source.hpp" #include #include "JSource.hpp" #include "VideoSrc.hpp" #include "JVideoSrc.hpp" #include #include #include "Subtitle.hpp" #include #include "JSubtitle.hpp" #include "Metadata.hpp" #include "JMetadata.hpp" #include "MixAudioMode.hpp" #include "JMixAudioMode.hpp" #include "PlayerBackend.hpp" #include "JPlayerBackend.hpp" #include "AndroidBackend.hpp" #include "JAndroidBackend.hpp" #include "CastOptions.hpp" #include "JCastOptions.hpp" namespace margelo::nitro::omni { std::shared_ptr JHybridOmniPlayerFactorySpec::JavaPart::getJHybridOmniPlayerFactorySpec() { auto hybridObject = JHybridObject::JavaPart::getJHybridObject(); auto castHybridObject = std::dynamic_pointer_cast(hybridObject); if (castHybridObject == nullptr) [[unlikely]] { throw std::runtime_error("Failed to downcast JHybridObject to JHybridOmniPlayerFactorySpec!"); } return castHybridObject; } jni::local_ref JHybridOmniPlayerFactorySpec::CxxPart::initHybrid(jni::alias_ref jThis) { return makeCxxInstance(jThis); } std::shared_ptr JHybridOmniPlayerFactorySpec::CxxPart::createHybridObject(const jni::local_ref& javaPart) { auto castJavaPart = jni::dynamic_ref_cast(javaPart); if (castJavaPart == nullptr) [[unlikely]] { throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridOmniPlayerFactorySpec::JavaPart!"); } return std::make_shared(castJavaPart); } void JHybridOmniPlayerFactorySpec::CxxPart::registerNatives() { registerHybrid({ makeNativeMethod("initHybrid", JHybridOmniPlayerFactorySpec::CxxPart::initHybrid), }); } // Properties // Methods std::shared_ptr JHybridOmniPlayerFactorySpec::createPlayer(const std::optional& props, const std::optional& backend, const std::optional& cast) { static const auto method = _javaPart->javaClassStatic()->getMethod(jni::alias_ref /* props */, jni::alias_ref /* backend */, jni::alias_ref /* cast */)>("createPlayer"); auto __result = method(_javaPart, props.has_value() ? JSource::fromCpp(props.value()) : nullptr, backend.has_value() ? JPlayerBackend::fromCpp(backend.value()) : nullptr, cast.has_value() ? JCastOptions::fromCpp(cast.value()) : nullptr); return __result->getJHybridOmniPlayerSpec(); } } // namespace margelo::nitro::omni