Event player class. More...
#include <ilviews/util/evplayer.h>
Public Member Functions | |
IlvEventPlayer () | |
Constructor. More... | |
virtual IlBoolean | load (IlvDisplay *, const char *filename) |
Loads an event sequence. More... | |
virtual void | play (IlvDisplay *display, IlUInt period=1000, IlBoolean movePointer=IlFalse) |
Plays the events. More... | |
void | playOnce (IlvDisplay *display) |
Plays one event at a time. More... | |
virtual void | playOneEvent (IlvAbstractView *view, IlvEvent &event) |
Plays a given event. More... | |
virtual void | recordOneEvent (IlvView *view, IlvEvent &event) |
Records a given event. More... | |
virtual IlBoolean | save (const char *filename) const |
Saves an event sequence. More... | |
virtual void | start () |
Resets the event player. More... | |
void | stop () |
Stops the recording of events. More... | |
Event player class.
Library: xviews or winviews or mviews (mutually exclusive)
This class is designed to handle the recording of sequences of events that occur in the views that it controls. These event sequences can be saved or read from a data file, and played back at any speed.
IlvCurrentEventPlayer
, IlvRecordingEvents
. IlvEventPlayer::IlvEventPlayer | ( | ) |
Constructor.
The constructor initializes a new empty event player ready to record user events or load an event data file.
|
virtual |
Loads an event sequence.
Loads an event sequence from the specified file. The previous list is emptied.
IlTrue
on success and IlFalse
if an error occured.
|
virtual |
Plays the events.
Triggers, at a specified speed, each event stored in this event player. The greater period is, the slower the events will be played back. (In fact, it defines a period of time.) The default value 1000
indicates that the events are played back at the same speed, and with the same intervals between events, as they occurred when they were recorded.
display | A pointer to the IlvDisplay . |
period | Period of time at which events are played back. The default value 1000 represent the normal speed, i.e. the speed at which the events were recorded. Passing 0 means "play as fast as possible". |
movePointer | If IlTrue , the event player will move the mouse pointer to the event location when playing a pointer event. |
void IlvEventPlayer::playOnce | ( | IlvDisplay * | display | ) |
Plays one event at a time.
Triggers only one event at a time. An internal event pointer is updated to point to the next event of the event sequence.
display | A pointer to the IlvDisplay . |
|
virtual |
Plays a given event.
Sends the event event to the view view. The event player calls this method for each event recorded in its event list.
view | The view where the event must be played. |
event | The event to be played. |
Records a given event.
Records the event event for the view view, in the IlvEventPlayer
.
view | The view where the event must be recorded. |
event | The event to be recorded. |
|
virtual |
Saves an event sequence.
Saves the event sequence in the specified file.
filename | The name of the file where to save the event sequence. |
IlTrue
on success and IlFalse
if an error occured.
|
virtual |
Resets the event player.
Resets this event player to the initial state. The event sequence is emptied.
void IlvEventPlayer::stop | ( | ) |
Stops the recording of events.
Stops the recording of events for this event player, if it was the current event recorder.