Primitive subtitle export feature.
[dcpomatic.git] / src / wx / export_dialog.cc
index 68d3706ff7f4b48725535da50951555964348551..b23583d44befba1bcd10a2d2d47c02fb5f72dd72 100644 (file)
 #include <wx/filepicker.h>
 #include <boost/bind.hpp>
 
+using std::string;
 using boost::bind;
 
-#define FORMATS 2
+#define FORMATS 3
 
 wxString format_names[] = {
        _("ProRes"),
-       _("MP4 / H.264")
+       _("MP4 / H.264"),
+       _("DCP subtitles")
 };
 
 wxString format_filters[] = {
        _("MOV files (*.mov)|*.mov"),
        _("MP4 files (*.mp4)|*.mp4"),
+       _("Subtitle files (*.xml)|*.xml"),
 };
 
 wxString format_extensions[] = {
        "mov",
-       "mp4"
+       "mp4",
+       "xml",
 };
 
 ExportFormat formats[] = {
        EXPORT_FORMAT_PRORES,
-       EXPORT_FORMAT_H264,
+       EXPORT_FORMAT_H264_AAC,
+       EXPORT_FORMAT_SUBTITLES_DCP
 };
 
-ExportDialog::ExportDialog (wxWindow* parent)
+ExportDialog::ExportDialog (wxWindow* parent, string name)
        : TableDialog (parent, _("Export film"), 2, 1, true)
 {
        add (_("Format"), true);
@@ -73,6 +78,7 @@ ExportDialog::ExportDialog (wxWindow* parent)
 
        add (_("Output file"), true);
        _file = new FilePickerCtrl (this, _("Select output file"), format_filters[0], false);
+       _file->SetPath (name);
        add (_file);
 
        for (int i = 0; i < FORMATS; ++i) {
@@ -104,6 +110,7 @@ ExportDialog::format_changed ()
        for (int i = 0; i < 2; ++i) {
                _x264_crf_label[i]->Enable (_format->GetSelection() == 1);
        }
+       _mixdown->Enable (_format->GetSelection() != 2);
 }
 
 boost::filesystem::path
@@ -143,5 +150,5 @@ void
 ExportDialog::file_changed ()
 {
        wxButton* ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK, this));
-       ok->Enable (true);
+       ok->Enable (_file->GetPath().Length() > 0);
 }