diff --git a/openVulkanoCpp/AR/ArSessionMetadata.cpp b/openVulkanoCpp/AR/ArSessionMetadata.cpp index 6e6f96c..b9fce28 100644 --- a/openVulkanoCpp/AR/ArSessionMetadata.cpp +++ b/openVulkanoCpp/AR/ArSessionMetadata.cpp @@ -83,7 +83,7 @@ namespace OpenVulkano::AR std::filesystem::exists(dirPath / RECORDING_METADATA_FILENAME); } - ArSessionMetadata::ArSessionMetadata(const std::filesystem::path& dirPath) + ArSessionMetadata ArSessionMetadata::FromFile(const std::filesystem::path& dirPath) { std::optional metaFromFile; if (!is_directory(dirPath)) throw std::runtime_error("Ar recording path must be a directory!"); @@ -103,10 +103,8 @@ namespace OpenVulkano::AR metaFromFile = FromYaml(ymlInfoPath.string()); } if (!metaFromFile) throw std::runtime_error("Ar recording dir is missing platform metadata file!"); - type = metaFromFile->type; - depthFormat = metaFromFile->depthFormat; - confidenceRange = metaFromFile->confidenceRange; - playback = true; + metaFromFile->playback = true; + return *metaFromFile; } std::string ArSessionMetadata::FinishedRecordingInfoToYaml() const diff --git a/openVulkanoCpp/AR/ArSessionMetadata.hpp b/openVulkanoCpp/AR/ArSessionMetadata.hpp index ddd57ec..393c3da 100644 --- a/openVulkanoCpp/AR/ArSessionMetadata.hpp +++ b/openVulkanoCpp/AR/ArSessionMetadata.hpp @@ -46,7 +46,7 @@ namespace OpenVulkano::AR , recFrameCount(frameCount), recDuration(duration), recSkippedFrames(skippedFrames), frontSensor(frontSensor) {} - ArSessionMetadata(const std::filesystem::path& dirPath); + ArSessionMetadata(const std::filesystem::path& dirPath) : ArSessionMetadata(FromFile(dirPath)) {} [[nodiscard]] std::string ToYaml() const; @@ -60,7 +60,7 @@ namespace OpenVulkano::AR static bool DirHasMetadata(const std::filesystem::path& dirPath); static ArSessionMetadata FromXML(const std::filesystem::path& filePath); - static ArSessionMetadata FromYaml(const std::filesystem::path& filePath); + static ArSessionMetadata FromFile(const std::filesystem::path& dirPath); }; }