libcluon  0.0.148
cluon::Player Class Reference

#include <Player.hpp>

Public Member Functions

 Player (const std::string &file, const bool &autoRewind, const bool &threading) noexcept
 
 ~Player ()
 
std::pair< bool, cluon::data::Envelope > getNextEnvelopeToBeReplayed () noexcept
 
uint32_t delay () const noexcept
 
bool hasMoreData () const noexcept
 
void rewind () noexcept
 
void seekTo (float ratio) noexcept
 
uint32_t totalNumberOfEnvelopesInRecFile () const noexcept
 
void setPlayerListener (std::function< void(cluon::data::PlayerStatus playerStatus)> playerListener) noexcept
 

Constructor & Destructor Documentation

◆ Player()

cluon::Player::Player ( const std::string &  file,
const bool &  autoRewind,
const bool &  threading 
)
noexcept

Constructor.

Parameters
fileFile to play.
autoRewindTrue if the file should be rewind at EOF.
threadingIf set to true, player will load new envelopes from the files in background.

◆ ~Player()

cluon::Player::~Player ( )

Member Function Documentation

◆ delay()

uint32_t cluon::Player::delay ( ) const
noexcept
Returns
real delay in microseconds to be waited before the next cluon::data::Envelope should be delivered.

◆ getNextEnvelopeToBeReplayed()

std::pair< bool, cluon::data::Envelope > cluon::Player::getNextEnvelopeToBeReplayed ( )
noexcept
Returns
Pair of bool and next cluon::data::Envelope to be replayed; if bool is false, no next Envelope is available.

References rewind().

Referenced by seekTo().

◆ hasMoreData()

bool cluon::Player::hasMoreData ( ) const
noexcept
Returns
true if there is more data to replay.

◆ rewind()

void cluon::Player::rewind ( )
noexcept

This method rewinds the iterators.

Referenced by getNextEnvelopeToBeReplayed().

◆ seekTo()

void cluon::Player::seekTo ( float  ratio)
noexcept

◆ setPlayerListener()

void cluon::Player::setPlayerListener ( std::function< void(cluon::data::PlayerStatus playerStatus)>  playerListener)
noexcept

◆ totalNumberOfEnvelopesInRecFile()

uint32_t cluon::Player::totalNumberOfEnvelopesInRecFile ( ) const
noexcept
Returns
total amount of cluon::data::Envelopes in the .rec file.