diff options
| author | Carl Hetherington <cth@carlh.net> | 2026-02-28 00:39:55 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2026-02-28 09:07:06 +0100 |
| commit | cbe615367e5e137d909387aec7993fc89fe1905d (patch) | |
| tree | f9f77d95301e63cf431724367db3d3f9768b551f /src/lib | |
| parent | 2a466391f79f3cab480f83ac0228049f050a54c6 (diff) | |
White space: frame_rate_change.{cc,h}
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/frame_rate_change.cc | 27 | ||||
| -rw-r--r-- | src/lib/frame_rate_change.h | 12 |
2 files changed, 19 insertions, 20 deletions
diff --git a/src/lib/frame_rate_change.cc b/src/lib/frame_rate_change.cc index 69296c970..48f5b9881 100644 --- a/src/lib/frame_rate_change.cc +++ b/src/lib/frame_rate_change.cc @@ -31,17 +31,16 @@ using std::shared_ptr; using std::string; -FrameRateChange::FrameRateChange () +FrameRateChange::FrameRateChange() { } -FrameRateChange::FrameRateChange (double source_, int dcp_) +FrameRateChange::FrameRateChange(double source_, int dcp_) + : source(source_) + , dcp(dcp_) { - source = source_; - dcp = dcp_; - if (fabs(source / 2.0 - dcp) < fabs(source - dcp)) { /* The difference between source and DCP frame rate will be lower (i.e. better) if we skip. @@ -52,35 +51,35 @@ FrameRateChange::FrameRateChange (double source_, int dcp_) if we repeated each frame once; it may be better still if we repeated more than once. Work out the required repeat. */ - repeat = round (dcp / source); + repeat = round(dcp / source); } speed_up = dcp / (source * factor()); auto about_equal = [](double a, double b) { - return (fabs (a - b) < VIDEO_FRAME_RATE_EPSILON); + return (fabs(a - b) < VIDEO_FRAME_RATE_EPSILON); }; - change_speed = !about_equal (speed_up, 1.0); + change_speed = !about_equal(speed_up, 1.0); } -FrameRateChange::FrameRateChange (shared_ptr<const Film> film, shared_ptr<const Content> content) - : FrameRateChange (content->active_video_frame_rate(film), film->video_frame_rate()) +FrameRateChange::FrameRateChange(shared_ptr<const Film> film, shared_ptr<const Content> content) + : FrameRateChange(content->active_video_frame_rate(film), film->video_frame_rate()) { } -FrameRateChange::FrameRateChange (shared_ptr<const Film> film, Content const * content) - : FrameRateChange (content->active_video_frame_rate(film), film->video_frame_rate()) +FrameRateChange::FrameRateChange(shared_ptr<const Film> film, Content const * content) + : FrameRateChange(content->active_video_frame_rate(film), film->video_frame_rate()) { } string -FrameRateChange::description () const +FrameRateChange::description() const { string description; @@ -98,7 +97,7 @@ FrameRateChange::description () const if (change_speed) { double const pc = dcp * 100 / (source * factor()); char buffer[256]; - snprintf (buffer, sizeof(buffer), _("DCP will run at %.1f%% of the content speed.\n"), pc); + snprintf(buffer, sizeof(buffer), _("DCP will run at %.1f%% of the content speed.\n"), pc); description += buffer; } } diff --git a/src/lib/frame_rate_change.h b/src/lib/frame_rate_change.h index c28342e92..84c4c340d 100644 --- a/src/lib/frame_rate_change.h +++ b/src/lib/frame_rate_change.h @@ -34,15 +34,15 @@ class Content; class FrameRateChange { public: - FrameRateChange (); - FrameRateChange (double, int); - FrameRateChange (std::shared_ptr<const Film> film, std::shared_ptr<const Content> content); - FrameRateChange (std::shared_ptr<const Film> film, Content const * content); + FrameRateChange(); + FrameRateChange(double, int); + FrameRateChange(std::shared_ptr<const Film> film, std::shared_ptr<const Content> content); + FrameRateChange(std::shared_ptr<const Film> film, Content const * content); /** @return factor by which to multiply a source frame rate to get the effective rate after any skip or repeat has happened. */ - double factor () const { + double factor() const { if (skip) { return 0.5; } @@ -73,7 +73,7 @@ public: */ double speed_up = 1.0; - std::string description () const; + std::string description() const; }; |
