Rename Content::full_length -> Content::full_length_dcp
authorCarl Hetherington <cth@carlh.net>
Thu, 6 May 2021 09:03:45 +0000 (11:03 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 7 May 2021 07:29:58 +0000 (09:29 +0200)
26 files changed:
src/lib/atmos_mxf_content.cc
src/lib/atmos_mxf_content.h
src/lib/audio_content.cc
src/lib/content.cc
src/lib/content.h
src/lib/dcp_content.cc
src/lib/dcp_content.h
src/lib/dcp_subtitle_content.cc
src/lib/dcp_subtitle_content.h
src/lib/ffmpeg_content.cc
src/lib/ffmpeg_content.h
src/lib/ffmpeg_decoder.cc
src/lib/image_content.cc
src/lib/image_content.h
src/lib/string_text_file_content.cc
src/lib/string_text_file_content.h
src/lib/video_mxf_content.cc
src/lib/video_mxf_content.h
src/tools/dcpomatic_cli.cc
src/wx/player_information.cc
src/wx/timing_panel.cc
test/dcp_subtitle_test.cc
test/player_test.cc
test/reels_test.cc
test/subtitle_charset_test.cc
test/time_calculation_test.cc

index 82c20e88f7bd8e7c723e49216b1d4aeeabe3bc4d..5c153309f0fde53052fa2e16b84537b3c13dbc67 100644 (file)
@@ -107,7 +107,7 @@ AtmosMXFContent::as_xml (xmlpp::Node* node, bool with_paths) const
 
 
 DCPTime
-AtmosMXFContent::full_length (shared_ptr<const Film> film) const
+AtmosMXFContent::full_length_dcp (shared_ptr<const Film> film) const
 {
        FrameRateChange const frc (film, shared_from_this());
        return DCPTime::from_frames (llrint(atmos->length() * frc.factor()), film->video_frame_rate());
index 57f041774c1b3776926545b7b77c025c2c872c33..912c818f6935b42a0969ef74ee319fdad782b867 100644 (file)
@@ -40,7 +40,7 @@ public:
        void examine (std::shared_ptr<const Film> film, std::shared_ptr<Job> job) override;
        std::string summary () const override;
        void as_xml (xmlpp::Node* node, bool with_path) const override;
-       dcpomatic::DCPTime full_length (std::shared_ptr<const Film> film) const override;
+       dcpomatic::DCPTime full_length_dcp (std::shared_ptr<const Film> film) const override;
        dcpomatic::DCPTime approximate_length () const override;
 
        static bool valid_mxf (boost::filesystem::path path);
index 3d9f6ac051ca9fa102daf1adffc42e8291bc89f9..e2858dfc30bf7df7a9ea3b02b7522dcadea01ae7 100644 (file)
@@ -331,7 +331,7 @@ AudioContent::add_properties (shared_ptr<const Film> film, list<UserProperty>& p
        }
 
        FrameRateChange const frc (_parent->active_video_frame_rate(film), film->video_frame_rate());
-       ContentTime const c (_parent->full_length(film), frc);
+       ContentTime const c (_parent->full_length_dcp(film), frc);
 
        p.push_back (
                UserProperty (UserProperty::LENGTH, _("Full length in video frames at content rate"), c.frames_round(frc.source))
index 49ab944be54c79c3d478469ad09762a9555768fe..2dbb218a6a1550d0c9d7adf198ebd1502033a215 100644 (file)
@@ -315,7 +315,7 @@ Content::technical_summary () const
 DCPTime
 Content::length_after_trim (shared_ptr<const Film> film) const
 {
-       auto length = max(DCPTime(), full_length(film) - DCPTime(trim_start() + trim_end(), film->active_frame_rate_change(position())));
+       auto length = max(DCPTime(), full_length_dcp(film) - DCPTime(trim_start() + trim_end(), film->active_frame_rate_change(position())));
        if (video) {
                length = length.round(film->video_frame_rate());
        }
index 567cd5c1f78c68901ef13cdbfcf6ff49ed81fc34..89ea28ab389a65431c5368761fd022b8371ecab1 100644 (file)
@@ -97,7 +97,7 @@ public:
        virtual std::string technical_summary () const;
 
        virtual void as_xml (xmlpp::Node *, bool with_paths) const;
-       virtual dcpomatic::DCPTime full_length (std::shared_ptr<const Film>) const = 0;
+       virtual dcpomatic::DCPTime full_length_dcp (std::shared_ptr<const Film>) const = 0;
        virtual dcpomatic::DCPTime approximate_length () const = 0;
        virtual std::string identifier () const;
        /** @return points at which to split this content when
index f6a74501c7cae8b13102e0f9a586bd9bd08d90cf..3c9e1fddd0b76639a65f0f354f5dfec435e24013 100644 (file)
@@ -410,7 +410,7 @@ DCPContent::as_xml (xmlpp::Node* node, bool with_paths) const
 }
 
 DCPTime
-DCPContent::full_length (shared_ptr<const Film> film) const
+DCPContent::full_length_dcp (shared_ptr<const Film> film) const
 {
        if (!video) {
                return {};
index c9b18037aa776d972b19bc558e90e6ebd1d6de58..29d5b24981a0e5d067a5044106c67dc412e2e6b7 100644 (file)
@@ -61,7 +61,7 @@ public:
                return std::dynamic_pointer_cast<const DCPContent> (Content::shared_from_this ());
        }
 
-       dcpomatic::DCPTime full_length (std::shared_ptr<const Film> film) const override;
+       dcpomatic::DCPTime full_length_dcp (std::shared_ptr<const Film> film) const override;
        dcpomatic::DCPTime approximate_length () const override;
 
        void examine (std::shared_ptr<const Film> film, std::shared_ptr<Job>) override;
index 858849ca3134f003803abbfcad881dcb890c1d8e..d42076e5a82b2b87faa51a713cb20ac1a5bdb477 100644 (file)
@@ -79,7 +79,7 @@ DCPSubtitleContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
 }
 
 DCPTime
-DCPSubtitleContent::full_length (shared_ptr<const Film> film) const
+DCPSubtitleContent::full_length_dcp (shared_ptr<const Film> film) const
 {
        FrameRateChange const frc (film, shared_from_this());
        return DCPTime (_length, frc);
index 5949f8b0ba5ef866b68a418379ff98c182b0053f..f734d04ba8db53f530ff382d6c6e28c65c31b42b 100644 (file)
@@ -31,7 +31,7 @@ public:
        std::string summary () const override;
        std::string technical_summary () const override;
        void as_xml (xmlpp::Node *, bool with_paths) const override;
-       dcpomatic::DCPTime full_length (std::shared_ptr<const Film> film) const override;
+       dcpomatic::DCPTime full_length_dcp (std::shared_ptr<const Film> film) const override;
        dcpomatic::DCPTime approximate_length () const override;
 
 private:
index 516962936238824775970f5796dc97c10ca6f62e..5cbc210ad8af8872de4381f8a8977bff43635011 100644 (file)
@@ -411,7 +411,7 @@ operator!= (FFmpegStream const & a, FFmpegStream const & b)
 
 
 DCPTime
-FFmpegContent::full_length (shared_ptr<const Film> film) const
+FFmpegContent::full_length_dcp (shared_ptr<const Film> film) const
 {
        FrameRateChange const frc (film, shared_from_this());
        if (video) {
index ce4a8aa6985cdbdc38af33bf5e4c8b479cbc65db..a92e613f0a86ca1d9538611872a0bccedec7c029 100644 (file)
@@ -64,7 +64,7 @@ public:
        std::string summary () const override;
        std::string technical_summary () const override;
        void as_xml (xmlpp::Node *, bool with_paths) const override;
-       dcpomatic::DCPTime full_length (std::shared_ptr<const Film> film) const override;
+       dcpomatic::DCPTime full_length_dcp (std::shared_ptr<const Film> film) const override;
        dcpomatic::DCPTime approximate_length () const override;
 
        std::string identifier () const override;
index db88562ea09b2bb05001d14b2c031ad018c19f6f..41728ee0608aca64528f3046a86f4f47b6c8a5d4 100644 (file)
@@ -141,7 +141,7 @@ FFmpegDecoder::flush ()
        /* Make sure all streams are the same length and round up to the next video frame */
 
        auto const frc = film()->active_frame_rate_change(_ffmpeg_content->position());
-       ContentTime full_length (_ffmpeg_content->full_length(film()), frc);
+       ContentTime full_length (_ffmpeg_content->full_length_dcp(film()), frc);
        full_length = full_length.ceil (frc.source);
        if (video) {
                double const vfr = _ffmpeg_content->video_frame_rate().get();
index 517d6792f89715d16f83edcaa60779f40a7e99ee..23493057658f20e476b8a7e6b0b89399fda9681c 100644 (file)
@@ -133,7 +133,7 @@ ImageContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
 }
 
 DCPTime
-ImageContent::full_length (shared_ptr<const Film> film) const
+ImageContent::full_length_dcp (shared_ptr<const Film> film) const
 {
        FrameRateChange const frc (film, shared_from_this());
        return DCPTime::from_frames (llrint(video->length_after_3d_combine() * frc.factor()), film->video_frame_rate());
index d817eeee84e4cc0b6a2685666db207eae79a0025..f496e253129e08e0485b877511e6804d61daa98e 100644 (file)
@@ -41,7 +41,7 @@ public:
        std::string summary () const override;
        std::string technical_summary () const override;
        void as_xml (xmlpp::Node *, bool with_paths) const override;
-       dcpomatic::DCPTime full_length (std::shared_ptr<const Film> film) const override;
+       dcpomatic::DCPTime full_length_dcp (std::shared_ptr<const Film> film) const override;
        dcpomatic::DCPTime approximate_length () const override;
 
        std::string identifier () const override;
index 69d2a67560e35a4f774a39f689ec01e96c8458a1..8796b5ee9c6805a1ab4f1615b87e0858f9e9d6e3 100644 (file)
@@ -102,7 +102,7 @@ StringTextFileContent::as_xml (xmlpp::Node* node, bool with_paths) const
 
 
 DCPTime
-StringTextFileContent::full_length (shared_ptr<const Film> film) const
+StringTextFileContent::full_length_dcp (shared_ptr<const Film> film) const
 {
        FrameRateChange const frc (film, shared_from_this());
        return DCPTime (_length, frc);
index f9356cc6fcfd286bde129e920d036fd2a0030aad..d3c0368b9360b7252e7b188510772d35fdcb8a70 100644 (file)
@@ -46,7 +46,7 @@ public:
        std::string summary () const override;
        std::string technical_summary () const override;
        void as_xml (xmlpp::Node *, bool with_paths) const override;
-       dcpomatic::DCPTime full_length (std::shared_ptr<const Film> film) const override;
+       dcpomatic::DCPTime full_length_dcp (std::shared_ptr<const Film> film) const override;
        dcpomatic::DCPTime approximate_length () const override;
        std::string identifier () const override;
 
index c7ee69d8932c647b62835ef5d12b5a82ab0ea391..1be9787fba6a46cda662122641b6b202527f7342 100644 (file)
@@ -130,7 +130,7 @@ VideoMXFContent::as_xml (xmlpp::Node* node, bool with_paths) const
 
 
 DCPTime
-VideoMXFContent::full_length (shared_ptr<const Film> film) const
+VideoMXFContent::full_length_dcp (shared_ptr<const Film> film) const
 {
        FrameRateChange const frc (film, shared_from_this());
        return DCPTime::from_frames (llrint(video->length_after_3d_combine() * frc.factor()), film->video_frame_rate());
index 5a04c3da9c292405b83f7e3f0c4e20fe73995077..14d31f91543a3b77dde15044a46476f9c367b149 100644 (file)
@@ -41,7 +41,7 @@ public:
        std::string technical_summary () const override;
        std::string identifier () const override;
        void as_xml (xmlpp::Node* node, bool with_paths) const override;
-       dcpomatic::DCPTime full_length (std::shared_ptr<const Film> film) const override;
+       dcpomatic::DCPTime full_length_dcp (std::shared_ptr<const Film> film) const override;
        dcpomatic::DCPTime approximate_length () const override;
        void add_properties (std::shared_ptr<const Film> film, std::list<UserProperty>& p) const override;
 
index 59d85d4c469de2a975d2be2caf4163e5d6422dee..f4e5f727a17a3609e17f049ef97265e4c941f12a 100644 (file)
@@ -85,7 +85,7 @@ print_dump (shared_ptr<Film> film)
                cout << "\n"
                     << c->path(0) << "\n"
                     << "\tat " << c->position().seconds ()
-                    << " length " << c->full_length(film).seconds ()
+                    << " length " << c->full_length_dcp(film).seconds ()
                     << " start trim " << c->trim_start().seconds ()
                     << " end trim " << c->trim_end().seconds () << "\n";
 
index f0eaa59bbea8e643ce7900f332fc3836e824061e..95a1e1063facc18d28056baf4633ff580fbb3483 100644 (file)
@@ -159,8 +159,8 @@ PlayerInformation::triggered_update ()
 
        string const len = String::compose(
                wx_to_std(_("Length: %1 (%2 frames)")),
-               time_to_hmsf(dcp->full_length(fv->film()), lrint(*vfr)),
-               dcp->full_length(fv->film()).frames_round(*vfr)
+               time_to_hmsf(dcp->full_length_dcp(fv->film()), lrint(*vfr)),
+               dcp->full_length_dcp(fv->film()).frames_round(*vfr)
                );
 
        checked_set (_dcp[r++], std_to_wx(len));
index f251e3c93679fbe45bbcbb07ab30b303caa8e9be..694b08b95cd00eb18678eaf2a5e35d34e9051720 100644 (file)
@@ -179,11 +179,11 @@ TimingPanel::update_full_length ()
 {
        set<DCPTime> check;
        for (auto i: _parent->selected()) {
-               check.insert (i->full_length(_parent->film()));
+               check.insert (i->full_length_dcp(_parent->film()));
        }
 
        if (check.size() == 1) {
-               _full_length->set (_parent->selected().front()->full_length(_parent->film()), _parent->film()->video_frame_rate());
+               _full_length->set (_parent->selected().front()->full_length_dcp(_parent->film()), _parent->film()->video_frame_rate());
        } else {
                _full_length->clear ();
        }
@@ -404,7 +404,7 @@ TimingPanel::play_length_changed ()
        for (auto i: _parent->selected()) {
                FrameRateChange const frc = _parent->film()->active_frame_rate_change (i->position ());
                i->set_trim_end (
-                       ContentTime (max(DCPTime(), i->full_length(_parent->film()) - play_length), frc) - i->trim_start()
+                       ContentTime (max(DCPTime(), i->full_length_dcp(_parent->film()) - play_length), frc) - i->trim_start()
                        );
        }
 }
@@ -473,7 +473,7 @@ TimingPanel::trim_end_to_playhead_clicked ()
        for (auto i: _parent->selected()) {
                if (i->position() < ph && ph < i->end(film)) {
                        FrameRateChange const frc = film->active_frame_rate_change (i->position ());
-                       i->set_trim_end (ContentTime(i->position() + i->full_length(film) - ph, frc) - i->trim_start());
+                       i->set_trim_end (ContentTime(i->position() + i->full_length_dcp(film) - ph, frc) - i->trim_start());
                }
        }
 }
index d923448d3afffa418a608454edcd0d2a21d79e92..ac6c3991fcfbc2d75d37d810f5353ac6464d2807 100644 (file)
@@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test)
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
-       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(2).get());
+       BOOST_CHECK_EQUAL (content->full_length_dcp(film).get(), DCPTime::from_seconds(2).get());
 
        content->only_text()->set_use (true);
        content->only_text()->set_burn (false);
index c325537fa80a18908049188f5ade4b83ba9e7c76..e110c9110d12a2cb65e9eede1c9220cac811f4f7 100644 (file)
@@ -159,8 +159,8 @@ BOOST_AUTO_TEST_CASE (player_subframe_test)
        film->set_video_frame_rate (24);
        A->video->set_length (3 * 24);
 
-       BOOST_CHECK (A->full_length(film) == DCPTime::from_frames(3 * 24, 24));
-       BOOST_CHECK (B->full_length(film) == DCPTime(289920));
+       BOOST_CHECK (A->full_length_dcp(film) == DCPTime::from_frames(3 * 24, 24));
+       BOOST_CHECK (B->full_length_dcp(film) == DCPTime(289920));
        /* Length should be rounded up from B's length to the next video frame */
        BOOST_CHECK (film->length() == DCPTime::from_frames(3 * 24 + 1, 24));
 
index 5bb119f463965ec81d6fe204ba8b0cde17acf685..a977595b39261acc21eef642b883433d653da172 100644 (file)
@@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE (reels_test1)
        auto B = make_shared<FFmpegContent>("test/data/test.mp4");
        film->examine_and_add_content (B);
        BOOST_REQUIRE (!wait_for_jobs());
-       BOOST_CHECK_EQUAL (A->full_length(film).get(), 288000);
+       BOOST_CHECK_EQUAL (A->full_length_dcp(film).get(), 288000);
 
        film->set_reel_type (ReelType::SINGLE);
        auto r = film->reels ();
@@ -179,7 +179,7 @@ BOOST_AUTO_TEST_CASE (reels_test3)
        BOOST_CHECK_EQUAL (i->to.get(), 96000 * 3);
        ++i;
        BOOST_CHECK_EQUAL (i->from.get(), 96000 * 3);
-       BOOST_CHECK_EQUAL (i->to.get(), sub->full_length(film).ceil(film->video_frame_rate()).get());
+       BOOST_CHECK_EQUAL (i->to.get(), sub->full_length_dcp(film).ceil(film->video_frame_rate()).get());
 }
 
 
index 8233bf023c9b7b1df9d74c4aa232b8ce09860bc7..664241063f8ccfa8c8699ba635e7ba17cc18cbec 100644 (file)
@@ -48,5 +48,5 @@ BOOST_AUTO_TEST_CASE (subtitle_charset_test2)
        auto ts = dynamic_pointer_cast<StringTextFileContent> (content);
        BOOST_REQUIRE (ts);
        /* Make sure we got the subtitle data from the file */
-       BOOST_REQUIRE_EQUAL (content->full_length(film).get(), 6052032);
+       BOOST_REQUIRE_EQUAL (content->full_length_dcp(film).get(), 6052032);
 }
index ffe77c2b786ec2aa98000a254cecf288fa5a6df2..9551a080e297d065927308f2459bf88007f7fe9f 100644 (file)
@@ -143,19 +143,19 @@ BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test)
 
        /* 25fps content, 25fps DCP */
        film->set_video_frame_rate (25);
-       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(content->video->length() / 25.0).get());
+       BOOST_CHECK_EQUAL (content->full_length_dcp(film).get(), DCPTime::from_seconds(content->video->length() / 25.0).get());
        /* 25fps content, 24fps DCP; length should be increased */
        film->set_video_frame_rate (24);
