Basics of export of multiple reels to multiple files.
[dcpomatic.git] / src / tools / dcpomatic_player.cc
index 0af44fd05d2dd27a89800c13c057a43f6d48d1cd..513a5c4e748f720b6f7cc72de2c792e04b495fb3 100644 (file)
@@ -27,7 +27,7 @@
 #include "lib/job_manager.h"
 #include "lib/job.h"
 #include "lib/video_content.h"
-#include "lib/caption_content.h"
+#include "lib/text_content.h"
 #include "lib/ratio.h"
 #include "lib/verify_dcp_job.h"
 #include "lib/dcp_examiner.h"
@@ -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<int>(0)), ID_view_scale_full);
                Bind (wxEVT_MENU, boost::bind (&DOMFrame::set_decode_reduction, this, optional<int>(1)), ID_view_scale_half);
@@ -226,10 +228,11 @@ public:
                DCPExaminer ex (dcp);
                int id = ID_view_cpl;
                BOOST_FOREACH (shared_ptr<dcp::CPL> i, ex.cpls()) {
-                       wxMenuItem* j = _cpl_menu->AppendRadioItem(id, i->id());
-                       if (!dcp->cpl() || i->id() == *dcp->cpl()) {
-                               j->Check(true);
-                       }
+                       wxMenuItem* j = _cpl_menu->AppendRadioItem(
+                               id,
+                               wxString::Format("%s (%s)", std_to_wx(i->annotation_text()).data(), std_to_wx(i->id()).data())
+                               );
+                       j->Check(!dcp->cpl() || i->id() == *dcp->cpl());
                        ++id;
                }
        }
@@ -267,6 +270,7 @@ private:
                wxMenu* view = new wxMenu;
                optional<int> 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<bool>(c));
                view->AppendRadioItem(ID_view_scale_full, _("Decode at full resolution"))->Check(c && c.get() == 0);
@@ -430,6 +434,11 @@ private:
                dcp->examine (shared_ptr<Job>());
        }
 
+       void view_closed_captions ()
+       {
+               _viewer->show_closed_captions ();
+       }
+
        void tools_verify ()
        {
                shared_ptr<DCPContent> dcp = boost::dynamic_pointer_cast<DCPContent>(_film->content().front());
@@ -618,8 +627,8 @@ private:
 
        void setup_from_dcp (shared_ptr<DCPContent> dcp)
        {
-               if (dcp->caption) {
-                       dcp->caption->set_use (true);
+               BOOST_FOREACH (shared_ptr<TextContent> i, dcp->text) {
+                       i->set_use (true);
                }
 
                if (dcp->video) {