TDME2  1.9.200
GUIVideoNode.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <string>
5 
6 #include <tdme/tdme.h>
7 #include <tdme/audio/fwd-tdme.h>
8 #include <tdme/engine/fwd-tdme.h>
9 #include <tdme/gui/fwd-tdme.h>
18 
19 using std::string;
20 using std::unique_ptr;
21 
38 
39 /**
40  * GUI video node
41  * @author Andreas Drewke
42  */
44  : public GUITextureBaseNode
45 {
46  friend class tdme::gui::GUIParser;
47 
48 private:
49  string source;
51  unique_ptr<DynamicColorTexture> videoTexture;
52  unique_ptr<ByteBuffer> videoAudioBuffer;
54  int64_t timeLast { -1LL };
55 
56 protected:
57  // forbid class copy
59 
60  /**
61  * Constructor
62  * @param screenNode screen node
63  * @param parentNode parent node
64  * @param id id
65  * @param flow flow
66  * @param alignments alignments
67  * @param requestedConstraints requested constraints
68  * @param backgroundColor background color
69  * @param backgroundImage background image
70  * @param backgroundImageScale9Grid background image scale 9 grid
71  * @param backgroundImageEffectColorMul background image effect color mul
72  * @param backgroundImageEffectColorAdd background image effect color add
73  * @param border border
74  * @param padding padding
75  * @param showOn show on
76  * @param hideOn hide on
77  * @param tooltip tooltip
78  * @param source source
79  * @param requestedDimensionConstraints requested dimension constraints
80  * @param mirrorX mirror X
81  * @param mirrorY mirror Y
82  * @param effectColorMul effect color mul
83  * @param effectColorAdd effect color add
84  * @param scale9Grid scale 9 grid
85  * @param clipping clipping
86  * @param mask mask image
87  * @param maskMaxValue maximum value of mask to display image
88  * @throws tdme::gui::GUIParserException
89  */
93  const string& id,
98  const string& backgroundImage,
102  const GUINode_Border& border,
103  const GUINode_Padding& padding,
104  const GUINodeConditions& showOn,
105  const GUINodeConditions& hideOn,
106  const string& tooltip,
107  const string& source,
108  const RequestedDimensionConstraints& requestedDimensionConstraints,
109  bool mirrorX,
110  bool mirrorY,
111  const GUIColor& effectColorMul,
112  const GUIColor& effectColorAdd,
114  const GUINode_Clipping& clipping,
115  const string& mask,
116  float maskMaxValue
117  );
118 
119  /**
120  * @return node type
121  */
122  const string getNodeType() override;
123 
124  /**
125  * Dispose video related members
126  */
127  void disposeVideo();
128 
129 public:
130  // overridden methods
131  void dispose() override;
132 
133  /**
134  * @return image source
135  */
136  const string& getSource();
137 
138  /**
139  * Set image source
140  * @param source source
141  */
142  void setSource(const string& source);
143 
144  // overridden methods
145  void onRenderTexture() override;
146 };
GUI parser.
Definition: GUIParser.h:40
GUI element node conditions.
GUINodeConditions hideOn
Definition: GUINode.h:162
GUIColor backgroundImageEffectColorMul
Definition: GUINode.h:157
GUINode_Border border
Definition: GUINode.h:160
GUINode_Scale9Grid backgroundImageScale9Grid
Definition: GUINode.h:156
GUIColor backgroundImageEffectColorAdd
Definition: GUINode.h:158
GUIParentNode * parentNode
Definition: GUINode.h:148
GUINode_Padding padding
Definition: GUINode.h:159
GUIScreenNode * screenNode
Definition: GUINode.h:147
GUINode_RequestedConstraints requestedConstraints
Definition: GUINode.h:151
GUINode_Alignments alignments
Definition: GUINode.h:150
GUINodeConditions showOn
Definition: GUINode.h:161
GUINode_Flow * flow
Definition: GUINode.h:86
GUI parent node base class thats supporting child nodes.
Definition: GUIParentNode.h:42
GUI screen node that represents a screen that can be rendered via GUI system.
Definition: GUIScreenNode.h:72
RequestedDimensionConstraints requestedDimensionConstraints
void onRenderTexture() override
On render texture event.
const string getNodeType() override
void dispose() override
Dispose node.
void setSource(const string &source)
Set image source.
PacketAudioStream * videoAudioStream
Definition: GUIVideoNode.h:53
GUIVideoNode(GUIScreenNode *screenNode, GUIParentNode *parentNode, const string &id, GUINode_Flow *flow, const GUINode_Alignments &alignments, const GUINode_RequestedConstraints &requestedConstraints, const GUIColor &backgroundColor, const string &backgroundImage, const GUINode_Scale9Grid &backgroundImageScale9Grid, const GUIColor &backgroundImageEffectColorMul, const GUIColor &backgroundImageEffectColorAdd, const GUINode_Border &border, const GUINode_Padding &padding, const GUINodeConditions &showOn, const GUINodeConditions &hideOn, const string &tooltip, const string &source, const RequestedDimensionConstraints &requestedDimensionConstraints, bool mirrorX, bool mirrorY, const GUIColor &effectColorMul, const GUIColor &effectColorAdd, const GUINode_Scale9Grid &scale9Grid, const GUINode_Clipping &clipping, const string &mask, float maskMaxValue)
Constructor.
unique_ptr< ByteBuffer > videoAudioBuffer
Definition: GUIVideoNode.h:52
void disposeVideo()
Dispose video related members.
unique_ptr< DynamicColorTexture > videoTexture
Definition: GUIVideoNode.h:51
Byte buffer class.
Definition: ByteBuffer.h:27
PL_MPEG/MPEG1 video decoder.
Definition: MPEG1Decoder.h:28
GUI node border entity.
GUI node clipping entity.
GUI node padding entity.
GUI node scale 9 grid entity.
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6