mirror of
https://github.com/storytold/LiveScan3D.git
synced 2026-10-09 00:09:58 +00:00
76bf5e9dba
-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)
41 lines
1.0 KiB
C++
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;
|
|
}; |