A representation of time within a DCP.
More...
#include <dcp_time.h>
|
int | h = 0 |
| hours
|
|
int | m = 0 |
| minutes
|
|
int | s = 0 |
| seconds
|
|
int | e = 0 |
| editable units (where 1 editable unit is 1 / tcr_ seconds)
|
|
int | tcr = 1 |
| timecode rate: the number of editable units per second.
|
|
|
void | set (double seconds, int tcr) |
|
A representation of time within a DCP.
Definition at line 72 of file dcp_time.h.
◆ Time() [1/5]
◆ Time() [2/5]
Time::Time |
( |
int |
frame, |
|
|
double |
frames_per_second, |
|
|
int |
tcr |
|
) |
| |
Construct a Time.
- Parameters
-
frame | Frame index (starting from 0). |
frames_per_second | Frames per second. |
tcr | Timecode rate. |
Definition at line 57 of file dcp_time.cc.
◆ Time() [3/5]
dcp::Time::Time |
( |
int |
h_, |
|
|
int |
m_, |
|
|
int |
s_, |
|
|
int |
e_, |
|
|
int |
tcr_ |
|
) |
| |
|
inline |
Construct a Time from hours, minutes, seconds, editable units and a timecode rate.
- Parameters
-
h_ | Hours. |
m_ | Minutes. |
s_ | Seconds. |
e_ | Editable units (where 1 editable unit is 1 / tcr_ seconds) |
tcr_ | Timecode rate; i.e. number of editable units per second. |
Definition at line 92 of file dcp_time.h.
◆ Time() [4/5]
Time::Time |
( |
double |
seconds, |
|
|
int |
tcr |
|
) |
| |
Construct a Time from a number of seconds and a timecode rate
- Parameters
-
seconds | A number of seconds |
tcr_ | Timecode rate |
Definition at line 63 of file dcp_time.cc.
◆ Time() [5/5]
dcp::Time::Time |
( |
std::string |
time, |
|
|
boost::optional< int > |
tcr |
|
) |
| |
- Parameters
-
time | String of the form HH:MM:SS:EE for SMPTE HH:MM:SS:E[E[E]] or HH:MM:SS.s[s[s]] for Interop where HH are hours, MM minutes, SS seconds, EE editable units and sss millseconds. |
tcr_ | Timecode rate if this is a SMPTE time, otherwise empty for an Interop time |
◆ as_editable_units_ceil()
int64_t Time::as_editable_units_ceil |
( |
int |
tcr_ | ) |
const |
- Parameters
-
tcr_ | Timecode rate with which the return value should be counted |
- Returns
- the total number of editable units that this time consists of at the specified timecode rate, rounded up to the nearest editable unit. For example, as_editable_units_ceil(24) returns the total time in frames at 24fps.
Definition at line 350 of file dcp_time.cc.
◆ as_editable_units_floor()
int64_t Time::as_editable_units_floor |
( |
int |
tcr_ | ) |
const |
- Parameters
-
tcr_ | Timecode rate with which the return value should be counted |
- Returns
- the total number of editable units that this time consists of at the specified timecode rate, rounded down to the nearest editable unit. For example, as_editable_units_floor(24) returns the total time in frames at 24fps.
Definition at line 343 of file dcp_time.cc.
◆ as_seconds()
double Time::as_seconds |
( |
| ) |
const |
- Returns
- the total number of seconds that this time consists of
Definition at line 357 of file dcp_time.cc.
◆ as_string()
string Time::as_string |
( |
Standard |
standard | ) |
const |
- Returns
- A string of the form h:m:s:e padded as in 00:00:00:000 (for Interop) or 00:00:00:00 (for SMPTE)
Definition at line 328 of file dcp_time.cc.
◆ rebase()
Time Time::rebase |
( |
int |
tcr_ | ) |
const |
- Parameters
-
- Returns
- A new Time which is this time at the spcified new timecode rate
Definition at line 364 of file dcp_time.cc.
◆ set()
void Time::set |
( |
double |
seconds, |
|
|
int |
tcr_ |
|
) |
| |
|
private |
Construct a Time with specified timecode rate and using the supplied number of seconds.
- Parameters
-
seconds | A number of seconds. |
tcr_ | Timecode rate to use. |
Definition at line 76 of file dcp_time.cc.
The documentation for this class was generated from the following files: