Files
2026-03-25 17:28:35 +01:00

249 lines
9.4 KiB
C++
Generated

///
/// HybridVideoPlayerSpecSwift.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///
#pragma once
#include "HybridVideoPlayerSpec.hpp"
// Forward declaration of `HybridVideoPlayerSpec_cxx` to properly resolve imports.
namespace ReactNativeVideo { class HybridVideoPlayerSpec_cxx; }
// Forward declaration of `HybridVideoPlayerSourceSpec` to properly resolve imports.
namespace margelo::nitro::video { class HybridVideoPlayerSourceSpec; }
// Forward declaration of `HybridVideoPlayerEventEmitterSpec` to properly resolve imports.
namespace margelo::nitro::video { class HybridVideoPlayerEventEmitterSpec; }
// Forward declaration of `VideoPlayerStatus` to properly resolve imports.
namespace margelo::nitro::video { enum class VideoPlayerStatus; }
// Forward declaration of `MixAudioMode` to properly resolve imports.
namespace margelo::nitro::video { enum class MixAudioMode; }
// Forward declaration of `IgnoreSilentSwitchMode` to properly resolve imports.
namespace margelo::nitro::video { enum class IgnoreSilentSwitchMode; }
// Forward declaration of `TextTrack` to properly resolve imports.
namespace margelo::nitro::video { struct TextTrack; }
#include <memory>
#include "HybridVideoPlayerSourceSpec.hpp"
#include "HybridVideoPlayerEventEmitterSpec.hpp"
#include "VideoPlayerStatus.hpp"
#include "MixAudioMode.hpp"
#include "IgnoreSilentSwitchMode.hpp"
#include "TextTrack.hpp"
#include <optional>
#include <string>
#include <NitroModules/Promise.hpp>
#include <NitroModules/Null.hpp>
#include <variant>
#include <vector>
#include "ReactNativeVideo-Swift-Cxx-Umbrella.hpp"
namespace margelo::nitro::video {
/**
* The C++ part of HybridVideoPlayerSpec_cxx.swift.
*
* HybridVideoPlayerSpecSwift (C++) accesses HybridVideoPlayerSpec_cxx (Swift), and might
* contain some additional bridging code for C++ <> Swift interop.
*
* Since this obviously introduces an overhead, I hope at some point in
* the future, HybridVideoPlayerSpec_cxx can directly inherit from the C++ class HybridVideoPlayerSpec
* to simplify the whole structure and memory management.
*/
class HybridVideoPlayerSpecSwift: public virtual HybridVideoPlayerSpec {
public:
// Constructor from a Swift instance
explicit HybridVideoPlayerSpecSwift(const ReactNativeVideo::HybridVideoPlayerSpec_cxx& swiftPart):
HybridObject(HybridVideoPlayerSpec::TAG),
_swiftPart(swiftPart) { }
public:
// Get the Swift part
inline ReactNativeVideo::HybridVideoPlayerSpec_cxx& getSwiftPart() noexcept {
return _swiftPart;
}
public:
inline size_t getExternalMemorySize() noexcept override {
return _swiftPart.getMemorySize();
}
bool equals(const std::shared_ptr<HybridObject>& other) override {
if (auto otherCast = std::dynamic_pointer_cast<HybridVideoPlayerSpecSwift>(other)) {
return _swiftPart.equals(otherCast->_swiftPart);
}
return false;
}
void dispose() noexcept override {
_swiftPart.dispose();
}
std::string toString() override {
return _swiftPart.toString();
}
public:
// Properties
inline std::shared_ptr<HybridVideoPlayerSourceSpec> getSource() noexcept override {
auto __result = _swiftPart.getSource();
return __result;
}
inline std::shared_ptr<HybridVideoPlayerEventEmitterSpec> getEventEmitter() noexcept override {
auto __result = _swiftPart.getEventEmitter();
return __result;
}
inline bool getShowNotificationControls() noexcept override {
return _swiftPart.getShowNotificationControls();
}
inline void setShowNotificationControls(bool showNotificationControls) noexcept override {
_swiftPart.setShowNotificationControls(std::forward<decltype(showNotificationControls)>(showNotificationControls));
}
inline VideoPlayerStatus getStatus() noexcept override {
auto __result = _swiftPart.getStatus();
return static_cast<VideoPlayerStatus>(__result);
}
inline double getDuration() noexcept override {
return _swiftPart.getDuration();
}
inline double getVolume() noexcept override {
return _swiftPart.getVolume();
}
inline void setVolume(double volume) noexcept override {
_swiftPart.setVolume(std::forward<decltype(volume)>(volume));
}
inline double getCurrentTime() noexcept override {
return _swiftPart.getCurrentTime();
}
inline void setCurrentTime(double currentTime) noexcept override {
_swiftPart.setCurrentTime(std::forward<decltype(currentTime)>(currentTime));
}
inline bool getMuted() noexcept override {
return _swiftPart.getMuted();
}
inline void setMuted(bool muted) noexcept override {
_swiftPart.setMuted(std::forward<decltype(muted)>(muted));
}
inline bool getLoop() noexcept override {
return _swiftPart.getLoop();
}
inline void setLoop(bool loop) noexcept override {
_swiftPart.setLoop(std::forward<decltype(loop)>(loop));
}
inline double getRate() noexcept override {
return _swiftPart.getRate();
}
inline void setRate(double rate) noexcept override {
_swiftPart.setRate(std::forward<decltype(rate)>(rate));
}
inline MixAudioMode getMixAudioMode() noexcept override {
auto __result = _swiftPart.getMixAudioMode();
return static_cast<MixAudioMode>(__result);
}
inline void setMixAudioMode(MixAudioMode mixAudioMode) noexcept override {
_swiftPart.setMixAudioMode(static_cast<int>(mixAudioMode));
}
inline IgnoreSilentSwitchMode getIgnoreSilentSwitchMode() noexcept override {
auto __result = _swiftPart.getIgnoreSilentSwitchMode();
return static_cast<IgnoreSilentSwitchMode>(__result);
}
inline void setIgnoreSilentSwitchMode(IgnoreSilentSwitchMode ignoreSilentSwitchMode) noexcept override {
_swiftPart.setIgnoreSilentSwitchMode(static_cast<int>(ignoreSilentSwitchMode));
}
inline bool getPlayInBackground() noexcept override {
return _swiftPart.getPlayInBackground();
}
inline void setPlayInBackground(bool playInBackground) noexcept override {
_swiftPart.setPlayInBackground(std::forward<decltype(playInBackground)>(playInBackground));
}
inline bool getPlayWhenInactive() noexcept override {
return _swiftPart.getPlayWhenInactive();
}
inline void setPlayWhenInactive(bool playWhenInactive) noexcept override {
_swiftPart.setPlayWhenInactive(std::forward<decltype(playWhenInactive)>(playWhenInactive));
}
inline bool getIsPlaying() noexcept override {
return _swiftPart.isPlaying();
}
inline std::optional<TextTrack> getSelectedTrack() noexcept override {
auto __result = _swiftPart.getSelectedTrack();
return __result;
}
public:
// Methods
inline std::shared_ptr<Promise<void>> replaceSourceAsync(const std::optional<std::variant<nitro::NullType, std::shared_ptr<HybridVideoPlayerSourceSpec>>>& source) override {
auto __result = _swiftPart.replaceSourceAsync(source);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline std::vector<TextTrack> getAvailableTextTracks() override {
auto __result = _swiftPart.getAvailableTextTracks();
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline void selectTextTrack(const std::optional<std::variant<nitro::NullType, TextTrack>>& textTrack) override {
auto __result = _swiftPart.selectTextTrack(textTrack);
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
}
inline void release() override {
auto __result = _swiftPart.release();
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
}
inline std::shared_ptr<Promise<void>> initialize() override {
auto __result = _swiftPart.initialize();
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline std::shared_ptr<Promise<void>> preload() override {
auto __result = _swiftPart.preload();
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
auto __value = std::move(__result.value());
return __value;
}
inline void play() override {
auto __result = _swiftPart.play();
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
}
inline void pause() override {
auto __result = _swiftPart.pause();
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
}
inline void seekBy(double time) override {
auto __result = _swiftPart.seekBy(std::forward<decltype(time)>(time));
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
}
inline void seekTo(double time) override {
auto __result = _swiftPart.seekTo(std::forward<decltype(time)>(time));
if (__result.hasError()) [[unlikely]] {
std::rethrow_exception(__result.error());
}
}
private:
ReactNativeVideo::HybridVideoPlayerSpec_cxx _swiftPart;
};
} // namespace margelo::nitro::video