Add a hint about >79 length subtitles.
authorCarl Hetherington <cth@carlh.net>
Fri, 9 Apr 2021 22:23:35 +0000 (00:23 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 9 Apr 2021 22:23:35 +0000 (00:23 +0200)
doc/bv21.md
src/lib/hints.cc
src/lib/hints.h

index ce4f17d7ab260292904cb1366bc91ce9733bb8f6..b1d5bbd01dd18dd332b28dddb7831cac2ccbda31 100644 (file)
@@ -68,7 +68,7 @@ We don't warn specifically about non-24fps 3D; maybe we should.
 
 - Create: not enforced.
 - Verify: yes.
-- Hint: yes, except TODO 79-character limit is not mentioned
+- Hint: yes.
 
 # 7.3 Audio Sample Rates
 
index 3c9339cc7e6dc4eeb2575c2ea779bbb1dd10295a..ea524df501f13a9576392eda508105a103a24c5e 100644 (file)
@@ -76,14 +76,6 @@ using namespace boost::placeholders;
 Hints::Hints (weak_ptr<const Film> film)
        : WeakConstFilm (film)
        , _writer (new Writer(film, weak_ptr<Job>(), true))
-       , _long_ccap (false)
-       , _overlap_ccap (false)
-       , _too_many_ccap_lines (false)
-       , _early_subtitle (false)
-       , _short_subtitle (false)
-       , _subtitles_too_close (false)
-       , _too_many_subtitle_lines (false)
-       , _long_subtitle (false)
        , _stop (false)
 {
 
@@ -564,7 +556,12 @@ Hints::open_subtitle (PlayerText text, DCPTimePeriod period)
 
        if (longest_line > 52 && !_long_subtitle) {
                _long_subtitle = true;
-               hint (_("At least one of your subtitle lines has more than 52 characters.  It is advisable to make each line 52 characters at most in length."));
+               hint (_("At least one of your subtitle lines has more than 52 characters.  It is recommended to make each line 52 characters at most in length."));
+       }
+
+       if (longest_line > 79 && !_very_long_subtitle) {
+               _very_long_subtitle = true;
+               hint (_("At least one of your subtitle lines has more than 79 characters.  You should make each line 79 characters at most in length."));
        }
 
        _last_subtitle = period;
index a7e476b2c738aa3e58f33a0524c307b7538bfc24..c692f6fcaf36e977312dee21fc940d11684ced3a 100644 (file)
@@ -83,16 +83,17 @@ private:
         */
        std::shared_ptr<Writer> _writer;
 
-       bool _long_ccap;
-       bool _overlap_ccap;
-       bool _too_many_ccap_lines;
+       bool _long_ccap = false;
+       bool _overlap_ccap = false;
+       bool _too_many_ccap_lines = false;
        boost::optional<dcpomatic::DCPTimePeriod> _last_ccap;
 
-       bool _early_subtitle;
-       bool _short_subtitle;
-       bool _subtitles_too_close;
-       bool _too_many_subtitle_lines;
-       bool _long_subtitle;
+       bool _early_subtitle = false;
+       bool _short_subtitle = false;
+       bool _subtitles_too_close = false;
+       bool _too_many_subtitle_lines = false;
+       bool _long_subtitle = false;
+       bool _very_long_subtitle = false;
        boost::optional<dcpomatic::DCPTimePeriod> _last_subtitle;
 
        boost::atomic<bool> _stop;