This patch is a mixture of versions 1 & 3 of the slideshow effects patch to work around problems displaying animations in Cardiff presentation diff -urd slideshow/source.old/engine/animationnodes/sequentialtimecontainer.cxx slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx --- slideshow/source.old/engine/animationnodes/sequentialtimecontainer.cxx 2008-04-11 00:46:29.000000000 +0000 +++ slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx 2008-12-22 20:06:48.000000000 +0000 @@ -124,8 +124,9 @@ pChildNode ) ); // deactivate child node when skip event occurs: - getContext().mrUserEventQueue.registerSkipEffectEvent( - mpCurrentSkipEvent ); + // FIXME: This causes the slide to advance too early + //getContext().mrUserEventQueue.registerSkipEffectEvent( + // mpCurrentSkipEvent ); // rewind to previous child: getContext().mrUserEventQueue.registerRewindEffectEvent( mpCurrentRewindEvent ); diff -urd slideshow/source.old/engine/eventmultiplexer.cxx slideshow/source/engine/eventmultiplexer.cxx --- slideshow/source.old/engine/eventmultiplexer.cxx 2008-06-24 12:02:05.000000000 +0000 +++ slideshow/source/engine/eventmultiplexer.cxx 2008-12-22 20:11:34.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 -urd slideshow/source.old/engine/slideshowimpl.cxx slideshow/source/engine/slideshowimpl.cxx --- slideshow/source.old/engine/slideshowimpl.cxx 2008-06-24 12:03:06.000000000 +0000 +++ slideshow/source/engine/slideshowimpl.cxx 2008-12-22 20:06:48.000000000 +0000 @@ -1149,6 +1149,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 +1667,7 @@ // delay aNotificationEvents = makeInterruptableDelay( boost::bind( &SlideShowImpl::notifySlideEnded, this ), - maEventMultiplexer.getAutomaticTimeout() ); + maEventMultiplexer.getAutomaticSlideTimeout() ); } else { @@ -1708,9 +1716,10 @@ // changes interruptable, register the interruption event // as a nextEffectEvent target. Note that the timeout // event is optional (e.g. manual slide changes don't - // generate a timeout) - maUserEventQueue.registerNextEffectEvent( - aNotificationEvents.mpImmediateEvent ); + // generate a timeout) + // FIXME: This causes the slide to advance too early + //maUserEventQueue.registerNextEffectEvent( + // aNotificationEvents.mpImmediateEvent ); if( aNotificationEvents.mpTimeoutEvent ) maEventQueue.addEvent( aNotificationEvents.mpTimeoutEvent ); diff -urd slideshow/source.old/inc/eventmultiplexer.hxx slideshow/source/inc/eventmultiplexer.hxx --- slideshow/source.old/inc/eventmultiplexer.hxx 2008-04-11 01:24:14.000000000 +0000 +++ slideshow/source/inc/eventmultiplexer.hxx 2008-12-22 20:06:48.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 // =========================================================