diff options
Diffstat (limited to 'slideshow/source/engine/animationnodes/animationaudionode.cxx')
-rw-r--r-- | slideshow/source/engine/animationnodes/animationaudionode.cxx | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/slideshow/source/engine/animationnodes/animationaudionode.cxx b/slideshow/source/engine/animationnodes/animationaudionode.cxx index 64c91e2a2519..a03336650459 100644 --- a/slideshow/source/engine/animationnodes/animationaudionode.cxx +++ b/slideshow/source/engine/animationnodes/animationaudionode.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,7 +46,7 @@ namespace slideshow { namespace internal { AnimationAudioNode::AnimationAudioNode( - const uno::Reference< animations::XAnimationNode >& xNode, + const uno::Reference< animations::XAnimationNode >& xNode, const BaseContainerNodeSharedPtr& rParent, const NodeContext& rContext ) : BaseNode( xNode, rParent, rContext ), @@ -55,10 +55,10 @@ AnimationAudioNode::AnimationAudioNode( mpPlayer() { mxAudioNode->getSource() >>= maSoundURL; - + OSL_ENSURE( maSoundURL.getLength(), "could not extract sound source URL/empty URL string" ); - + ENSURE_OR_THROW( getContext().mxComponentContext.is(), "Invalid component context" ); } @@ -73,21 +73,21 @@ void AnimationAudioNode::dispose() void AnimationAudioNode::activate_st() { createPlayer(); - + AnimationEventHandlerSharedPtr aHandler( boost::dynamic_pointer_cast<AnimationEventHandler>( getSelf() ) ); OSL_ENSURE( aHandler, "could not cast self to AnimationEventHandler?" ); getContext().mrEventMultiplexer.addCommandStopAudioHandler( aHandler ); - - if (mpPlayer && mpPlayer->startPlayback()) + + if (mpPlayer && mpPlayer->startPlayback()) { // TODO(F2): Handle end time attribute, too - if( getXAnimationNode()->getDuration().hasValue() ) + if( getXAnimationNode()->getDuration().hasValue() ) { scheduleDeactivationEvent(); } - else + else { // no node duration. Take inherent media time, then scheduleDeactivationEvent( @@ -96,7 +96,7 @@ void AnimationAudioNode::activate_st() "AnimationAudioNode::deactivate with delay") ); } } - else + else { // deactivate ASAP: scheduleDeactivationEvent( @@ -115,14 +115,14 @@ void AnimationAudioNode::deactivate_st( NodeState /*eDestState*/ ) OSL_ENSURE( aHandler, "could not cas self to AnimationEventHandler?" ); getContext().mrEventMultiplexer.removeCommandStopAudioHandler( aHandler ); - + // force-end sound - if (mpPlayer) + if (mpPlayer) { mpPlayer->stopPlayback(); resetPlayer(); } - + // notify _after_ state change: getContext().mrEventQueue.addEvent( makeEvent( boost::bind( &EventMultiplexer::notifyAudioStopped, @@ -143,14 +143,14 @@ void AnimationAudioNode::createPlayer() const { if (mpPlayer) return; - - try + + try { mpPlayer = SoundPlayer::create( getContext().mrEventMultiplexer, maSoundURL, getContext().mxComponentContext ); } - catch( lang::NoSupportException& ) + catch( lang::NoSupportException& ) { // catch possible exceptions from SoundPlayer, // since being not able to playback the sound @@ -161,7 +161,7 @@ void AnimationAudioNode::createPlayer() const void AnimationAudioNode::resetPlayer() const { - if (mpPlayer) + if (mpPlayer) { mpPlayer->stopPlayback(); mpPlayer->dispose(); |