diff options
Diffstat (limited to 'src/lib/util.h')
| -rw-r--r-- | src/lib/util.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/lib/util.h b/src/lib/util.h index 50e7410d6..1fd2c0150 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -62,6 +62,19 @@ typedef int SourceFrame; struct DCPFrameRate { DCPFrameRate (float); + + /** @return factor by which to multiply a source frame rate + to get the effective rate after any skip or repeat has happened. + */ + float factor () const { + if (skip) { + return 0.5; + } else if (repeat) { + return 2; + } + + return 1; + } /** frames per second for the DCP */ int frames_per_second; @@ -69,16 +82,16 @@ struct DCPFrameRate bool skip; /** true to repeat every frame once */ bool repeat; - /** true if this DCP will run its video faster than the source - * without taking into account `skip' and `repeat'. - * (i.e. run_fast will be true if + /** true if this DCP will run its video faster or slower than the source + * without taking into account `repeat'. + * (e.g. change_speed will be true if * source is 29.97fps, DCP is 30fps * source is 14.50fps, DCP is 30fps * but not if * source is 15.00fps, DCP is 30fps * source is 12.50fps, DCP is 25fps) */ - bool run_fast; + bool change_speed; }; enum ContentType { |
