Files
LiveScan3D/include/LiveScanClient/frameFileWriterReader.h
T
Christopher Remde 76bf5e9dba Added new UI for the Temporal Sync Feature, made the software more robust including:
-Settings window can only be opened once
    -When the client can't open a device, it tries multiple times
    -Recording bins are now saved with a unique ID per device, to allow multiple clients to record on the same PC
    -Synchronized & Unsynchronized devices can be both used in one server
    -Included a workaround for a bug in the Azure Kinect SDK regarding exposure (microsoft/Azure-Kinect-Sensor-SDK#1378)
2020-10-14 23:21:18 +02:00

41 lines
1.0 KiB
C++

#pragma once
#include <stdio.h>
#include <string>
#include <vector>
#include <chrono>
#include "utils.h"
class FrameFileWriterReader
{
public:
FrameFileWriterReader();
void openNewFileForWriting(int deviceID);
void openCurrentFileForReading();
// leave filename blank if you want the filename to be generated from the date
void setCurrentFilename(std::string filename = "");
void writeFrame(std::vector<Point3s> points, std::vector<RGB> colors, uint64_t timestamp, int deviceID);
bool readFrame(std::vector<Point3s> &outPoints, std::vector<RGB> &outColors);
bool openedForWriting() { return m_bFileOpenedForWriting; }
bool openedForReading() { return m_bFileOpenedForReading; }
void closeFileIfOpened();
~FrameFileWriterReader();
private:
void resetTimer();
int getRecordingTimeMilliseconds();
FILE *m_pFileHandle = nullptr;
bool m_bFileOpenedForWriting = false;
bool m_bFileOpenedForReading = false;
std::string m_sFilename = "";
std::chrono::steady_clock::time_point recording_start_time;
};