forked from partouf/OBSInfoWriter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
InfoWriter.h
58 lines (45 loc) · 1.3 KB
/
InfoWriter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
#include "InfoWriterSettings.h"
#include <cstdint>
#include <Groundfloor/Molecules/String.h>
#include "OutputFormat.h"
#include <memory>
enum InfoMediaType {
imtUnknown = 0,
imtStream = 1,
imtRecording = 2,
imtRecordingPauseStart = 3,
imtRecordingPauseResume = 4
};
typedef int8_t InfoHotkey;
class InfoWriter {
private:
int64_t StartTime;
int64_t StartRecordTime;
int64_t StartStreamTime;
int64_t PausedTotalTime;
int64_t PausedStartTime;
InfoMediaType lastInfoMediaType;
InfoWriterSettings Settings;
bool StreamStarted;
bool RecordStarted;
bool Paused;
std::string CurrentFilename;
std::unique_ptr<IOutputFormat> output;
int64_t getPausedTime(const int64_t currentTime) const;
void InitCurrentFilename(int64_t timestamp);
std::string SecsToHMSString(const int64_t totalseconds) const;
public:
InfoWriter();
void MarkStart(const InfoMediaType AType);
void MarkPauseStart(const InfoMediaType AType);
void MarkPauseResume(const InfoMediaType AType);
void WriteInfo(const std::string AExtraInfo) const;
void WriteInfo(const InfoHotkey AHotkey) const;
void WriteSceneChange(const std::string scenename) const;
void MarkStop(const InfoMediaType AType);
bool HasStarted() const;
bool IsStreaming() const;
std::string NowTimeStamp() const;
InfoWriterSettings *GetSettings();
};