General-purpose timecode generator. More...
#include <timecodegenerator.h>
Public Types | |
| enum | RunMode { Still , Forward , Reverse } |
| Run mode for the generator. More... | |
Public Member Functions | |
| TimecodeGenerator ()=default | |
| Constructs a default generator with no frame rate set. | |
| TimecodeGenerator (const FrameRate &frameRate, bool dropFrame=false) | |
| Constructs a generator with the given frame rate. | |
| FrameRate | frameRate () const |
| Returns the configured frame rate. | |
| void | setFrameRate (const FrameRate &frameRate) |
| Sets the frame rate and re-derives the timecode mode. | |
| bool | dropFrame () const |
| Returns whether drop-frame counting is enabled. | |
| void | setDropFrame (bool df) |
| Enables or disables drop-frame counting. | |
| Timecode::Mode | timecodeMode () const |
| Returns the resolved timecode mode. | |
| RunMode | runMode () const |
| Returns the current run mode. | |
| void | setRunMode (RunMode mode) |
| Sets the run mode. | |
| Timecode | timecode () const |
| Returns the current timecode value. | |
| void | setTimecode (const Timecode &tc) |
| Sets the current timecode value. | |
| void | jam (const Timecode &tc) |
| Jams to a new timecode value mid-run. | |
| Timecode | advance () |
| Advances the generator by one frame. | |
| uint64_t | frameCount () const |
| Returns the total number of frames advanced. | |
| void | reset () |
| Resets the generator. | |
General-purpose timecode generator.
Produces a sequence of timecode values with controllable direction and jam capability. Automatically derives the correct Timecode::Mode from the configured frame rate and drop-frame setting.
This is a simple value class — cheap to copy, no shared state.
Constructs a generator with the given frame rate.
| frameRate | The frame rate. |
| dropFrame | Whether to use drop-frame counting (only at 30000/1001). |
| Timecode TimecodeGenerator::advance | ( | ) |
Advances the generator by one frame.
Returns the previous timecode value (the value for the current frame). Forward increments, Reverse decrements, Still returns the same value repeatedly.
|
inline |
Returns whether drop-frame counting is enabled.
|
inline |
Returns the total number of frames advanced.
|
inline |
Returns the configured frame rate.
Jams to a new timecode value mid-run.
Equivalent to setTimecode() but semantically distinct — use for mid-run resync. Does not change the reset value.
| tc | The timecode to jam to. |
| void TimecodeGenerator::reset | ( | ) |
Resets the generator.
Resets frameCount to 0 and timecode to the value set by setTimecode().
|
inline |
Returns the current run mode.
Enables or disables drop-frame counting.
Only takes effect when the frame rate is 30000/1001. At all other rates, drop-frame is forced to false. Recalculates the timecode mode.
| df | true to enable drop-frame. |
Sets the frame rate and re-derives the timecode mode.
| frameRate | The frame rate. |
Sets the run mode.
| mode | The run mode (Still, Forward, or Reverse). |
Sets the current timecode value.
Also sets the initial value used by reset().
| tc | The timecode to set. |
|
inline |
Returns the current timecode value.
|
inline |
Returns the resolved timecode mode.