From 2e4edd93f6beb5729e5371336eeef84894ce99bd Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Thu, 10 Mar 2005 12:41:56 +0000 Subject: INTEGRATION: CWS presfixes01 (1.4.6); FILE MERGED 2005/02/17 23:56:50 thb 1.4.6.4: #i42499# Made de-spriting of shape effects happen in new Activity::dequeued() method; removed Activity::end() method; fixed calculation of XSlideShow::update() wait interval; slightly modified pres time handling, pres time is now held during _all_ queue processing, including EventQueue (generated funny bounce and break effects, because delayed activities got out of sync); clarified documentation 2005/02/07 01:05:36 thb 1.4.6.3: #i38960# Slight adaptions for new timer handling: event and activities queue now share a timer, such that e.g. a hold on this timer affects the other queue, too; slight reworks to slidechangebase, now creating the slide bitmap(s) on start(), too. 2005/02/02 22:46:58 dbo 1.4.6.2: #i37777# - timing changes for activities queue - minor fixes Issue number: Submitted by: Reviewed by: 2005/01/27 15:58:17 dbo 1.4.6.1: #i39662# using shared timer for correct pausing Issue number: Submitted by: Reviewed by: --- slideshow/source/engine/eventqueue.cxx | 38 ++++++++++++---------------------- 1 file changed, 13 insertions(+), 25 deletions(-) (limited to 'slideshow/source/engine/eventqueue.cxx') diff --git a/slideshow/source/engine/eventqueue.cxx b/slideshow/source/engine/eventqueue.cxx index f453b7ccb04f..15507a380248 100644 --- a/slideshow/source/engine/eventqueue.cxx +++ b/slideshow/source/engine/eventqueue.cxx @@ -2,9 +2,9 @@ * * $RCSfile: eventqueue.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: rt $ $Date: 2004-11-26 18:53:02 $ + * last change: $Author: vg $ $Date: 2005-03-10 13:41:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -96,9 +96,10 @@ namespace presentation } - EventQueue::EventQueue() : - maEvents(), - maElapsedTime() + EventQueue::EventQueue( + boost::shared_ptr const & pPresTimer ) + : maEvents(), + mpTimer( pPresTimer ) { } @@ -122,7 +123,7 @@ namespace presentation // prepare entry EventEntry entry; - const double nCurrTime( maElapsedTime.getElapsedTime() ); + const double nCurrTime( mpTimer->getElapsedTime() ); entry.pEvent = rEvent; entry.nTime = rEvent->getActivationTime( nCurrTime ); @@ -138,14 +139,14 @@ namespace presentation return true; } - void EventQueue::process( double* pTimeoutForNextCall ) + double EventQueue::process() { VERBOSE_TRACE( "EventQueue: heartbeat" ); // perform topmost, ready-to-execute event // ======================================= - const double nCurrTime( maElapsedTime.getElapsedTime() ); + const double nCurrTime( mpTimer->getElapsedTime() ); // process ready/elapsed events. Note that the 'perceived' // current time remains constant for this loop, thus we're @@ -197,23 +198,10 @@ namespace presentation } } - // setup optional timeout value - if( pTimeoutForNextCall ) - { - if( maEvents.empty() ) - { - // no further events available, - *pTimeoutForNextCall = ::std::numeric_limits::max(); - } - else - { - // ensure nothing negative is returned. Fetch - // fresh current time, event processing above - // might have taken significant time - *pTimeoutForNextCall = ::std::max(0.0, - maEvents.top().nTime - maElapsedTime.getElapsedTime()); - } - } + // return time for next entry (if any) + return maEvents.empty() ? + ::std::numeric_limits::max() : + maEvents.top().nTime; } bool EventQueue::isEmpty() -- cgit