ImFusion C++ SDK 4.4.0
ImFusion::PlaybackStreamBase< T > Class Template Reference

#include <ImFusion/Stream/PlaybackStreamBase.h>

Base class for various playback streams. More...

Detailed Description

template<typename T>
class ImFusion::PlaybackStreamBase< T >

Base class for various playback streams.

A playback stream converts a sequence of images or tracking positions into a continuous stream, which can be used in real-time streaming algorithms. An internal playbackTimer controls the stream timing. This class provides basic playback features, such as looping and playback speed adjustment. To update parameters, the derived stream must be restarted, and this base class requires access to the derived type. The CRTP (Curiously Recurring Template Pattern) is used for this purpose.

Public Member Functions

 PlaybackStreamBase (Stream *parentStream=nullptr)
void setLoop (bool loop)
bool loop () const
virtual void setSpeedFactor (double factor)
double speedFactor () const
void jumpToFocus (int focusFrame)
int playbackFocus () const
void setSkipDelayedFrames (bool value)
 Set whether to skip frames in case their subsequent frame is already due.
bool isSkippingDelayedFrames () const
 Return whether to skip frames in case their subsequent frame is already due.
void setUseAbsoluteTimesteps (bool value)
 If set to true, the current time is not taken into account, and the timer will wait for amount of time equal to difference between consecutive timestamps In this case all the frames will be played.
bool useAbsoluteTimesteps () const

Protected Attributes

Streamm_parentStream = nullptr
 If optional parent stream is set, stream data emission is triggered by parent stream.
std::unique_ptr< Threading::PlaybackTimerm_playbackTimer
 Core time controller for the playback stream.
int m_frame = 0
 Save the current forcus frame index.
double m_speedFactor = 1.0
 Decides the speed of a stream.

Member Function Documentation

◆ setSkipDelayedFrames()

template<typename T>
void ImFusion::PlaybackStreamBase< T >::setSkipDelayedFrames ( bool value)
inline

Set whether to skip frames in case their subsequent frame is already due.

This can for instance happen if the time between frames is less than the time needed to process the callback.


The documentation for this class was generated from the following file:
  • ImFusion/Stream/PlaybackStreamBase.h
Search Tab / S to search, Esc to close