Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 #ifndef __SP_VIDEODRIVER_MOVIE_H__
00009 #define __SP_VIDEODRIVER_MOVIE_H__
00010 
00011 
00012 #include "Base/spStandard.hpp"
00013 #include "Base/spDimensionSize2D.hpp"
00014 #include "Base/spInputOutputString.hpp"
00015 #include "Base/spMemoryManagement.hpp"
00016 #include "RenderSystem/spTextureBase.hpp"
00017 
00018 
00019 namespace sp
00020 {
00021 namespace video
00022 {
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 class SP_EXPORT Movie
00031 {
00032     
00033     public:
00034         
00035         Movie(const io::stringc &Filename, const s32 Resolution = 256);
00036         ~Movie();
00037         
00038         
00039         
00040         bool reload(const io::stringc &Filename, const s32 Resolution = 256);
00041         void close();
00042         
00043         void play(bool Looped = false);
00044         void pause(bool Paused = true);
00045         void stop();
00046         
00047         
00048         
00049         void setSeek(f32 Seek);
00050         f32 getSeek() const;
00051         
00052         void setSpeed(f32 Speed);
00053         f32 getSpeed() const;
00054         
00055         
00056         
00057         dim::size2di getSize() const;
00058         
00059         u32 getLength() const;
00060         
00061         bool finish() const;
00062         bool valid() const;
00063         
00065         void renderTexture(Texture* Tex);
00066         
00067         
00068         
00069         inline io::stringc getFilename() const
00070         {
00071             return Filename_;
00072         }
00073         
00074     private:
00075         
00076         
00077         
00078         enum EMovieStateTypes
00079         {
00080             MOVIESTATE_STOPED = 0,
00081             MOVIESTATE_PLAYED,
00082             MOVIESTATE_PAUSED
00083         };
00084         
00085         
00086         
00087         void flipDataBuffer(void* buffer, u32 Len);
00088         
00089         bool exitWithError(const io::stringc &ErrorMessage);
00090         
00091         
00092         
00093         void* DataPointer_;
00094         io::stringc Filename_;
00095         f32 Speed_;
00096         
00097 };
00098 
00099 
00100 } 
00101 
00102 } 
00103 
00104 
00105 #endif
00106 
00107 
00108 
00109