GL Studio C++ Runtime API
gls_movie_texture.h
Go to the documentation of this file.
1/// \file gls_movie_texture.h
2/// \brief The GlsMovieTexture class
3///
4/// \par Copyright Information
5///
6/// Copyright (c) 2017 by The DiSTI Corporation.<br>
7/// 12249 Science Drive; Suite 300<br>
8/// Orlando, Florida 32826<br>
9/// USA<br>
10/// <br>
11/// All rights reserved.<br>
12///
13/// This Software contains proprietary trade secrets of DiSTI and may not be
14/// reproduced, in whole or part, in any form, or by any means of electronic,
15/// mechanical, or otherwise, without the written permission of DiSTI. Said
16/// permission may be derived through the purchase of applicable DiSTI product
17/// licenses which detail the distribution rights of this content and any
18/// Derivative Works based on this or other copyrighted DiSTI Software.
19///
20/// NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21/// AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22/// PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23/// AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24/// IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25/// PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26///
27/// LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28/// IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29/// INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30/// DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31/// INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32/// INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33/// OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34/// EXCEED FIVE DOLLARS (US$5.00).
35///
36/// The aforementioned terms and restrictions are governed by the laws of the
37/// State of Florida and the United States of America.
38
39#ifndef INCLUDE_GLS_MOVIE_TEXTURE_H
40#define INCLUDE_GLS_MOVIE_TEXTURE_H
41#include "glpolygon.h"
43
44/// Provides support for creating DLLs.
45#if( defined( GLSGEN_EXPORT_GLSMOVIETEXTURE ) || defined( GLSGEN_IMPORT_GLSMOVIETEXTURE ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
46 && defined( _MSC_VER )
47# if defined( GLSGEN_EXPORT_GLSMOVIETEXTURE ) || defined( GLS_EXPORT_GENERATED )
48# define GLSGEN_GLSMOVIETEXTURE_EXPORT __declspec( dllexport )
49# else
50# define GLSGEN_GLSMOVIETEXTURE_EXPORT __declspec( dllimport )
51# endif
52#else
53# define GLSGEN_GLSMOVIETEXTURE_EXPORT
54#endif
55///////////////////////////////////////////////////////////////////////////////
56
57/// Automatically link the runtime library plugin (on Windows).
58#define LIB_BASE_NAME "gls_movie_texture"
59#include "gls_auto_lib.h"
60#undef LIB_BASE_NAME
61
62/// Force inclusion of the DirectShow library.
63#ifndef NO_GLS_AUTOLIB
64# define LIB_BASE_NAME "strmbase"
65# ifdef GLS_LIB_TYPE
66# undef GLS_LIB_TYPE
67# endif
68/// DirectShow is always statically linked.
69# define GLS_LIB_TYPE ""
70# include "gls_auto_lib.h"
71# undef GLS_LIB_TYPE
72# undef LIB_BASE_NAME
73#endif
74
75class CVideoTexture;
76
77namespace disti
78{
79// SetValue enumerations
80enum
81{
82 GLS_GLSMOVIETEXTURE_FIRST_VALUE = GLS_LAST_INITIALIZER + 1,
83 GLS_GLSMOVIETEXTURE_MOVIESOURCE,
84 GLS_GLSMOVIETEXTURE_LOOP,
85 GLS_GLSMOVIETEXTURE_SOUNDENABLED,
86 GLS_GLSMOVIETEXTURE_SOUNDVOLUME
87};
88
89/** Runtime implementation of a GlsMovieTexture */
91{
92 friend class GlsMovieTextureEditor;
93
94private:
97
98public:
99 DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
100 typedef GLPolygon _BaseClass; ///< Deprecated typedef for the base class.
101 typedef GLPolygon BaseClass; ///< Typedef for the base class.
102
103 /// Constructor
104 /// \param generateInstance Whether or not to generate an instance name for this object.
105 GLSGEN_GLSMOVIETEXTURE_EXPORT GlsMovieTexture( bool generateInstance = false );
106
107 /// Copy constructor
108 /// \param that The object to copy from.
109 /// \param generateNames Whether or not to generate an instance name for this object.
110 GLSGEN_GLSMOVIETEXTURE_EXPORT GlsMovieTexture( const GlsMovieTexture& that, const bool generateNames );
111
112 /** Destructs a GlsMovieTexture object */
114
115 /// \return A pointer to a new GlsMovieTexture object.
117
118 /// \copydoc DisplayObject::SetAvailableAttributes
120 /// \copydoc DisplayObject::CloneObject
122 /// \copydoc DisplayObject::CopyProperties
124#ifndef GLES
125 /// \copydoc DisplayObject::GetCppInterfaceDescription
127 /// \copydoc DisplayObject::GetCppInterfaceDescriptionFree
129#endif
130 /// \copydoc DisplayObject::PreDraw
132 /// \copydoc DisplayObject::Draw
134 /// \copydoc DisplayObject::Calculate
136 /// \copydoc DisplayObject::SetValue
138
139 //////////////////////////////////////////////////
140 // GlsMovieTexture specific operations
141 //////////////////////////////////////////////////
142
143 /// Sets the desired video source file.
144 /// \param s The path to the video source file to set.
146
147 /// \return The path to the current video source file.
149
150 /// Sets the looping state of the movie. should_loop == true will cause the movie to "rewind" and start playing again when the end is reached.
151 /// \param should_loop The new looping state.
152 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void Loop( const bool& should_loop );
153
154 /// \return The current looping state of the movie.
156
157 /// Sets the playing state of the movie. should_play == false is equivalent to STOP.
158 /// \param should_play The new playing state.
159 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void Playing( const bool& should_play );
160
161 /// \return The current playing state of the movie.
163
164 /// Sets the paused state of the movie.
165 /// \param should_pause The new paused state.
166 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void Paused( const bool& should_pause );
167
168 /// \return The current paused state of the movie.
170
171 /// Sets the position of the stream pointer by percent.
172 /// \param pct The new percentage position in playback.
173 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void PlayPosition( const float& pct );
174
175 /// \return The current playback position, in percent.
177
178 /// Sets the position of the stream pointer by frame number.
179 /// \param frame The absolute frame number to set the playback position.
180 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void CurrentAbsoluteFrame( const unsigned int& frame );
181
182 /// \return The current playback position, in absolute frames.
184
185 /// Sets the audio playback behavior.
186 /// \param soundon The new sound playback state.
187 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void SoundEnabled( const bool& soundon );
188
189 /// \return Whether or not the movie can play sound.
191
192 /// Sets the audio volume from 0.0 to 1.0.
193 /// \param volume The new volume value.
194 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void SoundVolume( const float& volume );
195
196 /// \return The current movie volume from 0.0 to 1.0.
198
199 /// \return The length of the movie in milliseconds.
201
202protected:
203 GlsPropString _movieFile; ///< Stores the name of the movie file.
204 bool _soundEnabled; ///< States whether sound should be enabled or not.
205 float _soundVolume; ///< Controls colume of sound (from 0.0f to 1.0f).
206 float _playPositionPercent; ///< Stores the current play position percent.
207 float _previousPlayPositionPercent; ///< Stores the previous play position percent.
208 unsigned int _currentAbsoluteFrame; ///< Stores the current frame of the movie.
209 unsigned int _previousAbsoluteFrame; ///< Stores the previous frame count.
210 CVideoTexture* _vidTex; ///< Instance of CVideoTexture class that interfaces with D3D.
211};
212
213} // namespace disti
214
215#endif
Definition: cull.h:49
Definition: display.h:95
Definition: dynamic_array.h:79
The Polygon class. Implements Polygons.
Definition: glpolygon.h:55
Definition: gls_movie_texture.h:91
virtual float SoundVolume()
virtual int DurationInMS()
GlsPropString _movieFile
Stores the name of the movie file.
Definition: gls_movie_texture.h:203
void SetValue(int spec, va_list &args) DISTI_METHOD_OVERRIDE
virtual bool SoundEnabled()
void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
unsigned int _previousAbsoluteFrame
Stores the previous frame count.
Definition: gls_movie_texture.h:209
virtual bool Playing()
CVideoTexture * _vidTex
Instance of CVideoTexture class that interfaces with D3D.
Definition: gls_movie_texture.h:210
void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
void GetCppInterfaceDescriptionFree(InterfaceListType *array) DISTI_METHOD_OVERRIDE
virtual unsigned int CurrentAbsoluteFrame()
float _soundVolume
Controls colume of sound (from 0.0f to 1.0f).
Definition: gls_movie_texture.h:205
virtual GlsPropString MovieSource()
static DisplayObject * CreateInstance()
void Draw() DISTI_METHOD_OVERRIDE
float _previousPlayPositionPercent
Stores the previous play position percent.
Definition: gls_movie_texture.h:207
float _playPositionPercent
Stores the current play position percent.
Definition: gls_movie_texture.h:206
virtual bool Paused()
virtual bool Loop()
virtual float PlayPosition()
bool _soundEnabled
States whether sound should be enabled or not.
Definition: gls_movie_texture.h:204
void PreDraw(const OpenGLMatrices &current, Culler &culler) DISTI_METHOD_OVERRIDE
unsigned int _currentAbsoluteFrame
Stores the current frame of the movie.
Definition: gls_movie_texture.h:208
void Calculate(double time) DISTI_METHOD_OVERRIDE
DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) DISTI_METHOD_OVERRIDE
Definition: util.h:1603
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:540
The disti::GLPolygon class. Implements Polygons.
The gls_auto_lib.
Macros and helper code to determine what subset of C++11/14/17 is available.
#define DISTI_SPECIAL_MEM_FUN_DELETE
Macro to wrap function deletion, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:245
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:487
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:221
#define GLSGEN_GLSMOVIETEXTURE_EXPORT
Provides support for creating DLLs.
Definition: gls_movie_texture.h:53
Definition: bmpimage.h:46