class MAGES::Recorder::RecorderModule

Overview

The root module for the XR recorder. More…

class RecorderModule: public MAGES::HubModule
{
public:
    // enums

    enum ChapterRecordingMode;

    // classes

    class ChapterInfo;
    class Recording;

    // properties

    int FrameSkip;
    ChapterRecordingMode ChapterMode;
    bool IsRecording;
    string AudioCodec;
    long CurrentFrame;
    string GetRecordingsDataURL;
    string PutRecordingsDataURL;
    string DownloadRecordingURL;
    string DeleteRecordingURL;
    string PatchRecordingURL;
    bool Armed;
    GameObject PlayerMenu;
    GameObject Proxy;
    Utilities.EventDelegator Events;
    Recorder RecorderInstance;
    Player PlayerInstance;
    GameObjectPathCache PathCache;

    // methods

    static long GetRecordingLength(string file);
    override void Startup();
    override void Shutdown();
    virtual override void UpdateModule(UpdatePhase updatePhase);
    async TaskRecording>> GetRecordingsAsync();
    IEnumerable<Recording> GetRecordings();
    Recording StopRecording();
    void PushChapter(string name);
    IReadOnlyList<ChapterInfo> ListChapters();

    void UploadRecording(
        Recording recording,
        System.Action onUploadComplete = null,
        System.Action onUploadUpdate = null,
        bool asInstructor = false
    );

    async Task<(bool Success, string Message)> UploadRecordingAsync(
        Recording recording,
        System.Action onUpdate,
        bool asPublic = false
    );

    async Task<(bool Success, string Message)> PlayRecordingAsync(
        Recording recording,
        System.Action onUpdate
    );
};

Inherited Members

public:
    // properties

    int Version;

    // methods

    void Startup();
    void Shutdown();
    virtual void UpdateModule(UpdatePhase updatePhase);

Detailed Documentation

The root module for the XR recorder.

Properties

int FrameSkip

Gets or sets the number of frames to skip between polling.

ChapterRecordingMode ChapterMode

Gets or sets how chapters are recorded.

bool IsRecording

Gets a value indicating whether the recorder is recording.

string AudioCodec

Gets or sets the audio codec.

long CurrentFrame

Gets the current frame of recording/playback.

string GetRecordingsDataURL

Gets the url to get recordings data.

string PutRecordingsDataURL

Gets the url to put recordings data.

string DownloadRecordingURL

Gets the url to download recordings data.

string DeleteRecordingURL

Gets the url to delete recordings data.

string PatchRecordingURL

Gets the url to patch recordings data.

bool Armed

Gets or sets a value indicating whether the recorder will start recording when appropriate.

This doesn’t mean you can start/stop recording whenever - only before the start action).

GameObject PlayerMenu

Gets the gameobject that is used as the menu of the recorder.

GameObject Proxy

Gets the proxy gameobject.

Utilities.EventDelegator Events

Gets the event delegator.

Recorder RecorderInstance

Gets the recorder instance.

Player PlayerInstance

Gets the player instance.

GameObjectPathCache PathCache

Gets the path cache.

Methods

static long GetRecordingLength(string file)

Gets the length of a recording in seconds.

Parameters:

file

The file to read.

Returns:

The amount of seconds the recording takes.

virtual override void UpdateModule(UpdatePhase updatePhase)

Updates the module during the specified update phase.

Parameters:

updatePhase

The specified update phase.

async TaskRecording>> GetRecordingsAsync()

Gets all recordings asynchronously.

Returns:

A task that can be awaited and all the recordings.

IEnumerable<Recording> GetRecordings()

Gets all recordings.

Returns:

An enumerable of recordings.

Recording StopRecording()

Stop Recording.

Returns:

The recording files.

void PushChapter(string name)

Pushes a chapter into the current recording.

Parameters:

name

The chapter name.

IReadOnlyList<ChapterInfo> ListChapters()

Lists available chapters with their cursor positions.

Returns:

The chapter list.

void UploadRecording(
    Recording recording,
    System.Action onUploadComplete = null,
    System.Action onUploadUpdate = null,
    bool asInstructor = false
)

Uploads a recording.

The onUploadUpdate action is invoked from a background thread, so no use of any Unity API call is allowed.

Parameters:

recording

The recording to upload.

onUploadComplete

Action invoked when the upload completed or failed.

onUploadUpdate

Action invoked when the upload is in progress.

asInstructor

A value indicating whether the recording is an instructor recording.

async Task<(bool Success, string Message)> UploadRecordingAsync(
    Recording recording,
    System.Action onUpdate,
    bool asPublic = false
)

Uploads a recording asynchronously.

Parameters:

recording

The recording to be uploaded.

onUpdate

Function to be called on each update.

asPublic

Wether the recording should be marked as public.

Returns:

Returns a task that can be awaited.

async Task<(bool Success, string Message)> PlayRecordingAsync(
    Recording recording,
    System.Action onUpdate
)

Plays a recording asynchrnonously.

Parameters:

recording

The recording to be blayed.

onUpdate

Function to be called on each update.

Returns:

Returns a task that can be awaited.