mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-10-27 14:26:04 +03:00
66 lines
1.8 KiB
C++
66 lines
1.8 KiB
C++
#ifndef UI_C_SIMPLE_MOVIE_FRAME_HPP
|
|
#define UI_C_SIMPLE_MOVIE_FRAME_HPP
|
|
|
|
#include "ui/CSimpleFrame.hpp"
|
|
#include <tempest/Vector.hpp>
|
|
|
|
class CRect;
|
|
class CRenderBatch;
|
|
|
|
class CSimpleMovieFrame : public CSimpleFrame {
|
|
public:
|
|
// Static variables
|
|
static int32_t s_metatable;
|
|
static int32_t s_objectType;
|
|
|
|
// Static functions
|
|
static void CreateScriptMetaTable();
|
|
static int32_t GetObjectType();
|
|
static void RegisterScriptMethods(lua_State* L);
|
|
static void RenderMovie(void* param);
|
|
|
|
// Member variables
|
|
void* m_audioChannel = nullptr;
|
|
int32_t m_isPlaying = 0;
|
|
int32_t m_isInterrupted = 0;
|
|
int32_t m_enableSubtitles = 0;
|
|
char m_filename[256];
|
|
int32_t m_volume = 100;
|
|
ScriptIx m_onMovieFinished;
|
|
ScriptIx m_onMovieShowSubtitle;
|
|
ScriptIx m_onMovieHideSubtitle;
|
|
float m_frameRate = 0.0;
|
|
uint32_t m_videoWidth = 0;
|
|
uint32_t m_videoHeight = 0;
|
|
uint32_t m_numFrames = 0;
|
|
char* m_videoData = nullptr;
|
|
char* m_currentFrameData = nullptr;
|
|
uint32_t m_videoBytes = 0;
|
|
char* m_audioData = nullptr;
|
|
uint32_t m_audioBytes = 0;
|
|
uint64_t m_startTime = 0;
|
|
uint32_t m_prevFrame = 0;
|
|
uint32_t m_currentFrame = 0;
|
|
uint32_t m_frameAudioSync = 0;
|
|
uint32_t m_lastKeyFrame = 0;
|
|
uint64_t m_elapsedTime = 0;
|
|
|
|
// Virtual member functions
|
|
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
|
virtual bool IsA(int32_t type);
|
|
virtual int32_t GetScriptMetaTable();
|
|
virtual void OnFrameRender(CRenderBatch* batch, uint32_t layer);
|
|
|
|
// Member functions
|
|
CSimpleMovieFrame(CSimpleFrame* parent);
|
|
int32_t StartMovie(const char* filename, int32_t volume);
|
|
void StopMovie();
|
|
int32_t ParseAVIFile(const char* filename);
|
|
int32_t OpenVideo();
|
|
int32_t UpdateTiming();
|
|
int32_t DecodeFrame(bool unk);
|
|
void Render();
|
|
};
|
|
|
|
#endif
|