On reflection showing CCAPs over the main picture doesn't make much sense.
authorCarl Hetherington <cth@carlh.net>
Sun, 22 Jul 2018 20:29:40 +0000 (21:29 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 22 Jul 2018 20:29:40 +0000 (21:29 +0100)
src/lib/ffmpeg_encoder.cc
src/lib/player.cc
src/lib/player.h
src/wx/film_viewer.cc
src/wx/film_viewer.h
test/player_test.cc

index 10d439f94f05b0f2954c39ef0799b98cf28e3454..29334e8ed26f85a2cb484440d4f4602f1a250ff3 100644 (file)
@@ -72,7 +72,7 @@ FFmpegEncoder::FFmpegEncoder (shared_ptr<const Film> film, weak_ptr<Job> job, bo
                break;
        }
 
-       _player->set_always_burn_captions (CAPTION_OPEN);
+       _player->set_always_burn_open_captions ();
        _player->set_play_referenced ();
 
        int const ch = film->audio_channels ();
index 580c3e6d43946230e85ac3001f42ce7bb9f24555..dfd3097745b8a15d58322149be6a394e01e26906 100644 (file)
@@ -444,14 +444,11 @@ Player::set_ignore_caption ()
        _ignore_caption = true;
 }
 
-/** Set a type of caption that this player should always burn into the image,
- *  regardless of the content settings.
- *  @param type type of captions to burn.
- */
+/** Set the player to always burn open captions into the image regardless of the content settings */
 void
-Player::set_always_burn_captions (CaptionType type)
+Player::set_always_burn_open_captions ()
 {
-       _always_burn_captions = type;
+       _always_burn_open_captions = true;
 }
 
 /** Sets up the player to be faster, possibly at the expense of quality */
@@ -687,7 +684,7 @@ Player::captions_for_frame (DCPTime time) const
        int const vfr = _film->video_frame_rate();
 
        for (int i = 0; i < CAPTION_COUNT; ++i) {
-               bool const always = _always_burn_captions && *_always_burn_captions == i;
+               bool const always = i == CAPTION_OPEN && _always_burn_open_captions;
                BOOST_FOREACH (
                        PlayerCaption j,
                        _active_captions[i].get_burnt(DCPTimePeriod(time, time + DCPTime::from_frames(1, vfr)), always)
@@ -960,7 +957,7 @@ Player::subtitle_stop (weak_ptr<Piece> wp, weak_ptr<const CaptionContent> wc, Co
 
        pair<PlayerCaption, DCPTime> from = _active_captions[type].add_to (wc, dcp_to);
 
-       bool const always = _always_burn_captions && *_always_burn_captions == type;
+       bool const always = type == CAPTION_OPEN && _always_burn_open_captions;
        if (caption->use() && !always && !caption->burn()) {
                Caption (from.first, type, DCPTimePeriod (from.second, dcp_to));
        }
index eda2d7eb0c68753d9300e101b9a17f76adcc0a16..d54d927cd65514c5803c888ca2758fbfc672f12e 100644 (file)
@@ -79,7 +79,7 @@ public:
        void set_video_container_size (dcp::Size);
        void set_ignore_video ();
        void set_ignore_caption ();
-       void set_always_burn_captions (CaptionType type);
+       void set_always_burn_open_captions ();
        void set_fast ();
        void set_play_referenced ();
        void set_dcp_decode_reduction (boost::optional<int> reduction);
@@ -154,10 +154,7 @@ private:
        bool _ignore_video;
        /** true if the player should ignore all captions; i.e. never produce any */
        bool _ignore_caption;
-       /** Type of captions that the player should always burn into the video regardless
-           of content settings.
-       */
-       boost::optional<CaptionType> _always_burn_captions;
+       bool _always_burn_open_captions;
        /** true if we should try to be fast rather than high quality */
        bool _fast;
        /** true if we should `play' (i.e output) referenced DCP data (e.g. for preview) */
index 56342d44f018bab10f90a824596af4fb431dbffc..c4b503ae05087c2ccfb9043b67d7c14cebff97c3 100644 (file)
@@ -123,12 +123,6 @@ FilmViewer::FilmViewer (wxWindow* p, bool outline_content, bool jump_to_selected
                view_options->Add (_jump_to_selected, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_GAP);
        }
 
-       _captions = new wxChoice (this, wxID_ANY);
-       _captions->Append (_("Open captions (subtitles)"));
-       _captions->Append (_("Closed captions"));
-       _captions->SetSelection (0);
-       view_options->Add (_captions, 0, wxLEFT | wxRIGHT, DCPOMATIC_SIZER_GAP);
-
        _v_sizer->Add (view_options, 0, wxALL, DCPOMATIC_SIZER_GAP);
 
        wxBoxSizer* h_sizer = new wxBoxSizer (wxHORIZONTAL);
@@ -157,7 +151,6 @@ FilmViewer::FilmViewer (wxWindow* p, bool outline_content, bool jump_to_selected
                _outline_content->Bind  (wxEVT_CHECKBOX, boost::bind (&FilmViewer::refresh_panel,   this));
        }
        _eye->Bind              (wxEVT_CHOICE,            boost::bind (&FilmViewer::slow_refresh,    this));
-       _captions->Bind         (wxEVT_CHOICE,            boost::bind (&FilmViewer::captions_changed, this));
        _slider->Bind           (wxEVT_SCROLL_THUMBTRACK, boost::bind (&FilmViewer::slider_moved,    this, false));
        _slider->Bind           (wxEVT_SCROLL_PAGEUP,     boost::bind (&FilmViewer::slider_moved,    this, true));
        _slider->Bind           (wxEVT_SCROLL_PAGEDOWN,   boost::bind (&FilmViewer::slider_moved,    this, true));
@@ -225,8 +218,7 @@ FilmViewer::set_film (shared_ptr<Film> film)
                return;
        }
 
-       /* Start off burning in subtitles, as that's the initial setting of the dropdown */
-       _player->set_always_burn_captions (CAPTION_OPEN);
+       _player->set_always_burn_open_captions ();
        _player->set_play_referenced ();
 
        _film->Changed.connect (boost::bind (&FilmViewer::film_changed, this, _1));
@@ -730,21 +722,6 @@ FilmViewer::film_changed (Film::Property p)
        }
 }
 