-       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(content->video->length() / 24.0).get());
+       BOOST_CHECK_EQUAL (content->full_length_dcp(film).get(), DCPTime::from_seconds(content->video->length() / 24.0).get());
        /* 25fps content, 30fps DCP; length should be decreased */
        film->set_video_frame_rate (30);
-       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(content->video->length() / 30.0).get());
+       BOOST_CHECK_EQUAL (content->full_length_dcp(film).get(), DCPTime::from_seconds(content->video->length() / 30.0).get());
        /* 25fps content, 50fps DCP; length should be the same */
        film->set_video_frame_rate (50);
-       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(content->video->length() / 25.0).get());
+       BOOST_CHECK_EQUAL (content->full_length_dcp(film).get(), DCPTime::from_seconds(content->video->length() / 25.0).get());
        /* 25fps content, 60fps DCP; length should be decreased */
        film->set_video_frame_rate (60);
-       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(content->video->length() * (50.0 / 60) / 25.0).get());
+       BOOST_CHECK_EQUAL (content->full_length_dcp(film).get(), DCPTime::from_seconds(content->video->length() * (50.0 / 60) / 25.0).get());
 
        /* Make the content audio-only */
        content->video.reset ();
@@ -163,23 +163,23 @@ BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test)
        /* 24fps content, 24fps DCP */
        film->set_video_frame_rate (24);
        content->set_video_frame_rate (24);
