libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
timecodegenerator.h
Go to the documentation of this file.
1
8#pragma once
9
13
15
38 public:
45
47 TimecodeGenerator() = default;
48
55
60 FrameRate frameRate() const { return _frameRate; }
61
67
72 bool dropFrame() const { return _dropFrame; }
73
82 void setDropFrame(bool df);
83
88 Timecode::Mode timecodeMode() const { return _mode; }
89
94 RunMode runMode() const { return _runMode; }
95
100 void setRunMode(RunMode mode) { _runMode = mode; return; }
101
106 Timecode timecode() const { return _timecode; }
107
115 void setTimecode(const Timecode &tc);
116
125 void jam(const Timecode &tc);
126
137
142 uint64_t frameCount() const { return _frameCount; }
143
149 void reset();
150
151 private:
152 FrameRate _frameRate;
153 bool _dropFrame = false;
154 Timecode::Mode _mode;
155 RunMode _runMode = Forward;
156 Timecode _timecode;
157 Timecode _startTimecode;
158 uint64_t _frameCount = 0;
159
160 void deriveMode();
161};
162
Represents a video frame rate as a rational number.
Definition framerate.h:36
Dynamic array container wrapping std::vector.
Definition list.h:40
General-purpose timecode generator.
Definition timecodegenerator.h:37
FrameRate frameRate() const
Returns the configured frame rate.
Definition timecodegenerator.h:60
TimecodeGenerator(const FrameRate &frameRate, bool dropFrame=false)
Constructs a generator with the given frame rate.
Timecode advance()
Advances the generator by one frame.
void reset()
Resets the generator.
RunMode
Run mode for the generator.
Definition timecodegenerator.h:40
@ Forward
Timecode increments each frame.
Definition timecodegenerator.h:42
@ Still
Timecode does not advance.
Definition timecodegenerator.h:41
@ Reverse
Timecode decrements each frame.
Definition timecodegenerator.h:43
void setDropFrame(bool df)
Enables or disables drop-frame counting.
uint64_t frameCount() const
Returns the total number of frames advanced.
Definition timecodegenerator.h:142
bool dropFrame() const
Returns whether drop-frame counting is enabled.
Definition timecodegenerator.h:72
Timecode timecode() const
Returns the current timecode value.
Definition timecodegenerator.h:106
void setFrameRate(const FrameRate &frameRate)
Sets the frame rate and re-derives the timecode mode.
Timecode::Mode timecodeMode() const
Returns the resolved timecode mode.
Definition timecodegenerator.h:88
void jam(const Timecode &tc)
Jams to a new timecode value mid-run.
RunMode runMode() const
Returns the current run mode.
Definition timecodegenerator.h:94
void setTimecode(const Timecode &tc)
Sets the current timecode value.
TimecodeGenerator()=default
Constructs a default generator with no frame rate set.
void setRunMode(RunMode mode)
Sets the run mode.
Definition timecodegenerator.h:100
Describes the timecode mode (frame rate and drop-frame status).
Definition timecode.h:70
Class for holding and manipulating timecode.
Definition timecode.h:45
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19