diff -ur slideshow/source.old/engine/eventmultiplexer.cxx slideshow/source/engine/eventmultiplexer.cxx --- slideshow/source.old/engine/eventmultiplexer.cxx 2008-06-24 13:02:05.000000000 +0100 +++ slideshow/source/engine/eventmultiplexer.cxx 2008-12-19 20:55:26.000000000 +0000 @@ -206,6 +206,7 @@ maMouseMoveHandlers(), maHyperlinkHandlers(), mnTimeout(0.0), + mnSlideTimeout(0.0), mpTickEvent(), mbIsAutoMode(false) {} @@ -322,8 +323,10 @@ ImplMouseHandlers maMouseMoveHandlers; ImplHyperLinkHandlers maHyperlinkHandlers; - /// automatic next effect mode timeout + /// automatic next effect mode delay between effects double mnTimeout; + /// automatic next effect mode delay between slides (default to mnTimeout if not set) + double mnSlideTimeout; /** Holds ptr to optional tick event weakly @@ -505,22 +508,38 @@ if( !mbIsAutoMode ) return; // this event is just a left-over, ignore - notifyNextEffect(); - - if( !maNextEffectHandlers.isEmpty() ) - { - // still handlers left, schedule next timeout - // event. Will also set mbIsTickEventOn back to true + if( !maNextEffectHandlers.isEmpty() ) { + notifyNextEffect(); + + if( !maNextEffectHandlers.isEmpty() ) + { + // still handlers left, schedule next timeout + // event. Will also set mbIsTickEventOn back to true + scheduleTick(); + } + } + else { + // The next effect has not yet been activated - try again next time scheduleTick(); } } void EventMultiplexerImpl::scheduleTick() { + double nNextTimeout = mrEventQueue.nextTimeout(); + double nDelay; + if( !mrEventQueue.isEmpty() && nNextTimeout > 0 && nNextTimeout > mnTimeout ) { + // Allow longer for long running effects + nDelay = nNextTimeout; + } + else { + nDelay = mnTimeout; + } + EventSharedPtr pEvent( makeDelay( boost::bind( &EventMultiplexerImpl::tick, this ), - mnTimeout )); + nDelay )); // store weak reference to generated event, to notice when // the event queue gets cleansed (we then have to @@ -757,11 +776,26 @@ mpImpl->mnTimeout = nTimeout; } +void EventMultiplexer::setAutomaticSlideTimeout( double nTimeout ) +{ + mpImpl->mnSlideTimeout = nTimeout; +} + double EventMultiplexer::getAutomaticTimeout() const { return mpImpl->mnTimeout; } +double EventMultiplexer::getAutomaticSlideTimeout() const +{ + double nTimeout; + if(mpImpl->mnSlideTimeout) + nTimeout = mpImpl->mnSlideTimeout; + else + nTimeout = mpImpl->mnTimeout; + return nTimeout; +} + void EventMultiplexer::addNextEffectHandler( EventHandlerSharedPtr const& rHandler, double nPriority ) diff -ur slideshow/source.old/engine/slideshowimpl.cxx slideshow/source/engine/slideshowimpl.cxx --- slideshow/source.old/engine/slideshowimpl.cxx 2008-06-24 13:03:06.000000000 +0100 +++ slideshow/source/engine/slideshowimpl.cxx 2008-12-19 00:36:14.000000000 +0000 @@ -1149,6 +1135,15 @@ } if (rProperty.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("AutomaticSlideAdvancement") )) + { + double nTimeout(0.0); + rProperty.Value >>= nTimeout; + maEventMultiplexer.setAutomaticSlideTimeout( nTimeout ); + return true; + } + + if (rProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("UserPaintColor") )) { sal_Int32 nColor(0); @@ -1659,7 +1654,10 @@ // delay aNotificationEvents = makeInterruptableDelay( boost::bind( &SlideShowImpl::notifySlideEnded, this ), - maEventMultiplexer.getAutomaticTimeout() ); + maEventMultiplexer.getAutomaticSlideTimeout() ); + aNotificationEvents.mpImmediateEvent = makeDelay( + boost::bind( &SlideShowImpl::notifySlideEnded, this ), + maEventMultiplexer.getAutomaticSlideTimeout() ); } else { diff -ur slideshow/source.old/inc/eventmultiplexer.hxx slideshow/source/inc/eventmultiplexer.hxx --- slideshow/source.old/inc/eventmultiplexer.hxx 2008-04-11 02:24:14.000000000 +0100 +++ slideshow/source/inc/eventmultiplexer.hxx 2008-10-31 15:27:05.000000000 +0000 @@ -120,15 +120,26 @@ /** Set the timeout for automatic mode. @param nTimeout - Timeout, between end of effect until start of next - effect. + Timeout between end of effect and start of next effect */ void setAutomaticTimeout( double nTimeout ); - /** Get automatic mode timeout value. + /** Set the timeout for effects in automatic mode. + + @param nTimeout + Timeout between end of effects and start of slide transition + If not specified, uses timeout from setAutomaticTimeout + */ + void setAutomaticSlideTimeout( double nTimeout ); + + /** Get automatic mode timeout value between effects. */ double getAutomaticTimeout() const; + /** Get automatic mode timeout value between slides. + */ + double getAutomaticSlideTimeout() const; + // Handler registration methods // =========================================================