class MAGES::Recorder::Player

Overview

Responsible for playing back a recording (XREC file). More…

class Player: public MonoBehaviour
{
public:
    // classes

    class PacketState;
    class ScheduledAction;

    // properties

    string CurrentFilePath;
    double Current01;
    double EndRTSS;
    double Cursor;
    bool Paused;
    UnityEvent OnRunChanged;

    // methods

    async Task<(bool, string)> LoadAsync(
        string filePath,
        System.Action onUpdate
    );

    void Play();
    void LoadAndPlay(string filePath);
    void Stop();
    void SetPaused(bool on);
    void Schedule(System.Action action, double forTime);
};

Detailed Documentation

Responsible for playing back a recording (XREC file).

Properties

string CurrentFilePath

Gets the current file path.

double Current01

Gets the current playback position as a fraction of the total duration.

double EndRTSS

Gets the end of the recording in RTSS.

double Cursor

Gets the current playback position in RTSS.

bool Paused

Gets a value indicating whether the player is paused.

UnityEvent OnRunChanged

Gets the event that is triggered when the player is paused or unpaused.

True when paused.

Methods

void LoadAndPlay(string filePath)

Loads a recording and starts playing it.

Parameters:

filePath

The file to play from.

void Stop()

Stops the player.

void SetPaused(bool on)

Set the player to paused or unpaused.

Parameters:

on

True for paused, false for unpaused.

void Schedule(System.Action action, double forTime)

Schedules an action to be run around a specific time in the cursor.

Parameters:

action

The action to run.

forTime

The point in time where it has to be run.