21#include <com/sun/star/presentation/EffectCommands.hpp>
22#include <com/sun/star/presentation/EffectNodeType.hpp>
23#include <com/sun/star/animations/AnimationNodeType.hpp>
24#include <com/sun/star/animations/XAudio.hpp>
25#include <com/sun/star/animations/Timing.hpp>
26#include <com/sun/star/beans/PropertyValue.hpp>
40bool IsTimingRootNode(
const uno::Reference<animations::XAnimationNode>& xNode)
42 uno::Sequence<beans::NamedValue> aUserData = xNode->getUserData();
44 auto it =
aMap.find(
"node-type");
50 sal_Int16 nNodeType{};
51 if (!(it->second >>= nNodeType))
56 return nNodeType == css::presentation::EffectNodeType::TIMING_ROOT;
60uno::Reference<animations::XAnimationNode>
61GetTimingRoot(
const uno::Reference<animations::XAnimationNode>& xNode)
63 uno::Reference<animations::XAnimationNode> xParent(xNode->getParent(), uno::UNO_QUERY);
71 if (IsTimingRootNode(xParent))
76 xParent.set(xParent->getParent(), uno::UNO_QUERY);
85namespace EffectCommands = css::presentation::EffectCommands;
88 ::std::shared_ptr<BaseContainerNode>
const& pParent,
90 BaseNode( xNode, pParent, rContext ),
92 mxCommandNode( xNode, css::
uno::UNO_QUERY_THROW )
97 mpShape = ::std::dynamic_pointer_cast< IExternalMediaShapeBase >( pShape );
114 if (!xEnumAccess.is())
120 while (xNodes->hasMoreElements())
123 if (xNode->getType() != animations::AnimationNodeType::AUDIO)
130 if (xSource != xShape)
135 animations::Timing eTiming{};
136 if ((xAudio->getRepeatCount() >>= eTiming) && eTiming == animations::Timing_INDEFINITE)
148 case EffectCommands::CUSTOM:
break;
150 case EffectCommands::VERB:
break;
152 case EffectCommands::PLAY:
154 double fMediaTime=0.0;
155 beans::PropertyValue aMediaTime;
156 if( (
mxCommandNode->getParameter() >>= aMediaTime) && aMediaTime.Name ==
"MediaTime" )
158 aMediaTime.Value >>= fMediaTime;
162 mpShape->setMediaTime(fMediaTime/1000.0);
176 case EffectCommands::TOGGLEPAUSE:
188 case EffectCommands::STOP:
195 case EffectCommands::STOPAUDIO:
203 makeEvent( [self] () { self->deactivate(); },
204 "AnimationCommandNode::deactivate" ) );
AnimatableShapeSharedPtr mpShape
static bool GetLoopingFromAnimation(const css::uno::Reference< css::animations::XCommand > &xCommandNode, const css::uno::Reference< css::drawing::XShape > &xShape)
Assuming that xCommandNode is a play command, determines if an audio node wants looping when xShape p...
AnimationCommandNode(css::uno::Reference< css::animations::XAnimationNode > const &xNode, ::std::shared_ptr< BaseContainerNode > const &pParent, NodeContext const &rContext)
virtual void dispose() override
Dispose all object references.
css::uno::Reference< css::animations::XCommand > mxCommandNode
css::uno::Reference< css::drawing::XShape > mxShape
IExternalMediaShapeBaseSharedPtr mpShape
virtual bool hasPendingAnimation() const override
Query node whether it has an animation pending.
virtual void activate_st() override
This interface extends AnimationNode with some file-private accessor methods.
SlideShowContext const & getContext() const
::std::shared_ptr< BaseNode > const & getSelf() const
virtual void dispose() override
Dispose all object references.
void scheduleDeactivationEvent(EventSharedPtr const &pEvent=EventSharedPtr())
bool notifyCommandStopAudio(const AnimationNodeSharedPtr &rNode)
Notify that all audio has to be stopped.
::std::shared_ptr< Shape > ShapeSharedPtr
HashMap_OWString_Interface aMap
std::shared_ptr< SubsettableShapeManager > mpSubsettableShapeManager
EventMultiplexer & mrEventMultiplexer