X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fframe_rate_change.cc;h=7b6d1389274832dc6d86a508bdc15062432db84c;hb=dd9be86db6cde0afa5da0d1d1ac43b42e05dca26;hp=456b4151e1a11accef6e1d6b481955c65e71a4c2;hpb=f67bc45820b4e56f90eecb97ba3b7762c119f9b5;p=dcpomatic.git diff --git a/src/lib/frame_rate_change.cc b/src/lib/frame_rate_change.cc index 456b4151e..7b6d13892 100644 --- a/src/lib/frame_rate_change.cc +++ b/src/lib/frame_rate_change.cc @@ -28,7 +28,7 @@ #include "i18n.h" using std::string; -using boost::shared_ptr; +using std::shared_ptr; static bool about_equal (double a, double b) @@ -36,6 +36,17 @@ about_equal (double a, double b) return (fabs (a - b) < VIDEO_FRAME_RATE_EPSILON); } +FrameRateChange::FrameRateChange () + : source (24) + , dcp (24) + , skip (false) + , repeat (1) + , change_speed (false) + , speed_up (1) +{ + +} + FrameRateChange::FrameRateChange (double source_, int dcp_) : skip (false) , repeat (1) @@ -68,11 +79,15 @@ FrameRateChange::construct (double source_, int dcp_) } FrameRateChange::FrameRateChange (shared_ptr film, shared_ptr content) + : skip (false) + , repeat (1) { construct (content->active_video_frame_rate(film), film->video_frame_rate()); } FrameRateChange::FrameRateChange (shared_ptr film, Content const * content) + : skip (false) + , repeat (1) { construct (content->active_video_frame_rate(film), film->video_frame_rate()); } @@ -95,7 +110,9 @@ FrameRateChange::description () const if (change_speed) { double const pc = dcp * 100 / (source * factor()); - description += String::compose (_("DCP will run at %1%% of the content speed.\n"), pc); + char buffer[256]; + snprintf (buffer, sizeof(buffer), _("DCP will run at %.1f%% of the content speed.\n"), pc); + description += buffer; } }