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
119 /// \copydoc DisplayObject::SetAvailableAttributes
121 /// \copydoc DisplayObject::CloneObject
123 /// \copydoc DisplayObject::CopyProperties
125#ifndef GLES
126 /// \copydoc DisplayObject::GetCppInterfaceDescription
127 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT InterfaceListType* GetCppInterfaceDescription( InterfaceListType* addToThisList = NULL ) DISTI_METHOD_OVERRIDE;
128 /// \copydoc DisplayObject::GetCppInterfaceDescriptionFree
129 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void GetCppInterfaceDescriptionFree( InterfaceListType* array ) DISTI_METHOD_OVERRIDE;
130#endif
131 /// \copydoc DisplayObject::PreDraw
133 /// \copydoc DisplayObject::Draw
135 /// \copydoc DisplayObject::Calculate
137 /// \copydoc DisplayObject::SetValue
138 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void SetValue( int spec, va_list& args ) DISTI_METHOD_OVERRIDE;
139
140 //////////////////////////////////////////////////
141 // GlsMovieTexture specific operations
142 //////////////////////////////////////////////////
143
144 /// Sets the desired video source file.
145 /// \param s The path to the video source file to set.
147
148 /// \return The path to the current video source file.
150
151 /// 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.
152 /// \param should_loop The new looping state.
153 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void Loop( const bool& should_loop );
154
155 /// \return The current looping state of the movie.
157
158 /// Sets the playing state of the movie. should_play == false is equivalent to STOP.
159 /// \param should_play The new playing state.
160 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void Playing( const bool& should_play );
161
162 /// \return The current playing state of the movie.
164
165 /// Sets the paused state of the movie.
166 /// \param should_pause The new paused state.
167 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void Paused( const bool& should_pause );
168
169 /// \return The current paused state of the movie.
171
172 /// Sets the position of the stream pointer by percent.
173 /// \param pct The new percentage position in playback.
174 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void PlayPosition( const float& pct );
175
176 /// \return The current playback position, in percent.
178
179 /// Sets the position of the stream pointer by frame number.
180 /// \param frame The absolute frame number to set the playback position.
181 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void CurrentAbsoluteFrame( const unsigned int& frame );
182
183 /// \return The current playback position, in absolute frames.
185
186 /// Sets the audio playback behavior.
187 /// \param soundon The new sound playback state.
188 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void SoundEnabled( const bool& soundon );
189
190 /// \return Whether or not the movie can play sound.
192
193 /// Sets the audio volume from 0.0 to 1.0.
194 /// \param volume The new volume value.
195 virtual GLSGEN_GLSMOVIETEXTURE_EXPORT void SoundVolume( const float& volume );
196
197 /// \return The current movie volume from 0.0 to 1.0.
199
200 /// \return The length of the movie in milliseconds.
202
203protected:
204 GlsPropString _movieFile; ///< Stores the name of the movie file.
205 bool _soundEnabled; ///< States whether sound should be enabled or not.
206 float _soundVolume; ///< Controls colume of sound (from 0.0f to 1.0f).
207 float _playPositionPercent; ///< Stores the current play position percent.
208 float _previousPlayPositionPercent; ///< Stores the previous play position percent.
209 unsigned int _currentAbsoluteFrame; ///< Stores the current frame of the movie.
210 unsigned int _previousAbsoluteFrame; ///< Stores the previous frame count.
211 CVideoTexture* _vidTex; ///< Instance of CVideoTexture class that interfaces with D3D.
212};
213
214} // namespace disti
215
216#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 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:204
virtual void Draw() 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:210
virtual bool Playing()
CVideoTexture * _vidTex
Instance of CVideoTexture class that interfaces with D3D.
Definition: gls_movie_texture.h:211
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:206
virtual void PreDraw(const OpenGLMatrices &current, Culler &culler) DISTI_METHOD_OVERRIDE
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:208
float _playPositionPercent
Stores the current play position percent.
Definition: gls_movie_texture.h:207
virtual bool Paused()
virtual bool Loop()
virtual float PlayPosition()
bool _soundEnabled
States whether sound should be enabled or not.
Definition: gls_movie_texture.h:205
unsigned int _currentAbsoluteFrame
Stores the current frame of the movie.
Definition: gls_movie_texture.h:209
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:246
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:488
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:222
#define GLSGEN_GLSMOVIETEXTURE_EXPORT
Provides support for creating DLLs.
Definition: gls_movie_texture.h:54
Definition: bmpimage.h:47