-void
-FilmViewer::captions_changed ()
-{
-       switch (_captions->GetSelection()) {
-       case 0:
-               _player->set_always_burn_captions (CAPTION_OPEN);
-               break;
-       case 1:
-               _player->set_always_burn_captions (CAPTION_CLOSED);
-               break;
-       }
-
-       slow_refresh ();
-}
-
 /** Re-get the current frame slowly by seeking */
 void
 FilmViewer::slow_refresh ()
index cb372391ad0306a16c4f614555af5b0e4b327891..385f6142becb1f43e77ed30af41b81e15b1d26b6 100644 (file)
@@ -87,7 +87,6 @@ private:
        void slider_released ();
        void play_clicked ();
        void timer ();
-       void captions_changed ();
        void calculate_sizes ();
        void check_play_state ();
        void active_jobs_changed (boost::optional<std::string>);
@@ -123,7 +122,6 @@ private:
        wxCheckBox* _outline_content;
        wxChoice* _eye;
        wxCheckBox* _jump_to_selected;
-       wxChoice* _captions;
        wxSlider* _slider;
        wxButton* _rewind_button;
        wxButton* _back_button;
index bc4af970ea2c1122f6d04c3410dc1ea0e9e9fb39..041bc3e81e91f67c95f7b2edd3932ee3505a07b0 100644 (file)
@@ -215,7 +215,7 @@ BOOST_AUTO_TEST_CASE (player_seek_test)
 
        shared_ptr<Player> player (new Player (film, film->playlist()));
        player->set_fast ();
-       player->set_always_burn_captions (CAPTION_OPEN);
+       player->set_always_burn_open_captions ();
        player->set_play_referenced ();
 
        shared_ptr<Butler> butler (new Butler (player, film->log(), AudioMapping(), 2));
@@ -246,7 +246,7 @@ BOOST_AUTO_TEST_CASE (player_seek_test2)
 
        shared_ptr<Player> player (new Player (film, film->playlist()));
        player->set_fast ();
-       player->set_always_burn_captions (CAPTION_OPEN);
+       player->set_always_burn_open_captions ();
        player->set_play_referenced ();
 
        shared_ptr<Butler> butler (new Butler (player, film->log(), AudioMapping(), 2));