Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::Recorder Class Reference

Object definition to interact with the recorder. More...

Inheritance diagram for gem::Recorder:
Collaboration diagram for gem::Recorder:

Classes

struct  __allow_private_constructor

Public Member Functions

void startAudioRecording ()
 Starts audio recording.
void stopAudioRecording ()
 Stops audio recording.
bool isAudioRecording ()
 Checks if audio recording is in progress.
int startRecording ()
 Starts the recording.
int stopRecording ()
 Stops the recording.
int pauseRecording ()
 Pauses the recording.
int resumeRecording ()
 Resumes the recording.
int setConfiguration (gem::RecorderConfigurationPtr configuration)
 Updates the recorder settings.
gem::RecorderConfigurationPtr getConfiguration () const
 Retrieves the current configuration of the recorder.
int addListener (ProgressListener listener)
 Adds a listener to monitor recording progress.
int removeListener (ProgressListener listener)
 Removes a registered listener.
ERecorderStatus getStatus ()
 Retrieves the current recorder status.
String getCurrentRecordPath ()
 Gets the path to the current log file.
LargeUnsignedInteger addUserData (LargeUnsignedInteger dataTypeIdentifier, const DataBuffer &userData)
 Records custom user data with the current session.
void addUserMetadata (const String &key, const DataBuffer &userMetadata)
 This method allows adding a user-defined key-value pair to the log metadata.
void addBitmap (StrongPointer< IBitmap > bitmap)
 Saves a bitmap in the log metadata.
void addTextMark (const String &report)
 Adds a textual annotation (text mark) at the current position in the log.
void setActivityRecord (const ActivityRecord &activityRecord)
 Sets the details of the recorded activity.
long diskSpaceUsedPerSecond () const
 Space used, in bytes, for 1 sec of log recording.
RecordMetrics getMetrics ()
 Retrieves the metrics for the currently active recording session.

Static Public Member Functions

static StrongPointer< Recorderproduce (gem::RecorderConfigurationPtr config={})
 Creates a new recorder object.

Protected Types

using Base = ApiObject<IRecorder, false>
 The base class.

Detailed Description

Object definition to interact with the recorder.

Records navigation and sensor sessions.

Captures sensor and navigation data streams into logs that can be saved, replayed, or analyzed later.Useful for debugging and offline testing.

Member Function Documentation

◆ addBitmap()

void gem::Recorder::addBitmap ( StrongPointer< IBitmap > bitmap)
inline

Saves a bitmap in the log metadata.

This method allows adding an image represented as a bitmap to the log metadata. The bitmap must be provided as a strong pointer and will be included in the final log. Call this method before stopping the recording to ensure the bitmap is saved in the log.

Parameters
[in]bitmapThe bitmap to be recorded. It must be a valid, non-null strong pointer to an IBitmap object.
Note
Calling this method after stopping the recording will have no effect, as the log metadata is finalized during the stop process.

◆ addListener()

int gem::Recorder::addListener ( ProgressListener listener)
inline

Adds a listener to monitor recording progress.

Parameters
[in]listenerThe listener to register.
Returns
KNoError Successfully registered the listener.
KExist The listener was already registered.

◆ addTextMark()

void gem::Recorder::addTextMark ( const String & report)
inline

Adds a textual annotation (text mark) at the current position in the log.

Parameters
reportThe text content of the annotation.

◆ addUserData()

LargeUnsignedInteger gem::Recorder::addUserData ( LargeUnsignedInteger dataTypeIdentifier,
const DataBuffer & userData )
inline

Records custom user data with the current session.

Parameters
[in]dataTypeIdentifierIdentifier for the data type.
[in]userDataThe data buffer to record.
Returns
The generated timestamp for the recorded data.

◆ addUserMetadata()

void gem::Recorder::addUserMetadata ( const String & key,
const DataBuffer & userMetadata )
inline

This method allows adding a user-defined key-value pair to the log metadata.

The key is a string identifier, and the value is a buffer containing the associated data. This method must be called before stopping the recording to ensure the metadata is saved in the final log.

Parameters
[in]keyThe string identifier for the metadata. Must be unique within the log.
[in]userMetadataThe buffer containing the custom metadata to be recorded.
Note
Calling this method after stopping the recording will have no effect, as the log metadata is finalized during the stop process.

◆ diskSpaceUsedPerSecond()

long gem::Recorder::diskSpaceUsedPerSecond ( ) const
inline

Space used, in bytes, for 1 sec of log recording.

Returns
The estimated disk space used per second of recording, in bytes.

◆ getConfiguration()

gem::RecorderConfigurationPtr gem::Recorder::getConfiguration ( ) const
inline

Retrieves the current configuration of the recorder.

Returns
A RecorderConfigurationPtr containing the current configuration settings of the recorder.

This method provides access to the current configuration used by the recorder. The returned configuration reflects the parameters set during initialization or any subsequent modifications made via setConfiguration(). This can be useful for verifying the recorder's setup or for debugging purposes.

◆ getCurrentRecordPath()

