Allow filesystem path directly in ar recorder
This commit is contained in:
@@ -185,18 +185,17 @@ namespace OpenVulkano::AR
|
||||
}
|
||||
}
|
||||
|
||||
void ArRecorder::SetRecordingPath(const std::string& path)
|
||||
void ArRecorder::SetRecordingPath(const std::filesystem::path& path)
|
||||
{
|
||||
if (!m_session) return;
|
||||
if (!m_colorWriter)
|
||||
{
|
||||
std::filesystem::path p(path);
|
||||
for (MultiPartArchiveWriter* writer: { m_colorWriter.get(), m_depthWriter.get(), m_confidenceWriter.get(), m_metadataWriter.get(), m_highResWriter.get() })
|
||||
{
|
||||
if (writer) writer->Move(p);
|
||||
if (writer) writer->Move(path);
|
||||
}
|
||||
if (std::filesystem::exists(m_settings.path / RECORDING_METADATA_FILENAME))
|
||||
std::filesystem::rename(m_settings.path / RECORDING_METADATA_FILENAME, p / RECORDING_METADATA_FILENAME);
|
||||
std::filesystem::rename(m_settings.path / RECORDING_METADATA_FILENAME, path / RECORDING_METADATA_FILENAME);
|
||||
}
|
||||
|
||||
m_persistent = true;
|
||||
|
||||
@@ -109,7 +109,19 @@ namespace OpenVulkano::AR
|
||||
* If path is changed after starting the recording, the already running recording will be moved to the new path.
|
||||
* @param path The path to be used to store the recording
|
||||
*/
|
||||
void SetRecordingPath(const std::string& path);
|
||||
void SetRecordingPath(const std::string& path)
|
||||
{
|
||||
std::filesystem::path p(path);
|
||||
SetRecordingPath(p);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the directory into which the AR recording should be stored.
|
||||
* The path needs to be set to make the recording persistent.
|
||||
* If path is changed after starting the recording, the already running recording will be moved to the new path.
|
||||
* @param path The path to be used to store the recording
|
||||
*/
|
||||
void SetRecordingPath(const std::filesystem::path& path);
|
||||
|
||||
/**
|
||||
* Gets the current recording path
|
||||
|
||||
Reference in New Issue
Block a user