-       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(1).get());
+       BOOST_CHECK_EQUAL (content->full_length_dcp(film).get(), DCPTime::from_seconds(1).get());
        /* 25fps content, 25fps DCP */
        film->set_video_frame_rate (25);
        content->set_video_frame_rate (25);
-       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(1).get());
+       BOOST_CHECK_EQUAL (content->full_length_dcp(film).get(), DCPTime::from_seconds(1).get());
        /* 25fps content, 24fps DCP; length should be increased */
        film->set_video_frame_rate (24);
-       BOOST_CHECK_SMALL (labs (content->full_length(film).get() - DCPTime::from_seconds(25.0 / 24).get()), 2L);
+       BOOST_CHECK_SMALL (labs (content->full_length_dcp(film).get() - DCPTime::from_seconds(25.0 / 24).get()), 2L);
        /* 25fps content, 30fps DCP; length should be decreased */
        film->set_video_frame_rate (30);
-       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(25.0 / 30).get());
+       BOOST_CHECK_EQUAL (content->full_length_dcp(film).get(), DCPTime::from_seconds(25.0 / 30).get());
        /* 25fps content, 50fps DCP; length should be the same */
        film->set_video_frame_rate (50);
-       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(1).get());
+       BOOST_CHECK_EQUAL (content->full_length_dcp(film).get(), DCPTime::from_seconds(1).get());
        /* 25fps content, 60fps DCP; length should be decreased */
        film->set_video_frame_rate (60);
-       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(50.0 / 60).get());
+       BOOST_CHECK_EQUAL (content->full_length_dcp(film).get(), DCPTime::from_seconds(50.0 / 60).get());
 
 }