String gem::Recorder::getCurrentRecordPath ( )
inline

Gets the path to the current log file.

Returns
The full path to the active log file.

◆ getMetrics()

RecordMetrics gem::Recorder::getMetrics ( )
inline

Retrieves the metrics for the currently active recording session.

Returns
RecordMetrics structure containing the metrics of the active record.

◆ getStatus()

ERecorderStatus gem::Recorder::getStatus ( )
inline

Retrieves the current recorder status.

Returns
The current status as an ERecorderStatus value.

◆ isAudioRecording()

bool gem::Recorder::isAudioRecording ( )
inline

Checks if audio recording is in progress.

Returns
true if audio recording is ongoing; otherwise, false.

◆ pauseRecording()

int gem::Recorder::pauseRecording ( )
inline

Pauses the recording.

Initiates the process of pausing the recording and transitions the recorder status to Pausing first. If the pause operation is successful, the status will change to Paused. A notification is issued upon successful pause.

Returns
KNoError Successfully transitioned to the Paused state.
KBusy The recorder could not transition to Pausing because it is busy with another operation.
KGeneral A general error occurred while attempting to pause the recording.

◆ produce()

StrongPointer< Recorder > gem::Recorder::produce ( gem::RecorderConfigurationPtr config = {})
inlinestatic

Creates a new recorder object.

Parameters
[in]configThe configuration structure used to initialize the recorder. This parameter is optional and defaults to an empty configuration if not provided.
Returns
A StrongPointer to the newly created Recorder object.

This static method instantiates a Recorder object based on the provided configuration. If no configuration is supplied (i.e., config is empty), the recorder will not be ready to start recording. In this case, the setConfiguration method must be called with a valid configuration before invoking startRecording(). Failure to set a valid configuration will result in startRecording() returning KInvalidInput.

◆ removeListener()

int gem::Recorder::removeListener ( ProgressListener listener)
inline

Removes a registered listener.

Parameters
[in]listenerThe listener to be removed.
Returns
KNoError Successfully removed the listener.
KNotFound The listener was not previously registered.

◆ resumeRecording()

int gem::Recorder::resumeRecording ( )
inline

Resumes the recording.

Initiates the process of resuming the recording and transitions the recorder status to Resuming first. If the resume operation is successful, the status will change back to Recording. A notification is issued upon successful resume.

Returns
KNoError Successfully transitioned to the Recording state.
KBusy The recorder could not transition to Resuming because it is busy with another operation.
KGeneral A general error occurred while attempting to resume the recording.

◆ setActivityRecord()

void gem::Recorder::setActivityRecord ( const ActivityRecord & activityRecord)
inline

Sets the details of the recorded activity.

Call this method before stopping the record.

Parameters
activityRecordAn ActivityRecord object containing the details of the activity to be set.

◆ setConfiguration()

int gem::Recorder::setConfiguration ( gem::RecorderConfigurationPtr configuration)
inline

Updates the recorder settings.

Stops the recorder, updates its settings, and restarts it.

Parameters
[in]configurationThe new recorder configuration.
Returns
KNoError Successfully updated the configuration.
KBusy Could not update the configuration because the recorder was active.
KGeneral General error during configuration update.

◆ startAudioRecording()

void gem::Recorder::startAudioRecording ( )
inline

Starts audio recording.

Resumes audio recording only if a recording is currently active and audio recording is enabled (bEnableAudio in the configuration).

◆ startRecording()

int gem::Recorder::startRecording ( )
inline

Starts the recording.

Initiates the recording process and transitions the recorder status to Starting first. If the start is successful, the status will change to Recording. A notification is issued upon successful start. If the operation fails, an error code is returned.

Returns
KNoError Successfully transitioned to the Recording state.
KBusy The recorder could not transition to Starting because it is busy with another operation.
KInvalidInput The recorder configuration is invalid.
KNoDiskSpace Insufficient disk space available to start the recording.
KOverheated The device temperature is too high to start the recording.
KAccessDenied Required sensor permissions are missing to start recording.
KGeneral A general error occurred while attempting to start the recording.

◆ stopAudioRecording()

void gem::Recorder::stopAudioRecording ( )
inline

Stops audio recording.

Suspends audio recording only if a recording is currently active and audio recording is enabled (bEnableAudio in the configuration).

◆ stopRecording()

int gem::Recorder::stopRecording ( )
inline

Stops the recording.

Stops the recording process and transitions the recorder status to Stopping first. If the stop is successful (i.e., the recording duration meets the minLogDuration), the status will change to Stopped. A notification is issued upon successful stop. If bContinuousRecording is set to true and the recording reaches the chunk duration, the status will transition to Restarting instead of Stopped, and a new recording session will begin automatically.

Returns
KNoError Successfully transitioned to the Stopped or Restarting state.
KRecordedLogTooShort The recorded log duration was shorter than the minLogDuration set in recorder configuration.
KBusy The recorder could not transition to Stopping because it is busy with another operation.
KGeneral A general error occurred while attempting to stop the recording.