From ded71cffd18962ebb6b9611a5eb6dfafe9e8e4ec Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 23 Jul 2018 01:21:07 +0100 Subject: Get ccaps by asking the Player, rather than by listening to its emissions, which is slightly cleaner and works when subtitles are emitted with an unknown end time. Also add CCAPs to the player. --- src/tools/dcpomatic_player.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/tools') diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index d357e566b..e5745403d 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -82,7 +82,8 @@ enum { ID_file_close = 100, ID_view_cpl, /* Allow spare IDs for CPLs */ - ID_view_scale_appropriate = 200, + ID_view_closed_captions = 200, + ID_view_scale_appropriate, ID_view_scale_full, ID_view_scale_half, ID_view_scale_quarter, @@ -134,6 +135,7 @@ public: Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_close, this), ID_file_close); Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_exit, this), wxID_EXIT); Bind (wxEVT_MENU, boost::bind (&DOMFrame::edit_preferences, this), wxID_PREFERENCES); + Bind (wxEVT_MENU, boost::bind (&DOMFrame::view_closed_captions, this), ID_view_closed_captions); Bind (wxEVT_MENU, boost::bind (&DOMFrame::view_cpl, this, _1), ID_view_cpl, ID_view_cpl + MAX_CPLS); Bind (wxEVT_MENU, boost::bind (&DOMFrame::set_decode_reduction, this, optional(0)), ID_view_scale_full); Bind (wxEVT_MENU, boost::bind (&DOMFrame::set_decode_reduction, this, optional(1)), ID_view_scale_half); @@ -267,6 +269,7 @@ private: wxMenu* view = new wxMenu; optional c = Config::instance()->decode_reduction(); _view_cpl = view->Append(ID_view_cpl, _("CPL"), _cpl_menu); + view->Append(ID_view_closed_captions, _("Closed captions...")); view->AppendSeparator(); view->AppendRadioItem(ID_view_scale_appropriate, _("Set decode resolution to match display"))->Check(!static_cast(c)); view->AppendRadioItem(ID_view_scale_full, _("Decode at full resolution"))->Check(c && c.get() == 0); @@ -430,6 +433,11 @@ private: dcp->examine (shared_ptr()); } + void view_closed_captions () + { + _viewer->show_closed_captions (); + } + void tools_verify () { shared_ptr dcp = boost::dynamic_pointer_cast(_film->content().front()); @@ -619,10 +627,7 @@ private: void setup_from_dcp (shared_ptr dcp) { BOOST_FOREACH (shared_ptr i, dcp->caption) { - /* XXX: we should offer the option to view closed captions */ - if (i->type() == CAPTION_OPEN) { - i->set_use (true); - } + i->set_use (true); } if (dcp->video) { -- cgit v1.2.3