X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fexport_video_file_dialog.cc;h=61198560294d792975cbcff0b665ba0ce970e0ec;hb=HEAD;hp=2dc452622e3f34c8206c23bada3886a7a5783c1e;hpb=fcba100f0dfd1d4214291abb76f22ebd696c24d4;p=dcpomatic.git diff --git a/src/wx/export_video_file_dialog.cc b/src/wx/export_video_file_dialog.cc index 2dc452622..611985602 100644 --- a/src/wx/export_video_file_dialog.cc +++ b/src/wx/export_video_file_dialog.cc @@ -35,26 +35,30 @@ using std::string; using boost::bind; -#define FORMATS 2 +int constexpr FORMATS = 3; wxString format_names[] = { - _("MOV / ProRes"), + _("MOV / ProRes 4444"), + _("MOV / ProRes HQ"), _("MP4 / H.264"), }; wxString format_filters[] = { + _("MOV files (*.mov)|*.mov"), _("MOV files (*.mov)|*.mov"), _("MP4 files (*.mp4)|*.mp4"), }; wxString format_extensions[] = { + "mov", "mov", "mp4", }; ExportFormat formats[] = { - ExportFormat::PRORES, + ExportFormat::PRORES_4444, + ExportFormat::PRORES_HQ, ExportFormat::H264_AAC, }; @@ -92,8 +96,7 @@ ExportVideoFileDialog::ExportVideoFileDialog (wxWindow* parent, string name) need to check if foo.mov (or similar) exists. I can't find a way to make wxWidgets do this, so disable its check and the caller will have to do it themselves. */ - _file = new FilePickerCtrl (this, _("Select output file"), format_filters[0], false, false); - _file->SetPath (_initial_name); + _file = new FilePickerCtrl(this, _("Select output file"), format_filters[0], false, false, "ExportVideoPath", _initial_name); add (_file); for (int i = 0; i < FORMATS; ++i) { @@ -114,9 +117,9 @@ ExportVideoFileDialog::ExportVideoFileDialog (wxWindow* parent, string name) _x264_crf_label[i]->Enable (false); } - _mixdown->Bind (wxEVT_CHECKBOX, bind(&ExportVideoFileDialog::mixdown_changed, this)); - _split_reels->Bind (wxEVT_CHECKBOX, bind(&ExportVideoFileDialog::split_reels_changed, this)); - _split_streams->Bind (wxEVT_CHECKBOX, bind(&ExportVideoFileDialog::split_streams_changed, this)); + _mixdown->bind(&ExportVideoFileDialog::mixdown_changed, this); + _split_reels->bind(&ExportVideoFileDialog::split_reels_changed, this); + _split_streams->bind(&ExportVideoFileDialog::split_streams_changed, this); _x264_crf->Bind (wxEVT_SLIDER, bind(&ExportVideoFileDialog::x264_crf_changed, this)); _format->Bind (wxEVT_CHOICE, bind (&ExportVideoFileDialog::format_changed, this)); _file->Bind (wxEVT_FILEPICKER_CHANGED, bind (&ExportVideoFileDialog::file_changed, this)); @@ -163,13 +166,11 @@ ExportVideoFileDialog::format_changed () { auto const selection = _format->GetSelection(); DCPOMATIC_ASSERT (selection >= 0 && selection < FORMATS); - _file->SetWildcard (format_filters[selection]); - _file->SetPath (_initial_name); - _x264_crf->Enable (selection == 1); + _file->set_wildcard(format_filters[selection]); + _x264_crf->Enable (formats[selection] == ExportFormat::H264_AAC); for (int i = 0; i < 2; ++i) { - _x264_crf_label[i]->Enable (selection == 1); + _x264_crf_label[i]->Enable(formats[selection] == ExportFormat::H264_AAC); } - _mixdown->Enable (selection != 2); Config::instance()->export_config().set_format(formats[selection]); } @@ -177,7 +178,9 @@ ExportVideoFileDialog::format_changed () boost::filesystem::path ExportVideoFileDialog::path () const { - wxFileName fn (_file->GetPath()); + auto path = _file->path(); + DCPOMATIC_ASSERT(path); + wxFileName fn(std_to_wx(path->string())); fn.SetExt (format_extensions[_format->GetSelection()]); return wx_to_std (fn.GetFullPath()); }