- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/quicktime/MovieData.h
r12910 r13041 20 20 21 21 22 /** 22 /** 23 23 * the class MovieData encapsulates all quicktime-related stuff, so it doesn't polute the namespaces 24 * it handles all calls to quicktime etc... It is mainly used by the QuicktimeImageStream, it is 25 * rarely needed in other contexts 24 * it handles all calls to quicktime etc... It is mainly used by the QuicktimeImageStream, it is 25 * rarely needed in other contexts 26 26 */ 27 27 class MovieData { 28 28 29 29 public: 30 30 /** default constructor */ 31 31 MovieData(); 32 32 33 33 /** default destructor */ 34 34 ~MovieData(); 35 36 /** 35 36 /** 37 37 * loads a movie, start it playing at startTime, use Image for the storage 38 38 * @param image the image, to use as storage … … 41 41 */ 42 42 void load(osg::Image* image, std::string fileName, double startTime = 0.0); 43 43 44 44 /** @return the duration for this movie in seconds */ 45 45 inline double getMovieDuration() { return GetMovieDuration(_movie)/_timescale;} 46 46 47 47 /** @return the current position for this movie in seconds */ 48 48 inline double getMovieTime() {return GetMovieTime(_movie,NULL)/_timescale; } 49 49 50 50 /** stes the movietime */ 51 51 void setMovieTime(double atime); 52 52 53 53 /** @return the Movie-handle, to use it with other quicktime-calls */ 54 54 inline Movie &getMovie() { return _movie; } 55 55 56 56 /** @return the current movieRate */ 57 57 inline double getMovieRate() { return Fix2X(GetMovieRate(_movie)); } 58 58 /** @return returns the cached movierate, may differ to the real movierate */ 59 59 inline double getCachedMovieRate() { return _movieRate; } 60 60 61 61 /** sets the MovieRate for this movie */ 62 62 void setMovieRate(double rate); 63 63 64 64 /** sets the volume for the soundtrack of this movie */ 65 65 void setVolume(float volume) { SetMovieVolume(_movie,(short)(ceil(volume*255.0f)));} 66 66 float getVolume() const { return GetMovieVolume(_movie) / 255.0f; } 67 67 68 68 void setAudioBalance(float f) { 69 69 Float32 balance = f; 70 70 SetMovieAudioBalance(_movie, balance, 0); 71 71 } 72 72 73 73 float getAudioBalance() { 74 74 Float32 balance; … … 78 78 return f; 79 79 } 80 80 81 81 /** @return true, if this movie is looping */ 82 82 bool isLooping() const { return _isLooping; } 83 83 84 84 /** sets the looping mode */ 85 85 void setLooping(bool loop) { … … 96 96 } 97 97 } 98 99 98 99 100 100 protected: 101 101 char* _pointer; 102 102 Movie _movie; 103 103 GWorldPtr _gw; 104 104 105 105 unsigned int _movieWidth, _movieHeight, _textureWidth, _textureHeight; 106 106 double _timescale; … … 109 109 bool _preRolled; 110 110 bool _isLooping; 111 111 112 112 /** inits the image for storage */ 113 113 void _initImage(osg::Image* image); 114 114 115 115 /** inits the gWorld, where the movie gets drawn into */ 116 116 void _initGWorldStuff(osg::Image * image); 117 117 118 118 /** inits the texture */ 119 119 void _initTexture(); 120 120 121 121 /** checks for an movie-error */ 122 122 inline void _checkMovieError(std::string msg) { … … 126 126 } 127 127 } 128 128 129 129 }; 130 130
