diff options
author | Christian Lippka <christian.lippka@sun.com> | 2010-01-04 15:43:22 +0100 |
---|---|---|
committer | Christian Lippka <christian.lippka@sun.com> | 2010-01-04 15:43:22 +0100 |
commit | b71823a291b10fe67cd96b81bce3fb0d91dcb893 (patch) | |
tree | 756017bd26f549770d70b47488b4fe11aaff1504 /slideshow/source/engine/animationnodes | |
parent | dada72080460ab3a1bf4228a38454339b1d5f204 (diff) | |
parent | eb86211c1db0bb492669e7ac8302b89254ed4793 (diff) |
merge to m68
Diffstat (limited to 'slideshow/source/engine/animationnodes')
9 files changed, 64 insertions, 25 deletions
diff --git a/slideshow/source/engine/animationnodes/animationaudionode.cxx b/slideshow/source/engine/animationnodes/animationaudionode.cxx index 634dc0342515..24c3a95382bf 100644 --- a/slideshow/source/engine/animationnodes/animationaudionode.cxx +++ b/slideshow/source/engine/animationnodes/animationaudionode.cxx @@ -94,14 +94,16 @@ void AnimationAudioNode::activate_st() // no node duration. Take inherent media time, then scheduleDeactivationEvent( makeDelay( boost::bind( &AnimationNode::deactivate, getSelf() ), - mpPlayer->getDuration() ) ); + mpPlayer->getDuration(), + "AnimationAudioNode::deactivate with delay") ); } } else { // deactivate ASAP: scheduleDeactivationEvent( - makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ) ) ); + makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ), + "AnimationAudioNode::deactivate without delay") ); } } @@ -127,7 +129,8 @@ void AnimationAudioNode::deactivate_st( NodeState /*eDestState*/ ) getContext().mrEventQueue.addEvent( makeEvent( boost::bind( &EventMultiplexer::notifyAudioStopped, boost::ref(getContext().mrEventMultiplexer), - getSelf() ) ) ); + getSelf() ), + "AnimationAudioNode::notifyAudioStopped") ); } bool AnimationAudioNode::hasPendingAnimation() const diff --git a/slideshow/source/engine/animationnodes/animationbasenode.cxx b/slideshow/source/engine/animationnodes/animationbasenode.cxx index 82868063fefa..19a6df2a8244 100644 --- a/slideshow/source/engine/animationnodes/animationbasenode.cxx +++ b/slideshow/source/engine/animationnodes/animationbasenode.cxx @@ -456,7 +456,8 @@ AnimationBaseNode::fillCommonParameters() const EventSharedPtr pEndEvent; if (pSelf) { pEndEvent = makeEvent( - boost::bind( &AnimationNode::deactivate, pSelf ) ); + boost::bind( &AnimationNode::deactivate, pSelf ), + "AnimationBaseNode::deactivate"); } // Calculate the minimum frame count that depends on the duration and diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.cxx b/slideshow/source/engine/animationnodes/animationcommandnode.cxx index f9104f37a45a..2adbe2b9b75a 100644 --- a/slideshow/source/engine/animationnodes/animationcommandnode.cxx +++ b/slideshow/source/engine/animationnodes/animationcommandnode.cxx @@ -124,7 +124,8 @@ void AnimationCommandNode::activate_st() // deactivate ASAP: scheduleDeactivationEvent( - makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ) ) ); + makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ), + "AnimationCommandNode::deactivate" ) ); } bool AnimationCommandNode::hasPendingAnimation() const diff --git a/slideshow/source/engine/animationnodes/animationsetnode.cxx b/slideshow/source/engine/animationnodes/animationsetnode.cxx index f7669b7214d3..ba1f015cd4fe 100644 --- a/slideshow/source/engine/animationnodes/animationsetnode.cxx +++ b/slideshow/source/engine/animationnodes/animationsetnode.cxx @@ -80,7 +80,8 @@ AnimationActivitySharedPtr AnimationSetNode::createActivity() const pSelf, "cannot cast getSelf() to my type!" ); aParms.mpEndEvent = makeEvent( boost::bind( &AnimationSetNode::implScheduleDeactivationEvent, - pSelf ) ); + pSelf ), + "AnimationSetNode::implScheduleDeactivationEvent"); } switch (AnimationFactory::classifyAttributeName( attrName )) { diff --git a/slideshow/source/engine/animationnodes/basenode.cxx b/slideshow/source/engine/animationnodes/basenode.cxx index 9f74a75fd571..6ad15e43462f 100644 --- a/slideshow/source/engine/animationnodes/basenode.cxx +++ b/slideshow/source/engine/animationnodes/basenode.cxx @@ -50,6 +50,7 @@ #include "tools.hxx" #include "nodetools.hxx" #include "generateevent.hxx" +#include "debug.hxx" #include <boost/bind.hpp> #include <vector> @@ -312,6 +313,10 @@ public: mpNode->meCurrState = meToState; clear(); } + + // Uncomment the following line to write the node tree to file on + // every state change of one of its nodes. + // Debug_ShowNodeTree(mpNode->mpSelf); } void clear() { @@ -488,7 +493,9 @@ bool BaseNode::resolve() // schedule delayed activation event. Take iterate node // timeout into account mpCurrentEvent = makeDelay( - boost::bind( &AnimationNode::activate, mpSelf ), mnStartDelay ); + boost::bind( &AnimationNode::activate, mpSelf ), + mnStartDelay, + "AnimationNode::activate with delay"); maContext.mrEventQueue.addEvent( mpCurrentEvent ); } diff --git a/slideshow/source/engine/animationnodes/basenode.hxx b/slideshow/source/engine/animationnodes/basenode.hxx index 68ec92f0fea7..3a0b25e7ea94 100644 --- a/slideshow/source/engine/animationnodes/basenode.hxx +++ b/slideshow/source/engine/animationnodes/basenode.hxx @@ -137,6 +137,8 @@ public: // nop: virtual void notifyDeactivating( const AnimationNodeSharedPtr& rNotifier ); + bool isMainSequenceRootNode() const { return mbIsMainSequenceRootNode; } + protected: void scheduleDeactivationEvent( EventSharedPtr const& pEvent = EventSharedPtr() ); @@ -144,8 +146,6 @@ protected: SlideShowContext const& getContext() const { return maContext; } ::boost::shared_ptr<BaseNode> const& getSelf() const { return mpSelf; } - bool isMainSequenceRootNode() const { return mbIsMainSequenceRootNode; } - bool checkValidNode() const { ENSURE_OR_THROW( mpSelf, "no self ptr set!" ); bool const bRet = (meCurrState != INVALID); diff --git a/slideshow/source/engine/animationnodes/generateevent.cxx b/slideshow/source/engine/animationnodes/generateevent.cxx index 0983019dafef..015db5586834 100644 --- a/slideshow/source/engine/animationnodes/generateevent.cxx +++ b/slideshow/source/engine/animationnodes/generateevent.cxx @@ -111,7 +111,9 @@ EventSharedPtr generateEvent( case animations::EventTrigger::BEGIN_EVENT: // try to extract XAnimationNode event source if (aEvent.Source >>= xNode) { - pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay ); + pEvent = makeDelay( rFunctor, + nDelay2 + nAdditionalDelay, + "generateEvent, BEGIN_EVENT"); rContext.mrUserEventQueue.registerAnimationStartEvent( pEvent, xNode ); } @@ -123,7 +125,9 @@ EventSharedPtr generateEvent( case animations::EventTrigger::END_EVENT: // try to extract XAnimationNode event source if (aEvent.Source >>= xNode) { - pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay ); + pEvent = makeDelay( rFunctor, + nDelay2 + nAdditionalDelay, + "generateEvent, END_EVENT"); rContext.mrUserEventQueue.registerAnimationEndEvent( pEvent, xNode ); } @@ -137,7 +141,9 @@ EventSharedPtr generateEvent( if ((aEvent.Source >>= xShape) && (pShape = rContext.mpSubsettableShapeManager->lookupShape(xShape)).get()) { - pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay ); + pEvent = makeDelay( rFunctor, + nDelay2 + nAdditionalDelay, + "generateEvent, ON_CLICK"); rContext.mrUserEventQueue.registerShapeClickEvent( pEvent, pShape ); } @@ -151,7 +157,9 @@ EventSharedPtr generateEvent( if ((aEvent.Source >>= xShape) && (pShape = rContext.mpSubsettableShapeManager->lookupShape(xShape)).get()) { - pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay ); + pEvent = makeDelay( rFunctor, + nDelay2 + nAdditionalDelay, + "generateEvent, ON_DBL_CLICK"); rContext.mrUserEventQueue.registerShapeDoubleClickEvent( pEvent, pShape ); } @@ -165,7 +173,9 @@ EventSharedPtr generateEvent( if ((aEvent.Source >>= xShape) && (pShape = rContext.mpSubsettableShapeManager->lookupShape(xShape)).get()) { - pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay ); + pEvent = makeDelay( rFunctor, + nDelay2 + nAdditionalDelay, + "generateEvent, ON_MOUSE_ENTER"); rContext.mrUserEventQueue.registerMouseEnterEvent( pEvent, pShape ); } @@ -179,7 +189,9 @@ EventSharedPtr generateEvent( if ((aEvent.Source >>= xShape) && (pShape = rContext.mpSubsettableShapeManager->lookupShape(xShape)).get()) { - pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay ); + pEvent = makeDelay( rFunctor, + nDelay2 + nAdditionalDelay, + "generateEvent, ON_MOUSE_LEAVE"); rContext.mrUserEventQueue.registerMouseLeaveEvent( pEvent, pShape ); } @@ -193,13 +205,17 @@ EventSharedPtr generateEvent( "mapped to ON_NEXT!" ); // FALLTHROUGH intended case animations::EventTrigger::ON_NEXT: - pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay ); + pEvent = makeDelay( rFunctor, + nDelay2 + nAdditionalDelay, + "generateEvent, ON_NEXT"); rContext.mrUserEventQueue.registerNextEffectEvent( pEvent ); break; case animations::EventTrigger::ON_STOP_AUDIO: // try to extract XAnimationNode event source if (aEvent.Source >>= xNode) { - pEvent = makeDelay( rFunctor, nDelay2 + nAdditionalDelay ); + pEvent = makeDelay( rFunctor, + nDelay2 + nAdditionalDelay, + "generateEvent, ON_STOP_AUDIO"); rContext.mrUserEventQueue.registerAudioStoppedEvent( pEvent, xNode ); } @@ -218,7 +234,9 @@ EventSharedPtr generateEvent( "not yet implemented!" ); } else if (rEventDescription >>= nDelay1) { - pEvent = makeDelay( rFunctor, nDelay1 + nAdditionalDelay ); + pEvent = makeDelay( rFunctor, + nDelay1 + nAdditionalDelay, + "generateEvent with delay"); // schedule delay event rContext.mrEventQueue.addEvent( pEvent ); } diff --git a/slideshow/source/engine/animationnodes/paralleltimecontainer.cxx b/slideshow/source/engine/animationnodes/paralleltimecontainer.cxx index 0bd4c524586e..0581c78e9c47 100644 --- a/slideshow/source/engine/animationnodes/paralleltimecontainer.cxx +++ b/slideshow/source/engine/animationnodes/paralleltimecontainer.cxx @@ -53,7 +53,8 @@ void ParallelTimeContainer::activate_st() if (isDurationIndefinite() && maChildren.empty()) { // deactivate ASAP: scheduleDeactivationEvent( - makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ) ) ); + makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ), + "ParallelTimeContainer::deactivate") ); } else { // use default scheduleDeactivationEvent(); diff --git a/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx b/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx index 683fe7bd9707..79046f50251a 100644 --- a/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx +++ b/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx @@ -63,7 +63,9 @@ void SequentialTimeContainer::activate_st() { // deactivate ASAP: scheduleDeactivationEvent( - makeEvent( boost::bind< void >( boost::mem_fn( &AnimationNode::deactivate ), getSelf() ) ) ); + makeEvent( + boost::bind< void >( boost::mem_fn( &AnimationNode::deactivate ), getSelf() ), + "SequentialTimeContainer::deactivate") ); } else // use default scheduleDeactivationEvent(); @@ -88,8 +90,10 @@ void SequentialTimeContainer::skipEffect( if (isChildNode(pChildNode)) { // empty all events ignoring timings => until next effect getContext().mrEventQueue.forceEmpty(); - getContext().mrEventQueue.addEventForNextRound( - makeEvent( boost::bind<void>( boost::mem_fn( &AnimationNode::deactivate ), pChildNode ) ) ); + getContext().mrEventQueue.addEvent( + makeEvent( + boost::bind<void>( boost::mem_fn( &AnimationNode::deactivate ), pChildNode ), + "SequentialTimeContainer::deactivate, skipEffect with delay") ); } else OSL_ENSURE( false, "unknown notifier!" ); @@ -116,16 +120,19 @@ bool SequentialTimeContainer::resolveChild( mpCurrentSkipEvent = makeEvent( boost::bind( &SequentialTimeContainer::skipEffect, boost::dynamic_pointer_cast<SequentialTimeContainer>( getSelf() ), - pChildNode ) ); + pChildNode ), + "SequentialTimeContainer::skipEffect, resolveChild"); // event that will reresolve the resolved/activated child: mpCurrentRewindEvent = makeEvent( boost::bind( &SequentialTimeContainer::rewindEffect, boost::dynamic_pointer_cast<SequentialTimeContainer>( getSelf() ), - pChildNode ) ); + pChildNode ), + "SequentialTimeContainer::rewindEffect, resolveChild"); // deactivate child node when skip event occurs: getContext().mrUserEventQueue.registerSkipEffectEvent( - mpCurrentSkipEvent ); + mpCurrentSkipEvent, + mnFinishedChildren+1<maChildren.size()); // rewind to previous child: getContext().mrUserEventQueue.registerRewindEffectEvent( mpCurrentRewindEvent ); |