LibreOffice Module slideshow (master) 1
|
This class handles events in a presentation. More...
#include <eventqueue.hxx>
Classes | |
struct | EventEntry |
Public Member Functions | |
EventQueue (std::shared_ptr< ::canvas::tools::ElapsedTime > pPresTimer) | |
~EventQueue () | |
EventQueue (const EventQueue &)=delete | |
EventQueue & | operator= (const EventQueue &)=delete |
bool | addEvent (const EventSharedPtr &event) |
Add the given event to the queue. More... | |
bool | addEventForNextRound (const EventSharedPtr &event) |
Add the given event to the queue. More... | |
bool | addEventWhenQueueIsEmpty (const EventSharedPtr &rpEvent) |
Another way to control the order of asynchronous event execution. More... | |
void | process () |
Process the event queue. More... | |
bool | isEmpty () const |
Query state of the queue. More... | |
double | nextTimeout () const |
Query timeout for the topmost event in the queue. More... | |
void | clear () |
Remove all pending events from the queue. More... | |
void | forceEmpty () |
Forces an empty queue, firing all events immediately without minding any times. More... | |
std::shared_ptr< ::canvas::tools::ElapsedTime > const & | getTimer () const |
Gets the queue's timer object. More... | |
Private Types | |
typedef ::std::priority_queue< EventEntry > | ImplQueueType |
typedef ::std::vector< EventEntry > | EventEntryVector |
Private Member Functions | |
void | process_ (bool bFireAllEvents) |
Private Attributes | |
std::mutex | maMutex |
ImplQueueType | maEvents |
EventEntryVector | maNextEvents |
ImplQueueType | maNextNextEvents |
std::shared_ptr< ::canvas::tools::ElapsedTime > | mpTimer |
This class handles events in a presentation.
Events are time instants where e.g. effects start.
Definition at line 40 of file eventqueue.hxx.
|
private |
Definition at line 134 of file eventqueue.hxx.
|
private |
Definition at line 132 of file eventqueue.hxx.
slideshow::internal::EventQueue::EventQueue | ( | std::shared_ptr< ::canvas::tools::ElapsedTime > | pPresTimer | ) |
slideshow::internal::EventQueue::~EventQueue | ( | ) |
Definition at line 55 of file eventqueue.cxx.
References maEvents, maNextEvents, and TOOLS_WARN_EXCEPTION.
|
delete |
bool slideshow::internal::EventQueue::addEvent | ( | const EventSharedPtr & | event | ) |
Add the given event to the queue.
The event is fired at, or shortly after, its Event::getActivationTime instant.
Definition at line 79 of file eventqueue.cxx.
References ENSURE_OR_RETURN_FALSE, maEvents, maMutex, mpTimer, and SAL_INFO.
Referenced by slideshow::internal::EffectRewinder::asynchronousRewind(), slideshow::internal::AnimationAudioNode::deactivate_st(), slideshow::internal::ActivityBase::endActivity(), slideshow::internal::generateEvent(), slideshow::internal::AllAnimationEventHandler::handleAnimationEvent(), slideshow::internal::BaseContainerNode::notifyDeactivatedChild(), slideshow::internal::DiscreteActivityBase::perform(), slideshow::internal::SetActivity< AnimationT >::perform(), slideshow::internal::RehearseTimingsActivity::perform(), slideshow::internal::BaseNode::resolve(), slideshow::internal::EffectRewinder::rewind(), slideshow::internal::BaseNode::scheduleDeactivationEvent(), slideshow::internal::EffectRewinder::skipAllMainSequenceEffects(), and slideshow::internal::SequentialTimeContainer::skipEffect().
bool slideshow::internal::EventQueue::addEventForNextRound | ( | const EventSharedPtr & | event | ) |
Add the given event to the queue.
The event is fired at, or shortly after, its Event::getActivationTime instant. The difference to addEvent() is that events added during process() are postponed to next process().
Definition at line 105 of file eventqueue.cxx.
References ENSURE_OR_RETURN_FALSE, maMutex, maNextEvents, mpTimer, and SAL_INFO.
Referenced by slideshow::internal::EventMultiplexerImpl::scheduleTick().
bool slideshow::internal::EventQueue::addEventWhenQueueIsEmpty | ( | const EventSharedPtr & | rpEvent | ) |
Another way to control the order of asynchronous event execution.
Use this method to schedule events that are to be executed after all regular events that have no delay, even when they schedule new regular events without delay.
Definition at line 122 of file eventqueue.cxx.
References ENSURE_OR_RETURN_FALSE, maMutex, maNextNextEvents, mpTimer, and SAL_INFO.
Referenced by slideshow::internal::SkipEffectEventHandler::handleEvent_impl().
void slideshow::internal::EventQueue::clear | ( | ) |
Remove all pending events from the queue.
Definition at line 283 of file eventqueue.cxx.
References maEvents, maMutex, maNextEvents, and maNextNextEvents.
void slideshow::internal::EventQueue::forceEmpty | ( | ) |
Forces an empty queue, firing all events immediately without minding any times.
Definition at line 142 of file eventqueue.cxx.
References process_().
Referenced by slideshow::internal::EffectRewinder::asynchronousRewind(), slideshow::internal::EffectRewinder::rewind(), slideshow::internal::SequentialTimeContainer::skipEffect(), and slideshow::internal::EffectRewinder::skipSingleMainSequenceEffects().
|
inline |
Gets the queue's timer object.
Definition at line 116 of file eventqueue.hxx.
References mpTimer.
Referenced by slideshow::internal::RehearseTimingsActivity::create(), and slideshow::internal::createDrawingLayerAnimActivity().
bool slideshow::internal::EventQueue::isEmpty | ( | ) | const |
Query state of the queue.
Definition at line 259 of file eventqueue.cxx.
References maEvents, maMutex, maNextEvents, and maNextNextEvents.
double slideshow::internal::EventQueue::nextTimeout | ( | ) | const |
Query timeout for the topmost event in the queue.
Definition at line 266 of file eventqueue.cxx.
References maEvents, maMutex, maNextEvents, maNextNextEvents, and mpTimer.
|
delete |
void slideshow::internal::EventQueue::process | ( | ) |
Process the event queue.
This method executes all events whose timeout has expired when calling this method (i.e. all events whose scheduled time is less or equal the current time).
Check for the next available event's timeout via nextTimeout(), or whether the queue is empty altogether via isEmpty().
Definition at line 147 of file eventqueue.cxx.
References process_().
|
private |
Definition at line 152 of file eventqueue.cxx.
References aEvent, maEvents, maMutex, maNextEvents, maNextNextEvents, mpTimer, slideshow::internal::EventQueue::EventEntry::pEvent, SAL_INFO, SAL_WARN, and TOOLS_WARN_EXCEPTION.
Referenced by forceEmpty(), and process().
|
private |
Definition at line 133 of file eventqueue.hxx.
Referenced by addEvent(), clear(), isEmpty(), nextTimeout(), process_(), and ~EventQueue().
|
mutableprivate |
Definition at line 119 of file eventqueue.hxx.
Referenced by addEvent(), addEventForNextRound(), addEventWhenQueueIsEmpty(), clear(), isEmpty(), nextTimeout(), and process_().
|
private |
Definition at line 135 of file eventqueue.hxx.
Referenced by addEventForNextRound(), clear(), isEmpty(), nextTimeout(), process_(), and ~EventQueue().
|
private |
Definition at line 136 of file eventqueue.hxx.
Referenced by addEventWhenQueueIsEmpty(), clear(), isEmpty(), nextTimeout(), and process_().
|
private |
Definition at line 142 of file eventqueue.hxx.
Referenced by addEvent(), addEventForNextRound(), addEventWhenQueueIsEmpty(), getTimer(), nextTimeout(), and process_().