Class for playing back tape files.
More...
#include <fw/TapePlayer.h>
Class for playing back tape files.
◆ TapePlayer()
◆ ~TapePlayer()
◆ reflect()
void reflect |
( |
Reflector & |
r | ) |
|
|
inline |
◆ pause()
◆ isPaused()
Is the playback paused.
- Returns
- true if paused
◆ inStepTo()
return if we are currently in stepTo mode
◆ step()
Do a single step.
Will set pause mode. Jumps to the next chronological message to visit
◆ stepTo() [1/3]
Do a step by playing back all messages between current message time and time.
Stopping again at time, setting pause mode. If time is above last message time in tape, this will just start/resume normal playback (same as play()).
◆ stepTo() [2/3]
bool stepTo |
( |
const std::string & |
channelID | ) |
|
Do a step by playing back all messages between current message time and the time of the next message in channel channelID.
Stopping again at next message time in channel channelID, setting pause mode. By default, returns true; If no such channel or no more messages for it exist, this will just go to the next message immediately and start/resume normal playback (same as play()), then return false.
◆ stepToAnyOf()
bool stepToAnyOf |
( |
const std::vector< std::string > & |
channelIDs | ) |
|
Do a step by playing back all messages between current message time and the time of the next message in any of the channels in channelIDs.
Stopping again at next message time in any of the specified channels, setting pause mode. By default, return true. If no such channel or no more messages for any of them exist, this will just just go to the next message immediately and start/resume normal playback (same as play()), then return false;
◆ stop()
◆ setLoop()
void setLoop |
( |
bool |
loop, |
|
|
int32 |
count = -1 |
|
) |
| |
|
inline |
Turn the loop mode on/off.
- Parameters
-
[in] | loop | Should the tape be played in loop mode |
[in] | count | How often should the tape be played back in loop mode (values < 0 = infinite loops (default)) |
◆ setTimeScaler()
void setTimeScaler |
( |
float |
scaler | ) |
|
|
inline |
Set the time scaling factor for play back.
- Parameters
-
[in] | scaler | The scale factor
- 1 means normal play back,
- 2 means double speed,
- 0.5 means half speed
|
◆ getTimeScaler()
float getTimeScaler |
( |
| ) |
const |
|
inline |
Get the time scaling factor.
- Returns
- Time scaling factor used for playback
◆ load()
Prepares playing back data from the visitor.
- Parameters
-
[in] | iVisitor | The visitor used for visiting the messages. |
[in] | startTime | The tape is played back relatively to this time. |
[in] | prefix | A namespace prefix. This prefix will be appeded to all channel names. |
◆ play()
Starts playing back the messages.
◆ isPlaying()
Are we currently in playback mode (i.e.
a file is opened for playback)
- Returns
- true if playing
◆ hasError()
When an error occurs during play back this method will return true.
In case of an error the play back is stopped automatically and the isPlaying() method will return false. In this case the error message can be obtained via getErrorMessage()
◆ getErrorMessage()
std::string getErrorMessage |
( |
| ) |
const |
|
inline |
Returns the error message of an error that occurred during play back.
◆ getCurrentMessageTimeOffset()
Duration getCurrentMessageTimeOffset |
( |
| ) |
const |
|
inline |
Get the recorded time offset of the currently played or to be played message (if currently paused the current message will be the one that is played after resume)
- Returns
- Recorded time offset of the current message in microseconds
◆ getCurrentMessageTZOffset()
Duration getCurrentMessageTZOffset |
( |
| ) |
const |
|
inline |
Get the recorded time zone offset of the tape containing the currently played or to be played message (if currently paused the current message will be the one that is played after resume)
- Returns
- Recorded time zone offset of the current message in microseconds
◆ getRelativeStartTime()
Time getRelativeStartTime |
( |
| ) |
const |
|
inline |
Returns the relative time the player plays back messages to.
The real message time is defined as relative start time + message time offset.
◆ jumpTo()
Jump to a given message at recorded time offset.
Jumps to the message with an offset closest to time.
- Parameters
-
[in] | time | The time offset of the message in microseconds we like to jump to. |
◆ getAuthority()
Return the authority of the player.
◆ stepTo() [3/3]
◆ doPlay()
◆ mAuthority
◆ mThread
◆ mLoopCount
◆ mLoop
◆ mPause
◆ mPlayImmediately
◆ mIsPlaying
◆ mTimeScaler
◆ mStartTime
◆ mJumpTo
◆ mStepTo
◆ mStepToChannel
◆ mErrorMessage
boost::optional<std::string> mErrorMessage |
|
protected |
◆ mVisitor
◆ mMessage
◆ mConditionMutex
boost::mutex mConditionMutex |
|
protected |
◆ mCondition
boost::condition_variable mCondition |
|
protected |
◆ mNamespacePrefix
std::string mNamespacePrefix |
|
protected |
The documentation for this class was generated from the following file: