This class implements the abstract base class for all device players.
More...
#include <DevicePlayer.h>
|
| DevicePlayer ()=default |
| Creates a new device player.
|
|
virtual | ~DevicePlayer () |
| Destructs the device player.
|
|
virtual bool | initialize (const std::string &filename)=0 |
| Initializes the player with a recording.
|
|
virtual bool | start (const float speed=1.0f)=0 |
| Starts the replay.
|
|
virtual bool | stop ()=0 |
| Stops the replay.
|
|
virtual Timestamp | playNextFrame ()=0 |
| Plays the next frame of the recording, the player must be started with stop-motion mode ('SPEED_USE_STOP_MOTION').
|
|
virtual double | duration () const =0 |
| Returns the duration of the content when played with default speed.
|
|
virtual Media::FrameMediumRefs | frameMediums () |
| Returns all frame media objects which have been created based on the recording.
|
|
virtual TransformationResult | transformation (const std::string &name, const Timestamp ×tamp, HomogenousMatrixD4 &matrix)=0 |
| Returns a specific transformation which is expected to be part of the recording.
|
|
virtual bool | isStarted () const =0 |
| Returns whether this player is currently started.
|
|
virtual bool | isValid () const |
| Returns whether this player holds a valid recording.
|
|
|
static constexpr float | SPEED_USE_STOP_MOTION = 0.0f |
| Definition of a speed value for the stop-motion replay mode.
|
|
|
std::string | filename_ |
| The filename of the recording which is used.
|
|
Lock | lock_ |
| The player's lock.
|
|
This class implements the abstract base class for all device players.
The device player can be used to re-play a previously captured data and exposing the data through devices.
◆ TransformationResult
Definition of individual transformation results.
Enumerator |
---|
TR_DOES_NOT_EXIST | The transformation does not exist in the recording.
|
TR_INTERPOLATED | The resulting transformation is valid but interpolated due to a not perfectly matching timestamp.
|
TR_PRECISE | The resulting transformation is valid and the timestamp matched perfectly with a transformation in the recording.
|
◆ DevicePlayer()
Ocean::Devices::DevicePlayer::DevicePlayer |
( |
| ) |
|
|
default |
Creates a new device player.
◆ ~DevicePlayer()
virtual Ocean::Devices::DevicePlayer::~DevicePlayer |
( |
| ) |
|
|
virtual |
Destructs the device player.
◆ duration()
virtual double Ocean::Devices::DevicePlayer::duration |
( |
| ) |
const |
|
pure virtual |
Returns the duration of the content when played with default speed.
- Returns
- The recording's default duration, in seconds, with range [0, infinity)
◆ frameMediums()
Returns all frame media objects which have been created based on the recording.
- Returns
- The media objects, empty if the recording does not contain any frame medium objects
◆ initialize()
virtual bool Ocean::Devices::DevicePlayer::initialize |
( |
const std::string & |
filename | ) |
|
|
pure virtual |
Initializes the player with a recording.
- Parameters
-
filename | The name of the file to be used in the player, must be valid |
- Returns
- True, if succeeded
◆ isStarted()
virtual bool Ocean::Devices::DevicePlayer::isStarted |
( |
| ) |
const |
|
pure virtual |
Returns whether this player is currently started.
- Returns
- True, if so
◆ isValid()
virtual bool Ocean::Devices::DevicePlayer::isValid |
( |
| ) |
const |
|
virtual |
Returns whether this player holds a valid recording.
- Returns
- True, if so
◆ playNextFrame()
virtual Timestamp Ocean::Devices::DevicePlayer::playNextFrame |
( |
| ) |
|
|
pure virtual |
Plays the next frame of the recording, the player must be started with stop-motion mode ('SPEED_USE_STOP_MOTION').
In case the recording holds several media objects, the fist media objects is used to identify the next frame.
This function will read all records which have been recorded before or at the same time as the next frame of the first media object.
If the recording does not have any media object nothing happens.
- Returns
- The timestamp of the frame which has been played, invalid if no additional frame exists
- See also
- start(), frameMediums().
◆ start()
virtual bool Ocean::Devices::DevicePlayer::start |
( |
const float |
speed = 1.0f | ) |
|
|
pure virtual |
Starts the replay.
The recording can be payed with individual speed, e.g., real-time, slower than real-time, faster than real-time.
Further, the player support a stop-motion mode in which the player will play one frame by another.
- Parameters
-
speed | The speed at which the recording will be played, e.g., 2 means two times faster than normal, with range (0, infinity), 'SPEED_USE_STOP_MOTION' to play the recording in a stop-motion (frame by frame) mode |
- Returns
- True, if succeeded
- See also
- duration(), playNextFrame();
◆ stop()
virtual bool Ocean::Devices::DevicePlayer::stop |
( |
| ) |
|
|
pure virtual |
Stops the replay.
- Returns
- True, if succeeded
◆ transformation()
Returns a specific transformation which is expected to be part of the recording.
This function is intended as a helper function to simplify access to important transformations which otherwise would be accessed through the player's tracking devices.
- Parameters
-
name | The name of the transformation, must be valid |
timestamp | The timestamp for which the transformation is evaluated, must be valid |
matrix | The resulting transformation matrix |
- Returns
- The transformation result
◆ filename_
std::string Ocean::Devices::DevicePlayer::filename_ |
|
protected |
The filename of the recording which is used.
◆ lock_
Lock Ocean::Devices::DevicePlayer::lock_ |
|
mutableprotected |
◆ SPEED_USE_STOP_MOTION
constexpr float Ocean::Devices::DevicePlayer::SPEED_USE_STOP_MOTION = 0.0f |
|
staticconstexpr |
Definition of a speed value for the stop-motion replay mode.
The documentation for this class was generated from the following file: