22#include <com/sun/star/lang/NoSupportException.hpp>
37 :
BaseNode( xNode, rParent, rContext ),
38 mxAudioNode( xNode,
uno::UNO_QUERY_THROW ),
45 "could not extract sound source URL/empty URL string" );
48 "Invalid component context" );
63 std::dynamic_pointer_cast<AnimationEventHandler>(
getSelf() ) );
65 "could not cast self to AnimationEventHandler?" );
84 "AnimationAudioNode::check if still playing with delay") );
92 makeEvent( [self] () { self->deactivate(); },
93 "AnimationAudioNode::deactivate without delay") );
105struct NotifyAudioStopped
109 NotifyAudioStopped(EventMultiplexer & rEventMultiplexer,
110 ::std::shared_ptr<BaseNode> pSelf)
124 std::dynamic_pointer_cast<AnimationEventHandler>(
getSelf() ) );
125 OSL_ENSURE( aHandler,
126 "could not cast self to AnimationEventHandler?" );
139 "AnimationAudioNode::notifyAudioStopped") );
162 catch( lang::NoSupportException& )
192 double nDuration =
mpPlayer->getDuration();
193 if (!
mpPlayer->isPlaying() || nDuration < 0.0)
197 makeDelay( [self] () { self->deactivate(); },
199 "AnimationAudioNode::deactivate with delay") );
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
EventMultiplexer & m_rEventMultiplexer
::std::shared_ptr< BaseNode > m_pSelf
virtual void activate_st() override
SoundPlayerSharedPtr mpPlayer
void checkPlayingStatus()
void createPlayer() const
AnimationAudioNode(css::uno::Reference< css::animations::XAnimationNode > const &xNode, BaseContainerNodeSharedPtr const &pParent, NodeContext const &rContext)
virtual bool hasPendingAnimation() const override
Query node whether it has an animation pending.
virtual bool handleAnimationEvent(const AnimationNodeSharedPtr &rNode) override
overridden, because we need to deal with STOPAUDIO commands
virtual void deactivate_st(NodeState eDestState) override
css::uno::Reference< css::animations::XAudio > mxAudioNode
virtual void dispose() override
Dispose all object references.
NodeState
The current state of this AnimationNode.
This interface extends AnimationNode with some file-private accessor methods.
virtual css::uno::Reference< css::animations::XAnimationNode > getXAnimationNode() const override
Query the corresponding XAnimationNode.
SlideShowContext const & getContext() const
::std::shared_ptr< BaseNode > const & getSelf() const
virtual void dispose() override
Dispose all object references.
virtual void deactivate() override
Immediately stop this node.
void scheduleDeactivationEvent(EventSharedPtr const &pEvent=EventSharedPtr())
void addCommandStopAudioHandler(const AnimationEventHandlerSharedPtr &rHandler)
Register an event handler that will be called when an XCommand node's with the command STOPAUDIO is a...
void removeCommandStopAudioHandler(const AnimationEventHandlerSharedPtr &rHandler)
bool addEvent(const EventSharedPtr &event)
Add the given event to the queue.
static ::std::shared_ptr< SoundPlayer > create(EventMultiplexer &rEventMultiplexer, const OUString &rSoundURL, const css::uno::Reference< css::uno::XComponentContext > &rComponentContext, MediaFileManager &rMediaFileManager)
Create a sound player object.
#define makeDelay(f, t, d)
#define ENSURE_OR_THROW(c, m)
::std::shared_ptr< BaseContainerNode > BaseContainerNodeSharedPtr
::std::shared_ptr< AnimationNode > AnimationNodeSharedPtr
::std::shared_ptr< AnimationEventHandler > AnimationEventHandlerSharedPtr
EventMultiplexer & mrEventMultiplexer
EventMultiplexer & mrEventMultiplexer
EventQueue & mrEventQueue