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
This commit is contained in:
Oliver Bolte 2007-07-17 13:46:26 +00:00
parent 09ee14c6f4
commit 951d8d97d3

View file

@ -4,9 +4,9 @@
* *
* $RCSfile: animationaudionode.cxx,v $ * $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 Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
@ -37,8 +37,10 @@
#include "precompiled_slideshow.hxx" #include "precompiled_slideshow.hxx"
// must be first // must be first
#include "canvas/debug.hxx" #include <canvas/debug.hxx>
#include "canvas/verbosetrace.hxx" #include <canvas/verbosetrace.hxx>
#include "eventqueue.hxx"
#include "animationaudionode.hxx" #include "animationaudionode.hxx"
#include "delayevent.hxx" #include "delayevent.hxx"
#include "tools.hxx" #include "tools.hxx"
@ -82,22 +84,26 @@ void AnimationAudioNode::activate_st()
AnimationEventHandlerSharedPtr aHandler( AnimationEventHandlerSharedPtr aHandler(
boost::dynamic_pointer_cast<AnimationEventHandler>( getSelf() ) ); boost::dynamic_pointer_cast<AnimationEventHandler>( getSelf() ) );
OSL_ENSURE( aHandler, OSL_ENSURE( aHandler,
"could not cas self to AnimationEventHandler?" ); "could not cast self to AnimationEventHandler?" );
getContext().mrEventMultiplexer.addCommandStopAudioHandler( aHandler ); getContext().mrEventMultiplexer.addCommandStopAudioHandler( aHandler );
if (mpPlayer && mpPlayer->startPlayback()) { if (mpPlayer && mpPlayer->startPlayback())
{
// TODO(F2): Handle end time attribute, too // TODO(F2): Handle end time attribute, too
if( getXAnimationNode()->getDuration().hasValue() ) { if( getXAnimationNode()->getDuration().hasValue() )
{
scheduleDeactivationEvent(); scheduleDeactivationEvent();
} }
else { else
{
// no node duration. Take inherent media time, then // no node duration. Take inherent media time, then
scheduleDeactivationEvent( scheduleDeactivationEvent(
makeDelay( boost::bind( &AnimationNode::deactivate, getSelf() ), makeDelay( boost::bind( &AnimationNode::deactivate, getSelf() ),
mpPlayer->getDuration() ) ); mpPlayer->getDuration() ) );
} }
} }
else { else
{
// deactivate ASAP: // deactivate ASAP:
scheduleDeactivationEvent( scheduleDeactivationEvent(
makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ) ) ); makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ) ) );
@ -116,7 +122,8 @@ void AnimationAudioNode::deactivate_st( NodeState /*eDestState*/ )
getContext().mrEventMultiplexer.removeCommandStopAudioHandler( aHandler ); getContext().mrEventMultiplexer.removeCommandStopAudioHandler( aHandler );
// force-end sound // force-end sound
if (mpPlayer) { if (mpPlayer)
{
mpPlayer->stopPlayback(); mpPlayer->stopPlayback();
resetPlayer(); resetPlayer();
} }
@ -141,12 +148,14 @@ void AnimationAudioNode::createPlayer() const
if (mpPlayer) if (mpPlayer)
return; return;
try { try
{
mpPlayer = SoundPlayer::create( getContext().mrEventMultiplexer, mpPlayer = SoundPlayer::create( getContext().mrEventMultiplexer,
maSoundURL, maSoundURL,
getContext().mxComponentContext ); getContext().mxComponentContext );
} }
catch( lang::NoSupportException& ) { catch( lang::NoSupportException& )
{
// catch possible exceptions from SoundPlayer, // catch possible exceptions from SoundPlayer,
// since being not able to playback the sound // since being not able to playback the sound
// is not a hard error here (remainder of the // is not a hard error here (remainder of the
@ -156,7 +165,8 @@ void AnimationAudioNode::createPlayer() const
void AnimationAudioNode::resetPlayer() const void AnimationAudioNode::resetPlayer() const
{ {
if (mpPlayer) { if (mpPlayer)
{
mpPlayer->stopPlayback(); mpPlayer->stopPlayback();
mpPlayer->dispose(); mpPlayer->dispose();
mpPlayer.reset(); mpPlayer.reset();