This class plays a reader, or anything offering events() and reset() as readers do.
More...
#include <player.hpp>
|
| | Player_ (Reader &reader) |
| | Construct the player. The playback starts with the first call to next().
|
| void | setSpeed (const double speed) |
| | Set the playback speed.
|
| double | speed () const |
| | Get the playback speed.
|
| void | pause (const bool paused) |
| | Hold the playhead, so next() delivers nothing.
|
| bool | isPaused () const |
| | Check if the playback is paused.
|
| void | setLoop (const bool loop) |
| | Choose what happens when the reader runs out of events.
|
|
void | restart () |
| | Start again from the beginning.
|
| std::size_t | loops () const |
| | Number of times the playback has started again, either by restart() or by reaching the end.
|
| TimeType | playhead () const |
| | Current position of the playback, which starts at the timestamp of the first event.
|
| bool | isFinished () const |
| | Check if the reader ran out of events with setLoop(false).
|
| void | next (Queue &events) |
| | Deliver what happened since the previous call.
|
| void | next (Queue &events, StampedMatQueue &frames) |
| void | next (Queue &events, StampedMatQueue &frames, ImuQueue &imus) |
template<typename Reader>
class ev::Player_< Reader >
This class plays a reader, or anything offering events() and reset() as readers do.
- Note
- Timestamps are expected in microseconds.
- Examples
- example-event-camera-dataset.cpp.
◆ Player_()
template<typename Reader>
Construct the player. The playback starts with the first call to next().
- Parameters
-
◆ isFinished()
template<typename Reader>
Check if the reader ran out of events with setLoop(false).
- Returns
- True if there is nothing else to deliver
◆ isPaused()
template<typename Reader>
Check if the playback is paused.
- Returns
- True if paused
◆ loops()
template<typename Reader>
Number of times the playback has started again, either by restart() or by reaching the end.
- Returns
- Count
◆ next() [1/3]
template<typename Reader>
◆ next() [2/3]
template<typename Reader>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
| frames | Frames are pushed here |
◆ next() [3/3]
template<typename Reader>
| void ev::Player_< Reader >::next |
( |
Queue & | events, |
|
|
StampedMatQueue & | frames, |
|
|
ImuQueue & | imus ) |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
| imus | Inertial measurements are pushed here |
◆ pause()
template<typename Reader>
Hold the playhead, so next() delivers nothing.
- Parameters
-
| paused | True to pause, false to resume |
◆ playhead()
template<typename Reader>
◆ setLoop()
template<typename Reader>
Choose what happens when the reader runs out of events.
- Parameters
-
| loop | True to start again, false to stop |
◆ setSpeed()
template<typename Reader>
| void ev::Player_< Reader >::setSpeed |
( |
const double | speed | ) |
|
|
inline |
◆ speed()
template<typename Reader>
Get the playback speed.
- Returns
- Speed relative to real time
The documentation for this class was generated from the following file: