diff --git a/include/osg/ImageStream b/include/osg/ImageStream index cb8df82b0..4ae14822a 100644 --- a/include/osg/ImageStream +++ b/include/osg/ImageStream @@ -67,6 +67,8 @@ class OSG_EXPORT ImageStream : public Image LoopingMode getLoopingMode() const { return _loopingMode; } + virtual double getLength() const { return 0.0; } + virtual void setReferenceTime(double) {} virtual double getReferenceTime() const { return 0.0; } diff --git a/src/osgPlugins/quicktime/QuicktimeImageStream.h b/src/osgPlugins/quicktime/QuicktimeImageStream.h index 6f5b913ee..e0e036c64 100644 --- a/src/osgPlugins/quicktime/QuicktimeImageStream.h +++ b/src/osgPlugins/quicktime/QuicktimeImageStream.h @@ -87,7 +87,10 @@ public: virtual void quit(bool wiatForThreadToExit); /// Get total length in seconds. - inline float getLength() const { return _len; } + virtual double getLength() const + { + return double(_len); + } /// jumps to a specific position void jumpTo(float pos) { @@ -106,6 +109,29 @@ public: /// starts the thread virtual void run(); + /// Go to a specific position in the stream. + virtual void setReferenceTime(double time) + { + jumpTo(float(time)); + } + /// Return the current position in the stream. + virtual double getReferenceTime() const + { + return double(getCurrentTime()); + } + + // Set the time multiplier if you want to speed up, + // slow down, or go normal speed. + virtual void setTimeMultiplier(double multiplier) + { + setMovieRate(float(multiplier)); + } + virtual double getTimeMultiplier() + { + return 0.0; + } + + protected: /// destructor virtual ~QuicktimeImageStream();