From 951d8d97d354f53d42f85426515788fc1695d011 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Tue, 17 Jul 2007 13:46:26 +0000 Subject: [PATCH] INTEGRATION: CWS presfixes12 (1.12.12); FILE MERGED 2007/02/25 01:10:25 thb 1.12.12.2: #i37778# Cleared up error handling a lot: no longer quenching RuntimeExceptions; reporting assertions in the debug case; ViewLayer now reports resized sprite (which needs re-render from all shapes); fixed missing subset area reduction for glyph-level animations; added return of resize state from Layer::commitLayerBounds(); adapted unit tests to corrected behaviour 2007/01/29 14:01:59 thb 1.12.12.1: Issue number: #i37778# Larger slideshow refactoring. Wrote design and coding style manifest, and adapted the code to actually conform to this. In detail: - cleaned up ownership/disposable/weak_ptr story. removed hacks and explicit Disposable implementations, where workaround were available - removed object mutices, where superfluous - reworked EventMultiplexer (using templatized listener class now), added more events. EventMultiplexer now serves as a true blackboard - reworked directory structure: disjunct parts are now physically separated into directories, instantiation happens via factories & abstract interfaces - added CursorManager, to make setting mouse cursor less hackish - reworked DrawShape, to implement SeparateListener pattern - reworked IntrinsicAnimationActivity, to avoid cyclic references - modified hyperlink & shape cursor handling to communicate via EventMultiplexer - renamed & cleaned up files (presentation.cxx now named slideshowimpl.cxx, etc.) - added first version of the z-order fix to layer/layermanager - cleaned up include guards and include syntax --- .../animationnodes/animationaudionode.cxx | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/slideshow/source/engine/animationnodes/animationaudionode.cxx b/slideshow/source/engine/animationnodes/animationaudionode.cxx index 8913cb4eee56..8b6ac7defe24 100644 --- a/slideshow/source/engine/animationnodes/animationaudionode.cxx +++ b/slideshow/source/engine/animationnodes/animationaudionode.cxx @@ -4,9 +4,9 @@ * * $RCSfile: animationaudionode.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: kz $ $Date: 2006-12-13 15:28:01 $ + * last change: $Author: obo $ $Date: 2007-07-17 14:46:26 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -37,8 +37,10 @@ #include "precompiled_slideshow.hxx" // must be first -#include "canvas/debug.hxx" -#include "canvas/verbosetrace.hxx" +#include +#include + +#include "eventqueue.hxx" #include "animationaudionode.hxx" #include "delayevent.hxx" #include "tools.hxx" @@ -82,22 +84,26 @@ void AnimationAudioNode::activate_st() AnimationEventHandlerSharedPtr aHandler( boost::dynamic_pointer_cast( getSelf() ) ); OSL_ENSURE( aHandler, - "could not cas self to AnimationEventHandler?" ); + "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( makeDelay( boost::bind( &AnimationNode::deactivate, getSelf() ), mpPlayer->getDuration() ) ); } } - else { + else + { // deactivate ASAP: scheduleDeactivationEvent( makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ) ) ); @@ -116,7 +122,8 @@ void AnimationAudioNode::deactivate_st( NodeState /*eDestState*/ ) getContext().mrEventMultiplexer.removeCommandStopAudioHandler( aHandler ); // force-end sound - if (mpPlayer) { + if (mpPlayer) + { mpPlayer->stopPlayback(); resetPlayer(); } @@ -141,12 +148,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 // is not a hard error here (remainder of the @@ -156,7 +165,8 @@ void AnimationAudioNode::createPlayer() const void AnimationAudioNode::resetPlayer() const { - if (mpPlayer) { + if (mpPlayer) + { mpPlayer->stopPlayback(); mpPlayer->dispose(); mpPlayer.reset();