Voyant API 0.2.1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
VoyantPlayback Class Reference

C++ wrapper for the Voyant playback system with timing capabilities. More...

#include <voyant_playback.hpp>

Public Member Functions

 VoyantPlayback (double rate=1.0, bool loop=false, bool filter_points=false)
 
 ~VoyantPlayback ()
 Destructor.
 
 VoyantPlayback (const VoyantPlayback &)=delete
 Non-copyable.
 
VoyantPlaybackoperator= (const VoyantPlayback &)=delete
 
bool openFile (const std::string &filePath)
 
bool nextFrame ()
 
const VoyantFrameWrappercurrentFrame () const
 
VoyantFrameWrappercurrentFrame ()
 
uint64_t currentFrameTimestamp ()
 
size_t currentFrameIndex ()
 
size_t getFramesProcessed () const
 
size_t getLoopsCompleted () const
 
bool isValid () const
 
std::string getLastError () const
 

Detailed Description

C++ wrapper for the Voyant playback system with timing capabilities.

Constructor & Destructor Documentation

◆ VoyantPlayback() [1/2]

VoyantPlayback::VoyantPlayback ( double  rate = 1.0,
bool  loop = false,
bool  filter_points = false 
)

Constructor

Parameters
ratePlayback rate (1.0 = real-time, 0 = as fast as possible)
loopWhether to loop when reaching the end of file
filter_pointsWhether to filter out invalid points during playback. When true, invalid points will be removed from frames. When false, all points including invalid ones will be included.

◆ ~VoyantPlayback()

VoyantPlayback::~VoyantPlayback ( )

Destructor.

◆ VoyantPlayback() [2/2]

VoyantPlayback::VoyantPlayback ( const VoyantPlayback )
delete

Non-copyable.

Member Function Documentation

◆ currentFrame() [1/2]

VoyantFrameWrapper & VoyantPlayback::currentFrame ( )

Gets the current frame (mutable version)

Returns
Mutable reference to the current frame
Warning
Only valid if nextFrame() returned true and no error occurred

◆ currentFrame() [2/2]

const VoyantFrameWrapper & VoyantPlayback::currentFrame ( ) const

Gets the current frame (const version)

Returns
Const reference to the current frame
Warning
Only valid if nextFrame() returned true and no error occurred

◆ currentFrameIndex()

size_t VoyantPlayback::currentFrameIndex ( )

Gets the current frame index (0-based)

Returns
Current frame index, 0 if invalid
Warning
Only valid if nextFrame() returned true and no error occurred

◆ currentFrameTimestamp()

uint64_t VoyantPlayback::currentFrameTimestamp ( )

Gets the current frame timestamp in nanoseconds

Returns
Timestamp in nanoseconds, 0 if invalid
Warning
Only valid if nextFrame() returned true and no error occurred

◆ getFramesProcessed()

size_t VoyantPlayback::getFramesProcessed ( ) const

Gets the number of frames processed

Returns
Number of frames processed

◆ getLastError()

std::string VoyantPlayback::getLastError ( ) const

Gets the last error message

Returns
Last error message or empty string if no error

◆ getLoopsCompleted()

size_t VoyantPlayback::getLoopsCompleted ( ) const

Gets the number of loops completed

Returns
Number of loops completed

◆ isValid()

bool VoyantPlayback::isValid ( ) const

Checks if the playback handle is valid

Returns
true if valid, false otherwise

◆ nextFrame()

bool VoyantPlayback::nextFrame ( )

Reads the next frame, automatically applying timing and handling loopback and parses the frame data into the pre-allocated frame wrapper

Returns
true if a frame was successfully read, false if at end of file or error

◆ openFile()

bool VoyantPlayback::openFile ( const std::string &  filePath)

Opens a file for playback

Parameters
filePathPath to the recording file
Returns
true if successful, false otherwise

◆ operator=()

VoyantPlayback & VoyantPlayback::operator= ( const VoyantPlayback )
delete

The documentation for this class was generated from the following file: