diff --git a/include/osgPresentation/SlideShowConstructor b/include/osgPresentation/SlideShowConstructor index 8b717d855..28ed5cab0 100644 --- a/include/osgPresentation/SlideShowConstructor +++ b/include/osgPresentation/SlideShowConstructor @@ -252,7 +252,10 @@ public: imageSequence(false), imageSequencePagingMode(osg::ImageSequence::PAGE_AND_DISCARD_USED_IMAGES), imageSequenceInteractionMode(PLAY_AUTOMATICALLY_LIKE_MOVIE), - blendingHint(USE_IMAGE_ALPHA) + blendingHint(USE_IMAGE_ALPHA), + delayTime(0.0), + startTime(0.0), + stopTime(-1.0) {} std::string options; @@ -285,7 +288,11 @@ public: ON }; - BlendingHint blendingHint; + BlendingHint blendingHint; + + double delayTime; + double startTime; + double stopTime; }; diff --git a/src/osgPlugins/p3d/ReaderWriterP3D.cpp b/src/osgPlugins/p3d/ReaderWriterP3D.cpp index 60ccedd6e..f28c0c194 100644 --- a/src/osgPlugins/p3d/ReaderWriterP3D.cpp +++ b/src/osgPlugins/p3d/ReaderWriterP3D.cpp @@ -956,6 +956,24 @@ bool ReaderWriterP3DXML::getProperties(osgDB::XmlNode*cur, osgPresentation::Slid OSG_NOTIFY(_notifyLevel)<<"read blendingHint \""<rewind() + play"<rewind() + play"<pause()"<pause()"<pause(); } @@ -202,10 +203,19 @@ struct ImageStreamOperator : public ObjectOperator virtual void reset(SlideEventHandler*) { + OSG_NOTICE<<"ImageStreamOperator::reset()"<getStatus(); - _imageStream->rewind(); - + double startTime; + if (_imageStream->getUserValue("start",startTime)) + { + _imageStream->seek(startTime); + } + else + { + _imageStream->rewind(); + } //_imageStream->setVolume(previousVolume); diff --git a/src/osgPresentation/SlideShowConstructor.cpp b/src/osgPresentation/SlideShowConstructor.cpp index 8f9bfea96..966ebaffe 100644 --- a/src/osgPresentation/SlideShowConstructor.cpp +++ b/src/osgPresentation/SlideShowConstructor.cpp @@ -1114,6 +1114,10 @@ osg::Image* SlideShowConstructor::readImage(const std::string& filename, const I image = imageSequence; } + if (imageData.delayTime>0.0) image->setUserValue("delay",imageData.delayTime); + if (imageData.startTime>0.0) image->setUserValue("start",imageData.startTime); + if (imageData.stopTime>0.0) image->setUserValue("stop",imageData.stopTime); + return image.release(); }