CommonLibVR
GFxMovie.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/G/GFxPlayerStats.h"
4 #include "RE/G/GRefCountBase.h"
5 
6 namespace RE
7 {
8  class GFxFunctionHandler;
9  class GFxMovieDef;
10  class GFxValue;
11 
12  class GFxMovie : public GRefCountBase<GFxMovie, GFxStatMovieViews::kGFxStatMV_Other_Mem>
13  {
14  public:
15  // PlayState describes the play state of the movie clip. When set on a Movie, affects only the root movie clip.
16  enum class PlayState
17  {
18  kPlaying, // The movie is playing
19  kStopped // The movie is stopped at its current clip. Child clips may still be playing
20  };
21 
22  // SetVarType describes the delayed assignment queuing behavior of SetVariable and SetVariableDouble functions; the use of this flag allows developers to control the type of effect the variable assignment will have on target objects that have not yet been created at the time of SetVariable call
23  enum class SetVarType
24  {
25  kNormal, // Sets variable only if target movie clip containing the variable is found
26  kSticky, // Sets variable if target clip is found, otherwise queues a set until the clip is created at path. When the target clip is created, value will be lost
27  kPermanent // Sets variable applied to this and all future clips at given path
28  };
29 
30  // SetArrayType sets the type of array.
31  enum class SetArrayType
32  {
33  kInt, // Array of 'Int'
34  kDouble, // Array of 'Double' in memory
35  kFloat, // Array of 'Float' in memory
36  kString, // Array of 'const char*'. (Deprecated; use kValue)
37  kStringW, // Array of 'const wchar_t*'. (Deprecated; use kValue)
38  kValue // Array of Value
39  };
40 
41  // add
42  [[nodiscard]] virtual GFxMovieDef* GetMovieDef() const; // 01 - pure - Obtains the movie definition that created this instance.
43  [[nodiscard]] virtual std::uint32_t GetCurrentFrame() const; // 02 - pure - Obtains the currently active frame of the movie, starting with 0.
44  [[nodiscard]] virtual bool HasLooped() const; // 03 - pure - Determines whether the movie clip has looped past its last frame.
45  virtual void GotoFrame(std::uint32_t a_frameNumber); // 04 - pure - Moves a playhead to a specified frame.
46  virtual bool GotoLabeledFrame(const char* a_label, std::int32_t a_offset = 0); // 05 - pure - Moves a playhead to a specified frame identified by a label.
47  virtual void SetPlayState(PlayState a_state); // 06 - pure - Changes playback state of the movie, allowing animation to be paused and resumed.
48  [[nodiscard]] virtual PlayState GetPlayState() const; // 07 - pure - Obtains the play state of the movie clip, currently either Playing or Stopped.
49  virtual void SetVisible(bool a_visible); // 08 - pure - Sets the visibility state of a movie clip.
50  [[nodiscard]] virtual bool GetVisible() const; // 09 - pure - Obtains the visibility state of a movie clip.
51  virtual bool IsAvailable(const char* a_pathToVar) const; // 0A - pure - Checks for availability of a field, method, or nested clip.
52  virtual void CreateString(GFxValue* a_value, const char* a_string); // 0B - pure - Creates strings that are managed by ActionScript runtime.
53  virtual void CreateStringW(GFxValue* a_value, const wchar_t* a_string); // 0C - pure - Creates wide character strings that are managed by ActionScript runtime.
54  virtual void CreateObject(GFxValue* a_value, const char* a_className = 0, const GFxValue* a_args = 0, std::uint32_t a_numArgs = 0); // 0D - pure - Creates an instance of an ActionScript Object.
55  virtual void CreateArray(GFxValue* a_value); // 0E - pure - Creates an instance of an ActionScript Array object.
56  virtual void CreateFunction(GFxValue* a_value, GFxFunctionHandler* a_fc, void* a_userData = 0); // 0F - pure - Creates a function object that wraps a C++ function.
57  virtual bool SetVariable(const char* a_pathToVar, const GFxValue& a_value, SetVarType a_setType = SetVarType::kSticky); // 10 - pure - Sets a variable identified by a path to a new value, specified in UTF-8 encoding.
58  virtual bool GetVariable(GFxValue* a_val, const char* a_pathToVar) const; // 11 - pure - Obtains the value of an ActionScript variable based on its path.
59  virtual bool SetVariableArray(SetArrayType a_type, const char* a_pathToVar, std::uint32_t a_index, const void* a_data, std::uint32_t a_count, SetVarType a_setType = SetVarType::kSticky) const; // 12 - pure - Sets array elements in specified range to data items of specified type.
60  virtual bool SetVariableArraySize(const char* a_pathToVar, std::uint32_t a_count, SetVarType a_setType = SetVarType::kSticky); // 13 - pure - Sets the size of the array.
61  virtual std::uint32_t GetVariableArraySize(const char* a_pathToVar); // 14 - pure - Returns the size of array buffer necessary for GetVariableArray.
62  virtual bool GetVariableArray(SetArrayType a_type, const char* a_pathToVar, std::uint32_t a_index, void* a_data, std::uint32_t a_count); // 15 - pure - Populates a buffer with results from an ActionScript array.
63  virtual bool InvokeFmt(const char* a_methodName, GFxValue* a_result, const char* a_argFmt, ...); // 16 - pure - Calls an ActionScript method on the movie clip.
64  virtual bool Invoke(const char* a_methodName, GFxValue* a_result, const GFxValue* a_args, std::uint32_t a_numArgs); // 17 - pure - Calls an ActionScript method on the movie clip.
65  virtual bool InvokeArgs(const char* a_methodName, GFxValue* a_result, const char* a_argFmt, std::va_list a_args); // 18 - pure - Invokes an ActionScript method on the movie clip using a format string followed by a variable argument list.
66 
67  static float GetRenderPixelScale();
68 
69  [[nodiscard]] std::uint32_t GetFrameCount() const;
70  [[nodiscard]] float GetFrameRate() const;
71  bool SetVariable(const char* a_pathToVar, const char* a_value, SetVarType a_setType = SetVarType::kSticky);
72  bool SetVariable(const char* a_pathToVar, const wchar_t* a_value, SetVarType a_setType = SetVarType::kSticky);
73  bool SetVariableDouble(const char* a_pathToVar, double a_value, SetVarType a_setType = SetVarType::kSticky);
74  double GetVariableDouble(const char* a_pathToVar) const;
75  bool SetVariableArray(const char* a_pathToVar, std::uint32_t a_index, const GFxValue* a_data, std::uint32_t a_count, SetVarType a_setType = SetVarType::kSticky);
76  bool GetVariableArray(const char* a_pathToVar, std::uint32_t a_index, GFxValue* a_data, std::uint32_t a_count);
77 
78  private:
79  KEEP_FOR_RE()
80  };
81  static_assert(sizeof(GFxMovie) == 0x10);
82 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: GFxFunctionHandler.h:12
Definition: GFxMovieDef.h:21
Definition: GFxMovie.h:13
virtual bool Invoke(const char *a_methodName, GFxValue *a_result, const GFxValue *a_args, std::uint32_t a_numArgs)
virtual std::uint32_t GetVariableArraySize(const char *a_pathToVar)
virtual bool InvokeArgs(const char *a_methodName, GFxValue *a_result, const char *a_argFmt, std::va_list a_args)
virtual void CreateStringW(GFxValue *a_value, const wchar_t *a_string)
virtual bool InvokeFmt(const char *a_methodName, GFxValue *a_result, const char *a_argFmt,...)
virtual std::uint32_t GetCurrentFrame() const
virtual void CreateFunction(GFxValue *a_value, GFxFunctionHandler *a_fc, void *a_userData=0)
virtual void CreateString(GFxValue *a_value, const char *a_string)
bool SetVariable(const char *a_pathToVar, const char *a_value, SetVarType a_setType=SetVarType::kSticky)
virtual bool SetVariable(const char *a_pathToVar, const GFxValue &a_value, SetVarType a_setType=SetVarType::kSticky)
bool GetVariableArray(const char *a_pathToVar, std::uint32_t a_index, GFxValue *a_data, std::uint32_t a_count)
virtual void CreateObject(GFxValue *a_value, const char *a_className=0, const GFxValue *a_args=0, std::uint32_t a_numArgs=0)
virtual void CreateArray(GFxValue *a_value)
std::uint32_t GetFrameCount() const
bool SetVariable(const char *a_pathToVar, const wchar_t *a_value, SetVarType a_setType=SetVarType::kSticky)
virtual bool SetVariableArray(SetArrayType a_type, const char *a_pathToVar, std::uint32_t a_index, const void *a_data, std::uint32_t a_count, SetVarType a_setType=SetVarType::kSticky) const
virtual PlayState GetPlayState() const
float GetFrameRate() const
virtual bool GetVisible() const
virtual bool HasLooped() const
virtual bool GetVariableArray(SetArrayType a_type, const char *a_pathToVar, std::uint32_t a_index, void *a_data, std::uint32_t a_count)
SetArrayType
Definition: GFxMovie.h:32
bool SetVariableDouble(const char *a_pathToVar, double a_value, SetVarType a_setType=SetVarType::kSticky)
virtual bool SetVariableArraySize(const char *a_pathToVar, std::uint32_t a_count, SetVarType a_setType=SetVarType::kSticky)
virtual bool GotoLabeledFrame(const char *a_label, std::int32_t a_offset=0)
virtual bool IsAvailable(const char *a_pathToVar) const
static float GetRenderPixelScale()
SetVarType
Definition: GFxMovie.h:24
virtual void GotoFrame(std::uint32_t a_frameNumber)
virtual GFxMovieDef * GetMovieDef() const
double GetVariableDouble(const char *a_pathToVar) const
PlayState
Definition: GFxMovie.h:17
virtual void SetPlayState(PlayState a_state)
virtual void SetVisible(bool a_visible)
bool SetVariableArray(const char *a_pathToVar, std::uint32_t a_index, const GFxValue *a_data, std::uint32_t a_count, SetVarType a_setType=SetVarType::kSticky)
virtual bool GetVariable(GFxValue *a_val, const char *a_pathToVar) const
Definition: GFxValue.h:92
Definition: GRefCountBase.h:12
Definition: AbsorbEffect.h:6