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