mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-05 13:46:59 +00:00
110 lines
3.7 KiB
C++
Generated
110 lines
3.7 KiB
C++
Generated
///
|
|
/// HybridOmniPlayerSpec.hpp
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © Marc Rousavy @ Margelo
|
|
///
|
|
|
|
#pragma once
|
|
|
|
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
#include <NitroModules/HybridObject.hpp>
|
|
#else
|
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
#endif
|
|
|
|
// Forward declaration of `HybridOmniEventMapSpec` to properly resolve imports.
|
|
namespace margelo::nitro::omni { class HybridOmniEventMapSpec; }
|
|
// Forward declaration of `Source` to properly resolve imports.
|
|
namespace margelo::nitro::omni { struct Source; }
|
|
// Forward declaration of `Track` to properly resolve imports.
|
|
namespace margelo::nitro::omni { struct Track; }
|
|
// Forward declaration of `Rendition` to properly resolve imports.
|
|
namespace margelo::nitro::omni { struct Rendition; }
|
|
// Forward declaration of `PlayerStatus` to properly resolve imports.
|
|
namespace margelo::nitro::omni { enum class PlayerStatus; }
|
|
|
|
#include <memory>
|
|
#include "HybridOmniEventMapSpec.hpp"
|
|
#include "Source.hpp"
|
|
#include <optional>
|
|
#include "Track.hpp"
|
|
#include <vector>
|
|
#include "Rendition.hpp"
|
|
#include "PlayerStatus.hpp"
|
|
|
|
namespace margelo::nitro::omni {
|
|
|
|
using namespace margelo::nitro;
|
|
|
|
/**
|
|
* An abstract base class for `OmniPlayer`
|
|
* Inherit this class to create instances of `HybridOmniPlayerSpec` in C++.
|
|
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
* @example
|
|
* ```cpp
|
|
* class HybridOmniPlayer: public HybridOmniPlayerSpec {
|
|
* public:
|
|
* HybridOmniPlayer(...): HybridObject(TAG) { ... }
|
|
* // ...
|
|
* };
|
|
* ```
|
|
*/
|
|
class HybridOmniPlayerSpec: public virtual HybridObject {
|
|
public:
|
|
// Constructor
|
|
explicit HybridOmniPlayerSpec(): HybridObject(TAG) { }
|
|
|
|
// Destructor
|
|
~HybridOmniPlayerSpec() override = default;
|
|
|
|
public:
|
|
// Properties
|
|
virtual std::shared_ptr<HybridOmniEventMapSpec> getEventMap() = 0;
|
|
virtual Source getSource() = 0;
|
|
virtual void setSource(const Source& source) = 0;
|
|
virtual std::optional<bool> getShowNotification() = 0;
|
|
virtual void setShowNotification(std::optional<bool> showNotification) = 0;
|
|
virtual bool getHasPrev() = 0;
|
|
virtual bool getHasNext() = 0;
|
|
virtual std::vector<Track> getVideos() = 0;
|
|
virtual std::vector<Track> getAudios() = 0;
|
|
virtual std::vector<Track> getSubtitles() = 0;
|
|
virtual std::vector<Rendition> getRendition() = 0;
|
|
virtual PlayerStatus getStatus() = 0;
|
|
virtual bool getIsPlaying() = 0;
|
|
virtual double getCurrentTime() = 0;
|
|
virtual void setCurrentTime(double currentTime) = 0;
|
|
virtual double getBuffered() = 0;
|
|
virtual double getDuration() = 0;
|
|
virtual double getPlaybackRate() = 0;
|
|
virtual void setPlaybackRate(double playbackRate) = 0;
|
|
virtual double getVolume() = 0;
|
|
virtual void setVolume(double volume) = 0;
|
|
virtual bool getMuted() = 0;
|
|
virtual void setMuted(bool muted) = 0;
|
|
virtual bool getIsAutoQuality() = 0;
|
|
|
|
public:
|
|
// Methods
|
|
virtual void play() = 0;
|
|
virtual void pause() = 0;
|
|
virtual void seekBy(double offset) = 0;
|
|
virtual void playPrev() = 0;
|
|
virtual void playNext() = 0;
|
|
virtual void selectVideo(const Track& video) = 0;
|
|
virtual void selectAudio(const Track& audio) = 0;
|
|
virtual void selectSubtitle(const std::optional<Track>& subtitle) = 0;
|
|
virtual void selectRendition(const std::optional<Rendition>& rendition) = 0;
|
|
|
|
protected:
|
|
// Hybrid Setup
|
|
void loadHybridMethods() override;
|
|
|
|
protected:
|
|
// Tag for logging
|
|
static constexpr auto TAG = "OmniPlayer";
|
|
};
|
|
|
|
} // namespace margelo::nitro::omni
|