Files
OpenVulkano/openVulkanoCpp/AR/ArRecorder.hpp
2021-06-21 16:12:31 +02:00

91 lines
2.4 KiB
C++

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#pragma once
#include <string>
#include <filesystem>
namespace openVulkanoCpp::AR
{
enum class RecordingMode
{
/**
* Frames will only be saved when manually requested through ArFrame::Save()
*/
MANUAL,
/**
* Frames will only be saved when the frame is manually requested through ArSession::GetFrame()
*/
FRAME_REQUEST,
/**
* Every new frame will be stored automatically
*/
NEW_FRAME
};
class ArRecorder
{
protected:
ArRecorder() = default;
public:
virtual ~ArRecorder() = default;
/**
* Starts the recording of the owning AR session
*/
virtual void Start() = 0;
/**
* Stops the recording of the owning AR session
*/
virtual void Stop() = 0;
/**
* 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
*/
virtual void SetRecordingPath(const std::string& path) = 0;
/**
* Gets the current recording path
* @return Current recording dir
*/
[[nodiscard]] virtual const std::filesystem::path& GetRecordingPath() const = 0;
/**
* Checks if a path to be used for the recording has been set.
* If no path has been set the recording will be stored in a temporary location and will be deleted once the recording is stopped.
* @return True if a path has been set and the recording will persist after stopping the recording.
*/
[[nodiscard]] virtual bool IsPersistent() const = 0;
/**
* Checks if the recording of the AR session is running
* @return True if recording is started
*/
[[nodiscard]] virtual bool IsRecording() const = 0;
/**
* Sets the used recording mode
* @param mode The mode that should be used to record the current session
*/
void SetRecordingMode(RecordingMode mode) { recordingMode = mode; }
/**
* Checks the currently used recording mode for the AR session
* @return The currently used recording mode
*/
[[nodiscard]] RecordingMode SetRecordingMode() { return recordingMode; }
protected:
RecordingMode recordingMode = RecordingMode::FRAME_REQUEST;
};
}